@inkeep/agents-ui 0.16.0 → 0.16.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/color-mode/index.js +4 -4
- 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/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 -1
- package/dist/primitives/components/embedded-chat/file-upload-input.js +119 -116
- package/dist/primitives/components/embedded-chat/image-preview-modal.js +3 -3
- 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 +305 -278
- 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 +1 -1
- package/dist/primitives/components/embedded-chat.d.ts +1 -2
- package/dist/primitives/components/embedded-chat.js +23 -23
- 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/providers/base-events-provider.cjs +1 -1
- package/dist/primitives/providers/base-events-provider.js +22 -22
- 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.js +3 -3
- 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/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 +5 -5
- package/dist/react/embedded-search.cjs +1 -1
- package/dist/react/embedded-search.js +18 -18
- 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 +5 -5
- package/dist/styled/components/embedded-chat.cjs +1 -1
- package/dist/styled/components/embedded-chat.js +198 -198
- package/dist/styled/components/embedded-search.cjs +1 -1
- package/dist/styled/components/embedded-search.js +65 -65
- 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 +90 -90
- 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/inkeep.css.cjs +13 -3
- package/dist/styled/inkeep.css.js +13 -3
- package/dist/theme/utils/generate-theme-variables.js +6 -6
- package/package.json +1 -1
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as C } from "react/jsx-runtime";
|
|
3
3
|
import { mergeAndCompare as g } from "merge-anything";
|
|
4
|
-
import { useMemo as m,
|
|
4
|
+
import { useMemo as m, useContext as S, createContext as u } from "react";
|
|
5
5
|
import { defaultInkeepSearchSettings as f, defaultInkeepBaseSettings as p, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
|
|
6
6
|
import { useShadow as l } from "../atoms/shadow/context.js";
|
|
7
7
|
const I = {
|
|
@@ -19,7 +19,7 @@ const I = {
|
|
|
19
19
|
baseSettings: p,
|
|
20
20
|
searchSettings: f,
|
|
21
21
|
componentType: I.EmbeddedChat
|
|
22
|
-
}, o =
|
|
22
|
+
}, o = u(a), A = ({ children: t, value: n }) => {
|
|
23
23
|
const i = l(), s = (e, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? e : r, d = {
|
|
24
24
|
baseSettings: i ?? {}
|
|
25
25
|
}, c = m(() => {
|
|
@@ -28,7 +28,7 @@ const I = {
|
|
|
28
28
|
}, [n]);
|
|
29
29
|
return /* @__PURE__ */ C(o.Provider, { value: c, children: t });
|
|
30
30
|
}, T = () => {
|
|
31
|
-
const t =
|
|
31
|
+
const t = S(o);
|
|
32
32
|
if (!t)
|
|
33
33
|
throw new Error("useInkeepConfig must be used within a ConfigProvider");
|
|
34
34
|
return t;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as E } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as N, useState as k, useCallback as b, createContext as M } from "react";
|
|
4
4
|
import { useChat as U } from "../components/embedded-chat/chat-provider.js";
|
|
5
5
|
import { getMessageContent as p } from "../utils/misc.js";
|
|
6
6
|
import { useInkeepConfig as j } from "./config-provider.js";
|
|
7
7
|
import { useBaseEvents as q } from "./base-events-provider.js";
|
|
8
8
|
import { useFeedbackApi as y } from "../hooks/use-feedback-api.js";
|
|
9
|
-
const m =
|
|
9
|
+
const m = M(void 0);
|
|
10
10
|
function B() {
|
|
11
11
|
const { baseSettings: t, aiChatSettings: n } = j(), [v, f] = k(null), [F, l] = k({}), { conversationId: a, messages: c, authToken: C, getCaptchaHeader: g, invalidateCaptcha: h, refreshSession: _ } = U(), { analyticsProperties: w } = t, { logEvent: d } = q(), { submitFeedback: x } = y({
|
|
12
12
|
baseUrl: n.baseUrl,
|
|
@@ -64,7 +64,7 @@ const L = ({ children: t }) => {
|
|
|
64
64
|
const n = B();
|
|
65
65
|
return /* @__PURE__ */ E(m.Provider, { value: n, children: t });
|
|
66
66
|
}, O = () => {
|
|
67
|
-
const t =
|
|
67
|
+
const t = N(m);
|
|
68
68
|
if (!t)
|
|
69
69
|
throw new Error("useFeedback must be used within a FeedbackProvider");
|
|
70
70
|
return t;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as F, createContext as u } from "react";
|
|
4
4
|
import { useChatForm as c } from "./chat-form-provider.js";
|
|
5
|
-
const e =
|
|
5
|
+
const e = u(void 0), a = ({ children: r, field: o, fieldProps: t, autoFocus: n }) => {
|
|
6
6
|
const { errors: i } = c(), s = i[o.name];
|
|
7
7
|
return /* @__PURE__ */ m(e.Provider, { value: { field: o, fieldProps: t, error: s, autoFocus: n }, children: r });
|
|
8
8
|
}, v = () => {
|
|
9
|
-
const r =
|
|
9
|
+
const r = F(e);
|
|
10
10
|
if (!r)
|
|
11
11
|
throw new Error("useFormField must be used within a FormFieldProvider");
|
|
12
12
|
return r;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const n =
|
|
3
|
+
import { useContext as r, useState as u, createContext as s } from "react";
|
|
4
|
+
const n = s(void 0);
|
|
5
5
|
function c() {
|
|
6
|
-
const [e, t] =
|
|
6
|
+
const [e, t] = u(!1);
|
|
7
7
|
return { open: e, setOpen: t };
|
|
8
8
|
}
|
|
9
9
|
const l = ({ children: e, value: t }) => /* @__PURE__ */ o(n.Provider, { value: t, children: e }), x = () => {
|
|
10
|
-
const e =
|
|
10
|
+
const e = r(n);
|
|
11
11
|
if (!e)
|
|
12
12
|
throw new Error("useHelpMenu must be used within a HelpMenuProvider");
|
|
13
13
|
return e;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as v } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const e =
|
|
5
|
-
const o =
|
|
3
|
+
import { useContext as n, createContext as s } from "react";
|
|
4
|
+
const e = s(void 0), p = ({ children: o, open: r, setOpen: t }) => /* @__PURE__ */ v(e.Provider, { value: { open: r, setOpen: t }, children: o }), P = () => {
|
|
5
|
+
const o = n(e);
|
|
6
6
|
if (!o)
|
|
7
7
|
throw new Error("useHoverPopover must be used within a HoverPopoverProvider");
|
|
8
8
|
return o;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as u } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const s =
|
|
5
|
-
const [r, t] =
|
|
3
|
+
import { useContext as v, useState as c, useCallback as i, useMemo as w, createContext as P } from "react";
|
|
4
|
+
const s = P(void 0), I = ({ children: e }) => {
|
|
5
|
+
const [r, t] = c(null), o = i((m) => {
|
|
6
6
|
t(m);
|
|
7
7
|
}, []), n = i(() => {
|
|
8
8
|
t(null);
|
|
9
|
-
}, []), a =
|
|
9
|
+
}, []), a = w(
|
|
10
10
|
() => ({ imagePreview: r, openImagePreview: o, closeImagePreview: n }),
|
|
11
11
|
[r, o, n]
|
|
12
12
|
);
|
|
13
13
|
return /* @__PURE__ */ u(s.Provider, { value: a, children: e });
|
|
14
14
|
}, x = () => {
|
|
15
|
-
const e =
|
|
15
|
+
const e = v(s);
|
|
16
16
|
if (!e)
|
|
17
17
|
throw new Error("useImagePreview must be used within an ImagePreviewProvider");
|
|
18
18
|
return e;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const o =
|
|
3
|
+
import { useContext as n, createContext as a } from "react";
|
|
4
|
+
const o = a(void 0), x = ({ children: t, componentStyles: e }) => /* @__PURE__ */ r(o.Provider, { value: { componentStyles: e }, children: t }), d = () => n(o);
|
|
5
5
|
export {
|
|
6
6
|
x as ChatMarkdownProvider,
|
|
7
7
|
d as useChatMarkdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useContext as s, createContext as n } from "react";
|
|
4
4
|
const t = n(void 0), u = ({ children: e, message: o }) => /* @__PURE__ */ r(t.Provider, { value: { message: o }, children: e }), a = () => {
|
|
5
5
|
const e = s(t);
|
|
6
6
|
if (!e)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as C } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useState as b, useContext as s, createContext as p } from "react";
|
|
4
4
|
import { useInkeepOpenState as S } from "../hooks/use-inkeep-open-state.js";
|
|
5
|
-
const r =
|
|
5
|
+
const r = p(void 0), v = ({ children: t, value: e }) => /* @__PURE__ */ C(r.Provider, { value: e, children: t }), g = () => {
|
|
6
6
|
const t = s(r);
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error("useSidebarChat must be used within a SidebarChatProvider");
|
|
@@ -17,7 +17,7 @@ const r = b(void 0), v = ({ children: t, value: e }) => /* @__PURE__ */ C(r.Prov
|
|
|
17
17
|
const { autoCloseThreshold: i = 0.7 } = n ?? {}, { isOpen: c, setOpen: d } = S(n, {
|
|
18
18
|
eventNamePrefix: "sidebar_chat",
|
|
19
19
|
defaultTriggerSelector: "[data-inkeep-sidebar-chat-trigger]"
|
|
20
|
-
}), [h, u] =
|
|
20
|
+
}), [h, u] = b(Math.min(a, Math.floor((e + o) / 2)));
|
|
21
21
|
return {
|
|
22
22
|
width: h,
|
|
23
23
|
setWidth: u,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const t =
|
|
5
|
-
const e =
|
|
3
|
+
import { useContext as u, createContext as n } from "react";
|
|
4
|
+
const t = n(void 0), i = ({ children: e, source: r }) => /* @__PURE__ */ o(t.Provider, { value: { source: r }, children: e }), m = () => {
|
|
5
|
+
const e = u(t);
|
|
6
6
|
if (!e)
|
|
7
7
|
throw new Error("useSourceItem must be used within a SourceItemProvider");
|
|
8
8
|
return e;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
const e =
|
|
3
|
+
import { useContext as n, createContext as i } from "react";
|
|
4
|
+
const e = i(void 0), x = ({ children: t, widget: o }) => /* @__PURE__ */ r(e.Provider, { value: o, children: t }), d = () => n(e);
|
|
5
5
|
export {
|
|
6
6
|
x as WidgetProvider,
|
|
7
7
|
d as useWidget
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=(...t)=>(...n)=>{for(const a of t)a?.(...n)},l=t=>typeof t=="string";function f(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const g=t=>t?"":void 0;function d(t){const n=t.split(" "),a=n[0]??"",o=n.length>1?n[n.length-1]:"";return a&&o?`${a.charAt(0)}${o.charAt(0)}`:a.charAt(0)}function m(t,n){return typeof t=="function"?t(n):t}function i(t){return t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"}const y=t=>{const n=e=>e.data?.artifactSummary?.title||e.data?.name||"Source",a=t.parts?.map(e=>{if(e.type==="text")return e.text;if(e.type==="data-component")return JSON.stringify(e.data);if(i(e)){const r=e.data?.artifactSummary?.url;return r?`[${n(e)}](${r})`:null}return null}).join("")??"",o=new Set,s=t.parts?.filter(i).filter(e=>{const r=e.data?.artifactSummary?.url;return!r||o.has(r)?!1:(o.add(r),!0)})??[];if(!s.length)return a;const c=`
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=((...t)=>(...n)=>{for(const a of t)a?.(...n)}),l=t=>typeof t=="string";function f(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").replace(/__/g,"__").toLowerCase()}const g=t=>t?"":void 0;function d(t){const n=t.split(" "),a=n[0]??"",o=n.length>1?n[n.length-1]:"";return a&&o?`${a.charAt(0)}${o.charAt(0)}`:a.charAt(0)}function m(t,n){return typeof t=="function"?t(n):t}function i(t){return t.type==="data-artifact"&&t.data?.type?.toLowerCase()==="citation"}const y=t=>{const n=e=>e.data?.artifactSummary?.title||e.data?.name||"Source",a=t.parts?.map(e=>{if(e.type==="text")return e.text;if(e.type==="data-component")return JSON.stringify(e.data);if(i(e)){const r=e.data?.artifactSummary?.url;return r?`[${n(e)}](${r})`:null}return null}).join("")??"",o=new Set,s=t.parts?.filter(i).filter(e=>{const r=e.data?.artifactSummary?.url;return!r||o.has(r)?!1:(o.add(r),!0)})??[];if(!s.length)return a;const c=`
|
|
2
2
|
|
|
3
3
|
**Sources:**
|
|
4
4
|
`+s.map(e=>{const r=e.data?.artifactSummary?.url;return`- [${n(e)}](${r})`}).join(`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const c = (
|
|
3
3
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
4
|
-
(...t) => (...e) => {
|
|
4
|
+
((...t) => (...e) => {
|
|
5
5
|
for (const r of t)
|
|
6
6
|
r?.(...e);
|
|
7
|
-
}
|
|
7
|
+
})
|
|
8
8
|
), l = (t) => typeof t == "string";
|
|
9
9
|
function f(t) {
|
|
10
10
|
return t.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/__/g, "__").toLowerCase();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as t, jsxs as d, Fragment as f } from "react/jsx-runtime";
|
|
3
3
|
import { ChatHistoryTrigger as y } from "../styled/components/embedded-chat.js";
|
|
4
4
|
import { Root as I, Header as O, CloseButton as v } from "../styled/components/chat-bubble.js";
|
|
5
5
|
import { Container as S, ChatButton as A, ChatButtonText as H, ChatButtonAvatarContent as T, ChatButtonAvatarImage as k, ChatButtonCloseIcon as w } from "../styled/components/chat-button.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),C=require("../styled/components/modal.cjs"),H=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),A=require("../primitives/providers/chat-history-provider.cjs"),b=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),f=require("../primitives/components/modal/modal-provider.cjs"),p=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),B=require("./modal.cjs"),L=require("../primitives/providers/image-preview-provider.cjs"),q=require("./widget-toggle.cjs"),y=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function D(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(P.ErrorBoundary,{children:e.jsx(H.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(w.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:b.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(S,{...r})})})})}function T(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})}function S(r){return e.jsx(T,{...r,children:e.jsx(v,{...r})})}function v(r){const{onToggleView:t,variant:n,header:o=W}=r,d=f.useModal(),l=k.useWidget(),x=d&&!l?B.ModalContent:g.Fragment;return e.jsx(L.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":p.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(Z,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(N,{}),e.jsx(U,{})]}),e.jsx(z,{}),e.jsx(R,{}),e.jsx(J,{})]})})})}const W=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=b.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":p.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":p.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(q.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(C.Close,{})]}):e.jsx(C.Close,{})})};function N(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(V,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function V(){const{aiChatSettings:{components:r}}=b.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,j)=>{const h=r?.[c];if(!h)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof h=="function"&&h.length<=1)return g.createElement(h,j);const u=h(j,document.createElement("div"),null);return g.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx($,{}),t.map(c=>{const j=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(F,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:j}),(!o||!j)&&e.jsx(O,{})]})}),e.jsx(_,{}),e.jsx(Q,{})]})]},c.id)}),n&&d?.role==="user"&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(F,{}),e.jsx(s.MessageLoading,{})]})]})}})}function $(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function F(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function R(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function _(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=y.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function Q(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function O(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(g.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{part:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function U(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(G,{}),e.jsx(K,{})]})}function G(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=y.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function K(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function Z(){const{sessions:r}=A.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(C.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":p.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function z(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackField,{children:[e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function J(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=D;exports.InkeepEmbeddedChatImpl=S;exports.InkeepEmbeddedChatImplContent=v;exports.InkeepEmbeddedChatProvider=T;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),s=require("../styled/components/embedded-chat.cjs"),a=require("../styled/components/chat-history.cjs"),C=require("../styled/components/modal.cjs"),H=require("../styled/components/shadow.cjs"),I=require("../styled/components/message.cjs"),A=require("../primitives/providers/chat-history-provider.cjs"),b=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),k=require("../primitives/providers/widget-provider.cjs"),M=require("../primitives/components/embedded-chat/chat-provider.cjs"),f=require("../primitives/components/modal/modal-provider.cjs"),p=require("../primitives/utils/misc.cjs"),E=require("../primitives/atoms/portal-with-theme.cjs"),P=require("../primitives/atoms/error-boundary.cjs"),B=require("./modal.cjs"),L=require("../primitives/providers/image-preview-provider.cjs"),q=require("./widget-toggle.cjs"),y=require("../primitives/components/embedded-chat/file-upload-input.cjs"),i=require("../styled/components/embedded-chat/file-upload-input.cjs"),m=require("../styled/components/embedded-chat/image-preview-modal.cjs");function D(r){const{baseSettings:t,aiChatSettings:n}=r;return e.jsx(P.ErrorBoundary,{children:e.jsx(H.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(w.RootProvider,{config:{baseSettings:t,aiChatSettings:n},componentType:b.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(S,{...r})})})})}function T(r){const{children:t,onToggleView:n,isHidden:o,shouldAutoFocusInput:d=!n}=r;return e.jsx(s.Provider,{isHidden:o,shouldAutoFocusInput:d,children:t})}function S(r){return e.jsx(T,{...r,children:e.jsx(v,{...r})})}function v(r){const{onToggleView:t,variant:n,header:o=W}=r,d=f.useModal(),l=k.useWidget(),x=d&&!l?B.ModalContent:g.Fragment;return e.jsx(L.ImagePreviewProvider,{children:e.jsx(x,{children:e.jsxs(s.Wrapper,{variant:n??(t?"no-shadow":"container-with-shadow"),"data-composite":p.dataAttr(!!r.onToggleView||d?.isOpen),children:[e.jsx(Z,{}),e.jsxs(s.Root,{children:[o&&e.jsx(o,{...r}),e.jsx(N,{}),e.jsx(U,{})]}),e.jsx(z,{}),e.jsx(R,{}),e.jsx(J,{})]})})})}const W=r=>{const{onToggleView:t,askAILabel:n,searchLabel:o}=r,{aiChatSettings:d}=b.useInkeepConfig(),l=d.isChatHistoryButtonVisible,x=!!t||l;return e.jsx(s.Header,{"data-show-toolbar":p.dataAttr(x),children:x?e.jsxs(s.HeaderToolbar,{"data-show-widget-toggle":p.dataAttr(!!t),children:[e.jsx(s.HeaderToolbarWrapper,{children:l&&e.jsx(s.ChatHistoryTrigger,{})}),t&&e.jsx(q.WidgetToggle,{onToggleView:t,askAILabel:n,searchLabel:o,view:"chat"}),e.jsx(C.Close,{})]}):e.jsx(C.Close,{})})};function N(){const{isSessionLoading:r}=M.useChat();return e.jsx(s.Content,{children:e.jsxs(s.ContentScrollArea,{children:[e.jsx(s.ContentScrollAreaViewport,{children:r?e.jsx(s.MessagesSessionLoading,{}):e.jsx(V,{})}),e.jsx(s.ContentScrollAreaScrollbar,{children:e.jsx(s.ContentScrollAreaThumb,{})}),e.jsx(s.ContentScrollAreaCorner,{})]})})}function V(){const{aiChatSettings:{components:r}}=b.useInkeepConfig();return e.jsx(s.Messages,{children:({messages:t,isLoading:n,isStreaming:o})=>{const d=t.at(-1),l=(c,j)=>{const h=r?.[c];if(!h)return console.warn(`Component "${c}" not found in components config`),null;try{if(typeof h=="function"&&h.length<=1)return g.createElement(h,j);const u=h(j,document.createElement("div"),null);return g.isValidElement(u)||typeof u=="string"?u:null}catch(u){return console.error(`🔍 [renderComponent] Error rendering component "${c}":`,u),null}},x=c=>e.jsx(s.Markdown,{text:c});return e.jsxs(e.Fragment,{children:[e.jsx($,{}),t.map(c=>{const j=d?.id===c.id;return e.jsxs(s.MessageWrapper,{message:c,children:[e.jsx(F,{}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:r?.IkpMessage?e.jsx(s.DynamicComponent,{name:"IkpMessage",props:{message:c,renderComponent:l,renderMarkdown:x},componentDef:r.IkpMessage}):e.jsxs(e.Fragment,{children:[e.jsx(I.EmbeddedChatMessagePart,{isLast:j}),(!o||!j)&&e.jsx(O,{})]})}),e.jsx(_,{}),e.jsx(Q,{})]})]},c.id)}),n&&d?.role==="user"&&d?.parts.length&&e.jsxs(s.MessageWrapper,{message:{id:"___loader___",role:"assistant",parts:[{type:"text",text:"Thinking..."}]},children:[e.jsx(F,{}),e.jsx(s.MessageLoading,{})]})]})}})}function $(){return e.jsxs(s.IntroMessageWrapper,{children:[e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]}),e.jsxs(s.MessageContentWrapper,{children:[e.jsx(s.MessageContent,{children:e.jsx(I.EmbeddedChatMessagePart,{isLast:!1})}),e.jsxs(s.Disclaimer,{children:[e.jsx(s.DisclaimerLabel,{}),e.jsx(s.DisclaimerTrigger,{}),e.jsxs(s.DisclaimerContent,{children:[e.jsx(s.DisclaimerText,{}),e.jsx(s.DisclaimerArrow,{})]})]}),e.jsxs(s.ExampleQuestions,{children:[e.jsx(s.ExampleQuestionsLabel,{}),e.jsx(s.ExampleQuestionsList,{children:r=>r.map(t=>e.jsx(s.ExampleQuestion,{children:e.jsx(s.ExampleQuestionButton,{question:t})},typeof t=="object"?t.label:t))})]})]})]})}function F(){return e.jsxs(s.MessageHeader,{children:[e.jsx(s.MessageAvatar,{children:e.jsx(s.MessageAvatarContent,{children:e.jsx(s.MessageAvatarImage,{})})}),e.jsx(s.MessageName,{})]})}function R(){return e.jsx(E.PortalWithTheme,{children:e.jsx(m.EmbeddedChatImagePreviewModal,{children:e.jsx(m.EmbeddedChatImagePreviewModalOverlay,{children:e.jsxs(m.EmbeddedChatImagePreviewModalContent,{children:[e.jsx(m.EmbeddedChatImagePreviewModalClose,{}),e.jsx(m.EmbeddedChatImagePreviewModalImage,{}),e.jsx(m.EmbeddedChatImagePreviewModalFooter,{children:e.jsx(m.EmbeddedChatImagePreviewModalFileName,{})})]})})})})}function _(){return e.jsx(i.EmbeddedChatMessageFiles,{children:r=>r.map((t,n)=>{const o=t.url,d=t.mediaType??"",l=d.split("/").pop(),x=t.filename??(l?`untitled.${l}`:"untitled"),c=y.isImageMimeType(d);return e.jsxs(i.EmbeddedChatMessageFile,{url:o,name:x,mediaType:d,children:[c?e.jsx(i.EmbeddedChatFileThumbnail,{}):e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]},o||n)})})}function Q(){return e.jsxs(s.MessageToolbar,{children:[e.jsx(s.MessageCustomActions,{children:r=>r.map((t,n)=>e.jsx(s.MessageCustomAction,{action:t},`action-${n}`))}),e.jsx(s.MessageAction,{action:"copy"}),e.jsx(s.MessageAction,{action:"upvote"}),e.jsx(s.MessageAction,{action:"downvote"})]})}function O(){return e.jsxs(s.MessageSources,{children:[e.jsx(s.MessageSourcesHeader,{}),e.jsx(s.MessageSourcesList,{children:r=>r.map((t,n)=>e.jsxs(s.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(s.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(o=>e.jsxs(g.Fragment,{children:[o,e.jsx(s.MessageSourceItemBreadcrumbIcon,{})]},o))}),e.jsx(s.MessageSourceItemIcon,{}),e.jsx(s.MessageSourceItemTitle,{}),e.jsx(s.MessageSourceItemTag,{}),e.jsx(s.MessageSourceItemDescription,{children:o=>o.map((d,l)=>e.jsx(s.MessageSourceItemDescriptionPart,{descriptionPart:d},`part-${l}`))}),e.jsx(s.MessageSourceItemIndicator,{})]},n))})]})}function U(){return e.jsxs(s.Footer,{children:[e.jsx(i.EmbeddedChatInputNotification,{children:e.jsxs(i.EmbeddedChatInputNotificationContent,{children:[e.jsxs(i.EmbeddedChatInputNotificationHeader,{children:[e.jsx(i.EmbeddedChatInputNotificationTitle,{}),e.jsx(i.EmbeddedChatInputNotificationClose,{})]}),e.jsx(i.EmbeddedChatInputNotificationMessage,{})]})}),e.jsx(G,{}),e.jsx(K,{})]})}function G(){return e.jsxs(s.InputFieldset,{children:[e.jsx(i.EmbeddedChatFileInput,{}),e.jsx(i.EmbeddedChatDropZone,{children:"Drop files here to add to chat"}),e.jsx(i.EmbeddedChatFileList,{children:r=>r.map((t,n)=>{const o=y.isImageMimeType(t.type);return e.jsxs(i.EmbeddedChatFileItem,{file:t,children:[o?e.jsxs(i.EmbeddedChatFilePreviewTrigger,{children:[e.jsx(i.EmbeddedChatFileThumbnail,{}),e.jsx(i.EmbeddedChatFileName,{})]}):e.jsxs(i.EmbeddedChatFileContent,{children:[e.jsx(i.EmbeddedChatFileTypeIcon,{}),e.jsx(i.EmbeddedChatFileName,{})]}),e.jsx(i.EmbeddedChatFileRemove,{})]},`${t.name}-${t.lastModified}-${n}`)})}),e.jsxs(s.InputGroup,{children:[e.jsx(i.EmbeddedChatFileUploadButton,{}),e.jsx(s.Input,{}),e.jsx(s.SendButton,{children:e.jsx(s.SendButtonIcon,{})})]})]})}function K(){return e.jsxs(s.ActionBar,{children:[e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]}),e.jsxs(s.Actions,{children:[e.jsx(s.HelpActions,{children:({pinned:r,unpinned:t})=>e.jsxs(e.Fragment,{children:[r.map(n=>e.jsx(s.HelpAction,{action:n},n.name)),t.length>0&&e.jsx(s.HelpActionsTrigger,{}),e.jsxs(s.HelpActionsMenu,{children:[e.jsx(s.HelpActionsMenuArrow,{}),t.map(n=>e.jsxs(s.HelpActionsMenuItem,{action:n,children:[e.jsx(s.HelpActionsMenuItemIcon,{action:n}),n.name]},n.name))]})]})}),e.jsxs(s.ChatAction,{action:"copy",children:[e.jsx(s.ChatActionLabel,{action:"copy"}),e.jsx(s.ChatActionFeedback,{action:"copy"})]}),e.jsx(s.ChatAction,{action:"clear"}),e.jsx(s.ChatAction,{action:"stop"})]})]})}function Z(){const{sessions:r}=A.useChatHistory(),{conversationId:t}=M.useChat();return e.jsxs(a.EmbeddedChatHistoryRoot,{children:[e.jsxs(a.EmbeddedChatHistoryHeader,{children:[e.jsxs(a.EmbeddedChatHistoryBackButton,{children:[e.jsx(a.EmbeddedChatHistoryBackButtonIcon,{iconKey:"backToChat"}),"Back to chat"]}),e.jsx(a.EmbeddedChatHistoryTitle,{}),e.jsx(C.Close,{})]}),e.jsxs(a.EmbeddedChatHistoryList,{children:[r.map(n=>e.jsxs(a.EmbeddedChatHistoryItem,{sessionId:n.id,"data-active":p.dataAttr(n.id===t),children:[e.jsx(a.EmbeddedChatHistoryItemTitle,{children:n.title}),e.jsx(a.EmbeddedChatHistoryItemDate,{children:a.formatSessionDate(n.updatedAt)})]},n.id)),e.jsx(a.EmbeddedChatHistoryEmptyState,{}),e.jsx(a.EmbeddedChatHistoryLoadingState,{})]}),e.jsx(a.EmbeddedChatHistoryFooter,{children:e.jsx(a.EmbeddedChatHistoryNewConversationButton,{})})]})}function z(){return e.jsx(E.PortalWithTheme,{children:e.jsx(s.FeedbackModal,{children:e.jsx(s.FeedbackModalOverlay,{children:e.jsxs(s.FeedbackModalContent,{children:[e.jsx(s.FeedbackModalHeader,{}),e.jsx(s.FeedbackModalClose,{}),e.jsx(s.FeedbackModalBody,{children:e.jsxs(s.FeedbackForm,{children:[e.jsxs(s.FeedbackField,{children:[e.jsx(s.FeedbackItemLabel,{}),e.jsx(s.FeedbackItemDescription,{})]}),e.jsx(s.FeedbackSubmitButton,{})]})})]})})})})}function J(){return e.jsxs(s.FormWrapper,{children:[e.jsx(s.FormClose,{}),e.jsxs(s.Form,{children:[e.jsxs(s.FormHeader,{children:[e.jsx(s.FormHeading,{}),e.jsx(s.FormDescription,{})]}),e.jsx(s.FormContent,{children:r=>e.jsxs(e.Fragment,{children:[r.map((t,n)=>e.jsxs(s.FormField,{field:t,autoFocus:n===0,children:[e.jsx(s.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(s.FormFieldText,{}),t.inputType==="email"&&e.jsx(s.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(s.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(s.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(s.FormFieldCheckbox,{children:e.jsx(s.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(s.FormFieldSelect,{children:[e.jsxs(s.FormFieldSelectTrigger,{children:[e.jsx(s.FormFieldSelectValue,{}),e.jsx(s.FormFieldSelectIcon,{})]}),e.jsx(s.FormFieldSelectContent,{children:e.jsx(s.FormFieldSelectViewport,{children:t.items.map(o=>e.jsxs(s.FormFieldSelectItem,{value:o.value,children:[e.jsx(s.FormFieldSelectItemText,{children:o.label}),e.jsx(s.FormFieldSelectItemIndicator,{})]},o.value))})})]}),t.inputType==="combobox"&&e.jsxs(s.FormFieldCombobox,{children:[e.jsxs(s.FormFieldComboboxControl,{children:["multiple"in t&&t.multiple&&e.jsx(s.FormFieldComboboxSelectedTags,{}),e.jsx(s.FormFieldComboboxInput,{}),e.jsx(s.FormFieldComboboxTrigger,{})]}),e.jsx(s.FormFieldComboboxPositioner,{children:e.jsx(s.FormFieldComboboxContent,{children:e.jsx(s.FormFieldComboboxList,{children:e.jsx(s.FormFieldComboboxListItems,{children:o=>o.length===0?e.jsx(s.FormFieldComboboxListEmpty,{}):o.map(d=>e.jsxs(s.FormFieldComboboxItem,{item:d,children:[e.jsx(s.FormFieldComboboxItemText,{children:d.label}),e.jsx(s.FormFieldComboboxItemIndicator,{})]},d.value))})})})})]}),e.jsx(s.FormFieldDescription,{}),e.jsx(s.FormFieldError,{})]},t.name)),e.jsx(s.FormError,{})]})}),e.jsxs(s.FormFooter,{children:[e.jsx(s.FormCancel,{}),e.jsx(s.FormSubmit,{})]})]}),e.jsxs(s.FormSuccess,{children:[e.jsx(s.FormSuccessHeading,{}),e.jsx(s.FormSuccessMessage,{}),e.jsx(s.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=D;exports.InkeepEmbeddedChatImpl=S;exports.InkeepEmbeddedChatImplContent=v;exports.InkeepEmbeddedChatProvider=T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as d, Fragment as b } from "react/jsx-runtime";
|
|
3
3
|
import g, { Fragment as S } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Wrapper as V, Root as N, Provider as Q, Header as $, HeaderToolbar as _, HeaderToolbarWrapper as R, ChatHistoryTrigger as O, Content as j, ContentScrollArea as G, ContentScrollAreaViewport as U, MessagesSessionLoading as K, ContentScrollAreaScrollbar as Z, ContentScrollAreaThumb as z, ContentScrollAreaCorner as J, Footer as X, FeedbackModal as Y, FeedbackModalOverlay as q, FeedbackModalContent as ee, FeedbackModalHeader as de, FeedbackModalClose as te, FeedbackModalBody as ae, FeedbackForm as oe, FeedbackField as re, FeedbackItemLabel as ne, FeedbackItemDescription as ie, FeedbackSubmitButton as me, FormWrapper as se, FormClose as le, Form as ce, FormHeader as he, FormHeading as be, FormDescription as Ce, FormContent as Fe, FormField as Ee, FormFieldLabel as ue, FormFieldText as pe, FormFieldEmail as ge, FormFieldFile as Ie, FormFieldTextArea as Me, FormFieldCheckbox as Se, FormFieldCheckboxIndicator as Te, FormFieldSelect as xe, FormFieldSelectTrigger as Ae, FormFieldSelectValue as He, FormFieldSelectIcon as ye, FormFieldSelectContent as fe, FormFieldSelectViewport as ke, FormFieldSelectItem as we, FormFieldSelectItemText as ve, FormFieldSelectItemIndicator as Le, FormFieldCombobox as De, FormFieldComboboxControl as Be, FormFieldComboboxSelectedTags as Pe, FormFieldComboboxInput as We, FormFieldComboboxTrigger as Ve, FormFieldComboboxPositioner as Ne, FormFieldComboboxContent as Qe, FormFieldComboboxList as $e, FormFieldComboboxListItems as _e, FormFieldComboboxListEmpty as Re, FormFieldComboboxItem as Oe, FormFieldComboboxItemText as je, FormFieldComboboxItemIndicator as Ge, FormFieldDescription as Ue, FormFieldError as Ke, FormError as Ze, FormFooter as ze, FormCancel as Je, FormSubmit as Xe, FormSuccess as Ye, FormSuccessHeading as qe, FormSuccessMessage as ed, FormSuccessButton as dd, Messages as td, MessageWrapper as I, MessageContentWrapper as T, MessageContent as x, DynamicComponent as ad, MessageLoading as od, InputFieldset as rd, InputGroup as nd, Input as id, SendButton as md, SendButtonIcon as sd, ActionBar as ld, TaglineContainer as cd, TaglineText as hd, TaglineLogo as bd, Actions as Cd, HelpActions as Fd, HelpAction as Ed, HelpActionsTrigger as ud, HelpActionsMenu as pd, HelpActionsMenuArrow as gd, HelpActionsMenuItem as Id, HelpActionsMenuItemIcon as Md, ChatAction as F, ChatActionLabel as Sd, ChatActionFeedback as Td, IntroMessageWrapper as xd, MessageHeader as A, MessageAvatar as H, MessageAvatarContent as y, MessageAvatarImage as f, MessageName as k, Disclaimer as Ad, DisclaimerLabel as Hd, DisclaimerTrigger as yd, DisclaimerContent as fd, DisclaimerText as kd, DisclaimerArrow as wd, ExampleQuestions as vd, ExampleQuestionsLabel as Ld, ExampleQuestionsList as Dd, ExampleQuestion as Bd, ExampleQuestionButton as Pd, Markdown as Wd, MessageSources as Vd, MessageSourcesHeader as Nd, MessageSourcesList as Qd, MessageSourceItem as $d, MessageSourceItemBreadcrumbs as _d, MessageSourceItemBreadcrumbIcon as Rd, MessageSourceItemIcon as Od, MessageSourceItemTitle as jd, MessageSourceItemTag as Gd, MessageSourceItemDescription as Ud, MessageSourceItemDescriptionPart as Kd, MessageSourceItemIndicator as Zd, MessageToolbar as zd, MessageCustomActions as Jd, MessageCustomAction as Xd, MessageAction as E } from "../styled/components/embedded-chat.js";
|
|
5
5
|
import { EmbeddedChatHistoryRoot as Yd, EmbeddedChatHistoryHeader as qd, EmbeddedChatHistoryBackButton as et, EmbeddedChatHistoryBackButtonIcon as dt, EmbeddedChatHistoryTitle as tt, EmbeddedChatHistoryList as at, EmbeddedChatHistoryItem as ot, EmbeddedChatHistoryItemTitle as rt, EmbeddedChatHistoryItemDate as nt, formatSessionDate as it, EmbeddedChatHistoryEmptyState as mt, EmbeddedChatHistoryLoadingState as st, EmbeddedChatHistoryFooter as lt, EmbeddedChatHistoryNewConversationButton as ct } from "../styled/components/chat-history.js";
|
|
6
6
|
import { Close as u } from "../styled/components/modal.js";
|
|
7
7
|
import { Shadow as ht } from "../styled/components/shadow.js";
|
|
@@ -46,7 +46,7 @@ function wa(a) {
|
|
|
46
46
|
}
|
|
47
47
|
function Gt(a) {
|
|
48
48
|
const { children: t, onToggleView: o, isHidden: r, shouldAutoFocusInput: n = !o } = a;
|
|
49
|
-
return /* @__PURE__ */ e(
|
|
49
|
+
return /* @__PURE__ */ e(Q, { isHidden: r, shouldAutoFocusInput: n, children: t });
|
|
50
50
|
}
|
|
51
51
|
function Ut(a) {
|
|
52
52
|
return /* @__PURE__ */ e(Gt, { ...a, children: /* @__PURE__ */ e(Kt, { ...a }) });
|
|
@@ -54,13 +54,13 @@ function Ut(a) {
|
|
|
54
54
|
function Kt(a) {
|
|
55
55
|
const { onToggleView: t, variant: o, header: r = Zt } = a, n = ut(), m = Et();
|
|
56
56
|
return /* @__PURE__ */ e(It, { children: /* @__PURE__ */ e(n && !m ? gt : S, { children: /* @__PURE__ */ d(
|
|
57
|
-
|
|
57
|
+
V,
|
|
58
58
|
{
|
|
59
59
|
variant: o ?? (t ? "no-shadow" : "container-with-shadow"),
|
|
60
60
|
"data-composite": C(!!a.onToggleView || n?.isOpen),
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ e(ra, {}),
|
|
63
|
-
/* @__PURE__ */ d(
|
|
63
|
+
/* @__PURE__ */ d(N, { children: [
|
|
64
64
|
r && /* @__PURE__ */ e(r, { ...a }),
|
|
65
65
|
/* @__PURE__ */ e(zt, {}),
|
|
66
66
|
/* @__PURE__ */ e(ta, {})
|
|
@@ -227,7 +227,7 @@ function da() {
|
|
|
227
227
|
/* @__PURE__ */ e(Ud, { children: (r) => r.map((n, m) => /* @__PURE__ */ e(
|
|
228
228
|
Kd,
|
|
229
229
|
{
|
|
230
|
-
|
|
230
|
+
descriptionPart: n
|
|
231
231
|
},
|
|
232
232
|
`part-${m}`
|
|
233
233
|
)) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../styled/components/embedded-search.cjs"),R=require("../styled/components/modal.cjs"),A=require("../styled/components/shadow.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../styled/components/embedded-search.cjs"),R=require("../styled/components/modal.cjs"),A=require("../styled/components/shadow.cjs"),u=require("../primitives/providers/config-provider.cjs"),w=require("../primitives/providers/root-provider.cjs"),S=require("../primitives/providers/widget-provider.cjs"),T=require("../primitives/components/embedded-search/search-provider.cjs"),p=require("../primitives/components/modal/modal-provider.cjs"),d=require("../primitives/utils/misc.cjs"),x=require("../primitives/atoms/cmdk/index.cjs"),v=require("../primitives/atoms/error-boundary.cjs"),a=require("react"),j=require("./widget-toggle.cjs"),k=require("./modal.cjs");function b(r){const{baseSettings:t,searchSettings:n}=r;return e.jsx(v.ErrorBoundary,{children:e.jsx(A.Shadow,{children:e.jsx(w.RootProvider,{config:{baseSettings:t,searchSettings:n},componentType:u.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(h,{...r})})})})}function I(r){const{children:t,onToggleView:n,isHidden:i,shouldAutoFocusInput:l=!n}=r;return e.jsx(s.Provider,{isHidden:i,shouldAutoFocusInput:l,children:t})}function h(r){return e.jsx(I,{...r,children:e.jsx(m,{...r})})}function m(r){const{searchSettings:{view:t}}=u.useInkeepConfig(),{onToggleView:n,shouldShowAskAICard:i=!!n&&t!=="dual-pane"}=r,l=p.useModal(),o=S.useWidget(),c=l&&!o?k.ModalContent:a.Fragment;return e.jsx(c,{children:e.jsx(s.Wrapper,{"data-show-ask-ai-card":d.dataAttr(i),"data-composite":d.dataAttr(!!n||l?.isOpen),children:e.jsxs(s.Root,{children:[e.jsx(P,{...r}),e.jsxs(s.Content,{children:[e.jsx(C,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:i}),e.jsx(L,{})]}),e.jsx(y,{})]})})})}function P(r){const{onToggleView:t,askAILabel:n,searchLabel:i}=r,l=x.useCommandState(c=>c.search),{loading:o}=T.useSearch();return e.jsxs(s.InputGroup,{children:[!o&&e.jsx(s.InputIcon,{}),e.jsx(s.Loading,{}),e.jsx(s.Input,{}),t&&e.jsx(j.WidgetToggle,{onToggleView:t,query:l,askAILabel:n,searchLabel:i,view:"search"}),e.jsx(R.Close,{})]})}function C(r){const{askAILabel:t,onToggleView:n,shouldShowAskAICard:i,askAICardLabel:l}=r,o=x.useCommandState(g=>g.search),{handleToggle:c}=j.useToggleView({onToggleView:n,query:o});return i?e.jsxs(s.AskAITrigger,{onSelect:()=>c("chat",!0),children:[e.jsx(s.AskAITriggerIcon,{}),e.jsxs(s.AskAITriggerLabel,{children:[l||t||"Ask AI",o&&e.jsx(s.AskAITriggerQuery,{children:`${o}`})]}),e.jsx(s.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(s.AskAITriggerIndicator,{})]}):null}function L(){return e.jsxs(s.Results,{children:[e.jsx(s.ResultsLoading,{}),e.jsx(s.ResultsTabList,{children:r=>r.map(t=>e.jsx(s.ResultsTab,{tab:t},t))}),e.jsx(s.ResultsEmpty,{}),e.jsxs(s.ResultsContent,{children:[e.jsx(q,{}),e.jsx(f,{})]})]})}function q(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsx(s.ResultsList,{children:r=>r.map(t=>e.jsxs(s.ResultsItem,{item:t,children:[e.jsx(s.ResultsItemBreadcrumbs,{children:n=>n.map((i,l)=>e.jsxs(a.Fragment,{children:[i,e.jsx(s.ResultsItemBreadcrumbIcon,{})]},`${i}-${l}`))}),e.jsx(s.ResultsItemIcon,{}),e.jsx(s.ResultsItemTitle,{}),e.jsx(s.ResultsItemTag,{}),e.jsx(s.ResultsItemDescription,{children:n=>n.map((i,l)=>e.jsx(s.ResultsItemDescriptionPart,{descriptionPart:i},`part-${l}`))}),e.jsx(s.ResultsItemIndicator,{})]},t.id))})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function f(){return e.jsxs(s.ResultsScrollArea,{children:[e.jsx(s.ResultsScrollAreaViewport,{children:e.jsxs(s.ResultsItemPreview,{children:[e.jsxs(s.ResultsItemPreviewHeader,{children:[e.jsxs(s.ResultsItemPreviewHeading,{children:[e.jsx(s.ResultsItemPreviewTitle,{}),e.jsx(s.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(s.ResultsItemPreviewBreadcrumbs,{children:r=>r.map((t,n)=>e.jsxs(a.Fragment,{children:[t,e.jsx(s.ResultsItemPreviewBreadcrumbIcon,{})]},`${t}-${n}`))})]}),e.jsx(s.ResultsItemPreviewBody,{}),e.jsxs(s.ResultsItemPreviewOutline,{children:[e.jsx(s.ResultsItemPreviewOutlineTitle,{}),e.jsx(s.ResultsItemPreviewOutlineList,{children:r=>r.map((t,n)=>e.jsxs(s.ResultsItemPreviewOutlineItem,{href:t.url??void 0,"data-is-match":d.dataAttr(t.isMatch),children:[e.jsx(s.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(s.ResultsItemPreviewOutlineItemText,{children:t.content}),t.url&&e.jsx(s.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${t.anchor}-${n}`))})]})]})}),e.jsx(s.ResultsScrollAreaScrollbar,{children:e.jsx(s.ResultsScrollAreaThumb,{})}),e.jsx(s.ResultsScrollAreaCorner,{})]})}function y(){return e.jsx(s.Footer,{children:e.jsxs(s.TaglineContainer,{children:[e.jsx(s.TaglineText,{}),e.jsx(s.TaglineLogo,{})]})})}exports.InkeepEmbeddedSearch=b;exports.InkeepEmbeddedSearchImpl=h;exports.InkeepEmbeddedSearchImplContent=m;exports.InkeepEmbeddedSearchProvider=I;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { Wrapper as g, Root as E, Content as p, Provider as T, InputGroup as A, InputIcon as w, Loading as v, Input as P, AskAITrigger as k, AskAITriggerIcon as f, AskAITriggerLabel as L, AskAITriggerQuery as C, AskAITriggerIndicatorText as O, AskAITriggerIndicator as y, Results as B, ResultsLoading as x, ResultsTabList as V, ResultsTab as W, ResultsEmpty as $, ResultsContent as F, Footer as H, TaglineContainer as D, TaglineText as M, TaglineLogo as G, ResultsScrollArea as m, ResultsScrollAreaViewport as u, ResultsList as j, ResultsItem as q, ResultsItemBreadcrumbs as Q, ResultsItemBreadcrumbIcon as z, ResultsItemIcon as J, ResultsItemTitle as K, ResultsItemTag as N, ResultsItemDescription as U, ResultsItemDescriptionPart as X, ResultsItemIndicator as Y, ResultsScrollAreaScrollbar as h, ResultsScrollAreaThumb as I, ResultsScrollAreaCorner as b, ResultsItemPreview as Z, ResultsItemPreviewHeader as _, ResultsItemPreviewHeading as ee, ResultsItemPreviewTitle as re, ResultsItemPreviewTitleLinkIcon as te, ResultsItemPreviewBreadcrumbs as se, ResultsItemPreviewBreadcrumbIcon as de, ResultsItemPreviewBody as ae, ResultsItemPreviewOutline as ne, ResultsItemPreviewOutlineTitle as ie, ResultsItemPreviewOutlineList as le, ResultsItemPreviewOutlineItem as ce, ResultsItemPreviewOutlineItemIcon as oe, ResultsItemPreviewOutlineItemText as me, ResultsItemPreviewOutlineItemLinkIcon as ue } from "../styled/components/embedded-search.js";
|
|
4
4
|
import { Close as he } from "../styled/components/modal.js";
|
|
5
5
|
import { Shadow as Ie } from "../styled/components/shadow.js";
|
|
6
6
|
import { WebWidgetInteractionType as be, useInkeepConfig as Se } from "../primitives/providers/config-provider.js";
|
|
7
7
|
import { RootProvider as Re } from "../primitives/providers/root-provider.js";
|
|
8
8
|
import { useWidget as ge } from "../primitives/providers/widget-provider.js";
|
|
9
9
|
import { useSearch as Ee } from "../primitives/components/embedded-search/search-provider.js";
|
|
10
|
-
import { useModal as
|
|
10
|
+
import { useModal as pe } from "../primitives/components/modal/modal-provider.js";
|
|
11
11
|
import { dataAttr as c } from "../primitives/utils/misc.js";
|
|
12
12
|
import { useCommandState as S } from "../primitives/atoms/cmdk/index.js";
|
|
13
|
-
import { ErrorBoundary as
|
|
13
|
+
import { ErrorBoundary as Te } from "../primitives/atoms/error-boundary.js";
|
|
14
14
|
import { Fragment as o } from "react";
|
|
15
15
|
import { WidgetToggle as Ae, useToggleView as we } from "./widget-toggle.js";
|
|
16
16
|
import { ModalContent as ve } from "./modal.js";
|
|
17
17
|
function Ue(r) {
|
|
18
18
|
const { baseSettings: t, searchSettings: s } = r;
|
|
19
|
-
return /* @__PURE__ */ e(
|
|
19
|
+
return /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(Ie, { children: /* @__PURE__ */ e(
|
|
20
20
|
Re,
|
|
21
21
|
{
|
|
22
22
|
config: {
|
|
@@ -30,7 +30,7 @@ function Ue(r) {
|
|
|
30
30
|
}
|
|
31
31
|
function Pe(r) {
|
|
32
32
|
const { children: t, onToggleView: s, isHidden: a, shouldAutoFocusInput: n = !s } = r;
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
33
|
+
return /* @__PURE__ */ e(T, { isHidden: a, shouldAutoFocusInput: n, children: t });
|
|
34
34
|
}
|
|
35
35
|
function ke(r) {
|
|
36
36
|
return /* @__PURE__ */ e(Pe, { ...r, children: /* @__PURE__ */ e(fe, { ...r }) });
|
|
@@ -38,13 +38,13 @@ function ke(r) {
|
|
|
38
38
|
function fe(r) {
|
|
39
39
|
const {
|
|
40
40
|
searchSettings: { view: t }
|
|
41
|
-
} = Se(), { onToggleView: s, shouldShowAskAICard: a = !!s && t !== "dual-pane" } = r, n =
|
|
42
|
-
return /* @__PURE__ */ e(n && !
|
|
43
|
-
|
|
41
|
+
} = Se(), { onToggleView: s, shouldShowAskAICard: a = !!s && t !== "dual-pane" } = r, n = pe(), i = ge();
|
|
42
|
+
return /* @__PURE__ */ e(n && !i ? ve : o, { children: /* @__PURE__ */ e(
|
|
43
|
+
g,
|
|
44
44
|
{
|
|
45
45
|
"data-show-ask-ai-card": c(a),
|
|
46
46
|
"data-composite": c(!!s || n?.isOpen),
|
|
47
|
-
children: /* @__PURE__ */ d(
|
|
47
|
+
children: /* @__PURE__ */ d(E, { children: [
|
|
48
48
|
/* @__PURE__ */ e(Le, { ...r }),
|
|
49
49
|
/* @__PURE__ */ d(p, { children: [
|
|
50
50
|
/* @__PURE__ */ e(
|
|
@@ -64,9 +64,9 @@ function fe(r) {
|
|
|
64
64
|
) });
|
|
65
65
|
}
|
|
66
66
|
function Le(r) {
|
|
67
|
-
const { onToggleView: t, askAILabel: s, searchLabel: a } = r, n = S((
|
|
67
|
+
const { onToggleView: t, askAILabel: s, searchLabel: a } = r, n = S((l) => l.search), { loading: i } = Ee();
|
|
68
68
|
return /* @__PURE__ */ d(A, { children: [
|
|
69
|
-
!
|
|
69
|
+
!i && /* @__PURE__ */ e(w, {}),
|
|
70
70
|
/* @__PURE__ */ e(v, {}),
|
|
71
71
|
/* @__PURE__ */ e(P, {}),
|
|
72
72
|
t && /* @__PURE__ */ e(
|
|
@@ -83,15 +83,15 @@ function Le(r) {
|
|
|
83
83
|
] });
|
|
84
84
|
}
|
|
85
85
|
function Ce(r) {
|
|
86
|
-
const { askAILabel: t, onToggleView: s, shouldShowAskAICard: a, askAICardLabel: n } = r,
|
|
86
|
+
const { askAILabel: t, onToggleView: s, shouldShowAskAICard: a, askAICardLabel: n } = r, i = S((R) => R.search), { handleToggle: l } = we({
|
|
87
87
|
onToggleView: s,
|
|
88
|
-
query:
|
|
88
|
+
query: i
|
|
89
89
|
});
|
|
90
|
-
return a ? /* @__PURE__ */ d(k, { onSelect: () =>
|
|
90
|
+
return a ? /* @__PURE__ */ d(k, { onSelect: () => l("chat", !0), children: [
|
|
91
91
|
/* @__PURE__ */ e(f, {}),
|
|
92
92
|
/* @__PURE__ */ d(L, { children: [
|
|
93
93
|
n || t || "Ask AI",
|
|
94
|
-
|
|
94
|
+
i && /* @__PURE__ */ e(C, { children: `${i}` })
|
|
95
95
|
] }),
|
|
96
96
|
/* @__PURE__ */ e(O, { children: "Start conversation" }),
|
|
97
97
|
/* @__PURE__ */ e(y, {})
|
|
@@ -121,7 +121,7 @@ function ye() {
|
|
|
121
121
|
/* @__PURE__ */ e(U, { children: (s) => s.map((a, n) => /* @__PURE__ */ e(
|
|
122
122
|
X,
|
|
123
123
|
{
|
|
124
|
-
|
|
124
|
+
descriptionPart: a
|
|
125
125
|
},
|
|
126
126
|
`part-${n}`
|
|
127
127
|
)) }),
|
|
@@ -146,8 +146,8 @@ function Be() {
|
|
|
146
146
|
] }),
|
|
147
147
|
/* @__PURE__ */ e(ae, {}),
|
|
148
148
|
/* @__PURE__ */ d(ne, { children: [
|
|
149
|
-
/* @__PURE__ */ e(
|
|
150
|
-
/* @__PURE__ */ e(
|
|
149
|
+
/* @__PURE__ */ e(ie, {}),
|
|
150
|
+
/* @__PURE__ */ e(le, { children: (r) => r.map((t, s) => /* @__PURE__ */ d(
|
|
151
151
|
ce,
|
|
152
152
|
{
|
|
153
153
|
href: t.url ?? void 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { CloseButton as o, Header as l, ChatBubblePrimitiveRoot as b } from "../../primitives/components/chat-bubble/index.js";
|
|
4
4
|
import { cn as r } from "../utils.js";
|
|
5
5
|
import { button as s } from "./ui/recipes/button.js";
|
|
6
6
|
import { scrollable as i } from "./ui/recipes/scrollable.js";
|
|
@@ -8,7 +8,7 @@ const f = ({
|
|
|
8
8
|
className: t,
|
|
9
9
|
...e
|
|
10
10
|
}) => /* @__PURE__ */ a(
|
|
11
|
-
|
|
11
|
+
b,
|
|
12
12
|
{
|
|
13
13
|
...e,
|
|
14
14
|
className: r(
|
|
@@ -30,7 +30,7 @@ const f = ({
|
|
|
30
30
|
className: t,
|
|
31
31
|
...e
|
|
32
32
|
}) => /* @__PURE__ */ a(
|
|
33
|
-
|
|
33
|
+
l,
|
|
34
34
|
{
|
|
35
35
|
className: r(
|
|
36
36
|
i({ section: "header" }),
|
|
@@ -53,7 +53,7 @@ const f = ({
|
|
|
53
53
|
className: t,
|
|
54
54
|
...e
|
|
55
55
|
}) => /* @__PURE__ */ a(
|
|
56
|
-
|
|
56
|
+
o,
|
|
57
57
|
{
|
|
58
58
|
className: r(
|
|
59
59
|
s({ variant: "ghost", size: "xs" }),
|
|
@@ -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 e=require("react/jsx-runtime"),n=require("../../primitives/components/chat-button.cjs"),o=require("../utils.cjs"),s=({className:t,...a})=>e.jsx(n.ChatButtonContainer,{className:o.cn("fixed right-6 bottom-6 z-50 mr-[var(--removed-body-scroll-bar-size)]",t),...a}),r=({className:t,...a})=>e.jsx(n.ChatButton,{className:o.cn("bg-inkeep-primary-text-bold dark:bg-gray-dark-600 rounded-full px-[18px] py-3 text-white font-medium flex items-center space-x-2 shadow-2xl hover:[&:not(:active)]:scale-110 dark:shadow-none transition-transform ease-in-out data-[open]:px-3 active:scale-90 active:transition-transform active:duration-100",t),...a}),c=({className:t,...a})=>e.jsx(n.ChatButtonText,{className:o.cn("flex items-center",t),...a}),i=({className:t,...a})=>e.jsx(n.ChatButtonCloseIcon,{className:o.cn("w-6 h-6",t),...a}),u=({className:t,...a})=>e.jsx(n.ChatButtonAvatarImage,{className:o.cn("data-[type=icon]:[--start-color:theme(colors.inkeep-expanded-primary.50)]","data-[type=icon]:[--end-color:theme(colors.inkeep-expanded-primary.300)]","h-6 w-6",t),...a}),l=({className:t,...a})=>e.jsx(n.ChatButtonAvatarContent,{className:o.cn("",t),...a});exports.ChatButton=r;exports.ChatButtonAvatarContent=l;exports.ChatButtonAvatarImage=u;exports.ChatButtonCloseIcon=i;exports.ChatButtonText=c;exports.Container=s;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { ChatButton as n, ChatButtonAvatarContent as r, ChatButtonAvatarImage as i, ChatButtonCloseIcon as s, ChatButtonText as m, ChatButtonContainer as c } from "../../primitives/components/chat-button.js";
|
|
4
4
|
import { cn as o } from "../utils.js";
|
|
5
|
-
const
|
|
5
|
+
const l = ({
|
|
6
6
|
className: t,
|
|
7
7
|
...a
|
|
8
8
|
}) => /* @__PURE__ */ e(
|
|
9
|
-
|
|
9
|
+
c,
|
|
10
10
|
{
|
|
11
11
|
className: o(
|
|
12
12
|
"fixed right-6 bottom-6 z-50 mr-[var(--removed-body-scroll-bar-size)]",
|
|
@@ -18,7 +18,7 @@ const u = ({
|
|
|
18
18
|
className: t,
|
|
19
19
|
...a
|
|
20
20
|
}) => /* @__PURE__ */ e(
|
|
21
|
-
|
|
21
|
+
n,
|
|
22
22
|
{
|
|
23
23
|
className: o(
|
|
24
24
|
"bg-inkeep-primary-text-bold dark:bg-gray-dark-600 rounded-full px-[18px] py-3 text-white font-medium flex items-center space-x-2 shadow-2xl hover:[&:not(:active)]:scale-110 dark:shadow-none transition-transform ease-in-out data-[open]:px-3 active:scale-90 active:transition-transform active:duration-100",
|
|
@@ -29,14 +29,14 @@ const u = ({
|
|
|
29
29
|
), p = ({
|
|
30
30
|
className: t,
|
|
31
31
|
...a
|
|
32
|
-
}) => /* @__PURE__ */ e(
|
|
32
|
+
}) => /* @__PURE__ */ e(m, { className: o("flex items-center", t), ...a }), v = ({
|
|
33
33
|
className: t,
|
|
34
34
|
...a
|
|
35
|
-
}) => /* @__PURE__ */ e(
|
|
35
|
+
}) => /* @__PURE__ */ e(s, { className: o("w-6 h-6", t), ...a }), B = ({
|
|
36
36
|
className: t,
|
|
37
37
|
...a
|
|
38
38
|
}) => /* @__PURE__ */ e(
|
|
39
|
-
|
|
39
|
+
i,
|
|
40
40
|
{
|
|
41
41
|
className: o(
|
|
42
42
|
"data-[type=icon]:[--start-color:theme(colors.inkeep-expanded-primary.50)]",
|
|
@@ -49,12 +49,12 @@ const u = ({
|
|
|
49
49
|
), x = ({
|
|
50
50
|
className: t,
|
|
51
51
|
...a
|
|
52
|
-
}) => /* @__PURE__ */ e(
|
|
52
|
+
}) => /* @__PURE__ */ e(r, { className: o("", t), ...a });
|
|
53
53
|
export {
|
|
54
54
|
d as ChatButton,
|
|
55
55
|
x as ChatButtonAvatarContent,
|
|
56
56
|
B as ChatButtonAvatarImage,
|
|
57
57
|
v as ChatButtonCloseIcon,
|
|
58
58
|
p as ChatButtonText,
|
|
59
|
-
|
|
59
|
+
l as Container
|
|
60
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("../../primitives/components/chat-history/index.cjs"),i=require("../utils.cjs"),d=require("./ui/recipes/button.cjs");function h(t){const e=Date.now()-t.getTime(),r=Math.floor(e/(1e3*60)),s=Math.floor(e/(1e3*60*60)),n=Math.floor(e/(1e3*60*60*24));return r<1?"Just now":r<60?`${r}m ago`:s<24?`${s}h ago`:n<7?t.toLocaleDateString("en-US",{weekday:"short"}):t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}const c=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveRoot,{className:i.cn("flex flex-col flex-1 min-h-0 w-full rounded-[inherit] font-body","data-[hidden]:hidden","group-data-[chat-history-layout=sidepane]/chat-history:basis-64","group-data-[chat-history-layout=sidepane]/chat-history:w-64","group-data-[chat-history-layout=sidepane]/chat-history:max-w-64","group-data-[chat-history-layout=sidepane]/chat-history:shrink-0","group-data-[chat-history-layout=sidepane]/chat-history:grow-0","group-data-[chat-history-layout=sidepane]/chat-history:border-r","group-data-[chat-history-layout=sidepane]/chat-history:border-gray-200","dark:group-data-[chat-history-layout=sidepane]/chat-history:border-gray-dark-800",t),...e}),l=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveHeader,{className:i.cn("flex items-center justify-between shrink-0","px-3 py-3 relative","after:absolute after:left-0 after:top-full after:h-3 after:w-full after:text-white after:dark:text-gray-dark-950 after:bg-[linear-gradient(currentColor,_transparent)] after:z-start",t),...e}),y=({className:t,...e})=>a.jsx(o.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("../../primitives/components/chat-history/index.cjs"),i=require("../utils.cjs"),d=require("./ui/recipes/button.cjs");function h(t){const e=Date.now()-t.getTime(),r=Math.floor(e/(1e3*60)),s=Math.floor(e/(1e3*60*60)),n=Math.floor(e/(1e3*60*60*24));return r<1?"Just now":r<60?`${r}m ago`:s<24?`${s}h ago`:n<7?t.toLocaleDateString("en-US",{weekday:"short"}):t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}const c=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveRoot,{className:i.cn("flex flex-col flex-1 min-h-0 w-full rounded-[inherit] font-body","data-[hidden]:hidden","group-data-[chat-history-layout=sidepane]/chat-history:basis-64","group-data-[chat-history-layout=sidepane]/chat-history:w-64","group-data-[chat-history-layout=sidepane]/chat-history:max-w-64","group-data-[chat-history-layout=sidepane]/chat-history:shrink-0","group-data-[chat-history-layout=sidepane]/chat-history:grow-0","group-data-[chat-history-layout=sidepane]/chat-history:border-r","group-data-[chat-history-layout=sidepane]/chat-history:border-gray-200","dark:group-data-[chat-history-layout=sidepane]/chat-history:border-gray-dark-800",t),...e}),l=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveHeader,{className:i.cn("flex items-center justify-between shrink-0","px-3 py-3 relative","after:absolute after:left-0 after:top-full after:h-3 after:w-full after:text-white after:dark:text-gray-dark-950 after:bg-[linear-gradient(currentColor,_transparent)] after:z-start",t),...e}),y=({className:t,...e})=>a.jsx(o.BackButtonIcon,{className:i.cn("text-sm",t),...e}),m=({className:t,...e})=>a.jsx(o.BackButton,{className:i.cn(d.button({size:"xs",variant:"ghost"}),"gap-1.5 text-gray-600 hover:text-gray-800 dark:text-white dark:opacity-60 dark:hover:text-white dark:hover:opacity-95","group-data-[chat-history-layout=sidepane]/chat-history:!hidden",t),...e}),u=({className:t,children:e,...r})=>a.jsx(o.ChatHistoryPrimitiveTitle,{className:i.cn("pl-2 text-sm font-normal text-gray-600 dark:text-white-alpha-600","group-data-[chat-history-layout=stack]/chat-history:!hidden",t),...r,children:e??"Chats"}),f=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveList,{className:i.cn("flex-1 min-h-0 overflow-y-auto [scrollbar-width:thin] px-2 py-3 space-y-0.5",t),...e}),b=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveItem,{className:i.cn("flex flex-col gap-0.5 w-full text-left px-3 py-2 rounded-lg","hover:bg-gray-50 dark:hover:bg-gray-dark-900","focus-visible:outline-none focus-visible:bg-gray-50 dark:focus-visible:bg-gray-dark-900","data-[active]:bg-gray-100 dark:data-[active]:bg-gray-dark-800","transition-colors cursor-pointer",t),...e}),g=({className:t,children:e,...r})=>a.jsx(o.ChatHistoryPrimitiveItemTitle,{className:i.cn("text-sm text-gray-800 dark:text-white-alpha-950 truncate w-full block",t),...r,children:e||a.jsx("span",{className:"text-gray-500 dark:text-white-alpha-500",children:"No message"})}),x=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveItemDate,{className:i.cn("text-xs text-gray-500 dark:text-white-alpha-500",t),...e}),p=({className:t,children:e,...r})=>a.jsx(o.ChatHistoryPrimitiveEmptyState,{className:i.cn("flex flex-col items-center justify-center flex-1 py-2 h-full","text-sm text-gray-500 dark:text-white-alpha-500",t),...r,children:e??"No conversations yet."}),C=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveLoadingState,{className:i.cn("flex flex-col px-3 py-2 gap-3",t),...e,children:[1,2,3].map(r=>a.jsx("div",{className:"h-14 w-full rounded-lg bg-gray-100 dark:bg-gray-dark-800 animate-pulse"},r))}),H=({className:t,...e})=>a.jsx(o.ChatHistoryPrimitiveFooter,{className:i.cn("shrink-0 px-5 py-4 relative","before:absolute before:block before:top-0 before:left-0 before:pointer-events-none before:w-full before:h-3 before:bg-[linear-gradient(transparent,_white)] dark:before:bg-[linear-gradient(transparent,_var(--ikp-color-gray-dark-950))] before:-translate-y-full",t),...e}),k=({className:t,children:e,...r})=>a.jsx(o.ChatHistoryPrimitiveNewConversationButton,{className:i.cn(d.button({variant:"primaryFilled"}),"w-full shrink-0",t),...r,children:e??"New conversation"});exports.EmbeddedChatHistoryBackButton=m;exports.EmbeddedChatHistoryBackButtonIcon=y;exports.EmbeddedChatHistoryEmptyState=p;exports.EmbeddedChatHistoryFooter=H;exports.EmbeddedChatHistoryHeader=l;exports.EmbeddedChatHistoryItem=b;exports.EmbeddedChatHistoryItemDate=x;exports.EmbeddedChatHistoryItemTitle=g;exports.EmbeddedChatHistoryList=f;exports.EmbeddedChatHistoryLoadingState=C;exports.EmbeddedChatHistoryNewConversationButton=k;exports.EmbeddedChatHistoryRoot=c;exports.EmbeddedChatHistoryTitle=u;exports.formatSessionDate=h;
|