@axiom-lattice/react-sdk 2.1.52 → 2.1.54
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/index.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +18 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -557,6 +557,18 @@ interface AuthContextValue {
|
|
|
557
557
|
clearError: () => void;
|
|
558
558
|
}
|
|
559
559
|
declare const useAuth: () => AuthContextValue;
|
|
560
|
+
/**
|
|
561
|
+
* Optional version of useAuth that returns null instead of throwing when AuthProvider is not present.
|
|
562
|
+
* Use this when authentication is optional for the component.
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
* // For required auth - throws if no provider
|
|
566
|
+
* const { user } = useAuth();
|
|
567
|
+
*
|
|
568
|
+
* // For optional auth - returns null if no provider
|
|
569
|
+
* const user = useAuthOptional()?.user;
|
|
570
|
+
*/
|
|
571
|
+
declare const useAuthOptional: () => AuthContextValue | null;
|
|
560
572
|
interface AuthProviderProps {
|
|
561
573
|
children: ReactNode;
|
|
562
574
|
baseURL: string;
|
|
@@ -682,6 +694,7 @@ interface ChatingProps {
|
|
|
682
694
|
showSender?: boolean;
|
|
683
695
|
showHITL?: boolean;
|
|
684
696
|
showRefreshButton?: boolean;
|
|
697
|
+
showEmptyState?: boolean;
|
|
685
698
|
emptyStateGreeting?: React__default.ReactNode;
|
|
686
699
|
emptyStateQuestion?: string;
|
|
687
700
|
welcomePrefix?: string;
|
|
@@ -2116,4 +2129,4 @@ type IframeMessage = {
|
|
|
2116
2129
|
};
|
|
2117
2130
|
declare function generateIframeSrcdoc(): string;
|
|
2118
2131
|
|
|
2119
|
-
export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, type PendingMessage, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
|
|
2132
|
+
export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, type PendingMessage, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAuthOptional, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
|
package/dist/index.d.ts
CHANGED
|
@@ -557,6 +557,18 @@ interface AuthContextValue {
|
|
|
557
557
|
clearError: () => void;
|
|
558
558
|
}
|
|
559
559
|
declare const useAuth: () => AuthContextValue;
|
|
560
|
+
/**
|
|
561
|
+
* Optional version of useAuth that returns null instead of throwing when AuthProvider is not present.
|
|
562
|
+
* Use this when authentication is optional for the component.
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
* // For required auth - throws if no provider
|
|
566
|
+
* const { user } = useAuth();
|
|
567
|
+
*
|
|
568
|
+
* // For optional auth - returns null if no provider
|
|
569
|
+
* const user = useAuthOptional()?.user;
|
|
570
|
+
*/
|
|
571
|
+
declare const useAuthOptional: () => AuthContextValue | null;
|
|
560
572
|
interface AuthProviderProps {
|
|
561
573
|
children: ReactNode;
|
|
562
574
|
baseURL: string;
|
|
@@ -682,6 +694,7 @@ interface ChatingProps {
|
|
|
682
694
|
showSender?: boolean;
|
|
683
695
|
showHITL?: boolean;
|
|
684
696
|
showRefreshButton?: boolean;
|
|
697
|
+
showEmptyState?: boolean;
|
|
685
698
|
emptyStateGreeting?: React__default.ReactNode;
|
|
686
699
|
emptyStateQuestion?: string;
|
|
687
700
|
welcomePrefix?: string;
|
|
@@ -2116,4 +2129,4 @@ type IframeMessage = {
|
|
|
2116
2129
|
};
|
|
2117
2130
|
declare function generateIframeSrcdoc(): string;
|
|
2118
2131
|
|
|
2119
|
-
export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, type PendingMessage, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
|
|
2132
|
+
export { type AgentChatProps, AgentConversations, type AgentConversationsProps, type AgentState, AgentThreadProvider, type AgentThreadProviderProps, AssistantContext, AssistantContextProvider, type AssistantContextProviderProps, type AssistantContextValue, AssistantFlow, type AssistantFlowProps, AssistantNode, type AssistantNodeData, type AssistantState, type AttachFile, type AuthContextValue, AuthProvider, AxiomLatticeProvider, type AxiomLatticeProviderProps, type BalanceResult, type ChatResponse, type ChatState, type ChatStateWithAgent, ChatUIContext, ChatUIContextProvider, Chating, type ChatingProps, type ClientConfig, ColumnLayout, type ColumnLayoutProps, ConversationContext, ConversationContextProvider, type ConversationContextProviderProps, type ConversationContextValue, type ConversationThread, CreateAssistantModal, type ElementMeta, type ElementProps, type ExplorerFile, FileExplorer, type FileExplorerProps, type IframeMessage, LatticeChat, LatticeChatShell, type LatticeChatShellConfig, LatticeChatShellContext, LatticeChatShellContextProvider, type LatticeChatShellContextProviderProps, type LatticeChatShellContextValue, type LatticeChatShellProps, LoginForm, type LoginFormProps, LoginPage, MDResponse, MDViewFormItem, MetricsConfigDrawerContent, type MiddlewareConfigDefinition, type MiddlewareConfigSchema, type MiddlewareConfigSchemaProperty, type MiddlewareToolDefinition, type MiddlewareTypeDefinition, type PendingMessage, ProtectedRoute, type ProtectedRouteProps, type QuickPromptCategory, type QuickPromptItem, RegisterForm, type RegisterFormProps, type ResourceFolderConfig, type SanitizerConfig, ScheduleButton, type ScheduleButtonProps, SideAppViewBrowser, type SideMenuItemConfig, type SideMenuItemType, SkillCategoryPrompts, type SkillCategoryPromptsProps, SkillFlow, type SkillFlowProps, SkillNode, type SkillNodeData, type StreamEventHandlerOptions, type StreamingError, StreamingHTMLRenderer, type StreamingHTMLRendererProps, TenantSelector, type TenantSelectorProps, type ThreadState, type ToolCallData, type UIMessage, type UseAgentStateOptions, type UseAgentStateReturn, type UseApiOptions, type UseApiReturn, type UseAxiomLatticeOptions, type UseChatOptions, type UseTenantsOptions, type UseTenantsReturn, type UseUsersOptions, type UseUsersReturn, UserProfile, type UserProfileProps, type UserTenantInfo, WorkspaceResourceManager, type WorkspaceResourceManagerProps, WorkspaceResourceUIContext, animation, axiomAntdTheme, axiomAntdThemeDark, axiomTokens, colors, generateIframeSrcdoc, generateLabelFromMessage, getAxiomAntdTheme, getElement, radius, regsiterElement, shadows, spacing, typography, useAgentChat, useAgentGraph, useAgentState, useAgentThreadContext, useApi, useAssistantContext, useAuth, useAuthOptional, useAxiomLattice, useAxiomTheme, useChat, useChatUIContext, useClient, useConversationContext, useLatticeChatShellContext, useTenants, useUsers };
|
package/dist/index.js
CHANGED
|
@@ -89,6 +89,7 @@ __export(index_exports, {
|
|
|
89
89
|
useApi: () => useApi,
|
|
90
90
|
useAssistantContext: () => useAssistantContext,
|
|
91
91
|
useAuth: () => useAuth,
|
|
92
|
+
useAuthOptional: () => useAuthOptional,
|
|
92
93
|
useAxiomLattice: () => useAxiomLattice,
|
|
93
94
|
useAxiomTheme: () => useAxiomTheme,
|
|
94
95
|
useChat: () => useChat,
|
|
@@ -119,6 +120,10 @@ var useAuth = () => {
|
|
|
119
120
|
}
|
|
120
121
|
return context;
|
|
121
122
|
};
|
|
123
|
+
var useAuthOptional = () => {
|
|
124
|
+
const context = (0, import_react.useContext)(AuthContext);
|
|
125
|
+
return context;
|
|
126
|
+
};
|
|
122
127
|
var AuthProvider = ({
|
|
123
128
|
children,
|
|
124
129
|
baseURL,
|
|
@@ -18732,6 +18737,7 @@ var Chating = ({
|
|
|
18732
18737
|
showSender = true,
|
|
18733
18738
|
showHITL = true,
|
|
18734
18739
|
showRefreshButton = false,
|
|
18740
|
+
showEmptyState = true,
|
|
18735
18741
|
emptyStateGreeting,
|
|
18736
18742
|
emptyStateQuestion = "Ready to turn data into insightful charts in seconds?",
|
|
18737
18743
|
welcomePrefix = "Hey"
|
|
@@ -18770,9 +18776,13 @@ var Chating = ({
|
|
|
18770
18776
|
return () => clearInterval(interval);
|
|
18771
18777
|
}, [isStreaming]);
|
|
18772
18778
|
const conversationContext = useConversationContext();
|
|
18773
|
-
const [isEmptyState, setIsEmptyState] = (0, import_react62.useState)(messages.length === 0 && !pendingMessages?.length);
|
|
18779
|
+
const [isEmptyState, setIsEmptyState] = (0, import_react62.useState)(showEmptyState && messages.length === 0 && !pendingMessages?.length);
|
|
18774
18780
|
const [isTransitioning, setIsTransitioning] = (0, import_react62.useState)(false);
|
|
18775
18781
|
(0, import_react62.useEffect)(() => {
|
|
18782
|
+
if (!showEmptyState) {
|
|
18783
|
+
setIsEmptyState(false);
|
|
18784
|
+
return;
|
|
18785
|
+
}
|
|
18776
18786
|
const isEmpty = messages.length === 0 && !pendingMessages?.length;
|
|
18777
18787
|
if (!isEmpty && isEmptyState) {
|
|
18778
18788
|
setIsTransitioning(true);
|
|
@@ -18783,10 +18793,10 @@ var Chating = ({
|
|
|
18783
18793
|
} else if (isEmpty && !isEmptyState) {
|
|
18784
18794
|
setIsEmptyState(true);
|
|
18785
18795
|
}
|
|
18786
|
-
}, [messages.length, pendingMessages?.length, isEmptyState]);
|
|
18796
|
+
}, [messages.length, pendingMessages?.length, isEmptyState, showEmptyState]);
|
|
18787
18797
|
const { config } = useLatticeChatShellContext();
|
|
18788
18798
|
const { baseURL } = config;
|
|
18789
|
-
const
|
|
18799
|
+
const user = useAuthOptional()?.user;
|
|
18790
18800
|
const displayUserName = user?.name || user?.email?.split("@")[0] || "there";
|
|
18791
18801
|
const workspaceContext = (0, import_react62.useContext)(WorkspaceContext);
|
|
18792
18802
|
const listPath = workspaceContext?.listPath ?? (async () => []);
|
|
@@ -18994,10 +19004,10 @@ var Chating = ({
|
|
|
18994
19004
|
)
|
|
18995
19005
|
}
|
|
18996
19006
|
);
|
|
18997
|
-
const showDatabaseSlot = config.enableDatabaseSlot
|
|
18998
|
-
const showSkillSlot = config.enableSkillSlot
|
|
18999
|
-
const showAgentSlot = config.enableAgentSlot
|
|
19000
|
-
const showMetricsDataSourceSlot = config.enableMetricsDataSourceSlot
|
|
19007
|
+
const showDatabaseSlot = config.enableDatabaseSlot;
|
|
19008
|
+
const showSkillSlot = config.enableSkillSlot;
|
|
19009
|
+
const showAgentSlot = config.enableAgentSlot;
|
|
19010
|
+
const showMetricsDataSourceSlot = config.enableMetricsDataSourceSlot;
|
|
19001
19011
|
const senderFooter = (actionNode) => {
|
|
19002
19012
|
const hasSlotButtons = showAgentSlot || showDatabaseSlot || showSkillSlot || showMetricsDataSourceSlot;
|
|
19003
19013
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_antd59.Flex, { justify: "space-between", align: "center", style: { padding: "8px 0" }, children: [
|
|
@@ -28362,6 +28372,7 @@ var LatticeChatShell = (props) => {
|
|
|
28362
28372
|
useApi,
|
|
28363
28373
|
useAssistantContext,
|
|
28364
28374
|
useAuth,
|
|
28375
|
+
useAuthOptional,
|
|
28365
28376
|
useAxiomLattice,
|
|
28366
28377
|
useAxiomTheme,
|
|
28367
28378
|
useChat,
|