@helpai/elements 1.3.18 → 1.5.3
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/LICENSE-OPENUI +21 -0
- package/NOTICE +17 -0
- package/configurator.css +19 -31
- package/configurator.d.ts +13 -13
- package/configurator.mjs +1 -1
- package/elements-web-component.esm.js +49 -30
- package/elements-web-component.esm.js.map +4 -4
- package/elements.cjs.js +48 -29
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +48 -29
- package/elements.esm.js.map +4 -4
- package/elements.js +49 -30
- package/elements.js.map +4 -4
- package/index.d.ts +51 -51
- package/index.mjs +24 -6
- package/loader.js +2 -2
- package/package.json +4 -2
- package/schema.d.ts +132 -133
- package/schema.json +8 -20
- package/schema.mjs +1 -1
- package/style.css +3 -1
- package/web-component.d.ts +1 -2
- package/web-component.mjs +24 -6
package/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ interface ClientStorage {
|
|
|
41
41
|
* populated {@link Strings} map. UI components then read `strings.send` as a
|
|
42
42
|
* normal property access — no per-render lookup, no per-render allocation.
|
|
43
43
|
*/
|
|
44
|
-
type StringKey =
|
|
44
|
+
type StringKey = 'launcherOpen' | 'launcherLabel' | 'panelTitle' | 'composerPlaceholder' | 'send' | 'stop' | 'queueMessage' | 'removeQueuedMessage' | 'compactingContext' | 'attach' | 'micStart' | 'micStop' | 'micUnsupported' | 'expand' | 'collapse' | 'fullscreen' | 'exitFullscreen' | 'popOut' | 'resizeHandle' | 'scrollToBottom' | 'close' | 'moreActions' | 'soundOn' | 'soundOff' | 'language' | 'theme' | 'themeAuto' | 'themeLight' | 'themeDark' | 'textSize' | 'textSizeSmall' | 'textSizeNormal' | 'textSizeLarge' | 'history' | 'historyTitle' | 'historyEmpty' | 'historyLoading' | 'historyBack' | 'historyContinue' | 'loadMoreConversations' | 'conversationLoading' | 'loadPreviousMessages' | 'conversationClosed' | 'startNewConversation' | 'talkToOperator' | 'connectingOperator' | 'noOperatorAvailable' | 'chattingWithOperator' | 'cancelOperatorRequest' | 'dateToday' | 'dateYesterday' | 'dateLastWeek' | 'dateOlder' | 'newConversation' | 'dropZone' | 'attachmentTooLarge' | 'attachmentTooMany' | 'attachmentMimeRejected' | 'errorRetry' | 'errorGeneric' | 'errorRateLimited' | 'loading' | 'visualPreparing' | 'visualError' | 'visualPartial' | 'thinking' | 'thoughts' | 'toolResult' | 'sources' | 'feedbackUp' | 'feedbackDown' | 'feedbackThanks' | 'copy' | 'copied' | 'collapseSidebar' | 'expandSidebar' | 'formSubmit' | 'formSkip' | 'formSubmitted' | 'formSkipped' | 'formFillOut' | 'formRequired' | 'formInvalidEmail' | 'formInvalidTel' | 'formInvalidUrl' | 'formInvalidNumber' | 'formTooShort' | 'formTooLong' | 'formNumberTooSmall' | 'formNumberTooLarge' | 'formPatternMismatch' | 'formChooseAtLeast' | 'formChooseAtMost' | 'formOther' | 'formOtherPlaceholder' | 'inputRequired' | 'inputBadge' | 'inputAnswered' | 'inputSkipped' | 'inputSubmit' | 'inputSubmitHint' | 'inputSkip' | 'showOptions' | 'hideOptions' | 'qtypeText' | 'qtypeEmail' | 'qtypePhone' | 'qtypeNumber' | 'qtypeDate' | 'qtypeChooseOne' | 'qtypeChooseAny' | 'qtypeBoolean' | 'confirmYes' | 'confirmNo' | 'approve' | 'reject' | 'approvalPrompt' | 'approvalBody' | 'approvalYourResponse' | 'approvalEditHint' | 'approvalSubmitting' | 'edit' | 'toolParameters' | 'statusAwaiting' | 'statusResponded' | 'statusCompleted' | 'statusDenied' | 'statusError' | 'statusRunning' | 'statusSuperseded' | 'tabHome' | 'tabConversations' | 'tabHelp' | 'tabNews' | 'modulesEmpty' | 'moduleBack' | 'contentLoading' | 'homeGreeting' | 'homeGreetingNamed' | 'homeGreetingLead' | 'homeSearchPlaceholder' | 'homeContentTitle' | 'homeStatus' | 'helpTitle' | 'helpSearchPlaceholder' | 'helpEmpty' | 'helpLoading' | 'helpSearchEmpty' | 'newsTitle' | 'newsEmpty' | 'newsLoading' | 'newsBack' | 'newsPublishedAt';
|
|
45
45
|
/** A partial map for one locale — what overrides look like on the wire. */
|
|
46
46
|
type LocaleStrings = Partial<Record<StringKey, string>>;
|
|
47
47
|
/**
|
|
@@ -73,7 +73,7 @@ type StringsOverride = LocaleStrings | Partial<Record<string, LocaleStrings>>;
|
|
|
73
73
|
* say) doesn't churn many files.
|
|
74
74
|
*/
|
|
75
75
|
/** Screen corner the floating launcher anchors to (ignored in `inline` / `standalone`). */
|
|
76
|
-
type Position =
|
|
76
|
+
type Position = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
77
77
|
/**
|
|
78
78
|
* Runtime rendering mode — what the widget *looks like* on the page.
|
|
79
79
|
*
|
|
@@ -95,11 +95,11 @@ type Position = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
|
95
95
|
*
|
|
96
96
|
* Page mode reads `site` and `blocks` from the handshake response.
|
|
97
97
|
*/
|
|
98
|
-
type Mode =
|
|
98
|
+
type Mode = 'floating' | 'inline' | 'standalone' | 'page' | 'modal' | 'drawer';
|
|
99
99
|
/** End-user text-size preference — scales the whole type ramp. */
|
|
100
|
-
type TextSize =
|
|
100
|
+
type TextSize = 'small' | 'normal' | 'large';
|
|
101
101
|
/** Theme preference. `auto` follows `prefers-color-scheme`. */
|
|
102
|
-
type ThemePreference =
|
|
102
|
+
type ThemePreference = 'auto' | 'light' | 'dark';
|
|
103
103
|
/**
|
|
104
104
|
* How the assistant's reply is delivered.
|
|
105
105
|
*
|
|
@@ -109,7 +109,7 @@ type ThemePreference = "auto" | "light" | "dark";
|
|
|
109
109
|
* chunk. The UI shows a "thinking…" indicator until the reply appears
|
|
110
110
|
* whole.
|
|
111
111
|
*/
|
|
112
|
-
type ResponseMode =
|
|
112
|
+
type ResponseMode = 'streaming' | 'buffered';
|
|
113
113
|
/**
|
|
114
114
|
* Identifiers for every header action the widget can render.
|
|
115
115
|
*
|
|
@@ -127,7 +127,7 @@ type ResponseMode = "streaming" | "buffered";
|
|
|
127
127
|
* - `textSize` — Cycle `normal` / `large` / `small`.
|
|
128
128
|
* - `close` — Close the floating panel.
|
|
129
129
|
*/
|
|
130
|
-
type ActionName =
|
|
130
|
+
type ActionName = 'clear' | 'expand' | 'fullscreen' | 'popOut' | 'sound' | 'history' | 'language' | 'theme' | 'textSize' | 'close';
|
|
131
131
|
/**
|
|
132
132
|
* The header's enabled actions. Unlisted actions are hidden; order is
|
|
133
133
|
* irrelevant. Per-mode defaults (`DEFAULT_ACTIONS_BY_MODE`) pick a sensible
|
|
@@ -150,7 +150,7 @@ type ActionList = ActionName[];
|
|
|
150
150
|
* endpoint, receive text back. Consistent quality; uses your upload quota.
|
|
151
151
|
* - `'disabled'` — hide the mic button entirely.
|
|
152
152
|
*/
|
|
153
|
-
type VoiceMode =
|
|
153
|
+
type VoiceMode = 'local' | 'server' | 'disabled';
|
|
154
154
|
/** Capability flags. Any field left `undefined` uses its default. */
|
|
155
155
|
interface FeatureFlags {
|
|
156
156
|
/** Voice input behaviour (see {@link VoiceMode}). Default: `'local'`. */
|
|
@@ -194,11 +194,11 @@ interface AttachmentLimits {
|
|
|
194
194
|
accept?: string;
|
|
195
195
|
}
|
|
196
196
|
/** Outline shape of the send button. */
|
|
197
|
-
type SendButtonShape =
|
|
197
|
+
type SendButtonShape = 'circle' | 'square' | 'pill';
|
|
198
198
|
/** Icon shown inside the send button. */
|
|
199
|
-
type SendButtonIcon =
|
|
199
|
+
type SendButtonIcon = 'arrowUp' | 'paperPlane' | 'send' | 'chevron';
|
|
200
200
|
/** Fill/stroke treatment. */
|
|
201
|
-
type SendButtonVariant =
|
|
201
|
+
type SendButtonVariant = 'filled' | 'outline' | 'ghost';
|
|
202
202
|
interface SendButtonOptions {
|
|
203
203
|
/** Outline shape. Default: `"circle"`. */
|
|
204
204
|
shape?: SendButtonShape;
|
|
@@ -219,7 +219,7 @@ interface ComposerOptions {
|
|
|
219
219
|
* autoplay policy still gates audio playback).
|
|
220
220
|
*/
|
|
221
221
|
/** Lifecycle events the feedback bus can react to. */
|
|
222
|
-
type FeedbackEvent =
|
|
222
|
+
type FeedbackEvent = 'messageReceived' | 'messageSent' | 'error' | 'voiceStart' | 'voiceStop';
|
|
223
223
|
/**
|
|
224
224
|
* Per-event sound configuration.
|
|
225
225
|
*
|
|
@@ -278,7 +278,7 @@ interface FeedbackOptions {
|
|
|
278
278
|
* The same {@link FormField} shape powers the AI-driven ask-questions tool.
|
|
279
279
|
*/
|
|
280
280
|
/** A renderable field type. `multiselect` collects an array of values. */
|
|
281
|
-
type FieldType =
|
|
281
|
+
type FieldType = 'text' | 'email' | 'tel' | 'url' | 'number' | 'date' | 'time' | 'textarea' | 'select' | 'radio' | 'checkbox' | 'multiselect';
|
|
282
282
|
/** One choice for `select` / `radio` / `multiselect` fields. */
|
|
283
283
|
interface FieldOption {
|
|
284
284
|
value: string;
|
|
@@ -322,9 +322,9 @@ interface FormField {
|
|
|
322
322
|
* serializable + server-pushable. `after-messages:3`, `idle:30`,
|
|
323
323
|
* `page-area:pricing`.
|
|
324
324
|
*/
|
|
325
|
-
type FormTrigger =
|
|
325
|
+
type FormTrigger = 'pre-chat' | `after-messages:${number}` | 'conversation-closed' | 'panel-close' | `idle:${number}` | `page-area:${string}` | 'manual';
|
|
326
326
|
/** The trigger kinds, parsed out from the {@link FormTrigger} string. */
|
|
327
|
-
type TriggerKind =
|
|
327
|
+
type TriggerKind = 'pre-chat' | 'after-messages' | 'conversation-closed' | 'panel-close' | 'idle' | 'page-area' | 'manual';
|
|
328
328
|
/** A {@link FormTrigger} parsed into kind + optional param. */
|
|
329
329
|
interface ParsedTrigger {
|
|
330
330
|
kind: TriggerKind;
|
|
@@ -347,7 +347,7 @@ interface FormCondition {
|
|
|
347
347
|
* How often a form may show: `once` per device (persisted), once per
|
|
348
348
|
* `conversation` (re-eligible when a new conversation starts), or `always`.
|
|
349
349
|
*/
|
|
350
|
-
type FormFrequency =
|
|
350
|
+
type FormFrequency = 'once' | 'conversation' | 'always';
|
|
351
351
|
/** One form as authored in config (raw input). */
|
|
352
352
|
interface FormDef {
|
|
353
353
|
/** Stable id — persistence dedupe + `manual` `openForm(id)`. */
|
|
@@ -464,9 +464,9 @@ interface ResolvedForms {
|
|
|
464
464
|
* - `bar` — rectangular button, stretches with content.
|
|
465
465
|
* - `minimal` — transparent outline, text-only.
|
|
466
466
|
*/
|
|
467
|
-
type LauncherVariant =
|
|
467
|
+
type LauncherVariant = 'circle' | 'pill' | 'bar' | 'minimal';
|
|
468
468
|
/** Launcher size preset. Resolves to concrete CSS lengths in panel.css. */
|
|
469
|
-
type LauncherSize =
|
|
469
|
+
type LauncherSize = 'sm' | 'md' | 'lg';
|
|
470
470
|
/**
|
|
471
471
|
* Visual variant of the launcher callout bubble.
|
|
472
472
|
*
|
|
@@ -475,13 +475,13 @@ type LauncherSize = "sm" | "md" | "lg";
|
|
|
475
475
|
* - `bubble` — speech-bubble shape with a tail. Friendly persona feel.
|
|
476
476
|
* - `callout` — larger pill with a louder arrow. Most attention-grabbing.
|
|
477
477
|
*/
|
|
478
|
-
type CalloutShape =
|
|
478
|
+
type CalloutShape = 'pill' | 'bubble' | 'callout';
|
|
479
479
|
/**
|
|
480
480
|
* Side of the launcher the callout anchors to. `auto` picks the side
|
|
481
481
|
* facing into the page based on the FAB's corner. Picks pointing AT the
|
|
482
482
|
* FAB's own viewport edge auto-flip to the opposite side.
|
|
483
483
|
*/
|
|
484
|
-
type CalloutPosition =
|
|
484
|
+
type CalloutPosition = 'auto' | 'horizontal' | 'vertical';
|
|
485
485
|
/**
|
|
486
486
|
* Pre-engagement message bubble next to the FAB. Use it for a greeting
|
|
487
487
|
* ("👋 Hi, need help?"), an attention-grabbing nudge ("Click here →"),
|
|
@@ -530,7 +530,7 @@ interface LauncherOptions {
|
|
|
530
530
|
* `GET /content`), and a translatable `label`.
|
|
531
531
|
*/
|
|
532
532
|
/** The UI layouts a tab can render with. `chat` is the conversation; the rest render content. */
|
|
533
|
-
type ModuleLayout =
|
|
533
|
+
type ModuleLayout = 'chat' | 'home' | 'help' | 'news';
|
|
534
534
|
/** A team/agent avatar shown in the Home hero. */
|
|
535
535
|
interface ModuleAvatar {
|
|
536
536
|
name: string;
|
|
@@ -584,7 +584,7 @@ type ModulesOptions = ModuleOptions[];
|
|
|
584
584
|
* (`showGreeting`/`showSearchBar`/`showRecentConversations`) — `resolveModules` inverts the wire-input
|
|
585
585
|
* `hide*` once, so no render site does `!hide…`. Present only for `home` tabs.
|
|
586
586
|
*/
|
|
587
|
-
interface ResolvedModule extends Omit<HomeConfig,
|
|
587
|
+
interface ResolvedModule extends Omit<HomeConfig, 'hideGreeting' | 'hideSearchBar' | 'hideRecentConversations'> {
|
|
588
588
|
/** Stable id for nav + last-tab persistence (`id` ?? first `contentTags` ?? `layout`, deduped). */
|
|
589
589
|
id: string;
|
|
590
590
|
/** i18n key or literal — resolved at render via the i18n strings. */
|
|
@@ -663,7 +663,7 @@ interface SizeOptions {
|
|
|
663
663
|
*
|
|
664
664
|
* Default: `"auto"`.
|
|
665
665
|
*/
|
|
666
|
-
initialSize?:
|
|
666
|
+
initialSize?: 'auto' | 'normal' | 'expanded' | 'fullscreen';
|
|
667
667
|
/**
|
|
668
668
|
* Viewport-width threshold (px) above which `initialSize: "auto"` picks
|
|
669
669
|
* `"expanded"`. Default: `900`.
|
|
@@ -801,7 +801,7 @@ interface UserContext {
|
|
|
801
801
|
* adapt routing / tone — a pricing-page visitor differs from a docs reader,
|
|
802
802
|
* a help-desk ticket, or a checkout.
|
|
803
803
|
*/
|
|
804
|
-
type PageArea =
|
|
804
|
+
type PageArea = 'home' | 'docs' | 'help-desk' | 'support' | 'pricing' | 'checkout' | 'orders' | 'account' | 'blog' | (string & {});
|
|
805
805
|
/**
|
|
806
806
|
* Host-asserted context about the *page / visit* — where on the site the
|
|
807
807
|
* visitor is and which surface they're using. Informational context for the
|
|
@@ -969,7 +969,7 @@ interface ChatWidgetOptions {
|
|
|
969
969
|
* `trace` gate output additively. Runtime-toggleable via
|
|
970
970
|
* `chat.setDebug(level)` or `?<brand>-debug=trace` in the page URL.
|
|
971
971
|
*/
|
|
972
|
-
debug?: boolean |
|
|
972
|
+
debug?: boolean | 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
973
973
|
presentation?: PresentationOptions;
|
|
974
974
|
behavior?: BehaviorOptions;
|
|
975
975
|
/** Theme preference (`'auto' | 'light' | 'dark'`) or overrides object. */
|
|
@@ -1041,7 +1041,7 @@ interface ResolvedOptions {
|
|
|
1041
1041
|
/** Resolved event-driven forms — ordered list + trigger index. */
|
|
1042
1042
|
forms: ResolvedForms;
|
|
1043
1043
|
endpoints: Required<Endpoints>;
|
|
1044
|
-
attachments: Required<Pick<AttachmentLimits,
|
|
1044
|
+
attachments: Required<Pick<AttachmentLimits, 'maxBytes' | 'maxCount'>> & {
|
|
1045
1045
|
accept: string;
|
|
1046
1046
|
};
|
|
1047
1047
|
/**
|
|
@@ -1065,7 +1065,7 @@ interface ResolvedOptions {
|
|
|
1065
1065
|
startMinimized: boolean;
|
|
1066
1066
|
actions: ActionList;
|
|
1067
1067
|
size: SizeOptions;
|
|
1068
|
-
launcher: Required<Omit<LauncherOptions,
|
|
1068
|
+
launcher: Required<Omit<LauncherOptions, 'callout' | 'label'>> & {
|
|
1069
1069
|
/** Label is optional even after resolution (`circle` variant has no label). */
|
|
1070
1070
|
label?: string;
|
|
1071
1071
|
/**
|
|
@@ -1074,11 +1074,11 @@ interface ResolvedOptions {
|
|
|
1074
1074
|
*/
|
|
1075
1075
|
callout: Required<LauncherCalloutOptions> | null;
|
|
1076
1076
|
};
|
|
1077
|
-
sound: Required<Omit<SoundOptions,
|
|
1078
|
-
events: SoundOptions[
|
|
1077
|
+
sound: Required<Omit<SoundOptions, 'events'>> & {
|
|
1078
|
+
events: SoundOptions['events'];
|
|
1079
1079
|
};
|
|
1080
|
-
haptics: Required<Omit<HapticsOptions,
|
|
1081
|
-
events: HapticsOptions[
|
|
1080
|
+
haptics: Required<Omit<HapticsOptions, 'events'>> & {
|
|
1081
|
+
events: HapticsOptions['events'];
|
|
1082
1082
|
};
|
|
1083
1083
|
/**
|
|
1084
1084
|
* Fully-resolved string map for the active locale. Pre-computed at
|
|
@@ -1103,10 +1103,10 @@ interface ResolvedOptions {
|
|
|
1103
1103
|
tracking: ResolvedTracking;
|
|
1104
1104
|
/** Resolved storage adapter — defaults to `LocalStorageAdapter`. */
|
|
1105
1105
|
storage: ClientStorage;
|
|
1106
|
-
onMessage?: ChatWidgetOptions[
|
|
1107
|
-
onOpen?: ChatWidgetOptions[
|
|
1108
|
-
onClose?: ChatWidgetOptions[
|
|
1109
|
-
onError?: ChatWidgetOptions[
|
|
1106
|
+
onMessage?: ChatWidgetOptions['onMessage'];
|
|
1107
|
+
onOpen?: ChatWidgetOptions['onOpen'];
|
|
1108
|
+
onClose?: ChatWidgetOptions['onClose'];
|
|
1109
|
+
onError?: ChatWidgetOptions['onError'];
|
|
1110
1110
|
}
|
|
1111
1111
|
//#endregion
|
|
1112
1112
|
//#region src/core/logger.d.ts
|
|
@@ -1133,7 +1133,7 @@ interface ResolvedOptions {
|
|
|
1133
1133
|
* brand-prefixed so two widgets on the same page don't fight over
|
|
1134
1134
|
* flags or pollute each other's transcripts.
|
|
1135
1135
|
*/
|
|
1136
|
-
type LogLevel =
|
|
1136
|
+
type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
1137
1137
|
/** One structured line, as forwarded to an external {@link setLogSink} sink. */
|
|
1138
1138
|
interface LogEntry {
|
|
1139
1139
|
level: LogLevel;
|
|
@@ -3097,7 +3097,7 @@ type HandshakeResponse = z.infer<typeof handshakeResponseSchema>;
|
|
|
3097
3097
|
//#endregion
|
|
3098
3098
|
//#region src/stream/types.d.ts
|
|
3099
3099
|
/** A 👍/👎 reaction on a rateable (assistant/operator) message; `null` clears a prior choice. */
|
|
3100
|
-
type FeedbackValue =
|
|
3100
|
+
type FeedbackValue = 'up' | 'down' | null;
|
|
3101
3101
|
//#endregion
|
|
3102
3102
|
//#region src/core/events.d.ts
|
|
3103
3103
|
/**
|
|
@@ -3147,7 +3147,7 @@ interface EventMap {
|
|
|
3147
3147
|
};
|
|
3148
3148
|
/** History pane toggled. Payload is the resulting view. */
|
|
3149
3149
|
toggleHistory: {
|
|
3150
|
-
view:
|
|
3150
|
+
view: 'chat' | 'history';
|
|
3151
3151
|
};
|
|
3152
3152
|
/** A form (intake, CSAT, …) was completed or skipped. */
|
|
3153
3153
|
formSubmit: {
|
|
@@ -3244,7 +3244,7 @@ interface EventMap {
|
|
|
3244
3244
|
type EventName = keyof EventMap;
|
|
3245
3245
|
//#endregion
|
|
3246
3246
|
//#region src/ui/host-mode.d.ts
|
|
3247
|
-
type HostMode =
|
|
3247
|
+
type HostMode = 'page' | 'standalone' | 'inline' | 'modal' | 'drawer' | 'fullscreen' | 'expanded' | 'open' | 'closed';
|
|
3248
3248
|
//#endregion
|
|
3249
3249
|
//#region src/boot.d.ts
|
|
3250
3250
|
/**
|
|
@@ -3258,11 +3258,11 @@ type HostMode = "page" | "standalone" | "inline" | "modal" | "drawer" | "fullscr
|
|
|
3258
3258
|
* different initial states, an iframe physically resizes between mount and App's
|
|
3259
3259
|
* first effect (the closed→open→closed flicker this pins against).
|
|
3260
3260
|
*/
|
|
3261
|
-
declare function resolveInitialHostMode(options: ResolvedOptions): HostMode;
|
|
3261
|
+
export declare function resolveInitialHostMode(options: ResolvedOptions): HostMode;
|
|
3262
3262
|
//#endregion
|
|
3263
3263
|
//#region src/core/hooks.d.ts
|
|
3264
3264
|
/** Wildcard that matches every widget id / every event name. */
|
|
3265
|
-
declare const HOOK_WILDCARD = "*";
|
|
3265
|
+
export declare const HOOK_WILDCARD = "*";
|
|
3266
3266
|
/**
|
|
3267
3267
|
* Unified lifecycle callback signature. `data` is `unknown` — narrow it
|
|
3268
3268
|
* via the `event` discriminator using {@link EventMap} if needed:
|
|
@@ -3283,7 +3283,7 @@ type HookListener = (instance: ChatWidgetInstance, event: EventName, data: unkno
|
|
|
3283
3283
|
* Handle returned by {@link mount} / {@link init}. All methods are safe to call
|
|
3284
3284
|
* after `destroy()` — they become no-ops rather than throwing.
|
|
3285
3285
|
*/
|
|
3286
|
-
interface ChatWidgetInstance {
|
|
3286
|
+
export interface ChatWidgetInstance {
|
|
3287
3287
|
/** Stable identifier — matches `options.widgetId ?? "default"`. */
|
|
3288
3288
|
readonly widgetId: string;
|
|
3289
3289
|
/** Open the floating panel (no-op in `inline` / `standalone` mode). */
|
|
@@ -3377,7 +3377,7 @@ interface ChatWidgetInstance {
|
|
|
3377
3377
|
* mount({ widgetId: 'sales', publicKey: KEY_B, aiAgentDeploymentId: DEPLOYMENT_B, target: salesEl });
|
|
3378
3378
|
* ```
|
|
3379
3379
|
*/
|
|
3380
|
-
declare function mount(opts: ChatWidgetOptions & {
|
|
3380
|
+
export declare function mount(opts: ChatWidgetOptions & {
|
|
3381
3381
|
aiAgentDeploymentId: string;
|
|
3382
3382
|
target?: HTMLElement;
|
|
3383
3383
|
}): ChatWidgetInstance;
|
|
@@ -3386,7 +3386,7 @@ declare function mount(opts: ChatWidgetOptions & {
|
|
|
3386
3386
|
* options are merged (via {@link ChatWidgetInstance.update}). Otherwise it
|
|
3387
3387
|
* behaves like {@link mount}. Safe to call on every route change in an SPA.
|
|
3388
3388
|
*/
|
|
3389
|
-
declare function init(opts: ChatWidgetOptions & {
|
|
3389
|
+
export declare function init(opts: ChatWidgetOptions & {
|
|
3390
3390
|
aiAgentDeploymentId: string;
|
|
3391
3391
|
target?: HTMLElement;
|
|
3392
3392
|
}): ChatWidgetInstance;
|
|
@@ -3394,14 +3394,14 @@ declare function init(opts: ChatWidgetOptions & {
|
|
|
3394
3394
|
* Destroy a specific instance by `widgetId`, or — when no id is supplied —
|
|
3395
3395
|
* every live widget on the page.
|
|
3396
3396
|
*/
|
|
3397
|
-
declare function destroy(widgetId?: string): void;
|
|
3397
|
+
export declare function destroy(widgetId?: string): void;
|
|
3398
3398
|
/**
|
|
3399
3399
|
* Look up a live instance by `widgetId` (default: `"default"`). Returns
|
|
3400
3400
|
* `null` if nothing is mounted at that slot.
|
|
3401
3401
|
*/
|
|
3402
|
-
declare function getInstance(widgetId?: string): ChatWidgetInstance | null;
|
|
3402
|
+
export declare function getInstance(widgetId?: string): ChatWidgetInstance | null;
|
|
3403
3403
|
/** All live widget instances on the page. */
|
|
3404
|
-
declare function getAllInstances(): ChatWidgetInstance[];
|
|
3404
|
+
export declare function getAllInstances(): ChatWidgetInstance[];
|
|
3405
3405
|
/**
|
|
3406
3406
|
* Register a lifecycle hook that fires for every matching
|
|
3407
3407
|
* `(widgetId, event)` pair across all live widgets.
|
|
@@ -3427,12 +3427,12 @@ declare function getAllInstances(): ChatWidgetInstance[];
|
|
|
3427
3427
|
* module-scope registry, so they persist across `mount()` / `destroy()`
|
|
3428
3428
|
* cycles until explicitly unregistered.
|
|
3429
3429
|
*/
|
|
3430
|
-
declare function hook(widgetId: string, event: string, listener: HookListener): () => void;
|
|
3430
|
+
export declare function hook(widgetId: string, event: string, listener: HookListener): () => void;
|
|
3431
3431
|
/** Semver of the published `@<brand>/elements` package — build-injected, also
|
|
3432
3432
|
* sent on every request + analytics hit as `_ev`. */
|
|
3433
|
-
declare const version: string;
|
|
3433
|
+
export declare const version: string;
|
|
3434
3434
|
/** Compile-time brand constants inlined at build time (name, CDN URL, theme). */
|
|
3435
|
-
declare const brand: {
|
|
3435
|
+
export declare const brand: {
|
|
3436
3436
|
readonly id: string;
|
|
3437
3437
|
readonly name: string;
|
|
3438
3438
|
readonly global: string;
|
|
@@ -3444,5 +3444,5 @@ declare const brand: {
|
|
|
3444
3444
|
readonly siteUrl: string;
|
|
3445
3445
|
};
|
|
3446
3446
|
//#endregion
|
|
3447
|
-
export {
|
|
3447
|
+
export type { Asset, BlocksConfig, ChatWidgetOptions, ConnectionConfig, ConnectionConfigPartial, EventMap, EventName, HandshakeResponse, HookListener, Link, LogEntry, LogLevel, ResolvedOptions, ServerConfig, SiteConfig, WidgetConfig, WidgetConfigPartial, WidgetSettings, WidgetSettingsPartial };
|
|
3448
3448
|
//# sourceMappingURL=index.d.ts.map
|