@inkeep/cxkit-react 0.0.0-dev-20250227001943 → 0.0.0-dev-20250228015002
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/components/chat-button.cjs +1 -1
- package/dist/components/chat-button.js +20 -20
- package/dist/components/embedded-chat.cjs +1 -1
- package/dist/components/embedded-chat.d.cts +3 -0
- package/dist/components/embedded-chat.d.ts +3 -0
- package/dist/components/embedded-chat.js +55 -46
- package/dist/components/embedded-search-and-chat.cjs +1 -1
- package/dist/components/embedded-search-and-chat.js +34 -39
- package/dist/components/embedded-search.cjs +1 -1
- package/dist/components/embedded-search.d.cts +3 -0
- package/dist/components/embedded-search.d.ts +3 -0
- package/dist/components/embedded-search.js +80 -71
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.js +30 -26
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.js +6 -6
- package/dist/components/searchbar.cjs +1 -1
- package/dist/components/searchbar.js +20 -20
- package/dist/index.cjs +1 -1
- package/dist/index.js +30 -26
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),m=require("react"),g=require("./modal.cjs"),x=require("./embedded-search-and-chat.cjs"),B=require("./embedded-search-and-chat.impl.cjs"),j=require("./embedded-chat.cjs");function I(n){const[
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("@inkeep/cxkit-styled"),m=require("react"),g=require("./modal.cjs"),x=require("./embedded-search-and-chat.cjs"),B=require("./embedded-search-and-chat.impl.cjs"),j=require("./embedded-chat.cjs");function I(n){const[a,o]=m.useState(!1),{modalSettings:r,label:i,defaultView:s="chat",canToggleView:p=!0,...c}=n,{config:d,...u}=B.useWidgetImpl({...c,defaultView:s}),C={...r,isOpen:a,onOpenChange:h=>{n.forceDefaultView&&!h&&u.setView(s??"chat"),o(!!h)}};return t.jsxs(t.Fragment,{children:[t.jsx(e.Shadow,{wrapperStyles:{display:"contents"},children:t.jsx(e.RootProvider,{config:d,componentType:e.WebWidgetInteractionType.ChatButton,children:t.jsx(l,{label:i,setOpen:o})})}),t.jsx(g.InkeepModal,{...d,componentType:e.WebWidgetInteractionType.ChatButton,modalSettings:C,children:p?t.jsx(x.InkeepEmbeddedSearchAndChatImpl,{...u}):t.jsx(j.InkeepEmbeddedChatImpl,{...c})})]})}function l(n){const{label:a="Ask AI",setOpen:o}=n;return t.jsx(e.ChatButton.Container,{children:t.jsxs(e.ChatButton.ChatButton,{onClick:r=>{r.button!==2&&o(i=>!i)},children:[t.jsx(e.ChatButton.ChatButtonText,{children:a}),t.jsx(e.ChatButton.ChatButtonAvatarContent,{children:t.jsx(e.ChatButton.ChatButtonAvatarImage,{})})]})})}exports.ChatButtonImpl=l;exports.InkeepChatButton=I;
|
|
@@ -2,47 +2,47 @@
|
|
|
2
2
|
import { jsxs as s, Fragment as C, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { Shadow as g, RootProvider as I, WebWidgetInteractionType as h, ChatButton as e } from "@inkeep/cxkit-styled";
|
|
4
4
|
import { useState as B } from "react";
|
|
5
|
-
import { InkeepModal as
|
|
6
|
-
import { InkeepEmbeddedSearchAndChatImpl as
|
|
7
|
-
import { useWidgetImpl as
|
|
8
|
-
import { InkeepEmbeddedChatImpl as
|
|
9
|
-
function
|
|
10
|
-
const [
|
|
11
|
-
modalSettings:
|
|
5
|
+
import { InkeepModal as S } from "./modal.js";
|
|
6
|
+
import { InkeepEmbeddedSearchAndChatImpl as b } from "./embedded-search-and-chat.js";
|
|
7
|
+
import { useWidgetImpl as k } from "./embedded-search-and-chat.impl.js";
|
|
8
|
+
import { InkeepEmbeddedChatImpl as w } from "./embedded-chat.js";
|
|
9
|
+
function E(n) {
|
|
10
|
+
const [r, o] = B(!1), {
|
|
11
|
+
modalSettings: a,
|
|
12
12
|
label: i,
|
|
13
|
-
defaultView:
|
|
13
|
+
defaultView: l = "chat",
|
|
14
14
|
canToggleView: u = !0,
|
|
15
|
-
...
|
|
16
|
-
} = n, { config: m, ...
|
|
17
|
-
...
|
|
18
|
-
isOpen:
|
|
15
|
+
...c
|
|
16
|
+
} = n, { config: m, ...p } = k({ ...c, defaultView: l }), f = {
|
|
17
|
+
...a,
|
|
18
|
+
isOpen: r,
|
|
19
19
|
onOpenChange: (d) => {
|
|
20
|
-
n.forceDefaultView && !d &&
|
|
20
|
+
n.forceDefaultView && !d && p.setView(l ?? "chat"), o(!!d);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return /* @__PURE__ */ s(C, { children: [
|
|
24
24
|
/* @__PURE__ */ t(g, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ t(I, { config: m, componentType: h.ChatButton, children: /* @__PURE__ */ t(y, { label: i, setOpen: o }) }) }),
|
|
25
25
|
/* @__PURE__ */ t(
|
|
26
|
-
|
|
26
|
+
S,
|
|
27
27
|
{
|
|
28
28
|
...m,
|
|
29
29
|
componentType: h.ChatButton,
|
|
30
30
|
modalSettings: f,
|
|
31
|
-
children: u ? /* @__PURE__ */ t(
|
|
31
|
+
children: u ? /* @__PURE__ */ t(b, { ...p }) : /* @__PURE__ */ t(w, { ...c })
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
] });
|
|
35
35
|
}
|
|
36
36
|
function y(n) {
|
|
37
|
-
const { label:
|
|
37
|
+
const { label: r = "Ask AI", setOpen: o } = n;
|
|
38
38
|
return /* @__PURE__ */ t(e.Container, { children: /* @__PURE__ */ s(
|
|
39
39
|
e.ChatButton,
|
|
40
40
|
{
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
onClick: (a) => {
|
|
42
|
+
a.button !== 2 && o((i) => !i);
|
|
43
43
|
},
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */ t(e.ChatButtonText, { children:
|
|
45
|
+
/* @__PURE__ */ t(e.ChatButtonText, { children: r }),
|
|
46
46
|
/* @__PURE__ */ t(e.ChatButtonAvatarContent, { children: /* @__PURE__ */ t(e.ChatButtonAvatarImage, {}) })
|
|
47
47
|
]
|
|
48
48
|
}
|
|
@@ -50,5 +50,5 @@ function y(n) {
|
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
52
|
y as ChatButtonImpl,
|
|
53
|
-
|
|
53
|
+
E as InkeepChatButton
|
|
54
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),c=require("react"),i=require("./widget-toggle.cjs");function o(a){const{baseSettings:t,aiChatSettings:s}=a;return e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:{baseSettings:t,aiChatSettings:s},componentType:d.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(r,{...a})})})}function r(a){const{onToggleView:t,isHidden:s,shouldAutoFocusInput:n=!t}=a,h=d.useModal();return e.jsx(d.EmbeddedChat.Provider,{isHidden:s,shouldAutoFocusInput:n,children:e.jsxs(d.EmbeddedChat.Wrapper,{variant:t?"no-shadow":"container-with-shadow","data-composite":d.dataAttr(!!a.onToggleView||h?.isOpen),children:[e.jsx(d.EmbeddedChat.ConversationLoading,{}),e.jsxs(d.EmbeddedChat.Root,{children:[e.jsx(b,{...a}),e.jsx(l,{}),e.jsx(g,{})]}),e.jsx(M,{}),e.jsx(I,{})]})})}function b(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,h=!!t;return e.jsxs(d.EmbeddedChat.Header,{"data-show-toolbar":d.dataAttr(h),children:[h&&e.jsxs(d.EmbeddedChat.HeaderToolbar,{children:[e.jsxs(d.EmbeddedChat.HeaderToolbarWrapper,{children:[e.jsx(d.EmbeddedChat.ToolbarHeader,{}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]})]}),e.jsx(i.WidgetToggle,{onToggleView:t,askAILabel:s,searchLabel:n,view:"chat"})]}),e.jsx(d.Modal.Close,{})]})}function l(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(C,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function C(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(x,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(j,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(E,{}),e.jsx(u,{}),e.jsx(F,{})]})]},t.id))]})})}function x(){return e.jsxs(d.EmbeddedChat.IntroMessageWrapper,{children:[e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerLabel,{}),e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]}),e.jsxs(d.EmbeddedChat.QuickQuestions,{children:[e.jsx(d.EmbeddedChat.QuickQuestionsLabel,{}),e.jsx(d.EmbeddedChat.QuickQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.QuickQuestion,{children:e.jsx(d.EmbeddedChat.QuickQuestionButton,{question:t})},t))})]})]})]})}function j(){return e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]})}function E(){return e.jsxs(d.EmbeddedChat.MessageAttachments,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.MessageAttachmentsItem,{attachment:t,children:[e.jsx(d.EmbeddedChat.MessageAttachmentsItemIcon,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreview,{children:e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewOverlay,{children:e.jsxs(d.EmbeddedChat.MessageAttachmentsPreviewContent,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewHeader,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewClose,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewBody,{})]})})})})]})}function u(){return e.jsxs(d.EmbeddedChat.MessageActions,{children:[e.jsx(d.EmbeddedChat.MessageToolActions,{children:a=>a.map((t,s)=>e.jsx(d.EmbeddedChat.MessageToolAction,{action:t},`action-${s}`))}),e.jsx(d.EmbeddedChat.MessageAction,{action:"copy"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"upvote"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"downvote"})]})}function F(){return e.jsxs(d.EmbeddedChat.MessageSources,{children:[e.jsx(d.EmbeddedChat.MessageSourcesHeader,{}),e.jsx(d.EmbeddedChat.MessageSourcesList,{children:a=>a.map((t,s)=>e.jsxs(d.EmbeddedChat.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(n=>e.jsxs(c.Fragment,{children:[n,e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedChat.MessageSourceItemIcon,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTitle,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTag,{}),e.jsx(d.EmbeddedChat.MessageSourceItemDescription,{children:n=>n.map((h,m)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:h},`part-${m}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function g(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(A,{}),e.jsx(p,{})]})}function A(){return e.jsxs(d.EmbeddedChat.InputFieldset,{children:[e.jsxs(d.EmbeddedChat.InputGroup,{children:[e.jsx(d.EmbeddedChat.Input,{}),e.jsx(d.EmbeddedChat.SendButton,{children:e.jsx(d.EmbeddedChat.SendButtonIcon,{})})]}),e.jsxs(d.EmbeddedChat.AttachmentsBar,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentTitle,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(d.EmbeddedChat.AttachmentsBarActions,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarInfoTip,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipText,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarInputs,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarInput,{input:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarInputIcon,{}),t.displayName]},t.id))})]}),e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModal,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModalOverlay,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarModalContent,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarModalHeader,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarModalHeading,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalDescription,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalHelp,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarModalClose,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalBody,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarForm,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarFormTitle,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleError,{})]}),e.jsxs(d.EmbeddedChat.AttachmentsBarFormContent,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormContentLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentError,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function p(){return e.jsxs(d.EmbeddedChat.ActionBar,{children:[e.jsxs(d.EmbeddedChat.TaglineContainer,{children:[e.jsx(d.EmbeddedChat.TaglineText,{}),e.jsx(d.EmbeddedChat.TaglineLogo,{}),e.jsx(d.EmbeddedChat.TaglineBrandName,{})]}),e.jsxs(d.EmbeddedChat.Actions,{children:[e.jsx(d.EmbeddedChat.HelpActions,{children:({pinned:a,unpinned:t})=>e.jsxs(e.Fragment,{children:[a.map(s=>e.jsx(d.EmbeddedChat.HelpAction,{action:s},s.name)),t.length>0&&e.jsx(d.EmbeddedChat.HelpActionsTrigger,{}),e.jsxs(d.EmbeddedChat.HelpActionsMenu,{children:[e.jsx(d.EmbeddedChat.HelpActionsMenuArrow,{}),t.map(s=>e.jsxs(d.EmbeddedChat.HelpActionsMenuItem,{action:s,children:[e.jsx(d.EmbeddedChat.HelpActionsMenuItemIcon,{action:s}),s.name]},s.name))]})]})}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"copy",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"copy"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"copy"})]}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"share",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"share"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"share"})]}),e.jsx(d.EmbeddedChat.ChatAction,{action:"clear"}),e.jsx(d.EmbeddedChat.ChatAction,{action:"stop"})]})]})}function M(){return e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.FeedbackModal,{children:e.jsx(d.EmbeddedChat.FeedbackModalOverlay,{children:e.jsxs(d.EmbeddedChat.FeedbackModalContent,{children:[e.jsx(d.EmbeddedChat.FeedbackModalHeader,{}),e.jsx(d.EmbeddedChat.FeedbackModalClose,{}),e.jsx(d.EmbeddedChat.FeedbackModalBody,{children:e.jsxs(d.EmbeddedChat.FeedbackForm,{children:[e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"unrelated_response",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{})]}),e.jsx(d.EmbeddedChat.FeedbackSubmitButton,{})]})})]})})})})}function I(){return e.jsxs(d.EmbeddedChat.FormWrapper,{children:[e.jsx(d.EmbeddedChat.FormClose,{}),e.jsxs(d.EmbeddedChat.Form,{children:[e.jsxs(d.EmbeddedChat.FormHeader,{children:[e.jsx(d.EmbeddedChat.FormHeading,{}),e.jsx(d.EmbeddedChat.FormDescription,{})]}),e.jsx(d.EmbeddedChat.FormContent,{children:a=>e.jsxs(e.Fragment,{children:[a.map((t,s)=>e.jsxs(d.EmbeddedChat.FormField,{field:t,autoFocus:s===0,children:[e.jsx(d.EmbeddedChat.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(d.EmbeddedChat.FormFieldText,{}),t.inputType==="email"&&e.jsx(d.EmbeddedChat.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(d.EmbeddedChat.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(d.EmbeddedChat.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(d.EmbeddedChat.FormFieldCheckbox,{children:e.jsx(d.EmbeddedChat.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(d.EmbeddedChat.FormFieldSelect,{children:[e.jsxs(d.EmbeddedChat.FormFieldSelectTrigger,{children:[e.jsx(d.EmbeddedChat.FormFieldSelectValue,{}),e.jsx(d.EmbeddedChat.FormFieldSelectIcon,{})]}),e.jsx(d.EmbeddedChat.FormFieldSelectContent,{children:e.jsx(d.EmbeddedChat.FormFieldSelectViewport,{children:t.items.map(n=>e.jsxs(d.EmbeddedChat.FormFieldSelectItem,{value:n.value,children:[e.jsx(d.EmbeddedChat.FormFieldSelectItemText,{children:n.label}),e.jsx(d.EmbeddedChat.FormFieldSelectItemIndicator,{})]},n.value))})})]}),e.jsx(d.EmbeddedChat.FormFieldError,{})]},t.name)),e.jsx(d.EmbeddedChat.FormError,{})]})}),e.jsxs(d.EmbeddedChat.FormFooter,{children:[e.jsx(d.EmbeddedChat.FormCancel,{}),e.jsx(d.EmbeddedChat.FormSubmit,{})]})]}),e.jsxs(d.EmbeddedChat.FormSuccess,{children:[e.jsx(d.EmbeddedChat.FormSuccessHeading,{}),e.jsx(d.EmbeddedChat.FormSuccessMessage,{}),e.jsx(d.EmbeddedChat.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=o;exports.InkeepEmbeddedChatImpl=r;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),h=require("react"),b=require("./widget-toggle.cjs");function C(a){const{baseSettings:t,aiChatSettings:s}=a;return e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:{baseSettings:t,aiChatSettings:s},componentType:d.WebWidgetInteractionType.EmbeddedChat,children:e.jsx(c,{...a})})})}function m(a){const{children:t,onToggleView:s,isHidden:n,shouldAutoFocusInput:r=!s}=a;return e.jsx(d.EmbeddedChat.Provider,{isHidden:n,shouldAutoFocusInput:r,children:t})}function c(a){return e.jsx(m,{...a,children:e.jsx(i,{...a})})}function i(a){const{onToggleView:t}=a,s=d.useModal(),n=d.useWidget(),r=s&&!n?d.Modal.Content:h.Fragment;return e.jsx(r,{children:e.jsxs(d.EmbeddedChat.Wrapper,{variant:t?"no-shadow":"container-with-shadow","data-composite":d.dataAttr(!!a.onToggleView||s?.isOpen),children:[e.jsx(d.EmbeddedChat.ConversationLoading,{}),e.jsxs(d.EmbeddedChat.Root,{children:[e.jsx(l,{...a}),e.jsx(x,{}),e.jsx(p,{})]}),e.jsx(k,{}),e.jsx(T,{})]})})}function l(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,r=!!t;return e.jsxs(d.EmbeddedChat.Header,{"data-show-toolbar":d.dataAttr(r),children:[r&&e.jsxs(d.EmbeddedChat.HeaderToolbar,{children:[e.jsxs(d.EmbeddedChat.HeaderToolbarWrapper,{children:[e.jsx(d.EmbeddedChat.ToolbarHeader,{}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{side:"bottom",align:"start",children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]})]}),e.jsx(b.WidgetToggle,{onToggleView:t,askAILabel:s,searchLabel:n,view:"chat"})]}),e.jsx(d.Modal.Close,{})]})}function x(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(j,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function j(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(E,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(u,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(F,{}),e.jsx(g,{}),e.jsx(A,{})]})]},t.id))]})})}function E(){return e.jsxs(d.EmbeddedChat.IntroMessageWrapper,{children:[e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsxs(d.EmbeddedChat.Disclaimer,{children:[e.jsx(d.EmbeddedChat.DisclaimerLabel,{}),e.jsx(d.EmbeddedChat.DisclaimerTrigger,{}),e.jsxs(d.EmbeddedChat.DisclaimerContent,{children:[e.jsx(d.EmbeddedChat.DisclaimerText,{}),e.jsx(d.EmbeddedChat.DisclaimerArrow,{})]})]}),e.jsxs(d.EmbeddedChat.QuickQuestions,{children:[e.jsx(d.EmbeddedChat.QuickQuestionsLabel,{}),e.jsx(d.EmbeddedChat.QuickQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.QuickQuestion,{children:e.jsx(d.EmbeddedChat.QuickQuestionButton,{question:t})},t))})]})]})]})}function u(){return e.jsxs(d.EmbeddedChat.MessageHeader,{children:[e.jsx(d.EmbeddedChat.MessageAvatar,{children:e.jsxs(d.EmbeddedChat.MessageAvatarContent,{children:[e.jsx(d.EmbeddedChat.MessageAvatarFallback,{}),e.jsx(d.EmbeddedChat.MessageAvatarImage,{})]})}),e.jsx(d.EmbeddedChat.MessageName,{})]})}function F(){return e.jsxs(d.EmbeddedChat.MessageAttachments,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.MessageAttachmentsItem,{attachment:t,children:[e.jsx(d.EmbeddedChat.MessageAttachmentsItemIcon,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsItemTitle,{})]},t.id))}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreview,{children:e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewOverlay,{children:e.jsxs(d.EmbeddedChat.MessageAttachmentsPreviewContent,{children:[e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewHeader,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewClose,{}),e.jsx(d.EmbeddedChat.MessageAttachmentsPreviewBody,{})]})})})})]})}function g(){return e.jsxs(d.EmbeddedChat.MessageActions,{children:[e.jsx(d.EmbeddedChat.MessageToolActions,{children:a=>a.map((t,s)=>e.jsx(d.EmbeddedChat.MessageToolAction,{action:t},`action-${s}`))}),e.jsx(d.EmbeddedChat.MessageAction,{action:"copy"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"upvote"}),e.jsx(d.EmbeddedChat.MessageAction,{action:"downvote"})]})}function A(){return e.jsxs(d.EmbeddedChat.MessageSources,{children:[e.jsx(d.EmbeddedChat.MessageSourcesHeader,{}),e.jsx(d.EmbeddedChat.MessageSourcesList,{children:a=>a.map((t,s)=>e.jsxs(d.EmbeddedChat.MessageSourceItem,{href:t.url,source:t,children:[e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbs,{children:t.breadcrumbs?.map(n=>e.jsxs(h.Fragment,{children:[n,e.jsx(d.EmbeddedChat.MessageSourceItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedChat.MessageSourceItemIcon,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTitle,{}),e.jsx(d.EmbeddedChat.MessageSourceItemTag,{}),e.jsx(d.EmbeddedChat.MessageSourceItemDescription,{children:n=>n.map((r,o)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${o}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function p(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(I,{}),e.jsx(M,{})]})}function I(){return e.jsxs(d.EmbeddedChat.InputFieldset,{children:[e.jsxs(d.EmbeddedChat.InputGroup,{children:[e.jsx(d.EmbeddedChat.Input,{}),e.jsx(d.EmbeddedChat.SendButton,{children:e.jsx(d.EmbeddedChat.SendButtonIcon,{})})]}),e.jsxs(d.EmbeddedChat.AttachmentsBar,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarList,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarAttachment,{attachment:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentTitle,{}),e.jsx(d.EmbeddedChat.AttachmentsBarAttachmentDelete,{})]},t.id))}),e.jsxs(d.EmbeddedChat.AttachmentsBarActions,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarInfoTip,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipIcon,{}),e.jsx(d.EmbeddedChat.AttachmentsBarInfoTipText,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarInputs,{children:a=>a.map(t=>e.jsxs(d.EmbeddedChat.AttachmentsBarInput,{input:t,children:[e.jsx(d.EmbeddedChat.AttachmentsBarInputIcon,{}),t.displayName]},t.id))})]}),e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModal,{children:e.jsx(d.EmbeddedChat.AttachmentsBarModalOverlay,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarModalContent,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarModalHeader,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarModalHeading,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalDescription,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalHelp,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarModalClose,{}),e.jsx(d.EmbeddedChat.AttachmentsBarModalBody,{children:e.jsxs(d.EmbeddedChat.AttachmentsBarForm,{children:[e.jsxs(d.EmbeddedChat.AttachmentsBarFormTitle,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormTitleError,{})]}),e.jsxs(d.EmbeddedChat.AttachmentsBarFormContent,{children:[e.jsx(d.EmbeddedChat.AttachmentsBarFormContentLabel,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentInput,{}),e.jsx(d.EmbeddedChat.AttachmentsBarFormContentError,{})]}),e.jsx(d.EmbeddedChat.AttachmentsBarFormSubmitButton,{})]})})]})})})})]})]})}function M(){return e.jsxs(d.EmbeddedChat.ActionBar,{children:[e.jsxs(d.EmbeddedChat.TaglineContainer,{children:[e.jsx(d.EmbeddedChat.TaglineText,{}),e.jsx(d.EmbeddedChat.TaglineLogo,{}),e.jsx(d.EmbeddedChat.TaglineBrandName,{})]}),e.jsxs(d.EmbeddedChat.Actions,{children:[e.jsx(d.EmbeddedChat.HelpActions,{children:({pinned:a,unpinned:t})=>e.jsxs(e.Fragment,{children:[a.map(s=>e.jsx(d.EmbeddedChat.HelpAction,{action:s},s.name)),t.length>0&&e.jsx(d.EmbeddedChat.HelpActionsTrigger,{}),e.jsxs(d.EmbeddedChat.HelpActionsMenu,{children:[e.jsx(d.EmbeddedChat.HelpActionsMenuArrow,{}),t.map(s=>e.jsxs(d.EmbeddedChat.HelpActionsMenuItem,{action:s,children:[e.jsx(d.EmbeddedChat.HelpActionsMenuItemIcon,{action:s}),s.name]},s.name))]})]})}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"copy",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"copy"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"copy"})]}),e.jsxs(d.EmbeddedChat.ChatAction,{action:"share",children:[e.jsx(d.EmbeddedChat.ChatActionLabel,{action:"share"}),e.jsx(d.EmbeddedChat.ChatActionFeedback,{action:"share"})]}),e.jsx(d.EmbeddedChat.ChatAction,{action:"clear"}),e.jsx(d.EmbeddedChat.ChatAction,{action:"stop"})]})]})}function k(){return e.jsx(d.PortalWithTheme,{children:e.jsx(d.EmbeddedChat.FeedbackModal,{children:e.jsx(d.EmbeddedChat.FeedbackModalOverlay,{children:e.jsxs(d.EmbeddedChat.FeedbackModalContent,{children:[e.jsx(d.EmbeddedChat.FeedbackModalHeader,{}),e.jsx(d.EmbeddedChat.FeedbackModalClose,{}),e.jsx(d.EmbeddedChat.FeedbackModalBody,{children:e.jsxs(d.EmbeddedChat.FeedbackForm,{children:[e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"unrelated_response",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_statement",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"inaccurate_code_snippet",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{}),e.jsx(d.EmbeddedChat.FeedbackItemDescription,{})]}),e.jsxs(d.EmbeddedChat.FeedbackItem,{name:"irrelevant_citations",children:[e.jsx(d.EmbeddedChat.FeedbackItemCheckbox,{children:e.jsx(d.EmbeddedChat.FeedbackItemCheckboxIndicator,{})}),e.jsx(d.EmbeddedChat.FeedbackItemLabel,{})]}),e.jsx(d.EmbeddedChat.FeedbackSubmitButton,{})]})})]})})})})}function T(){return e.jsxs(d.EmbeddedChat.FormWrapper,{children:[e.jsx(d.EmbeddedChat.FormClose,{}),e.jsxs(d.EmbeddedChat.Form,{children:[e.jsxs(d.EmbeddedChat.FormHeader,{children:[e.jsx(d.EmbeddedChat.FormHeading,{}),e.jsx(d.EmbeddedChat.FormDescription,{})]}),e.jsx(d.EmbeddedChat.FormContent,{children:a=>e.jsxs(e.Fragment,{children:[a.map((t,s)=>e.jsxs(d.EmbeddedChat.FormField,{field:t,autoFocus:s===0,children:[e.jsx(d.EmbeddedChat.FormFieldLabel,{}),t.inputType==="text"&&e.jsx(d.EmbeddedChat.FormFieldText,{}),t.inputType==="email"&&e.jsx(d.EmbeddedChat.FormFieldEmail,{}),t.inputType==="file"&&e.jsx(d.EmbeddedChat.FormFieldFile,{}),t.inputType==="textarea"&&e.jsx(d.EmbeddedChat.FormFieldTextArea,{}),t.inputType==="checkbox"&&e.jsx(d.EmbeddedChat.FormFieldCheckbox,{children:e.jsx(d.EmbeddedChat.FormFieldCheckboxIndicator,{})}),t.inputType==="select"&&e.jsxs(d.EmbeddedChat.FormFieldSelect,{children:[e.jsxs(d.EmbeddedChat.FormFieldSelectTrigger,{children:[e.jsx(d.EmbeddedChat.FormFieldSelectValue,{}),e.jsx(d.EmbeddedChat.FormFieldSelectIcon,{})]}),e.jsx(d.EmbeddedChat.FormFieldSelectContent,{children:e.jsx(d.EmbeddedChat.FormFieldSelectViewport,{children:t.items.map(n=>e.jsxs(d.EmbeddedChat.FormFieldSelectItem,{value:n.value,children:[e.jsx(d.EmbeddedChat.FormFieldSelectItemText,{children:n.label}),e.jsx(d.EmbeddedChat.FormFieldSelectItemIndicator,{})]},n.value))})})]}),e.jsx(d.EmbeddedChat.FormFieldError,{})]},t.name)),e.jsx(d.EmbeddedChat.FormError,{})]})}),e.jsxs(d.EmbeddedChat.FormFooter,{children:[e.jsx(d.EmbeddedChat.FormCancel,{}),e.jsx(d.EmbeddedChat.FormSubmit,{})]})]}),e.jsxs(d.EmbeddedChat.FormSuccess,{children:[e.jsx(d.EmbeddedChat.FormSuccessHeading,{}),e.jsx(d.EmbeddedChat.FormSuccessMessage,{}),e.jsx(d.EmbeddedChat.FormSuccessButton,{})]})]})}exports.InkeepEmbeddedChat=C;exports.InkeepEmbeddedChatImpl=c;exports.InkeepEmbeddedChatImplContent=i;exports.InkeepEmbeddedChatProvider=m;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
2
3
|
import { EmbeddedChatProviderProps } from '@inkeep/cxkit-styled';
|
|
3
4
|
type ChatConfig = Pick<InkeepConfig, 'baseSettings' | 'aiChatSettings'>;
|
|
4
5
|
type InkeepEmbeddedChatImplProps = EmbeddedChatProviderProps & WidgetView;
|
|
5
6
|
export type InkeepEmbeddedChatProps = InkeepEmbeddedChatImplProps & Partial<ChatConfig>;
|
|
6
7
|
export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function InkeepEmbeddedChatProvider(props: PropsWithChildren<InkeepEmbeddedChatImplProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export declare function InkeepEmbeddedChatImpl(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function InkeepEmbeddedChatImplContent(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
2
3
|
import { EmbeddedChatProviderProps } from '@inkeep/cxkit-styled';
|
|
3
4
|
type ChatConfig = Pick<InkeepConfig, 'baseSettings' | 'aiChatSettings'>;
|
|
4
5
|
type InkeepEmbeddedChatImplProps = EmbeddedChatProviderProps & WidgetView;
|
|
5
6
|
export type InkeepEmbeddedChatProps = InkeepEmbeddedChatImplProps & Partial<ChatConfig>;
|
|
6
7
|
export declare function InkeepEmbeddedChat(props: InkeepEmbeddedChatProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function InkeepEmbeddedChatProvider(props: PropsWithChildren<InkeepEmbeddedChatImplProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export declare function InkeepEmbeddedChatImpl(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function InkeepEmbeddedChatImplContent(props: InkeepEmbeddedChatImplProps): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -1,54 +1,61 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as n, Fragment as s } from "react/jsx-runtime";
|
|
3
|
-
import { Shadow as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { WidgetToggle as
|
|
6
|
-
function
|
|
3
|
+
import { Shadow as u, RootProvider as g, WebWidgetInteractionType as A, EmbeddedChat as e, useModal as p, useWidget as b, Modal as d, dataAttr as h, PortalWithTheme as l } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { Fragment as m } from "react";
|
|
5
|
+
import { WidgetToggle as I } from "./widget-toggle.js";
|
|
6
|
+
function N(a) {
|
|
7
7
|
const { baseSettings: r, aiChatSettings: c } = a;
|
|
8
8
|
return /* @__PURE__ */ t(
|
|
9
|
-
|
|
9
|
+
u,
|
|
10
10
|
{
|
|
11
11
|
wrapperStyles: {
|
|
12
12
|
height: "inherit",
|
|
13
13
|
width: "inherit"
|
|
14
14
|
},
|
|
15
15
|
children: /* @__PURE__ */ t(
|
|
16
|
-
|
|
16
|
+
g,
|
|
17
17
|
{
|
|
18
18
|
config: {
|
|
19
19
|
baseSettings: r,
|
|
20
20
|
aiChatSettings: c
|
|
21
21
|
},
|
|
22
|
-
componentType:
|
|
23
|
-
children: /* @__PURE__ */ t(
|
|
22
|
+
componentType: A.EmbeddedChat,
|
|
23
|
+
children: /* @__PURE__ */ t(C, { ...a })
|
|
24
24
|
}
|
|
25
25
|
)
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const {
|
|
31
|
-
return /* @__PURE__ */ t(e.Provider, { isHidden:
|
|
29
|
+
function M(a) {
|
|
30
|
+
const { children: r, onToggleView: c, isHidden: i, shouldAutoFocusInput: o = !c } = a;
|
|
31
|
+
return /* @__PURE__ */ t(e.Provider, { isHidden: i, shouldAutoFocusInput: o, children: r });
|
|
32
|
+
}
|
|
33
|
+
function C(a) {
|
|
34
|
+
return /* @__PURE__ */ t(M, { ...a, children: /* @__PURE__ */ t(k, { ...a }) });
|
|
35
|
+
}
|
|
36
|
+
function k(a) {
|
|
37
|
+
const { onToggleView: r } = a, c = p(), i = b(), o = c && !i ? d.Content : m;
|
|
38
|
+
return /* @__PURE__ */ t(o, { children: /* @__PURE__ */ n(
|
|
32
39
|
e.Wrapper,
|
|
33
40
|
{
|
|
34
41
|
variant: r ? "no-shadow" : "container-with-shadow",
|
|
35
|
-
"data-composite":
|
|
42
|
+
"data-composite": h(!!a.onToggleView || c?.isOpen),
|
|
36
43
|
children: [
|
|
37
44
|
/* @__PURE__ */ t(e.ConversationLoading, {}),
|
|
38
45
|
/* @__PURE__ */ n(e.Root, { children: [
|
|
39
|
-
/* @__PURE__ */ t(
|
|
40
|
-
/* @__PURE__ */ t(
|
|
41
|
-
/* @__PURE__ */ t(
|
|
46
|
+
/* @__PURE__ */ t(T, { ...a }),
|
|
47
|
+
/* @__PURE__ */ t(B, {}),
|
|
48
|
+
/* @__PURE__ */ t(L, {})
|
|
42
49
|
] }),
|
|
43
|
-
/* @__PURE__ */ t(
|
|
44
|
-
/* @__PURE__ */ t(
|
|
50
|
+
/* @__PURE__ */ t(W, {}),
|
|
51
|
+
/* @__PURE__ */ t(E, {})
|
|
45
52
|
]
|
|
46
53
|
}
|
|
47
54
|
) });
|
|
48
55
|
}
|
|
49
|
-
function
|
|
56
|
+
function T(a) {
|
|
50
57
|
const { onToggleView: r, askAILabel: c, searchLabel: i } = a, o = !!r;
|
|
51
|
-
return /* @__PURE__ */ n(e.Header, { "data-show-toolbar":
|
|
58
|
+
return /* @__PURE__ */ n(e.Header, { "data-show-toolbar": h(o), children: [
|
|
52
59
|
o && /* @__PURE__ */ n(e.HeaderToolbar, { children: [
|
|
53
60
|
/* @__PURE__ */ n(e.HeaderToolbarWrapper, { children: [
|
|
54
61
|
/* @__PURE__ */ t(e.ToolbarHeader, {}),
|
|
@@ -61,7 +68,7 @@ function I(a) {
|
|
|
61
68
|
] })
|
|
62
69
|
] }),
|
|
63
70
|
/* @__PURE__ */ t(
|
|
64
|
-
|
|
71
|
+
I,
|
|
65
72
|
{
|
|
66
73
|
onToggleView: r,
|
|
67
74
|
askAILabel: c,
|
|
@@ -70,32 +77,32 @@ function I(a) {
|
|
|
70
77
|
}
|
|
71
78
|
)
|
|
72
79
|
] }),
|
|
73
|
-
/* @__PURE__ */ t(
|
|
80
|
+
/* @__PURE__ */ t(d.Close, {})
|
|
74
81
|
] });
|
|
75
82
|
}
|
|
76
|
-
function
|
|
83
|
+
function B() {
|
|
77
84
|
return /* @__PURE__ */ t(e.Content, { children: /* @__PURE__ */ n(e.ContentScrollArea, { children: [
|
|
78
|
-
/* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: /* @__PURE__ */ t(
|
|
85
|
+
/* @__PURE__ */ t(e.ContentScrollAreaViewport, { children: /* @__PURE__ */ t(S, {}) }),
|
|
79
86
|
/* @__PURE__ */ t(e.ContentScrollAreaScrollbar, { children: /* @__PURE__ */ t(e.ContentScrollAreaThumb, {}) }),
|
|
80
87
|
/* @__PURE__ */ t(e.ContentScrollAreaCorner, {})
|
|
81
88
|
] }) });
|
|
82
89
|
}
|
|
83
|
-
function
|
|
90
|
+
function S() {
|
|
84
91
|
return /* @__PURE__ */ t(e.Messages, { children: ({ messages: a }) => /* @__PURE__ */ n(s, { children: [
|
|
85
|
-
/* @__PURE__ */ t(
|
|
92
|
+
/* @__PURE__ */ t(v, {}),
|
|
86
93
|
a.map((r) => /* @__PURE__ */ n(e.MessageWrapper, { message: r, children: [
|
|
87
|
-
/* @__PURE__ */ t(
|
|
94
|
+
/* @__PURE__ */ t(w, {}),
|
|
88
95
|
/* @__PURE__ */ t(e.MessageLoading, {}),
|
|
89
96
|
/* @__PURE__ */ n(e.MessageContentWrapper, { children: [
|
|
90
97
|
/* @__PURE__ */ t(e.MessageContent, { children: /* @__PURE__ */ t(e.Message, {}) }),
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
-
/* @__PURE__ */ t(
|
|
93
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ t(H, {}),
|
|
99
|
+
/* @__PURE__ */ t(x, {}),
|
|
100
|
+
/* @__PURE__ */ t(y, {})
|
|
94
101
|
] })
|
|
95
102
|
] }, r.id))
|
|
96
103
|
] }) });
|
|
97
104
|
}
|
|
98
|
-
function
|
|
105
|
+
function v() {
|
|
99
106
|
return /* @__PURE__ */ n(e.IntroMessageWrapper, { children: [
|
|
100
107
|
/* @__PURE__ */ n(e.MessageHeader, { children: [
|
|
101
108
|
/* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */ n(e.MessageAvatarContent, { children: [
|
|
@@ -121,7 +128,7 @@ function B() {
|
|
|
121
128
|
] })
|
|
122
129
|
] });
|
|
123
130
|
}
|
|
124
|
-
function
|
|
131
|
+
function w() {
|
|
125
132
|
return /* @__PURE__ */ n(e.MessageHeader, { children: [
|
|
126
133
|
/* @__PURE__ */ t(e.MessageAvatar, { children: /* @__PURE__ */ n(e.MessageAvatarContent, { children: [
|
|
127
134
|
/* @__PURE__ */ t(e.MessageAvatarFallback, {}),
|
|
@@ -130,7 +137,7 @@ function T() {
|
|
|
130
137
|
/* @__PURE__ */ t(e.MessageName, {})
|
|
131
138
|
] });
|
|
132
139
|
}
|
|
133
|
-
function
|
|
140
|
+
function H() {
|
|
134
141
|
return /* @__PURE__ */ n(e.MessageAttachments, { children: [
|
|
135
142
|
/* @__PURE__ */ t(e.MessageAttachmentsList, { children: (a) => a.map((r) => /* @__PURE__ */ n(e.MessageAttachmentsItem, { attachment: r, children: [
|
|
136
143
|
/* @__PURE__ */ t(e.MessageAttachmentsItemIcon, {}),
|
|
@@ -143,7 +150,7 @@ function S() {
|
|
|
143
150
|
] }) }) }) })
|
|
144
151
|
] });
|
|
145
152
|
}
|
|
146
|
-
function
|
|
153
|
+
function x() {
|
|
147
154
|
return /* @__PURE__ */ n(e.MessageActions, { children: [
|
|
148
155
|
/* @__PURE__ */ t(e.MessageToolActions, { children: (a) => a.map((r, c) => /* @__PURE__ */ t(e.MessageToolAction, { action: r }, `action-${c}`)) }),
|
|
149
156
|
/* @__PURE__ */ t(e.MessageAction, { action: "copy" }),
|
|
@@ -151,35 +158,35 @@ function v() {
|
|
|
151
158
|
/* @__PURE__ */ t(e.MessageAction, { action: "downvote" })
|
|
152
159
|
] });
|
|
153
160
|
}
|
|
154
|
-
function
|
|
161
|
+
function y() {
|
|
155
162
|
return /* @__PURE__ */ n(e.MessageSources, { children: [
|
|
156
163
|
/* @__PURE__ */ t(e.MessageSourcesHeader, {}),
|
|
157
164
|
/* @__PURE__ */ t(e.MessageSourcesList, { children: (a) => a.map((r, c) => /* @__PURE__ */ n(e.MessageSourceItem, { href: r.url, source: r, children: [
|
|
158
|
-
/* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: r.breadcrumbs?.map((i) => /* @__PURE__ */ n(
|
|
165
|
+
/* @__PURE__ */ t(e.MessageSourceItemBreadcrumbs, { children: r.breadcrumbs?.map((i) => /* @__PURE__ */ n(m, { children: [
|
|
159
166
|
i,
|
|
160
167
|
/* @__PURE__ */ t(e.MessageSourceItemBreadcrumbIcon, {})
|
|
161
168
|
] }, i)) }),
|
|
162
169
|
/* @__PURE__ */ t(e.MessageSourceItemIcon, {}),
|
|
163
170
|
/* @__PURE__ */ t(e.MessageSourceItemTitle, {}),
|
|
164
171
|
/* @__PURE__ */ t(e.MessageSourceItemTag, {}),
|
|
165
|
-
/* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (i) => i.map((o,
|
|
172
|
+
/* @__PURE__ */ t(e.MessageSourceItemDescription, { children: (i) => i.map((o, F) => /* @__PURE__ */ t(
|
|
166
173
|
e.MessageSourceItemDescriptionPart,
|
|
167
174
|
{
|
|
168
175
|
part: o
|
|
169
176
|
},
|
|
170
|
-
`part-${
|
|
177
|
+
`part-${F}`
|
|
171
178
|
)) }),
|
|
172
179
|
/* @__PURE__ */ t(e.MessageSourceItemIndicator, {})
|
|
173
180
|
] }, c)) })
|
|
174
181
|
] });
|
|
175
182
|
}
|
|
176
|
-
function
|
|
183
|
+
function L() {
|
|
177
184
|
return /* @__PURE__ */ n(e.Footer, { children: [
|
|
178
|
-
/* @__PURE__ */ t(
|
|
179
|
-
/* @__PURE__ */ t(
|
|
185
|
+
/* @__PURE__ */ t(f, {}),
|
|
186
|
+
/* @__PURE__ */ t(D, {})
|
|
180
187
|
] });
|
|
181
188
|
}
|
|
182
|
-
function
|
|
189
|
+
function f() {
|
|
183
190
|
return /* @__PURE__ */ n(e.InputFieldset, { children: [
|
|
184
191
|
/* @__PURE__ */ n(e.InputGroup, { children: [
|
|
185
192
|
/* @__PURE__ */ t(e.Input, {}),
|
|
@@ -225,7 +232,7 @@ function x() {
|
|
|
225
232
|
] })
|
|
226
233
|
] });
|
|
227
234
|
}
|
|
228
|
-
function
|
|
235
|
+
function D() {
|
|
229
236
|
return /* @__PURE__ */ n(e.ActionBar, { children: [
|
|
230
237
|
/* @__PURE__ */ n(e.TaglineContainer, { children: [
|
|
231
238
|
/* @__PURE__ */ t(e.TaglineText, {}),
|
|
@@ -257,7 +264,7 @@ function y() {
|
|
|
257
264
|
] })
|
|
258
265
|
] });
|
|
259
266
|
}
|
|
260
|
-
function
|
|
267
|
+
function W() {
|
|
261
268
|
return /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(e.FeedbackModal, { children: /* @__PURE__ */ t(e.FeedbackModalOverlay, { children: /* @__PURE__ */ n(e.FeedbackModalContent, { children: [
|
|
262
269
|
/* @__PURE__ */ t(e.FeedbackModalHeader, {}),
|
|
263
270
|
/* @__PURE__ */ t(e.FeedbackModalClose, {}),
|
|
@@ -285,7 +292,7 @@ function L() {
|
|
|
285
292
|
] }) })
|
|
286
293
|
] }) }) }) });
|
|
287
294
|
}
|
|
288
|
-
function
|
|
295
|
+
function E() {
|
|
289
296
|
return /* @__PURE__ */ n(e.FormWrapper, { children: [
|
|
290
297
|
/* @__PURE__ */ t(e.FormClose, {}),
|
|
291
298
|
/* @__PURE__ */ n(e.Form, { children: [
|
|
@@ -328,6 +335,8 @@ function D() {
|
|
|
328
335
|
] });
|
|
329
336
|
}
|
|
330
337
|
export {
|
|
331
|
-
|
|
332
|
-
|
|
338
|
+
N as InkeepEmbeddedChat,
|
|
339
|
+
C as InkeepEmbeddedChatImpl,
|
|
340
|
+
k as InkeepEmbeddedChatImplContent,
|
|
341
|
+
M as InkeepEmbeddedChatProvider
|
|
333
342
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("./embedded-chat.cjs"),d=require("@inkeep/cxkit-styled"),p=require("./embedded-search.cjs"),S=require("./embedded-search-and-chat.impl.cjs"),C=require("react");function A(n){const{config:t,...r}=S.useWidgetImpl(n);return e.jsx(d.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(d.RootProvider,{config:t,componentType:d.WebWidgetInteractionType.EmbeddedSearchAndChat,children:e.jsx(m,{...r})})})}function m(n){const{view:t,setView:r,shouldShowAskAICard:I,onToggleView:o,defaultView:c,shouldAutoFocusInput:s,searchLabel:i,askAILabel:a}=n,b=d.useModal()?d.Modal.Content:C.Fragment,h={isHidden:t==="chat",onToggleView:o,shouldShowAskAICard:I,shouldAutoFocusInput:s&&c==="search",searchLabel:i,askAILabel:a},l={isHidden:t==="search",onToggleView:o,shouldAutoFocusInput:s&&c==="chat",searchLabel:i,askAILabel:a};return e.jsx(d.WidgetProvider,{widget:{setView:r},children:e.jsx(p.InkeepEmbeddedSearchProvider,{...h,children:e.jsx(u.InkeepEmbeddedChatProvider,{...l,children:e.jsxs(b,{children:[e.jsx(p.InkeepEmbeddedSearchImplContent,{...h}),e.jsx(u.InkeepEmbeddedChatImplContent,{...l})]})})})})}exports.InkeepEmbeddedSearchAndChat=A;exports.InkeepEmbeddedSearchAndChatImpl=m;
|
|
@@ -1,58 +1,53 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import {
|
|
4
|
-
import { Shadow as
|
|
5
|
-
import {
|
|
6
|
-
import { useWidgetImpl as
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedChatProvider as u, InkeepEmbeddedChatImplContent as I } from "./embedded-chat.js";
|
|
4
|
+
import { Shadow as b, RootProvider as f, WebWidgetInteractionType as C, useModal as g, Modal as w, WidgetProvider as A } from "@inkeep/cxkit-styled";
|
|
5
|
+
import { InkeepEmbeddedSearchProvider as k, InkeepEmbeddedSearchImplContent as S } from "./embedded-search.js";
|
|
6
|
+
import { useWidgetImpl as E } from "./embedded-search-and-chat.impl.js";
|
|
7
|
+
import { Fragment as P } from "react";
|
|
8
|
+
function H(o) {
|
|
9
|
+
const { config: t, ...d } = E(o);
|
|
9
10
|
return /* @__PURE__ */ e(
|
|
10
|
-
|
|
11
|
+
b,
|
|
11
12
|
{
|
|
12
13
|
wrapperStyles: {
|
|
13
14
|
height: "inherit",
|
|
14
15
|
width: "inherit"
|
|
15
16
|
},
|
|
16
|
-
children: /* @__PURE__ */ e(
|
|
17
|
+
children: /* @__PURE__ */ e(f, { config: t, componentType: C.EmbeddedSearchAndChat, children: /* @__PURE__ */ e(v, { ...d }) })
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function v(o) {
|
|
21
22
|
const {
|
|
22
23
|
view: t,
|
|
23
|
-
setView:
|
|
24
|
+
setView: d,
|
|
24
25
|
shouldShowAskAICard: p,
|
|
25
26
|
onToggleView: r,
|
|
26
|
-
defaultView:
|
|
27
|
-
shouldAutoFocusInput:
|
|
27
|
+
defaultView: n,
|
|
28
|
+
shouldAutoFocusInput: i,
|
|
28
29
|
searchLabel: h,
|
|
29
30
|
askAILabel: c
|
|
30
|
-
} =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
shouldAutoFocusInput: n && i === "chat",
|
|
49
|
-
askAILabel: c,
|
|
50
|
-
searchLabel: h
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
] });
|
|
31
|
+
} = o, m = g() ? w.Content : P, a = {
|
|
32
|
+
isHidden: t === "chat",
|
|
33
|
+
onToggleView: r,
|
|
34
|
+
shouldShowAskAICard: p,
|
|
35
|
+
shouldAutoFocusInput: i && n === "search",
|
|
36
|
+
searchLabel: h,
|
|
37
|
+
askAILabel: c
|
|
38
|
+
}, s = {
|
|
39
|
+
isHidden: t === "search",
|
|
40
|
+
onToggleView: r,
|
|
41
|
+
shouldAutoFocusInput: i && n === "chat",
|
|
42
|
+
searchLabel: h,
|
|
43
|
+
askAILabel: c
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ e(A, { widget: { setView: d }, children: /* @__PURE__ */ e(k, { ...a, children: /* @__PURE__ */ e(u, { ...s, children: /* @__PURE__ */ l(m, { children: [
|
|
46
|
+
/* @__PURE__ */ e(S, { ...a }),
|
|
47
|
+
/* @__PURE__ */ e(I, { ...s })
|
|
48
|
+
] }) }) }) });
|
|
54
49
|
}
|
|
55
50
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
H as InkeepEmbeddedSearchAndChat,
|
|
52
|
+
v as InkeepEmbeddedSearchAndChatImpl
|
|
58
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),a=require("react"),l=require("./widget-toggle.cjs");function u(r){const{baseSettings:s,searchSettings:t}=r;return e.jsx(d.Shadow,{children:e.jsx(d.RootProvider,{config:{baseSettings:s,searchSettings:t},componentType:d.WebWidgetInteractionType.EmbeddedSearch,children:e.jsx(i,{...r})})})}function o(r){const{children:s,onToggleView:t,isHidden:n,shouldAutoFocusInput:c=!t}=r;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:n,shouldAutoFocusInput:c,children:s})}function i(r){return e.jsx(o,{...r,children:e.jsx(h,{...r})})}function h(r){const{onToggleView:s}=r,t=d.useModal(),n=d.useWidget(),c=t&&!n?d.Modal.Content:a.Fragment;return e.jsx(c,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-composite":d.dataAttr(!!s||t?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(S,{...r}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(b,{...r}),e.jsx(x,{})]}),e.jsx(E,{})]})})})}function S(r){const{onToggleView:s,askAILabel:t,searchLabel:n}=r,{query:c}=d.useSearch();return e.jsxs(d.EmbeddedSearch.InputGroup,{children:[e.jsx(d.EmbeddedSearch.InputIcon,{}),e.jsx(d.EmbeddedSearch.Input,{}),e.jsx(d.EmbeddedSearch.Loading,{}),s&&e.jsx(l.WidgetToggle,{onToggleView:s,query:c,askAILabel:t,searchLabel:n,view:"search"}),e.jsx(d.Modal.Close,{})]})}function b(r){const{askAILabel:s,onToggleView:t,shouldShowAskAICard:n=!!t}=r,{query:c}=d.useSearch(),{handleToggle:m}=l.useToggleView({onToggleView:t,query:c});return n?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>m("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[s||"Ask AI",c&&` "${c}"`]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function x(){return e.jsxs(d.EmbeddedSearch.Results,{children:[e.jsx(d.EmbeddedSearch.ResultsLoading,{}),e.jsx(d.EmbeddedSearch.ResultsTabList,{children:r=>r.map(s=>e.jsx(d.EmbeddedSearch.ResultsTab,{tab:s},s))}),e.jsx(d.EmbeddedSearch.ResultsEmpty,{}),e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsx(j,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})]})}function j(){return e.jsx(d.EmbeddedSearch.ResultsList,{children:r=>r.map(s=>e.jsxs(d.EmbeddedSearch.ResultsItem,{item:s,children:[e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbs,{children:t=>t.map(n=>e.jsxs(a.Fragment,{children:[n,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},n))}),e.jsx(d.EmbeddedSearch.ResultsItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemTag,{}),e.jsx(d.EmbeddedSearch.ResultsItemDescription,{children:t=>t.map((n,c)=>e.jsx(d.EmbeddedSearch.ResultsItemDescriptionPart,{part:n},`part-${c}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIndicator,{})]},s.id))})}function E(){return e.jsx(d.EmbeddedSearch.Footer,{children:e.jsxs(d.EmbeddedSearch.TaglineContainer,{children:[e.jsx(d.EmbeddedSearch.TaglineText,{}),e.jsx(d.EmbeddedSearch.TaglineLogo,{}),e.jsx(d.EmbeddedSearch.TaglineBrandName,{})]})})}exports.InkeepEmbeddedSearch=u;exports.InkeepEmbeddedSearchImpl=i;exports.InkeepEmbeddedSearchImplContent=h;exports.InkeepEmbeddedSearchProvider=o;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
2
3
|
import { EmbeddedSearchProviderProps } from '@inkeep/cxkit-styled';
|
|
3
4
|
type SearchConfig = Pick<InkeepConfig, 'baseSettings' | 'searchSettings'>;
|
|
4
5
|
type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView & {
|
|
@@ -10,5 +11,7 @@ type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView &
|
|
|
10
11
|
};
|
|
11
12
|
export type InkeepEmbeddedSearchProps = InkeepEmbeddedSearchImplProps & Partial<SearchConfig>;
|
|
12
13
|
export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function InkeepEmbeddedSearchProvider(props: PropsWithChildren<InkeepEmbeddedSearchImplProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export declare function InkeepEmbeddedSearchImpl(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function InkeepEmbeddedSearchImplContent(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WidgetView, InkeepConfig } from '@inkeep/cxkit-types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
2
3
|
import { EmbeddedSearchProviderProps } from '@inkeep/cxkit-styled';
|
|
3
4
|
type SearchConfig = Pick<InkeepConfig, 'baseSettings' | 'searchSettings'>;
|
|
4
5
|
type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView & {
|
|
@@ -10,5 +11,7 @@ type InkeepEmbeddedSearchImplProps = EmbeddedSearchProviderProps & WidgetView &
|
|
|
10
11
|
};
|
|
11
12
|
export type InkeepEmbeddedSearchProps = InkeepEmbeddedSearchImplProps & Partial<SearchConfig>;
|
|
12
13
|
export declare function InkeepEmbeddedSearch(props: InkeepEmbeddedSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function InkeepEmbeddedSearchProvider(props: PropsWithChildren<InkeepEmbeddedSearchImplProps>): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export declare function InkeepEmbeddedSearchImpl(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function InkeepEmbeddedSearchImplContent(props: InkeepEmbeddedSearchImplProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export {};
|
|
@@ -1,99 +1,108 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { Shadow as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { WidgetToggle as
|
|
6
|
-
function
|
|
7
|
-
const { baseSettings:
|
|
8
|
-
return /* @__PURE__ */ e(
|
|
9
|
-
|
|
2
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { Shadow as g, RootProvider as h, WebWidgetInteractionType as m, EmbeddedSearch as t, useModal as I, useWidget as p, Modal as c, dataAttr as R, useSearch as d } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { Fragment as u } from "react";
|
|
5
|
+
import { WidgetToggle as T, useToggleView as A } from "./widget-toggle.js";
|
|
6
|
+
function x(n) {
|
|
7
|
+
const { baseSettings: r, searchSettings: o } = n;
|
|
8
|
+
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(
|
|
9
|
+
h,
|
|
10
10
|
{
|
|
11
11
|
config: {
|
|
12
|
-
baseSettings:
|
|
13
|
-
searchSettings:
|
|
12
|
+
baseSettings: r,
|
|
13
|
+
searchSettings: o
|
|
14
14
|
},
|
|
15
|
-
componentType:
|
|
16
|
-
children: /* @__PURE__ */ e(
|
|
15
|
+
componentType: m.EmbeddedSearch,
|
|
16
|
+
children: /* @__PURE__ */ e(b, { ...n })
|
|
17
17
|
}
|
|
18
18
|
) });
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const { onToggleView:
|
|
22
|
-
return /* @__PURE__ */ e(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
function S(n) {
|
|
21
|
+
const { children: r, onToggleView: o, isHidden: s, shouldAutoFocusInput: l = !o } = n;
|
|
22
|
+
return /* @__PURE__ */ e(t.Provider, { isHidden: s, shouldAutoFocusInput: l, children: r });
|
|
23
|
+
}
|
|
24
|
+
function b(n) {
|
|
25
|
+
return /* @__PURE__ */ e(S, { ...n, children: /* @__PURE__ */ e(f, { ...n }) });
|
|
26
|
+
}
|
|
27
|
+
function f(n) {
|
|
28
|
+
const { onToggleView: r } = n, o = I(), s = p(), l = o && !s ? c.Content : u;
|
|
29
|
+
return /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(t.Wrapper, { "data-composite": R(!!r || o?.isOpen), children: /* @__PURE__ */ i(t.Root, { children: [
|
|
30
|
+
/* @__PURE__ */ e(k, { ...n }),
|
|
31
|
+
/* @__PURE__ */ i(t.Content, { children: [
|
|
32
|
+
/* @__PURE__ */ e(w, { ...n }),
|
|
33
|
+
/* @__PURE__ */ e(L, {})
|
|
27
34
|
] }),
|
|
28
|
-
/* @__PURE__ */ e(
|
|
35
|
+
/* @__PURE__ */ e(E, {})
|
|
29
36
|
] }) }) });
|
|
30
37
|
}
|
|
31
|
-
function
|
|
32
|
-
const { onToggleView:
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
/* @__PURE__ */ e(
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
function k(n) {
|
|
39
|
+
const { onToggleView: r, askAILabel: o, searchLabel: s } = n, { query: l } = d();
|
|
40
|
+
return /* @__PURE__ */ i(t.InputGroup, { children: [
|
|
41
|
+
/* @__PURE__ */ e(t.InputIcon, {}),
|
|
42
|
+
/* @__PURE__ */ e(t.Input, {}),
|
|
43
|
+
/* @__PURE__ */ e(t.Loading, {}),
|
|
44
|
+
r && /* @__PURE__ */ e(
|
|
45
|
+
T,
|
|
39
46
|
{
|
|
40
|
-
onToggleView:
|
|
41
|
-
query:
|
|
42
|
-
askAILabel:
|
|
43
|
-
searchLabel:
|
|
47
|
+
onToggleView: r,
|
|
48
|
+
query: l,
|
|
49
|
+
askAILabel: o,
|
|
50
|
+
searchLabel: s,
|
|
44
51
|
view: "search"
|
|
45
52
|
}
|
|
46
53
|
),
|
|
47
|
-
/* @__PURE__ */ e(
|
|
54
|
+
/* @__PURE__ */ e(c.Close, {})
|
|
48
55
|
] });
|
|
49
56
|
}
|
|
50
|
-
function
|
|
51
|
-
const { askAILabel:
|
|
52
|
-
onToggleView:
|
|
53
|
-
query:
|
|
57
|
+
function w(n) {
|
|
58
|
+
const { askAILabel: r, onToggleView: o, shouldShowAskAICard: s = !!o } = n, { query: l } = d(), { handleToggle: a } = A({
|
|
59
|
+
onToggleView: o,
|
|
60
|
+
query: l
|
|
54
61
|
});
|
|
55
|
-
return
|
|
56
|
-
/* @__PURE__ */ e(
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
return s ? /* @__PURE__ */ i(t.AskAITrigger, { onSelect: () => a("chat", !0), children: [
|
|
63
|
+
/* @__PURE__ */ e(t.AskAITriggerIcon, {}),
|
|
64
|
+
/* @__PURE__ */ i(t.AskAITriggerLabel, { children: [
|
|
65
|
+
r || "Ask AI",
|
|
66
|
+
l && ` "${l}"`
|
|
60
67
|
] }),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
68
|
+
/* @__PURE__ */ e(t.AskAITriggerIndicator, {})
|
|
62
69
|
] }) : null;
|
|
63
70
|
}
|
|
64
|
-
function
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
/* @__PURE__ */ e(
|
|
68
|
-
/* @__PURE__ */ e(
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
/* @__PURE__ */ e(
|
|
71
|
-
/* @__PURE__ */ e(
|
|
72
|
-
/* @__PURE__ */ e(
|
|
71
|
+
function L() {
|
|
72
|
+
return /* @__PURE__ */ i(t.Results, { children: [
|
|
73
|
+
/* @__PURE__ */ e(t.ResultsLoading, {}),
|
|
74
|
+
/* @__PURE__ */ e(t.ResultsTabList, { children: (n) => n.map((r) => /* @__PURE__ */ e(t.ResultsTab, { tab: r }, r)) }),
|
|
75
|
+
/* @__PURE__ */ e(t.ResultsEmpty, {}),
|
|
76
|
+
/* @__PURE__ */ i(t.ResultsScrollArea, { children: [
|
|
77
|
+
/* @__PURE__ */ e(t.ResultsScrollAreaViewport, { children: /* @__PURE__ */ e(C, {}) }),
|
|
78
|
+
/* @__PURE__ */ e(t.ResultsScrollAreaScrollbar, { children: /* @__PURE__ */ e(t.ResultsScrollAreaThumb, {}) }),
|
|
79
|
+
/* @__PURE__ */ e(t.ResultsScrollAreaCorner, {})
|
|
73
80
|
] })
|
|
74
81
|
] });
|
|
75
82
|
}
|
|
76
|
-
function
|
|
77
|
-
return /* @__PURE__ */ e(
|
|
78
|
-
/* @__PURE__ */ e(
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */ e(
|
|
81
|
-
] },
|
|
82
|
-
/* @__PURE__ */ e(
|
|
83
|
-
/* @__PURE__ */ e(
|
|
84
|
-
/* @__PURE__ */ e(
|
|
85
|
-
/* @__PURE__ */ e(
|
|
86
|
-
/* @__PURE__ */ e(
|
|
87
|
-
] },
|
|
83
|
+
function C() {
|
|
84
|
+
return /* @__PURE__ */ e(t.ResultsList, { children: (n) => n.map((r) => /* @__PURE__ */ i(t.ResultsItem, { item: r, children: [
|
|
85
|
+
/* @__PURE__ */ e(t.ResultsItemBreadcrumbs, { children: (o) => o.map((s) => /* @__PURE__ */ i(u, { children: [
|
|
86
|
+
s,
|
|
87
|
+
/* @__PURE__ */ e(t.ResultsItemBreadcrumbIcon, {})
|
|
88
|
+
] }, s)) }),
|
|
89
|
+
/* @__PURE__ */ e(t.ResultsItemIcon, {}),
|
|
90
|
+
/* @__PURE__ */ e(t.ResultsItemTitle, {}),
|
|
91
|
+
/* @__PURE__ */ e(t.ResultsItemTag, {}),
|
|
92
|
+
/* @__PURE__ */ e(t.ResultsItemDescription, { children: (o) => o.map((s, l) => /* @__PURE__ */ e(t.ResultsItemDescriptionPart, { part: s }, `part-${l}`)) }),
|
|
93
|
+
/* @__PURE__ */ e(t.ResultsItemIndicator, {})
|
|
94
|
+
] }, r.id)) });
|
|
88
95
|
}
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */ e(
|
|
91
|
-
/* @__PURE__ */ e(
|
|
92
|
-
/* @__PURE__ */ e(
|
|
93
|
-
/* @__PURE__ */ e(
|
|
96
|
+
function E() {
|
|
97
|
+
return /* @__PURE__ */ e(t.Footer, { children: /* @__PURE__ */ i(t.TaglineContainer, { children: [
|
|
98
|
+
/* @__PURE__ */ e(t.TaglineText, {}),
|
|
99
|
+
/* @__PURE__ */ e(t.TaglineLogo, {}),
|
|
100
|
+
/* @__PURE__ */ e(t.TaglineBrandName, {})
|
|
94
101
|
] }) });
|
|
95
102
|
}
|
|
96
103
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
x as InkeepEmbeddedSearch,
|
|
105
|
+
b as InkeepEmbeddedSearchImpl,
|
|
106
|
+
f as InkeepEmbeddedSearchImplContent,
|
|
107
|
+
S as InkeepEmbeddedSearchProvider
|
|
99
108
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./embedded-chat.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./embedded-chat.cjs"),n=require("./embedded-search-and-chat.cjs"),d=require("./embedded-search.cjs"),I=require("./modal.chat.cjs"),p=require("./modal.search-and-chat.cjs"),h=require("./modal.search.cjs"),m=require("./modal.cjs"),a=require("./chat-button.cjs"),t=require("./searchbar.cjs"),r=require("./intelligent-form.cjs");exports.InkeepEmbeddedChat=e.InkeepEmbeddedChat;exports.InkeepEmbeddedChatImpl=e.InkeepEmbeddedChatImpl;exports.InkeepEmbeddedChatImplContent=e.InkeepEmbeddedChatImplContent;exports.InkeepEmbeddedChatProvider=e.InkeepEmbeddedChatProvider;exports.InkeepEmbeddedSearchAndChat=n.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearchAndChatImpl=n.InkeepEmbeddedSearchAndChatImpl;exports.InkeepEmbeddedSearch=d.InkeepEmbeddedSearch;exports.InkeepEmbeddedSearchImpl=d.InkeepEmbeddedSearchImpl;exports.InkeepEmbeddedSearchImplContent=d.InkeepEmbeddedSearchImplContent;exports.InkeepEmbeddedSearchProvider=d.InkeepEmbeddedSearchProvider;exports.InkeepModalChat=I.InkeepModalChat;exports.InkeepModalSearchAndChat=p.InkeepModalSearchAndChat;exports.InkeepModalSearch=h.InkeepModalSearch;exports.InkeepModal=m.InkeepModal;exports.ChatButtonImpl=a.ChatButtonImpl;exports.InkeepChatButton=a.InkeepChatButton;exports.InkeepSearchBar=t.InkeepSearchBar;exports.SearchBarImpl=t.SearchBarImpl;exports.InkeepIntelligentForm=r.InkeepIntelligentForm;exports.InkeepIntelligentFormImpl=r.InkeepIntelligentFormImpl;
|
package/dist/components/index.js
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { InkeepEmbeddedChat as
|
|
2
|
-
import { InkeepEmbeddedSearchAndChat as
|
|
3
|
-
import { InkeepEmbeddedSearch as
|
|
4
|
-
import { InkeepModalChat as
|
|
5
|
-
import { InkeepModalSearchAndChat as
|
|
6
|
-
import { InkeepModalSearch as
|
|
7
|
-
import { InkeepModal as
|
|
8
|
-
import { ChatButtonImpl as
|
|
9
|
-
import { InkeepSearchBar as
|
|
10
|
-
import { InkeepIntelligentForm as
|
|
1
|
+
import { InkeepEmbeddedChat as r, InkeepEmbeddedChatImpl as p, InkeepEmbeddedChatImplContent as o, InkeepEmbeddedChatProvider as t } from "./embedded-chat.js";
|
|
2
|
+
import { InkeepEmbeddedSearchAndChat as m, InkeepEmbeddedSearchAndChatImpl as I } from "./embedded-search-and-chat.js";
|
|
3
|
+
import { InkeepEmbeddedSearch as h, InkeepEmbeddedSearchImpl as k, InkeepEmbeddedSearchImplContent as l, InkeepEmbeddedSearchProvider as C } from "./embedded-search.js";
|
|
4
|
+
import { InkeepModalChat as c } from "./modal.chat.js";
|
|
5
|
+
import { InkeepModalSearchAndChat as x } from "./modal.search-and-chat.js";
|
|
6
|
+
import { InkeepModalSearch as S } from "./modal.search.js";
|
|
7
|
+
import { InkeepModal as B } from "./modal.js";
|
|
8
|
+
import { ChatButtonImpl as A, InkeepChatButton as g } from "./chat-button.js";
|
|
9
|
+
import { InkeepSearchBar as v, SearchBarImpl as F } from "./searchbar.js";
|
|
10
|
+
import { InkeepIntelligentForm as j, InkeepIntelligentFormImpl as q } from "./intelligent-form.js";
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
A as ChatButtonImpl,
|
|
13
|
+
g as InkeepChatButton,
|
|
14
|
+
r as InkeepEmbeddedChat,
|
|
15
|
+
p as InkeepEmbeddedChatImpl,
|
|
16
|
+
o as InkeepEmbeddedChatImplContent,
|
|
17
|
+
t as InkeepEmbeddedChatProvider,
|
|
18
|
+
h as InkeepEmbeddedSearch,
|
|
19
|
+
m as InkeepEmbeddedSearchAndChat,
|
|
20
|
+
I as InkeepEmbeddedSearchAndChatImpl,
|
|
21
|
+
k as InkeepEmbeddedSearchImpl,
|
|
22
|
+
l as InkeepEmbeddedSearchImplContent,
|
|
23
|
+
C as InkeepEmbeddedSearchProvider,
|
|
24
|
+
j as InkeepIntelligentForm,
|
|
25
|
+
q as InkeepIntelligentFormImpl,
|
|
26
|
+
B as InkeepModal,
|
|
27
|
+
c as InkeepModalChat,
|
|
28
|
+
S as InkeepModalSearch,
|
|
29
|
+
x as InkeepModalSearchAndChat,
|
|
30
|
+
v as InkeepSearchBar,
|
|
31
|
+
F as SearchBarImpl
|
|
28
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@inkeep/cxkit-styled");function c(n){const{componentType:t,children:r,modalSettings:i,...l}=n;return e.jsx(o.Portal,{children:e.jsx(o.Shadow,{children:e.jsx(o.RootProvider,{config:{...l},componentType:t,children:e.jsx(o.Modal.Root,{config:i,children:e.jsx(o.Modal.Overlay,{children:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("@inkeep/cxkit-styled");function c(n){const{componentType:t,children:r,modalSettings:i,...l}=n;return e.jsx(o.Portal,{children:e.jsx(o.Shadow,{children:e.jsx(o.RootProvider,{config:{...l},componentType:t,children:e.jsx(o.Modal.Root,{config:i,children:e.jsx(o.Modal.Overlay,{children:r})})})})})}exports.InkeepModal=c;
|
package/dist/components/modal.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { Portal as l, Shadow as d, RootProvider as
|
|
4
|
-
function p(
|
|
5
|
-
const { componentType:
|
|
3
|
+
import { Portal as l, Shadow as d, RootProvider as a, Modal as e } from "@inkeep/cxkit-styled";
|
|
4
|
+
function p(r) {
|
|
5
|
+
const { componentType: n, children: t, modalSettings: i, ...c } = r;
|
|
6
6
|
return /* @__PURE__ */ o(l, { children: /* @__PURE__ */ o(d, { children: /* @__PURE__ */ o(
|
|
7
|
-
|
|
7
|
+
a,
|
|
8
8
|
{
|
|
9
9
|
config: {
|
|
10
10
|
...c
|
|
11
11
|
},
|
|
12
|
-
componentType:
|
|
13
|
-
children: /* @__PURE__ */ o(e.Root, { config: i, children: /* @__PURE__ */ o(e.Overlay, { children:
|
|
12
|
+
componentType: n,
|
|
13
|
+
children: /* @__PURE__ */ o(e.Root, { config: i, children: /* @__PURE__ */ o(e.Overlay, { children: t }) })
|
|
14
14
|
}
|
|
15
15
|
) }) });
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),B=require("./embedded-search-and-chat.cjs"),m=require("./embedded-search-and-chat.impl.cjs"),x=require("./embedded-search.cjs"),r=require("@inkeep/cxkit-styled"),j=require("./modal.cjs");function g(a){const[
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),B=require("./embedded-search-and-chat.cjs"),m=require("./embedded-search-and-chat.impl.cjs"),x=require("./embedded-search.cjs"),r=require("@inkeep/cxkit-styled"),j=require("./modal.cjs");function g(a){const[n,t]=u.useState(!1),{modalSettings:s,defaultView:c="search",canToggleView:p=!0,...o}=a,{config:h,...i}=m.useWidgetImpl({...o,defaultView:c}),d={shortcutKey:"k",...s,isOpen:n,onOpenChange:S=>{a.forceDefaultView&&!S&&i.setView(c??"search"),t(!!S)}};return e.jsxs(e.Fragment,{children:[e.jsx(r.Shadow,{wrapperStyles:{display:"contents"},children:e.jsx(r.RootProvider,{config:h,componentType:r.WebWidgetInteractionType.SearchBar,children:e.jsx(l,{setOpen:t,modalSettings:d})})}),e.jsx(j.InkeepModal,{...h,modalSettings:d,componentType:r.WebWidgetInteractionType.SearchBar,children:p?e.jsx(B.InkeepEmbeddedSearchAndChatImpl,{...i}):e.jsx(x.InkeepEmbeddedSearchImpl,{...o})})]})}function l(a){const{setOpen:n,modalSettings:t}=a;return e.jsx(r.SearchBar.SearchBarContainer,{children:e.jsxs(r.SearchBar.SearchBarButton,{onClick:s=>{s.button!==2&&n(c=>!c)},children:[e.jsxs(r.SearchBar.SearchBarContentWrapper,{children:[e.jsx(r.SearchBar.SearchBarIcon,{}),e.jsx(r.SearchBar.SearchBarText,{})]}),e.jsxs(r.SearchBar.SearchBarKbdWrapper,{children:[e.jsx(r.SearchBar.SearchBarKbdModifier,{shortcutKey:t?.shortcutKey}),e.jsx(r.SearchBar.SearchBarKbdShortcutKey,{shortcutKey:t?.shortcutKey})]})]})})}exports.InkeepSearchBar=g;exports.SearchBarImpl=l;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as a, Fragment as u, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { useState as f } from "react";
|
|
4
4
|
import { InkeepEmbeddedSearchAndChatImpl as B } from "./embedded-search-and-chat.js";
|
|
5
5
|
import { useWidgetImpl as g } from "./embedded-search-and-chat.impl.js";
|
|
6
6
|
import { InkeepEmbeddedSearchImpl as y } from "./embedded-search.js";
|
|
7
7
|
import { Shadow as I, RootProvider as K, WebWidgetInteractionType as l, SearchBar as r } from "@inkeep/cxkit-styled";
|
|
8
8
|
import { InkeepModal as b } from "./modal.js";
|
|
9
|
-
function
|
|
10
|
-
const [
|
|
11
|
-
modalSettings:
|
|
12
|
-
defaultView:
|
|
9
|
+
function E(n) {
|
|
10
|
+
const [c, t] = f(!1), {
|
|
11
|
+
modalSettings: i,
|
|
12
|
+
defaultView: o = "search",
|
|
13
13
|
canToggleView: S = !0,
|
|
14
14
|
...h
|
|
15
|
-
} = n, { config: p, ...s } = g({ ...h, defaultView:
|
|
15
|
+
} = n, { config: p, ...s } = g({ ...h, defaultView: o }), d = {
|
|
16
16
|
shortcutKey: "k",
|
|
17
|
-
...
|
|
18
|
-
isOpen:
|
|
17
|
+
...i,
|
|
18
|
+
isOpen: c,
|
|
19
19
|
onOpenChange: (m) => {
|
|
20
|
-
n.forceDefaultView && !m && s.setView(
|
|
20
|
+
n.forceDefaultView && !m && s.setView(o ?? "search"), t(!!m);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */ e(I, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ e(K, { config: p, componentType: l.SearchBar, children: /* @__PURE__ */ e(
|
|
23
|
+
return /* @__PURE__ */ a(u, { children: [
|
|
24
|
+
/* @__PURE__ */ e(I, { wrapperStyles: { display: "contents" }, children: /* @__PURE__ */ e(K, { config: p, componentType: l.SearchBar, children: /* @__PURE__ */ e(k, { setOpen: t, modalSettings: d }) }) }),
|
|
25
25
|
/* @__PURE__ */ e(
|
|
26
26
|
b,
|
|
27
27
|
{
|
|
@@ -33,20 +33,20 @@ function j(n) {
|
|
|
33
33
|
)
|
|
34
34
|
] });
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const { setOpen:
|
|
38
|
-
return /* @__PURE__ */ e(r.SearchBarContainer, { children: /* @__PURE__ */
|
|
36
|
+
function k(n) {
|
|
37
|
+
const { setOpen: c, modalSettings: t } = n;
|
|
38
|
+
return /* @__PURE__ */ e(r.SearchBarContainer, { children: /* @__PURE__ */ a(
|
|
39
39
|
r.SearchBarButton,
|
|
40
40
|
{
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
onClick: (i) => {
|
|
42
|
+
i.button !== 2 && c((o) => !o);
|
|
43
43
|
},
|
|
44
44
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ a(r.SearchBarContentWrapper, { children: [
|
|
46
46
|
/* @__PURE__ */ e(r.SearchBarIcon, {}),
|
|
47
47
|
/* @__PURE__ */ e(r.SearchBarText, {})
|
|
48
48
|
] }),
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ a(r.SearchBarKbdWrapper, { children: [
|
|
50
50
|
/* @__PURE__ */ e(r.SearchBarKbdModifier, { shortcutKey: t?.shortcutKey }),
|
|
51
51
|
/* @__PURE__ */ e(r.SearchBarKbdShortcutKey, { shortcutKey: t?.shortcutKey })
|
|
52
52
|
] })
|
|
@@ -55,6 +55,6 @@ function w(n) {
|
|
|
55
55
|
) });
|
|
56
56
|
}
|
|
57
57
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
E as InkeepSearchBar,
|
|
59
|
+
k as SearchBarImpl
|
|
60
60
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./components/embedded-chat.cjs"),r=require("./components/embedded-search-and-chat.cjs"),n=require("./components/embedded-search.cjs"),h=require("./components/modal.chat.cjs"),m=require("./components/modal.search-and-chat.cjs"),o=require("./components/modal.search.cjs"),c=require("./components/modal.cjs"),a=require("./components/chat-button.cjs"),p=require("./components/searchbar.cjs"),I=require("./components/intelligent-form.cjs"),t=require("@inkeep/cxkit-styled");exports.InkeepEmbeddedChat=d.InkeepEmbeddedChat;exports.InkeepEmbeddedChatImpl=d.InkeepEmbeddedChatImpl;exports.InkeepEmbeddedChatImplContent=d.InkeepEmbeddedChatImplContent;exports.InkeepEmbeddedChatProvider=d.InkeepEmbeddedChatProvider;exports.InkeepEmbeddedSearchAndChat=r.InkeepEmbeddedSearchAndChat;exports.InkeepEmbeddedSearchAndChatImpl=r.InkeepEmbeddedSearchAndChatImpl;exports.InkeepEmbeddedSearch=n.InkeepEmbeddedSearch;exports.InkeepEmbeddedSearchImpl=n.InkeepEmbeddedSearchImpl;exports.InkeepEmbeddedSearchImplContent=n.InkeepEmbeddedSearchImplContent;exports.InkeepEmbeddedSearchProvider=n.InkeepEmbeddedSearchProvider;exports.InkeepModalChat=h.InkeepModalChat;exports.InkeepModalSearchAndChat=m.InkeepModalSearchAndChat;exports.InkeepModalSearch=o.InkeepModalSearch;exports.InkeepModal=c.InkeepModal;exports.ChatButtonImpl=a.ChatButtonImpl;exports.InkeepChatButton=a.InkeepChatButton;exports.InkeepSearchBar=p.InkeepSearchBar;exports.SearchBarImpl=p.SearchBarImpl;exports.InkeepIntelligentForm=I.InkeepIntelligentForm;exports.InkeepIntelligentFormImpl=I.InkeepIntelligentFormImpl;Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import { InkeepEmbeddedChat as
|
|
2
|
-
import { InkeepEmbeddedSearchAndChat as
|
|
3
|
-
import { InkeepEmbeddedSearch as
|
|
4
|
-
import { InkeepModalChat as
|
|
5
|
-
import { InkeepModalSearchAndChat as
|
|
6
|
-
import { InkeepModalSearch as
|
|
7
|
-
import { InkeepModal as
|
|
8
|
-
import { ChatButtonImpl as
|
|
9
|
-
import { InkeepSearchBar as
|
|
10
|
-
import { InkeepIntelligentForm as
|
|
1
|
+
import { InkeepEmbeddedChat as d, InkeepEmbeddedChatImpl as p, InkeepEmbeddedChatImplContent as o, InkeepEmbeddedChatProvider as t } from "./components/embedded-chat.js";
|
|
2
|
+
import { InkeepEmbeddedSearchAndChat as n, InkeepEmbeddedSearchAndChatImpl as I } from "./components/embedded-search-and-chat.js";
|
|
3
|
+
import { InkeepEmbeddedSearch as h, InkeepEmbeddedSearchImpl as k, InkeepEmbeddedSearchImplContent as l, InkeepEmbeddedSearchProvider as C } from "./components/embedded-search.js";
|
|
4
|
+
import { InkeepModalChat as x } from "./components/modal.chat.js";
|
|
5
|
+
import { InkeepModalSearchAndChat as c } from "./components/modal.search-and-chat.js";
|
|
6
|
+
import { InkeepModalSearch as S } from "./components/modal.search.js";
|
|
7
|
+
import { InkeepModal as B } from "./components/modal.js";
|
|
8
|
+
import { ChatButtonImpl as A, InkeepChatButton as g } from "./components/chat-button.js";
|
|
9
|
+
import { InkeepSearchBar as v, SearchBarImpl as F } from "./components/searchbar.js";
|
|
10
|
+
import { InkeepIntelligentForm as j, InkeepIntelligentFormImpl as q } from "./components/intelligent-form.js";
|
|
11
11
|
export * from "@inkeep/cxkit-styled";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
A as ChatButtonImpl,
|
|
14
|
+
g as InkeepChatButton,
|
|
15
|
+
d as InkeepEmbeddedChat,
|
|
16
|
+
p as InkeepEmbeddedChatImpl,
|
|
17
|
+
o as InkeepEmbeddedChatImplContent,
|
|
18
|
+
t as InkeepEmbeddedChatProvider,
|
|
19
|
+
h as InkeepEmbeddedSearch,
|
|
20
|
+
n as InkeepEmbeddedSearchAndChat,
|
|
21
|
+
I as InkeepEmbeddedSearchAndChatImpl,
|
|
22
|
+
k as InkeepEmbeddedSearchImpl,
|
|
23
|
+
l as InkeepEmbeddedSearchImplContent,
|
|
24
|
+
C as InkeepEmbeddedSearchProvider,
|
|
25
|
+
j as InkeepIntelligentForm,
|
|
26
|
+
q as InkeepIntelligentFormImpl,
|
|
27
|
+
B as InkeepModal,
|
|
28
|
+
x as InkeepModalChat,
|
|
29
|
+
S as InkeepModalSearch,
|
|
30
|
+
c as InkeepModalSearchAndChat,
|
|
31
|
+
v as InkeepSearchBar,
|
|
32
|
+
F as SearchBarImpl
|
|
29
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-react",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20250228015002",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@inkeep/cxkit-styled": "0.0.0-dev-
|
|
23
|
+
"@inkeep/cxkit-styled": "0.0.0-dev-20250228015002"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@biomejs/biome": "1.9.4",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"typescript": "5.7.3",
|
|
44
44
|
"vite": "5.4.11",
|
|
45
45
|
"vite-plugin-dts": "4.4.0",
|
|
46
|
-
"@inkeep/cxkit-color-mode": "0.0.0-dev-
|
|
47
|
-
"@inkeep/cxkit-types": "0.0.0-dev-
|
|
46
|
+
"@inkeep/cxkit-color-mode": "0.0.0-dev-20250228015002",
|
|
47
|
+
"@inkeep/cxkit-types": "0.0.0-dev-20250228015002"
|
|
48
48
|
},
|
|
49
49
|
"module": "dist/index.js",
|
|
50
50
|
"types": "dist/index.d.ts",
|