@cimulate/copilot-widget 1.22.1 → 1.24.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/cimulate-copilot-widget.d.ts +43 -11
- package/dist/cimulate-copilot-widget.es.js +10246 -11355
- package/dist/cimulate-copilot-widget.umd.js +37 -37
- package/dist/copilot.es.js +10255 -11364
- package/dist/copilot.umd.js +37 -37
- package/dist/messaging.css +1 -1
- package/dist/messaging.d.ts +178 -14
- package/dist/messaging.es.js +12181 -12876
- package/dist/messaging.umd.js +41 -41
- package/package.json +5 -5
|
@@ -20,7 +20,7 @@ import { DisplayProducts } from '@cimulate/copilot-sdk';
|
|
|
20
20
|
import { FacetedNavigationSuggestion } from '@cimulate/copilot-sdk';
|
|
21
21
|
import { FollowUp } from '@cimulate/copilot-sdk';
|
|
22
22
|
import { Inquiry } from '@cimulate/copilot-sdk';
|
|
23
|
-
import { JSX as JSX_2 } from 'react
|
|
23
|
+
import { JSX as JSX_2 } from 'react';
|
|
24
24
|
import { PartialInquiry } from '@cimulate/copilot-sdk';
|
|
25
25
|
import { ProductView } from '@cimulate/copilot-sdk';
|
|
26
26
|
import { ProductViewAck } from '@cimulate/copilot-sdk';
|
|
@@ -101,6 +101,28 @@ declare interface CommonParams {
|
|
|
101
101
|
pricebooks?: string[] | null;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
/**
|
|
105
|
+
* One flat map from override key to custom-element tag name.
|
|
106
|
+
*
|
|
107
|
+
* `ProductTile` and `ProductCarousel` are the only keys the widget consults for
|
|
108
|
+
* its built-in product UI: register one and the widget mounts your element in
|
|
109
|
+
* place of the default tile/carousel (leave it unset and the built-in renders).
|
|
110
|
+
* Every other key is matched against a `type:"tool_results"` block's top-level
|
|
111
|
+
* `output_name` (never a field inside the arbitrary `data` payload); an unmatched
|
|
112
|
+
* block renders nothing. All of them receive the same `OverrideProps`.
|
|
113
|
+
*
|
|
114
|
+
* { ProductTile: "cx-product-card", recentOrders: "cx-recent-orders" }
|
|
115
|
+
*
|
|
116
|
+
* Widget chrome (header, search bar, follow-up suggestions) is intentionally NOT
|
|
117
|
+
* overridable: those keys are accepted by the open index signature but have no
|
|
118
|
+
* render path, so they are silently ignored.
|
|
119
|
+
*/
|
|
120
|
+
declare interface ComponentOverrides {
|
|
121
|
+
ProductTile?: OverrideTagName;
|
|
122
|
+
ProductCarousel?: OverrideTagName;
|
|
123
|
+
[key: string]: OverrideTagName | undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
104
126
|
declare type ComponentType = "chat" | "dialog" | "modal";
|
|
105
127
|
|
|
106
128
|
declare namespace copilot {
|
|
@@ -167,6 +189,7 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
|
|
|
167
189
|
suggestionButtonConfig?: SuggestionButtonConfig;
|
|
168
190
|
messageAlignment?: MessageAlignment;
|
|
169
191
|
autoScroll?: boolean;
|
|
192
|
+
showProductDescription?: boolean;
|
|
170
193
|
theme?: ThemeConfig;
|
|
171
194
|
openLinksInNewTab?: boolean;
|
|
172
195
|
entryType?: EntryType;
|
|
@@ -220,6 +243,9 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
|
|
|
220
243
|
* Configuration for messaging mode. Required when mode is 'messaging'.
|
|
221
244
|
*/
|
|
222
245
|
messagingConfig?: MessagingModeConfig;
|
|
246
|
+
overrides?: ComponentOverrides;
|
|
247
|
+
overridesUrl?: string;
|
|
248
|
+
inlineOverrides?: ComponentOverrides;
|
|
223
249
|
/**
|
|
224
250
|
*
|
|
225
251
|
* Enables features not yet released. They may require additional backend support and are subject to change.
|
|
@@ -323,13 +349,9 @@ declare type MessageAlignment = "start" | "end";
|
|
|
323
349
|
* Configuration for messaging mode (SCRT2 Agentforce).
|
|
324
350
|
*/
|
|
325
351
|
declare interface MessagingModeConfig {
|
|
326
|
-
/** SCRT2 instance URL (e.g. "https://xyz.salesforce-scrt.com") */
|
|
327
352
|
scrt2Url: string;
|
|
328
|
-
/** Salesforce Organization ID */
|
|
329
353
|
orgId: string;
|
|
330
|
-
/** Embedded Service developer name */
|
|
331
354
|
esDeveloperName: string;
|
|
332
|
-
/** Optional routing attributes for the conversation */
|
|
333
355
|
routingAttributes?: Record<string, string>;
|
|
334
356
|
/**
|
|
335
357
|
* Capabilities version for the SCRT2 token request. Required (>= "63", i.e.
|
|
@@ -339,20 +361,30 @@ declare interface MessagingModeConfig {
|
|
|
339
361
|
*/
|
|
340
362
|
capabilitiesVersion?: string;
|
|
341
363
|
/**
|
|
342
|
-
*
|
|
343
|
-
* saves the current conversation as a PDF. Defaults to true; set to false to
|
|
344
|
-
* hide it. Requires the org's messaging channel to allow transcript download.
|
|
364
|
+
* Requires the org's messaging channel to allow transcript download.
|
|
345
365
|
*/
|
|
346
366
|
enableDownloadTranscript?: boolean;
|
|
347
367
|
/**
|
|
348
|
-
*
|
|
349
|
-
* asks the Agentforce agent to escalate the conversation to a human. Defaults
|
|
350
|
-
* to false; set to true to show it. Requires the org's Agentforce agent to be
|
|
368
|
+
* Requires the org's Agentforce agent to be
|
|
351
369
|
* configured with an escalation path/topic, otherwise the button is a no-op.
|
|
352
370
|
*/
|
|
353
371
|
enableEscalationToAgent?: boolean;
|
|
372
|
+
showProductCaptions?: boolean;
|
|
354
373
|
}
|
|
355
374
|
|
|
375
|
+
/**
|
|
376
|
+
* A component override is the tag name of a pre-registered custom element
|
|
377
|
+
* (e.g. "product-card"). The widget creates the element via
|
|
378
|
+
* document.createElement(tagName) and assigns `OverrideProps` to its `props`
|
|
379
|
+
* setter. The element must be registered with customElements.define before the
|
|
380
|
+
* widget renders.
|
|
381
|
+
*
|
|
382
|
+
* The name must be a valid custom element name — it has to contain a hyphen and
|
|
383
|
+
* be all lowercase. Anything else (e.g. "ProductTile" or "div") is rejected with
|
|
384
|
+
* a console error and the slot renders blank.
|
|
385
|
+
*/
|
|
386
|
+
declare type OverrideTagName = string;
|
|
387
|
+
|
|
356
388
|
declare type PromptsDisplay = "input" | "buttons" | "both";
|
|
357
389
|
|
|
358
390
|
declare type PromptsExtensionConfig = Omit<PromptsExtensionState, "isInitialized" | "activePromptsId" | "userPrompt" | "promptsMessage" | "responseMessage" | "isResponseLoading" | "placeholder" | "askElseButtonLabel" | "entryType" | "params" | "promptsDisplay" | "disableAskElseButton"> & Partial<Pick<PromptsExtensionState, "placeholder" | "askElseButtonLabel" | "entryType" | "params" | "promptsDisplay" | "disableAskElseButton">>;
|