@gram-ai/elements 1.0.4 → 1.0.5

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.
@@ -1,14 +1,47 @@
1
1
  import { ChatModelAdapter } from '@assistant-ui/react';
2
2
  import { ReactNode } from 'react';
3
3
  export interface ElementsProviderProps {
4
+ /**
5
+ * The children to render.
6
+ */
4
7
  children: ReactNode;
8
+ /**
9
+ * The API to use for the elements.
10
+ * Can be a GramRuntimeApi or a CustomRuntimeApi.
11
+ */
5
12
  api: GramRuntimeApi | CustomRuntimeApi;
13
+ /**
14
+ * Configuration object for the Elements library.
15
+ */
16
+ config: ElementsConfig;
17
+ }
18
+ export interface ElementsConfig {
19
+ /**
20
+ * Whether to render the chat window inside of an expandable modal or a standalone chat window.
21
+ */
22
+ variant?: 'modal' | 'standalone';
23
+ /**
24
+ * The configuration for the composer.
25
+ */
26
+ composer?: ComposerConfig;
27
+ }
28
+ export interface ComposerConfig {
29
+ /**
30
+ * The placeholder text for the composer input.
31
+ */
32
+ placeholder: string;
33
+ /**
34
+ * Whether to enable attachments in the composer.
35
+ */
36
+ attachments: boolean;
6
37
  }
7
38
  export interface GramRuntimeApi {
8
39
  getSessionToken: () => Promise<string>;
9
40
  projectToken: string;
10
41
  }
11
42
  export type CustomRuntimeApi = ChatModelAdapter;
12
- export type ElementsContextType = object;
13
- export declare function isGramRuntimeApi(api: GramRuntimeApi | CustomRuntimeApi): api is GramRuntimeApi;
14
- export declare function isCustomRuntimeApi(api: GramRuntimeApi | CustomRuntimeApi): api is CustomRuntimeApi;
43
+ export type ElementsContextType = {
44
+ config: ElementsConfig;
45
+ };
46
+ export declare function isGramRuntimeApi(api: GramRuntimeApi | CustomRuntimeApi | undefined): api is GramRuntimeApi;
47
+ export declare function isCustomRuntimeApi(api: GramRuntimeApi | CustomRuntimeApi | undefined): api is CustomRuntimeApi;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@gram-ai/elements",
3
3
  "description": "Gram Elements is a library of UI primitives for building chat-like experiences for MCP Servers.",
4
4
  "type": "module",
5
- "version": "1.0.4",
5
+ "version": "1.0.5",
6
6
  "main": "dist/index.js",
7
7
  "exports": {
8
8
  ".": {
@@ -61,7 +61,6 @@
61
61
  "@eslint/compat": "^2.0.0",
62
62
  "@eslint/js": "^9.39.1",
63
63
  "@storybook/addon-docs": "^10.0.8",
64
- "@storybook/addon-onboarding": "^10.0.8",
65
64
  "@storybook/react-vite": "^10.0.8",
66
65
  "@tailwindcss/vite": "^4.1.13",
67
66
  "@types/node": "^24.10.1",