@cimulate/copilot-widget 1.58.1 → 1.60.1

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.
@@ -328,6 +328,13 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
328
328
  * Configuration for messaging mode. Required when mode is 'messaging'.
329
329
  */
330
330
  messagingConfig?: MessagingModeConfig;
331
+ /**
332
+ * Translated or customized widget copy. Pass a full locale catalog (e.g.
333
+ * imported from `@cimulate/copilot-widget/locales/fr-FR`) or a partial
334
+ * object to override individual strings. Any key omitted falls back to the
335
+ * bundled English (`en-US`) default.
336
+ */
337
+ translations?: WidgetMessageCatalog;
331
338
  overrides?: ComponentOverrides;
332
339
  overridesUrl?: string;
333
340
  inlineOverrides?: ComponentOverrides;
@@ -352,7 +359,7 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
352
359
  * PromptsExtensionContext >
353
360
  * CopilotProvider (SocketSdk: copilot-sdk)
354
361
  */
355
- declare const CopilotWidgetProvider: ({ mode, apiKey, apiToken, baseUrl, customerId, tenantId, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, onNavigate, globalClassName, isDevelopment, componentType, componentConfig, entryType, initialEntry, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, baseCatalogParams, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, resetConversationMessage, conversationHistory, onConnect, onCopilotEvent, onRefinedSearch, onRefinedBrowse, __features, children, }: CopilotWidgetProps & {
362
+ declare const CopilotWidgetProvider: ({ mode, apiKey, apiToken, baseUrl, customerId, tenantId, logoUrl, headerText, headerConfig, theme, openLinksInNewTab, onNavigate, globalClassName, isDevelopment, componentType, componentConfig, entryType, initialEntry, entryMessage, disclaimerText, disclaimerMarkdown, clientContext, baseCatalogParams, searchPlaceholder, searchButtonLabel, searchConfig, suggestionButtonConfig, messageAlignment, autoScroll, promptsConfig, resetConversationMessage, conversationHistory, onConnect, onCopilotEvent, onRefinedSearch, onRefinedBrowse, translations, __features, children, }: CopilotWidgetProps & {
356
363
  children: ReactNode;
357
364
  }) => JSX_2.Element;
358
365
 
@@ -582,6 +589,11 @@ declare interface PdpPageContext {
582
589
  imageUrl?: string;
583
590
  }
584
591
 
592
+ declare interface PendingInput {
593
+ text: string;
594
+ phase: "queued" | "sending" | "failed";
595
+ }
596
+
585
597
  declare interface ProductResultDetail {
586
598
  agentSessionId: string;
587
599
  kind: "search" | "detail";
@@ -687,8 +699,13 @@ declare interface SocketSdkContextType {
687
699
  messages: AllCopilotEvents[];
688
700
  groupedMessages: Message[];
689
701
  isLoading: boolean;
702
+ isConnecting: boolean;
703
+ isConnectionSlow: boolean;
704
+ pendingInput: PendingInput | null;
705
+ inputError: string | null;
690
706
  isResponseLoading: (messageId: string) => boolean;
691
- handleUserInput: (userPrompt: string, file?: string) => void;
707
+ handleUserInput: (userPrompt: string, file?: string) => Promise<boolean> | void;
708
+ prepareUserInput: (userPrompt: string) => (file?: string) => Promise<boolean> | void;
692
709
  handleSuggestion: (suggestion: Suggestion, eventId: string) => void;
693
710
  handleAskCim: (payload: {
694
711
  userPrompt: string;
@@ -915,6 +932,287 @@ declare interface WidgetComponentConfig {
915
932
  };
916
933
  }
917
934
 
935
+ /**
936
+ * Locale-keyed catalog of every widget-owned UI string.
937
+ *
938
+ * Pass a partial catalog as the `messages` prop on `CopilotWidget` or
939
+ * `AgentForceWidget`. Each key is optional — omitted keys fall back to
940
+ * the locale catalog default and then to the bundled English default.
941
+ *
942
+ * String values that contain `{placeholder}` tokens are interpolated at
943
+ * runtime by the widget's `interpolate(template, params)` utility before
944
+ * they are rendered.
945
+ */
946
+ declare interface WidgetMessageCatalog {
947
+ common?: {
948
+ close?: string;
949
+ cancel?: string;
950
+ retry?: string;
951
+ dismiss?: string;
952
+ remove?: string;
953
+ search?: string;
954
+ checkout?: string;
955
+ moreOptions?: string;
956
+ conversation?: string;
957
+ };
958
+ controls?: {
959
+ /** `{componentType}` */
960
+ overflowMenuAriaLabel?: string;
961
+ clearChat?: string;
962
+ clearChatMenu?: string;
963
+ downloadTranscript?: string;
964
+ endConversation?: string;
965
+ toggleMinimizeAriaLabel?: string;
966
+ minimize?: string;
967
+ expandAriaLabel?: string;
968
+ showModal?: string;
969
+ collapseAriaLabel?: string;
970
+ /** `{previousComponentType}` */
971
+ showDialog?: string;
972
+ showDialogFallback?: string;
973
+ toggleFullscreen?: string;
974
+ moveRight?: string;
975
+ moveLeft?: string;
976
+ };
977
+ launcher?: {
978
+ openCommerceClientAriaLabel?: string;
979
+ openCopilotAriaLabel?: string;
980
+ logoAlt?: string;
981
+ };
982
+ header?: {
983
+ defaultHeaderTextCopilot?: string;
984
+ defaultHeaderTextMessaging?: string;
985
+ };
986
+ loading?: {
987
+ loadingCopilot?: string;
988
+ loadingResponse?: string;
989
+ reconnecting?: string;
990
+ addingToCart?: string;
991
+ connectingToAgent?: string;
992
+ };
993
+ connecting?: {
994
+ /** Shown for `layoutPreset="standard"`. */
995
+ default?: readonly string[];
996
+ /** Shown for `layoutPreset="commerce"`. */
997
+ commerce?: readonly string[];
998
+ loadingShoppingAssistantAriaLabel?: string;
999
+ loadingShoppingAssistantHeading?: string;
1000
+ connectingToAssistantAriaLabel?: string;
1001
+ connectedToAssistant?: string;
1002
+ disconnectedFromAssistant?: string;
1003
+ };
1004
+ searchBar?: {
1005
+ placeholderAskUsAnything?: string;
1006
+ placeholderAskAQuestion?: string;
1007
+ connectToHumanAriaLabel?: string;
1008
+ connectToHumanSentMessage?: string;
1009
+ currentPageContextAriaLabel?: string;
1010
+ searchCopilotAriaLabel?: string;
1011
+ cancelProcessingAriaLabel?: string;
1012
+ cancelRequestTitle?: string;
1013
+ sendMessageAriaLabel?: string;
1014
+ };
1015
+ imageAttachment?: {
1016
+ uploadImageAriaLabel?: string;
1017
+ removeImageLabel?: string;
1018
+ /** `{fileName}` */
1019
+ previewAlt?: string;
1020
+ /** `{maxImageMb}` */
1021
+ fileSizeExceeded?: string;
1022
+ fileSizeExceeded10mb?: string;
1023
+ unsupportedFileType?: string;
1024
+ fileProcessingError?: string;
1025
+ };
1026
+ prompts?: {
1027
+ askMeSomethingElse?: string;
1028
+ submitPromptAriaLabel?: string;
1029
+ placeholderAskCopilot?: string;
1030
+ placeholderAskAQuestion?: string;
1031
+ connectingToAgent?: string;
1032
+ agentError?: string;
1033
+ };
1034
+ entryMessage?: {
1035
+ askCimWelcome?: string;
1036
+ };
1037
+ messages?: {
1038
+ conversationReset?: string;
1039
+ startSearchPrompt?: string;
1040
+ genericError?: string;
1041
+ displayDisplayTrouble?: string;
1042
+ requestTrouble?: string;
1043
+ progressHide?: string;
1044
+ progressContext?: string;
1045
+ userProvidedContextAlt?: string;
1046
+ recommendedProductsAriaLabel?: string;
1047
+ /** `{count}` — singular */
1048
+ filterCountOne?: string;
1049
+ /** `{count}` — plural */
1050
+ filterCountMultiple?: string;
1051
+ progressStepCompleted?: string;
1052
+ progressStepInProgress?: string;
1053
+ /** `{step}`, `{status}` */
1054
+ progressStepAriaLabel?: string;
1055
+ };
1056
+ userQuery?: {
1057
+ yourSearch?: string;
1058
+ browsingCategory?: string;
1059
+ viewingProduct?: string;
1060
+ };
1061
+ product?: {
1062
+ /** `{name}` */
1063
+ goToProductPageAriaLabel?: string;
1064
+ /** `{name}` */
1065
+ viewDetailsAriaLabel?: string;
1066
+ productImageAlt?: string;
1067
+ /** `{name}` */
1068
+ noImageAriaLabel?: string;
1069
+ noProductImageAriaLabel?: string;
1070
+ /** `{productName}` */
1071
+ showMeDetailsSentMessage?: string;
1072
+ thisProductFallbackName?: string;
1073
+ /** `{low}`, `{high}` */
1074
+ priceFromToAriaLabel?: string;
1075
+ colorVariantLabel?: string;
1076
+ quantityLabel?: string;
1077
+ decreaseQuantityAriaLabel?: string;
1078
+ increaseQuantityAriaLabel?: string;
1079
+ unavailableVariant?: string;
1080
+ addToCart?: string;
1081
+ };
1082
+ productComparison?: {
1083
+ /** `{productName}` */
1084
+ viewDetailsAriaLabel?: string;
1085
+ /** `{productName}` */
1086
+ showDetailsSentMessage?: string;
1087
+ };
1088
+ productGallery?: {
1089
+ productImagesAriaLabel?: string;
1090
+ /** `{altText}`, `{index}` */
1091
+ imageAlt?: string;
1092
+ /** `{index}` */
1093
+ imageAltFallback?: string;
1094
+ previousImageAriaLabel?: string;
1095
+ nextImageAriaLabel?: string;
1096
+ /** `{index}` */
1097
+ goToImageAriaLabel?: string;
1098
+ };
1099
+ carousel?: {
1100
+ productCarouselAriaLabel?: string;
1101
+ productRecommendationsAriaLabel?: string;
1102
+ previousSlideAriaLabel?: string;
1103
+ nextSlideAriaLabel?: string;
1104
+ /** `{index}` */
1105
+ goToSlideGroupAriaLabel?: string;
1106
+ };
1107
+ price?: {
1108
+ currentPriceLabel?: string;
1109
+ originalPriceLabel?: string;
1110
+ };
1111
+ cart?: {
1112
+ checkout?: string;
1113
+ decreaseQuantityAriaLabel?: string;
1114
+ increaseQuantityAriaLabel?: string;
1115
+ quantityAriaLabel?: string;
1116
+ quantityHeading?: string;
1117
+ productImageAlt?: string;
1118
+ /** `{promo}` */
1119
+ promotionLabel?: string;
1120
+ remove?: string;
1121
+ /** `{count}` — singular */
1122
+ subtotalOne?: string;
1123
+ /** `{count}` — plural */
1124
+ subtotalMultiple?: string;
1125
+ coupon?: string;
1126
+ promotions?: string;
1127
+ shipping?: string;
1128
+ shippingDiscount?: string;
1129
+ tax?: string;
1130
+ estimatedTotal?: string;
1131
+ enterCouponCode?: string;
1132
+ applyCouponAriaLabel?: string;
1133
+ couponNotApplied?: string;
1134
+ shippingAndTaxesFooter?: string;
1135
+ /** `{orderId}` */
1136
+ expressCheckoutCompleteWithOrder?: string;
1137
+ expressCheckoutCompleteNoOrder?: string;
1138
+ /** `{qty}` */
1139
+ addToCartWithQty?: string;
1140
+ addToCart?: string;
1141
+ };
1142
+ orderConfirmation?: {
1143
+ productImageAlt?: string;
1144
+ /** `{promo}` */
1145
+ promotionLabel?: string;
1146
+ /** `{quantity}` */
1147
+ quantityLabel?: string;
1148
+ orderConfirmed?: string;
1149
+ /** `{id}` */
1150
+ orderNumberLabel?: string;
1151
+ /** `{date}` */
1152
+ orderedOnLabel?: string;
1153
+ subtotal?: string;
1154
+ coupon?: string;
1155
+ promotions?: string;
1156
+ shipping?: string;
1157
+ shippingDiscount?: string;
1158
+ tax?: string;
1159
+ total?: string;
1160
+ shippingAndTaxesFooter?: string;
1161
+ };
1162
+ payment?: {
1163
+ expressPaymentTitle?: string;
1164
+ paymentFailed?: string;
1165
+ paymentCanceled?: string;
1166
+ };
1167
+ jumpToLatest?: {
1168
+ jumpToLatestAriaLabel?: string;
1169
+ jumpToLatestTitle?: string;
1170
+ };
1171
+ attachment?: {
1172
+ fallbackAlt?: string;
1173
+ };
1174
+ announcements?: {
1175
+ assistantResponseAvailable?: string;
1176
+ noProductsFound?: string;
1177
+ /** `{count}` — singular */
1178
+ productsFoundOne?: string;
1179
+ /** `{count}` — plural */
1180
+ productsFoundMultiple?: string;
1181
+ /** singular */
1182
+ productTitleLabelOne?: string;
1183
+ /** plural */
1184
+ productTitleLabelMultiple?: string;
1185
+ };
1186
+ pageContext?: {
1187
+ /** `{label}` */
1188
+ stopAskingAboutAriaLabel?: string;
1189
+ /** `{label}` */
1190
+ askAboutPlaceholder?: string;
1191
+ /** `{query}` */
1192
+ searchDisplayLabel?: string;
1193
+ /** `{query}` */
1194
+ removeSearchContextAriaLabel?: string;
1195
+ searchPlaceholder?: string;
1196
+ /** `{label}` */
1197
+ searchDividerLabel?: string;
1198
+ };
1199
+ errors?: {
1200
+ genericRetry?: string;
1201
+ rateLimited?: string;
1202
+ offline?: string;
1203
+ messagingUnavailable?: string;
1204
+ };
1205
+ session?: {
1206
+ sessionEnded?: string;
1207
+ conversationEnded?: string;
1208
+ /** `{name}` */
1209
+ participantJoined?: string;
1210
+ /** `{name}` */
1211
+ participantLeft?: string;
1212
+ participantFallbackName?: string;
1213
+ };
1214
+ }
1215
+
918
1216
  /**
919
1217
  * Widget operating mode.
920
1218
  * - 'copilot' (default): Uses the Cimulate Copilot SDK (Socket.IO)