@burdenoff/website-sdk 2026.923.3 → 2026.924.2
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.d.mts +1 -1
- package/dist/components/explore.d.ts +1 -1
- package/dist/components/explore.js +17 -0
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +17 -2
- package/dist/components/explore.mjs.map +1 -1
- package/dist/{explore-I4QnY4J9.d.ts → explore-C3SEP5K6.d.ts} +12 -1
- package/dist/{explore-D25zoXy9.d.mts → explore-Crc41y0j.d.mts} +12 -1
- package/dist/index.d.mts +36 -4
- package/dist/index.d.ts +36 -4
- package/dist/index.js +295 -143
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +294 -145
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createContext, useMemo, useState, useRef,
|
|
2
|
+
import { createContext, useMemo, useState, useRef, useEffect, useCallback, useContext, Children, isValidElement, cloneElement } from 'react';
|
|
3
3
|
import { Sparkles, RotateCcw, Link2, History, Trash2, Paperclip, X, Mic, Square, ArrowUp, BookOpenText, Layers, TriangleAlert, ChevronLeft, ChevronRight, ExternalLink, Check, Copy, ThumbsUp, ThumbsDown, Volume2 } from 'lucide-react';
|
|
4
4
|
import ReactMarkdown from 'react-markdown';
|
|
5
5
|
import rehypeSanitize from 'rehype-sanitize';
|
|
@@ -5653,6 +5653,13 @@ function WelcomeState({
|
|
|
5653
5653
|
)
|
|
5654
5654
|
] });
|
|
5655
5655
|
}
|
|
5656
|
+
var EXPLORE_PREFILL_MAX_LENGTH = 500;
|
|
5657
|
+
function exploreQuestionHref(question, base = "/explore") {
|
|
5658
|
+
const trimmed = question.trim().slice(0, EXPLORE_PREFILL_MAX_LENGTH);
|
|
5659
|
+
if (!trimmed) return base;
|
|
5660
|
+
const joiner = base.includes("?") ? "&" : "?";
|
|
5661
|
+
return `${base}${joiner}q=${encodeURIComponent(trimmed)}`;
|
|
5662
|
+
}
|
|
5656
5663
|
function ExplorePage({
|
|
5657
5664
|
seo,
|
|
5658
5665
|
productSlug,
|
|
@@ -5712,6 +5719,14 @@ function ExplorePage({
|
|
|
5712
5719
|
});
|
|
5713
5720
|
const [draft, setDraft] = useState("");
|
|
5714
5721
|
const textareaRef = useRef(null);
|
|
5722
|
+
useEffect(() => {
|
|
5723
|
+
if (typeof window === "undefined") return;
|
|
5724
|
+
const params = new URLSearchParams(window.location.search);
|
|
5725
|
+
if (params.has("c")) return;
|
|
5726
|
+
const question = params.get("q")?.trim();
|
|
5727
|
+
if (!question) return;
|
|
5728
|
+
setDraft(question.slice(0, EXPLORE_PREFILL_MAX_LENGTH));
|
|
5729
|
+
}, []);
|
|
5715
5730
|
const [historyOpen, setHistoryOpen] = useState(false);
|
|
5716
5731
|
const speechStopRef = useRef(() => void 0);
|
|
5717
5732
|
const stopDictation = useCallback(() => {
|
|
@@ -6630,6 +6645,6 @@ function ExplorePage({
|
|
|
6630
6645
|
);
|
|
6631
6646
|
}
|
|
6632
6647
|
|
|
6633
|
-
export { ExplorePage, answerPlainText, answerSpeechText, inlineImageOrigins, isInlineImageAllowed, logoUrlOf, productNamesByOrigin, referenceKindOf, summariseReferences };
|
|
6648
|
+
export { EXPLORE_PREFILL_MAX_LENGTH, ExplorePage, answerPlainText, answerSpeechText, exploreQuestionHref, inlineImageOrigins, isInlineImageAllowed, logoUrlOf, productNamesByOrigin, referenceKindOf, summariseReferences };
|
|
6634
6649
|
//# sourceMappingURL=explore.mjs.map
|
|
6635
6650
|
//# sourceMappingURL=explore.mjs.map
|