@athenaintel/react 0.9.12 → 0.9.14
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/README.md +38 -0
- package/dist/index.cjs +536 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +108 -2
- package/dist/index.js +536 -71
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,6 +48,44 @@ function App() {
|
|
|
48
48
|
|
|
49
49
|
If `config.appUrl` is omitted, the provider resolves it from the parent bridge or from the matching Athena environment defaults. Known Athena staging and production `apiUrl` and `backendUrl` values automatically fall back to the corresponding frontend origin.
|
|
50
50
|
|
|
51
|
+
## Citation Links
|
|
52
|
+
|
|
53
|
+
When you render chat inside `<AthenaLayout>`, Athena citation links (`app.athenaintel.com/dashboard/spaces?...`) now open the referenced asset in the SDK asset pane by default instead of navigating away.
|
|
54
|
+
|
|
55
|
+
If your host app wants different behavior, configure `linkClicks` on `<AthenaProvider>` or use `useAthenaLinkClickHandler()` inside a custom message renderer. The hook runs for every rendered link; only Athena citation links are intercepted by default.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { useMemo } from 'react';
|
|
59
|
+
import { AthenaChat, AthenaLayout, AthenaProvider } from '@athenaintel/react';
|
|
60
|
+
|
|
61
|
+
function App() {
|
|
62
|
+
const linkClicks = useMemo(
|
|
63
|
+
() => ({
|
|
64
|
+
onClick: (link) => {
|
|
65
|
+
if (link.kind !== 'athena-citation' || !link.openInAssetPanel) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
console.log('Citation clicked:', link.citation?.assetId);
|
|
70
|
+
link.openInAssetPanel();
|
|
71
|
+
return true;
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
[],
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<AthenaProvider linkClicks={linkClicks}>
|
|
79
|
+
<AthenaLayout>
|
|
80
|
+
<AthenaChat />
|
|
81
|
+
</AthenaLayout>
|
|
82
|
+
</AthenaProvider>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Set `linkClicks={{ interceptAthenaCitations: false }}` to keep Athena citation links opening in the browser while still letting your app observe all link clicks.
|
|
88
|
+
|
|
51
89
|
## Theming
|
|
52
90
|
|
|
53
91
|
```tsx
|