@inkeep/agents-ui 0.16.0 → 0.16.2
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.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +167 -161
- package/dist/node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +2 -2
- package/dist/primitives/atoms/cmdk/index.cjs +1 -1
- package/dist/primitives/atoms/cmdk/index.js +14 -2
- package/dist/primitives/atoms/combobox.d.ts +104 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +4 -1
- package/dist/primitives/atoms/icons/built-in-icons.js +94 -91
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -1
- package/dist/primitives/atoms/icons/collections/pi.d.ts +3 -0
- package/dist/primitives/atoms/icons/collections/pi.js +82 -37
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -1
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +4 -1
- package/dist/primitives/atoms/portal.js +3 -3
- package/dist/primitives/atoms/select.cjs +1 -1
- package/dist/primitives/atoms/select.js +2 -2
- package/dist/primitives/atoms/shadow/context.js +4 -4
- package/dist/primitives/components/embedded-chat/chat-error-helpers.cjs +3 -0
- package/dist/primitives/components/embedded-chat/chat-error-helpers.d.ts +26 -0
- package/dist/primitives/components/embedded-chat/chat-error-helpers.js +32 -0
- package/dist/primitives/components/embedded-chat/file-upload-input.cjs +1 -1
- package/dist/primitives/components/embedded-chat/file-upload-input.d.ts +1 -2
- package/dist/primitives/components/embedded-chat/file-upload-input.js +359 -217
- package/dist/primitives/components/embedded-chat/image-preview-modal.js +3 -3
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-chat-action.js +16 -14
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +2 -4
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +1 -2
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +312 -284
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +1 -1
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.d.ts +2 -3
- package/dist/primitives/components/embedded-chat.js +122 -114
- package/dist/primitives/components/embedded-search/search-provider.js +3 -3
- package/dist/primitives/components/embedded-search.cjs +1 -1
- package/dist/primitives/components/embedded-search.d.ts +1 -1
- package/dist/primitives/components/embedded-search.js +3 -3
- package/dist/primitives/components/modal/modal-provider.js +2 -2
- package/dist/primitives/components/modal.js +3 -3
- package/dist/primitives/components/sidebar-chat/index.js +1 -1
- package/dist/primitives/components/tagline-logo-icon.js +50 -9
- package/dist/primitives/hooks/use-events-api.cjs +1 -0
- package/dist/primitives/hooks/use-events-api.d.ts +29 -0
- package/dist/primitives/hooks/use-events-api.js +43 -0
- package/dist/primitives/hooks/use-initial-conversation.js +4 -1
- package/dist/primitives/hooks/use-input-notification.js +9 -9
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +150 -144
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.d.ts +2 -0
- package/dist/primitives/providers/base-events-provider.js +23 -22
- package/dist/primitives/providers/chat-auth-provider.cjs +1 -0
- package/dist/primitives/providers/chat-auth-provider.d.ts +27 -0
- package/dist/primitives/providers/chat-auth-provider.js +46 -0
- package/dist/primitives/providers/chat-base-events-provider.cjs +1 -0
- package/dist/primitives/providers/chat-base-events-provider.d.ts +12 -0
- package/dist/primitives/providers/chat-base-events-provider.js +73 -0
- package/dist/primitives/providers/chat-bubble-provider.js +1 -1
- package/dist/primitives/providers/chat-form-provider.d.ts +1 -1
- package/dist/primitives/providers/chat-form-provider.js +4 -4
- package/dist/primitives/providers/chat-history-provider.js +3 -3
- package/dist/primitives/providers/config-provider.js +3 -3
- package/dist/primitives/providers/feedback-provider.cjs +1 -1
- package/dist/primitives/providers/feedback-provider.js +37 -31
- package/dist/primitives/providers/form-field-provider.js +3 -3
- package/dist/primitives/providers/help-menu-provider.js +4 -4
- package/dist/primitives/providers/hover-popover-provider.js +3 -3
- package/dist/primitives/providers/image-preview-provider.js +5 -5
- package/dist/primitives/providers/index.cjs +1 -1
- package/dist/primitives/providers/index.d.ts +2 -0
- package/dist/primitives/providers/index.js +57 -51
- package/dist/primitives/providers/markdown-provider.js +2 -2
- package/dist/primitives/providers/message-provider.js +1 -1
- package/dist/primitives/providers/sidebar-chat-provider.js +3 -3
- package/dist/primitives/providers/source-item-provider.js +3 -3
- package/dist/primitives/providers/widget-provider.js +2 -2
- package/dist/primitives/utils/misc.cjs +1 -1
- package/dist/primitives/utils/misc.js +2 -2
- package/dist/react/chat-button.js +1 -1
- package/dist/react/embedded-chat.cjs +1 -1
- package/dist/react/embedded-chat.js +104 -102
- package/dist/react/embedded-search.cjs +1 -1
- package/dist/react/embedded-search.js +18 -18
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +167 -161
- package/dist/styled/components/chat-bubble.js +4 -4
- package/dist/styled/components/chat-button.cjs +1 -1
- package/dist/styled/components/chat-button.js +9 -9
- package/dist/styled/components/chat-history.cjs +1 -1
- package/dist/styled/components/chat-history.js +22 -22
- package/dist/styled/components/embedded-chat/file-upload-input.cjs +1 -1
- package/dist/styled/components/embedded-chat/file-upload-input.js +71 -72
- package/dist/styled/components/embedded-chat/image-preview-modal.js +14 -7
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.js +211 -199
- package/dist/styled/components/embedded-search.cjs +1 -1
- package/dist/styled/components/embedded-search.js +72 -66
- package/dist/styled/components/loading-indicator.cjs +1 -1
- package/dist/styled/components/loading-indicator.js +1 -1
- package/dist/styled/components/message.cjs +1 -1
- package/dist/styled/components/message.js +142 -139
- package/dist/styled/components/modal.js +3 -3
- package/dist/styled/components/searchbar.js +8 -8
- package/dist/styled/components/sidebar-chat.cjs +1 -1
- package/dist/styled/components/sidebar-chat.js +5 -5
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +155 -149
- package/dist/styled/inkeep.css.cjs +13 -3
- package/dist/styled/inkeep.css.js +13 -3
- package/dist/theme/utils/generate-theme-variables.js +6 -6
- package/dist/types/config/ai.d.ts +5 -0
- package/dist/types/events.d.ts +11 -0
- package/dist/types/icons/built-in.d.ts +1 -1
- package/dist/types/icons/custom.d.ts +3 -0
- package/package.json +2 -2
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +0 -9
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.cjs +0 -0
- /package/dist/node_modules/.pnpm/{use-sync-external-store@1.5.0_react@19.0.0 → use-sync-external-store@1.6.0_react@19.3.0-canary-87ae75b3-20260128}/node_modules/use-sync-external-store/shim/index.js +0 -0
package/dist/primitives/index.js
CHANGED
|
@@ -1,164 +1,170 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import { BaseEventsContext as u, BaseEventsProvider as C, useBaseEvents as f } from "./providers/base-events-provider.js";
|
|
2
|
+
import { ChatAuthProvider as h, useChatAuth as l } from "./providers/chat-auth-provider.js";
|
|
3
|
+
import { ChatBaseEventsProvider as S } from "./providers/chat-base-events-provider.js";
|
|
4
|
+
import { ChatFormProvider as b, useChatForm as I, useChatFormState as c } from "./providers/chat-form-provider.js";
|
|
5
|
+
import { ChatHistoryProvider as B, useChatHistory as M } from "./providers/chat-history-provider.js";
|
|
6
|
+
import { InkeepConfigProvider as y, WebWidgetInteractionType as F, useInkeepConfig as E } from "./providers/config-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 z, useHelpMenuState as L } from "./providers/help-menu-provider.js";
|
|
10
|
+
import { ChatMarkdownProvider as j, useChatMarkdown as K } from "./providers/markdown-provider.js";
|
|
11
|
+
import { MessageProvider as Q, useMessage as U, useOptionalMessage as q } from "./providers/message-provider.js";
|
|
12
|
+
import { RootProvider as J } from "./providers/root-provider.js";
|
|
13
|
+
import { SourceItemProvider as X, useSourceItem as Y } from "./providers/source-item-provider.js";
|
|
14
|
+
import { ThemeProvider as _ } from "./providers/theme-provider.js";
|
|
15
|
+
import { WidgetProvider as oe, useWidget as re } from "./providers/widget-provider.js";
|
|
16
|
+
import { SidebarChatProvider as ae, useInkeepSidebarChat as me, useOptionalSidebarChat as se, useSidebarChat as ie } from "./providers/sidebar-chat-provider.js";
|
|
17
|
+
import { ChatBubbleProvider as de, useChatBubble as ne, useInkeepChatBubble as ue, useOptionalChatBubble as Ce } from "./providers/chat-bubble-provider.js";
|
|
18
|
+
import { ikp as xe, jsxFactory as he } from "./components/factory.js";
|
|
17
19
|
import * as e from "./components/embedded-chat.js";
|
|
18
20
|
import * as o from "./components/sidebar-chat/index.js";
|
|
19
|
-
import { ChatProvider as
|
|
21
|
+
import { ChatProvider as ve, useChat as Se } from "./components/embedded-chat/chat-provider.js";
|
|
20
22
|
import * as r from "./components/embedded-search.js";
|
|
21
|
-
import { SearchProvider as
|
|
23
|
+
import { SearchProvider as be, SearchProviderImpl as Ie, useSearch as ce } from "./components/embedded-search/search-provider.js";
|
|
22
24
|
import * as t from "./components/modal.js";
|
|
23
|
-
import { ModalProvider as
|
|
25
|
+
import { ModalProvider as Be, useModal as Me } from "./components/modal/modal-provider.js";
|
|
24
26
|
import * as a from "./components/chat-button.js";
|
|
25
27
|
import * as m from "./components/searchbar.js";
|
|
26
28
|
import * as s from "./components/chat-bubble/index.js";
|
|
27
29
|
import * as i from "./components/data-summaries.js";
|
|
28
30
|
import * as p from "./components/chat-history/index.js";
|
|
29
|
-
import { useBoolean as
|
|
30
|
-
import { useComponentClassNames as
|
|
31
|
-
import { useContainerSize as
|
|
32
|
-
import { useInkeepOpenState as
|
|
33
|
-
import { useCopyToClipboard as
|
|
34
|
-
import { useInstantUpdate as
|
|
35
|
-
import { useIsMounted as
|
|
36
|
-
import { useMediaQuery as
|
|
37
|
-
import { useResizeObserver as
|
|
38
|
-
import { useScrollingFades as
|
|
39
|
-
import { useSettleAction as
|
|
40
|
-
import { useSimpleScroll as
|
|
41
|
-
import { callAll as
|
|
42
|
-
import { ChatBubbleComponentIds as
|
|
43
|
-
import { composeRefs as
|
|
44
|
-
import { mergeProps as
|
|
45
|
-
import { Portal as
|
|
46
|
-
import { CustomIcon as
|
|
47
|
-
import { BuiltInIconRenderer as
|
|
48
|
-
import { PortalWithTheme as
|
|
49
|
-
import { Command as
|
|
50
|
-
import { ErrorBoundary as
|
|
51
|
-
import { InkeepShadow as
|
|
31
|
+
import { useBoolean as ye } from "./hooks/use-boolean.js";
|
|
32
|
+
import { useComponentClassNames as Ee } from "./hooks/use-component-classnames.js";
|
|
33
|
+
import { useContainerSize as we } from "./hooks/use-container-size.js";
|
|
34
|
+
import { useInkeepOpenState as Ae } from "./hooks/use-inkeep-open-state.js";
|
|
35
|
+
import { useCopyToClipboard as Oe } from "./hooks/use-copy-to-clipboard.js";
|
|
36
|
+
import { useInstantUpdate as Te } from "./hooks/use-instant-update.js";
|
|
37
|
+
import { useIsMounted as Le } from "./hooks/use-is-mounted.js";
|
|
38
|
+
import { useMediaQuery as je } from "./hooks/use-media-query.js";
|
|
39
|
+
import { useResizeObserver as Ne } from "./hooks/use-resize-observer.js";
|
|
40
|
+
import { useScrollingFades as Ue, useScrollingFadesHorizontal as qe } from "./hooks/use-scrolling-fades.js";
|
|
41
|
+
import { useSettleAction as Je } from "./hooks/use-settle-action.js";
|
|
42
|
+
import { useSimpleScroll as Xe } from "./hooks/use-simple-scroll.js";
|
|
43
|
+
import { callAll as Ze, dataAttr as _e, getInitials as eo, getMessageContent as oo, isCitationArtifact as ro, isString as to, maybeRender as ao, toKebabCase as mo } from "./utils/misc.js";
|
|
44
|
+
import { ChatBubbleComponentIds as io, DataSummaryComponentIds as po, SearchBarComponentIds as no, SidebarChatComponentIds as uo, aiChatComponentIds as Co, aiChatHistoryComponentIds as fo, aiSearchComponentIds as xo, chatButtonComponentIds as ho, componentIDs as lo, markDownComponentIds as vo, miscellanousComponentIds as So, modalComponentIds as Po } from "./utils/component-ids.js";
|
|
45
|
+
import { composeRefs as Io, useComposedRefs as co } from "./utils/compose-refs.js";
|
|
46
|
+
import { mergeProps as Bo } from "./utils/merge-props.js";
|
|
47
|
+
import { Portal as ko } from "./atoms/portal.js";
|
|
48
|
+
import { CustomIcon as Fo } from "./atoms/icons/custom-icon.js";
|
|
49
|
+
import { BuiltInIconRenderer as Ho } 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 zo, CommandList as Lo, CommandLoading as $o, CommandRoot as jo, CommandSeparator as Ko, defaultFilter as No, useCommandState as Qo, useCommandStore as Uo } from "./atoms/cmdk/index.js";
|
|
52
|
+
import { ErrorBoundary as Go } from "./atoms/error-boundary.js";
|
|
53
|
+
import { InkeepShadow as Vo, InkeepShadowProvider as Xo, ShadowContext as Yo, useShadow as Zo } from "./atoms/shadow/context.js";
|
|
52
54
|
export {
|
|
53
|
-
u as
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
u as BaseEventsContext,
|
|
56
|
+
C as BaseEventsProvider,
|
|
57
|
+
Ho as BuiltInIconRenderer,
|
|
58
|
+
h as ChatAuthProvider,
|
|
59
|
+
S as ChatBaseEventsProvider,
|
|
60
|
+
io as ChatBubbleComponentIds,
|
|
56
61
|
s as ChatBubblePrimitive,
|
|
57
|
-
|
|
62
|
+
de as ChatBubbleProvider,
|
|
58
63
|
a as ChatButtonPrimitive,
|
|
59
|
-
|
|
64
|
+
b as ChatFormProvider,
|
|
60
65
|
p as ChatHistoryPrimitive,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
B as ChatHistoryProvider,
|
|
67
|
+
j as ChatMarkdownProvider,
|
|
68
|
+
ve as ChatProvider,
|
|
69
|
+
Do as Command,
|
|
70
|
+
Oo as CommandDialog,
|
|
71
|
+
Wo as CommandEmpty,
|
|
72
|
+
To as CommandInput,
|
|
73
|
+
zo as CommandItem,
|
|
74
|
+
Lo as CommandList,
|
|
75
|
+
$o as CommandLoading,
|
|
76
|
+
jo as CommandRoot,
|
|
77
|
+
Ko as CommandSeparator,
|
|
78
|
+
Fo as CustomIcon,
|
|
79
|
+
po as DataSummaryComponentIds,
|
|
75
80
|
i as DataSummaryPrimitive,
|
|
76
81
|
e as EmbeddedChatPrimitive,
|
|
77
82
|
r as EmbeddedSearchPrimitive,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
Go as ErrorBoundary,
|
|
84
|
+
w as FeedbackProvider,
|
|
85
|
+
D as FormFieldProvider,
|
|
86
|
+
T as HelpMenuProvider,
|
|
87
|
+
y as InkeepConfigProvider,
|
|
88
|
+
Vo as InkeepShadow,
|
|
89
|
+
Xo as InkeepShadowProvider,
|
|
90
|
+
Q as MessageProvider,
|
|
86
91
|
t as ModalPrimitive,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
Be as ModalProvider,
|
|
93
|
+
ko as Portal,
|
|
94
|
+
Ro as PortalWithTheme,
|
|
95
|
+
J as RootProvider,
|
|
96
|
+
no as SearchBarComponentIds,
|
|
92
97
|
m as SearchBarPrimitive,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
be as SearchProvider,
|
|
99
|
+
Ie as SearchProviderImpl,
|
|
100
|
+
Yo as ShadowContext,
|
|
101
|
+
uo as SidebarChatComponentIds,
|
|
97
102
|
o as SidebarChatPrimitive,
|
|
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
|
-
|
|
123
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
103
|
+
ae as SidebarChatProvider,
|
|
104
|
+
X as SourceItemProvider,
|
|
105
|
+
_ as ThemeProvider,
|
|
106
|
+
F as WebWidgetInteractionType,
|
|
107
|
+
oe as WidgetProvider,
|
|
108
|
+
Co as aiChatComponentIds,
|
|
109
|
+
fo as aiChatHistoryComponentIds,
|
|
110
|
+
xo as aiSearchComponentIds,
|
|
111
|
+
Ze as callAll,
|
|
112
|
+
ho as chatButtonComponentIds,
|
|
113
|
+
lo as componentIDs,
|
|
114
|
+
Io as composeRefs,
|
|
115
|
+
_e as dataAttr,
|
|
116
|
+
No as defaultFilter,
|
|
117
|
+
eo as getInitials,
|
|
118
|
+
oo as getMessageContent,
|
|
119
|
+
xe as ikp,
|
|
120
|
+
ro as isCitationArtifact,
|
|
121
|
+
to as isString,
|
|
122
|
+
he as jsxFactory,
|
|
123
|
+
vo as markDownComponentIds,
|
|
124
|
+
ao as maybeRender,
|
|
125
|
+
Bo as mergeProps,
|
|
126
|
+
So as miscellanousComponentIds,
|
|
127
|
+
Po as modalComponentIds,
|
|
128
|
+
mo as toKebabCase,
|
|
129
|
+
f as useBaseEvents,
|
|
130
|
+
ye as useBoolean,
|
|
131
|
+
Se as useChat,
|
|
132
|
+
l as useChatAuth,
|
|
133
|
+
ne as useChatBubble,
|
|
134
|
+
I as useChatForm,
|
|
135
|
+
c as useChatFormState,
|
|
136
|
+
M as useChatHistory,
|
|
137
|
+
K as useChatMarkdown,
|
|
138
|
+
Qo as useCommandState,
|
|
139
|
+
Uo as useCommandStore,
|
|
140
|
+
Ee as useComponentClassNames,
|
|
141
|
+
co as useComposedRefs,
|
|
142
|
+
we as useContainerSize,
|
|
143
|
+
Oe as useCopyToClipboard,
|
|
144
|
+
O as useFormField,
|
|
145
|
+
z as useHelpMenu,
|
|
146
|
+
L as useHelpMenuState,
|
|
147
|
+
ue as useInkeepChatBubble,
|
|
148
|
+
E as useInkeepConfig,
|
|
149
|
+
Ae as useInkeepOpenState,
|
|
150
|
+
me as useInkeepSidebarChat,
|
|
151
|
+
Te as useInstantUpdate,
|
|
152
|
+
Le as useIsMounted,
|
|
153
|
+
je as useMediaQuery,
|
|
154
|
+
U as useMessage,
|
|
155
|
+
R as useMessageFeedback,
|
|
156
|
+
Me as useModal,
|
|
157
|
+
Ce as useOptionalChatBubble,
|
|
158
|
+
q as useOptionalMessage,
|
|
159
|
+
se as useOptionalSidebarChat,
|
|
160
|
+
Ne as useResizeObserver,
|
|
161
|
+
Ue as useScrollingFades,
|
|
162
|
+
qe as useScrollingFadesHorizontal,
|
|
163
|
+
ce as useSearch,
|
|
164
|
+
Je as useSettleAction,
|
|
165
|
+
Zo as useShadow,
|
|
166
|
+
ie as useSidebarChat,
|
|
167
|
+
Xe as useSimpleScroll,
|
|
168
|
+
Y as useSourceItem,
|
|
169
|
+
re as useWidget
|
|
164
170
|
};
|
|
@@ -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 l=require("react/jsx-runtime"),t=require("react"),p=require("./config-provider.cjs"),n=t.createContext(void 0),g=({children:e})=>{const{baseSettings:s,componentType:o}=p.useInkeepConfig(),{tags:r,analyticsProperties:i}=s,c="0.16.2",a=t.useMemo(()=>({widgetLibraryVersion:c,componentType:o,tags:r}),[o,r,c]),v={logEvent:t.useCallback(async u=>{const E={...a,...u.properties,...i},d={eventName:u.eventName,properties:E};return s.onEvent?.(d)},[s,a,i])};return l.jsx(n.Provider,{value:v,children:e})},m=()=>{const e=t.useContext(n);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsContext=n;exports.BaseEventsProvider=g;exports.useBaseEvents=m;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { InkeepEvent } from '../../types/index.ts';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
export declare const BaseEventsContext: Context<BaseEventsContextValue | undefined>;
|
|
2
4
|
export type BaseEventsContextValue = {
|
|
3
5
|
logEvent: (event: InkeepEvent) => Promise<void>;
|
|
4
6
|
};
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import { useInkeepConfig as
|
|
5
|
-
const
|
|
6
|
-
const { baseSettings: t, componentType: o } =
|
|
2
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as E, useMemo as d, useCallback as l, useContext as g } from "react";
|
|
4
|
+
import { useInkeepConfig as x } from "./config-provider.js";
|
|
5
|
+
const c = E(void 0), b = ({ children: e }) => {
|
|
6
|
+
const { baseSettings: t, componentType: o } = x(), { tags: s, analyticsProperties: n } = t, r = "0.16.2", i = d(
|
|
7
7
|
() => ({
|
|
8
|
-
widgetLibraryVersion:
|
|
8
|
+
widgetLibraryVersion: r,
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|
|
12
|
-
[o, s]
|
|
13
|
-
),
|
|
14
|
-
async (
|
|
15
|
-
const
|
|
16
|
-
...
|
|
17
|
-
...
|
|
12
|
+
[o, s, r]
|
|
13
|
+
), v = { logEvent: l(
|
|
14
|
+
async (a) => {
|
|
15
|
+
const m = {
|
|
16
|
+
...i,
|
|
17
|
+
...a.properties,
|
|
18
18
|
...n
|
|
19
|
-
},
|
|
20
|
-
eventName:
|
|
21
|
-
properties:
|
|
19
|
+
}, p = {
|
|
20
|
+
eventName: a.eventName,
|
|
21
|
+
properties: m
|
|
22
22
|
};
|
|
23
|
-
return t.onEvent?.(
|
|
23
|
+
return t.onEvent?.(p);
|
|
24
24
|
},
|
|
25
|
-
[t,
|
|
25
|
+
[t, i, n]
|
|
26
26
|
) };
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
},
|
|
29
|
-
const e =
|
|
27
|
+
return /* @__PURE__ */ u(c.Provider, { value: v, children: e });
|
|
28
|
+
}, w = () => {
|
|
29
|
+
const e = g(c);
|
|
30
30
|
if (!e)
|
|
31
31
|
throw new Error("useBaseEvents must be used within a BaseEventsProvider");
|
|
32
32
|
return e;
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
36
|
-
b as
|
|
35
|
+
c as BaseEventsContext,
|
|
36
|
+
b as BaseEventsProvider,
|
|
37
|
+
w as useBaseEvents
|
|
37
38
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),d=require("react"),T=require("./config-provider.cjs"),O=require("../components/modal/modal-provider.cjs"),m=require("./chat-bubble-provider.cjs"),x=require("./sidebar-chat-provider.cjs"),B=require("../hooks/use-auth-token.cjs"),R=require("../components/embedded-chat/use-captcha.cjs"),w=require("../hooks/use-anonymous-session.cjs"),l=d.createContext(void 0),I=({children:e})=>{const{baseSettings:n,aiChatSettings:p}=T.useInkeepConfig(),{shouldBypassCaptcha:C,privacyPreferences:A}=n,{baseUrl:i,appId:b,apiKey:s}=p,v=O.useModal(),f=m.useOptionalChatBubble(),g=x.useOptionalSidebarChat(),k=v?.isOpen??f?.isOpen??g?.isOpen??!0,{authToken:o,isLoading:a,refreshToken:q}=B.useAuthToken(),y=!!n.getAuthToken,t=!!o,{getCaptchaHeader:r,invalidate:u}=R.useCaptcha({baseUrl:i,shouldBypassCaptcha:C||!!s,shouldMakeInitialRequest:k}),{sessionToken:c,refreshSession:h}=w.useAnonymousSession({baseUrl:i,appId:b,getCaptchaHeader:r,invalidateCaptcha:u,optOutAllAnalytics:A?.optOutAllAnalytics,enabled:!t&&!a}),P={authToken:o,isAuthenticated:t,isAuthLoading:a,isAuthConfigured:y,refreshAuthToken:q,sessionToken:c,refreshSession:h,getCaptchaHeader:r,invalidateCaptcha:u,effectiveAuthToken:s??(t?o:c),applicableRefreshSession:s||t?void 0:h};return S.jsx(l.Provider,{value:P,children:e})},j=()=>{const e=d.useContext(l);if(!e)throw new Error("useChatAuth must be used within a ChatAuthProvider");return e};exports.ChatAuthProvider=I;exports.useChatAuth=j;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ChatAuthContextValue {
|
|
2
|
+
authToken: string | null;
|
|
3
|
+
isAuthenticated: boolean;
|
|
4
|
+
isAuthLoading: boolean;
|
|
5
|
+
isAuthConfigured: boolean;
|
|
6
|
+
refreshAuthToken: () => Promise<string | null>;
|
|
7
|
+
sessionToken: string | null;
|
|
8
|
+
refreshSession: () => Promise<string | null>;
|
|
9
|
+
getCaptchaHeader: () => Promise<Record<string, string>>;
|
|
10
|
+
invalidateCaptcha: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Resolved bearer token, in priority order:
|
|
13
|
+
* apiKey ?? (isAuthenticated ? authToken : sessionToken)
|
|
14
|
+
* This is what should be sent as `Authorization: Bearer <token>` for run API calls.
|
|
15
|
+
*/
|
|
16
|
+
effectiveAuthToken: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* The `refreshSession` callback to pass into `useInkeepApiClient` for 401 retries.
|
|
19
|
+
* Undefined when `apiKey` or JWT auth is in use, since neither has an anonymous
|
|
20
|
+
* session to refresh — in those modes a 401 is terminal and shouldn't retry.
|
|
21
|
+
*/
|
|
22
|
+
applicableRefreshSession: (() => Promise<string | null>) | undefined;
|
|
23
|
+
}
|
|
24
|
+
export declare const ChatAuthProvider: React.FC<{
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const useChatAuth: () => ChatAuthContextValue;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as y, createContext as S } from "react";
|
|
4
|
+
import { useInkeepConfig as x } from "./config-provider.js";
|
|
5
|
+
import { useModal as w } from "../components/modal/modal-provider.js";
|
|
6
|
+
import { useOptionalChatBubble as B } from "./chat-bubble-provider.js";
|
|
7
|
+
import { useOptionalSidebarChat as I } from "./sidebar-chat-provider.js";
|
|
8
|
+
import { useAuthToken as P } from "../hooks/use-auth-token.js";
|
|
9
|
+
import { useCaptcha as R } from "../components/embedded-chat/use-captcha.js";
|
|
10
|
+
import { useAnonymousSession as L } from "../hooks/use-anonymous-session.js";
|
|
11
|
+
const p = S(void 0), J = ({ children: t }) => {
|
|
12
|
+
const { baseSettings: n, aiChatSettings: l } = x(), { shouldBypassCaptcha: d, privacyPreferences: f } = n, { baseUrl: i, appId: m, apiKey: o } = l, C = w(), A = B(), b = I(), v = C?.isOpen ?? A?.isOpen ?? b?.isOpen ?? !0, { authToken: s, isLoading: a, refreshToken: k } = P(), g = !!n.getAuthToken, e = !!s, { getCaptchaHeader: r, invalidate: u } = R({
|
|
13
|
+
baseUrl: i,
|
|
14
|
+
shouldBypassCaptcha: d || !!o,
|
|
15
|
+
shouldMakeInitialRequest: v
|
|
16
|
+
}), { sessionToken: h, refreshSession: c } = L({
|
|
17
|
+
baseUrl: i,
|
|
18
|
+
appId: m,
|
|
19
|
+
getCaptchaHeader: r,
|
|
20
|
+
invalidateCaptcha: u,
|
|
21
|
+
optOutAllAnalytics: f?.optOutAllAnalytics,
|
|
22
|
+
enabled: !e && !a
|
|
23
|
+
}), O = {
|
|
24
|
+
authToken: s,
|
|
25
|
+
isAuthenticated: e,
|
|
26
|
+
isAuthLoading: a,
|
|
27
|
+
isAuthConfigured: g,
|
|
28
|
+
refreshAuthToken: k,
|
|
29
|
+
sessionToken: h,
|
|
30
|
+
refreshSession: c,
|
|
31
|
+
getCaptchaHeader: r,
|
|
32
|
+
invalidateCaptcha: u,
|
|
33
|
+
effectiveAuthToken: o ?? (e ? s : h),
|
|
34
|
+
applicableRefreshSession: o || e ? void 0 : c
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ T(p.Provider, { value: O, children: t });
|
|
37
|
+
}, N = () => {
|
|
38
|
+
const t = y(p);
|
|
39
|
+
if (!t)
|
|
40
|
+
throw new Error("useChatAuth must be used within a ChatAuthProvider");
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
J as ChatAuthProvider,
|
|
45
|
+
N as useChatAuth
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),g=require("react"),j=require("./config-provider.cjs"),B=require("./chat-auth-provider.cjs"),O=require("../hooks/use-events-api.cjs"),U=require("./base-events-provider.cjs"),x=({children:h})=>{const{baseSettings:n,aiChatSettings:y,componentType:c}=j.useInkeepConfig(),{tags:t,analyticsProperties:r,privacyPreferences:b,userProperties:o}=n,p="0.16.2",a=g.useMemo(()=>({widgetLibraryVersion:p,componentType:c}),[c,p]),{effectiveAuthToken:i,applicableRefreshSession:f,getCaptchaHeader:E,invalidateCaptcha:P}=B.useChatAuth(),{baseUrl:m,appId:A,analyticsApiBaseUrl:C}=y,l=b?.optOutAllAnalytics??!1,{logEvent:v}=O.useEventsApi({baseUrl:C??m,appId:A,authToken:i,getCaptchaHeader:E,invalidateCaptcha:P,refreshSession:f}),I={logEvent:g.useCallback(async s=>{const k={eventName:s.eventName,properties:{...a,...t?{tags:t}:{},...s.properties,...r}};if(!l&&i){const e=s.properties??{},u=typeof e.conversationId=="string"?e.conversationId:void 0,d=typeof e.messageId=="string"?e.messageId:void 0,q=!!o&&Object.keys(o).length>0,S={...t?{tags:t}:{},...r??{}},w={...a,...s.properties};v({body:{type:s.eventName,...u?{conversationId:u}:{},...d?{messageId:d}:{},...q?{userProperties:o}:{},properties:S,metadata:w}})}try{return await n.onEvent?.(k)}catch(e){console.warn("[events] onEvent callback threw",e)}},[n,a,t,r,v,l,i,o])};return T.jsx(U.BaseEventsContext.Provider,{value:I,children:h})};exports.ChatBaseEventsProvider=x;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-publishes BaseEventsContext for the chat subtree with an augmented logger
|
|
3
|
+
* that also POSTs to /run/v1/events. Outer BaseEventsProvider (search-side, no
|
|
4
|
+
* API) is unaffected — chat-tree consumers see this provider's logger, everyone
|
|
5
|
+
* else (widget triggers, search) sees the simple onEvent-only logger.
|
|
6
|
+
*
|
|
7
|
+
* Reads auth from ChatAuthProvider (parent), not useChat (child) — this is the
|
|
8
|
+
* direction-flip that breaks the previous cycle.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ChatBaseEventsProvider: React.FC<{
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as U, useCallback as x } from "react";
|
|
4
|
+
import { useInkeepConfig as B } from "./config-provider.js";
|
|
5
|
+
import { useChatAuth as N } from "./chat-auth-provider.js";
|
|
6
|
+
import { useEventsApi as O } from "../hooks/use-events-api.js";
|
|
7
|
+
import { BaseEventsContext as j } from "./base-events-provider.js";
|
|
8
|
+
const D = ({ children: g }) => {
|
|
9
|
+
const { baseSettings: n, aiChatSettings: f, componentType: c } = B(), { tags: t, analyticsProperties: r, privacyPreferences: u, userProperties: o } = n, p = "0.16.2", a = U(
|
|
10
|
+
() => ({
|
|
11
|
+
widgetLibraryVersion: p,
|
|
12
|
+
componentType: c
|
|
13
|
+
}),
|
|
14
|
+
[c, p]
|
|
15
|
+
), { effectiveAuthToken: i, applicableRefreshSession: h, getCaptchaHeader: y, invalidateCaptcha: b } = N(), { baseUrl: A, appId: E, analyticsApiBaseUrl: C } = f, l = u?.optOutAllAnalytics ?? !1, { logEvent: v } = O({
|
|
16
|
+
baseUrl: C ?? A,
|
|
17
|
+
appId: E,
|
|
18
|
+
authToken: i,
|
|
19
|
+
getCaptchaHeader: y,
|
|
20
|
+
invalidateCaptcha: b,
|
|
21
|
+
refreshSession: h
|
|
22
|
+
}), I = { logEvent: x(
|
|
23
|
+
async (s) => {
|
|
24
|
+
const P = {
|
|
25
|
+
eventName: s.eventName,
|
|
26
|
+
properties: {
|
|
27
|
+
...a,
|
|
28
|
+
...t ? { tags: t } : {},
|
|
29
|
+
...s.properties,
|
|
30
|
+
...r
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
if (!l && i) {
|
|
34
|
+
const e = s.properties ?? {}, m = typeof e.conversationId == "string" ? e.conversationId : void 0, d = typeof e.messageId == "string" ? e.messageId : void 0, k = !!o && Object.keys(o).length > 0, w = {
|
|
35
|
+
...t ? { tags: t } : {},
|
|
36
|
+
...r ?? {}
|
|
37
|
+
}, S = {
|
|
38
|
+
...a,
|
|
39
|
+
...s.properties
|
|
40
|
+
};
|
|
41
|
+
v({
|
|
42
|
+
body: {
|
|
43
|
+
type: s.eventName,
|
|
44
|
+
...m ? { conversationId: m } : {},
|
|
45
|
+
...d ? { messageId: d } : {},
|
|
46
|
+
...k ? { userProperties: o } : {},
|
|
47
|
+
properties: w,
|
|
48
|
+
metadata: S
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
return await n.onEvent?.(P);
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.warn("[events] onEvent callback threw", e);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[
|
|
59
|
+
n,
|
|
60
|
+
a,
|
|
61
|
+
t,
|
|
62
|
+
r,
|
|
63
|
+
v,
|
|
64
|
+
l,
|
|
65
|
+
i,
|
|
66
|
+
o
|
|
67
|
+
]
|
|
68
|
+
) };
|
|
69
|
+
return /* @__PURE__ */ T(j.Provider, { value: I, children: g });
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
D as ChatBaseEventsProvider
|
|
73
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as o, createContext as u } from "react";
|
|
4
4
|
import { useInkeepOpenState as b } from "../hooks/use-inkeep-open-state.js";
|
|
5
5
|
const t = u(void 0), i = ({ children: e, value: r }) => /* @__PURE__ */ n(t.Provider, { value: r, children: e }), h = () => {
|
|
6
6
|
const e = o(t);
|
|
@@ -17,7 +17,7 @@ export declare function useChatFormState(): {
|
|
|
17
17
|
}> | undefined;
|
|
18
18
|
getFields: (conversationId?: string) => FormField[];
|
|
19
19
|
errors: FieldErrors<Record<string, any>>;
|
|
20
|
-
control: Control<Record<string, any>, any
|
|
20
|
+
control: Control<Record<string, any>, any, Record<string, any>>;
|
|
21
21
|
defaultValues: Record<string, any>;
|
|
22
22
|
};
|
|
23
23
|
export declare const ChatFormProvider: React.FC<{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as N } from "react/jsx-runtime";
|
|
3
|
-
import { useState as d, useCallback as a, useMemo as v, useEffect as
|
|
3
|
+
import { useContext as P, useState as d, useCallback as a, useMemo as v, useEffect as T, createContext as k } from "react";
|
|
4
4
|
import { useForm as G } from "react-hook-form";
|
|
5
5
|
import { useModal as W } from "../components/modal/modal-provider.js";
|
|
6
6
|
import { getFormDefaultValues as j } from "../utils/form.js";
|
|
7
7
|
import { useBaseEvents as A } from "./base-events-provider.js";
|
|
8
|
-
const B = "root.serverError", y =
|
|
8
|
+
const B = "root.serverError", y = k(void 0);
|
|
9
9
|
function D() {
|
|
10
10
|
const [e, c] = d(null), [u, f] = d(null), [w, p] = d(!1), h = W(), { logEvent: b } = A(), x = a(
|
|
11
11
|
(o, t) => {
|
|
@@ -37,7 +37,7 @@ function D() {
|
|
|
37
37
|
} = G({
|
|
38
38
|
defaultValues: n
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
T(() => {
|
|
41
41
|
n && E(n);
|
|
42
42
|
}, [E, n]);
|
|
43
43
|
const F = a(
|
|
@@ -97,7 +97,7 @@ const U = ({ children: e }) => {
|
|
|
97
97
|
const c = D();
|
|
98
98
|
return /* @__PURE__ */ N(y.Provider, { value: c, children: e });
|
|
99
99
|
}, X = () => {
|
|
100
|
-
const e =
|
|
100
|
+
const e = P(y);
|
|
101
101
|
if (!e)
|
|
102
102
|
throw new Error("useChatForm must be used within a ChatFormProvider");
|
|
103
103
|
return e;
|