@gram-ai/elements 1.20.2 → 1.21.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/bin/cli.js +14 -12
- package/dist/components/Chat/stories/ConnectionConfiguration.stories.d.ts +2 -2
- package/dist/components/Chat/stories/ToolApproval.stories.d.ts +2 -0
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/tooltip.d.ts +3 -1
- package/dist/constants/tailwind.d.ts +1 -0
- package/dist/contexts/portal-container-context.d.ts +2 -0
- package/dist/contexts/portal-container.d.ts +7 -0
- package/dist/elements.cjs +1 -160
- package/dist/elements.cjs.map +1 -1
- package/dist/elements.css +1 -1
- package/dist/elements.js +11 -47215
- package/dist/elements.js.map +1 -1
- package/dist/hooks/usePortalContainer.d.ts +8 -0
- package/dist/hooks/useSession.d.ts +1 -2
- package/dist/index-B48xzOEm.cjs +169 -0
- package/dist/index-B48xzOEm.cjs.map +1 -0
- package/dist/index-C-iaUGd_.js +54687 -0
- package/dist/index-C-iaUGd_.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/lib/auth.d.ts +2 -2
- package/dist/lib/errorTracking.config.d.ts +16 -0
- package/dist/lib/errorTracking.d.ts +24 -0
- package/dist/lib/tools.d.ts +3 -2
- package/dist/profiler-WPgSewiM.js +278 -0
- package/dist/profiler-WPgSewiM.js.map +1 -0
- package/dist/profiler-j7uDglf5.cjs +2 -0
- package/dist/profiler-j7uDglf5.cjs.map +1 -0
- package/dist/startRecording-Cahc4WH4.cjs +3 -0
- package/dist/startRecording-Cahc4WH4.cjs.map +1 -0
- package/dist/startRecording-DpwlHYPJ.js +1212 -0
- package/dist/startRecording-DpwlHYPJ.js.map +1 -0
- package/dist/types/index.d.ts +45 -15
- package/package.json +16 -2
- package/src/components/Chat/index.tsx +31 -3
- package/src/components/Chat/stories/Composer.stories.tsx +0 -7
- package/src/components/Chat/stories/ConnectionConfiguration.stories.tsx +7 -14
- package/src/components/Chat/stories/CustomComponents.stories.tsx +0 -7
- package/src/components/Chat/stories/Density.stories.tsx +0 -7
- package/src/components/Chat/stories/ErrorBoundary.stories.tsx +4 -23
- package/src/components/Chat/stories/FrontendTools.stories.tsx +0 -7
- package/src/components/Chat/stories/Model.stories.tsx +0 -7
- package/src/components/Chat/stories/Plugins.stories.tsx +0 -7
- package/src/components/Chat/stories/Radius.stories.tsx +0 -7
- package/src/components/Chat/stories/ToolApproval.stories.tsx +51 -7
- package/src/components/Chat/stories/Tools.stories.tsx +0 -7
- package/src/components/Chat/stories/Variants.stories.tsx +5 -2
- package/src/components/Chat/stories/Welcome.stories.tsx +0 -8
- package/src/components/assistant-ui/assistant-sidecar.tsx +1 -4
- package/src/components/assistant-ui/attachment.tsx +1 -4
- package/src/components/assistant-ui/error-boundary.tsx +6 -0
- package/src/components/assistant-ui/thread-list.tsx +3 -1
- package/src/components/assistant-ui/thread.tsx +7 -8
- package/src/components/ui/dialog.tsx +10 -1
- package/src/components/ui/popover.tsx +10 -12
- package/src/components/ui/tooltip.tsx +7 -2
- package/src/constants/tailwind.ts +2 -0
- package/src/contexts/ElementsProvider.tsx +13 -1
- package/src/contexts/portal-container-context.ts +4 -0
- package/src/contexts/portal-container.tsx +20 -0
- package/src/global.css +129 -16
- package/src/hooks/useAuth.ts +6 -16
- package/src/hooks/usePortalContainer.ts +16 -0
- package/src/hooks/useSession.ts +1 -3
- package/src/index.ts +5 -0
- package/src/lib/api.test.ts +5 -5
- package/src/lib/auth.ts +4 -4
- package/src/lib/errorTracking.config.ts +16 -0
- package/src/lib/errorTracking.ts +104 -0
- package/src/lib/tools.ts +37 -8
- package/src/types/index.ts +48 -16
- package/src/vite-env.d.ts +3 -0
- package/dist/components/Chat/stories/ColorScheme.stories.d.ts +0 -8
- package/src/components/Chat/stories/ColorScheme.stories.tsx +0 -52
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Because we do not want Tailwind to leak from the Elements library, and
|
|
3
|
+
* because some UI elements such as Dialogs and Tooltips need to be rendered in
|
|
4
|
+
* a different container than the root element, we need to use a portal
|
|
5
|
+
* container, which renders any tooltips, dialogs etc within the .gram-elements
|
|
6
|
+
* scope so that they still inherit the Elements CSS
|
|
7
|
+
*/
|
|
8
|
+
export declare function usePortalContainer(): HTMLElement | null;
|
|
@@ -3,8 +3,7 @@ import { GetSessionFn } from '../types';
|
|
|
3
3
|
* Hook to fetch or retrieve the session token for the chat.
|
|
4
4
|
* @returns The session token string or null
|
|
5
5
|
*/
|
|
6
|
-
export declare const useSession: ({ getSession, projectSlug,
|
|
6
|
+
export declare const useSession: ({ getSession, projectSlug, }: {
|
|
7
7
|
getSession: GetSessionFn | null;
|
|
8
8
|
projectSlug: string;
|
|
9
|
-
enabled: boolean;
|
|
10
9
|
}) => string | null;
|