@inkeep/agents-ui 0.14.28 → 0.15.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.
- package/dist/index.cjs +1 -1
- package/dist/index.js +220 -205
- 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/data-summaries.cjs +1 -0
- package/dist/primitives/components/data-summaries.d.ts +14 -0
- package/dist/primitives/components/data-summaries.js +38 -0
- package/dist/primitives/components/index.cjs +1 -1
- package/dist/primitives/components/index.d.ts +2 -0
- package/dist/primitives/components/index.js +21 -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 +155 -142
- 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/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 +34 -0
- package/dist/primitives/utils/component-ids.js +29 -8
- package/dist/react/chat-button.cjs +1 -1
- package/dist/react/chat-button.d.ts +7 -13
- 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 +220 -205
- package/dist/react/modal.chat.cjs +1 -1
- package/dist/react/modal.chat.d.ts +3 -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/data-summary-group.cjs +1 -1
- package/dist/styled/components/data-summary-group.js +62 -62
- 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 +182 -167
- 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/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,168 @@
|
|
|
1
|
-
import { AttachmentItemProvider as
|
|
2
|
-
import { AttachmentsBarProvider as
|
|
3
|
-
import { BaseEventsProvider as
|
|
4
|
-
import { ChatFormProvider as
|
|
5
|
-
import { InkeepConfigProvider as
|
|
6
|
-
import { FeedbackItemProvider as F, useFeedbackItem as
|
|
7
|
-
import { FeedbackProvider as
|
|
8
|
-
import { FormFieldProvider as
|
|
9
|
-
import { HelpMenuProvider as T, useHelpMenu as
|
|
10
|
-
import { ChatMarkdownProvider as
|
|
11
|
-
import { MessageAttachmentsProvider as
|
|
12
|
-
import { MessageProvider as
|
|
13
|
-
import { RootProvider as
|
|
14
|
-
import { SourceItemProvider as
|
|
15
|
-
import { ThemeProvider as
|
|
16
|
-
import { WidgetProvider as
|
|
17
|
-
import { SidebarChatProvider as
|
|
18
|
-
import {
|
|
1
|
+
import { AttachmentItemProvider as n, useAttachmentItem as u } from "./providers/attachment-item-provider.js";
|
|
2
|
+
import { AttachmentsBarProvider as x, useAttachmentsBar as C } from "./providers/attachments-bar-provider.js";
|
|
3
|
+
import { BaseEventsProvider as l, useBaseEvents as S } from "./providers/base-events-provider.js";
|
|
4
|
+
import { ChatFormProvider as v, useChatForm as I, useChatFormState as P } from "./providers/chat-form-provider.js";
|
|
5
|
+
import { InkeepConfigProvider as g, WebWidgetInteractionType as B, useInkeepConfig as M } from "./providers/config-provider.js";
|
|
6
|
+
import { FeedbackItemProvider as F, useFeedbackItem as y } from "./providers/feedback-item-provider.js";
|
|
7
|
+
import { FeedbackProvider as w, useMessageFeedback as R } from "./providers/feedback-provider.js";
|
|
8
|
+
import { FormFieldProvider as D, useFormField as O } from "./providers/form-field-provider.js";
|
|
9
|
+
import { HelpMenuProvider as T, useHelpMenu as H, useHelpMenuState as z } from "./providers/help-menu-provider.js";
|
|
10
|
+
import { ChatMarkdownProvider as j, useChatMarkdown as K } from "./providers/markdown-provider.js";
|
|
11
|
+
import { MessageAttachmentsProvider as Q, useMessageAttachments as U } from "./providers/message-attachments-provider.js";
|
|
12
|
+
import { MessageProvider as q, useMessage as G, useOptionalMessage as J } from "./providers/message-provider.js";
|
|
13
|
+
import { RootProvider as X } from "./providers/root-provider.js";
|
|
14
|
+
import { SourceItemProvider as Z, useSourceItem as _ } from "./providers/source-item-provider.js";
|
|
15
|
+
import { ThemeProvider as oe } from "./providers/theme-provider.js";
|
|
16
|
+
import { WidgetProvider as te, useWidget as ae } from "./providers/widget-provider.js";
|
|
17
|
+
import { SidebarChatProvider as se, useInkeepSidebarChat as pe, useOptionalSidebarChat as de, useSidebarChat as ie } from "./providers/sidebar-chat-provider.js";
|
|
18
|
+
import { ChatBubbleProvider as ue, useChatBubble as fe, useInkeepChatBubble as xe, useOptionalChatBubble as Ce } from "./providers/chat-bubble-provider.js";
|
|
19
|
+
import { ikp as le, jsxFactory as Se } 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 ve, useChat as Ie } 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 be, SearchProviderImpl as ge, useSearch as Be } 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 ke, useModal as Fe } 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 * as p from "./components/data-summaries.js";
|
|
31
|
+
import { useBoolean as Ae } from "./hooks/use-boolean.js";
|
|
32
|
+
import { useComponentClassNames as Re } from "./hooks/use-component-classnames.js";
|
|
33
|
+
import { useContainerSize as De } from "./hooks/use-container-size.js";
|
|
34
|
+
import { useInkeepOpenState as We } from "./hooks/use-inkeep-open-state.js";
|
|
35
|
+
import { useCopyToClipboard as He } from "./hooks/use-copy-to-clipboard.js";
|
|
36
|
+
import { useInstantUpdate as Le } from "./hooks/use-instant-update.js";
|
|
37
|
+
import { useIsMounted as Ke } from "./hooks/use-is-mounted.js";
|
|
38
|
+
import { useMediaQuery as Qe } from "./hooks/use-media-query.js";
|
|
39
|
+
import { useResizeObserver as $e } from "./hooks/use-resize-observer.js";
|
|
40
|
+
import { useScrollingFades as Ge } from "./hooks/use-scrolling-fades.js";
|
|
41
|
+
import { useSettleAction as Ve } from "./hooks/use-settle-action.js";
|
|
42
|
+
import { useSimpleScroll as Ye } from "./hooks/use-simple-scroll.js";
|
|
43
|
+
import { callAll as _e, dataAttr as eo, getInitials as oo, getMessageContent as ro, isString as to, maybeRender as ao, toKebabCase as mo } from "./utils/misc.js";
|
|
44
|
+
import { ChatBubbleComponentIds as po, DataSummaryComponentIds as io, SearchBarComponentIds as no, SidebarChatComponentIds as uo, aiChatComponentIds as fo, aiSearchComponentIds as xo, chatButtonComponentIds as Co, componentIDs as ho, markDownComponentIds as lo, miscellanousComponentIds as So, modalComponentIds as co } from "./utils/component-ids.js";
|
|
45
|
+
import { composeRefs as Io, useComposedRefs as Po } from "./utils/compose-refs.js";
|
|
46
|
+
import { mergeProps as go } from "./utils/merge-props.js";
|
|
47
|
+
import { Portal as Mo } from "./atoms/portal.js";
|
|
48
|
+
import { CustomIcon as Fo } from "./atoms/icons/custom-icon.js";
|
|
49
|
+
import { BuiltInIconRenderer as Ao } from "./atoms/icons/built-in-icon-renderer.js";
|
|
50
|
+
import { PortalWithTheme as Ro } from "./atoms/portal-with-theme.js";
|
|
51
|
+
import { Command as Do, CommandDialog as Oo, CommandEmpty as Wo, CommandInput as To, CommandItem as Ho, CommandList as zo, CommandLoading as Lo, CommandRoot as jo, CommandSeparator as Ko, defaultFilter as No, useCommandState as Qo, useCommandStore as Uo } from "./atoms/cmdk/index.js";
|
|
52
|
+
import { ErrorBoundary as qo } from "./atoms/error-boundary.js";
|
|
53
|
+
import { InkeepShadow as Jo, InkeepShadowProvider as Vo, ShadowContext as Xo, useShadow as Yo } from "./atoms/shadow/context.js";
|
|
50
54
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
n as AttachmentItemProvider,
|
|
56
|
+
x as AttachmentsBarProvider,
|
|
57
|
+
l as BaseEventsProvider,
|
|
58
|
+
Ao as BuiltInIconRenderer,
|
|
59
|
+
po as ChatBubbleComponentIds,
|
|
60
|
+
s as ChatBubblePrimitive,
|
|
61
|
+
ue as ChatBubbleProvider,
|
|
62
|
+
a as ChatButtonPrimitive,
|
|
63
|
+
v as ChatFormProvider,
|
|
64
|
+
j as ChatMarkdownProvider,
|
|
65
|
+
ve as ChatProvider,
|
|
66
|
+
Do as Command,
|
|
67
|
+
Oo as CommandDialog,
|
|
68
|
+
Wo as CommandEmpty,
|
|
69
|
+
To as CommandInput,
|
|
70
|
+
Ho as CommandItem,
|
|
71
|
+
zo as CommandList,
|
|
72
|
+
Lo as CommandLoading,
|
|
73
|
+
jo as CommandRoot,
|
|
74
|
+
Ko as CommandSeparator,
|
|
75
|
+
Fo as CustomIcon,
|
|
76
|
+
io as DataSummaryComponentIds,
|
|
77
|
+
p as DataSummaryPrimitive,
|
|
69
78
|
e as EmbeddedChatPrimitive,
|
|
70
79
|
r as EmbeddedSearchPrimitive,
|
|
71
|
-
|
|
80
|
+
qo as ErrorBoundary,
|
|
72
81
|
F as FeedbackItemProvider,
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
w as FeedbackProvider,
|
|
83
|
+
D as FormFieldProvider,
|
|
75
84
|
T as HelpMenuProvider,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
g as InkeepConfigProvider,
|
|
86
|
+
Jo as InkeepShadow,
|
|
87
|
+
Vo as InkeepShadowProvider,
|
|
88
|
+
Q as MessageAttachmentsProvider,
|
|
89
|
+
q as MessageProvider,
|
|
81
90
|
t as ModalPrimitive,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
ke as ModalProvider,
|
|
92
|
+
Mo as Portal,
|
|
93
|
+
Ro as PortalWithTheme,
|
|
94
|
+
X as RootProvider,
|
|
95
|
+
no as SearchBarComponentIds,
|
|
96
|
+
m as SearchBarPrimitive,
|
|
97
|
+
be as SearchProvider,
|
|
98
|
+
ge as SearchProviderImpl,
|
|
99
|
+
Xo as ShadowContext,
|
|
100
|
+
uo as SidebarChatComponentIds,
|
|
92
101
|
o as SidebarChatPrimitive,
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
122
|
-
|
|
102
|
+
se as SidebarChatProvider,
|
|
103
|
+
Z as SourceItemProvider,
|
|
104
|
+
oe as ThemeProvider,
|
|
105
|
+
B as WebWidgetInteractionType,
|
|
106
|
+
te as WidgetProvider,
|
|
107
|
+
fo as aiChatComponentIds,
|
|
108
|
+
xo as aiSearchComponentIds,
|
|
109
|
+
_e as callAll,
|
|
110
|
+
Co as chatButtonComponentIds,
|
|
111
|
+
ho as componentIDs,
|
|
112
|
+
Io as composeRefs,
|
|
113
|
+
eo as dataAttr,
|
|
114
|
+
No as defaultFilter,
|
|
115
|
+
oo as getInitials,
|
|
116
|
+
ro as getMessageContent,
|
|
117
|
+
le as ikp,
|
|
118
|
+
to as isString,
|
|
119
|
+
Se as jsxFactory,
|
|
120
|
+
lo as markDownComponentIds,
|
|
121
|
+
ao as maybeRender,
|
|
122
|
+
go as mergeProps,
|
|
123
|
+
So as miscellanousComponentIds,
|
|
124
|
+
co as modalComponentIds,
|
|
125
|
+
mo as toKebabCase,
|
|
126
|
+
u as useAttachmentItem,
|
|
127
|
+
C as useAttachmentsBar,
|
|
128
|
+
S as useBaseEvents,
|
|
129
|
+
Ae as useBoolean,
|
|
130
|
+
Ie as useChat,
|
|
131
|
+
fe as useChatBubble,
|
|
132
|
+
I as useChatForm,
|
|
123
133
|
P as useChatFormState,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
134
|
+
K as useChatMarkdown,
|
|
135
|
+
Qo as useCommandState,
|
|
136
|
+
Uo as useCommandStore,
|
|
137
|
+
Re as useComponentClassNames,
|
|
138
|
+
Po as useComposedRefs,
|
|
139
|
+
De as useContainerSize,
|
|
140
|
+
He as useCopyToClipboard,
|
|
141
|
+
y as useFeedbackItem,
|
|
142
|
+
O as useFormField,
|
|
143
|
+
H as useHelpMenu,
|
|
144
|
+
z as useHelpMenuState,
|
|
145
|
+
xe as useInkeepChatBubble,
|
|
146
|
+
M as useInkeepConfig,
|
|
147
|
+
We as useInkeepOpenState,
|
|
148
|
+
pe as useInkeepSidebarChat,
|
|
149
|
+
Le as useInstantUpdate,
|
|
150
|
+
Ke as useIsMounted,
|
|
151
|
+
Qe as useMediaQuery,
|
|
152
|
+
G as useMessage,
|
|
153
|
+
U as useMessageAttachments,
|
|
154
|
+
R as useMessageFeedback,
|
|
155
|
+
Fe as useModal,
|
|
156
|
+
Ce as useOptionalChatBubble,
|
|
157
|
+
J as useOptionalMessage,
|
|
158
|
+
de as useOptionalSidebarChat,
|
|
159
|
+
$e as useResizeObserver,
|
|
160
|
+
Ge as useScrollingFades,
|
|
161
|
+
Be as useSearch,
|
|
162
|
+
Ve as useSettleAction,
|
|
163
|
+
Yo as useShadow,
|
|
164
|
+
ie as useSidebarChat,
|
|
165
|
+
Ye as useSimpleScroll,
|
|
166
|
+
_ as useSourceItem,
|
|
167
|
+
ae as useWidget
|
|
155
168
|
};
|
|
@@ -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.
|
|
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.15.0",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.
|
|
8
|
+
widgetLibraryVersion: "0.15.0",
|
|
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 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";
|
|
@@ -1,41 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
const t = s(
|
|
2
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as b, useContext as s, useState as p } from "react";
|
|
4
|
+
import { useInkeepOpenState as S } from "../hooks/use-inkeep-open-state.js";
|
|
5
|
+
const r = b(void 0), v = ({ children: t, value: e }) => /* @__PURE__ */ C(r.Provider, { value: e, children: t }), g = () => {
|
|
6
|
+
const t = s(r);
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error("useSidebarChat must be used within a SidebarChatProvider");
|
|
9
9
|
return t;
|
|
10
|
-
},
|
|
10
|
+
}, w = () => s(r), x = 250, f = 600, l = 420, D = ({
|
|
11
11
|
position: t = "right",
|
|
12
12
|
minWidth: e = x,
|
|
13
|
-
maxWidth:
|
|
14
|
-
defaultWidth: a =
|
|
15
|
-
|
|
16
|
-
autoCloseThreshold: c = 0.7,
|
|
17
|
-
isOpen: n,
|
|
18
|
-
onOpenChange: u
|
|
13
|
+
maxWidth: o = f,
|
|
14
|
+
defaultWidth: a = l,
|
|
15
|
+
openSettings: n
|
|
19
16
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
17
|
+
const { autoCloseThreshold: i = 0.7 } = n ?? {}, { isOpen: c, setOpen: d } = S(n, {
|
|
18
|
+
eventNamePrefix: "sidebar_chat",
|
|
19
|
+
defaultTriggerSelector: "[data-inkeep-sidebar-chat-trigger]"
|
|
20
|
+
}), [h, u] = p(Math.min(a, Math.floor((e + o) / 2)));
|
|
25
21
|
return {
|
|
26
|
-
width:
|
|
27
|
-
setWidth:
|
|
22
|
+
width: h,
|
|
23
|
+
setWidth: u,
|
|
28
24
|
position: t,
|
|
29
25
|
minWidth: e,
|
|
30
|
-
maxWidth:
|
|
31
|
-
autoCloseThreshold:
|
|
32
|
-
setOpen:
|
|
33
|
-
isOpen:
|
|
26
|
+
maxWidth: o,
|
|
27
|
+
autoCloseThreshold: i,
|
|
28
|
+
setOpen: d,
|
|
29
|
+
isOpen: c
|
|
34
30
|
};
|
|
35
31
|
};
|
|
36
32
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
v as SidebarChatProvider,
|
|
34
|
+
D as useInkeepSidebarChat,
|
|
35
|
+
w as useOptionalSidebarChat,
|
|
36
|
+
g as useSidebarChat
|
|
41
37
|
};
|