@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.
- package/CHANGELOG.md +18 -0
- package/README.md +91 -3
- package/dist/cimulate-copilot-widget.css +1 -1
- package/dist/cimulate-copilot-widget.d.ts +300 -2
- package/dist/cimulate-copilot-widget.es.js +8915 -8525
- package/dist/cimulate-copilot-widget.umd.js +31 -31
- package/dist/{client-DaAK0txn.js → client-C4_HVnQ6.js} +156 -146
- package/dist/copilot.css +1 -1
- package/dist/copilot.es.js +8913 -8523
- package/dist/copilot.umd.js +31 -31
- package/dist/locales/da-DK.json +238 -0
- package/dist/locales/de-DE.json +238 -0
- package/dist/locales/en-US.json +237 -0
- package/dist/locales/es-ES.json +238 -0
- package/dist/locales/es-MX.json +238 -0
- package/dist/locales/fi-FI.json +238 -0
- package/dist/locales/fr-FR.json +238 -0
- package/dist/locales/it-IT.json +238 -0
- package/dist/locales/ja-JP.json +238 -0
- package/dist/locales/ko-KR.json +234 -0
- package/dist/locales/nb-NO.json +238 -0
- package/dist/locales/nl-NL.json +238 -0
- package/dist/locales/pl.json +238 -0
- package/dist/locales/pt-BR.json +238 -0
- package/dist/locales/sv-SE.json +238 -0
- package/dist/locales/zh-CN.json +230 -0
- package/dist/locales/zh-TW.json +230 -0
- package/dist/messaging.css +1 -1
- package/dist/messaging.d.ts +307 -1
- package/dist/messaging.es.js +10864 -10682
- package/dist/messaging.umd.js +38 -38
- package/dist/o11y-sdk.umd.js +2 -2
- package/package.json +3 -2
package/dist/messaging.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare const AgentForceWidget: (props: CopilotWidgetProps) => JSX_2.Elem
|
|
|
69
69
|
* UIStateContext >
|
|
70
70
|
* MessagingProvider (Agentforce/SCRT2 SDK)
|
|
71
71
|
*/
|
|
72
|
-
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 & {
|
|
72
|
+
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, translations, overrides, overridesUrl, inlineOverrides, __features, children, }: CopilotWidgetProps & {
|
|
73
73
|
overridesUrl?: string;
|
|
74
74
|
inlineOverrides?: ComponentOverrides;
|
|
75
75
|
children: ReactNode;
|
|
@@ -105,6 +105,13 @@ declare interface BrowseState extends CommonParams {
|
|
|
105
105
|
categoryName?: string;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/** `commerce_agent_context.browsing_history`: the shopper's recent storefront events, oldest first. */
|
|
109
|
+
export declare interface BrowsingHistory {
|
|
110
|
+
events: Record<string, unknown>[];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export declare type BrowsingHistorySource = BrowsingHistory | (() => BrowsingHistory | null | undefined);
|
|
114
|
+
|
|
108
115
|
export declare const CART_ACTION_EVENT = "cimulate:cart-action";
|
|
109
116
|
|
|
110
117
|
export declare const CART_UPDATE_EVENT = "cimulate:cart-update";
|
|
@@ -356,6 +363,8 @@ export declare interface CimulateWidgetReadyDetail {
|
|
|
356
363
|
abort: () => void;
|
|
357
364
|
}
|
|
358
365
|
|
|
366
|
+
declare function clearBrowsingHistory(): void;
|
|
367
|
+
|
|
359
368
|
export declare function clearPageContext(): void;
|
|
360
369
|
|
|
361
370
|
declare interface ClientContext {
|
|
@@ -534,6 +543,13 @@ declare interface CopilotWidgetProps extends CimCopilotSdkConfig {
|
|
|
534
543
|
* Configuration for messaging mode. Required when mode is 'messaging'.
|
|
535
544
|
*/
|
|
536
545
|
messagingConfig?: MessagingModeConfig;
|
|
546
|
+
/**
|
|
547
|
+
* Translated or customized widget copy. Pass a full locale catalog (e.g.
|
|
548
|
+
* imported from `@cimulate/copilot-widget/locales/fr-FR`) or a partial
|
|
549
|
+
* object to override individual strings. Any key omitted falls back to the
|
|
550
|
+
* bundled English (`en-US`) default.
|
|
551
|
+
*/
|
|
552
|
+
translations?: WidgetMessageCatalog;
|
|
537
553
|
overrides?: ComponentOverrides;
|
|
538
554
|
overridesUrl?: string;
|
|
539
555
|
inlineOverrides?: ComponentOverrides;
|
|
@@ -581,6 +597,11 @@ export declare const eventHandlers: {
|
|
|
581
597
|
get: typeof getPageContext;
|
|
582
598
|
clear: typeof clearPageContext;
|
|
583
599
|
};
|
|
600
|
+
browsingHistory: {
|
|
601
|
+
set: typeof setBrowsingHistory;
|
|
602
|
+
get: typeof getBrowsingHistory;
|
|
603
|
+
clear: typeof clearBrowsingHistory;
|
|
604
|
+
};
|
|
584
605
|
cart: {
|
|
585
606
|
update: typeof updateCart;
|
|
586
607
|
};
|
|
@@ -599,6 +620,8 @@ declare type FacetFilters = Record<string, string[]>;
|
|
|
599
620
|
*/
|
|
600
621
|
export declare function getAuthLinkKey(): Promise<string>;
|
|
601
622
|
|
|
623
|
+
declare function getBrowsingHistory(): BrowsingHistory | null;
|
|
624
|
+
|
|
602
625
|
export declare function getPageContext(): PageContext | null;
|
|
603
626
|
|
|
604
627
|
export declare type HeaderActionName = "cart" | "close" | "toggleExpanded" | "toggleFullscreen" | "toggleDialogPosition" | "minimize" | "clearChat" | "endConversation" | "downloadTranscript";
|
|
@@ -1530,6 +1553,8 @@ export declare type SendMessageResult = {
|
|
|
1530
1553
|
outcome: "timeout";
|
|
1531
1554
|
};
|
|
1532
1555
|
|
|
1556
|
+
declare function setBrowsingHistory(next: BrowsingHistorySource): void;
|
|
1557
|
+
|
|
1533
1558
|
export declare function setPageContext(context: PageContext): void;
|
|
1534
1559
|
|
|
1535
1560
|
export declare interface SrpPageContext {
|
|
@@ -1733,6 +1758,287 @@ declare interface WidgetComponentConfig {
|
|
|
1733
1758
|
};
|
|
1734
1759
|
}
|
|
1735
1760
|
|
|
1761
|
+
/**
|
|
1762
|
+
* Locale-keyed catalog of every widget-owned UI string.
|
|
1763
|
+
*
|
|
1764
|
+
* Pass a partial catalog as the `messages` prop on `CopilotWidget` or
|
|
1765
|
+
* `AgentForceWidget`. Each key is optional — omitted keys fall back to
|
|
1766
|
+
* the locale catalog default and then to the bundled English default.
|
|
1767
|
+
*
|
|
1768
|
+
* String values that contain `{placeholder}` tokens are interpolated at
|
|
1769
|
+
* runtime by the widget's `interpolate(template, params)` utility before
|
|
1770
|
+
* they are rendered.
|
|
1771
|
+
*/
|
|
1772
|
+
declare interface WidgetMessageCatalog {
|
|
1773
|
+
common?: {
|
|
1774
|
+
close?: string;
|
|
1775
|
+
cancel?: string;
|
|
1776
|
+
retry?: string;
|
|
1777
|
+
dismiss?: string;
|
|
1778
|
+
remove?: string;
|
|
1779
|
+
search?: string;
|
|
1780
|
+
checkout?: string;
|
|
1781
|
+
moreOptions?: string;
|
|
1782
|
+
conversation?: string;
|
|
1783
|
+
};
|
|
1784
|
+
controls?: {
|
|
1785
|
+
/** `{componentType}` */
|
|
1786
|
+
overflowMenuAriaLabel?: string;
|
|
1787
|
+
clearChat?: string;
|
|
1788
|
+
clearChatMenu?: string;
|
|
1789
|
+
downloadTranscript?: string;
|
|
1790
|
+
endConversation?: string;
|
|
1791
|
+
toggleMinimizeAriaLabel?: string;
|
|
1792
|
+
minimize?: string;
|
|
1793
|
+
expandAriaLabel?: string;
|
|
1794
|
+
showModal?: string;
|
|
1795
|
+
collapseAriaLabel?: string;
|
|
1796
|
+
/** `{previousComponentType}` */
|
|
1797
|
+
showDialog?: string;
|
|
1798
|
+
showDialogFallback?: string;
|
|
1799
|
+
toggleFullscreen?: string;
|
|
1800
|
+
moveRight?: string;
|
|
1801
|
+
moveLeft?: string;
|
|
1802
|
+
};
|
|
1803
|
+
launcher?: {
|
|
1804
|
+
openCommerceClientAriaLabel?: string;
|
|
1805
|
+
openCopilotAriaLabel?: string;
|
|
1806
|
+
logoAlt?: string;
|
|
1807
|
+
};
|
|
1808
|
+
header?: {
|
|
1809
|
+
defaultHeaderTextCopilot?: string;
|
|
1810
|
+
defaultHeaderTextMessaging?: string;
|
|
1811
|
+
};
|
|
1812
|
+
loading?: {
|
|
1813
|
+
loadingCopilot?: string;
|
|
1814
|
+
loadingResponse?: string;
|
|
1815
|
+
reconnecting?: string;
|
|
1816
|
+
addingToCart?: string;
|
|
1817
|
+
connectingToAgent?: string;
|
|
1818
|
+
};
|
|
1819
|
+
connecting?: {
|
|
1820
|
+
/** Shown for `layoutPreset="standard"`. */
|
|
1821
|
+
default?: readonly string[];
|
|
1822
|
+
/** Shown for `layoutPreset="commerce"`. */
|
|
1823
|
+
commerce?: readonly string[];
|
|
1824
|
+
loadingShoppingAssistantAriaLabel?: string;
|
|
1825
|
+
loadingShoppingAssistantHeading?: string;
|
|
1826
|
+
connectingToAssistantAriaLabel?: string;
|
|
1827
|
+
connectedToAssistant?: string;
|
|
1828
|
+
disconnectedFromAssistant?: string;
|
|
1829
|
+
};
|
|
1830
|
+
searchBar?: {
|
|
1831
|
+
placeholderAskUsAnything?: string;
|
|
1832
|
+
placeholderAskAQuestion?: string;
|
|
1833
|
+
connectToHumanAriaLabel?: string;
|
|
1834
|
+
connectToHumanSentMessage?: string;
|
|
1835
|
+
currentPageContextAriaLabel?: string;
|
|
1836
|
+
searchCopilotAriaLabel?: string;
|
|
1837
|
+
cancelProcessingAriaLabel?: string;
|
|
1838
|
+
cancelRequestTitle?: string;
|
|
1839
|
+
sendMessageAriaLabel?: string;
|
|
1840
|
+
};
|
|
1841
|
+
imageAttachment?: {
|
|
1842
|
+
uploadImageAriaLabel?: string;
|
|
1843
|
+
removeImageLabel?: string;
|
|
1844
|
+
/** `{fileName}` */
|
|
1845
|
+
previewAlt?: string;
|
|
1846
|
+
/** `{maxImageMb}` */
|
|
1847
|
+
fileSizeExceeded?: string;
|
|
1848
|
+
fileSizeExceeded10mb?: string;
|
|
1849
|
+
unsupportedFileType?: string;
|
|
1850
|
+
fileProcessingError?: string;
|
|
1851
|
+
};
|
|
1852
|
+
prompts?: {
|
|
1853
|
+
askMeSomethingElse?: string;
|
|
1854
|
+
submitPromptAriaLabel?: string;
|
|
1855
|
+
placeholderAskCopilot?: string;
|
|
1856
|
+
placeholderAskAQuestion?: string;
|
|
1857
|
+
connectingToAgent?: string;
|
|
1858
|
+
agentError?: string;
|
|
1859
|
+
};
|
|
1860
|
+
entryMessage?: {
|
|
1861
|
+
askCimWelcome?: string;
|
|
1862
|
+
};
|
|
1863
|
+
messages?: {
|
|
1864
|
+
conversationReset?: string;
|
|
1865
|
+
startSearchPrompt?: string;
|
|
1866
|
+
genericError?: string;
|
|
1867
|
+
displayDisplayTrouble?: string;
|
|
1868
|
+
requestTrouble?: string;
|
|
1869
|
+
progressHide?: string;
|
|
1870
|
+
progressContext?: string;
|
|
1871
|
+
userProvidedContextAlt?: string;
|
|
1872
|
+
recommendedProductsAriaLabel?: string;
|
|
1873
|
+
/** `{count}` — singular */
|
|
1874
|
+
filterCountOne?: string;
|
|
1875
|
+
/** `{count}` — plural */
|
|
1876
|
+
filterCountMultiple?: string;
|
|
1877
|
+
progressStepCompleted?: string;
|
|
1878
|
+
progressStepInProgress?: string;
|
|
1879
|
+
/** `{step}`, `{status}` */
|
|
1880
|
+
progressStepAriaLabel?: string;
|
|
1881
|
+
};
|
|
1882
|
+
userQuery?: {
|
|
1883
|
+
yourSearch?: string;
|
|
1884
|
+
browsingCategory?: string;
|
|
1885
|
+
viewingProduct?: string;
|
|
1886
|
+
};
|
|
1887
|
+
product?: {
|
|
1888
|
+
/** `{name}` */
|
|
1889
|
+
goToProductPageAriaLabel?: string;
|
|
1890
|
+
/** `{name}` */
|
|
1891
|
+
viewDetailsAriaLabel?: string;
|
|
1892
|
+
productImageAlt?: string;
|
|
1893
|
+
/** `{name}` */
|
|
1894
|
+
noImageAriaLabel?: string;
|
|
1895
|
+
noProductImageAriaLabel?: string;
|
|
1896
|
+
/** `{productName}` */
|
|
1897
|
+
showMeDetailsSentMessage?: string;
|
|
1898
|
+
thisProductFallbackName?: string;
|
|
1899
|
+
/** `{low}`, `{high}` */
|
|
1900
|
+
priceFromToAriaLabel?: string;
|
|
1901
|
+
colorVariantLabel?: string;
|
|
1902
|
+
quantityLabel?: string;
|
|
1903
|
+
decreaseQuantityAriaLabel?: string;
|
|
1904
|
+
increaseQuantityAriaLabel?: string;
|
|
1905
|
+
unavailableVariant?: string;
|
|
1906
|
+
addToCart?: string;
|
|
1907
|
+
};
|
|
1908
|
+
productComparison?: {
|
|
1909
|
+
/** `{productName}` */
|
|
1910
|
+
viewDetailsAriaLabel?: string;
|
|
1911
|
+
/** `{productName}` */
|
|
1912
|
+
showDetailsSentMessage?: string;
|
|
1913
|
+
};
|
|
1914
|
+
productGallery?: {
|
|
1915
|
+
productImagesAriaLabel?: string;
|
|
1916
|
+
/** `{altText}`, `{index}` */
|
|
1917
|
+
imageAlt?: string;
|
|
1918
|
+
/** `{index}` */
|
|
1919
|
+
imageAltFallback?: string;
|
|
1920
|
+
previousImageAriaLabel?: string;
|
|
1921
|
+
nextImageAriaLabel?: string;
|
|
1922
|
+
/** `{index}` */
|
|
1923
|
+
goToImageAriaLabel?: string;
|
|
1924
|
+
};
|
|
1925
|
+
carousel?: {
|
|
1926
|
+
productCarouselAriaLabel?: string;
|
|
1927
|
+
productRecommendationsAriaLabel?: string;
|
|
1928
|
+
previousSlideAriaLabel?: string;
|
|
1929
|
+
nextSlideAriaLabel?: string;
|
|
1930
|
+
/** `{index}` */
|
|
1931
|
+
goToSlideGroupAriaLabel?: string;
|
|
1932
|
+
};
|
|
1933
|
+
price?: {
|
|
1934
|
+
currentPriceLabel?: string;
|
|
1935
|
+
originalPriceLabel?: string;
|
|
1936
|
+
};
|
|
1937
|
+
cart?: {
|
|
1938
|
+
checkout?: string;
|
|
1939
|
+
decreaseQuantityAriaLabel?: string;
|
|
1940
|
+
increaseQuantityAriaLabel?: string;
|
|
1941
|
+
quantityAriaLabel?: string;
|
|
1942
|
+
quantityHeading?: string;
|
|
1943
|
+
productImageAlt?: string;
|
|
1944
|
+
/** `{promo}` */
|
|
1945
|
+
promotionLabel?: string;
|
|
1946
|
+
remove?: string;
|
|
1947
|
+
/** `{count}` — singular */
|
|
1948
|
+
subtotalOne?: string;
|
|
1949
|
+
/** `{count}` — plural */
|
|
1950
|
+
subtotalMultiple?: string;
|
|
1951
|
+
coupon?: string;
|
|
1952
|
+
promotions?: string;
|
|
1953
|
+
shipping?: string;
|
|
1954
|
+
shippingDiscount?: string;
|
|
1955
|
+
tax?: string;
|
|
1956
|
+
estimatedTotal?: string;
|
|
1957
|
+
enterCouponCode?: string;
|
|
1958
|
+
applyCouponAriaLabel?: string;
|
|
1959
|
+
couponNotApplied?: string;
|
|
1960
|
+
shippingAndTaxesFooter?: string;
|
|
1961
|
+
/** `{orderId}` */
|
|
1962
|
+
expressCheckoutCompleteWithOrder?: string;
|
|
1963
|
+
expressCheckoutCompleteNoOrder?: string;
|
|
1964
|
+
/** `{qty}` */
|
|
1965
|
+
addToCartWithQty?: string;
|
|
1966
|
+
addToCart?: string;
|
|
1967
|
+
};
|
|
1968
|
+
orderConfirmation?: {
|
|
1969
|
+
productImageAlt?: string;
|
|
1970
|
+
/** `{promo}` */
|
|
1971
|
+
promotionLabel?: string;
|
|
1972
|
+
/** `{quantity}` */
|
|
1973
|
+
quantityLabel?: string;
|
|
1974
|
+
orderConfirmed?: string;
|
|
1975
|
+
/** `{id}` */
|
|
1976
|
+
orderNumberLabel?: string;
|
|
1977
|
+
/** `{date}` */
|
|
1978
|
+
orderedOnLabel?: string;
|
|
1979
|
+
subtotal?: string;
|
|
1980
|
+
coupon?: string;
|
|
1981
|
+
promotions?: string;
|
|
1982
|
+
shipping?: string;
|
|
1983
|
+
shippingDiscount?: string;
|
|
1984
|
+
tax?: string;
|
|
1985
|
+
total?: string;
|
|
1986
|
+
shippingAndTaxesFooter?: string;
|
|
1987
|
+
};
|
|
1988
|
+
payment?: {
|
|
1989
|
+
expressPaymentTitle?: string;
|
|
1990
|
+
paymentFailed?: string;
|
|
1991
|
+
paymentCanceled?: string;
|
|
1992
|
+
};
|
|
1993
|
+
jumpToLatest?: {
|
|
1994
|
+
jumpToLatestAriaLabel?: string;
|
|
1995
|
+
jumpToLatestTitle?: string;
|
|
1996
|
+
};
|
|
1997
|
+
attachment?: {
|
|
1998
|
+
fallbackAlt?: string;
|
|
1999
|
+
};
|
|
2000
|
+
announcements?: {
|
|
2001
|
+
assistantResponseAvailable?: string;
|
|
2002
|
+
noProductsFound?: string;
|
|
2003
|
+
/** `{count}` — singular */
|
|
2004
|
+
productsFoundOne?: string;
|
|
2005
|
+
/** `{count}` — plural */
|
|
2006
|
+
productsFoundMultiple?: string;
|
|
2007
|
+
/** singular */
|
|
2008
|
+
productTitleLabelOne?: string;
|
|
2009
|
+
/** plural */
|
|
2010
|
+
productTitleLabelMultiple?: string;
|
|
2011
|
+
};
|
|
2012
|
+
pageContext?: {
|
|
2013
|
+
/** `{label}` */
|
|
2014
|
+
stopAskingAboutAriaLabel?: string;
|
|
2015
|
+
/** `{label}` */
|
|
2016
|
+
askAboutPlaceholder?: string;
|
|
2017
|
+
/** `{query}` */
|
|
2018
|
+
searchDisplayLabel?: string;
|
|
2019
|
+
/** `{query}` */
|
|
2020
|
+
removeSearchContextAriaLabel?: string;
|
|
2021
|
+
searchPlaceholder?: string;
|
|
2022
|
+
/** `{label}` */
|
|
2023
|
+
searchDividerLabel?: string;
|
|
2024
|
+
};
|
|
2025
|
+
errors?: {
|
|
2026
|
+
genericRetry?: string;
|
|
2027
|
+
rateLimited?: string;
|
|
2028
|
+
offline?: string;
|
|
2029
|
+
messagingUnavailable?: string;
|
|
2030
|
+
};
|
|
2031
|
+
session?: {
|
|
2032
|
+
sessionEnded?: string;
|
|
2033
|
+
conversationEnded?: string;
|
|
2034
|
+
/** `{name}` */
|
|
2035
|
+
participantJoined?: string;
|
|
2036
|
+
/** `{name}` */
|
|
2037
|
+
participantLeft?: string;
|
|
2038
|
+
participantFallbackName?: string;
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
|
|
1736
2042
|
/**
|
|
1737
2043
|
* Widget operating mode.
|
|
1738
2044
|
* - 'copilot' (default): Uses the Cimulate Copilot SDK (Socket.IO)
|