@cimulate/copilot-widget 1.55.8 → 1.57.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.
@@ -67,7 +67,7 @@ export declare const AgentForceWidget: (props: CopilotWidgetProps) => JSX_2.Elem
67
67
  * UIStateContext >
68
68
  * MessagingProvider (Agentforce/SCRT2 SDK)
69
69
  */
70
- export declare const AgentforceWidgetProvider: ({ mode, layoutPreset, apiKey, apiToken, baseUrl, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, onNavigate, globalClassName, isDevelopment, componentType, componentConfig, initialEntry, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, showProductDescription, resetConversationMessage, conversationHistory, messagingConfig, overrides, overridesUrl, inlineOverrides, __features, children, }: CopilotWidgetProps & {
70
+ export declare const AgentforceWidgetProvider: ({ mode, apiKey, apiToken, baseUrl, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, onNavigate, globalClassName, isDevelopment, componentType, componentConfig, initialEntry, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, showProductDescription, resetConversationMessage, conversationHistory, messagingConfig, overrides, overridesUrl, inlineOverrides, __features, children, }: CopilotWidgetProps & {
71
71
  overridesUrl?: string;
72
72
  inlineOverrides?: ComponentOverrides;
73
73
  children: ReactNode;
@@ -327,12 +327,13 @@ declare type ComparisonTableRow = {
327
327
  * One flat map from override key to custom-element tag name.
328
328
  *
329
329
  * `ProductTile`, `ProductCarousel`, `ProductDetailCard`, `ProductComparison`,
330
- * `ProgressSteps`, `Suggestions`, `OrderConfirmation`, `Cart`, and
331
- * `HeaderActions` are the named keys the widget consults for its built-in UI:
332
- * register one and the widget mounts your element in place of the default
333
- * tile/carousel/detail card/comparison table/progress panel/follow-up
334
- * buttons/order confirmation card/cart card/header action cluster (leave it
335
- * unset and the built-in renders).
330
+ * `ProgressSteps`, `Suggestions`, `OrderConfirmation`, `Cart`,
331
+ * `HeaderActions`, and `SubHeader` are the named keys the widget consults for
332
+ * its built-in UI: register one and the widget mounts your element in place of
333
+ * the default tile/carousel/detail card/comparison table/progress panel/follow-up
334
+ * buttons/order confirmation card/cart card/header action cluster, or under the
335
+ * messaging title bar for `SubHeader` (leave a replacement unset and the
336
+ * built-in renders; leave `SubHeader` unset and that row is absent).
336
337
  * Every other key is matched against a `type:"tool_results"` block's top-level
337
338
  * `output_name` (never a field inside the arbitrary `data` payload); an
338
339
  * unmatched block renders nothing. `Header`, `HeaderActions`, and `SubHeader`
@@ -343,7 +344,8 @@ declare type ComparisonTableRow = {
343
344
  *
344
345
  * The search bar is the remaining non-overridable chrome: that key is accepted
345
346
  * by the open index signature but has no render path, so it is silently ignored.
346
- * `Header` and `SubHeader` are not slots.
347
+ * `Header` is not a slot. A future `Header` override replaces the title bar and
348
+ * the `SubHeader` row together.
347
349
  */
348
350
  export declare interface ComponentOverrides {
349
351
  ProductTile?: OverrideTagName;
@@ -380,6 +382,13 @@ export declare interface ComponentOverrides {
380
382
  * built-in actions render.
381
383
  */
382
384
  HeaderActions?: OverrideTagName;
385
+ /**
386
+ * Mounts a row under the built-in title bar on the messaging dialog and
387
+ * modal. Receives {@link SubHeaderOverrideProps}. `payload` is empty; paint
388
+ * the row from the storefront and call actions through `api.*`.
389
+ * Leave unset and the row is absent. Embedded chat does not mount this slot.
390
+ */
391
+ SubHeader?: OverrideTagName;
383
392
  [key: string]: OverrideTagName | undefined;
384
393
  }
385
394
 
@@ -388,7 +397,6 @@ export declare type ComponentType = "chat" | "dialog" | "modal";
388
397
  declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
389
398
  isDevelopment?: boolean;
390
399
  globalClassName?: string;
391
- layoutPreset?: "standard" | "commerce";
392
400
  /**
393
401
  * @deprecated
394
402
  *
@@ -406,7 +414,7 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
406
414
  messageAlignment?: MessageAlignment;
407
415
  autoScroll?: boolean;
408
416
  showProductDescription?: boolean;
409
- theme?: ThemeConfig;
417
+ theme?: ThemeInput;
410
418
  openLinksInNewTab?: boolean;
411
419
  /**
412
420
  * Called on an unmodified same-tab click of a same-origin link in the widget
@@ -1117,10 +1125,13 @@ export declare interface OverrideFailureOptions {
1117
1125
  * `payload.actions` is the live header state, and `api`
1118
1126
  * adds `actions` beside `sendMessage`. See
1119
1127
  * ComponentOverrides.HeaderActions.
1128
+ * - "SubHeader" → uses its own {@link SubHeaderOverrideProps}:
1129
+ * `payload` is empty. The storefront paints the row.
1130
+ * See ComponentOverrides.SubHeader.
1120
1131
  * - any custom-block key → the `tool_results` block's raw `data`, your own shape
1121
1132
  */
1122
1133
  export declare interface OverrideProps {
1123
- /** The resolved override key: "ProductTile"/"ProductCarousel"/"ProductDetailCard"/"ProductComparison"/"ProgressSteps"/"Suggestions"/"OrderConfirmation"/"Cart"/"HeaderActions" for the built-in slots, else the `tool_results` block's `output_name`. */
1134
+ /** The resolved override key: "ProductTile"/"ProductCarousel"/"ProductDetailCard"/"ProductComparison"/"ProgressSteps"/"Suggestions"/"OrderConfirmation"/"Cart"/"HeaderActions"/"SubHeader" for the built-in slots, else the `tool_results` block's `output_name`. */
1124
1135
  name: string;
1125
1136
  payload: unknown;
1126
1137
  api: OverrideApi;
@@ -1370,6 +1381,18 @@ export declare type ReportOverrideEvent = (code: string, options?: OverrideEvent
1370
1381
  */
1371
1382
  export declare type ReportOverrideFailure = (code: string, options?: OverrideFailureOptions) => void;
1372
1383
 
1384
+ declare interface ResolvedTheme {
1385
+ compatibility: "legacy" | null;
1386
+ preset: ThemePresetName;
1387
+ traits: ThemeTraits;
1388
+ tokens: ThemeTokens;
1389
+ variants: ThemeVariants;
1390
+ cssVariables: Record<string, string>;
1391
+ transcriptClassName: string;
1392
+ }
1393
+
1394
+ export declare const resolveTheme: (theme?: ThemeInput) => ResolvedTheme;
1395
+
1373
1396
  declare type ResponseItem = MarkdownResponse | ProductCarouselResponse | ProductTileResponse | ProductComparisonResponse | SuggestionsResponse | CartResponse | OrderConfirmationResponse | ToolResultsResponse;
1374
1397
 
1375
1398
  declare type SearchEntryParams = SearchPayload["searchParams"];
@@ -1471,6 +1494,18 @@ declare type StructuredCoupon = {
1471
1494
  status?: string;
1472
1495
  };
1473
1496
 
1497
+ /**
1498
+ * Props for the `SubHeader` slot. `payload` is empty: the storefront already
1499
+ * has the product and paints the row. Add to cart goes through
1500
+ * `api.sendMessage`, the same channel as a product override. This slot has no
1501
+ * cart mutation api.
1502
+ */
1503
+ export declare interface SubHeaderOverrideProps {
1504
+ name: "SubHeader";
1505
+ payload: Record<string, never>;
1506
+ api: OverrideApi;
1507
+ }
1508
+
1474
1509
  declare type Suggestion = CopilotSearchSuggestion | FacetedNavigationSuggestion | ProductViewSuggestion | CopilotBrowseSuggestion;
1475
1510
 
1476
1511
  declare interface SuggestionButtonConfig {
@@ -1488,7 +1523,7 @@ declare type SuggestionsResponse = {
1488
1523
  };
1489
1524
  };
1490
1525
 
1491
- declare interface ThemeConfig {
1526
+ export declare interface ThemeConfig {
1492
1527
  primaryColor?: string;
1493
1528
  secondaryColor?: string;
1494
1529
  fontColor?: string;
@@ -1499,6 +1534,93 @@ declare interface ThemeConfig {
1499
1534
  borderRadius?: string | 0;
1500
1535
  }
1501
1536
 
1537
+ export declare type ThemeDensity = "compact" | "comfortable";
1538
+
1539
+ export declare type ThemeElevation = "flat" | "raised";
1540
+
1541
+ export declare type ThemeInput = ThemeRecipe;
1542
+
1543
+ export declare type ThemePresetName = "legacy" | "commerce";
1544
+
1545
+ export declare interface ThemeRecipe extends ThemeConfig {
1546
+ preset?: ThemePresetName;
1547
+ density?: ThemeDensity;
1548
+ shape?: ThemeShape;
1549
+ elevation?: ThemeElevation;
1550
+ tokens?: Partial<{
1551
+ [K in keyof ThemeTokens]: string | 0;
1552
+ }>;
1553
+ }
1554
+
1555
+ export declare const themes: Readonly<Record<ThemePresetName, Readonly<ThemeInput>>>;
1556
+
1557
+ export declare type ThemeShape = "sharp" | "soft" | "round";
1558
+
1559
+ export declare interface ThemeTokens {
1560
+ primary: string;
1561
+ secondary: string;
1562
+ text: string;
1563
+ fontFamily: string;
1564
+ surface: string;
1565
+ border: string;
1566
+ inputBorder: string;
1567
+ canvas: string;
1568
+ muted: string;
1569
+ subtle: string;
1570
+ outline: string;
1571
+ foreground: string;
1572
+ onPrimary: string;
1573
+ focus: string;
1574
+ variantSelection: string;
1575
+ variantSelectionHover: string;
1576
+ variantSelectionText: string;
1577
+ variantSelectionBorder: string;
1578
+ variantSelectionHoverBorder: string;
1579
+ loaderStart: string;
1580
+ loaderEnd: string;
1581
+ sendIdleBackground: string;
1582
+ sendIdleForeground: string;
1583
+ sendBackground: string;
1584
+ sendHoverBackground: string;
1585
+ productFontFamily: string;
1586
+ cardRadius: string;
1587
+ controlRadius: string;
1588
+ composerRadius: string;
1589
+ chipRadius: string;
1590
+ mediaRadius: string;
1591
+ transcriptPadding: string;
1592
+ mobileTranscriptPadding: string;
1593
+ cardPadding: string;
1594
+ transcriptGap: string;
1595
+ carouselGap: string;
1596
+ headerHeight: string;
1597
+ controlSize: string;
1598
+ cardShadow: string;
1599
+ headerShadow: string;
1600
+ launcherShadow: string;
1601
+ launcherAnimation: string;
1602
+ headerBackground: string;
1603
+ headerText: string;
1604
+ headerFontSize: string;
1605
+ headerFontWeight: string;
1606
+ headerFontFamily: string;
1607
+ }
1608
+
1609
+ declare interface ThemeTraits {
1610
+ density: ThemeDensity;
1611
+ shape: ThemeShape;
1612
+ elevation: ThemeElevation;
1613
+ }
1614
+
1615
+ export declare interface ThemeVariants {
1616
+ transcript: "grouped" | "unified-card";
1617
+ connecting: "pulse" | "sparkles";
1618
+ quantity: "input" | "stepper";
1619
+ carousel: "chevron" | "circle-arrow";
1620
+ logoFallback: "none" | "sparkle";
1621
+ userMessageIcon: "visible" | "hidden";
1622
+ }
1623
+
1502
1624
  /**
1503
1625
  * Escape hatch for agent-action outputs that don't map to any built-in block
1504
1626
  * (e.g. order tracking, warranty registration, option pickers). Rendered via a
@@ -1506,7 +1628,8 @@ declare interface ThemeConfig {
1506
1628
  * `data` is the raw action output, handed to the override verbatim. An unmatched
1507
1629
  * `output_name` renders nothing, same as an unknown block type. `Header`,
1508
1630
  * `HeaderActions`, and `SubHeader` render nothing even when registered; those
1509
- * names are widget chrome.
1631
+ * names are widget chrome. `SubHeader` is the row under the messaging title
1632
+ * bar, not a transcript block.
1510
1633
  */
1511
1634
  declare type ToolResultsResponse = {
1512
1635
  type: "tool_results";