@cimulate/copilot-widget 1.47.1 → 1.48.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.
@@ -21,6 +21,7 @@ import { FacetedNavigationSuggestion } from '@cimulate/copilot-sdk';
21
21
  import { FollowUp } from '@cimulate/copilot-sdk';
22
22
  import { Inquiry } from '@cimulate/copilot-sdk';
23
23
  import { JSX as JSX_2 } from 'react';
24
+ import { MouseEvent as MouseEvent_2 } from 'react';
24
25
  import { MutableRefObject } from 'react';
25
26
  import { PartialInquiry } from '@cimulate/copilot-sdk';
26
27
  import { ProductView } from '@cimulate/copilot-sdk';
@@ -66,7 +67,7 @@ export declare const AgentForceWidget: (props: CopilotWidgetProps) => JSX_2.Elem
66
67
  * UIStateContext >
67
68
  * MessagingProvider (Agentforce/SCRT2 SDK)
68
69
  */
69
- export declare const AgentforceWidgetProvider: ({ mode, apiKey, apiToken, baseUrl, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, globalClassName, isDevelopment, componentType, componentConfig, entryType, 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, entryType, initialEntry, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, showProductDescription, resetConversationMessage, conversationHistory, messagingConfig, overrides, overridesUrl, inlineOverrides, __features, children, }: CopilotWidgetProps & {
70
71
  overridesUrl?: string;
71
72
  inlineOverrides?: ComponentOverrides;
72
73
  children: ReactNode;
@@ -385,6 +386,16 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
385
386
  showProductDescription?: boolean;
386
387
  theme?: ThemeConfig;
387
388
  openLinksInNewTab?: boolean;
389
+ /**
390
+ * Called on an unmodified same-tab click of a same-origin link in the widget
391
+ * (product, checkout, and message links). Use this on SPA storefronts to route
392
+ * with the host router (`history.push`, `router.push`, etc.) instead of a full
393
+ * page load.
394
+ * Call `event.preventDefault()` inside the handler to skip the native
395
+ * navigation. Modifier clicks, `target="_blank"`, and cross-origin URLs
396
+ * are left to the browser.
397
+ */
398
+ onNavigate?: StorefrontNavigateHandler;
388
399
  /**
389
400
  * @deprecated This setting has been moved to the initialEntry object. Please use initialEntry.type instead.
390
401
  */
@@ -1287,6 +1298,8 @@ declare type StaticQuestionsConfig = {
1287
1298
 
1288
1299
  declare type StaticQuestionsStrategy = "override" | "append" | "prepend";
1289
1300
 
1301
+ declare type StorefrontNavigateHandler = (url: string, event: MouseEvent_2<HTMLAnchorElement>) => void;
1302
+
1290
1303
  declare type StructuredCoupon = {
1291
1304
  code: string;
1292
1305
  id?: string;