@inkeep/cxkit-react 0.5.72 → 0.5.74
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/embedded-chat.cjs +1 -1
- package/dist/components/embedded-chat.js +1 -4
- package/dist/components/embedded-search-and-chat.cjs +1 -1
- package/dist/components/embedded-search-and-chat.js +30 -28
- package/dist/components/embedded-search.cjs +1 -1
- package/dist/components/embedded-search.js +70 -69
- package/package.json +5 -5
|
@@ -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"),h=require("react"),b=require("./widget-toggle.cjs"),l=require("./modal.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(o,{...a})})}function o(a){const{onToggleView:t}=a,s=d.useModal(),n=d.useWidget(),r=s&&!n?l.ModalContent: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(x,{...a}),e.jsx(j,{}),e.jsx(I,{})]}),e.jsx(T,{}),e.jsx(B,{})]})})}function x(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,r=!!t;return e.jsx(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,{})]}):e.jsx(d.Modal.Close,{})})}function j(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function E(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(u,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(F,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(g,{}),e.jsx(p,{}),e.jsx(A,{})]})]},t.id))]})})}function u(){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.ExampleQuestions,{children:[e.jsx(d.EmbeddedChat.ExampleQuestionsLabel,{}),e.jsx(d.EmbeddedChat.ExampleQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.ExampleQuestion,{children:e.jsx(d.EmbeddedChat.ExampleQuestionButton,{question:t})},t))})]})]})]})}function F(){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 g(){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 p(){return e.jsxs(d.EmbeddedChat.MessageToolbar,{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,i)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${i}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function I(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(M,{}),e.jsx(k,{})]})}function M(){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 k(){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 T(){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 B(){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=o;exports.InkeepEmbeddedChatProvider=m;
|
|
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"),l=require("./modal.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(o,{...a})})}function o(a){const{onToggleView:t}=a,s=d.useModal(),n=d.useWidget(),r=s&&!n?l.ModalContent: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(x,{...a}),e.jsx(j,{}),e.jsx(I,{})]}),e.jsx(T,{}),e.jsx(B,{})]})})}function x(a){const{onToggleView:t,askAILabel:s,searchLabel:n}=a,r=!!t;return e.jsx(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,{})]}):e.jsx(d.Modal.Close,{})})}function j(){return e.jsx(d.EmbeddedChat.Content,{children:e.jsxs(d.EmbeddedChat.ContentScrollArea,{children:[e.jsx(d.EmbeddedChat.ContentScrollAreaViewport,{children:e.jsx(E,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaScrollbar,{children:e.jsx(d.EmbeddedChat.ContentScrollAreaThumb,{})}),e.jsx(d.EmbeddedChat.ContentScrollAreaCorner,{})]})})}function E(){return e.jsx(d.EmbeddedChat.Messages,{children:({messages:a})=>e.jsxs(e.Fragment,{children:[e.jsx(u,{}),a.map(t=>e.jsxs(d.EmbeddedChat.MessageWrapper,{message:t,children:[e.jsx(F,{}),e.jsx(d.EmbeddedChat.MessageLoading,{}),e.jsxs(d.EmbeddedChat.MessageContentWrapper,{children:[e.jsx(d.EmbeddedChat.MessageContent,{children:e.jsx(d.EmbeddedChat.Message,{})}),e.jsx(g,{}),e.jsx(p,{}),e.jsx(A,{})]})]},t.id))]})})}function u(){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.ExampleQuestions,{children:[e.jsx(d.EmbeddedChat.ExampleQuestionsLabel,{}),e.jsx(d.EmbeddedChat.ExampleQuestionsList,{children:a=>a.map(t=>e.jsx(d.EmbeddedChat.ExampleQuestion,{children:e.jsx(d.EmbeddedChat.ExampleQuestionButton,{question:t})},t))})]})]})]})}function F(){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 g(){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 p(){return e.jsxs(d.EmbeddedChat.MessageToolbar,{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,i)=>e.jsx(d.EmbeddedChat.MessageSourceItemDescriptionPart,{part:r},`part-${i}`))}),e.jsx(d.EmbeddedChat.MessageSourceItemIndicator,{})]},s))})]})}function I(){return e.jsxs(d.EmbeddedChat.Footer,{children:[e.jsx(M,{}),e.jsx(k,{})]})}function M(){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.jsx(d.EmbeddedChat.AttachmentsBarInput,{input:t,children: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 k(){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 T(){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 B(){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=o;exports.InkeepEmbeddedChatProvider=m;
|
|
@@ -202,10 +202,7 @@ function D() {
|
|
|
202
202
|
/* @__PURE__ */ t(e.AttachmentsBarInfoTipIcon, {}),
|
|
203
203
|
/* @__PURE__ */ t(e.AttachmentsBarInfoTipText, {})
|
|
204
204
|
] }),
|
|
205
|
-
/* @__PURE__ */ t(e.AttachmentsBarInputs, { children: (a) => a.map((r) => /* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */ t(e.AttachmentsBarInputIcon, {}),
|
|
207
|
-
r.displayName
|
|
208
|
-
] }, r.id)) })
|
|
205
|
+
/* @__PURE__ */ t(e.AttachmentsBarInputs, { children: (a) => a.map((r) => /* @__PURE__ */ t(e.AttachmentsBarInput, { input: r, children: r.displayName }, r.id)) })
|
|
209
206
|
] }),
|
|
210
207
|
/* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.AttachmentsBarModal, { children: /* @__PURE__ */ t(e.AttachmentsBarModalOverlay, { children: /* @__PURE__ */ n(e.AttachmentsBarModalContent, { children: [
|
|
211
208
|
/* @__PURE__ */ n(e.AttachmentsBarModalHeader, { children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./embedded-chat.cjs"),t=require("@inkeep/cxkit-styled"),a=require("./embedded-search.cjs"),S=require("./embedded-search-and-chat.impl.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./embedded-chat.cjs"),t=require("@inkeep/cxkit-styled"),a=require("./embedded-search.cjs"),S=require("./embedded-search-and-chat.impl.cjs"),k=require("react"),g=require("./modal.cjs");function j(n){const{config:d,...r}=S.useWidgetImpl(n);return e.jsx(t.Shadow,{wrapperStyles:{height:"inherit",width:"inherit"},children:e.jsx(t.RootProvider,{config:d,componentType:t.WebWidgetInteractionType.EmbeddedSearchAndChat,children:e.jsx(h,{...r})})})}function h(n){const{view:d,setView:r,shouldShowAskAICard:l,onToggleView:p,shouldAutoFocusInput:m,searchLabel:u,askAILabel:b,askAICardLabel:I}=n,C=t.useModal()?g.ModalContent:k.Fragment,o={onToggleView:p,shouldShowAskAICard:l,shouldAutoFocusInput:m,searchLabel:u,askAILabel:b,askAICardLabel:I},s={isHidden:d==="chat",...o},i={isHidden:d==="search",...o};return e.jsx(t.WidgetProvider,{widget:{setView:r,view:d},children:e.jsx(a.InkeepEmbeddedSearchProvider,{...s,children:e.jsx(c.InkeepEmbeddedChatProvider,{...i,children:e.jsxs(C,{children:[e.jsx(a.InkeepEmbeddedSearchImplContent,{...s}),e.jsx(c.InkeepEmbeddedChatImplContent,{...i})]})})})})}exports.InkeepEmbeddedSearchAndChat=j;exports.InkeepEmbeddedSearchAndChatImpl=h;
|
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
3
|
-
import { InkeepEmbeddedChatProvider as
|
|
4
|
-
import { Shadow as
|
|
5
|
-
import { InkeepEmbeddedSearchProvider as
|
|
6
|
-
import { useWidgetImpl as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { ModalContent as
|
|
9
|
-
function
|
|
10
|
-
const { config: r, ...
|
|
2
|
+
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
3
|
+
import { InkeepEmbeddedChatProvider as u, InkeepEmbeddedChatImplContent as b } from "./embedded-chat.js";
|
|
4
|
+
import { Shadow as C, RootProvider as f, WebWidgetInteractionType as g, useModal as k, WidgetProvider as w } from "@inkeep/cxkit-styled";
|
|
5
|
+
import { InkeepEmbeddedSearchProvider as A, 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
|
+
import { ModalContent as v } from "./modal.js";
|
|
9
|
+
function V(d) {
|
|
10
|
+
const { config: r, ...o } = E(d);
|
|
11
11
|
return /* @__PURE__ */ e(
|
|
12
|
-
|
|
12
|
+
C,
|
|
13
13
|
{
|
|
14
14
|
wrapperStyles: {
|
|
15
15
|
height: "inherit",
|
|
16
16
|
width: "inherit"
|
|
17
17
|
},
|
|
18
|
-
children: /* @__PURE__ */ e(f, { config: r, componentType:
|
|
18
|
+
children: /* @__PURE__ */ e(f, { config: r, componentType: g.EmbeddedSearchAndChat, children: /* @__PURE__ */ e(W, { ...o }) })
|
|
19
19
|
}
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function W(d) {
|
|
23
23
|
const {
|
|
24
24
|
view: r,
|
|
25
|
-
setView:
|
|
26
|
-
shouldShowAskAICard:
|
|
27
|
-
onToggleView:
|
|
28
|
-
shouldAutoFocusInput:
|
|
29
|
-
searchLabel:
|
|
30
|
-
askAILabel:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
setView: o,
|
|
26
|
+
shouldShowAskAICard: a,
|
|
27
|
+
onToggleView: h,
|
|
28
|
+
shouldAutoFocusInput: c,
|
|
29
|
+
searchLabel: m,
|
|
30
|
+
askAILabel: p,
|
|
31
|
+
askAICardLabel: s
|
|
32
|
+
} = d, l = k() ? v : P, t = {
|
|
33
|
+
onToggleView: h,
|
|
34
|
+
shouldShowAskAICard: a,
|
|
35
|
+
shouldAutoFocusInput: c,
|
|
36
|
+
searchLabel: m,
|
|
37
|
+
askAILabel: p,
|
|
38
|
+
askAICardLabel: s
|
|
37
39
|
}, n = {
|
|
38
40
|
isHidden: r === "chat",
|
|
39
41
|
...t
|
|
@@ -41,12 +43,12 @@ function v(o) {
|
|
|
41
43
|
isHidden: r === "search",
|
|
42
44
|
...t
|
|
43
45
|
};
|
|
44
|
-
return /* @__PURE__ */ e(
|
|
46
|
+
return /* @__PURE__ */ e(w, { widget: { setView: o, view: r }, children: /* @__PURE__ */ e(A, { ...n, children: /* @__PURE__ */ e(u, { ...i, children: /* @__PURE__ */ I(l, { children: [
|
|
45
47
|
/* @__PURE__ */ e(S, { ...n }),
|
|
46
|
-
/* @__PURE__ */ e(
|
|
48
|
+
/* @__PURE__ */ e(b, { ...i })
|
|
47
49
|
] }) }) }) });
|
|
48
50
|
}
|
|
49
51
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
V as InkeepEmbeddedSearchAndChat,
|
|
53
|
+
W as InkeepEmbeddedSearchAndChatImpl
|
|
52
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"),i=require("react"),h=require("./widget-toggle.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("@inkeep/cxkit-styled"),i=require("react"),h=require("./widget-toggle.cjs"),b=require("./modal.cjs");function x(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(m,{...r})})})}function o(r){const{children:s,onToggleView:t,isHidden:c,shouldAutoFocusInput:n=!t}=r;return e.jsx(d.EmbeddedSearch.Provider,{isHidden:c,shouldAutoFocusInput:n,children:s})}function m(r){return e.jsx(o,{...r,children:e.jsx(u,{...r})})}function u(r){const{searchSettings:{view:s}}=d.useInkeepConfig(),{onToggleView:t,shouldShowAskAICard:c=!!t&&s!=="dual-pane"}=r,n=d.useModal(),a=d.useWidget(),l=n&&!a?b.ModalContent:i.Fragment;return e.jsx(l,{children:e.jsx(d.EmbeddedSearch.Wrapper,{"data-show-ask-ai-card":d.dataAttr(c),"data-composite":d.dataAttr(!!t||n?.isOpen),children:e.jsxs(d.EmbeddedSearch.Root,{children:[e.jsx(j,{...r}),e.jsxs(d.EmbeddedSearch.Content,{children:[e.jsx(I,{askAICardLabel:r.askAICardLabel,askAILabel:r.askAILabel,onToggleView:r.onToggleView,shouldShowAskAICard:c}),e.jsx(E,{})]}),e.jsx(A,{})]})})})}function j(r){const{onToggleView:s,askAILabel:t,searchLabel:c}=r,n=d.useCommandState(a=>a.search);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(h.WidgetToggle,{onToggleView:s,query:n,askAILabel:t,searchLabel:c,view:"search"}),e.jsx(d.Modal.Close,{})]})}function I(r){const{askAILabel:s,onToggleView:t,shouldShowAskAICard:c,askAICardLabel:n}=r,a=d.useCommandState(S=>S.search),{handleToggle:l}=h.useToggleView({onToggleView:t,query:a});return c?e.jsxs(d.EmbeddedSearch.AskAITrigger,{onSelect:()=>l("chat",!0),children:[e.jsx(d.EmbeddedSearch.AskAITriggerIcon,{}),e.jsxs(d.EmbeddedSearch.AskAITriggerLabel,{children:[n||s||"Ask AI",a&&e.jsx(d.EmbeddedSearch.AskAITriggerQuery,{children:`${a}`})]}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicatorText,{children:"Start conversation"}),e.jsx(d.EmbeddedSearch.AskAITriggerIndicator,{})]}):null}function E(){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.ResultsContent,{children:[e.jsx(g,{}),e.jsx(R,{})]})]})}function g(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children: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((c,n)=>e.jsxs(i.Fragment,{children:[c,e.jsx(d.EmbeddedSearch.ResultsItemBreadcrumbIcon,{})]},`${c}-${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((c,n)=>e.jsx(d.EmbeddedSearch.ResultsItemDescriptionPart,{part:c},`part-${n}`))}),e.jsx(d.EmbeddedSearch.ResultsItemIndicator,{})]},s.id))})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function R(){return e.jsxs(d.EmbeddedSearch.ResultsScrollArea,{children:[e.jsx(d.EmbeddedSearch.ResultsScrollAreaViewport,{children:e.jsxs(d.EmbeddedSearch.ResultsItemPreview,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeader,{children:[e.jsxs(d.EmbeddedSearch.ResultsItemPreviewHeading,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewTitleLinkIcon,{})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbs,{children:r=>r.map((s,t)=>e.jsxs(i.Fragment,{children:[s,e.jsx(d.EmbeddedSearch.ResultsItemPreviewBreadcrumbIcon,{})]},`${s}-${t}`))})]}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewBody,{}),e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutline,{children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineTitle,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineList,{children:r=>r.map((s,t)=>e.jsxs(d.EmbeddedSearch.ResultsItemPreviewOutlineItem,{href:s.url??void 0,"data-is-match":d.dataAttr(s.isMatch),children:[e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemIcon,{}),e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemText,{children:s.content}),s.url&&e.jsx(d.EmbeddedSearch.ResultsItemPreviewOutlineItemLinkIcon,{})]},`${s.anchor}-${t}`))})]})]})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaScrollbar,{children:e.jsx(d.EmbeddedSearch.ResultsScrollAreaThumb,{})}),e.jsx(d.EmbeddedSearch.ResultsScrollAreaCorner,{})]})}function A(){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=x;exports.InkeepEmbeddedSearchImpl=m;exports.InkeepEmbeddedSearchImplContent=u;exports.InkeepEmbeddedSearchProvider=o;
|
|
@@ -1,126 +1,127 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
3
|
-
import { Shadow as
|
|
4
|
-
import { Fragment as
|
|
5
|
-
import { WidgetToggle as
|
|
3
|
+
import { Shadow as m, RootProvider as g, WebWidgetInteractionType as R, EmbeddedSearch as e, useInkeepConfig as A, useModal as T, useWidget as p, dataAttr as a, useCommandState as I, Modal as w } from "@inkeep/cxkit-styled";
|
|
4
|
+
import { Fragment as u } from "react";
|
|
5
|
+
import { WidgetToggle as S, useToggleView as k } from "./widget-toggle.js";
|
|
6
6
|
import { ModalContent as v } from "./modal.js";
|
|
7
|
-
function
|
|
8
|
-
const { baseSettings:
|
|
9
|
-
return /* @__PURE__ */ t(
|
|
10
|
-
|
|
7
|
+
function M(r) {
|
|
8
|
+
const { baseSettings: n, searchSettings: l } = r;
|
|
9
|
+
return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(
|
|
10
|
+
g,
|
|
11
11
|
{
|
|
12
12
|
config: {
|
|
13
|
-
baseSettings:
|
|
13
|
+
baseSettings: n,
|
|
14
14
|
searchSettings: l
|
|
15
15
|
},
|
|
16
|
-
componentType:
|
|
17
|
-
children: /* @__PURE__ */ t(P, { ...
|
|
16
|
+
componentType: R.EmbeddedSearch,
|
|
17
|
+
children: /* @__PURE__ */ t(P, { ...r })
|
|
18
18
|
}
|
|
19
19
|
) });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const { children:
|
|
23
|
-
return /* @__PURE__ */ t(e.Provider, { isHidden:
|
|
21
|
+
function b(r) {
|
|
22
|
+
const { children: n, onToggleView: l, isHidden: i, shouldAutoFocusInput: o = !l } = r;
|
|
23
|
+
return /* @__PURE__ */ t(e.Provider, { isHidden: i, shouldAutoFocusInput: o, children: n });
|
|
24
24
|
}
|
|
25
|
-
function P(
|
|
26
|
-
return /* @__PURE__ */ t(
|
|
25
|
+
function P(r) {
|
|
26
|
+
return /* @__PURE__ */ t(b, { ...r, children: /* @__PURE__ */ t(f, { ...r }) });
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function f(r) {
|
|
29
29
|
const {
|
|
30
|
-
searchSettings: { view:
|
|
31
|
-
} =
|
|
32
|
-
return /* @__PURE__ */ t(
|
|
30
|
+
searchSettings: { view: n }
|
|
31
|
+
} = A(), { onToggleView: l, shouldShowAskAICard: i = !!l && n !== "dual-pane" } = r, o = T(), c = p();
|
|
32
|
+
return /* @__PURE__ */ t(o && !c ? v : u, { children: /* @__PURE__ */ t(
|
|
33
33
|
e.Wrapper,
|
|
34
34
|
{
|
|
35
|
-
"data-show-ask-ai-card":
|
|
36
|
-
"data-composite":
|
|
35
|
+
"data-show-ask-ai-card": a(i),
|
|
36
|
+
"data-composite": a(!!l || o?.isOpen),
|
|
37
37
|
children: /* @__PURE__ */ s(e.Root, { children: [
|
|
38
|
-
/* @__PURE__ */ t(
|
|
38
|
+
/* @__PURE__ */ t(L, { ...r }),
|
|
39
39
|
/* @__PURE__ */ s(e.Content, { children: [
|
|
40
40
|
/* @__PURE__ */ t(
|
|
41
|
-
|
|
41
|
+
C,
|
|
42
42
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
askAICardLabel: r.askAICardLabel,
|
|
44
|
+
askAILabel: r.askAILabel,
|
|
45
|
+
onToggleView: r.onToggleView,
|
|
46
|
+
shouldShowAskAICard: i
|
|
46
47
|
}
|
|
47
48
|
),
|
|
48
|
-
/* @__PURE__ */ t(
|
|
49
|
+
/* @__PURE__ */ t(V, {})
|
|
49
50
|
] }),
|
|
50
|
-
/* @__PURE__ */ t(
|
|
51
|
+
/* @__PURE__ */ t(y, {})
|
|
51
52
|
] })
|
|
52
53
|
}
|
|
53
54
|
) });
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
const { onToggleView:
|
|
56
|
+
function L(r) {
|
|
57
|
+
const { onToggleView: n, askAILabel: l, searchLabel: i } = r, o = I((c) => c.search);
|
|
57
58
|
return /* @__PURE__ */ s(e.InputGroup, { children: [
|
|
58
59
|
/* @__PURE__ */ t(e.InputIcon, {}),
|
|
59
60
|
/* @__PURE__ */ t(e.Input, {}),
|
|
60
61
|
/* @__PURE__ */ t(e.Loading, {}),
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
n && /* @__PURE__ */ t(
|
|
63
|
+
S,
|
|
63
64
|
{
|
|
64
|
-
onToggleView:
|
|
65
|
-
query:
|
|
65
|
+
onToggleView: n,
|
|
66
|
+
query: o,
|
|
66
67
|
askAILabel: l,
|
|
67
|
-
searchLabel:
|
|
68
|
+
searchLabel: i,
|
|
68
69
|
view: "search"
|
|
69
70
|
}
|
|
70
71
|
),
|
|
71
|
-
/* @__PURE__ */ t(
|
|
72
|
+
/* @__PURE__ */ t(w.Close, {})
|
|
72
73
|
] });
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
const { askAILabel:
|
|
75
|
+
function C(r) {
|
|
76
|
+
const { askAILabel: n, onToggleView: l, shouldShowAskAICard: i, askAICardLabel: o } = r, c = I((h) => h.search), { handleToggle: d } = k({
|
|
76
77
|
onToggleView: l,
|
|
77
|
-
query:
|
|
78
|
+
query: c
|
|
78
79
|
});
|
|
79
|
-
return
|
|
80
|
+
return i ? /* @__PURE__ */ s(e.AskAITrigger, { onSelect: () => d("chat", !0), children: [
|
|
80
81
|
/* @__PURE__ */ t(e.AskAITriggerIcon, {}),
|
|
81
82
|
/* @__PURE__ */ s(e.AskAITriggerLabel, { children: [
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
o || n || "Ask AI",
|
|
84
|
+
c && /* @__PURE__ */ t(e.AskAITriggerQuery, { children: `${c}` })
|
|
84
85
|
] }),
|
|
85
86
|
/* @__PURE__ */ t(e.AskAITriggerIndicatorText, { children: "Start conversation" }),
|
|
86
87
|
/* @__PURE__ */ t(e.AskAITriggerIndicator, {})
|
|
87
88
|
] }) : null;
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function V() {
|
|
90
91
|
return /* @__PURE__ */ s(e.Results, { children: [
|
|
91
92
|
/* @__PURE__ */ t(e.ResultsLoading, {}),
|
|
92
|
-
/* @__PURE__ */ t(e.ResultsTabList, { children: (
|
|
93
|
+
/* @__PURE__ */ t(e.ResultsTabList, { children: (r) => r.map((n) => /* @__PURE__ */ t(e.ResultsTab, { tab: n }, n)) }),
|
|
93
94
|
/* @__PURE__ */ t(e.ResultsEmpty, {}),
|
|
94
95
|
/* @__PURE__ */ s(e.ResultsContent, { children: [
|
|
95
|
-
/* @__PURE__ */ t(
|
|
96
|
-
/* @__PURE__ */ t(
|
|
96
|
+
/* @__PURE__ */ t(O, {}),
|
|
97
|
+
/* @__PURE__ */ t($, {})
|
|
97
98
|
] })
|
|
98
99
|
] });
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
+
function O() {
|
|
101
102
|
return /* @__PURE__ */ s(e.ResultsScrollArea, { children: [
|
|
102
|
-
/* @__PURE__ */ t(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ t(e.ResultsList, { children: (
|
|
103
|
-
/* @__PURE__ */ t(e.ResultsItemBreadcrumbs, { children: (l) => l.map((
|
|
104
|
-
|
|
103
|
+
/* @__PURE__ */ t(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ t(e.ResultsList, { children: (r) => r.map((n) => /* @__PURE__ */ s(e.ResultsItem, { item: n, children: [
|
|
104
|
+
/* @__PURE__ */ t(e.ResultsItemBreadcrumbs, { children: (l) => l.map((i, o) => /* @__PURE__ */ s(u, { children: [
|
|
105
|
+
i,
|
|
105
106
|
/* @__PURE__ */ t(e.ResultsItemBreadcrumbIcon, {})
|
|
106
|
-
] }, `${
|
|
107
|
+
] }, `${i}-${o}`)) }),
|
|
107
108
|
/* @__PURE__ */ t(e.ResultsItemIcon, {}),
|
|
108
109
|
/* @__PURE__ */ t(e.ResultsItemTitle, {}),
|
|
109
110
|
/* @__PURE__ */ t(e.ResultsItemTag, {}),
|
|
110
|
-
/* @__PURE__ */ t(e.ResultsItemDescription, { children: (l) => l.map((
|
|
111
|
+
/* @__PURE__ */ t(e.ResultsItemDescription, { children: (l) => l.map((i, o) => /* @__PURE__ */ t(
|
|
111
112
|
e.ResultsItemDescriptionPart,
|
|
112
113
|
{
|
|
113
|
-
part:
|
|
114
|
+
part: i
|
|
114
115
|
},
|
|
115
|
-
`part-${
|
|
116
|
+
`part-${o}`
|
|
116
117
|
)) }),
|
|
117
118
|
/* @__PURE__ */ t(e.ResultsItemIndicator, {})
|
|
118
|
-
] },
|
|
119
|
+
] }, n.id)) }) }),
|
|
119
120
|
/* @__PURE__ */ t(e.ResultsScrollAreaScrollbar, { children: /* @__PURE__ */ t(e.ResultsScrollAreaThumb, {}) }),
|
|
120
121
|
/* @__PURE__ */ t(e.ResultsScrollAreaCorner, {})
|
|
121
122
|
] });
|
|
122
123
|
}
|
|
123
|
-
function
|
|
124
|
+
function $() {
|
|
124
125
|
return /* @__PURE__ */ s(e.ResultsScrollArea, { children: [
|
|
125
126
|
/* @__PURE__ */ t(e.ResultsScrollAreaViewport, { children: /* @__PURE__ */ s(e.ResultsItemPreview, { children: [
|
|
126
127
|
/* @__PURE__ */ s(e.ResultsItemPreviewHeader, { children: [
|
|
@@ -128,26 +129,26 @@ function O() {
|
|
|
128
129
|
/* @__PURE__ */ t(e.ResultsItemPreviewTitle, {}),
|
|
129
130
|
/* @__PURE__ */ t(e.ResultsItemPreviewTitleLinkIcon, {})
|
|
130
131
|
] }),
|
|
131
|
-
/* @__PURE__ */ t(e.ResultsItemPreviewBreadcrumbs, { children: (
|
|
132
|
-
|
|
132
|
+
/* @__PURE__ */ t(e.ResultsItemPreviewBreadcrumbs, { children: (r) => r.map((n, l) => /* @__PURE__ */ s(u, { children: [
|
|
133
|
+
n,
|
|
133
134
|
/* @__PURE__ */ t(e.ResultsItemPreviewBreadcrumbIcon, {})
|
|
134
|
-
] }, `${
|
|
135
|
+
] }, `${n}-${l}`)) })
|
|
135
136
|
] }),
|
|
136
137
|
/* @__PURE__ */ t(e.ResultsItemPreviewBody, {}),
|
|
137
138
|
/* @__PURE__ */ s(e.ResultsItemPreviewOutline, { children: [
|
|
138
139
|
/* @__PURE__ */ t(e.ResultsItemPreviewOutlineTitle, {}),
|
|
139
|
-
/* @__PURE__ */ t(e.ResultsItemPreviewOutlineList, { children: (
|
|
140
|
+
/* @__PURE__ */ t(e.ResultsItemPreviewOutlineList, { children: (r) => r.map((n, l) => /* @__PURE__ */ s(
|
|
140
141
|
e.ResultsItemPreviewOutlineItem,
|
|
141
142
|
{
|
|
142
|
-
href:
|
|
143
|
-
"data-is-match":
|
|
143
|
+
href: n.url ?? void 0,
|
|
144
|
+
"data-is-match": a(n.isMatch),
|
|
144
145
|
children: [
|
|
145
146
|
/* @__PURE__ */ t(e.ResultsItemPreviewOutlineItemIcon, {}),
|
|
146
|
-
/* @__PURE__ */ t(e.ResultsItemPreviewOutlineItemText, { children:
|
|
147
|
-
|
|
147
|
+
/* @__PURE__ */ t(e.ResultsItemPreviewOutlineItemText, { children: n.content }),
|
|
148
|
+
n.url && /* @__PURE__ */ t(e.ResultsItemPreviewOutlineItemLinkIcon, {})
|
|
148
149
|
]
|
|
149
150
|
},
|
|
150
|
-
`${
|
|
151
|
+
`${n.anchor}-${l}`
|
|
151
152
|
)) })
|
|
152
153
|
] })
|
|
153
154
|
] }) }),
|
|
@@ -155,7 +156,7 @@ function O() {
|
|
|
155
156
|
/* @__PURE__ */ t(e.ResultsScrollAreaCorner, {})
|
|
156
157
|
] });
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function y() {
|
|
159
160
|
return /* @__PURE__ */ t(e.Footer, { children: /* @__PURE__ */ s(e.TaglineContainer, { children: [
|
|
160
161
|
/* @__PURE__ */ t(e.TaglineText, {}),
|
|
161
162
|
/* @__PURE__ */ t(e.TaglineLogo, {}),
|
|
@@ -163,8 +164,8 @@ function $() {
|
|
|
163
164
|
] }) });
|
|
164
165
|
}
|
|
165
166
|
export {
|
|
166
|
-
|
|
167
|
+
M as InkeepEmbeddedSearch,
|
|
167
168
|
P as InkeepEmbeddedSearchImpl,
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
f as InkeepEmbeddedSearchImplContent,
|
|
170
|
+
b as InkeepEmbeddedSearchProvider
|
|
170
171
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.74",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@radix-ui/react-use-controllable-state": "^1.1.0",
|
|
24
|
-
"
|
|
24
|
+
"lucide-react": "^0.503.0",
|
|
25
|
+
"@inkeep/cxkit-styled": "0.5.74"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@biomejs/biome": "1.9.4",
|
|
@@ -39,13 +40,12 @@
|
|
|
39
40
|
"prism-react-renderer": "2.4.1",
|
|
40
41
|
"react": "19.0.0",
|
|
41
42
|
"react-dom": "19.0.0",
|
|
42
|
-
"react-icons": "5.4.0",
|
|
43
43
|
"storybook": "^8.5.3",
|
|
44
44
|
"typescript": "5.7.3",
|
|
45
45
|
"vite": "5.4.11",
|
|
46
46
|
"vite-plugin-dts": "4.4.0",
|
|
47
|
-
"@inkeep/cxkit-color-mode": "0.5.
|
|
48
|
-
"@inkeep/cxkit-types": "0.5.
|
|
47
|
+
"@inkeep/cxkit-color-mode": "0.5.74",
|
|
48
|
+
"@inkeep/cxkit-types": "0.5.74"
|
|
49
49
|
},
|
|
50
50
|
"module": "dist/index.js",
|
|
51
51
|
"types": "dist/index.d.ts",
|