@gram-ai/elements 1.20.1 → 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.
Files changed (82) hide show
  1. package/bin/cli.js +14 -12
  2. package/dist/components/Chat/stories/ConnectionConfiguration.stories.d.ts +2 -2
  3. package/dist/components/Chat/stories/{ColorScheme.stories.d.ts → ErrorBoundary.stories.d.ts} +4 -4
  4. package/dist/components/Chat/stories/ToolApproval.stories.d.ts +2 -0
  5. package/dist/components/assistant-ui/error-boundary.d.ts +28 -0
  6. package/dist/components/ui/dialog.d.ts +1 -1
  7. package/dist/components/ui/tooltip.d.ts +3 -1
  8. package/dist/constants/tailwind.d.ts +1 -0
  9. package/dist/contexts/portal-container-context.d.ts +2 -0
  10. package/dist/contexts/portal-container.d.ts +7 -0
  11. package/dist/elements.cjs +1 -160
  12. package/dist/elements.cjs.map +1 -1
  13. package/dist/elements.css +1 -1
  14. package/dist/elements.js +11 -47174
  15. package/dist/elements.js.map +1 -1
  16. package/dist/hooks/usePortalContainer.d.ts +8 -0
  17. package/dist/hooks/useSession.d.ts +1 -2
  18. package/dist/index-B48xzOEm.cjs +169 -0
  19. package/dist/index-B48xzOEm.cjs.map +1 -0
  20. package/dist/{index-DaF9fGY-.js → index-BwdTXSZG.js} +4 -3
  21. package/dist/{index-DaF9fGY-.js.map → index-BwdTXSZG.js.map} +1 -1
  22. package/dist/index-C-iaUGd_.js +54687 -0
  23. package/dist/index-C-iaUGd_.js.map +1 -0
  24. package/dist/{index-B52U8PL6.cjs → index-D8g4LkEy.cjs} +3 -3
  25. package/dist/{index-B52U8PL6.cjs.map → index-D8g4LkEy.cjs.map} +1 -1
  26. package/dist/index.d.ts +3 -1
  27. package/dist/lib/auth.d.ts +2 -2
  28. package/dist/lib/errorTracking.config.d.ts +16 -0
  29. package/dist/lib/errorTracking.d.ts +24 -0
  30. package/dist/lib/tools.d.ts +3 -2
  31. package/dist/plugins.cjs +1 -1
  32. package/dist/plugins.js +1 -1
  33. package/dist/profiler-WPgSewiM.js +278 -0
  34. package/dist/profiler-WPgSewiM.js.map +1 -0
  35. package/dist/profiler-j7uDglf5.cjs +2 -0
  36. package/dist/profiler-j7uDglf5.cjs.map +1 -0
  37. package/dist/startRecording-Cahc4WH4.cjs +3 -0
  38. package/dist/startRecording-Cahc4WH4.cjs.map +1 -0
  39. package/dist/startRecording-DpwlHYPJ.js +1212 -0
  40. package/dist/startRecording-DpwlHYPJ.js.map +1 -0
  41. package/dist/types/index.d.ts +45 -15
  42. package/package.json +16 -2
  43. package/src/components/Chat/index.tsx +39 -3
  44. package/src/components/Chat/stories/Composer.stories.tsx +0 -7
  45. package/src/components/Chat/stories/ConnectionConfiguration.stories.tsx +7 -14
  46. package/src/components/Chat/stories/CustomComponents.stories.tsx +0 -7
  47. package/src/components/Chat/stories/Density.stories.tsx +0 -7
  48. package/src/components/Chat/stories/ErrorBoundary.stories.tsx +202 -0
  49. package/src/components/Chat/stories/FrontendTools.stories.tsx +0 -7
  50. package/src/components/Chat/stories/Model.stories.tsx +0 -7
  51. package/src/components/Chat/stories/Plugins.stories.tsx +0 -7
  52. package/src/components/Chat/stories/Radius.stories.tsx +0 -7
  53. package/src/components/Chat/stories/ToolApproval.stories.tsx +51 -7
  54. package/src/components/Chat/stories/Tools.stories.tsx +0 -7
  55. package/src/components/Chat/stories/Variants.stories.tsx +5 -2
  56. package/src/components/Chat/stories/Welcome.stories.tsx +0 -8
  57. package/src/components/assistant-ui/assistant-modal.tsx +4 -1
  58. package/src/components/assistant-ui/assistant-sidecar.tsx +5 -5
  59. package/src/components/assistant-ui/attachment.tsx +1 -4
  60. package/src/components/assistant-ui/error-boundary.tsx +119 -0
  61. package/src/components/assistant-ui/thread-list.tsx +3 -1
  62. package/src/components/assistant-ui/thread.tsx +7 -8
  63. package/src/components/ui/dialog.tsx +10 -1
  64. package/src/components/ui/popover.tsx +10 -12
  65. package/src/components/ui/tooltip.tsx +7 -2
  66. package/src/constants/tailwind.ts +2 -0
  67. package/src/contexts/ElementsProvider.tsx +29 -2
  68. package/src/contexts/portal-container-context.ts +4 -0
  69. package/src/contexts/portal-container.tsx +20 -0
  70. package/src/global.css +129 -16
  71. package/src/hooks/useAuth.ts +6 -16
  72. package/src/hooks/usePortalContainer.ts +16 -0
  73. package/src/hooks/useSession.ts +1 -3
  74. package/src/index.ts +5 -0
  75. package/src/lib/api.test.ts +5 -5
  76. package/src/lib/auth.ts +4 -4
  77. package/src/lib/errorTracking.config.ts +16 -0
  78. package/src/lib/errorTracking.ts +104 -0
  79. package/src/lib/tools.ts +37 -8
  80. package/src/types/index.ts +48 -16
  81. package/src/vite-env.d.ts +3 -0
  82. package/src/components/Chat/stories/ColorScheme.stories.tsx +0 -52
package/src/vite-env.d.ts CHANGED
@@ -5,6 +5,9 @@ declare const __GRAM_GIT_SHA__: string | undefined
5
5
  interface ImportMetaEnv {
6
6
  readonly VITE_GRAM_ELEMENTS_STORYBOOK_PROJECT_SLUG?: string | undefined
7
7
  readonly VITE_GRAM_ELEMENTS_STORYBOOK_MCP_URL?: string | undefined
8
+ readonly VITE_DATADOG_APPLICATION_ID?: string | undefined
9
+ readonly VITE_DATADOG_CLIENT_TOKEN?: string | undefined
10
+ readonly VITE_DATADOG_SITE?: string | undefined
8
11
  }
9
12
 
10
13
  interface ImportMeta {
@@ -1,52 +0,0 @@
1
- import React from 'react'
2
- import { Chat } from '..'
3
- import type { Meta, StoryFn } from '@storybook/react-vite'
4
-
5
- const meta: Meta<typeof Chat> = {
6
- title: 'Chat/Color Scheme',
7
- component: Chat,
8
- parameters: {
9
- layout: 'fullscreen',
10
- },
11
- decorators: [
12
- (Story) => (
13
- <div className="m-auto flex h-screen w-full max-w-3xl flex-col">
14
- <Story />
15
- </div>
16
- ),
17
- ],
18
- } satisfies Meta<typeof Chat>
19
-
20
- export default meta
21
-
22
- type Story = StoryFn<typeof Chat>
23
-
24
- export const Light: Story = () => <Chat />
25
- Light.parameters = {
26
- elements: {
27
- config: {
28
- variant: 'standalone',
29
- theme: { colorScheme: 'light' },
30
- },
31
- },
32
- }
33
-
34
- export const Dark: Story = () => <Chat />
35
- Dark.parameters = {
36
- elements: {
37
- config: {
38
- variant: 'standalone',
39
- theme: { colorScheme: 'dark' },
40
- },
41
- },
42
- }
43
-
44
- export const System: Story = () => <Chat />
45
- System.parameters = {
46
- elements: {
47
- config: {
48
- variant: 'standalone',
49
- theme: { colorScheme: 'system' },
50
- },
51
- },
52
- }