@burdenoff/website-sdk 2026.829.2 → 2026.829.4
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 +86 -2
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +87 -3
- 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 +22 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +22 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +86 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{use-explore-chat-8eL7WdLc.d.mts → use-explore-chat-B-E7jN1H.d.mts} +5 -0
- package/dist/{use-explore-chat-8eL7WdLc.d.ts → use-explore-chat-B-E7jN1H.d.ts} +5 -0
- package/package.json +1 -1
|
@@ -574,6 +574,16 @@ var RECORD_EXPLORE_CLICK_MUTATION = (
|
|
|
574
574
|
}
|
|
575
575
|
`
|
|
576
576
|
);
|
|
577
|
+
var CREATE_EXPLORE_SHARE_LINK_MUTATION = (
|
|
578
|
+
/* GraphQL */
|
|
579
|
+
`
|
|
580
|
+
mutation CreateExploreShareLink($conversationToken: String!) {
|
|
581
|
+
createExploreShareLink(conversationToken: $conversationToken) {
|
|
582
|
+
shareToken
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
`
|
|
586
|
+
);
|
|
577
587
|
|
|
578
588
|
// src/data/products.ts
|
|
579
589
|
var ECOSYSTEM_PRODUCTS = [
|
|
@@ -1506,6 +1516,16 @@ function useExploreChat(options = {}) {
|
|
|
1506
1516
|
return null;
|
|
1507
1517
|
}, [messages]);
|
|
1508
1518
|
const canSend = (phase === "ready" || phase === "error") && catalog.enabled && turnCount < catalog.limits.maxTurnsPerConversation;
|
|
1519
|
+
const createShareLink = React.useCallback(async () => {
|
|
1520
|
+
const token = conversationTokenRef.current;
|
|
1521
|
+
if (!token) return null;
|
|
1522
|
+
try {
|
|
1523
|
+
const result = await client.mutate(CREATE_EXPLORE_SHARE_LINK_MUTATION, { conversationToken: token });
|
|
1524
|
+
return result?.data?.createExploreShareLink?.shareToken ?? null;
|
|
1525
|
+
} catch {
|
|
1526
|
+
return null;
|
|
1527
|
+
}
|
|
1528
|
+
}, [client]);
|
|
1509
1529
|
const recordClick = React.useCallback(
|
|
1510
1530
|
(messageId, kind, url) => {
|
|
1511
1531
|
const token = conversationTokenRef.current;
|
|
@@ -1538,7 +1558,8 @@ function useExploreChat(options = {}) {
|
|
|
1538
1558
|
openConversation,
|
|
1539
1559
|
deleteConversation,
|
|
1540
1560
|
clearHistory,
|
|
1541
|
-
recordClick
|
|
1561
|
+
recordClick,
|
|
1562
|
+
createShareLink
|
|
1542
1563
|
};
|
|
1543
1564
|
}
|
|
1544
1565
|
var optimisticCounter = 0;
|
|
@@ -2666,7 +2687,8 @@ function ExplorePage({
|
|
|
2666
2687
|
openConversation,
|
|
2667
2688
|
deleteConversation,
|
|
2668
2689
|
clearHistory,
|
|
2669
|
-
recordClick
|
|
2690
|
+
recordClick,
|
|
2691
|
+
createShareLink
|
|
2670
2692
|
} = useExploreChat({ productSlug, pageUrl, onSend, examplePrompts });
|
|
2671
2693
|
const [draft, setDraft] = React.useState("");
|
|
2672
2694
|
const textareaRef = React.useRef(null);
|
|
@@ -2686,6 +2708,8 @@ function ExplorePage({
|
|
|
2686
2708
|
});
|
|
2687
2709
|
speechStopRef.current = speech.stop;
|
|
2688
2710
|
const [disclaimerOpen, setDisclaimerOpen] = React.useState(false);
|
|
2711
|
+
const [shareLabel, setShareLabel] = React.useState("Share");
|
|
2712
|
+
const [shareUrl, setShareUrl] = React.useState(null);
|
|
2689
2713
|
const scrollRef = React.useRef(null);
|
|
2690
2714
|
const latestAssistantRef = React.useRef(null);
|
|
2691
2715
|
const alignedForRef = React.useRef(null);
|
|
@@ -2740,6 +2764,26 @@ function ExplorePage({
|
|
|
2740
2764
|
if (!el) return;
|
|
2741
2765
|
el.scrollTop = el.scrollHeight;
|
|
2742
2766
|
}, [activity, latestAssistantId, messages]);
|
|
2767
|
+
const handleShare = React.useCallback(async () => {
|
|
2768
|
+
setShareLabel("Copying\u2026");
|
|
2769
|
+
setShareUrl(null);
|
|
2770
|
+
const token = await createShareLink();
|
|
2771
|
+
if (!token) {
|
|
2772
|
+
setShareLabel("Unavailable");
|
|
2773
|
+
setTimeout(() => setShareLabel("Share"), 2500);
|
|
2774
|
+
return;
|
|
2775
|
+
}
|
|
2776
|
+
const base = (pageUrl ?? window.location.href).split("?")[0];
|
|
2777
|
+
const url = `${base}?c=${encodeURIComponent(token)}`;
|
|
2778
|
+
try {
|
|
2779
|
+
await navigator.clipboard.writeText(url);
|
|
2780
|
+
setShareLabel("Copied");
|
|
2781
|
+
setTimeout(() => setShareLabel("Share"), 2500);
|
|
2782
|
+
} catch {
|
|
2783
|
+
setShareUrl(url);
|
|
2784
|
+
setShareLabel("Share");
|
|
2785
|
+
}
|
|
2786
|
+
}, [createShareLink, pageUrl]);
|
|
2743
2787
|
const submitDraft = React.useCallback(() => {
|
|
2744
2788
|
const text = draft.trim();
|
|
2745
2789
|
if (!text || overLimit || busy || !canSend) return;
|
|
@@ -2822,6 +2866,24 @@ function ExplorePage({
|
|
|
2822
2866
|
]
|
|
2823
2867
|
}
|
|
2824
2868
|
),
|
|
2869
|
+
messages.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2870
|
+
Button,
|
|
2871
|
+
{
|
|
2872
|
+
"data-boff-explore": "share",
|
|
2873
|
+
type: "button",
|
|
2874
|
+
size: "sm",
|
|
2875
|
+
variant: "ghost",
|
|
2876
|
+
className: "shrink-0 text-muted-foreground",
|
|
2877
|
+
title: "Copy a read-only link to this conversation",
|
|
2878
|
+
onClick: () => {
|
|
2879
|
+
void handleShare();
|
|
2880
|
+
},
|
|
2881
|
+
children: [
|
|
2882
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, { className: "h-3.5 w-3.5" }),
|
|
2883
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden sm:inline", children: shareLabel })
|
|
2884
|
+
]
|
|
2885
|
+
}
|
|
2886
|
+
) : null,
|
|
2825
2887
|
history.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2826
2888
|
Button,
|
|
2827
2889
|
{
|
|
@@ -3084,6 +3146,28 @@ function ExplorePage({
|
|
|
3084
3146
|
}
|
|
3085
3147
|
)
|
|
3086
3148
|
] }),
|
|
3149
|
+
shareUrl ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
3150
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3151
|
+
"input",
|
|
3152
|
+
{
|
|
3153
|
+
"data-boff-explore": "share-url",
|
|
3154
|
+
readOnly: true,
|
|
3155
|
+
value: shareUrl,
|
|
3156
|
+
"aria-label": "Read-only link to this conversation",
|
|
3157
|
+
onFocus: (event) => event.currentTarget.select(),
|
|
3158
|
+
className: "min-w-0 flex-1 rounded-md border border-border bg-muted px-2 py-1 text-xs text-muted-foreground"
|
|
3159
|
+
}
|
|
3160
|
+
),
|
|
3161
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3162
|
+
"button",
|
|
3163
|
+
{
|
|
3164
|
+
type: "button",
|
|
3165
|
+
className: "shrink-0 text-xs underline underline-offset-2",
|
|
3166
|
+
onClick: () => setShareUrl(null),
|
|
3167
|
+
children: "Done"
|
|
3168
|
+
}
|
|
3169
|
+
)
|
|
3170
|
+
] }) : null,
|
|
3087
3171
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground", children: [
|
|
3088
3172
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: "Grounded in our docs \u2014 check anything important." }),
|
|
3089
3173
|
/* @__PURE__ */ jsxRuntime.jsx(
|