@inkeep/agents-ui 0.14.18 → 0.14.20
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.d.cts +7 -13
- package/dist/index.d.ts +7 -13
- package/dist/index.js +21 -21
- package/dist/primitives/atoms/markdown/components.cjs +1 -1
- package/dist/primitives/atoms/markdown/components.js +15 -12
- package/dist/primitives/atoms/markdown/index.cjs +1 -1
- package/dist/primitives/atoms/markdown/index.js +17 -16
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -1
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +34 -30
- package/dist/primitives/components/embedded-chat.cjs +3 -3
- package/dist/primitives/components/embedded-chat.js +53 -51
- package/dist/primitives/hooks/index.cjs +1 -1
- package/dist/primitives/hooks/index.js +3 -3
- package/dist/primitives/hooks/use-simple-scroll.cjs +1 -0
- package/dist/primitives/hooks/use-simple-scroll.js +18 -0
- package/dist/primitives/index.cjs +1 -1
- package/dist/primitives/index.js +21 -21
- package/dist/primitives/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +1 -1
- package/dist/primitives/utils/component-ids.cjs +1 -1
- package/dist/primitives/utils/component-ids.js +2 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +21 -21
- package/dist/styled/components/ui/markdown-styles.cjs +1 -1
- package/dist/styled/components/ui/markdown-styles.js +1 -0
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +2 -2
- package/dist/styled/inkeep.css.cjs +4 -0
- package/dist/styled/inkeep.css.js +4 -0
- package/package.json +1 -1
- package/dist/primitives/hooks/use-scroll-to-bottom.cjs +0 -1
- package/dist/primitives/hooks/use-scroll-to-bottom.js +0 -52
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as n, jsxs as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as n, jsxs as $, Fragment as Z } from "react/jsx-runtime";
|
|
3
|
+
import J, { memo as E, forwardRef as Q, useRef as O, useState as N, useMemo as Ce, useEffect as V, useLayoutEffect as fe } from "react";
|
|
4
4
|
import * as Me from "react-dom/client";
|
|
5
5
|
import ee from "react-textarea-autosize";
|
|
6
6
|
import * as te from "@radix-ui/react-avatar";
|
|
7
|
-
import * as
|
|
7
|
+
import * as U from "@radix-ui/react-checkbox";
|
|
8
8
|
import * as T from "@radix-ui/react-popover";
|
|
9
9
|
import * as w from "@radix-ui/react-tooltip";
|
|
10
10
|
import * as W from "@radix-ui/react-scroll-area";
|
|
@@ -15,13 +15,13 @@ import xe from "../atoms/avatars/user.js";
|
|
|
15
15
|
import { CustomIcon as I } from "../atoms/icons/custom-icon.js";
|
|
16
16
|
import { BuiltInIconRenderer as H } from "../atoms/icons/built-in-icon-renderer.js";
|
|
17
17
|
import { LinkWithQueryParams as De } from "../atoms/link.js";
|
|
18
|
-
import { Markdown as
|
|
19
|
-
import { AttachmentItemProvider as pe, useAttachmentItem as
|
|
18
|
+
import { Markdown as K } from "../atoms/markdown/index.js";
|
|
19
|
+
import { AttachmentItemProvider as pe, useAttachmentItem as q } from "../providers/attachment-item-provider.js";
|
|
20
20
|
import { useAttachmentsBar as k, AttachmentsBarProvider as Oe } from "../providers/attachments-bar-provider.js";
|
|
21
21
|
import { SourceItemProvider as We, useSourceItem as L } from "../providers/source-item-provider.js";
|
|
22
22
|
import { useInkeepConfig as p } from "../providers/config-provider.js";
|
|
23
23
|
import { useMessageFeedback as se } from "../providers/feedback-provider.js";
|
|
24
|
-
import { MessageAttachmentsProvider as Re, useMessageAttachments as
|
|
24
|
+
import { MessageAttachmentsProvider as Re, useMessageAttachments as j } from "../providers/message-attachments-provider.js";
|
|
25
25
|
import { useMessage as f, MessageProvider as Ne } from "../providers/message-provider.js";
|
|
26
26
|
import { CheckboxIcon as ve } from "../atoms/icons/checkbox-icon.js";
|
|
27
27
|
import { useCopyToClipboard as X } from "../hooks/use-copy-to-clipboard.js";
|
|
@@ -43,7 +43,7 @@ import { useModal as Xe } from "./modal/modal-provider.js";
|
|
|
43
43
|
import { useColorModeValue as Ze } from "../../color-mode/index.js";
|
|
44
44
|
import { useComposedRefs as me } from "../utils/compose-refs.js";
|
|
45
45
|
import { composeEventHandlers as h } from "../utils/compose-event-handlers.js";
|
|
46
|
-
import {
|
|
46
|
+
import { useSimpleScroll as et } from "../hooks/use-simple-scroll.js";
|
|
47
47
|
import { useDebounce as tt } from "../hooks/use-debounce.js";
|
|
48
48
|
import { HoverPopoverProvider as it, useHoverPopover as be } from "../providers/hover-popover-provider.js";
|
|
49
49
|
import { useWidgetAutoFocus as at } from "./modal/widget-auto-focus.js";
|
|
@@ -53,7 +53,7 @@ import { getIcon as rt } from "../utils/get-source-icon.js";
|
|
|
53
53
|
import { CITATION_ARTIFACT_TYPE as _e } from "../../types/message.js";
|
|
54
54
|
const ot = "__intro__", st = a("div", {
|
|
55
55
|
_id: "aiChatWrapper"
|
|
56
|
-
}), nn =
|
|
56
|
+
}), nn = Q((t, e) => {
|
|
57
57
|
const { ...i } = t, { isHidden: r, isMobile: o } = b(), [s, c] = Ke(), d = me(e, s), m = c?.width ? c.width > 580 : !0, l = Xe();
|
|
58
58
|
return /* @__PURE__ */ n(
|
|
59
59
|
st,
|
|
@@ -90,12 +90,14 @@ const ot = "__intro__", st = a("div", {
|
|
|
90
90
|
_id: "aiChatContentScrollArea"
|
|
91
91
|
}), mt = a(W.Viewport, {
|
|
92
92
|
_id: "aiChatContentScrollArea__Viewport"
|
|
93
|
-
}), hn =
|
|
94
|
-
const { containerRef: r } = et(),
|
|
95
|
-
return
|
|
93
|
+
}), hn = Q(({ children: t, ...e }, i) => {
|
|
94
|
+
const { containerRef: r, scrollToBottom: o } = et(), s = me(i, r), { messages: c } = b();
|
|
95
|
+
return V(() => {
|
|
96
|
+
c.length > 0 && o();
|
|
97
|
+
}, [c.length, o]), /* @__PURE__ */ n(
|
|
96
98
|
mt,
|
|
97
99
|
{
|
|
98
|
-
ref:
|
|
100
|
+
ref: s,
|
|
99
101
|
children: (
|
|
100
102
|
/* added this to fix an overflow issue see https://github.com/radix-ui/primitives/issues/926 */
|
|
101
103
|
/* @__PURE__ */ n("div", { "data-part": "grid", style: { display: "grid" }, children: t })
|
|
@@ -165,7 +167,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
165
167
|
...t
|
|
166
168
|
}
|
|
167
169
|
);
|
|
168
|
-
}, vt = a(
|
|
170
|
+
}, vt = a(K, {
|
|
169
171
|
_id: "aiChatDisclaimerText"
|
|
170
172
|
}), Pn = E(
|
|
171
173
|
(t) => {
|
|
@@ -195,7 +197,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
195
197
|
}
|
|
196
198
|
), At = a("div", {
|
|
197
199
|
_id: "aiChatExampleQuestion"
|
|
198
|
-
}), En =
|
|
200
|
+
}), En = Q((t, e) => {
|
|
199
201
|
const { aiChatSettings: i } = p(), r = i.isFirstExampleQuestionHighlighted;
|
|
200
202
|
return /* @__PURE__ */ n(At, { ref: e, "data-highlight": g(r), ...t });
|
|
201
203
|
}), Pt = a("button", {
|
|
@@ -306,7 +308,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
306
308
|
aiChatSettings: r,
|
|
307
309
|
baseSettings: { userProperties: o }
|
|
308
310
|
} = p(), { message: s } = f(), { aiAssistantAvatar: c } = r ?? {}, d = typeof c == "string" ? c : c?.light, m = (typeof c == "string" ? c : c?.dark) ?? d, l = Ze(d, m), [C, v] = N(l);
|
|
309
|
-
|
|
311
|
+
V(() => {
|
|
310
312
|
v(l);
|
|
311
313
|
}, [l]);
|
|
312
314
|
const u = (_) => {
|
|
@@ -392,7 +394,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
392
394
|
}, Wt = a("div", {
|
|
393
395
|
_id: "aiChatMessageAttachments__Item"
|
|
394
396
|
}), Un = (t) => {
|
|
395
|
-
const { attachment: e, onClick: i, ...r } = t, { selectItem: o, onOpen: s } =
|
|
397
|
+
const { attachment: e, onClick: i, ...r } = t, { selectItem: o, onOpen: s } = j();
|
|
396
398
|
return /* @__PURE__ */ n(pe, { attachment: e, children: /* @__PURE__ */ n(
|
|
397
399
|
Wt,
|
|
398
400
|
{
|
|
@@ -405,17 +407,17 @@ const ot = "__intro__", st = a("div", {
|
|
|
405
407
|
}, Rt = a(H, {
|
|
406
408
|
_id: "aiChatMessageAttachments__ItemIcon"
|
|
407
409
|
}), Kn = (t) => {
|
|
408
|
-
const { attachment: e } =
|
|
410
|
+
const { attachment: e } = q(), i = e.contentType?.attachmentIcon;
|
|
409
411
|
return i ? /* @__PURE__ */ n(Rt, { iconSettings: i, ...t }) : null;
|
|
410
412
|
}, Nt = a("span", {
|
|
411
413
|
_id: "aiChatMessageAttachments__ItemTitle"
|
|
412
414
|
}), qn = (t) => {
|
|
413
|
-
const { attachment: e } =
|
|
415
|
+
const { attachment: e } = q();
|
|
414
416
|
return /* @__PURE__ */ n(Nt, { children: e.title, ...t });
|
|
415
417
|
}, Vt = a(oe, {
|
|
416
418
|
_id: "aiChatMessageAttachmentsPreview"
|
|
417
419
|
}), jn = (t) => {
|
|
418
|
-
const { onOpenChange: e, ...i } = t, { selectItem: r, isOpen: o, onClose: s, selectedItem: c } =
|
|
420
|
+
const { onOpenChange: e, ...i } = t, { selectItem: r, isOpen: o, onClose: s, selectedItem: c } = j();
|
|
419
421
|
return /* @__PURE__ */ n(
|
|
420
422
|
Vt,
|
|
421
423
|
{
|
|
@@ -434,7 +436,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
434
436
|
}), $t = a(re, {
|
|
435
437
|
_id: "aiChatMessageAttachmentsPreview__Header"
|
|
436
438
|
}), Yn = (t) => {
|
|
437
|
-
const { selectedItem: e } =
|
|
439
|
+
const { selectedItem: e } = j();
|
|
438
440
|
return /* @__PURE__ */ n(
|
|
439
441
|
$t,
|
|
440
442
|
{
|
|
@@ -448,12 +450,12 @@ const ot = "__intro__", st = a("div", {
|
|
|
448
450
|
}), Qt = a("p", {
|
|
449
451
|
_id: "aiChatMessageAttachmentsPreview__Body"
|
|
450
452
|
}), Xn = (t) => {
|
|
451
|
-
const { selectedItem: e } =
|
|
453
|
+
const { selectedItem: e } = j();
|
|
452
454
|
return /* @__PURE__ */ n(Qt, { children: e?.content, ...t });
|
|
453
455
|
}, Zn = (t) => {
|
|
454
456
|
const { text: e, componentStyles: i, ...r } = t, { aiChatSettings: o } = p(), { shouldOpenLinksInNewTab: s } = o;
|
|
455
457
|
return /* @__PURE__ */ n(
|
|
456
|
-
|
|
458
|
+
K,
|
|
457
459
|
{
|
|
458
460
|
children: e,
|
|
459
461
|
componentStyles: i,
|
|
@@ -471,7 +473,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
471
473
|
i !== _.current && (typeof i == "function" && typeof _.current == "function" ? i.toString() !== _.current.toString() && (_.current = i) : _.current = i);
|
|
472
474
|
}, [i]);
|
|
473
475
|
const B = _.current;
|
|
474
|
-
return
|
|
476
|
+
return V(() => {
|
|
475
477
|
s.current || (s.current = `dyn:${t}:${crypto.randomUUID()}`, C(!0));
|
|
476
478
|
}, [t]), fe(() => {
|
|
477
479
|
if (!B || !o || !l || !s.current)
|
|
@@ -487,7 +489,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
487
489
|
F.parentNode === o && F.remove(), c.current = null;
|
|
488
490
|
});
|
|
489
491
|
};
|
|
490
|
-
}, [B, o, l, t]),
|
|
492
|
+
}, [B, o, l, t]), V(() => {
|
|
491
493
|
const P = c.current;
|
|
492
494
|
if (!P || m.current) return;
|
|
493
495
|
const F = (S) => {
|
|
@@ -495,7 +497,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
495
497
|
try {
|
|
496
498
|
if (typeof S == "function" && S.constructor === Function) {
|
|
497
499
|
const D = S({});
|
|
498
|
-
return
|
|
500
|
+
return J.isValidElement(D);
|
|
499
501
|
}
|
|
500
502
|
return !1;
|
|
501
503
|
} catch {
|
|
@@ -506,7 +508,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
506
508
|
if (F(B))
|
|
507
509
|
try {
|
|
508
510
|
const S = B;
|
|
509
|
-
M =
|
|
511
|
+
M = J.createElement(S, e || {});
|
|
510
512
|
} catch (S) {
|
|
511
513
|
console.error("Error creating React element from component:", S);
|
|
512
514
|
return;
|
|
@@ -517,7 +519,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
517
519
|
console.error("Invalid component definition");
|
|
518
520
|
return;
|
|
519
521
|
}
|
|
520
|
-
if (
|
|
522
|
+
if (J.isValidElement(M) || typeof M == "string") {
|
|
521
523
|
if (m.current) return;
|
|
522
524
|
d.current || (d.current = Me.createRoot(P)), !m.current && d.current && d.current.render(M);
|
|
523
525
|
return;
|
|
@@ -549,7 +551,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
549
551
|
conversationId: c
|
|
550
552
|
}
|
|
551
553
|
});
|
|
552
|
-
}, m = i.label || "Contact Support", l = /* @__PURE__ */
|
|
554
|
+
}, m = i.label || "Contact Support", l = /* @__PURE__ */ $(Z, { children: [
|
|
553
555
|
i.icon && /* @__PURE__ */ n(H, { iconSettings: i.icon }),
|
|
554
556
|
m
|
|
555
557
|
] });
|
|
@@ -578,8 +580,8 @@ const ot = "__intro__", st = a("div", {
|
|
|
578
580
|
}), rr = (t) => {
|
|
579
581
|
const { action: e, onClick: i, className: r, ...o } = t, { conversationId: s } = b(), {
|
|
580
582
|
baseSettings: { onFeedback: c }
|
|
581
|
-
} = p(), { message: d } = f(), { isStreaming: m, messages: l } = b(), [C, v] = X(), { feedback: u, submitPositiveFeedback: _, setCurrentFeedback: B, currentFeedback: P } = se(), { logEvent: F } = le(), [M, S] = Ue(), D = l.at(-1)?.id === d?.id,
|
|
582
|
-
if (D && m || !
|
|
583
|
+
} = p(), { message: d } = f(), { isStreaming: m, messages: l } = b(), [C, v] = X(), { feedback: u, submitPositiveFeedback: _, setCurrentFeedback: B, currentFeedback: P } = se(), { logEvent: F } = le(), [M, S] = Ue(), D = l.at(-1)?.id === d?.id, z = d.role === "assistant";
|
|
584
|
+
if (D && m || !z) return null;
|
|
583
585
|
const R = {
|
|
584
586
|
copy() {
|
|
585
587
|
v(ge(d)), F({
|
|
@@ -597,11 +599,11 @@ const ot = "__intro__", st = a("div", {
|
|
|
597
599
|
downvote() {
|
|
598
600
|
B(d.id);
|
|
599
601
|
}
|
|
600
|
-
},
|
|
602
|
+
}, G = {
|
|
601
603
|
copy: "Copy Message",
|
|
602
604
|
upvote: "Upvote Message",
|
|
603
605
|
downvote: "Downvote Message"
|
|
604
|
-
},
|
|
606
|
+
}, Y = {
|
|
605
607
|
copy: /* @__PURE__ */ n(I, { iconKey: C ? "messageCopied" : "messageCopy" }),
|
|
606
608
|
upvote: /* @__PURE__ */ n(I, { iconKey: M ? "messageCopied" : "thumbsUp" }),
|
|
607
609
|
downvote: /* @__PURE__ */ n(I, { iconKey: "thumbsDown" })
|
|
@@ -624,8 +626,8 @@ const ot = "__intro__", st = a("div", {
|
|
|
624
626
|
{
|
|
625
627
|
"data-action": e,
|
|
626
628
|
...Fe[e],
|
|
627
|
-
children:
|
|
628
|
-
"aria-label":
|
|
629
|
+
children: Y[e],
|
|
630
|
+
"aria-label": G[e],
|
|
629
631
|
className: `${r} ${e}`,
|
|
630
632
|
onClick: h(i, R[e]),
|
|
631
633
|
...o
|
|
@@ -767,7 +769,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
767
769
|
_id: "aiChatInput__Group"
|
|
768
770
|
}), oi = a("textarea", {
|
|
769
771
|
_id: "aiChatInput"
|
|
770
|
-
}), Pr =
|
|
772
|
+
}), Pr = Q(({ onChange: t, onKeyDown: e, ...i }, r) => {
|
|
771
773
|
const { handleInputChange: o, handleInputKeyDown: s, input: c, error: d, shouldAutoFocusInput: m, inputRef: l } = b(), { aiChatSettings: C } = p(), v = me(
|
|
772
774
|
r,
|
|
773
775
|
l
|
|
@@ -821,12 +823,12 @@ const ot = "__intro__", st = a("div", {
|
|
|
821
823
|
}, li = a(H, {
|
|
822
824
|
_id: "aiChatAttachmentsBar__AttachmentIcon"
|
|
823
825
|
}), Sr = (t) => {
|
|
824
|
-
const { attachment: e } =
|
|
826
|
+
const { attachment: e } = q(), i = e.contentType?.attachmentIcon;
|
|
825
827
|
return i ? /* @__PURE__ */ n(li, { iconSettings: i, ...t }) : null;
|
|
826
828
|
}, hi = a("span", {
|
|
827
829
|
_id: "aiChatAttachmentsBar__AttachmentTitle"
|
|
828
830
|
}), kr = (t) => {
|
|
829
|
-
const { attachment: e } =
|
|
831
|
+
const { attachment: e } = q();
|
|
830
832
|
return /* @__PURE__ */ n(hi, { children: e.title, ...t });
|
|
831
833
|
}, ui = a("button", {
|
|
832
834
|
_id: "aiChatAttachmentsBar__AttachmentDelete"
|
|
@@ -857,7 +859,7 @@ const ot = "__intro__", st = a("div", {
|
|
|
857
859
|
side: "bottom",
|
|
858
860
|
sideOffset: 3,
|
|
859
861
|
align: "center",
|
|
860
|
-
children: /* @__PURE__ */
|
|
862
|
+
children: /* @__PURE__ */ $(Z, { children: [
|
|
861
863
|
/* @__PURE__ */ n(Ci, {}),
|
|
862
864
|
"Attachments will be kept in context for the entire conversation."
|
|
863
865
|
] })
|
|
@@ -1071,10 +1073,10 @@ const ot = "__intro__", st = a("div", {
|
|
|
1071
1073
|
},
|
|
1072
1074
|
copy: () => {
|
|
1073
1075
|
const he = C.map((R) => {
|
|
1074
|
-
const
|
|
1075
|
-
return `${
|
|
1076
|
+
const G = `**${R.role === "assistant" ? "AI Assistant" : "User"}**`, Y = ge(R);
|
|
1077
|
+
return `${G}
|
|
1076
1078
|
|
|
1077
|
-
${
|
|
1079
|
+
${Y}`;
|
|
1078
1080
|
}).join(`
|
|
1079
1081
|
|
|
1080
1082
|
---
|
|
@@ -1086,11 +1088,11 @@ ${G}`;
|
|
|
1086
1088
|
},
|
|
1087
1089
|
clear: c,
|
|
1088
1090
|
stop: d
|
|
1089
|
-
},
|
|
1091
|
+
}, z = {
|
|
1090
1092
|
copy: _,
|
|
1091
1093
|
share: P
|
|
1092
1094
|
};
|
|
1093
|
-
return /* @__PURE__ */ n(w.Tooltip, { delayDuration: 0, open:
|
|
1095
|
+
return /* @__PURE__ */ n(w.Tooltip, { delayDuration: 0, open: z[e], children: /* @__PURE__ */ n(
|
|
1094
1096
|
ki,
|
|
1095
1097
|
{
|
|
1096
1098
|
"data-type": e,
|
|
@@ -1119,7 +1121,7 @@ ${G}`;
|
|
|
1119
1121
|
copy: "Copied!",
|
|
1120
1122
|
share: "Link copied!"
|
|
1121
1123
|
};
|
|
1122
|
-
return /* @__PURE__ */
|
|
1124
|
+
return /* @__PURE__ */ $(Ti, { sideOffset: 5, ...r, children: [
|
|
1123
1125
|
/* @__PURE__ */ n(w.Arrow, {}),
|
|
1124
1126
|
i || o[e]
|
|
1125
1127
|
] });
|
|
@@ -1247,7 +1249,7 @@ ${G}`;
|
|
|
1247
1249
|
}), fo = (t) => {
|
|
1248
1250
|
const { name: e, ...i } = t;
|
|
1249
1251
|
return /* @__PURE__ */ n(Ve, { name: e, children: /* @__PURE__ */ n(Ni, { ...i }) });
|
|
1250
|
-
}, Vi = a(
|
|
1252
|
+
}, Vi = a(U.Root, {
|
|
1251
1253
|
_id: "aiChatFeedbackItem__Checkbox"
|
|
1252
1254
|
}), Mo = (t) => {
|
|
1253
1255
|
const { name: e, focusItem: i } = ce(), { onCheckedChange: r, ...o } = t, s = (c) => {
|
|
@@ -1262,7 +1264,7 @@ ${G}`;
|
|
|
1262
1264
|
...o
|
|
1263
1265
|
}
|
|
1264
1266
|
);
|
|
1265
|
-
}, Io = a(
|
|
1267
|
+
}, Io = a(U.Indicator, {
|
|
1266
1268
|
_id: "aiChatFeedbackItem__CheckboxIndicator",
|
|
1267
1269
|
children: /* @__PURE__ */ n(ve, {})
|
|
1268
1270
|
}), $i = a("label", {
|
|
@@ -1324,7 +1326,7 @@ ${G}`;
|
|
|
1324
1326
|
}), Ho = (t) => {
|
|
1325
1327
|
const { form: e } = A();
|
|
1326
1328
|
return e?.heading ? /* @__PURE__ */ n(ji, { children: e.heading, ...t }) : null;
|
|
1327
|
-
}, zi = a(
|
|
1329
|
+
}, zi = a(K, {
|
|
1328
1330
|
_id: "aiChatForm__Description"
|
|
1329
1331
|
}), Lo = (t) => {
|
|
1330
1332
|
const { form: e } = A();
|
|
@@ -1437,7 +1439,7 @@ ${G}`;
|
|
|
1437
1439
|
type: "textarea",
|
|
1438
1440
|
asChild: !0,
|
|
1439
1441
|
children: /* @__PURE__ */ n(ee, { maxRows: 8 })
|
|
1440
|
-
}), ea = a(
|
|
1442
|
+
}), ea = a(U.Root, {
|
|
1441
1443
|
_id: "aiChatForm__FieldCheckbox"
|
|
1442
1444
|
}), Vo = (t) => {
|
|
1443
1445
|
const { field: e, error: i, fieldProps: r, autoFocus: o } = x(), { onCheckedChange: s, ...c } = t;
|
|
@@ -1453,7 +1455,7 @@ ${G}`;
|
|
|
1453
1455
|
...c
|
|
1454
1456
|
}
|
|
1455
1457
|
);
|
|
1456
|
-
}, $o = a(
|
|
1458
|
+
}, $o = a(U.Indicator, {
|
|
1457
1459
|
_id: "aiChatForm__FieldCheckboxIndicator",
|
|
1458
1460
|
children: /* @__PURE__ */ n(ve, {})
|
|
1459
1461
|
}), ta = a(we, {
|
|
@@ -1539,7 +1541,7 @@ ${G}`;
|
|
|
1539
1541
|
}), ns = (t) => {
|
|
1540
1542
|
const { form: e } = A();
|
|
1541
1543
|
return /* @__PURE__ */ n(ca, { children: e?.successView?.heading, ...t });
|
|
1542
|
-
}, da = a(
|
|
1544
|
+
}, da = a(K, {
|
|
1543
1545
|
_id: "aiChatForm__SuccessMessage"
|
|
1544
1546
|
}), rs = (t) => {
|
|
1545
1547
|
const { form: e } = A();
|
|
@@ -1554,7 +1556,7 @@ ${G}`;
|
|
|
1554
1556
|
ma,
|
|
1555
1557
|
{
|
|
1556
1558
|
onClick: h(e, o),
|
|
1557
|
-
children: /* @__PURE__ */
|
|
1559
|
+
children: /* @__PURE__ */ $(Z, { children: [
|
|
1558
1560
|
c,
|
|
1559
1561
|
d
|
|
1560
1562
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-boolean.cjs"),s=require("./use-component-classnames.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-boolean.cjs"),s=require("./use-component-classnames.cjs"),u=require("./use-container-size.cjs"),o=require("./use-copy-to-clipboard.cjs"),r=require("./use-instant-update.cjs"),n=require("./use-is-mounted.cjs"),t=require("./use-media-query.cjs"),i=require("./use-resize-observer.cjs"),l=require("./use-scrolling-fades.cjs"),a=require("./use-settle-action.cjs"),c=require("./use-simple-scroll.cjs");exports.useBoolean=e.useBoolean;exports.useComponentClassNames=s.useComponentClassNames;exports.useContainerSize=u.useContainerSize;exports.useCopyToClipboard=o.useCopyToClipboard;exports.useInstantUpdate=r.useInstantUpdate;exports.useIsMounted=n.useIsMounted;exports.useMediaQuery=t.useMediaQuery;exports.useResizeObserver=i.useResizeObserver;exports.useScrollingFades=l.useScrollingFades;exports.useSettleAction=a.useSettleAction;exports.useSimpleScroll=c.useSimpleScroll;
|
|
@@ -8,7 +8,7 @@ import { useMediaQuery as d } from "./use-media-query.js";
|
|
|
8
8
|
import { useResizeObserver as S } from "./use-resize-observer.js";
|
|
9
9
|
import { useScrollingFades as b } from "./use-scrolling-fades.js";
|
|
10
10
|
import { useSettleAction as z } from "./use-settle-action.js";
|
|
11
|
-
import {
|
|
11
|
+
import { useSimpleScroll as M } from "./use-simple-scroll.js";
|
|
12
12
|
export {
|
|
13
13
|
r as useBoolean,
|
|
14
14
|
s as useComponentClassNames,
|
|
@@ -18,7 +18,7 @@ export {
|
|
|
18
18
|
l as useIsMounted,
|
|
19
19
|
d as useMediaQuery,
|
|
20
20
|
S as useResizeObserver,
|
|
21
|
-
I as useScrollToBottom,
|
|
22
21
|
b as useScrollingFades,
|
|
23
|
-
z as useSettleAction
|
|
22
|
+
z as useSettleAction,
|
|
23
|
+
M as useSimpleScroll
|
|
24
24
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react");function c(){const o=t.useRef(null),r=t.useCallback((l=!0)=>{const e=o.current;e&&e.scrollTo({top:e.scrollHeight,behavior:l?"smooth":"auto"})},[]);return{containerRef:o,scrollToBottom:r}}exports.useSimpleScroll=c;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as l, useCallback as n } from "react";
|
|
3
|
+
function s() {
|
|
4
|
+
const t = l(null), e = n((r = !0) => {
|
|
5
|
+
const o = t.current;
|
|
6
|
+
o && o.scrollTo({
|
|
7
|
+
top: o.scrollHeight,
|
|
8
|
+
behavior: r ? "smooth" : "auto"
|
|
9
|
+
});
|
|
10
|
+
}, []);
|
|
11
|
+
return {
|
|
12
|
+
containerRef: t,
|
|
13
|
+
scrollToBottom: e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
s as useSimpleScroll
|
|
18
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./providers/attachment-item-provider.cjs"),c=require("./providers/attachments-bar-provider.cjs"),C=require("./providers/base-events-provider.cjs"),a=require("./providers/chat-form-provider.cjs"),n=require("./providers/config-provider.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./providers/attachment-item-provider.cjs"),c=require("./providers/attachments-bar-provider.cjs"),C=require("./providers/base-events-provider.cjs"),a=require("./providers/chat-form-provider.cjs"),n=require("./providers/config-provider.cjs"),l=require("./providers/feedback-item-provider.cjs"),h=require("./providers/feedback-provider.cjs"),v=require("./providers/form-field-provider.cjs"),i=require("./providers/help-menu-provider.cjs"),p=require("./providers/markdown-provider.cjs"),P=require("./providers/message-attachments-provider.cjs"),d=require("./providers/message-provider.cjs"),F=require("./providers/root-provider.cjs"),I=require("./providers/source-item-provider.cjs"),k=require("./providers/theme-provider.cjs"),S=require("./providers/widget-provider.cjs"),t=require("./providers/sidebar-chat-provider.cjs"),q=require("./components/factory.cjs"),B=require("./components/embedded-chat.cjs"),y=require("./components/sidebar-chat/index.cjs"),g=require("./components/embedded-chat/chat-provider.cjs"),A=require("./components/embedded-search.cjs"),u=require("./components/embedded-search/search-provider.cjs"),f=require("./components/modal.cjs"),b=require("./components/modal/modal-provider.cjs"),R=require("./components/chat-button.cjs"),w=require("./components/searchbar.cjs"),E=require("./hooks/use-boolean.cjs"),T=require("./hooks/use-component-classnames.cjs"),W=require("./hooks/use-container-size.cjs"),O=require("./hooks/use-copy-to-clipboard.cjs"),x=require("./hooks/use-instant-update.cjs"),z=require("./hooks/use-is-mounted.cjs"),D=require("./hooks/use-media-query.cjs"),H=require("./hooks/use-resize-observer.cjs"),L=require("./hooks/use-scrolling-fades.cjs"),j=require("./hooks/use-settle-action.cjs"),Q=require("./hooks/use-simple-scroll.cjs"),o=require("./utils/misc.cjs"),r=require("./utils/component-ids.cjs"),M=require("./utils/compose-refs.cjs"),U=require("./utils/merge-props.cjs"),K=require("./atoms/portal.cjs"),N=require("./atoms/icons/custom-icon.cjs"),$=require("./atoms/icons/built-in-icon-renderer.cjs"),G=require("./atoms/portal-with-theme.cjs"),e=require("./atoms/cmdk/index.cjs"),J=require("./atoms/error-boundary.cjs"),s=require("./atoms/shadow/context.cjs");exports.AttachmentItemProvider=m.AttachmentItemProvider;exports.useAttachmentItem=m.useAttachmentItem;exports.AttachmentsBarProvider=c.AttachmentsBarProvider;exports.useAttachmentsBar=c.useAttachmentsBar;exports.BaseEventsProvider=C.BaseEventsProvider;exports.useBaseEvents=C.useBaseEvents;exports.ChatFormProvider=a.ChatFormProvider;exports.useChatForm=a.useChatForm;exports.useChatFormState=a.useChatFormState;exports.InkeepConfigProvider=n.InkeepConfigProvider;exports.WebWidgetInteractionType=n.WebWidgetInteractionType;exports.useInkeepConfig=n.useInkeepConfig;exports.FeedbackItemProvider=l.FeedbackItemProvider;exports.useFeedbackItem=l.useFeedbackItem;exports.FeedbackProvider=h.FeedbackProvider;exports.useMessageFeedback=h.useMessageFeedback;exports.FormFieldProvider=v.FormFieldProvider;exports.useFormField=v.useFormField;exports.HelpMenuProvider=i.HelpMenuProvider;exports.useHelpMenu=i.useHelpMenu;exports.useHelpMenuState=i.useHelpMenuState;exports.ChatMarkdownProvider=p.ChatMarkdownProvider;exports.useChatMarkdown=p.useChatMarkdown;exports.MessageAttachmentsProvider=P.MessageAttachmentsProvider;exports.useMessageAttachments=P.useMessageAttachments;exports.MessageProvider=d.MessageProvider;exports.useMessage=d.useMessage;exports.useOptionalMessage=d.useOptionalMessage;exports.RootProvider=F.RootProvider;exports.SourceItemProvider=I.SourceItemProvider;exports.useSourceItem=I.useSourceItem;exports.ThemeProvider=k.ThemeProvider;exports.WidgetProvider=S.WidgetProvider;exports.useWidget=S.useWidget;exports.SidebarChatProvider=t.SidebarChatProvider;exports.useInkeepSidebarChat=t.useInkeepSidebarChat;exports.useOptionalSidebarChat=t.useOptionalSidebarChat;exports.useSidebarChat=t.useSidebarChat;exports.ikp=q.ikp;exports.jsxFactory=q.jsxFactory;exports.EmbeddedChatPrimitive=B;exports.SidebarChatPrimitive=y;exports.ChatProvider=g.ChatProvider;exports.useChat=g.useChat;exports.EmbeddedSearchPrimitive=A;exports.SearchProvider=u.SearchProvider;exports.SearchProviderImpl=u.SearchProviderImpl;exports.useSearch=u.useSearch;exports.ModalPrimitive=f;exports.ModalProvider=b.ModalProvider;exports.useModal=b.useModal;exports.ChatButtonPrimitive=R;exports.SearchBarPrimitive=w;exports.useBoolean=E.useBoolean;exports.useComponentClassNames=T.useComponentClassNames;exports.useContainerSize=W.useContainerSize;exports.useCopyToClipboard=O.useCopyToClipboard;exports.useInstantUpdate=x.useInstantUpdate;exports.useIsMounted=z.useIsMounted;exports.useMediaQuery=D.useMediaQuery;exports.useResizeObserver=H.useResizeObserver;exports.useScrollingFades=L.useScrollingFades;exports.useSettleAction=j.useSettleAction;exports.useSimpleScroll=Q.useSimpleScroll;exports.callAll=o.callAll;exports.dataAttr=o.dataAttr;exports.getInitials=o.getInitials;exports.getMessageContent=o.getMessageContent;exports.isString=o.isString;exports.maybeRender=o.maybeRender;exports.toKebabCase=o.toKebabCase;exports.SearchBarComponentIds=r.SearchBarComponentIds;exports.SidebarChatComponentIds=r.SidebarChatComponentIds;exports.aiChatComponentIds=r.aiChatComponentIds;exports.aiSearchComponentIds=r.aiSearchComponentIds;exports.chatButtonComponentIds=r.chatButtonComponentIds;exports.componentIDs=r.componentIDs;exports.markDownComponentIds=r.markDownComponentIds;exports.miscellanousComponentIds=r.miscellanousComponentIds;exports.modalComponentIds=r.modalComponentIds;exports.composeRefs=M.composeRefs;exports.useComposedRefs=M.useComposedRefs;exports.mergeProps=U.mergeProps;exports.Portal=K.Portal;exports.CustomIcon=N.CustomIcon;exports.BuiltInIconRenderer=$.BuiltInIconRenderer;exports.PortalWithTheme=G.PortalWithTheme;exports.Command=e.Command;exports.CommandDialog=e.CommandDialog;exports.CommandEmpty=e.CommandEmpty;exports.CommandInput=e.CommandInput;exports.CommandItem=e.CommandItem;exports.CommandList=e.CommandList;exports.CommandLoading=e.CommandLoading;exports.CommandRoot=e.CommandRoot;exports.CommandSeparator=e.CommandSeparator;exports.defaultFilter=e.defaultFilter;exports.useCommandState=e.useCommandState;exports.useCommandStore=e.useCommandStore;exports.ErrorBoundary=J.ErrorBoundary;exports.InkeepShadow=s.InkeepShadow;exports.InkeepShadowProvider=s.InkeepShadowProvider;exports.ShadowContext=s.ShadowContext;exports.useShadow=s.useShadow;
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AttachmentItemProvider as p, useAttachmentItem as i } from "./providers/attachment-item-provider.js";
|
|
2
2
|
import { AttachmentsBarProvider as f, useAttachmentsBar as u } from "./providers/attachments-bar-provider.js";
|
|
3
3
|
import { BaseEventsProvider as C, useBaseEvents as h } from "./providers/base-events-provider.js";
|
|
4
|
-
import { ChatFormProvider as
|
|
5
|
-
import { InkeepConfigProvider as
|
|
4
|
+
import { ChatFormProvider as c, useChatForm as v, useChatFormState as P } from "./providers/chat-form-provider.js";
|
|
5
|
+
import { InkeepConfigProvider as I, WebWidgetInteractionType as b, useInkeepConfig as g } from "./providers/config-provider.js";
|
|
6
6
|
import { FeedbackItemProvider as F, useFeedbackItem as k } from "./providers/feedback-item-provider.js";
|
|
7
7
|
import { FeedbackProvider as A, useMessageFeedback as w } from "./providers/feedback-provider.js";
|
|
8
8
|
import { FormFieldProvider as R, useFormField as E } from "./providers/form-field-provider.js";
|
|
9
|
-
import { HelpMenuProvider as
|
|
9
|
+
import { HelpMenuProvider as T, useHelpMenu as D, useHelpMenuState as H } from "./providers/help-menu-provider.js";
|
|
10
10
|
import { ChatMarkdownProvider as z, useChatMarkdown as L } from "./providers/markdown-provider.js";
|
|
11
11
|
import { MessageAttachmentsProvider as K, useMessageAttachments as N } from "./providers/message-attachments-provider.js";
|
|
12
12
|
import { MessageProvider as U, useMessage as q, useOptionalMessage as G } from "./providers/message-provider.js";
|
|
@@ -20,9 +20,9 @@ import * as e from "./components/embedded-chat.js";
|
|
|
20
20
|
import * as o from "./components/sidebar-chat/index.js";
|
|
21
21
|
import { ChatProvider as ue, useChat as xe } from "./components/embedded-chat/chat-provider.js";
|
|
22
22
|
import * as r from "./components/embedded-search.js";
|
|
23
|
-
import { SearchProvider as he, SearchProviderImpl as
|
|
23
|
+
import { SearchProvider as he, SearchProviderImpl as le, useSearch as ce } from "./components/embedded-search/search-provider.js";
|
|
24
24
|
import * as t from "./components/modal.js";
|
|
25
|
-
import { ModalProvider as Pe, useModal as
|
|
25
|
+
import { ModalProvider as Pe, useModal as Se } from "./components/modal/modal-provider.js";
|
|
26
26
|
import * as m from "./components/chat-button.js";
|
|
27
27
|
import * as a from "./components/searchbar.js";
|
|
28
28
|
import { useBoolean as be } from "./hooks/use-boolean.js";
|
|
@@ -31,20 +31,20 @@ import { useContainerSize as ke } from "./hooks/use-container-size.js";
|
|
|
31
31
|
import { useCopyToClipboard as Ae } from "./hooks/use-copy-to-clipboard.js";
|
|
32
32
|
import { useInstantUpdate as ye } from "./hooks/use-instant-update.js";
|
|
33
33
|
import { useIsMounted as Ee } from "./hooks/use-is-mounted.js";
|
|
34
|
-
import { useMediaQuery as
|
|
34
|
+
import { useMediaQuery as Te } from "./hooks/use-media-query.js";
|
|
35
35
|
import { useResizeObserver as He } from "./hooks/use-resize-observer.js";
|
|
36
36
|
import { useScrollingFades as ze } from "./hooks/use-scrolling-fades.js";
|
|
37
37
|
import { useSettleAction as je } from "./hooks/use-settle-action.js";
|
|
38
|
-
import {
|
|
38
|
+
import { useSimpleScroll as Ne } from "./hooks/use-simple-scroll.js";
|
|
39
39
|
import { callAll as Ue, dataAttr as qe, getInitials as Ge, getMessageContent as Je, isString as Ve, maybeRender as Xe, toKebabCase as Ye } from "./utils/misc.js";
|
|
40
40
|
import { SearchBarComponentIds as _e, SidebarChatComponentIds as $e, aiChatComponentIds as eo, aiSearchComponentIds as oo, chatButtonComponentIds as ro, componentIDs as to, markDownComponentIds as mo, miscellanousComponentIds as ao, modalComponentIds as so } from "./utils/component-ids.js";
|
|
41
41
|
import { composeRefs as io, useComposedRefs as no } from "./utils/compose-refs.js";
|
|
42
42
|
import { mergeProps as uo } from "./utils/merge-props.js";
|
|
43
43
|
import { Portal as Co } from "./atoms/portal.js";
|
|
44
|
-
import { CustomIcon as
|
|
44
|
+
import { CustomIcon as lo } from "./atoms/icons/custom-icon.js";
|
|
45
45
|
import { BuiltInIconRenderer as vo } from "./atoms/icons/built-in-icon-renderer.js";
|
|
46
|
-
import { PortalWithTheme as
|
|
47
|
-
import { Command as bo, CommandDialog as go, CommandEmpty as Mo, CommandInput as Fo, CommandItem as ko, CommandList as Bo, CommandLoading as Ao, CommandRoot as wo, CommandSeparator as yo, defaultFilter as Ro, useCommandState as Eo, useCommandStore as
|
|
46
|
+
import { PortalWithTheme as So } from "./atoms/portal-with-theme.js";
|
|
47
|
+
import { Command as bo, CommandDialog as go, CommandEmpty as Mo, CommandInput as Fo, CommandItem as ko, CommandList as Bo, CommandLoading as Ao, CommandRoot as wo, CommandSeparator as yo, defaultFilter as Ro, useCommandState as Eo, useCommandStore as Wo } from "./atoms/cmdk/index.js";
|
|
48
48
|
import { ErrorBoundary as Do } from "./atoms/error-boundary.js";
|
|
49
49
|
import { InkeepShadow as Oo, InkeepShadowProvider as zo, ShadowContext as Lo, useShadow as jo } from "./atoms/shadow/context.js";
|
|
50
50
|
export {
|
|
@@ -53,7 +53,7 @@ export {
|
|
|
53
53
|
C as BaseEventsProvider,
|
|
54
54
|
vo as BuiltInIconRenderer,
|
|
55
55
|
m as ChatButtonPrimitive,
|
|
56
|
-
|
|
56
|
+
c as ChatFormProvider,
|
|
57
57
|
z as ChatMarkdownProvider,
|
|
58
58
|
ue as ChatProvider,
|
|
59
59
|
bo as Command,
|
|
@@ -65,15 +65,15 @@ export {
|
|
|
65
65
|
Ao as CommandLoading,
|
|
66
66
|
wo as CommandRoot,
|
|
67
67
|
yo as CommandSeparator,
|
|
68
|
-
|
|
68
|
+
lo as CustomIcon,
|
|
69
69
|
e as EmbeddedChatPrimitive,
|
|
70
70
|
r as EmbeddedSearchPrimitive,
|
|
71
71
|
Do as ErrorBoundary,
|
|
72
72
|
F as FeedbackItemProvider,
|
|
73
73
|
A as FeedbackProvider,
|
|
74
74
|
R as FormFieldProvider,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
T as HelpMenuProvider,
|
|
76
|
+
I as InkeepConfigProvider,
|
|
77
77
|
Oo as InkeepShadow,
|
|
78
78
|
zo as InkeepShadowProvider,
|
|
79
79
|
K as MessageAttachmentsProvider,
|
|
@@ -81,12 +81,12 @@ export {
|
|
|
81
81
|
t as ModalPrimitive,
|
|
82
82
|
Pe as ModalProvider,
|
|
83
83
|
Co as Portal,
|
|
84
|
-
|
|
84
|
+
So as PortalWithTheme,
|
|
85
85
|
V as RootProvider,
|
|
86
86
|
_e as SearchBarComponentIds,
|
|
87
87
|
a as SearchBarPrimitive,
|
|
88
88
|
he as SearchProvider,
|
|
89
|
-
|
|
89
|
+
le as SearchProviderImpl,
|
|
90
90
|
Lo as ShadowContext,
|
|
91
91
|
$e as SidebarChatComponentIds,
|
|
92
92
|
o as SidebarChatPrimitive,
|
|
@@ -123,7 +123,7 @@ export {
|
|
|
123
123
|
P as useChatFormState,
|
|
124
124
|
L as useChatMarkdown,
|
|
125
125
|
Eo as useCommandState,
|
|
126
|
-
|
|
126
|
+
Wo as useCommandStore,
|
|
127
127
|
Me as useComponentClassNames,
|
|
128
128
|
no as useComposedRefs,
|
|
129
129
|
ke as useContainerSize,
|
|
@@ -136,20 +136,20 @@ export {
|
|
|
136
136
|
ae as useInkeepSidebarChat,
|
|
137
137
|
ye as useInstantUpdate,
|
|
138
138
|
Ee as useIsMounted,
|
|
139
|
-
|
|
139
|
+
Te as useMediaQuery,
|
|
140
140
|
q as useMessage,
|
|
141
141
|
N as useMessageAttachments,
|
|
142
142
|
w as useMessageFeedback,
|
|
143
|
-
|
|
143
|
+
Se as useModal,
|
|
144
144
|
G as useOptionalMessage,
|
|
145
145
|
se as useOptionalSidebarChat,
|
|
146
146
|
He as useResizeObserver,
|
|
147
|
-
Ne as useScrollToBottom,
|
|
148
147
|
ze as useScrollingFades,
|
|
149
|
-
|
|
148
|
+
ce as useSearch,
|
|
150
149
|
je as useSettleAction,
|
|
151
150
|
jo as useShadow,
|
|
152
151
|
de as useSidebarChat,
|
|
152
|
+
Ne as useSimpleScroll,
|
|
153
153
|
Z as useSourceItem,
|
|
154
154
|
re as useWidget
|
|
155
155
|
};
|
|
@@ -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.19",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.19",
|
|
9
9
|
componentType: o,
|
|
10
10
|
tags: s
|
|
11
11
|
}),
|