@burdenoff/website-sdk 2026.829.8 → 2026.830.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/dist/components/explore.js +63 -28
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +63 -28
- package/dist/components/explore.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +19 -6
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +19 -6
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +63 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +63 -28
- package/dist/index.mjs.map +1 -1
- package/dist/{use-explore-chat-BzXCz2UM.d.mts → use-explore-chat-B8xKGid5.d.mts} +13 -1
- package/dist/{use-explore-chat-BzXCz2UM.d.ts → use-explore-chat-B8xKGid5.d.ts} +13 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -18,7 +18,7 @@ export { ProblemSolved, ProblemsSolvedSection, ProblemsSolvedSectionProps } from
|
|
|
18
18
|
export { DetectedPlatform, ElectronDownloadLink, ElectronDownloadLinkProps, detectElectronPlatform } from './components/electron-download.mjs';
|
|
19
19
|
export { ExplorePage, ExplorePageProps } from './components/explore.mjs';
|
|
20
20
|
export { ExploreCta, ExploreCtaProps } from './components/explore-cta.mjs';
|
|
21
|
-
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, e as EXPLORE_CATALOG_QUERY, f as EXPLORE_MESSAGE_QUERY, g as ExploreCatalog, h as ExploreCatalogQueryData, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, i as ExploreConversation, j as ExploreCtaKind, k as ExploreCtaLink, l as ExploreErrorCode, m as ExploreLimits, n as ExploreMessage, o as ExploreMessageQueryData, p as ExploreMessageRole, q as ExploreMessageStatus, r as ExploreProduct, s as ExploreReference, F as FALLBACK_EXPLORE_LIMITS, S as SEND_EXPLORE_MESSAGE_MUTATION, t as SendExploreMessageInput, v as SendExploreMessageMutationData, w as SendExploreMessageResult, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from './use-explore-chat-
|
|
21
|
+
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, e as EXPLORE_CATALOG_QUERY, f as EXPLORE_MESSAGE_QUERY, g as ExploreCatalog, h as ExploreCatalogQueryData, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, i as ExploreConversation, j as ExploreCtaKind, k as ExploreCtaLink, l as ExploreErrorCode, m as ExploreLimits, n as ExploreMessage, o as ExploreMessageQueryData, p as ExploreMessageRole, q as ExploreMessageStatus, r as ExploreProduct, s as ExploreReference, F as FALLBACK_EXPLORE_LIMITS, S as SEND_EXPLORE_MESSAGE_MUTATION, t as SendExploreMessageInput, v as SendExploreMessageMutationData, w as SendExploreMessageResult, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from './use-explore-chat-B8xKGid5.mjs';
|
|
22
22
|
export { RybbitAnalytics, RybbitAnalyticsProps } from './analytics/index.mjs';
|
|
23
23
|
export { PageHead, PageHeadProps } from './seo/index.mjs';
|
|
24
24
|
export { ProductData, ProductProvider, ProductProviderProps, useProduct, useProductConfig } from './product/index.mjs';
|
|
@@ -62,7 +62,7 @@ declare function CareersSubmissionForm({ productName, recaptchaSiteKey, postings
|
|
|
62
62
|
|
|
63
63
|
declare const buttonVariants: (props?: ({
|
|
64
64
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
65
|
-
size?: "
|
|
65
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
66
66
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
67
67
|
interface ButtonProps extends react.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
68
68
|
asChild?: boolean;
|
|
@@ -143,6 +143,7 @@ interface ExploreStrings {
|
|
|
143
143
|
attachmentTooLarge: string;
|
|
144
144
|
attachmentTooMany: string;
|
|
145
145
|
noAnswer: string;
|
|
146
|
+
answerDidNotArrive: string;
|
|
146
147
|
askHuman: string;
|
|
147
148
|
prevSuggestion: string;
|
|
148
149
|
nextSuggestion: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export { ProblemSolved, ProblemsSolvedSection, ProblemsSolvedSectionProps } from
|
|
|
18
18
|
export { DetectedPlatform, ElectronDownloadLink, ElectronDownloadLinkProps, detectElectronPlatform } from './components/electron-download.js';
|
|
19
19
|
export { ExplorePage, ExplorePageProps } from './components/explore.js';
|
|
20
20
|
export { ExploreCta, ExploreCtaProps } from './components/explore-cta.js';
|
|
21
|
-
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, e as EXPLORE_CATALOG_QUERY, f as EXPLORE_MESSAGE_QUERY, g as ExploreCatalog, h as ExploreCatalogQueryData, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, i as ExploreConversation, j as ExploreCtaKind, k as ExploreCtaLink, l as ExploreErrorCode, m as ExploreLimits, n as ExploreMessage, o as ExploreMessageQueryData, p as ExploreMessageRole, q as ExploreMessageStatus, r as ExploreProduct, s as ExploreReference, F as FALLBACK_EXPLORE_LIMITS, S as SEND_EXPLORE_MESSAGE_MUTATION, t as SendExploreMessageInput, v as SendExploreMessageMutationData, w as SendExploreMessageResult, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from './use-explore-chat-
|
|
21
|
+
export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, e as EXPLORE_CATALOG_QUERY, f as EXPLORE_MESSAGE_QUERY, g as ExploreCatalog, h as ExploreCatalogQueryData, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, i as ExploreConversation, j as ExploreCtaKind, k as ExploreCtaLink, l as ExploreErrorCode, m as ExploreLimits, n as ExploreMessage, o as ExploreMessageQueryData, p as ExploreMessageRole, q as ExploreMessageStatus, r as ExploreProduct, s as ExploreReference, F as FALLBACK_EXPLORE_LIMITS, S as SEND_EXPLORE_MESSAGE_MUTATION, t as SendExploreMessageInput, v as SendExploreMessageMutationData, w as SendExploreMessageResult, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from './use-explore-chat-B8xKGid5.js';
|
|
22
22
|
export { RybbitAnalytics, RybbitAnalyticsProps } from './analytics/index.js';
|
|
23
23
|
export { PageHead, PageHeadProps } from './seo/index.js';
|
|
24
24
|
export { ProductData, ProductProvider, ProductProviderProps, useProduct, useProductConfig } from './product/index.js';
|
|
@@ -62,7 +62,7 @@ declare function CareersSubmissionForm({ productName, recaptchaSiteKey, postings
|
|
|
62
62
|
|
|
63
63
|
declare const buttonVariants: (props?: ({
|
|
64
64
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
65
|
-
size?: "
|
|
65
|
+
size?: "icon" | "default" | "sm" | "lg" | null | undefined;
|
|
66
66
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
67
67
|
interface ButtonProps extends react.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
68
68
|
asChild?: boolean;
|
|
@@ -143,6 +143,7 @@ interface ExploreStrings {
|
|
|
143
143
|
attachmentTooLarge: string;
|
|
144
144
|
attachmentTooMany: string;
|
|
145
145
|
noAnswer: string;
|
|
146
|
+
answerDidNotArrive: string;
|
|
146
147
|
askHuman: string;
|
|
147
148
|
prevSuggestion: string;
|
|
148
149
|
nextSuggestion: string;
|
package/dist/index.js
CHANGED
|
@@ -4805,6 +4805,7 @@ var EN = {
|
|
|
4805
4805
|
attachmentTooLarge: "{{name}} is larger than {{size}} MB and was not attached.",
|
|
4806
4806
|
attachmentTooMany: "Only {{max}} files can be attached, so {{name}} was skipped.",
|
|
4807
4807
|
noAnswer: "I couldn't find this in our documentation, so the answer below is not grounded in a source. Try rephrasing, or",
|
|
4808
|
+
answerDidNotArrive: "That answer didn't come through. Try asking again.",
|
|
4808
4809
|
askHuman: "ask a human",
|
|
4809
4810
|
prevSuggestion: "Previous suggestion",
|
|
4810
4811
|
nextSuggestion: "Next suggestion",
|
|
@@ -4853,6 +4854,7 @@ var ZH = {
|
|
|
4853
4854
|
attachmentTooLarge: "{{name}} \u8D85\u8FC7 {{size}} MB\uFF0C\u672A\u80FD\u6DFB\u52A0\u3002",
|
|
4854
4855
|
attachmentTooMany: "\u6700\u591A\u53EA\u80FD\u6DFB\u52A0 {{max}} \u4E2A\u6587\u4EF6\uFF0C\u5DF2\u8DF3\u8FC7 {{name}}\u3002",
|
|
4855
4856
|
noAnswer: "\u6211\u5728\u6587\u6863\u4E2D\u6CA1\u6709\u627E\u5230\u76F8\u5173\u5185\u5BB9\uFF0C\u4E0B\u9762\u7684\u56DE\u7B54\u6CA1\u6709\u6765\u6E90\u652F\u6301\u3002\u8BF7\u6362\u4E2A\u8BF4\u6CD5\uFF0C\u6216",
|
|
4857
|
+
answerDidNotArrive: "\u8FD9\u6761\u56DE\u7B54\u6CA1\u6709\u8FD4\u56DE\u3002\u8BF7\u518D\u95EE\u4E00\u6B21\u3002",
|
|
4856
4858
|
askHuman: "\u8054\u7CFB\u6211\u4EEC",
|
|
4857
4859
|
prevSuggestion: "\u4E0A\u4E00\u4E2A\u5EFA\u8BAE",
|
|
4858
4860
|
nextSuggestion: "\u4E0B\u4E00\u4E2A\u5EFA\u8BAE",
|
|
@@ -4897,6 +4899,7 @@ var HI = {
|
|
|
4897
4899
|
attachmentTooLarge: "{{name}} {{size}} MB \u0938\u0947 \u092C\u0921\u093C\u0940 \u0939\u0948, \u0907\u0938\u0932\u093F\u090F \u091C\u094B\u0921\u093C\u0940 \u0928\u0939\u0940\u0902 \u0917\u0908\u0964",
|
|
4898
4900
|
attachmentTooMany: "\u0915\u0947\u0935\u0932 {{max}} \u092B\u093C\u093E\u0907\u0932\u0947\u0902 \u091C\u094B\u0921\u093C\u0940 \u091C\u093E \u0938\u0915\u0924\u0940 \u0939\u0948\u0902, \u0907\u0938\u0932\u093F\u090F {{name}} \u091B\u094B\u0921\u093C \u0926\u0940 \u0917\u0908\u0964",
|
|
4899
4901
|
noAnswer: "\u092F\u0939 \u092E\u0941\u091D\u0947 \u0939\u092E\u093E\u0930\u0947 \u0926\u0938\u094D\u0924\u093E\u0935\u0947\u091C\u093C\u094B\u0902 \u092E\u0947\u0902 \u0928\u0939\u0940\u0902 \u092E\u093F\u0932\u093E, \u0907\u0938\u0932\u093F\u090F \u0928\u0940\u091A\u0947 \u0926\u093F\u092F\u093E \u0909\u0924\u094D\u0924\u0930 \u0915\u093F\u0938\u0940 \u0938\u094D\u0930\u094B\u0924 \u092A\u0930 \u0906\u0927\u093E\u0930\u093F\u0924 \u0928\u0939\u0940\u0902 \u0939\u0948\u0964 \u0926\u0942\u0938\u0930\u0947 \u0936\u092C\u094D\u0926\u094B\u0902 \u092E\u0947\u0902 \u092A\u0942\u091B\u0947\u0902, \u092F\u093E",
|
|
4902
|
+
answerDidNotArrive: "\u0935\u0939 \u0909\u0924\u094D\u0924\u0930 \u0928\u0939\u0940\u0902 \u0906 \u0938\u0915\u093E\u0964 \u0915\u0943\u092A\u092F\u093E \u0926\u094B\u092C\u093E\u0930\u093E \u092A\u0942\u091B\u0947\u0902\u0964",
|
|
4900
4903
|
askHuman: "\u0939\u092E\u0938\u0947 \u0938\u0902\u092A\u0930\u094D\u0915 \u0915\u0930\u0947\u0902",
|
|
4901
4904
|
prevSuggestion: "\u092A\u093F\u091B\u0932\u093E \u0938\u0941\u091D\u093E\u0935",
|
|
4902
4905
|
nextSuggestion: "\u0905\u0917\u0932\u093E \u0938\u0941\u091D\u093E\u0935",
|
|
@@ -4945,6 +4948,7 @@ var ES = {
|
|
|
4945
4948
|
attachmentTooLarge: "{{name}} supera los {{size}} MB y no se adjunt\xF3.",
|
|
4946
4949
|
attachmentTooMany: "Solo se pueden adjuntar {{max}} archivos, as\xED que se omiti\xF3 {{name}}.",
|
|
4947
4950
|
noAnswer: "No he encontrado esto en nuestra documentaci\xF3n, as\xED que la respuesta de abajo no se apoya en ninguna fuente. Prueba a reformularla, o",
|
|
4951
|
+
answerDidNotArrive: "Esa respuesta no lleg\xF3. Int\xE9ntalo de nuevo.",
|
|
4948
4952
|
askHuman: "habla con una persona",
|
|
4949
4953
|
prevSuggestion: "Sugerencia anterior",
|
|
4950
4954
|
nextSuggestion: "Sugerencia siguiente",
|
|
@@ -4993,6 +4997,7 @@ var AR = {
|
|
|
4993
4997
|
attachmentTooLarge: "{{name}} \u0623\u0643\u0628\u0631 \u0645\u0646 {{size}} \u0645\u064A\u063A\u0627\u0628\u0627\u064A\u062A \u0648\u0644\u0645 \u064A\u062A\u0645 \u0625\u0631\u0641\u0627\u0642\u0647.",
|
|
4994
4998
|
attachmentTooMany: "\u064A\u0645\u0643\u0646 \u0625\u0631\u0641\u0627\u0642 {{max}} \u0645\u0644\u0641\u0627\u062A \u0641\u0642\u0637\u060C \u0644\u0630\u0627 \u062A\u0645 \u062A\u062E\u0637\u064A {{name}}.",
|
|
4995
4999
|
noAnswer: "\u0644\u0645 \u0623\u062C\u062F \u0647\u0630\u0627 \u0641\u064A \u0648\u062B\u0627\u0626\u0642\u0646\u0627\u060C \u0644\u0630\u0627 \u0641\u0627\u0644\u0625\u062C\u0627\u0628\u0629 \u0623\u062F\u0646\u0627\u0647 \u063A\u064A\u0631 \u0645\u0633\u062A\u0646\u062F\u0629 \u0625\u0644\u0649 \u0645\u0635\u062F\u0631. \u062D\u0627\u0648\u0644 \u0625\u0639\u0627\u062F\u0629 \u0627\u0644\u0635\u064A\u0627\u063A\u0629\u060C \u0623\u0648",
|
|
5000
|
+
answerDidNotArrive: "\u0644\u0645 \u062A\u0635\u0644 \u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629. \u064A\u0631\u062C\u0649 \u0627\u0644\u0645\u062D\u0627\u0648\u0644\u0629 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649.",
|
|
4996
5001
|
askHuman: "\u062A\u062D\u062F\u0651\u062B \u0625\u0644\u0649 \u0634\u062E\u0635",
|
|
4997
5002
|
prevSuggestion: "\u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u0633\u0627\u0628\u0642",
|
|
4998
5003
|
nextSuggestion: "\u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u062A\u0627\u0644\u064A",
|
|
@@ -5041,6 +5046,7 @@ var TA = {
|
|
|
5041
5046
|
attachmentTooLarge: "{{name}} {{size}} MB-\u0B90 \u0BB5\u0BBF\u0B9F \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1, \u0B8E\u0BA9\u0BB5\u0BC7 \u0B87\u0BA3\u0BC8\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BB5\u0BBF\u0BB2\u0BCD\u0BB2\u0BC8.",
|
|
5042
5047
|
attachmentTooMany: "{{max}} \u0B95\u0BCB\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD \u0BAE\u0B9F\u0BCD\u0B9F\u0BC1\u0BAE\u0BC7 \u0B87\u0BA3\u0BC8\u0B95\u0BCD\u0B95 \u0BAE\u0BC1\u0B9F\u0BBF\u0BAF\u0BC1\u0BAE\u0BCD, \u0B8E\u0BA9\u0BB5\u0BC7 {{name}} \u0BA4\u0BB5\u0BBF\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1.",
|
|
5043
5048
|
noAnswer: "\u0B87\u0BA4\u0BC1 \u0B8E\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0B86\u0BB5\u0BA3\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BCD \u0B95\u0BBF\u0B9F\u0BC8\u0B95\u0BCD\u0B95\u0BB5\u0BBF\u0BB2\u0BCD\u0BB2\u0BC8, \u0B8E\u0BA9\u0BB5\u0BC7 \u0B95\u0BC0\u0BB4\u0BC7 \u0B89\u0BB3\u0BCD\u0BB3 \u0BAA\u0BA4\u0BBF\u0BB2\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BC2\u0BB2\u0BAE\u0BCD \u0B87\u0BB2\u0BCD\u0BB2\u0BC8. \u0BB5\u0BC7\u0BB1\u0BC1 \u0BB5\u0B95\u0BC8\u0BAF\u0BBF\u0BB2\u0BCD \u0B95\u0BC7\u0BB3\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD, \u0B85\u0BB2\u0BCD\u0BB2\u0BA4\u0BC1",
|
|
5049
|
+
answerDidNotArrive: "\u0B85\u0BA8\u0BCD\u0BA4\u0BAA\u0BCD \u0BAA\u0BA4\u0BBF\u0BB2\u0BCD \u0BB5\u0BB0\u0BB5\u0BBF\u0BB2\u0BCD\u0BB2\u0BC8. \u0BAE\u0BC0\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD \u0B95\u0BC7\u0B9F\u0BCD\u0B9F\u0BC1\u0BAA\u0BCD \u0BAA\u0BBE\u0BB0\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD.",
|
|
5044
5050
|
askHuman: "\u0B8E\u0B99\u0BCD\u0B95\u0BB3\u0BC8\u0BA4\u0BCD \u0BA4\u0BCA\u0B9F\u0BB0\u0BCD\u0BAA\u0BC1 \u0B95\u0BCA\u0BB3\u0BCD\u0BB3\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
|
|
5045
5051
|
prevSuggestion: "\u0BAE\u0BC1\u0BA8\u0BCD\u0BA4\u0BC8\u0BAF \u0BAA\u0BB0\u0BBF\u0BA8\u0BCD\u0BA4\u0BC1\u0BB0\u0BC8",
|
|
5046
5052
|
nextSuggestion: "\u0B85\u0B9F\u0BC1\u0BA4\u0BCD\u0BA4 \u0BAA\u0BB0\u0BBF\u0BA8\u0BCD\u0BA4\u0BC1\u0BB0\u0BC8",
|
|
@@ -5656,7 +5662,7 @@ var DEFAULT_EXPLORE_EXAMPLE_PROMPTS = [
|
|
|
5656
5662
|
];
|
|
5657
5663
|
var FALLBACK_WELCOME_TITLE = "Ask anything about our products";
|
|
5658
5664
|
var FALLBACK_WELCOME_BODY = "Get straight answers drawn from our product documentation and public pages \u2014 with links back to the exact page each answer came from.";
|
|
5659
|
-
function buildFallbackCatalog(examplePrompts) {
|
|
5665
|
+
function buildFallbackCatalog(examplePrompts, welcome) {
|
|
5660
5666
|
return {
|
|
5661
5667
|
enabled: true,
|
|
5662
5668
|
products: ECOSYSTEM_PRODUCTS.map((p) => ({
|
|
@@ -5666,8 +5672,8 @@ function buildFallbackCatalog(examplePrompts) {
|
|
|
5666
5672
|
website: p.websiteUrl
|
|
5667
5673
|
})),
|
|
5668
5674
|
examplePrompts: examplePrompts?.length ? examplePrompts : DEFAULT_EXPLORE_EXAMPLE_PROMPTS,
|
|
5669
|
-
welcomeTitle: FALLBACK_WELCOME_TITLE,
|
|
5670
|
-
welcomeBody: FALLBACK_WELCOME_BODY,
|
|
5675
|
+
welcomeTitle: welcome?.title ?? FALLBACK_WELCOME_TITLE,
|
|
5676
|
+
welcomeBody: welcome?.body ?? FALLBACK_WELCOME_BODY,
|
|
5671
5677
|
limits: FALLBACK_EXPLORE_LIMITS,
|
|
5672
5678
|
captchaRequired: false,
|
|
5673
5679
|
recaptchaSiteKey: null
|
|
@@ -5727,7 +5733,15 @@ function classifyExploreError(code, serverMessage) {
|
|
|
5727
5733
|
retryable: true
|
|
5728
5734
|
};
|
|
5729
5735
|
}
|
|
5730
|
-
if (c === "
|
|
5736
|
+
if (c === "TOOL_BUDGET") {
|
|
5737
|
+
return {
|
|
5738
|
+
kind: "scope",
|
|
5739
|
+
code: c,
|
|
5740
|
+
message: "That question spans more of our products than I can look through in one go. Try asking about two or three specific products.",
|
|
5741
|
+
retryable: false
|
|
5742
|
+
};
|
|
5743
|
+
}
|
|
5744
|
+
if (c === "TIMEOUT") {
|
|
5731
5745
|
return {
|
|
5732
5746
|
kind: "timeout",
|
|
5733
5747
|
code: c,
|
|
@@ -5859,6 +5873,7 @@ function useExploreChat(options = {}) {
|
|
|
5859
5873
|
pageUrl,
|
|
5860
5874
|
locale,
|
|
5861
5875
|
examplePrompts,
|
|
5876
|
+
fallbackWelcome,
|
|
5862
5877
|
pollIntervalMs = DEFAULT_POLL_INTERVAL_MS,
|
|
5863
5878
|
pollTimeoutMs = DEFAULT_POLL_TIMEOUT_MS,
|
|
5864
5879
|
storageKey = DEFAULT_STORAGE_KEY,
|
|
@@ -5867,9 +5882,13 @@ function useExploreChat(options = {}) {
|
|
|
5867
5882
|
} = options;
|
|
5868
5883
|
const client = useWebSDK();
|
|
5869
5884
|
const promptKey = JSON.stringify(examplePrompts ?? []);
|
|
5885
|
+
const welcomeKey = JSON.stringify(fallbackWelcome ?? null);
|
|
5870
5886
|
const fallbackCatalog = React.useMemo(
|
|
5871
|
-
() => buildFallbackCatalog(
|
|
5872
|
-
|
|
5887
|
+
() => buildFallbackCatalog(
|
|
5888
|
+
JSON.parse(promptKey),
|
|
5889
|
+
JSON.parse(welcomeKey) ?? void 0
|
|
5890
|
+
),
|
|
5891
|
+
[promptKey, welcomeKey]
|
|
5873
5892
|
);
|
|
5874
5893
|
const [catalog, setCatalog] = React.useState(fallbackCatalog);
|
|
5875
5894
|
const [messages, setMessages] = React.useState([]);
|
|
@@ -7244,7 +7263,7 @@ function AssistantBubble({
|
|
|
7244
7263
|
children: [
|
|
7245
7264
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.TriangleAlert, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400" }),
|
|
7246
7265
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
7247
|
-
|
|
7266
|
+
T.noAnswer,
|
|
7248
7267
|
" ",
|
|
7249
7268
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7250
7269
|
"a",
|
|
@@ -7269,7 +7288,7 @@ function AssistantBubble({
|
|
|
7269
7288
|
streaming ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "boff-explore-caret", "aria-hidden": "true" }) : null
|
|
7270
7289
|
] }) : null,
|
|
7271
7290
|
streaming ? /* @__PURE__ */ jsxRuntime.jsx(ThinkingIndicator, { activity }) : null,
|
|
7272
|
-
failed && !body ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-2xl rounded-tl-md border border-border bg-muted px-4 py-3 text-sm text-muted-foreground", children:
|
|
7291
|
+
failed && !body ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-2xl rounded-tl-md border border-border bg-muted px-4 py-3 text-sm text-muted-foreground", children: T.answerDidNotArrive }) : null,
|
|
7273
7292
|
message.references.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7274
7293
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: T.sources }),
|
|
7275
7294
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3", children: message.references.map((reference) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7685,6 +7704,12 @@ function ExplorePage({
|
|
|
7685
7704
|
() => typeof window === "undefined" ? void 0 : window.location.href,
|
|
7686
7705
|
[]
|
|
7687
7706
|
);
|
|
7707
|
+
const activeLocale = React.useMemo(
|
|
7708
|
+
() => resolveExploreLocale(locale),
|
|
7709
|
+
[locale]
|
|
7710
|
+
);
|
|
7711
|
+
const T = React.useMemo(() => exploreStrings(activeLocale), [activeLocale]);
|
|
7712
|
+
const rtl = isRtlLocale(activeLocale);
|
|
7688
7713
|
const {
|
|
7689
7714
|
phase,
|
|
7690
7715
|
catalog,
|
|
@@ -7706,7 +7731,15 @@ function ExplorePage({
|
|
|
7706
7731
|
recordClick,
|
|
7707
7732
|
createShareLink,
|
|
7708
7733
|
isSharedView
|
|
7709
|
-
} = useExploreChat({
|
|
7734
|
+
} = useExploreChat({
|
|
7735
|
+
productSlug,
|
|
7736
|
+
pageUrl,
|
|
7737
|
+
onSend,
|
|
7738
|
+
// Locale-aware, so a catalog outage degrades to a translated welcome rather than an
|
|
7739
|
+
// English one. `T.prompts` seeds the chips the same way.
|
|
7740
|
+
examplePrompts: examplePrompts ?? T.prompts,
|
|
7741
|
+
fallbackWelcome: { title: T.welcomeTitle, body: T.welcomeBody }
|
|
7742
|
+
});
|
|
7710
7743
|
const [draft, setDraft] = React.useState("");
|
|
7711
7744
|
const textareaRef = React.useRef(null);
|
|
7712
7745
|
const [historyOpen, setHistoryOpen] = React.useState(false);
|
|
@@ -7724,12 +7757,6 @@ function ExplorePage({
|
|
|
7724
7757
|
}
|
|
7725
7758
|
});
|
|
7726
7759
|
speechStopRef.current = speech.stop;
|
|
7727
|
-
const activeLocale = React.useMemo(
|
|
7728
|
-
() => resolveExploreLocale(locale),
|
|
7729
|
-
[locale]
|
|
7730
|
-
);
|
|
7731
|
-
const T = React.useMemo(() => exploreStrings(activeLocale), [activeLocale]);
|
|
7732
|
-
const rtl = isRtlLocale(activeLocale);
|
|
7733
7760
|
const [disclaimerOpen, setDisclaimerOpen] = React.useState(false);
|
|
7734
7761
|
const [staged, setStaged] = React.useState([]);
|
|
7735
7762
|
const [attachmentNotice, setAttachmentNotice] = React.useState(null);
|
|
@@ -7737,7 +7764,7 @@ function ExplorePage({
|
|
|
7737
7764
|
const stagedRef = React.useRef([]);
|
|
7738
7765
|
stagedRef.current = staged;
|
|
7739
7766
|
const pickQueueRef = React.useRef(Promise.resolve());
|
|
7740
|
-
const [shareLabel, setShareLabel] = React.useState(
|
|
7767
|
+
const [shareLabel, setShareLabel] = React.useState(T.share);
|
|
7741
7768
|
const [shareUrl, setShareUrl] = React.useState(null);
|
|
7742
7769
|
const scrollRef = React.useRef(null);
|
|
7743
7770
|
const latestAssistantRef = React.useRef(null);
|
|
@@ -7794,12 +7821,12 @@ function ExplorePage({
|
|
|
7794
7821
|
el.scrollTop = el.scrollHeight;
|
|
7795
7822
|
}, [activity, latestAssistantId, messages]);
|
|
7796
7823
|
const handleShare = React.useCallback(async () => {
|
|
7797
|
-
setShareLabel(
|
|
7824
|
+
setShareLabel(T.copying);
|
|
7798
7825
|
setShareUrl(null);
|
|
7799
7826
|
const token = await createShareLink();
|
|
7800
7827
|
if (!token) {
|
|
7801
|
-
setShareLabel(
|
|
7802
|
-
setTimeout(() => setShareLabel(
|
|
7828
|
+
setShareLabel(T.shareUnavailable);
|
|
7829
|
+
setTimeout(() => setShareLabel(T.share), 2500);
|
|
7803
7830
|
return;
|
|
7804
7831
|
}
|
|
7805
7832
|
const url = new URL(pageUrl ?? window.location.href);
|
|
@@ -7809,13 +7836,20 @@ function ExplorePage({
|
|
|
7809
7836
|
const shareable = url.toString();
|
|
7810
7837
|
try {
|
|
7811
7838
|
await navigator.clipboard.writeText(shareable);
|
|
7812
|
-
setShareLabel(
|
|
7813
|
-
setTimeout(() => setShareLabel(
|
|
7839
|
+
setShareLabel(T.copied);
|
|
7840
|
+
setTimeout(() => setShareLabel(T.share), 2500);
|
|
7814
7841
|
} catch {
|
|
7815
7842
|
setShareUrl(shareable);
|
|
7816
|
-
setShareLabel(
|
|
7843
|
+
setShareLabel(T.share);
|
|
7817
7844
|
}
|
|
7818
|
-
}, [
|
|
7845
|
+
}, [
|
|
7846
|
+
createShareLink,
|
|
7847
|
+
pageUrl,
|
|
7848
|
+
T.copied,
|
|
7849
|
+
T.copying,
|
|
7850
|
+
T.share,
|
|
7851
|
+
T.shareUnavailable
|
|
7852
|
+
]);
|
|
7819
7853
|
const handleFilesPicked = React.useCallback(
|
|
7820
7854
|
(picked) => {
|
|
7821
7855
|
if (!picked || picked.length === 0) return pickQueueRef.current;
|
|
@@ -7931,7 +7965,7 @@ function ExplorePage({
|
|
|
7931
7965
|
onClick: reset,
|
|
7932
7966
|
children: [
|
|
7933
7967
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "h-3.5 w-3.5" }),
|
|
7934
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children:
|
|
7968
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: T.newChat })
|
|
7935
7969
|
]
|
|
7936
7970
|
}
|
|
7937
7971
|
),
|
|
@@ -7968,7 +8002,8 @@ function ExplorePage({
|
|
|
7968
8002
|
children: [
|
|
7969
8003
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.History, { className: "h-3.5 w-3.5" }),
|
|
7970
8004
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "hidden sm:inline", children: [
|
|
7971
|
-
|
|
8005
|
+
T.history,
|
|
8006
|
+
" (",
|
|
7972
8007
|
history.length,
|
|
7973
8008
|
")"
|
|
7974
8009
|
] })
|
|
@@ -7998,7 +8033,7 @@ function ExplorePage({
|
|
|
7998
8033
|
},
|
|
7999
8034
|
children: [
|
|
8000
8035
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-3.5 w-3.5" }),
|
|
8001
|
-
|
|
8036
|
+
T.clearHistory
|
|
8002
8037
|
]
|
|
8003
8038
|
}
|
|
8004
8039
|
)
|
|
@@ -8264,7 +8299,7 @@ function ExplorePage({
|
|
|
8264
8299
|
type: "button",
|
|
8265
8300
|
size: "icon",
|
|
8266
8301
|
variant: "secondary",
|
|
8267
|
-
"aria-label":
|
|
8302
|
+
"aria-label": T.stop,
|
|
8268
8303
|
onClick: stop,
|
|
8269
8304
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "h-4 w-4" })
|
|
8270
8305
|
}
|
|
@@ -8275,7 +8310,7 @@ function ExplorePage({
|
|
|
8275
8310
|
type: "submit",
|
|
8276
8311
|
size: "icon",
|
|
8277
8312
|
disabled: !canSubmit,
|
|
8278
|
-
"aria-label":
|
|
8313
|
+
"aria-label": T.send,
|
|
8279
8314
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUp, { className: "h-4 w-4" })
|
|
8280
8315
|
}
|
|
8281
8316
|
)
|