@inkeep/agents-ui 0.14.27 → 0.15.0
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.cjs +1 -1
- package/dist/index.js +215 -203
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +1 -0
- package/dist/primitives/atoms/icons/built-in-icons.js +44 -43
- package/dist/primitives/atoms/icons/checkbox-icon.cjs +1 -1
- package/dist/primitives/atoms/icons/checkbox-icon.js +1 -1
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +3 -2
- package/dist/primitives/components/chat-bubble/index.cjs +1 -0
- package/dist/primitives/components/chat-bubble/index.d.ts +10 -0
- package/dist/primitives/components/chat-bubble/index.js +38 -0
- package/dist/primitives/components/chat-button.cjs +1 -1
- package/dist/primitives/components/chat-button.d.ts +3 -1
- package/dist/primitives/components/chat-button.js +31 -26
- package/dist/primitives/components/index.cjs +1 -1
- package/dist/primitives/components/index.d.ts +1 -0
- package/dist/primitives/components/index.js +19 -17
- package/dist/primitives/components/modal/use-inkeep-modal.cjs +1 -1
- package/dist/primitives/components/modal/use-inkeep-modal.d.ts +2 -2
- package/dist/primitives/components/modal/use-inkeep-modal.js +6 -42
- package/dist/primitives/components/modal/widget-auto-focus.cjs +1 -1
- package/dist/primitives/components/modal/widget-auto-focus.js +21 -12
- package/dist/primitives/components/modal.d.ts +2 -2
- package/dist/primitives/components/searchbar.d.ts +3 -3
- package/dist/primitives/components/sidebar-chat/index.cjs +1 -1
- package/dist/primitives/components/sidebar-chat/index.js +48 -67
- package/dist/primitives/components/use-component-trigger.cjs +1 -1
- package/dist/primitives/components/use-component-trigger.d.ts +1 -1
- package/dist/primitives/components/use-component-trigger.js +4 -3
- package/dist/primitives/hooks/index.cjs +1 -1
- package/dist/primitives/hooks/index.d.ts +1 -0
- package/dist/primitives/hooks/index.js +18 -16
- package/dist/primitives/hooks/use-inkeep-open-state.cjs +1 -0
- package/dist/primitives/hooks/use-inkeep-open-state.d.ts +18 -0
- package/dist/primitives/hooks/use-inkeep-open-state.js +47 -0
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +140 -130
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/providers/chat-bubble-provider.cjs +1 -0
- package/dist/primitives/providers/chat-bubble-provider.d.ts +22 -0
- package/dist/primitives/providers/chat-bubble-provider.js +19 -0
- package/dist/primitives/providers/config-provider.cjs +1 -1
- package/dist/primitives/providers/config-provider.d.ts +0 -1
- package/dist/primitives/providers/config-provider.js +12 -13
- package/dist/primitives/providers/index.cjs +1 -1
- package/dist/primitives/providers/index.d.ts +1 -0
- package/dist/primitives/providers/index.js +27 -22
- package/dist/primitives/providers/sidebar-chat-provider.cjs +1 -1
- package/dist/primitives/providers/sidebar-chat-provider.d.ts +3 -25
- package/dist/primitives/providers/sidebar-chat-provider.js +23 -27
- package/dist/primitives/utils/component-ids.cjs +1 -1
- package/dist/primitives/utils/component-ids.d.ts +10 -0
- package/dist/primitives/utils/component-ids.js +10 -3
- package/dist/react/chat-button.cjs +1 -1
- package/dist/react/chat-button.d.ts +23 -7
- package/dist/react/chat-button.js +55 -46
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.d.ts +4 -3
- package/dist/react/embedded-chat.js +171 -177
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +215 -203
- package/dist/react/modal.chat.cjs +1 -1
- package/dist/react/modal.chat.d.ts +6 -3
- package/dist/react/modal.chat.js +10 -10
- package/dist/react/modal.cjs +1 -1
- package/dist/react/modal.d.ts +2 -2
- package/dist/react/modal.js +5 -5
- package/dist/react/modal.search-and-chat.cjs +1 -1
- package/dist/react/modal.search-and-chat.d.ts +2 -2
- package/dist/react/modal.search-and-chat.js +15 -15
- package/dist/react/modal.search.cjs +1 -1
- package/dist/react/modal.search.d.ts +2 -2
- package/dist/react/modal.search.js +8 -8
- package/dist/react/searchbar.cjs +1 -1
- package/dist/react/searchbar.d.ts +4 -4
- package/dist/react/searchbar.js +12 -12
- package/dist/react/sidebar-chat.d.ts +1 -3
- package/dist/styled/components/chat-bubble.cjs +1 -0
- package/dist/styled/components/chat-bubble.d.ts +5 -0
- package/dist/styled/components/chat-bubble.js +70 -0
- package/dist/styled/components/chat-button.cjs +1 -1
- package/dist/styled/components/chat-button.d.ts +2 -1
- package/dist/styled/components/chat-button.js +10 -6
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.js +331 -320
- package/dist/styled/components/embedded-search.cjs +1 -1
- package/dist/styled/components/embedded-search.js +3 -3
- package/dist/styled/components/index.cjs +1 -1
- package/dist/styled/components/index.d.ts +1 -0
- package/dist/styled/components/index.js +14 -12
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +28 -25
- package/dist/styled/components/ui/recipes/button.cjs +1 -1
- package/dist/styled/components/ui/recipes/button.js +1 -1
- package/dist/styled/components/ui/recipes/checkbox.cjs +1 -1
- package/dist/styled/components/ui/recipes/checkbox.js +1 -1
- package/dist/styled/components/ui/recipes/input.cjs +1 -1
- package/dist/styled/components/ui/recipes/input.js +2 -2
- package/dist/styled/components/ui/recipes/markdown.cjs +1 -1
- package/dist/styled/components/ui/recipes/markdown.js +3 -3
- package/dist/styled/components/ui/recipes/select.cjs +1 -1
- package/dist/styled/components/ui/recipes/select.js +2 -2
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +174 -162
- package/dist/styled/inkeep.css.cjs +218 -99
- package/dist/styled/inkeep.css.js +218 -99
- package/dist/types/config/open-settings.d.ts +70 -0
- package/dist/types/config/settings/form.d.ts +0 -53
- package/dist/types/events.d.ts +9 -1
- package/dist/types/icons/built-in.d.ts +1 -1
- package/dist/types/icons/custom.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/js/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/config/modal.d.ts +0 -33
package/dist/primitives/index.js
CHANGED
|
@@ -1,155 +1,165 @@
|
|
|
1
|
-
import { AttachmentItemProvider as
|
|
2
|
-
import { AttachmentsBarProvider as f, useAttachmentsBar as
|
|
3
|
-
import { BaseEventsProvider as
|
|
4
|
-
import { ChatFormProvider as
|
|
5
|
-
import { InkeepConfigProvider as
|
|
6
|
-
import { FeedbackItemProvider as
|
|
7
|
-
import { FeedbackProvider as
|
|
8
|
-
import { FormFieldProvider as
|
|
1
|
+
import { AttachmentItemProvider as i, useAttachmentItem as n } from "./providers/attachment-item-provider.js";
|
|
2
|
+
import { AttachmentsBarProvider as f, useAttachmentsBar as x } from "./providers/attachments-bar-provider.js";
|
|
3
|
+
import { BaseEventsProvider as h, useBaseEvents as l } from "./providers/base-events-provider.js";
|
|
4
|
+
import { ChatFormProvider as b, useChatForm as v, useChatFormState as I } from "./providers/chat-form-provider.js";
|
|
5
|
+
import { InkeepConfigProvider as S, WebWidgetInteractionType as g, useInkeepConfig as B } from "./providers/config-provider.js";
|
|
6
|
+
import { FeedbackItemProvider as k, useFeedbackItem as F } from "./providers/feedback-item-provider.js";
|
|
7
|
+
import { FeedbackProvider as w, useMessageFeedback as y } from "./providers/feedback-provider.js";
|
|
8
|
+
import { FormFieldProvider as E, useFormField as O } from "./providers/form-field-provider.js";
|
|
9
9
|
import { HelpMenuProvider as T, useHelpMenu as D, useHelpMenuState as H } from "./providers/help-menu-provider.js";
|
|
10
|
-
import { ChatMarkdownProvider as
|
|
11
|
-
import { MessageAttachmentsProvider as
|
|
12
|
-
import { MessageProvider as
|
|
10
|
+
import { ChatMarkdownProvider as L, useChatMarkdown as j } from "./providers/markdown-provider.js";
|
|
11
|
+
import { MessageAttachmentsProvider as N, useMessageAttachments as Q } from "./providers/message-attachments-provider.js";
|
|
12
|
+
import { MessageProvider as $, useMessage as q, useOptionalMessage as G } from "./providers/message-provider.js";
|
|
13
13
|
import { RootProvider as V } from "./providers/root-provider.js";
|
|
14
14
|
import { SourceItemProvider as Y, useSourceItem as Z } from "./providers/source-item-provider.js";
|
|
15
|
-
import { ThemeProvider as
|
|
16
|
-
import { WidgetProvider as
|
|
17
|
-
import { SidebarChatProvider as me, useInkeepSidebarChat as
|
|
18
|
-
import {
|
|
15
|
+
import { ThemeProvider as ee } from "./providers/theme-provider.js";
|
|
16
|
+
import { WidgetProvider as re, useWidget as te } from "./providers/widget-provider.js";
|
|
17
|
+
import { SidebarChatProvider as me, useInkeepSidebarChat as se, useOptionalSidebarChat as pe, useSidebarChat as de } from "./providers/sidebar-chat-provider.js";
|
|
18
|
+
import { ChatBubbleProvider as ne, useChatBubble as ue, useInkeepChatBubble as fe, useOptionalChatBubble as xe } from "./providers/chat-bubble-provider.js";
|
|
19
|
+
import { ikp as he, jsxFactory as le } from "./components/factory.js";
|
|
19
20
|
import * as e from "./components/embedded-chat.js";
|
|
20
21
|
import * as o from "./components/sidebar-chat/index.js";
|
|
21
|
-
import { ChatProvider as
|
|
22
|
+
import { ChatProvider as be, useChat as ve } from "./components/embedded-chat/chat-provider.js";
|
|
22
23
|
import * as r from "./components/embedded-search.js";
|
|
23
|
-
import { SearchProvider as
|
|
24
|
+
import { SearchProvider as Pe, SearchProviderImpl as Se, useSearch as ge } from "./components/embedded-search/search-provider.js";
|
|
24
25
|
import * as t from "./components/modal.js";
|
|
25
|
-
import { ModalProvider as
|
|
26
|
-
import * as
|
|
27
|
-
import * as
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
26
|
+
import { ModalProvider as Me, useModal as ke } from "./components/modal/modal-provider.js";
|
|
27
|
+
import * as a from "./components/chat-button.js";
|
|
28
|
+
import * as m from "./components/searchbar.js";
|
|
29
|
+
import * as s from "./components/chat-bubble/index.js";
|
|
30
|
+
import { useBoolean as Ae } from "./hooks/use-boolean.js";
|
|
31
|
+
import { useComponentClassNames as ye } from "./hooks/use-component-classnames.js";
|
|
32
|
+
import { useContainerSize as Ee } from "./hooks/use-container-size.js";
|
|
33
|
+
import { useInkeepOpenState as We } from "./hooks/use-inkeep-open-state.js";
|
|
34
|
+
import { useCopyToClipboard as De } from "./hooks/use-copy-to-clipboard.js";
|
|
35
|
+
import { useInstantUpdate as ze } from "./hooks/use-instant-update.js";
|
|
36
|
+
import { useIsMounted as je } from "./hooks/use-is-mounted.js";
|
|
37
|
+
import { useMediaQuery as Ne } from "./hooks/use-media-query.js";
|
|
38
|
+
import { useResizeObserver as Ue } from "./hooks/use-resize-observer.js";
|
|
39
|
+
import { useScrollingFades as qe } from "./hooks/use-scrolling-fades.js";
|
|
40
|
+
import { useSettleAction as Je } from "./hooks/use-settle-action.js";
|
|
41
|
+
import { useSimpleScroll as Xe } from "./hooks/use-simple-scroll.js";
|
|
42
|
+
import { callAll as Ze, dataAttr as _e, getInitials as eo, getMessageContent as oo, isString as ro, maybeRender as to, toKebabCase as ao } from "./utils/misc.js";
|
|
43
|
+
import { ChatBubbleComponentIds as so, SearchBarComponentIds as po, SidebarChatComponentIds as io, aiChatComponentIds as no, aiSearchComponentIds as uo, chatButtonComponentIds as fo, componentIDs as xo, markDownComponentIds as Co, miscellanousComponentIds as ho, modalComponentIds as lo } from "./utils/component-ids.js";
|
|
44
|
+
import { composeRefs as bo, useComposedRefs as vo } from "./utils/compose-refs.js";
|
|
45
|
+
import { mergeProps as Po } from "./utils/merge-props.js";
|
|
46
|
+
import { Portal as go } from "./atoms/portal.js";
|
|
47
|
+
import { CustomIcon as Mo } from "./atoms/icons/custom-icon.js";
|
|
48
|
+
import { BuiltInIconRenderer as Fo } from "./atoms/icons/built-in-icon-renderer.js";
|
|
49
|
+
import { PortalWithTheme as wo } from "./atoms/portal-with-theme.js";
|
|
50
|
+
import { Command as Ro, CommandDialog as Eo, CommandEmpty as Oo, CommandInput as Wo, CommandItem as To, CommandList as Do, CommandLoading as Ho, CommandRoot as zo, CommandSeparator as Lo, defaultFilter as jo, useCommandState as Ko, useCommandStore as No } from "./atoms/cmdk/index.js";
|
|
51
|
+
import { ErrorBoundary as Uo } from "./atoms/error-boundary.js";
|
|
52
|
+
import { InkeepShadow as qo, InkeepShadowProvider as Go, ShadowContext as Jo, useShadow as Vo } from "./atoms/shadow/context.js";
|
|
50
53
|
export {
|
|
51
|
-
|
|
54
|
+
i as AttachmentItemProvider,
|
|
52
55
|
f as AttachmentsBarProvider,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
h as BaseEventsProvider,
|
|
57
|
+
Fo as BuiltInIconRenderer,
|
|
58
|
+
so as ChatBubbleComponentIds,
|
|
59
|
+
s as ChatBubblePrimitive,
|
|
60
|
+
ne as ChatBubbleProvider,
|
|
61
|
+
a as ChatButtonPrimitive,
|
|
62
|
+
b as ChatFormProvider,
|
|
63
|
+
L as ChatMarkdownProvider,
|
|
64
|
+
be as ChatProvider,
|
|
65
|
+
Ro as Command,
|
|
66
|
+
Eo as CommandDialog,
|
|
67
|
+
Oo as CommandEmpty,
|
|
68
|
+
Wo as CommandInput,
|
|
69
|
+
To as CommandItem,
|
|
70
|
+
Do as CommandList,
|
|
71
|
+
Ho as CommandLoading,
|
|
72
|
+
zo as CommandRoot,
|
|
73
|
+
Lo as CommandSeparator,
|
|
74
|
+
Mo as CustomIcon,
|
|
69
75
|
e as EmbeddedChatPrimitive,
|
|
70
76
|
r as EmbeddedSearchPrimitive,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
Uo as ErrorBoundary,
|
|
78
|
+
k as FeedbackItemProvider,
|
|
79
|
+
w as FeedbackProvider,
|
|
80
|
+
E as FormFieldProvider,
|
|
75
81
|
T as HelpMenuProvider,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
S as InkeepConfigProvider,
|
|
83
|
+
qo as InkeepShadow,
|
|
84
|
+
Go as InkeepShadowProvider,
|
|
85
|
+
N as MessageAttachmentsProvider,
|
|
86
|
+
$ as MessageProvider,
|
|
81
87
|
t as ModalPrimitive,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
Me as ModalProvider,
|
|
89
|
+
go as Portal,
|
|
90
|
+
wo as PortalWithTheme,
|
|
85
91
|
V as RootProvider,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
po as SearchBarComponentIds,
|
|
93
|
+
m as SearchBarPrimitive,
|
|
94
|
+
Pe as SearchProvider,
|
|
95
|
+
Se as SearchProviderImpl,
|
|
96
|
+
Jo as ShadowContext,
|
|
97
|
+
io as SidebarChatComponentIds,
|
|
92
98
|
o as SidebarChatPrimitive,
|
|
93
99
|
me as SidebarChatProvider,
|
|
94
100
|
Y as SourceItemProvider,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
101
|
+
ee as ThemeProvider,
|
|
102
|
+
g as WebWidgetInteractionType,
|
|
103
|
+
re as WidgetProvider,
|
|
104
|
+
no as aiChatComponentIds,
|
|
105
|
+
uo as aiSearchComponentIds,
|
|
106
|
+
Ze as callAll,
|
|
107
|
+
fo as chatButtonComponentIds,
|
|
108
|
+
xo as componentIDs,
|
|
109
|
+
bo as composeRefs,
|
|
110
|
+
_e as dataAttr,
|
|
111
|
+
jo as defaultFilter,
|
|
112
|
+
eo as getInitials,
|
|
113
|
+
oo as getMessageContent,
|
|
114
|
+
he as ikp,
|
|
115
|
+
ro as isString,
|
|
116
|
+
le as jsxFactory,
|
|
117
|
+
Co as markDownComponentIds,
|
|
118
|
+
to as maybeRender,
|
|
119
|
+
Po as mergeProps,
|
|
120
|
+
ho as miscellanousComponentIds,
|
|
121
|
+
lo as modalComponentIds,
|
|
122
|
+
ao as toKebabCase,
|
|
123
|
+
n as useAttachmentItem,
|
|
124
|
+
x as useAttachmentsBar,
|
|
125
|
+
l as useBaseEvents,
|
|
126
|
+
Ae as useBoolean,
|
|
127
|
+
ve as useChat,
|
|
128
|
+
ue as useChatBubble,
|
|
122
129
|
v as useChatForm,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
I as useChatFormState,
|
|
131
|
+
j as useChatMarkdown,
|
|
132
|
+
Ko as useCommandState,
|
|
133
|
+
No as useCommandStore,
|
|
134
|
+
ye as useComponentClassNames,
|
|
135
|
+
vo as useComposedRefs,
|
|
136
|
+
Ee as useContainerSize,
|
|
137
|
+
De as useCopyToClipboard,
|
|
138
|
+
F as useFeedbackItem,
|
|
139
|
+
O as useFormField,
|
|
133
140
|
D as useHelpMenu,
|
|
134
141
|
H as useHelpMenuState,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
fe as useInkeepChatBubble,
|
|
143
|
+
B as useInkeepConfig,
|
|
144
|
+
We as useInkeepOpenState,
|
|
145
|
+
se as useInkeepSidebarChat,
|
|
146
|
+
ze as useInstantUpdate,
|
|
147
|
+
je as useIsMounted,
|
|
148
|
+
Ne as useMediaQuery,
|
|
140
149
|
q as useMessage,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
150
|
+
Q as useMessageAttachments,
|
|
151
|
+
y as useMessageFeedback,
|
|
152
|
+
ke as useModal,
|
|
153
|
+
xe as useOptionalChatBubble,
|
|
144
154
|
G as useOptionalMessage,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
pe as useOptionalSidebarChat,
|
|
156
|
+
Ue as useResizeObserver,
|
|
157
|
+
qe as useScrollingFades,
|
|
158
|
+
ge as useSearch,
|
|
159
|
+
Je as useSettleAction,
|
|
160
|
+
Vo as useShadow,
|
|
151
161
|
de as useSidebarChat,
|
|
152
|
-
|
|
162
|
+
Xe as useSimpleScroll,
|
|
153
163
|
Z as useSourceItem,
|
|
154
|
-
|
|
164
|
+
te as useWidget
|
|
155
165
|
};
|
|
@@ -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.27",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;
|
|
@@ -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.27",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),o=require("../hooks/use-inkeep-open-state.cjs"),u=t.createContext(void 0),b=({children:e,value:n})=>r.jsx(u.Provider,{value:n,children:e}),s=()=>{const e=t.useContext(u);if(!e)throw new Error("useChatBubble must be used within a ChatBubbleProvider");return e},a=()=>t.useContext(u),c=e=>o.useInkeepOpenState(e,{eventNamePrefix:"chat_bubble"});exports.ChatBubbleProvider=b;exports.useChatBubble=s;exports.useInkeepChatBubble=c;exports.useOptionalChatBubble=a;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OpenSettingsChatButton } from '../../types/index.ts';
|
|
2
|
+
import { SetStateAction } from 'react';
|
|
3
|
+
export type ChatBubbleContextValue = ReturnType<typeof useInkeepChatBubble>;
|
|
4
|
+
export declare const ChatBubbleProvider: React.FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
value: ChatBubbleContextValue;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useChatBubble: () => {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
11
|
+
shortcutKey: string | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const useOptionalChatBubble: () => {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
16
|
+
shortcutKey: string | null | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export declare const useInkeepChatBubble: (props: OpenSettingsChatButton) => {
|
|
19
|
+
isOpen: boolean;
|
|
20
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
21
|
+
shortcutKey: string | null | undefined;
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as u, useContext as o } from "react";
|
|
4
|
+
import { useInkeepOpenState as b } from "../hooks/use-inkeep-open-state.js";
|
|
5
|
+
const t = u(void 0), i = ({ children: e, value: r }) => /* @__PURE__ */ n(t.Provider, { value: r, children: e }), h = () => {
|
|
6
|
+
const e = o(t);
|
|
7
|
+
if (!e)
|
|
8
|
+
throw new Error("useChatBubble must be used within a ChatBubbleProvider");
|
|
9
|
+
return e;
|
|
10
|
+
}, l = () => o(t), C = (e) => b(e, {
|
|
11
|
+
eventNamePrefix: "chat_bubble"
|
|
12
|
+
// No default trigger selector - chat buttons typically don't use click triggers
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
i as ChatBubbleProvider,
|
|
16
|
+
h as useChatBubble,
|
|
17
|
+
C as useInkeepChatBubble,
|
|
18
|
+
l as useOptionalChatBubble
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),f=require("merge-anything"),n=require("react"),t=require("../utils/default-settings.cjs"),m=require("../atoms/shadow/context.cjs"),s={ChatButton:"ChatButton",CustomTrigger:"CustomTrigger",SearchBar:"SearchBar",EmbeddedChat:"EmbeddedChat",EmbeddedSearch:"EmbeddedSearch",EmbeddedSearchAndChat:"EmbeddedSearchAndChat",SidebarChat:"SidebarChat"},a={prefix:"ikp",aiChatSettings:t.defaultInkeepAIChatSettings,baseSettings:t.defaultInkeepBaseSettings,searchSettings:t.defaultInkeepSearchSettings,componentType:s.EmbeddedChat},d=n.createContext(a),p=({children:e,value:r})=>{const c=m.useShadow(),u=(o,i,C)=>["baseSettings","searchSettings","aiChatSettings"].includes(C)&&!i?o:i,g={baseSettings:c??{}},h=n.useMemo(()=>f.mergeAndCompare(u,a,g,r??{}),[r]);return S.jsx(d.Provider,{value:h,children:e})},b=()=>{const e=n.useContext(d);if(!e)throw new Error("useInkeepConfig must be used within a ConfigProvider");return e};exports.InkeepConfigProvider=p;exports.WebWidgetInteractionType=s;exports.useInkeepConfig=b;
|
|
@@ -8,7 +8,6 @@ export declare const WebWidgetInteractionType: {
|
|
|
8
8
|
readonly EmbeddedChat: "EmbeddedChat";
|
|
9
9
|
readonly EmbeddedSearch: "EmbeddedSearch";
|
|
10
10
|
readonly EmbeddedSearchAndChat: "EmbeddedSearchAndChat";
|
|
11
|
-
readonly IntelligentForm: "IntelligentForm";
|
|
12
11
|
readonly SidebarChat: "SidebarChat";
|
|
13
12
|
};
|
|
14
13
|
export interface WidgetConfig extends InkeepConfig {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { mergeAndCompare as
|
|
4
|
-
import { useMemo as
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { mergeAndCompare as C } from "merge-anything";
|
|
4
|
+
import { useMemo as g, createContext as u, useContext as f } from "react";
|
|
5
5
|
import { defaultInkeepSearchSettings as p, defaultInkeepBaseSettings as S, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
|
|
6
6
|
import { useShadow as I } from "../atoms/shadow/context.js";
|
|
7
|
-
const
|
|
7
|
+
const k = {
|
|
8
8
|
ChatButton: "ChatButton",
|
|
9
9
|
CustomTrigger: "CustomTrigger",
|
|
10
10
|
SearchBar: "SearchBar",
|
|
11
11
|
EmbeddedChat: "EmbeddedChat",
|
|
12
12
|
EmbeddedSearch: "EmbeddedSearch",
|
|
13
13
|
EmbeddedSearchAndChat: "EmbeddedSearchAndChat",
|
|
14
|
-
IntelligentForm: "IntelligentForm",
|
|
15
14
|
SidebarChat: "SidebarChat"
|
|
16
15
|
}, o = {
|
|
17
16
|
prefix: "ikp",
|
|
@@ -19,20 +18,20 @@ const l = {
|
|
|
19
18
|
aiChatSettings: b,
|
|
20
19
|
baseSettings: S,
|
|
21
20
|
searchSettings: p,
|
|
22
|
-
componentType:
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
baseSettings:
|
|
26
|
-
}, c =
|
|
27
|
-
return /* @__PURE__ */
|
|
21
|
+
componentType: k.EmbeddedChat
|
|
22
|
+
}, a = u(o), A = ({ children: e, value: t }) => {
|
|
23
|
+
const i = I(), s = (n, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? n : r, d = {
|
|
24
|
+
baseSettings: i ?? {}
|
|
25
|
+
}, c = g(() => C(s, o, d, t ?? {}), [t]);
|
|
26
|
+
return /* @__PURE__ */ m(a.Provider, { value: c, children: e });
|
|
28
27
|
}, T = () => {
|
|
29
|
-
const e = f(
|
|
28
|
+
const e = f(a);
|
|
30
29
|
if (!e)
|
|
31
30
|
throw new Error("useInkeepConfig must be used within a ConfigProvider");
|
|
32
31
|
return e;
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
34
|
A as InkeepConfigProvider,
|
|
36
|
-
|
|
35
|
+
k as WebWidgetInteractionType,
|
|
37
36
|
T as useInkeepConfig
|
|
38
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./attachment-item-provider.cjs"),d=require("./attachments-bar-provider.cjs"),u=require("./base-events-provider.cjs"),t=require("./chat-form-provider.cjs"),o=require("./config-provider.cjs"),n=require("./feedback-item-provider.cjs"),v=require("./feedback-provider.cjs"),c=require("./form-field-provider.cjs"),s=require("./help-menu-provider.cjs"),P=require("./markdown-provider.cjs"),m=require("./message-attachments-provider.cjs"),i=require("./message-provider.cjs"),C=require("./root-provider.cjs"),h=require("./source-item-provider.cjs"),l=require("./theme-provider.cjs"),b=require("./widget-provider.cjs"),e=require("./sidebar-chat-provider.cjs"),r=require("./chat-bubble-provider.cjs");exports.AttachmentItemProvider=a.AttachmentItemProvider;exports.useAttachmentItem=a.useAttachmentItem;exports.AttachmentsBarProvider=d.AttachmentsBarProvider;exports.useAttachmentsBar=d.useAttachmentsBar;exports.BaseEventsProvider=u.BaseEventsProvider;exports.useBaseEvents=u.useBaseEvents;exports.ChatFormProvider=t.ChatFormProvider;exports.useChatForm=t.useChatForm;exports.useChatFormState=t.useChatFormState;exports.InkeepConfigProvider=o.InkeepConfigProvider;exports.WebWidgetInteractionType=o.WebWidgetInteractionType;exports.useInkeepConfig=o.useInkeepConfig;exports.FeedbackItemProvider=n.FeedbackItemProvider;exports.useFeedbackItem=n.useFeedbackItem;exports.FeedbackProvider=v.FeedbackProvider;exports.useMessageFeedback=v.useMessageFeedback;exports.FormFieldProvider=c.FormFieldProvider;exports.useFormField=c.useFormField;exports.HelpMenuProvider=s.HelpMenuProvider;exports.useHelpMenu=s.useHelpMenu;exports.useHelpMenuState=s.useHelpMenuState;exports.ChatMarkdownProvider=P.ChatMarkdownProvider;exports.useChatMarkdown=P.useChatMarkdown;exports.MessageAttachmentsProvider=m.MessageAttachmentsProvider;exports.useMessageAttachments=m.useMessageAttachments;exports.MessageProvider=i.MessageProvider;exports.useMessage=i.useMessage;exports.useOptionalMessage=i.useOptionalMessage;exports.RootProvider=C.RootProvider;exports.SourceItemProvider=h.SourceItemProvider;exports.useSourceItem=h.useSourceItem;exports.ThemeProvider=l.ThemeProvider;exports.WidgetProvider=b.WidgetProvider;exports.useWidget=b.useWidget;exports.SidebarChatProvider=e.SidebarChatProvider;exports.useInkeepSidebarChat=e.useInkeepSidebarChat;exports.useOptionalSidebarChat=e.useOptionalSidebarChat;exports.useSidebarChat=e.useSidebarChat;exports.ChatBubbleProvider=r.ChatBubbleProvider;exports.useChatBubble=r.useChatBubble;exports.useInkeepChatBubble=r.useInkeepChatBubble;exports.useOptionalChatBubble=r.useOptionalChatBubble;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { AttachmentItemProvider as o, useAttachmentItem as t } from "./attachment-item-provider.js";
|
|
2
2
|
import { AttachmentsBarProvider as s, useAttachmentsBar as m } from "./attachments-bar-provider.js";
|
|
3
|
-
import { BaseEventsProvider as i, useBaseEvents as
|
|
4
|
-
import { ChatFormProvider as n, useChatForm as f, useChatFormState as
|
|
5
|
-
import { InkeepConfigProvider as
|
|
6
|
-
import { FeedbackItemProvider as
|
|
7
|
-
import { FeedbackProvider as
|
|
8
|
-
import { FormFieldProvider as
|
|
9
|
-
import { HelpMenuProvider as
|
|
10
|
-
import { ChatMarkdownProvider as
|
|
3
|
+
import { BaseEventsProvider as i, useBaseEvents as u } from "./base-events-provider.js";
|
|
4
|
+
import { ChatFormProvider as n, useChatForm as f, useChatFormState as h } from "./chat-form-provider.js";
|
|
5
|
+
import { InkeepConfigProvider as x, WebWidgetInteractionType as P, useInkeepConfig as b } from "./config-provider.js";
|
|
6
|
+
import { FeedbackItemProvider as c, useFeedbackItem as l } from "./feedback-item-provider.js";
|
|
7
|
+
import { FeedbackProvider as F, useMessageFeedback as I } from "./feedback-provider.js";
|
|
8
|
+
import { FormFieldProvider as k, useFormField as B } from "./form-field-provider.js";
|
|
9
|
+
import { HelpMenuProvider as A, useHelpMenu as W, useHelpMenuState as H } from "./help-menu-provider.js";
|
|
10
|
+
import { ChatMarkdownProvider as w, useChatMarkdown as E } from "./markdown-provider.js";
|
|
11
11
|
import { MessageAttachmentsProvider as y, useMessageAttachments as R } from "./message-attachments-provider.js";
|
|
12
12
|
import { MessageProvider as q, useMessage as z, useOptionalMessage as D } from "./message-provider.js";
|
|
13
13
|
import { RootProvider as J } from "./root-provider.js";
|
|
@@ -15,40 +15,45 @@ import { SourceItemProvider as L, useSourceItem as N } from "./source-item-provi
|
|
|
15
15
|
import { ThemeProvider as U } from "./theme-provider.js";
|
|
16
16
|
import { WidgetProvider as X, useWidget as Y } from "./widget-provider.js";
|
|
17
17
|
import { SidebarChatProvider as _, useInkeepSidebarChat as $, useOptionalSidebarChat as ee, useSidebarChat as re } from "./sidebar-chat-provider.js";
|
|
18
|
+
import { ChatBubbleProvider as te, useChatBubble as ae, useInkeepChatBubble as se, useOptionalChatBubble as me } from "./chat-bubble-provider.js";
|
|
18
19
|
export {
|
|
19
20
|
o as AttachmentItemProvider,
|
|
20
21
|
s as AttachmentsBarProvider,
|
|
21
22
|
i as BaseEventsProvider,
|
|
23
|
+
te as ChatBubbleProvider,
|
|
22
24
|
n as ChatFormProvider,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
w as ChatMarkdownProvider,
|
|
26
|
+
c as FeedbackItemProvider,
|
|
27
|
+
F as FeedbackProvider,
|
|
28
|
+
k as FormFieldProvider,
|
|
29
|
+
A as HelpMenuProvider,
|
|
30
|
+
x as InkeepConfigProvider,
|
|
29
31
|
y as MessageAttachmentsProvider,
|
|
30
32
|
q as MessageProvider,
|
|
31
33
|
J as RootProvider,
|
|
32
34
|
_ as SidebarChatProvider,
|
|
33
35
|
L as SourceItemProvider,
|
|
34
36
|
U as ThemeProvider,
|
|
35
|
-
|
|
37
|
+
P as WebWidgetInteractionType,
|
|
36
38
|
X as WidgetProvider,
|
|
37
39
|
t as useAttachmentItem,
|
|
38
40
|
m as useAttachmentsBar,
|
|
39
|
-
|
|
41
|
+
u as useBaseEvents,
|
|
42
|
+
ae as useChatBubble,
|
|
40
43
|
f as useChatForm,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
h as useChatFormState,
|
|
45
|
+
E as useChatMarkdown,
|
|
46
|
+
l as useFeedbackItem,
|
|
47
|
+
B as useFormField,
|
|
45
48
|
W as useHelpMenu,
|
|
46
49
|
H as useHelpMenuState,
|
|
47
|
-
|
|
50
|
+
se as useInkeepChatBubble,
|
|
51
|
+
b as useInkeepConfig,
|
|
48
52
|
$ as useInkeepSidebarChat,
|
|
49
53
|
z as useMessage,
|
|
50
54
|
R as useMessageAttachments,
|
|
51
|
-
|
|
55
|
+
I as useMessageFeedback,
|
|
56
|
+
me as useOptionalChatBubble,
|
|
52
57
|
D as useOptionalMessage,
|
|
53
58
|
ee as useOptionalSidebarChat,
|
|
54
59
|
re as useSidebarChat,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),r=require("react"),C=require("../hooks/use-inkeep-open-state.cjs"),n=r.createContext(void 0),S=({children:e,value:t})=>b.jsx(n.Provider,{value:t,children:e}),l=()=>{const e=r.useContext(n);if(!e)throw new Error("useSidebarChat must be used within a SidebarChatProvider");return e},p=()=>r.useContext(n),x=250,I=600,v=420,O=({position:e="right",minWidth:t=x,maxWidth:a=I,defaultWidth:s=v,openSettings:o})=>{const{autoCloseThreshold:i=.7}=o??{},{isOpen:u,setOpen:c}=C.useInkeepOpenState(o,{eventNamePrefix:"sidebar_chat",defaultTriggerSelector:"[data-inkeep-sidebar-chat-trigger]"}),[d,h]=r.useState(Math.min(s,Math.floor((t+a)/2)));return{width:d,setWidth:h,position:e,minWidth:t,maxWidth:a,autoCloseThreshold:i,setOpen:c,isOpen:u}};exports.SidebarChatProvider=S;exports.useInkeepSidebarChat=O;exports.useOptionalSidebarChat=p;exports.useSidebarChat=l;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OpenSettingsSidebar } from '../../types';
|
|
1
2
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
3
|
export interface SidebarChatProps {
|
|
3
4
|
/**
|
|
@@ -6,11 +7,6 @@ export interface SidebarChatProps {
|
|
|
6
7
|
* @default 'right'
|
|
7
8
|
*/
|
|
8
9
|
position?: 'left' | 'right';
|
|
9
|
-
/**
|
|
10
|
-
* The trigger selector for the sidebar chat.
|
|
11
|
-
* @default '[data-inkeep-sidebar-chat-trigger]'
|
|
12
|
-
*/
|
|
13
|
-
triggerSelector?: string;
|
|
14
10
|
/**
|
|
15
11
|
* The minimum width of the sidebar chat.
|
|
16
12
|
* @default 250
|
|
@@ -26,25 +22,7 @@ export interface SidebarChatProps {
|
|
|
26
22
|
* @default 400
|
|
27
23
|
*/
|
|
28
24
|
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;
|
|
25
|
+
openSettings?: OpenSettingsSidebar;
|
|
48
26
|
}
|
|
49
27
|
export type SidebarChatContextValue = ReturnType<typeof useInkeepSidebarChat>;
|
|
50
28
|
export declare const SidebarChatProvider: React.FC<{
|
|
@@ -71,7 +49,7 @@ export declare const useOptionalSidebarChat: () => {
|
|
|
71
49
|
setOpen: (value: SetStateAction<boolean>) => void;
|
|
72
50
|
isOpen: boolean;
|
|
73
51
|
} | undefined;
|
|
74
|
-
export declare const useInkeepSidebarChat: ({ position, minWidth, maxWidth, defaultWidth,
|
|
52
|
+
export declare const useInkeepSidebarChat: ({ position, minWidth, maxWidth, defaultWidth, openSettings, }: SidebarChatProps) => {
|
|
75
53
|
width: number;
|
|
76
54
|
setWidth: Dispatch<SetStateAction<number>>;
|
|
77
55
|
position: "left" | "right";
|