@inkeep/agents-ui 0.14.20 → 0.14.21
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/color-mode/index.d.ts +21 -0
- package/dist/index.d.ts +1 -5103
- package/dist/primitives/atoms/avatars/ai.d.ts +3 -0
- package/dist/primitives/atoms/avatars/user.d.ts +3 -0
- package/dist/primitives/atoms/cmdk/command-score.d.ts +1 -0
- package/dist/primitives/atoms/cmdk/index.d.ts +460 -0
- package/dist/primitives/atoms/codeblock/index.d.ts +10 -0
- package/dist/primitives/atoms/custom-styles.d.ts +5 -0
- package/dist/primitives/atoms/dialog.d.ts +94 -0
- package/dist/primitives/atoms/error-boundary.d.ts +6 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.d.ts +6 -0
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +83 -0
- package/dist/primitives/atoms/icons/checkbox-icon.d.ts +1 -0
- package/dist/primitives/atoms/icons/collections/bi.d.ts +4 -0
- package/dist/primitives/atoms/icons/collections/fi.d.ts +2 -0
- package/dist/primitives/atoms/icons/collections/gr.d.ts +2 -0
- package/dist/primitives/atoms/icons/collections/io5.d.ts +34 -0
- package/dist/primitives/atoms/icons/collections/pi.d.ts +4 -0
- package/dist/primitives/atoms/icons/custom-icon.d.ts +6 -0
- package/dist/primitives/atoms/icons/generate-icon.d.ts +28 -0
- package/dist/primitives/atoms/icons/index.d.ts +2 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.d.ts +2 -0
- package/dist/primitives/atoms/link.d.ts +14 -0
- package/dist/primitives/atoms/markdown/components.d.ts +31 -0
- package/dist/primitives/atoms/markdown/index.d.ts +17 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.d.ts +1 -0
- package/dist/primitives/atoms/portal-with-theme.d.ts +2 -0
- package/dist/primitives/atoms/portal.d.ts +8 -0
- package/dist/primitives/atoms/select.d.ts +136 -0
- package/dist/primitives/atoms/shadow/context.d.ts +14 -0
- package/dist/primitives/atoms/shadow/create.d.ts +8 -0
- package/dist/primitives/atoms/shadow/index.d.ts +1 -0
- package/dist/primitives/atoms/shadow/root.d.ts +5 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.d.ts +2 -0
- package/dist/primitives/atoms/shadow/utils.d.ts +9 -0
- package/dist/primitives/components/chat-button.d.ts +18 -0
- package/dist/primitives/components/embedded-chat/chat-provider.d.ts +19 -0
- package/dist/primitives/components/embedded-chat/use-captcha.d.ts +13 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.d.ts +9 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +27 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.d.ts +28 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +27 -28
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.d.ts +431 -0
- package/dist/primitives/components/embedded-chat.js +775 -776
- package/dist/primitives/components/embedded-search/search-provider.d.ts +21 -0
- package/dist/primitives/components/embedded-search/transform-results.d.ts +3 -0
- package/dist/primitives/components/embedded-search/url-query.d.ts +4 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.d.ts +19 -0
- package/dist/primitives/components/embedded-search/use-search-filter.d.ts +1 -0
- package/dist/primitives/components/embedded-search.d.ts +249 -0
- package/dist/primitives/components/factory.d.ts +19 -0
- package/dist/primitives/components/index.d.ts +10 -0
- package/dist/primitives/components/modal/modal-provider.d.ts +12 -0
- package/dist/primitives/components/modal/use-inkeep-modal.d.ts +7 -0
- package/dist/primitives/components/modal/widget-auto-focus.d.ts +2 -0
- package/dist/primitives/components/modal.d.ts +18 -0
- package/dist/primitives/components/presence.d.ts +8 -0
- package/dist/primitives/components/searchbar.d.ts +23 -0
- package/dist/primitives/components/sidebar-chat/index.d.ts +9 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.d.ts +5 -0
- package/dist/primitives/components/tagline-logo-icon.d.ts +1 -0
- package/dist/primitives/components/use-component-trigger.d.ts +5 -0
- package/dist/primitives/constants/search.d.ts +1 -0
- package/dist/primitives/hooks/index.d.ts +11 -0
- package/dist/primitives/hooks/use-boolean.d.ts +10 -0
- package/dist/primitives/hooks/use-component-classnames.d.ts +6 -0
- package/dist/primitives/hooks/use-container-size.d.ts +5 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.d.ts +3 -0
- package/dist/primitives/hooks/use-debounce.d.ts +1 -0
- package/dist/primitives/hooks/use-instant-update.d.ts +17 -0
- package/dist/primitives/hooks/use-is-mounted.d.ts +1 -0
- package/dist/primitives/hooks/use-media-query.d.ts +1 -0
- package/dist/primitives/hooks/use-resize-observer.d.ts +12 -0
- package/dist/primitives/hooks/use-scrolling-fades.d.ts +2 -0
- package/dist/primitives/hooks/use-settle-action.d.ts +3 -0
- package/dist/primitives/hooks/use-simple-scroll.d.ts +5 -0
- package/dist/primitives/hooks/use-streaming-events.d.ts +8 -0
- package/dist/primitives/index.d.ts +13 -0
- package/dist/primitives/providers/attachment-item-provider.d.ts +9 -0
- package/dist/primitives/providers/attachments-bar-provider.d.ts +30 -0
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.d.ts +8 -0
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/providers/chat-form-provider.d.ts +26 -0
- package/dist/primitives/providers/config-provider.d.ts +25 -0
- package/dist/primitives/providers/feedback-item-provider.d.ts +10 -0
- package/dist/primitives/providers/feedback-provider.d.ts +16 -0
- package/dist/primitives/providers/form-field-provider.d.ts +15 -0
- package/dist/primitives/providers/help-menu-provider.d.ts +11 -0
- package/dist/primitives/providers/hover-popover-provider.d.ts +10 -0
- package/dist/primitives/providers/index.d.ts +17 -0
- package/dist/primitives/providers/markdown-provider.d.ts +9 -0
- package/dist/primitives/providers/message-attachments-provider.d.ts +13 -0
- package/dist/primitives/providers/message-provider.d.ts +10 -0
- package/dist/primitives/providers/root-provider.d.ts +8 -0
- package/dist/primitives/providers/search-events-provider.d.ts +8 -0
- package/dist/primitives/providers/sidebar-chat-provider.d.ts +83 -0
- package/dist/primitives/providers/source-item-provider.d.ts +12 -0
- package/dist/primitives/providers/theme-provider.d.ts +3 -0
- package/dist/primitives/providers/widget-provider.d.ts +10 -0
- package/dist/primitives/utils/component-ids.d.ts +572 -0
- package/dist/primitives/utils/compose-event-handlers.d.ts +3 -0
- package/dist/primitives/utils/compose-refs.d.ts +5 -0
- package/dist/primitives/utils/default-settings.d.ts +167 -0
- package/dist/primitives/utils/form.d.ts +3 -0
- package/dist/primitives/utils/generate-uid.d.ts +2 -0
- package/dist/primitives/utils/get-message-metadata.d.ts +8 -0
- package/dist/primitives/utils/get-source-icon.d.ts +2 -0
- package/dist/primitives/utils/highlight-emphasis.d.ts +4 -0
- package/dist/primitives/utils/merge-props.d.ts +7 -0
- package/dist/primitives/utils/misc.d.ts +12 -0
- package/dist/primitives/utils/split-props.d.ts +15 -0
- package/dist/react/chat-button.d.ts +14 -0
- package/dist/react/embedded-chat.d.ts +14 -0
- package/dist/react/embedded-search-and-chat.d.ts +40 -0
- package/dist/react/embedded-search-and-chat.impl.d.ts +9 -0
- package/dist/react/embedded-search.d.ts +17 -0
- package/dist/react/index.d.ts +12 -0
- package/dist/react/modal.chat.d.ts +6 -0
- package/dist/react/modal.d.ts +23 -0
- package/dist/react/modal.search-and-chat.d.ts +6 -0
- package/dist/react/modal.search.d.ts +6 -0
- package/dist/react/searchbar.d.ts +13 -0
- package/dist/react/sidebar-chat.d.ts +6 -0
- package/dist/react/utils.d.ts +6 -0
- package/dist/react/widget-toggle.d.ts +14 -0
- package/dist/styled/components/chat-button.d.ts +8 -0
- package/dist/styled/components/data-summary-group.d.ts +11 -0
- package/dist/styled/components/embedded-chat.d.ts +190 -0
- package/dist/styled/components/embedded-search/results-loading.d.ts +1 -0
- package/dist/styled/components/embedded-search.d.ts +73 -0
- package/dist/styled/components/index.d.ts +11 -0
- package/dist/styled/components/loading-indicator.d.ts +1 -0
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.d.ts +4 -0
- package/dist/styled/components/message.js +46 -47
- package/dist/styled/components/modal.d.ts +6 -0
- package/dist/styled/components/searchbar.d.ts +11 -0
- package/dist/styled/components/shadow.d.ts +3 -0
- package/dist/styled/components/sidebar-chat.d.ts +6 -0
- package/dist/styled/components/ui/markdown-styles.d.ts +23 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.d.ts +7 -0
- package/dist/styled/components/ui/recipes/attachment.d.ts +4 -0
- package/dist/styled/components/ui/recipes/button.d.ts +6 -0
- package/dist/styled/components/ui/recipes/checkbox.d.ts +4 -0
- package/dist/styled/components/ui/recipes/citation.d.ts +4 -0
- package/dist/styled/components/ui/recipes/icon.d.ts +2 -0
- package/dist/styled/components/ui/recipes/index.d.ts +15 -0
- package/dist/styled/components/ui/recipes/input.d.ts +5 -0
- package/dist/styled/components/ui/recipes/link.d.ts +2 -0
- package/dist/styled/components/ui/recipes/markdown.cjs +1 -1
- package/dist/styled/components/ui/recipes/markdown.d.ts +16 -0
- package/dist/styled/components/ui/recipes/markdown.js +1 -1
- package/dist/styled/components/ui/recipes/modal.d.ts +4 -0
- package/dist/styled/components/ui/recipes/popover.d.ts +4 -0
- package/dist/styled/components/ui/recipes/scrollable.d.ts +4 -0
- package/dist/styled/components/ui/recipes/select.d.ts +4 -0
- package/dist/styled/components/ui/recipes/skeleton.d.ts +2 -0
- package/dist/styled/components/ui/recipes/widget-toggle.d.ts +4 -0
- package/dist/styled/index.d.ts +2 -0
- package/dist/styled/utils.d.ts +4 -0
- package/dist/theme/color-utils.d.ts +1 -0
- package/dist/theme/colors.d.ts +104 -0
- package/dist/theme/index.d.ts +125 -0
- package/dist/theme/utils/create-css-variables.d.ts +2 -0
- package/dist/theme/utils/generate-theme-variables.d.ts +3 -0
- package/dist/types/color-mode.d.ts +44 -0
- package/dist/types/config/ai.d.ts +243 -0
- package/dist/types/config/base.d.ts +344 -0
- package/dist/types/config/components.d.ts +10 -0
- package/dist/types/config/filters.d.ts +17 -0
- package/dist/types/config/index.d.ts +36 -0
- package/dist/types/config/modal.d.ts +33 -0
- package/dist/types/config/search.d.ts +95 -0
- package/dist/types/config/settings/actions.d.ts +37 -0
- package/dist/types/config/settings/form.d.ts +128 -0
- package/dist/types/config/settings/jsonschema.d.ts +105 -0
- package/dist/types/config/settings/workflow.d.ts +86 -0
- package/dist/types/events.d.ts +173 -0
- package/dist/types/icons/built-in.d.ts +1 -0
- package/dist/types/icons/custom.d.ts +29 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/js/index.d.ts +54 -0
- package/dist/types/message.d.ts +43 -0
- package/dist/types/shadow.d.ts +15 -0
- package/dist/types/sources.d.ts +108 -0
- package/dist/types/theme.d.ts +25 -0
- package/dist/types/widget.d.ts +28 -0
- package/package.json +2 -4
- package/dist/index.d.cts +0 -5103
- package/dist/types/message.cjs +0 -1
- package/dist/types/message.js +0 -5
- package/dist/types/types.d.cts +0 -1758
- package/dist/types/types.d.ts +0 -1758
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './providers';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './utils/misc';
|
|
5
|
+
export * from './utils/component-ids';
|
|
6
|
+
export * from './utils/compose-refs';
|
|
7
|
+
export * from './utils/merge-props';
|
|
8
|
+
export * from './atoms/shadow';
|
|
9
|
+
export * from './atoms/portal';
|
|
10
|
+
export * from './atoms/icons';
|
|
11
|
+
export * from './atoms/portal-with-theme';
|
|
12
|
+
export * from './atoms/cmdk';
|
|
13
|
+
export * from './atoms/error-boundary';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MessageAttachment } from '../../types/index.ts';
|
|
2
|
+
export type AttachmentItemContextValue = {
|
|
3
|
+
attachment: MessageAttachment;
|
|
4
|
+
};
|
|
5
|
+
export declare const AttachmentItemProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
attachment: MessageAttachment;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useAttachmentItem: () => AttachmentItemContextValue;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WorkflowModalSingleInput } from '../../types/index.ts';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type AttachmentsBarContextValue = ReturnType<typeof useChatAttachmentsBar>;
|
|
4
|
+
type FormErrors = Record<'title' | 'content', string | undefined>;
|
|
5
|
+
declare function useChatAttachmentsBar(): {
|
|
6
|
+
selectedInput: WorkflowModalSingleInput | null;
|
|
7
|
+
selectInput: Dispatch<SetStateAction<WorkflowModalSingleInput | null>>;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
onOpen: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
form: {
|
|
12
|
+
data: {
|
|
13
|
+
title: string;
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
16
|
+
errors: FormErrors;
|
|
17
|
+
labels: {
|
|
18
|
+
title: string;
|
|
19
|
+
content: string;
|
|
20
|
+
};
|
|
21
|
+
validate(): FormErrors;
|
|
22
|
+
onChange(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>): void;
|
|
23
|
+
onSubmit(e: React.FormEvent<HTMLFormElement>): void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare function AttachmentsBarProvider({ children }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const useAttachmentsBar: () => AttachmentsBarContextValue;
|
|
30
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.14.20",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InkeepEvent } from '../../types/index.ts';
|
|
2
|
+
export type BaseEventsContextValue = {
|
|
3
|
+
logEvent: (event: InkeepEvent) => Promise<void>;
|
|
4
|
+
};
|
|
5
|
+
export declare const BaseEventsProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useBaseEvents: () => BaseEventsContextValue;
|
|
@@ -5,7 +5,7 @@ import { useInkeepConfig as g } from "./config-provider.js";
|
|
|
5
5
|
const a = d(void 0), P = ({ children: e }) => {
|
|
6
6
|
const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
|
|
7
7
|
() => ({
|
|
8
|
-
widgetLibraryVersion: "0.14.
|
|
8
|
+
widgetLibraryVersion: "0.14.20",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AIChatFormSettings, GetHelpOption, Message, FormField } from '../../types/index.ts';
|
|
2
|
+
import { Message, FieldErrors, Control } from 'react-hook-form';
|
|
3
|
+
export type ChatFormContextValue = ReturnType<typeof useChatFormState>;
|
|
4
|
+
export declare function useChatFormState(): {
|
|
5
|
+
form: AIChatFormSettings | null;
|
|
6
|
+
openForm: (formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void;
|
|
7
|
+
closeForm: () => void;
|
|
8
|
+
handleSubmit: (e: React.FormEvent, conversation?: {
|
|
9
|
+
id: string;
|
|
10
|
+
messages: Message[];
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
isSuccess: boolean;
|
|
13
|
+
isSubmitting: boolean;
|
|
14
|
+
formError: Partial<{
|
|
15
|
+
type: string | number;
|
|
16
|
+
message: Message;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
getFields: (conversationId?: string) => FormField[];
|
|
19
|
+
errors: FieldErrors<Record<string, any>>;
|
|
20
|
+
control: Control<Record<string, any>, any>;
|
|
21
|
+
defaultValues: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
export declare const ChatFormProvider: React.FC<{
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const useChatForm: () => ChatFormContextValue;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DefaultInkeepAIChatSettings, DefaultInkeepBaseSettings, DefaultInkeepSearchSettings } from '../utils/default-settings';
|
|
3
|
+
import { InkeepConfig } from '../../types/index.ts';
|
|
4
|
+
export declare const WebWidgetInteractionType: {
|
|
5
|
+
readonly ChatButton: "ChatButton";
|
|
6
|
+
readonly CustomTrigger: "CustomTrigger";
|
|
7
|
+
readonly SearchBar: "SearchBar";
|
|
8
|
+
readonly EmbeddedChat: "EmbeddedChat";
|
|
9
|
+
readonly EmbeddedSearch: "EmbeddedSearch";
|
|
10
|
+
readonly EmbeddedSearchAndChat: "EmbeddedSearchAndChat";
|
|
11
|
+
readonly IntelligentForm: "IntelligentForm";
|
|
12
|
+
readonly SidebarChat: "SidebarChat";
|
|
13
|
+
};
|
|
14
|
+
export interface WidgetConfig extends InkeepConfig {
|
|
15
|
+
aiChatSettings: InkeepConfig['aiChatSettings'] & DefaultInkeepAIChatSettings;
|
|
16
|
+
baseSettings: InkeepConfig['baseSettings'] & DefaultInkeepBaseSettings;
|
|
17
|
+
searchSettings: InkeepConfig['searchSettings'] & DefaultInkeepSearchSettings;
|
|
18
|
+
}
|
|
19
|
+
interface InkeepConfigProviderProps {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
value?: Partial<InkeepConfig>;
|
|
22
|
+
}
|
|
23
|
+
export declare const InkeepConfigProvider: ({ children, value }: InkeepConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare const useInkeepConfig: () => WidgetConfig;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FeedbackItemType } from '../../types/index.ts';
|
|
2
|
+
export type FeedbackItemContextValue = {
|
|
3
|
+
name: FeedbackItemType;
|
|
4
|
+
focusItem: React.RefObject<HTMLElement | null>;
|
|
5
|
+
};
|
|
6
|
+
export declare const FeedbackItemProvider: React.FC<{
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
name: FeedbackItemType;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useFeedbackItem: () => FeedbackItemContextValue;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InkeepFeedback } from '../../types/index.ts';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type FeedbackContextValue = ReturnType<typeof useFeedback>;
|
|
4
|
+
export type MessageFeedbackItem = Record<string, InkeepFeedback>;
|
|
5
|
+
declare function useFeedback(): {
|
|
6
|
+
feedback: MessageFeedbackItem;
|
|
7
|
+
currentFeedback: string | null;
|
|
8
|
+
setCurrentFeedback: Dispatch<SetStateAction<string | null>>;
|
|
9
|
+
submitPositiveFeedback: (messageId: string) => Promise<void>;
|
|
10
|
+
submitNegativeFeedback: (messageId: string, reasonsData: Record<string, FormDataEntryValue>) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare const FeedbackProvider: React.FC<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const useMessageFeedback: () => FeedbackContextValue;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FormField } from '../../types/index.ts';
|
|
2
|
+
import { ControllerRenderProps, FieldErrors } from 'react-hook-form';
|
|
3
|
+
interface FormFieldCtx {
|
|
4
|
+
field: FormField;
|
|
5
|
+
fieldProps: ControllerRenderProps<Record<string, any>, string>;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FormFieldContextValue extends FormFieldCtx {
|
|
9
|
+
error: FieldErrors<Record<string, any>>[number];
|
|
10
|
+
}
|
|
11
|
+
export declare const FormFieldProvider: React.FC<{
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
} & FormFieldCtx>;
|
|
14
|
+
export declare const useFormField: () => FormFieldContextValue;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export type HelpMenuContextValue = ReturnType<typeof useHelpMenuState>;
|
|
3
|
+
export declare function useHelpMenuState(): {
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const HelpMenuProvider: React.FC<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
value: HelpMenuContextValue;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const useHelpMenu: () => HelpMenuContextValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type HoverPopoverContextValue = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
setOpen: (open: boolean) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const HoverPopoverProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
open: boolean;
|
|
8
|
+
setOpen: (open: boolean) => void;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useHoverPopover: () => HoverPopoverContextValue;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './attachment-item-provider';
|
|
2
|
+
export * from './attachments-bar-provider';
|
|
3
|
+
export * from './base-events-provider';
|
|
4
|
+
export * from './chat-form-provider';
|
|
5
|
+
export * from './config-provider';
|
|
6
|
+
export * from './feedback-item-provider';
|
|
7
|
+
export * from './feedback-provider';
|
|
8
|
+
export * from './form-field-provider';
|
|
9
|
+
export * from './help-menu-provider';
|
|
10
|
+
export * from './markdown-provider';
|
|
11
|
+
export * from './message-attachments-provider';
|
|
12
|
+
export * from './message-provider';
|
|
13
|
+
export * from './root-provider';
|
|
14
|
+
export * from './source-item-provider';
|
|
15
|
+
export * from './theme-provider';
|
|
16
|
+
export * from './widget-provider';
|
|
17
|
+
export * from './sidebar-chat-provider';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MarkdownComponentID } from '../utils/component-ids';
|
|
2
|
+
export type ChatMarkdownContextValue = {
|
|
3
|
+
componentStyles?: Partial<Record<MarkdownComponentID, string>>;
|
|
4
|
+
};
|
|
5
|
+
export declare const ChatMarkdownProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
componentStyles?: Partial<Record<MarkdownComponentID, string>>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useChatMarkdown: () => ChatMarkdownContextValue | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MessageAttachment } from '../../types/index.ts';
|
|
3
|
+
export type MessageAttachmentsContextValue = {
|
|
4
|
+
selectedItem: MessageAttachment | null;
|
|
5
|
+
selectItem: (input: MessageAttachmentsContextValue['selectedItem']) => void;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
onOpen: () => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function MessageAttachmentsProvider({ children }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const useMessageAttachments: () => MessageAttachmentsContextValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Message } from '../../types/index.ts';
|
|
2
|
+
export type MessageContextValue = {
|
|
3
|
+
message: Message;
|
|
4
|
+
};
|
|
5
|
+
export declare const MessageProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
message: Message;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useMessage: () => MessageContextValue;
|
|
10
|
+
export declare const useOptionalMessage: () => MessageContextValue | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WebWidgetInteractionType } from './config-provider';
|
|
2
|
+
import { InkeepConfig } from '../../types/index.ts';
|
|
3
|
+
export interface RootProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
config: Partial<InkeepConfig>;
|
|
6
|
+
componentType: (typeof WebWidgetInteractionType)[keyof typeof WebWidgetInteractionType];
|
|
7
|
+
}
|
|
8
|
+
export declare function RootProvider(props: RootProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InkeepEvent } from '../../types/index.ts';
|
|
2
|
+
export type SearchEventsContextValue = {
|
|
3
|
+
logEvent: (event: InkeepEvent) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const SearchEventsProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useSearchEvents: () => SearchEventsContextValue;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export interface SidebarChatProps {
|
|
3
|
+
/**
|
|
4
|
+
* The position of the sidebar chat.
|
|
5
|
+
* This also influences the resizing of the component.
|
|
6
|
+
* @default 'right'
|
|
7
|
+
*/
|
|
8
|
+
position?: 'left' | 'right';
|
|
9
|
+
/**
|
|
10
|
+
* The trigger selector for the sidebar chat.
|
|
11
|
+
* @default '[data-inkeep-sidebar-chat-trigger]'
|
|
12
|
+
*/
|
|
13
|
+
triggerSelector?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The minimum width of the sidebar chat.
|
|
16
|
+
* @default 250
|
|
17
|
+
*/
|
|
18
|
+
minWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The maximum width of the sidebar chat.
|
|
21
|
+
* @default 600
|
|
22
|
+
*/
|
|
23
|
+
maxWidth?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The default width of the sidebar chat.
|
|
26
|
+
* @default 400
|
|
27
|
+
*/
|
|
28
|
+
defaultWidth?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the sidebar is open by default.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
defaultOpen?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Controls whether the sidebar chat is open.
|
|
36
|
+
*/
|
|
37
|
+
isOpen?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Handler called when the sidebar chat opens or closes.
|
|
40
|
+
*/
|
|
41
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Threshold factor for auto-closing when resizing.
|
|
44
|
+
* When dragging below (minWidth * autoCloseThreshold), the sidebar will auto-close.
|
|
45
|
+
* @default 0.7 (70% of minimum width)
|
|
46
|
+
*/
|
|
47
|
+
autoCloseThreshold?: number;
|
|
48
|
+
}
|
|
49
|
+
export type SidebarChatContextValue = ReturnType<typeof useInkeepSidebarChat>;
|
|
50
|
+
export declare const SidebarChatProvider: React.FC<{
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
value: SidebarChatContextValue;
|
|
53
|
+
}>;
|
|
54
|
+
export declare const useSidebarChat: () => {
|
|
55
|
+
width: number;
|
|
56
|
+
setWidth: Dispatch<SetStateAction<number>>;
|
|
57
|
+
position: "left" | "right";
|
|
58
|
+
minWidth: number;
|
|
59
|
+
maxWidth: number;
|
|
60
|
+
autoCloseThreshold: number;
|
|
61
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
62
|
+
isOpen: boolean;
|
|
63
|
+
};
|
|
64
|
+
export declare const useOptionalSidebarChat: () => {
|
|
65
|
+
width: number;
|
|
66
|
+
setWidth: Dispatch<SetStateAction<number>>;
|
|
67
|
+
position: "left" | "right";
|
|
68
|
+
minWidth: number;
|
|
69
|
+
maxWidth: number;
|
|
70
|
+
autoCloseThreshold: number;
|
|
71
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
72
|
+
isOpen: boolean;
|
|
73
|
+
} | undefined;
|
|
74
|
+
export declare const useInkeepSidebarChat: ({ position, minWidth, maxWidth, defaultWidth, defaultOpen, autoCloseThreshold, isOpen, onOpenChange, }: SidebarChatProps) => {
|
|
75
|
+
width: number;
|
|
76
|
+
setWidth: Dispatch<SetStateAction<number>>;
|
|
77
|
+
position: "left" | "right";
|
|
78
|
+
minWidth: number;
|
|
79
|
+
maxWidth: number;
|
|
80
|
+
autoCloseThreshold: number;
|
|
81
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
82
|
+
isOpen: boolean;
|
|
83
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TransformedSource } from '../../types/index.ts';
|
|
2
|
+
export type TransformedSourceItem = TransformedSource & {
|
|
3
|
+
isExternal: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type SourceItemContextValue = {
|
|
6
|
+
source: TransformedSourceItem;
|
|
7
|
+
};
|
|
8
|
+
export declare const SourceItemProvider: React.FC<{
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
source: TransformedSourceItem;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const useSourceItem: () => SourceItemContextValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModalViewTypes } from '../../types/index.ts';
|
|
2
|
+
export type WidgetContextValue = {
|
|
3
|
+
setView: (view: ModalViewTypes) => void;
|
|
4
|
+
view: ModalViewTypes;
|
|
5
|
+
};
|
|
6
|
+
export declare const WidgetProvider: React.FC<{
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
widget: WidgetContextValue;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useWidget: () => WidgetContextValue | undefined;
|