@inkeep/cxkit-primitives 0.5.98 → 0.5.99
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("../atoms/cmdk/index.cjs"),r=require("./factory.cjs"),h=require("../utils/misc.cjs"),l=require("react"),m=require("./embedded-search/search-provider.cjs"),Oe=require("./tagline-logo-icon.cjs"),E=require("../atoms/icons/custom-icon.cjs"),je=require("@radix-ui/react-scroll-area"),qe=require("@radix-ui/react-tabs"),R=require("../providers/config-provider.cjs"),Be=require("../providers/search-events-provider.cjs"),y=require("../atoms/link.cjs"),S=require("../providers/source-item-provider.cjs"),C=require("../atoms/icons/built-in-icon-renderer.cjs"),Me=require("../utils/highlight-emphasis.cjs"),Ne=require("../hooks/use-scrolling-fades.cjs"),He=require("@inkeep/cxkit-color-mode"),Ue=require("../atoms/avatars/ai.cjs"),Qe=require("./modal/modal-provider.cjs"),f=require("../utils/compose-refs.cjs"),A=require("../utils/compose-event-handlers.cjs"),Fe=require("../atoms/shadow/context.cjs"),Ge=require("../atoms/markdown/index.cjs"),O=require("../hooks/use-media-query.cjs"),De=require("./embedded-search/use-search-filter.cjs"),Ke=require("./embedded-search/url-query.cjs"),k=require("../constants/search.cjs"),Ve=require("./modal/widget-auto-focus.cjs");function M(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const T=M(je),x=M(qe),We=r.ikp("div",{_id:"aiSearchWrapper"}),N=e=>{const{searchSettings:{view:t}}=R.useInkeepConfig(),{isHidden:i,hasContent:s}=m.useSearch(),n=O.useMediaQuery("(max-width: 768px)"),c=Qe.useModal();return a.jsx(We,{"data-hidden":h.dataAttr(i),"data-has-content":h.dataAttr(s),"data-in-modal":h.dataAttr(!!c),"data-mobile":h.dataAttr(n),"data-view":t,"data-dual-pane-search-expanded":h.dataAttr(s&&t==="dual-pane"&&!i),...e})},$e=r.ikp("div",{_id:"aiSearchRoot"}),H=e=>{const{isHidden:t}=m.useSearch(),i=O.useMediaQuery("(max-width: 768px)");return a.jsx($e,{"data-hidden":h.dataAttr(t),"data-mobile":h.dataAttr(i),...e})},U=r.ikp(p.Command.List,{_id:"aiSearchContent"}),Q=l.forwardRef((e,t)=>{const i=p.useCommandState(s=>s.value);return a.jsx(U,{"aria-activedescendant":`aiSearchResults__Item-${i}`,...e,ref:t})}),F=r.ikp("div",{_id:"aiSearchInputGroup"}),G=r.ikp(E.CustomIcon,{_id:"aiSearchInputIcon",iconKey:"search"}),ze=r.ikp(p.Command.Input,{_id:"aiSearchInput"}),D=l.forwardRef(({onInput:e,...t},i)=>{const{inputRef:s,shouldAutoFocusInput:n}=m.useSearch(),c=p.useCommandState(v=>v.value),o=O.useMediaQuery("(max-width: 768px)"),{searchSettings:d}=R.useInkeepConfig(),u=l.useMemo(()=>d.placeholder||(o?"Search...":"Search for anything..."),[d.placeholder,o]),b=f.useComposedRefs(i,s);return Ve.useWidgetAutoFocus("search",s,n),De.useSearchFetch(),a.jsx(ze,{ref:b,placeholder:u,"aria-activedescendant":`aiSearchResults__Item-${c}`,...t})}),Je=r.ikp(C.BuiltInIconRenderer,{_id:"aiSearchLoading",iconSettings:{builtIn:"LuLoaderCircle"}}),K=e=>{const{loading:t}=m.useSearch();return t?a.jsx(Je,{...e}):null},Xe=r.ikp(p.Command.Item,{_id:"aiAskAITrigger",value:k.ASK_AI_TRIGGER_VALUE}),V=e=>{const{results:t,tab:i}=m.useSearch(),s=p.useCommandStore(),n=t[i]?.[0]?.id??"NONE";return a.jsx(Xe,{...e,id:`aiSearchResults__Item-${k.ASK_AI_TRIGGER_VALUE}`,tabIndex:0,onPointerLeave:()=>s.setState("value",n,!0)})},Ye=r.ikp("img",{_id:"aiAskAITrigger__Icon"}),W=e=>{const{aiChatSettings:t}=R.useInkeepConfig(),{aiAssistantAvatar:i}=t??{},s=typeof i=="string"?i:i?.light,n=(typeof i=="string"?i:i?.dark)??s,c=He.useColorModeValue(s,n),[o,d]=l.useState(c);l.useEffect(()=>{d(c)},[c]);const u=()=>{d(null)};return a.jsx(Ye,{asChild:!0,...e,children:o?a.jsx("img",{src:o,alt:"AI Avatar","data-type":"image",onError:A.composeEventHandlers(u),...e}):a.jsx(Ue.default,{"data-type":"icon",...e})})},$=r.ikp("span",{_id:"aiAskAITrigger__Label"}),z=r.ikp("span",{_id:"aiAskAITrigger__Query"}),J=r.ikp(E.CustomIcon,{_id:"aiAskAITrigger__Indicator",iconKey:"openLinkInSameTab"}),X=r.ikp("span",{_id:"aiAskAITrigger__IndicatorText"}),Ze=r.ikp(x.Root,{_id:"aiSearchResults"}),Y=e=>{const{searchSettings:{view:t}}=R.useInkeepConfig(),{tab:i,setTab:s,hasContent:n,isHidden:c,disableTransition:o,results:d,defaultTab:u}=m.useSearch(),b=p.useCommandStore(),v=l.useCallback(I=>{o(),s(I);const P=d[I][0]?d[I][0]?.id:void 0;b.setState("value",P,!0)},[d,o]);return l.useEffect(()=>{let I=i in d?i:Object.keys(d)[0];if(!d[I]?.length){const _=Object.keys(d).find(w=>d[w]?.length);_?I=_:I=u}if(!I)return;s(I);const P=d[I]?.[0];P&&b.setState("value",P.id,!0)},[d]),a.jsx(Ze,{value:i,onValueChange:v,"data-has-content":h.dataAttr(n),"data-dual-pane-search-expanded":h.dataAttr(n&&t==="dual-pane"&&!c),...e})},et=r.ikp("div",{_id:"aiSearchResults__Loading"}),Z=e=>{const{loading:t,resultsList:i}=m.useSearch();return!t||i.length>0?null:a.jsx(et,{...e})},tt=r.ikp(p.Command.Empty,{_id:"aiSearchResults__Empty"}),ee=e=>{const t=p.useCommandState(o=>o.search),{loading:i,results:s,tab:n}=m.useSearch(),c=s[n]?.length;return i||!t||c?null:a.jsx(tt,{children:"No results found.",...e})},it=r.ikp(x.List,{_id:"aiSearchResults__TabList"}),te=e=>{const{children:t,...i}=e,{searchSettings:{tabs:s}}=R.useInkeepConfig(),{results:n,loading:c,resultsList:o}=m.useSearch();if(c&&o.length===0)return null;const d=Object.keys(n);return!s.length||!d.length?null:a.jsx(it,{tabIndex:-1,children:h.maybeRender(t,d),...i})},rt=r.ikp(x.Trigger,{_id:"aiSearchResults__Tab"}),ie=l.forwardRef((e,t)=>{const i=l.useRef(null),s=f.useComposedRefs(t,i),{tab:n,onClick:c,...o}=e,{results:d,tab:u,inputRef:b}=m.useSearch(),v=d[n].length,I=n===u,P=()=>{b.current?.focus()},_=Fe.useShadow();return l.useEffect(()=>{I&&_?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab")&&i.current?.focus()},[I]),a.jsx(rt,{ref:s,"ikp-tab":"",tabIndex:I?0:-1,value:n,children:`${n} (${v})`,onClick:A.composeEventHandlers(c,P),...o})}),re=r.ikp("div",{_id:"aiSearchResults__Content"}),st=r.ikp(T.Root,{_id:"aiSearchResults__ScrollArea"}),se=e=>{const{loading:t,resultsList:i}=m.useSearch();return t&&i.length===0?null:a.jsx(st,{tabIndex:-1,...e})},nt=r.ikp(T.Viewport,{_id:"aiSearchResults__ScrollAreaViewport"}),ne=l.forwardRef(({children:e,...t},i)=>{const s=Ne.useScrollingFades(),n=f.useComposedRefs(i,s),{tab:c}=m.useSearch();return l.useEffect(()=>{c&&s.current?.scrollTo({top:0,behavior:"auto"})},[c]),a.jsx(nt,{ref:n,tabIndex:-1,children:a.jsx("div",{tabIndex:-1,style:{display:"grid"},children:e}),...t})}),at=r.ikp(T.ScrollAreaScrollbar,{_id:"aiSearchResults__ScrollAreaScrollbar"}),ct=r.ikp(T.ScrollAreaThumb,{_id:"aiSearchResults__ScrollAreaThumb"}),dt=r.ikp(T.Corner,{_id:"aiSearchResults__ScrollAreaCorner"}),ot=r.ikp(x.Content,{_id:"aiSearchResults__List"}),ae=e=>{const{children:t,...i}=e,{results:s,tab:n}=m.useSearch(),c=s[n]??[];return a.jsx(ot,{value:n,"data-has-results":h.dataAttr(c.length>0),"aria-label":"Search results",children:h.maybeRender(t,c),tabIndex:-1,...i})},ut=r.ikp(p.Command.Item,{_id:"aiSearchResults__Item",asChild:!0}),ce=l.forwardRef(({item:e,onClick:t,onSelect:i,children:s,...n},c)=>{const{searchSettings:{shouldOpenLinksInNewTab:o,view:d,searchQueryParamKey:u}}=R.useInkeepConfig(),{logEvent:b}=Be.useSearchEvents(),v=p.useCommandState(g=>g.search),{transitionsDisabled:I}=m.useSearch(),P=p.useCommandState(g=>g.value),_=l.useRef(null),w=f.useComposedRefs(c,_),q=l.useCallback(g=>{g.trigger==="keyboard"&&_.current?.click()},[]),xe=l.useCallback(()=>{b({eventName:"search_result_clicked",properties:{searchQuery:v,title:e.title,url:e.url}})},[b,v,e.title,e.url]),L=l.useMemo(()=>e.shouldOpenInNewTab!==void 0?e.shouldOpenInNewTab:o,[e.shouldOpenInNewTab,o]),B=P===e.id,Le=P==="NONE"||P===k.ASK_AI_TRIGGER_VALUE,ye=B||Le,Ce=l.useMemo(()=>({href:u?Ke.getUrlWithQuery(e.url,v,u):e.url,isExternal:L,appendToUrl:e.appendToUrl,children:s,id:`aiSearchResults__Item-${e.id}`}),[e.url,L,e.appendToUrl,s,e.id,u,v]);return a.jsx(S.SourceItemProvider,{source:{...e,isExternal:L},children:a.jsx(ut,{ref:w,value:e.id,"data-type":e.type,"data-breadcrumbs":!!e.breadcrumbs?.length,"data-disable-transitions":h.dataAttr(I),"data-view":d,onSelect:A.composeEventHandlers(i,q),onClick:A.composeEventHandlers(t,xe),"data-selected":h.dataAttr(B),tabIndex:ye?0:-1,...n,children:a.jsx(y.LinkWithQueryParams,{...Ce})})})}),lt=r.ikp("div",{_id:"aiSearchResults__ItemBreadcrumbs"}),j=e=>{const{source:t}=S.useSourceItem(),{tab:i}=m.useSearch();if(!t.breadcrumbs?.length)return null;const{children:s,...n}=e,o=t.tabs?.find(d=>typeof d!="string"&&d[0]===i)?.[1]?.breadcrumbs??t.breadcrumbs??[];return a.jsx(lt,{"aria-hidden":"true",children:h.maybeRender(s,o),...n})},de=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemBreadcrumbIcon",iconKey:"breadcrumbSeparator"}),mt=r.ikp(C.BuiltInIconRenderer,{_id:"aiSearchResults__ItemIcon"}),oe=e=>{const{source:t}=S.useSourceItem();return a.jsx(mt,{iconSettings:t.icon,"data-type":t.type,...e})},ht=r.ikp("span",{_id:"aiSearchResults__ItemTitle"}),ue=e=>{const{source:t}=S.useSourceItem();return a.jsx(ht,{"data-type":t.type,children:t.title,...e})},It=r.ikp("span",{_id:"aiSearchResults__ItemTag"}),le=e=>{const{source:t}=S.useSourceItem();return a.jsx(It,{"data-type":t.type,children:t.tag,...e})},vt=r.ikp("span",{_id:"aiSearchResults__ItemDescription"}),me=e=>{const{source:t}=S.useSourceItem(),{children:i,...s}=e,n=l.useMemo(()=>t.description?Me.highlightEmphasis(t.description):[],[t.description]);return n.length?a.jsx(vt,{"data-type":t.type,"aria-hidden":"true",children:h.maybeRender(i,n),...s}):null},St=r.ikp("span",{_id:"aiSearchResults__ItemDescriptionPart"}),he=e=>{const{part:t,...i}=e,{source:s}=S.useSourceItem();return typeof t=="string"?t:a.jsx(St,{"data-type":s.type,children:t.content,"data-highlighted":h.dataAttr(t.highlighted),...i})},bt=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemIndicator"}),Ie=e=>{const{source:t}=S.useSourceItem(),{searchSettings:{view:i}}=R.useInkeepConfig();return a.jsx(bt,{iconKey:t.isExternal?"openLinkInNewTab":"openLinkInSameTab","data-view":i,...e})},pt=r.ikp("div",{_id:"aiSearchResults__ItemPreview","aria-hidden":!0}),ve=e=>{const{searchSettings:{view:t,shouldOpenLinksInNewTab:i}}=R.useInkeepConfig(),{results:s,tab:n}=m.useSearch(),c=p.useCommandState(v=>v.value),o=s[n]??[],d=l.useRef(null),u=l.useMemo(()=>{if(c===k.ASK_AI_TRIGGER_VALUE)return d.current;const v=o.find(I=>I.id===c);return d.current=v??null,v},[c]);if(t!=="dual-pane"||c===k.ASK_AI_TRIGGER_VALUE||!u)return null;const b=u.shouldOpenInNewTab!==void 0?u.shouldOpenInNewTab:i;return a.jsx(S.SourceItemProvider,{source:{...u,isExternal:b},children:a.jsx(pt,{...e})})},Pt=r.ikp("div",{_id:"aiSearchResults__ItemPreview__Header"}),Rt=r.ikp(y.LinkWithQueryParams,{_id:"aiSearchResults__ItemPreview__Heading"}),Se=e=>{const{source:t}=S.useSourceItem();return a.jsx(Rt,{href:t.url,isExternal:t.isExternal,appendToUrl:t.appendToUrl,"data-type":t.type,...e})},_t=r.ikp("span",{_id:"aiSearchResults__ItemPreview__Title"}),be=e=>{const{source:t}=S.useSourceItem();return a.jsx(_t,{children:t.title,...e})},gt=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemPreview__Title__LinkIcon",iconKey:"openLinkInNewTab"}),pe=e=>{const{source:t}=S.useSourceItem();return a.jsx(gt,{iconKey:t.isExternal?"openLinkInNewTab":"openLinkInSameTab",...e})},Et=r.ikp(j,{_id:"aiSearchResults__ItemPreview__Breadcrumbs"}),Pe=r.ikp(de,{_id:"aiSearchResults__ItemPreview__BreadcrumbIcon"}),kt=r.ikp(Ge.Markdown,{_id:"aiSearchResults__ItemPreview__Body"}),Re=e=>{const{source:t}=S.useSourceItem(),{resultsList:i}=m.useSearch(),s=i.find(c=>c.id===t.id),{searchSettings:{shouldOpenLinksInNewTab:n}}=R.useInkeepConfig();return s?a.jsx(kt,{shouldOpenLinksInNewTab:n,children:s.preview,...e}):null},Tt=r.ikp("div",{_id:"aiSearchResults__ItemPreview__Outline"}),_e=e=>{const{source:t}=S.useSourceItem(),{resultsList:i}=m.useSearch();return i.find(c=>c.id===t.id)?.rootRecord.topLevelHeadings?.length?a.jsx(Tt,{...e}):null},ge=r.ikp("span",{_id:"aiSearchResults__ItemPreview__Outline__Title",children:"On this page"}),wt=r.ikp("ul",{_id:"aiSearchResults__ItemPreview__Outline__List"}),Ee=e=>{const{source:t}=S.useSourceItem(),{resultsList:i}=m.useSearch(),s=i.find(u=>u.id===t.id),n=s?.rootRecord.topLevelHeadings;if(!n?.length)return null;const c=n.map(u=>{const b=u?.anchor&&u?.anchor===s?.content?.anchor,v=u?.anchor===s?.pathHeadings?.[0]?.anchor;return{...u,isMatch:b||v}}),{children:o,...d}=e;return a.jsx(wt,{children:h.maybeRender(o,c),...d})},At=r.ikp(y.LinkWithQueryParams,{_id:"aiSearchResults__ItemPreview__Outline__Item"}),ke=e=>{const{searchSettings:{shouldOpenLinksInNewTab:t}}=R.useInkeepConfig();return a.jsx(At,{isExternal:t,...e})},Te=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemPreview__Outline__ItemIcon",iconKey:"newLine"}),ft=r.ikp("span",{_id:"aiSearchResults__ItemPreview__Outline__ItemText"}),we=e=>a.jsx(ft,{...e}),Ae=r.ikp(C.BuiltInIconRenderer,{_id:"aiSearchResults__ItemPreview__Outline__ItemLinkIcon",iconSettings:{builtIn:"LuLink"}}),xt=r.ikp("div",{_id:"aiSearchFooter"}),fe=e=>{const{hasContent:t}=m.useSearch();return a.jsx(xt,{"data-has-results":h.dataAttr(t),...e})},Lt=r.ikp("div",{_id:"aiSearchTagline__Container"}),yt=r.ikp("span",{_id:"aiSearchTagline__Text",children:"Powered by"}),Ct=r.ikp(Oe.default,{_id:"aiSearchTagline__Logo"}),Ot=r.ikp("a",{_id:"aiSearchTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"});exports.Provider=m.SearchProvider;exports.AskAITrigger=V;exports.AskAITriggerIcon=W;exports.AskAITriggerIndicator=J;exports.AskAITriggerIndicatorText=X;exports.AskAITriggerLabel=$;exports.AskAITriggerQuery=z;exports.Content=Q;exports.EmbeddedSearchInputIcon=G;exports.EmbeddedSearchPrimitiveAskAITrigger=V;exports.EmbeddedSearchPrimitiveAskAITriggerIcon=W;exports.EmbeddedSearchPrimitiveAskAITriggerIndicator=J;exports.EmbeddedSearchPrimitiveAskAITriggerIndicatorText=X;exports.EmbeddedSearchPrimitiveAskAITriggerLabel=$;exports.EmbeddedSearchPrimitiveAskAITriggerQuery=z;exports.EmbeddedSearchPrimitiveContent=Q;exports.EmbeddedSearchPrimitiveFooter=fe;exports.EmbeddedSearchPrimitiveInput=D;exports.EmbeddedSearchPrimitiveInputGroup=F;exports.EmbeddedSearchPrimitiveLoading=K;exports.EmbeddedSearchPrimitiveResults=Y;exports.EmbeddedSearchPrimitiveResultsContent=re;exports.EmbeddedSearchPrimitiveResultsEmpty=ee;exports.EmbeddedSearchPrimitiveResultsItem=ce;exports.EmbeddedSearchPrimitiveResultsItemBreadcrumbs=j;exports.EmbeddedSearchPrimitiveResultsItemDescription=me;exports.EmbeddedSearchPrimitiveResultsItemDescriptionPart=he;exports.EmbeddedSearchPrimitiveResultsItemIcon=oe;exports.EmbeddedSearchPrimitiveResultsItemIndicator=Ie;exports.EmbeddedSearchPrimitiveResultsItemPreview=ve;exports.EmbeddedSearchPrimitiveResultsItemPreviewBody=Re;exports.EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon=Pe;exports.EmbeddedSearchPrimitiveResultsItemPreviewHeading=Se;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutline=_e;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem=ke;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon=Te;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon=Ae;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText=we;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineList=Ee;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle=ge;exports.EmbeddedSearchPrimitiveResultsItemPreviewTitle=be;exports.EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon=pe;exports.EmbeddedSearchPrimitiveResultsItemTag=le;exports.EmbeddedSearchPrimitiveResultsItemTitle=ue;exports.EmbeddedSearchPrimitiveResultsList=ae;exports.EmbeddedSearchPrimitiveResultsLoading=Z;exports.EmbeddedSearchPrimitiveResultsScrollArea=se;exports.EmbeddedSearchPrimitiveResultsScrollAreaViewport=ne;exports.EmbeddedSearchPrimitiveResultsTab=ie;exports.EmbeddedSearchPrimitiveResultsTabList=te;exports.EmbeddedSearchPrimitiveRoot=H;exports.EmbeddedSearchPrimitiveWrapper=N;exports.Footer=fe;exports.Input=D;exports.InputGroup=F;exports.InputIcon=G;exports.Loading=K;exports.PrimitiveContent=U;exports.Results=Y;exports.ResultsContent=re;exports.ResultsEmpty=ee;exports.ResultsItem=ce;exports.ResultsItemBreadcrumbIcon=de;exports.ResultsItemBreadcrumbs=j;exports.ResultsItemDescription=me;exports.ResultsItemDescriptionPart=he;exports.ResultsItemIcon=oe;exports.ResultsItemIndicator=Ie;exports.ResultsItemPreview=ve;exports.ResultsItemPreviewBody=Re;exports.ResultsItemPreviewBreadcrumbIcon=Pe;exports.ResultsItemPreviewBreadcrumbs=Et;exports.ResultsItemPreviewHeader=Pt;exports.ResultsItemPreviewHeading=Se;exports.ResultsItemPreviewOutline=_e;exports.ResultsItemPreviewOutlineItem=ke;exports.ResultsItemPreviewOutlineItemIcon=Te;exports.ResultsItemPreviewOutlineItemLinkIcon=Ae;exports.ResultsItemPreviewOutlineItemText=we;exports.ResultsItemPreviewOutlineList=Ee;exports.ResultsItemPreviewOutlineTitle=ge;exports.ResultsItemPreviewTitle=be;exports.ResultsItemPreviewTitleLinkIcon=pe;exports.ResultsItemTag=le;exports.ResultsItemTitle=ue;exports.ResultsList=ae;exports.ResultsLoading=Z;exports.ResultsScrollArea=se;exports.ResultsScrollAreaCorner=dt;exports.ResultsScrollAreaScrollbar=at;exports.ResultsScrollAreaThumb=ct;exports.ResultsScrollAreaViewport=ne;exports.ResultsTab=ie;exports.ResultsTabList=te;exports.Root=H;exports.TaglineBrandName=Ot;exports.TaglineContainer=Lt;exports.TaglineLogo=Ct;exports.TaglineText=yt;exports.Wrapper=N;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),P=require("../atoms/cmdk/index.cjs"),r=require("./factory.cjs"),I=require("../utils/misc.cjs"),l=require("react"),m=require("./embedded-search/search-provider.cjs"),Ue=require("./tagline-logo-icon.cjs"),E=require("../atoms/icons/custom-icon.cjs"),Ke=require("@radix-ui/react-scroll-area"),Qe=require("@radix-ui/react-tabs"),_=require("../providers/config-provider.cjs"),De=require("../providers/search-events-provider.cjs"),O=require("../atoms/link.cjs"),S=require("../providers/source-item-provider.cjs"),j=require("../atoms/icons/built-in-icon-renderer.cjs"),Fe=require("../utils/highlight-emphasis.cjs"),Ge=require("../hooks/use-scrolling-fades.cjs"),Ve=require("@inkeep/cxkit-color-mode"),We=require("../atoms/avatars/ai.cjs"),Q=require("./modal/modal-provider.cjs"),f=require("../utils/compose-refs.cjs"),A=require("../utils/compose-event-handlers.cjs"),$e=require("../atoms/shadow/context.cjs"),ze=require("../atoms/markdown/index.cjs"),q=require("../hooks/use-media-query.cjs"),Je=require("./embedded-search/use-search-filter.cjs"),K=require("./embedded-search/url-query.cjs"),T=require("../constants/search.cjs"),Xe=require("./modal/widget-auto-focus.cjs");function D(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const w=D(Ke),x=D(Qe),Ye=r.ikp("div",{_id:"aiSearchWrapper"}),F=e=>{const{searchSettings:{view:t}}=_.useInkeepConfig(),{isHidden:i,hasContent:s}=m.useSearch(),n=q.useMediaQuery("(max-width: 768px)"),c=Q.useModal();return a.jsx(Ye,{"data-hidden":I.dataAttr(i),"data-has-content":I.dataAttr(s),"data-in-modal":I.dataAttr(!!c),"data-mobile":I.dataAttr(n),"data-view":t,"data-dual-pane-search-expanded":I.dataAttr(s&&t==="dual-pane"&&!i),...e})},Ze=r.ikp("div",{_id:"aiSearchRoot"}),G=e=>{const{isHidden:t}=m.useSearch(),i=q.useMediaQuery("(max-width: 768px)");return a.jsx(Ze,{"data-hidden":I.dataAttr(t),"data-mobile":I.dataAttr(i),...e})},V=r.ikp(P.Command.List,{_id:"aiSearchContent"}),W=l.forwardRef((e,t)=>{const i=P.useCommandState(s=>s.value);return a.jsx(V,{"aria-activedescendant":`aiSearchResults__Item-${i}`,...e,ref:t})}),$=r.ikp("div",{_id:"aiSearchInputGroup"}),z=r.ikp(E.CustomIcon,{_id:"aiSearchInputIcon",iconKey:"search"}),et=r.ikp(P.Command.Input,{_id:"aiSearchInput"}),J=l.forwardRef(({onInput:e,...t},i)=>{const{inputRef:s,shouldAutoFocusInput:n}=m.useSearch(),c=P.useCommandState(h=>h.value),o=q.useMediaQuery("(max-width: 768px)"),{searchSettings:d}=_.useInkeepConfig(),u=l.useMemo(()=>d.placeholder||(o?"Search...":"Search for anything..."),[d.placeholder,o]),p=f.useComposedRefs(i,s);return Xe.useWidgetAutoFocus("search",s,n),Je.useSearchFetch(),a.jsx(et,{ref:p,placeholder:u,"aria-activedescendant":`aiSearchResults__Item-${c}`,...t})}),tt=r.ikp(j.BuiltInIconRenderer,{_id:"aiSearchLoading",iconSettings:{builtIn:"LuLoaderCircle"}}),X=e=>{const{loading:t}=m.useSearch();return t?a.jsx(tt,{...e}):null},it=r.ikp(P.Command.Item,{_id:"aiAskAITrigger",value:T.ASK_AI_TRIGGER_VALUE}),Y=e=>{const{results:t,tab:i}=m.useSearch(),s=P.useCommandStore(),n=t[i]?.[0]?.id??"NONE";return a.jsx(it,{...e,id:`aiSearchResults__Item-${T.ASK_AI_TRIGGER_VALUE}`,tabIndex:0,onPointerLeave:()=>s.setState("value",n,!0)})},rt=r.ikp("img",{_id:"aiAskAITrigger__Icon"}),Z=e=>{const{aiChatSettings:t}=_.useInkeepConfig(),{aiAssistantAvatar:i}=t??{},s=typeof i=="string"?i:i?.light,n=(typeof i=="string"?i:i?.dark)??s,c=Ve.useColorModeValue(s,n),[o,d]=l.useState(c);l.useEffect(()=>{d(c)},[c]);const u=()=>{d(null)};return a.jsx(rt,{asChild:!0,...e,children:o?a.jsx("img",{src:o,alt:"AI Avatar","data-type":"image",onError:A.composeEventHandlers(u),...e}):a.jsx(We.default,{"data-type":"icon",...e})})},ee=r.ikp("span",{_id:"aiAskAITrigger__Label"}),te=r.ikp("span",{_id:"aiAskAITrigger__Query"}),ie=r.ikp(E.CustomIcon,{_id:"aiAskAITrigger__Indicator",iconKey:"openLinkInSameTab"}),re=r.ikp("span",{_id:"aiAskAITrigger__IndicatorText"}),st=r.ikp(x.Root,{_id:"aiSearchResults"}),se=e=>{const{searchSettings:{view:t}}=_.useInkeepConfig(),{tab:i,setTab:s,hasContent:n,isHidden:c,disableTransition:o,results:d,defaultTab:u}=m.useSearch(),p=P.useCommandStore(),h=l.useCallback(v=>{o(),s(v);const R=d[v][0]?d[v][0]?.id:void 0;p.setState("value",R,!0)},[d,o]);return l.useEffect(()=>{let v=i in d?i:Object.keys(d)[0];if(!d[v]?.length){const g=Object.keys(d).find(k=>d[k]?.length);g?v=g:v=u}if(!v)return;s(v);const R=d[v]?.[0];R&&p.setState("value",R.id,!0)},[d]),a.jsx(st,{value:i,onValueChange:h,"data-has-content":I.dataAttr(n),"data-dual-pane-search-expanded":I.dataAttr(n&&t==="dual-pane"&&!c),...e})},nt=r.ikp("div",{_id:"aiSearchResults__Loading"}),ne=e=>{const{loading:t,resultsList:i}=m.useSearch();return!t||i.length>0?null:a.jsx(nt,{...e})},at=r.ikp(P.Command.Empty,{_id:"aiSearchResults__Empty"}),ae=e=>{const t=P.useCommandState(o=>o.search),{loading:i,results:s,tab:n}=m.useSearch(),c=s[n]?.length;return i||!t||c?null:a.jsx(at,{children:"No results found.",...e})},ct=r.ikp(x.List,{_id:"aiSearchResults__TabList"}),ce=e=>{const{children:t,...i}=e,{searchSettings:{tabs:s}}=_.useInkeepConfig(),{results:n,loading:c,resultsList:o}=m.useSearch();if(c&&o.length===0)return null;const d=Object.keys(n);return!s.length||!d.length?null:a.jsx(ct,{tabIndex:-1,children:I.maybeRender(t,d),...i})},dt=r.ikp(x.Trigger,{_id:"aiSearchResults__Tab"}),de=l.forwardRef((e,t)=>{const i=l.useRef(null),s=f.useComposedRefs(t,i),{tab:n,onClick:c,...o}=e,{results:d,tab:u,inputRef:p}=m.useSearch(),h=d[n].length,v=n===u,R=()=>{p.current?.focus()},g=$e.useShadow();return l.useEffect(()=>{v&&g?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab")&&i.current?.focus()},[v]),a.jsx(dt,{ref:s,"ikp-tab":"",tabIndex:v?0:-1,value:n,children:`${n} (${h})`,onClick:A.composeEventHandlers(c,R),...o})}),oe=r.ikp("div",{_id:"aiSearchResults__Content"}),ot=r.ikp(w.Root,{_id:"aiSearchResults__ScrollArea"}),ue=e=>{const{loading:t,resultsList:i}=m.useSearch();return t&&i.length===0?null:a.jsx(ot,{tabIndex:-1,...e})},ut=r.ikp(w.Viewport,{_id:"aiSearchResults__ScrollAreaViewport"}),le=l.forwardRef(({children:e,...t},i)=>{const s=Ge.useScrollingFades(),n=f.useComposedRefs(i,s),{tab:c}=m.useSearch();return l.useEffect(()=>{c&&s.current?.scrollTo({top:0,behavior:"auto"})},[c]),a.jsx(ut,{ref:n,tabIndex:-1,children:a.jsx("div",{tabIndex:-1,style:{display:"grid"},children:e}),...t})}),lt=r.ikp(w.ScrollAreaScrollbar,{_id:"aiSearchResults__ScrollAreaScrollbar"}),mt=r.ikp(w.ScrollAreaThumb,{_id:"aiSearchResults__ScrollAreaThumb"}),ht=r.ikp(w.Corner,{_id:"aiSearchResults__ScrollAreaCorner"}),It=r.ikp(x.Content,{_id:"aiSearchResults__List"}),me=e=>{const{children:t,...i}=e,{results:s,tab:n}=m.useSearch(),c=s[n]??[];return a.jsx(It,{value:n,"data-has-results":I.dataAttr(c.length>0),"aria-label":"Search results",children:I.maybeRender(t,c),tabIndex:-1,...i})},vt=r.ikp(P.Command.Item,{_id:"aiSearchResults__Item",asChild:!0}),he=l.forwardRef(({item:e,onClick:t,onSelect:i,children:s,...n},c)=>{const{searchSettings:{shouldOpenLinksInNewTab:o,view:d,searchQueryParamKey:u}}=_.useInkeepConfig(),{logEvent:p}=De.useSearchEvents(),h=P.useCommandState(b=>b.search),{transitionsDisabled:v}=m.useSearch(),R=P.useCommandState(b=>b.value),g=l.useRef(null),k=Q.useModal(),N=f.useComposedRefs(c,g),qe=l.useCallback(b=>{b.trigger==="keyboard"&&g.current?.click()},[]),Be=l.useCallback(b=>{p({eventName:"search_result_clicked",properties:{searchQuery:h,title:e.title,url:e.url}});const L=b.metaKey||b.ctrlKey,C=e.shouldOpenInNewTab!==void 0?e.shouldOpenInNewTab:o;L||C?b.preventDefault():k?.setOpen(!1)},[p,h,e.title,e.url,e.shouldOpenInNewTab,o,k]),y=l.useMemo(()=>e.shouldOpenInNewTab!==void 0?e.shouldOpenInNewTab:o,[e.shouldOpenInNewTab,o]),M=R===e.id,Ne=R==="NONE"||R===T.ASK_AI_TRIGGER_VALUE,Me=M||Ne,H=l.useCallback(b=>{const L=b.metaKey||b.ctrlKey,C=e.shouldOpenInNewTab!==void 0?e.shouldOpenInNewTab:o;if(L||C){b.preventDefault();const U=u?K.getUrlWithQuery(e.url,h,u):e.url;U&&window.open(U,"_blank","noopener")}else k?.setOpen(!1)},[e.url,e.shouldOpenInNewTab,o,u,h,k]),He=l.useMemo(()=>({href:u?K.getUrlWithQuery(e.url,h,u):e.url,isExternal:y,appendToUrl:e.appendToUrl,children:s,id:`aiSearchResults__Item-${e.id}`,onClick:H}),[e.url,y,e.appendToUrl,s,e.id,u,h,H]);return a.jsx(S.SourceItemProvider,{source:{...e,isExternal:y},children:a.jsx(vt,{ref:N,value:e.id,"data-type":e.type,"data-breadcrumbs":!!e.breadcrumbs?.length,"data-disable-transitions":I.dataAttr(v),"data-view":d,onSelect:A.composeEventHandlers(i,qe),onClick:A.composeEventHandlers(t,Be),"data-selected":I.dataAttr(M),tabIndex:Me?0:-1,...n,children:a.jsx(O.LinkWithQueryParams,{...He})})})}),St=r.ikp("div",{_id:"aiSearchResults__ItemBreadcrumbs"}),B=e=>{const{source:t}=S.useSourceItem(),{tab:i}=m.useSearch();if(!t.breadcrumbs?.length)return null;const{children:s,...n}=e,o=t.tabs?.find(d=>typeof d!="string"&&d[0]===i)?.[1]?.breadcrumbs??t.breadcrumbs??[];return a.jsx(St,{"aria-hidden":"true",children:I.maybeRender(s,o),...n})},Ie=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemBreadcrumbIcon",iconKey:"breadcrumbSeparator"}),bt=r.ikp(j.BuiltInIconRenderer,{_id:"aiSearchResults__ItemIcon"}),ve=e=>{const{source:t}=S.useSourceItem();return a.jsx(bt,{iconSettings:t.icon,"data-type":t.type,...e})},pt=r.ikp("span",{_id:"aiSearchResults__ItemTitle"}),Se=e=>{const{source:t}=S.useSourceItem();return a.jsx(pt,{"data-type":t.type,children:t.title,...e})},Pt=r.ikp("span",{_id:"aiSearchResults__ItemTag"}),be=e=>{const{source:t}=S.useSourceItem();return a.jsx(Pt,{"data-type":t.type,children:t.tag,...e})},Rt=r.ikp("span",{_id:"aiSearchResults__ItemDescription"}),pe=e=>{const{source:t}=S.useSourceItem(),{children:i,...s}=e,n=l.useMemo(()=>t.description?Fe.highlightEmphasis(t.description):[],[t.description]);return n.length?a.jsx(Rt,{"data-type":t.type,"aria-hidden":"true",children:I.maybeRender(i,n),...s}):null},_t=r.ikp("span",{_id:"aiSearchResults__ItemDescriptionPart"}),Pe=e=>{const{part:t,...i}=e,{source:s}=S.useSourceItem();return typeof t=="string"?t:a.jsx(_t,{"data-type":s.type,children:t.content,"data-highlighted":I.dataAttr(t.highlighted),...i})},gt=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemIndicator"}),Re=e=>{const{source:t}=S.useSourceItem(),{searchSettings:{view:i}}=_.useInkeepConfig();return a.jsx(gt,{iconKey:t.isExternal?"openLinkInNewTab":"openLinkInSameTab","data-view":i,...e})},kt=r.ikp("div",{_id:"aiSearchResults__ItemPreview","aria-hidden":!0}),_e=e=>{const{searchSettings:{view:t,shouldOpenLinksInNewTab:i}}=_.useInkeepConfig(),{results:s,tab:n}=m.useSearch(),c=P.useCommandState(h=>h.value),o=s[n]??[],d=l.useRef(null),u=l.useMemo(()=>{if(c===T.ASK_AI_TRIGGER_VALUE)return d.current;const h=o.find(v=>v.id===c);return d.current=h??null,h},[c]);if(t!=="dual-pane"||c===T.ASK_AI_TRIGGER_VALUE||!u)return null;const p=u.shouldOpenInNewTab!==void 0?u.shouldOpenInNewTab:i;return a.jsx(S.SourceItemProvider,{source:{...u,isExternal:p},children:a.jsx(kt,{...e})})},Et=r.ikp("div",{_id:"aiSearchResults__ItemPreview__Header"}),Tt=r.ikp(O.LinkWithQueryParams,{_id:"aiSearchResults__ItemPreview__Heading"}),ge=e=>{const{source:t}=S.useSourceItem();return a.jsx(Tt,{href:t.url,isExternal:t.isExternal,appendToUrl:t.appendToUrl,"data-type":t.type,...e})},wt=r.ikp("span",{_id:"aiSearchResults__ItemPreview__Title"}),ke=e=>{const{source:t}=S.useSourceItem();return a.jsx(wt,{children:t.title,...e})},At=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemPreview__Title__LinkIcon",iconKey:"openLinkInNewTab"}),Ee=e=>{const{source:t}=S.useSourceItem();return a.jsx(At,{iconKey:t.isExternal?"openLinkInNewTab":"openLinkInSameTab",...e})},ft=r.ikp(B,{_id:"aiSearchResults__ItemPreview__Breadcrumbs"}),Te=r.ikp(Ie,{_id:"aiSearchResults__ItemPreview__BreadcrumbIcon"}),xt=r.ikp(ze.Markdown,{_id:"aiSearchResults__ItemPreview__Body"}),we=e=>{const{source:t}=S.useSourceItem(),{resultsList:i}=m.useSearch(),s=i.find(c=>c.id===t.id),{searchSettings:{shouldOpenLinksInNewTab:n}}=_.useInkeepConfig();return s?a.jsx(xt,{shouldOpenLinksInNewTab:n,children:s.preview,...e}):null},yt=r.ikp("div",{_id:"aiSearchResults__ItemPreview__Outline"}),Ae=e=>{const{source:t}=S.useSourceItem(),{resultsList:i}=m.useSearch();return i.find(c=>c.id===t.id)?.rootRecord.topLevelHeadings?.length?a.jsx(yt,{...e}):null},fe=r.ikp("span",{_id:"aiSearchResults__ItemPreview__Outline__Title",children:"On this page"}),Lt=r.ikp("ul",{_id:"aiSearchResults__ItemPreview__Outline__List"}),xe=e=>{const{source:t}=S.useSourceItem(),{resultsList:i}=m.useSearch(),s=i.find(u=>u.id===t.id),n=s?.rootRecord.topLevelHeadings;if(!n?.length)return null;const c=n.map(u=>{const p=u?.anchor&&u?.anchor===s?.content?.anchor,h=u?.anchor===s?.pathHeadings?.[0]?.anchor;return{...u,isMatch:p||h}}),{children:o,...d}=e;return a.jsx(Lt,{children:I.maybeRender(o,c),...d})},Ct=r.ikp(O.LinkWithQueryParams,{_id:"aiSearchResults__ItemPreview__Outline__Item"}),ye=e=>{const{searchSettings:{shouldOpenLinksInNewTab:t}}=_.useInkeepConfig();return a.jsx(Ct,{isExternal:t,...e})},Le=r.ikp(E.CustomIcon,{_id:"aiSearchResults__ItemPreview__Outline__ItemIcon",iconKey:"newLine"}),Ot=r.ikp("span",{_id:"aiSearchResults__ItemPreview__Outline__ItemText"}),Ce=e=>a.jsx(Ot,{...e}),Oe=r.ikp(j.BuiltInIconRenderer,{_id:"aiSearchResults__ItemPreview__Outline__ItemLinkIcon",iconSettings:{builtIn:"LuLink"}}),jt=r.ikp("div",{_id:"aiSearchFooter"}),je=e=>{const{hasContent:t}=m.useSearch();return a.jsx(jt,{"data-has-results":I.dataAttr(t),...e})},qt=r.ikp("div",{_id:"aiSearchTagline__Container"}),Bt=r.ikp("span",{_id:"aiSearchTagline__Text",children:"Powered by"}),Nt=r.ikp(Ue.default,{_id:"aiSearchTagline__Logo"}),Mt=r.ikp("a",{_id:"aiSearchTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"});exports.Provider=m.SearchProvider;exports.AskAITrigger=Y;exports.AskAITriggerIcon=Z;exports.AskAITriggerIndicator=ie;exports.AskAITriggerIndicatorText=re;exports.AskAITriggerLabel=ee;exports.AskAITriggerQuery=te;exports.Content=W;exports.EmbeddedSearchInputIcon=z;exports.EmbeddedSearchPrimitiveAskAITrigger=Y;exports.EmbeddedSearchPrimitiveAskAITriggerIcon=Z;exports.EmbeddedSearchPrimitiveAskAITriggerIndicator=ie;exports.EmbeddedSearchPrimitiveAskAITriggerIndicatorText=re;exports.EmbeddedSearchPrimitiveAskAITriggerLabel=ee;exports.EmbeddedSearchPrimitiveAskAITriggerQuery=te;exports.EmbeddedSearchPrimitiveContent=W;exports.EmbeddedSearchPrimitiveFooter=je;exports.EmbeddedSearchPrimitiveInput=J;exports.EmbeddedSearchPrimitiveInputGroup=$;exports.EmbeddedSearchPrimitiveLoading=X;exports.EmbeddedSearchPrimitiveResults=se;exports.EmbeddedSearchPrimitiveResultsContent=oe;exports.EmbeddedSearchPrimitiveResultsEmpty=ae;exports.EmbeddedSearchPrimitiveResultsItem=he;exports.EmbeddedSearchPrimitiveResultsItemBreadcrumbs=B;exports.EmbeddedSearchPrimitiveResultsItemDescription=pe;exports.EmbeddedSearchPrimitiveResultsItemDescriptionPart=Pe;exports.EmbeddedSearchPrimitiveResultsItemIcon=ve;exports.EmbeddedSearchPrimitiveResultsItemIndicator=Re;exports.EmbeddedSearchPrimitiveResultsItemPreview=_e;exports.EmbeddedSearchPrimitiveResultsItemPreviewBody=we;exports.EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon=Te;exports.EmbeddedSearchPrimitiveResultsItemPreviewHeading=ge;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutline=Ae;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem=ye;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon=Le;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon=Oe;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText=Ce;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineList=xe;exports.EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle=fe;exports.EmbeddedSearchPrimitiveResultsItemPreviewTitle=ke;exports.EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon=Ee;exports.EmbeddedSearchPrimitiveResultsItemTag=be;exports.EmbeddedSearchPrimitiveResultsItemTitle=Se;exports.EmbeddedSearchPrimitiveResultsList=me;exports.EmbeddedSearchPrimitiveResultsLoading=ne;exports.EmbeddedSearchPrimitiveResultsScrollArea=ue;exports.EmbeddedSearchPrimitiveResultsScrollAreaViewport=le;exports.EmbeddedSearchPrimitiveResultsTab=de;exports.EmbeddedSearchPrimitiveResultsTabList=ce;exports.EmbeddedSearchPrimitiveRoot=G;exports.EmbeddedSearchPrimitiveWrapper=F;exports.Footer=je;exports.Input=J;exports.InputGroup=$;exports.InputIcon=z;exports.Loading=X;exports.PrimitiveContent=V;exports.Results=se;exports.ResultsContent=oe;exports.ResultsEmpty=ae;exports.ResultsItem=he;exports.ResultsItemBreadcrumbIcon=Ie;exports.ResultsItemBreadcrumbs=B;exports.ResultsItemDescription=pe;exports.ResultsItemDescriptionPart=Pe;exports.ResultsItemIcon=ve;exports.ResultsItemIndicator=Re;exports.ResultsItemPreview=_e;exports.ResultsItemPreviewBody=we;exports.ResultsItemPreviewBreadcrumbIcon=Te;exports.ResultsItemPreviewBreadcrumbs=ft;exports.ResultsItemPreviewHeader=Et;exports.ResultsItemPreviewHeading=ge;exports.ResultsItemPreviewOutline=Ae;exports.ResultsItemPreviewOutlineItem=ye;exports.ResultsItemPreviewOutlineItemIcon=Le;exports.ResultsItemPreviewOutlineItemLinkIcon=Oe;exports.ResultsItemPreviewOutlineItemText=Ce;exports.ResultsItemPreviewOutlineList=xe;exports.ResultsItemPreviewOutlineTitle=fe;exports.ResultsItemPreviewTitle=ke;exports.ResultsItemPreviewTitleLinkIcon=Ee;exports.ResultsItemTag=be;exports.ResultsItemTitle=Se;exports.ResultsList=me;exports.ResultsLoading=ne;exports.ResultsScrollArea=ue;exports.ResultsScrollAreaCorner=ht;exports.ResultsScrollAreaScrollbar=lt;exports.ResultsScrollAreaThumb=mt;exports.ResultsScrollAreaViewport=le;exports.ResultsTab=de;exports.ResultsTabList=ce;exports.Root=G;exports.TaglineBrandName=Mt;exports.TaglineContainer=qt;exports.TaglineLogo=Nt;exports.TaglineText=Bt;exports.Wrapper=F;
|
|
@@ -1,229 +1,229 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { Command as
|
|
4
|
-
import { ikp as
|
|
5
|
-
import { dataAttr as
|
|
6
|
-
import { forwardRef as
|
|
3
|
+
import { Command as E, useCommandState as g, useCommandStore as j } from "../atoms/cmdk/index.js";
|
|
4
|
+
import { ikp as i } from "./factory.js";
|
|
5
|
+
import { dataAttr as v, maybeRender as A } from "../utils/misc.js";
|
|
6
|
+
import { forwardRef as k, useMemo as w, useState as ee, useEffect as C, useCallback as y, useRef as K } from "react";
|
|
7
7
|
import { useSearch as u } from "./embedded-search/search-provider.js";
|
|
8
|
-
import { SearchProvider as
|
|
9
|
-
import
|
|
10
|
-
import { CustomIcon as
|
|
8
|
+
import { SearchProvider as Rr } from "./embedded-search/search-provider.js";
|
|
9
|
+
import te from "./tagline-logo-icon.js";
|
|
10
|
+
import { CustomIcon as T } from "../atoms/icons/custom-icon.js";
|
|
11
11
|
import * as L from "@radix-ui/react-scroll-area";
|
|
12
|
-
import * as
|
|
13
|
-
import { useInkeepConfig as
|
|
14
|
-
import { useSearchEvents as
|
|
15
|
-
import { LinkWithQueryParams as
|
|
16
|
-
import { SourceItemProvider as
|
|
17
|
-
import { BuiltInIconRenderer as
|
|
18
|
-
import { highlightEmphasis as
|
|
19
|
-
import { useScrollingFades as
|
|
20
|
-
import { useColorModeValue as
|
|
21
|
-
import
|
|
22
|
-
import { useModal as
|
|
23
|
-
import { useComposedRefs as
|
|
24
|
-
import { composeEventHandlers as
|
|
25
|
-
import { useShadow as
|
|
26
|
-
import { Markdown as
|
|
12
|
+
import * as x from "@radix-ui/react-tabs";
|
|
13
|
+
import { useInkeepConfig as S } from "../providers/config-provider.js";
|
|
14
|
+
import { useSearchEvents as re } from "../providers/search-events-provider.js";
|
|
15
|
+
import { LinkWithQueryParams as U } from "../atoms/link.js";
|
|
16
|
+
import { SourceItemProvider as q, useSourceItem as p } from "../providers/source-item-provider.js";
|
|
17
|
+
import { BuiltInIconRenderer as D } from "../atoms/icons/built-in-icon-renderer.js";
|
|
18
|
+
import { highlightEmphasis as ie } from "../utils/highlight-emphasis.js";
|
|
19
|
+
import { useScrollingFades as se } from "../hooks/use-scrolling-fades.js";
|
|
20
|
+
import { useColorModeValue as ne } from "@inkeep/cxkit-color-mode";
|
|
21
|
+
import ae from "../atoms/avatars/ai.js";
|
|
22
|
+
import { useModal as z } from "./modal/modal-provider.js";
|
|
23
|
+
import { useComposedRefs as N } from "../utils/compose-refs.js";
|
|
24
|
+
import { composeEventHandlers as O } from "../utils/compose-event-handlers.js";
|
|
25
|
+
import { useShadow as oe } from "../atoms/shadow/context.js";
|
|
26
|
+
import { Markdown as ce } from "../atoms/markdown/index.js";
|
|
27
27
|
import { useMediaQuery as F } from "../hooks/use-media-query.js";
|
|
28
|
-
import { useSearchFetch as
|
|
29
|
-
import { getUrlWithQuery as
|
|
30
|
-
import { ASK_AI_TRIGGER_VALUE as
|
|
31
|
-
import { useWidgetAutoFocus as
|
|
32
|
-
const
|
|
28
|
+
import { useSearchFetch as le } from "./embedded-search/use-search-filter.js";
|
|
29
|
+
import { getUrlWithQuery as G } from "./embedded-search/url-query.js";
|
|
30
|
+
import { ASK_AI_TRIGGER_VALUE as f } from "../constants/search.js";
|
|
31
|
+
import { useWidgetAutoFocus as de } from "./modal/widget-auto-focus.js";
|
|
32
|
+
const ue = i("div", {
|
|
33
33
|
_id: "aiSearchWrapper"
|
|
34
|
-
}),
|
|
34
|
+
}), Rt = (e) => {
|
|
35
35
|
const {
|
|
36
36
|
searchSettings: { view: t }
|
|
37
|
-
} =
|
|
37
|
+
} = S(), { isHidden: r, hasContent: s } = u(), n = F("(max-width: 768px)"), o = z();
|
|
38
38
|
return /* @__PURE__ */ a(
|
|
39
|
-
|
|
39
|
+
ue,
|
|
40
40
|
{
|
|
41
|
-
"data-hidden":
|
|
42
|
-
"data-has-content":
|
|
43
|
-
"data-in-modal":
|
|
44
|
-
"data-mobile":
|
|
41
|
+
"data-hidden": v(r),
|
|
42
|
+
"data-has-content": v(s),
|
|
43
|
+
"data-in-modal": v(!!o),
|
|
44
|
+
"data-mobile": v(n),
|
|
45
45
|
"data-view": t,
|
|
46
|
-
"data-dual-pane-search-expanded":
|
|
46
|
+
"data-dual-pane-search-expanded": v(s && t === "dual-pane" && !r),
|
|
47
47
|
...e
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
},
|
|
50
|
+
}, me = i("div", {
|
|
51
51
|
_id: "aiSearchRoot"
|
|
52
|
-
}),
|
|
53
|
-
const { isHidden: t } = u(),
|
|
54
|
-
return /* @__PURE__ */ a(
|
|
55
|
-
},
|
|
52
|
+
}), Pt = (e) => {
|
|
53
|
+
const { isHidden: t } = u(), r = F("(max-width: 768px)");
|
|
54
|
+
return /* @__PURE__ */ a(me, { "data-hidden": v(t), "data-mobile": v(r), ...e });
|
|
55
|
+
}, he = i(E.List, {
|
|
56
56
|
_id: "aiSearchContent"
|
|
57
|
-
}),
|
|
58
|
-
const
|
|
57
|
+
}), gt = k((e, t) => {
|
|
58
|
+
const r = g((s) => s.value);
|
|
59
59
|
return /* @__PURE__ */ a(
|
|
60
|
-
|
|
60
|
+
he,
|
|
61
61
|
{
|
|
62
|
-
"aria-activedescendant": `aiSearchResults__Item-${
|
|
62
|
+
"aria-activedescendant": `aiSearchResults__Item-${r}`,
|
|
63
63
|
...e,
|
|
64
64
|
ref: t
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
}),
|
|
67
|
+
}), Tt = i("div", {
|
|
68
68
|
_id: "aiSearchInputGroup"
|
|
69
|
-
}),
|
|
69
|
+
}), wt = i(T, {
|
|
70
70
|
_id: "aiSearchInputIcon",
|
|
71
71
|
iconKey: "search"
|
|
72
|
-
}),
|
|
72
|
+
}), Ie = i(E.Input, {
|
|
73
73
|
_id: "aiSearchInput"
|
|
74
|
-
}),
|
|
75
|
-
const { inputRef: s, shouldAutoFocusInput: n } = u(), o =
|
|
76
|
-
() => c.placeholder || (
|
|
77
|
-
[c.placeholder,
|
|
78
|
-
),
|
|
79
|
-
return
|
|
80
|
-
|
|
74
|
+
}), ft = k(({ onInput: e, ...t }, r) => {
|
|
75
|
+
const { inputRef: s, shouldAutoFocusInput: n } = u(), o = g((m) => m.value), l = F("(max-width: 768px)"), { searchSettings: c } = S(), d = w(
|
|
76
|
+
() => c.placeholder || (l ? "Search..." : "Search for anything..."),
|
|
77
|
+
[c.placeholder, l]
|
|
78
|
+
), _ = N(r, s);
|
|
79
|
+
return de("search", s, n), le(), /* @__PURE__ */ a(
|
|
80
|
+
Ie,
|
|
81
81
|
{
|
|
82
|
-
ref:
|
|
83
|
-
placeholder:
|
|
82
|
+
ref: _,
|
|
83
|
+
placeholder: d,
|
|
84
84
|
"aria-activedescendant": `aiSearchResults__Item-${o}`,
|
|
85
85
|
...t
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
|
-
}),
|
|
88
|
+
}), ve = i(D, {
|
|
89
89
|
_id: "aiSearchLoading",
|
|
90
90
|
iconSettings: {
|
|
91
91
|
builtIn: "LuLoaderCircle"
|
|
92
92
|
}
|
|
93
|
-
}),
|
|
93
|
+
}), Et = (e) => {
|
|
94
94
|
const { loading: t } = u();
|
|
95
|
-
return t ? /* @__PURE__ */ a(
|
|
96
|
-
},
|
|
95
|
+
return t ? /* @__PURE__ */ a(ve, { ...e }) : null;
|
|
96
|
+
}, _e = i(E.Item, {
|
|
97
97
|
_id: "aiAskAITrigger",
|
|
98
|
-
value:
|
|
99
|
-
}),
|
|
100
|
-
const { results: t, tab:
|
|
98
|
+
value: f
|
|
99
|
+
}), At = (e) => {
|
|
100
|
+
const { results: t, tab: r } = u(), s = j(), n = t[r]?.[0]?.id ?? "NONE";
|
|
101
101
|
return /* @__PURE__ */ a(
|
|
102
|
-
|
|
102
|
+
_e,
|
|
103
103
|
{
|
|
104
104
|
...e,
|
|
105
|
-
id: `aiSearchResults__Item-${
|
|
105
|
+
id: `aiSearchResults__Item-${f}`,
|
|
106
106
|
tabIndex: 0,
|
|
107
107
|
onPointerLeave: () => s.setState("value", n, !0)
|
|
108
108
|
}
|
|
109
109
|
);
|
|
110
|
-
},
|
|
110
|
+
}, pe = i("img", {
|
|
111
111
|
_id: "aiAskAITrigger__Icon"
|
|
112
|
-
}),
|
|
113
|
-
const { aiChatSettings: t } =
|
|
114
|
-
return
|
|
112
|
+
}), kt = (e) => {
|
|
113
|
+
const { aiChatSettings: t } = S(), { aiAssistantAvatar: r } = t ?? {}, s = typeof r == "string" ? r : r?.light, n = (typeof r == "string" ? r : r?.dark) ?? s, o = ne(s, n), [l, c] = ee(o);
|
|
114
|
+
return C(() => {
|
|
115
115
|
c(o);
|
|
116
|
-
}, [o]), /* @__PURE__ */ a(
|
|
116
|
+
}, [o]), /* @__PURE__ */ a(pe, { asChild: !0, ...e, children: l ? (
|
|
117
117
|
// biome-ignore lint/a11y/useAltText: <explanation>
|
|
118
118
|
/* @__PURE__ */ a(
|
|
119
119
|
"img",
|
|
120
120
|
{
|
|
121
|
-
src:
|
|
121
|
+
src: l,
|
|
122
122
|
alt: "AI Avatar",
|
|
123
123
|
"data-type": "image",
|
|
124
|
-
onError:
|
|
124
|
+
onError: O(() => {
|
|
125
125
|
c(null);
|
|
126
126
|
}),
|
|
127
127
|
...e
|
|
128
128
|
}
|
|
129
129
|
)
|
|
130
|
-
) : /* @__PURE__ */ a(
|
|
131
|
-
},
|
|
130
|
+
) : /* @__PURE__ */ a(ae, { "data-type": "icon", ...e }) });
|
|
131
|
+
}, Lt = i("span", {
|
|
132
132
|
_id: "aiAskAITrigger__Label"
|
|
133
|
-
}),
|
|
133
|
+
}), yt = i("span", {
|
|
134
134
|
_id: "aiAskAITrigger__Query"
|
|
135
|
-
}),
|
|
135
|
+
}), Ot = i(T, {
|
|
136
136
|
_id: "aiAskAITrigger__Indicator",
|
|
137
137
|
iconKey: "openLinkInSameTab"
|
|
138
|
-
}),
|
|
138
|
+
}), Ct = i("span", {
|
|
139
139
|
_id: "aiAskAITrigger__IndicatorText"
|
|
140
|
-
}),
|
|
140
|
+
}), be = i(x.Root, {
|
|
141
141
|
_id: "aiSearchResults"
|
|
142
|
-
}),
|
|
142
|
+
}), xt = (e) => {
|
|
143
143
|
const {
|
|
144
144
|
searchSettings: { view: t }
|
|
145
|
-
} =
|
|
146
|
-
(
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
145
|
+
} = S(), { tab: r, setTab: s, hasContent: n, isHidden: o, disableTransition: l, results: c, defaultTab: d } = u(), _ = j(), m = y(
|
|
146
|
+
(h) => {
|
|
147
|
+
l(), s(h);
|
|
148
|
+
const b = c[h][0] ? c[h][0]?.id : void 0;
|
|
149
|
+
_.setState("value", b, !0);
|
|
150
150
|
},
|
|
151
|
-
[c,
|
|
151
|
+
[c, l]
|
|
152
152
|
);
|
|
153
|
-
return
|
|
154
|
-
let
|
|
155
|
-
if (!c[
|
|
156
|
-
const
|
|
157
|
-
|
|
153
|
+
return C(() => {
|
|
154
|
+
let h = r in c ? r : Object.keys(c)[0];
|
|
155
|
+
if (!c[h]?.length) {
|
|
156
|
+
const R = Object.keys(c).find((P) => c[P]?.length);
|
|
157
|
+
R ? h = R : h = d;
|
|
158
158
|
}
|
|
159
|
-
if (!
|
|
160
|
-
s(
|
|
161
|
-
const
|
|
162
|
-
|
|
159
|
+
if (!h) return;
|
|
160
|
+
s(h);
|
|
161
|
+
const b = c[h]?.[0];
|
|
162
|
+
b && _.setState("value", b.id, !0);
|
|
163
163
|
}, [c]), /* @__PURE__ */ a(
|
|
164
|
-
|
|
164
|
+
be,
|
|
165
165
|
{
|
|
166
|
-
value:
|
|
167
|
-
onValueChange:
|
|
168
|
-
"data-has-content":
|
|
169
|
-
"data-dual-pane-search-expanded":
|
|
166
|
+
value: r,
|
|
167
|
+
onValueChange: m,
|
|
168
|
+
"data-has-content": v(n),
|
|
169
|
+
"data-dual-pane-search-expanded": v(n && t === "dual-pane" && !o),
|
|
170
170
|
...e
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
|
-
},
|
|
173
|
+
}, Se = i("div", {
|
|
174
174
|
_id: "aiSearchResults__Loading"
|
|
175
|
-
}),
|
|
176
|
-
const { loading: t, resultsList:
|
|
177
|
-
return !t ||
|
|
178
|
-
},
|
|
175
|
+
}), Nt = (e) => {
|
|
176
|
+
const { loading: t, resultsList: r } = u();
|
|
177
|
+
return !t || r.length > 0 ? null : /* @__PURE__ */ a(Se, { ...e });
|
|
178
|
+
}, Re = i(E.Empty, {
|
|
179
179
|
_id: "aiSearchResults__Empty"
|
|
180
|
-
}),
|
|
181
|
-
const t =
|
|
182
|
-
return
|
|
183
|
-
},
|
|
180
|
+
}), Bt = (e) => {
|
|
181
|
+
const t = g((l) => l.search), { loading: r, results: s, tab: n } = u(), o = s[n]?.length;
|
|
182
|
+
return r || !t || o ? null : /* @__PURE__ */ a(Re, { children: "No results found.", ...e });
|
|
183
|
+
}, Pe = i(x.List, {
|
|
184
184
|
_id: "aiSearchResults__TabList"
|
|
185
|
-
}),
|
|
186
|
-
const { children: t, ...
|
|
185
|
+
}), Ht = (e) => {
|
|
186
|
+
const { children: t, ...r } = e, {
|
|
187
187
|
searchSettings: { tabs: s }
|
|
188
|
-
} =
|
|
189
|
-
if (o &&
|
|
188
|
+
} = S(), { results: n, loading: o, resultsList: l } = u();
|
|
189
|
+
if (o && l.length === 0) return null;
|
|
190
190
|
const c = Object.keys(n);
|
|
191
|
-
return !s.length || !c.length ? null : /* @__PURE__ */ a(
|
|
192
|
-
},
|
|
191
|
+
return !s.length || !c.length ? null : /* @__PURE__ */ a(Pe, { tabIndex: -1, children: A(t, c), ...r });
|
|
192
|
+
}, ge = i(x.Trigger, {
|
|
193
193
|
_id: "aiSearchResults__Tab"
|
|
194
|
-
}),
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
return
|
|
199
|
-
|
|
200
|
-
}, [
|
|
201
|
-
|
|
194
|
+
}), Mt = k((e, t) => {
|
|
195
|
+
const r = K(null), s = N(t, r), { tab: n, onClick: o, ...l } = e, { results: c, tab: d, inputRef: _ } = u(), m = c[n].length, h = n === d, b = () => {
|
|
196
|
+
_.current?.focus();
|
|
197
|
+
}, R = oe();
|
|
198
|
+
return C(() => {
|
|
199
|
+
h && R?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab") && r.current?.focus();
|
|
200
|
+
}, [h]), /* @__PURE__ */ a(
|
|
201
|
+
ge,
|
|
202
202
|
{
|
|
203
203
|
ref: s,
|
|
204
204
|
"ikp-tab": "",
|
|
205
|
-
tabIndex:
|
|
205
|
+
tabIndex: h ? 0 : -1,
|
|
206
206
|
value: n,
|
|
207
|
-
children: `${n} (${
|
|
208
|
-
onClick:
|
|
209
|
-
...
|
|
207
|
+
children: `${n} (${m})`,
|
|
208
|
+
onClick: O(o, b),
|
|
209
|
+
...l
|
|
210
210
|
}
|
|
211
211
|
);
|
|
212
|
-
}),
|
|
212
|
+
}), Kt = i("div", {
|
|
213
213
|
_id: "aiSearchResults__Content"
|
|
214
|
-
}),
|
|
214
|
+
}), Te = i(L.Root, {
|
|
215
215
|
_id: "aiSearchResults__ScrollArea"
|
|
216
|
-
}),
|
|
217
|
-
const { loading: t, resultsList:
|
|
218
|
-
return t &&
|
|
219
|
-
},
|
|
216
|
+
}), Ut = (e) => {
|
|
217
|
+
const { loading: t, resultsList: r } = u();
|
|
218
|
+
return t && r.length === 0 ? null : /* @__PURE__ */ a(Te, { tabIndex: -1, ...e });
|
|
219
|
+
}, we = i(L.Viewport, {
|
|
220
220
|
_id: "aiSearchResults__ScrollAreaViewport"
|
|
221
|
-
}),
|
|
222
|
-
const s =
|
|
223
|
-
return
|
|
221
|
+
}), Dt = k(({ children: e, ...t }, r) => {
|
|
222
|
+
const s = se(), n = N(r, s), { tab: o } = u();
|
|
223
|
+
return C(() => {
|
|
224
224
|
o && s.current?.scrollTo({ top: 0, behavior: "auto" });
|
|
225
225
|
}, [o]), /* @__PURE__ */ a(
|
|
226
|
-
|
|
226
|
+
we,
|
|
227
227
|
{
|
|
228
228
|
ref: n,
|
|
229
229
|
tabIndex: -1,
|
|
@@ -234,168 +234,202 @@ const ae = r("div", {
|
|
|
234
234
|
...t
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
|
-
}),
|
|
237
|
+
}), Ft = i(
|
|
238
238
|
L.ScrollAreaScrollbar,
|
|
239
239
|
{
|
|
240
240
|
_id: "aiSearchResults__ScrollAreaScrollbar"
|
|
241
241
|
}
|
|
242
|
-
),
|
|
242
|
+
), Qt = i(L.ScrollAreaThumb, {
|
|
243
243
|
_id: "aiSearchResults__ScrollAreaThumb"
|
|
244
|
-
}),
|
|
244
|
+
}), Vt = i(L.Corner, {
|
|
245
245
|
_id: "aiSearchResults__ScrollAreaCorner"
|
|
246
|
-
}),
|
|
246
|
+
}), fe = i(x.Content, {
|
|
247
247
|
_id: "aiSearchResults__List"
|
|
248
|
-
}),
|
|
249
|
-
const { children: t, ...
|
|
248
|
+
}), Wt = (e) => {
|
|
249
|
+
const { children: t, ...r } = e, { results: s, tab: n } = u(), o = s[n] ?? [];
|
|
250
250
|
return /* @__PURE__ */ a(
|
|
251
|
-
|
|
251
|
+
fe,
|
|
252
252
|
{
|
|
253
253
|
value: n,
|
|
254
|
-
"data-has-results":
|
|
254
|
+
"data-has-results": v(o.length > 0),
|
|
255
255
|
"aria-label": "Search results",
|
|
256
|
-
children:
|
|
256
|
+
children: A(t, o),
|
|
257
257
|
tabIndex: -1,
|
|
258
|
-
...
|
|
258
|
+
...r
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
|
-
},
|
|
261
|
+
}, Ee = i(E.Item, {
|
|
262
262
|
_id: "aiSearchResults__Item",
|
|
263
263
|
asChild: !0
|
|
264
|
-
}),
|
|
264
|
+
}), $t = k(({ item: e, onClick: t, onSelect: r, children: s, ...n }, o) => {
|
|
265
265
|
const {
|
|
266
|
-
searchSettings: { shouldOpenLinksInNewTab:
|
|
267
|
-
} =
|
|
268
|
-
|
|
269
|
-
}, []),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
266
|
+
searchSettings: { shouldOpenLinksInNewTab: l, view: c, searchQueryParamKey: d }
|
|
267
|
+
} = S(), { logEvent: _ } = re(), m = g((I) => I.search), { transitionsDisabled: h } = u(), b = g((I) => I.value), R = K(null), P = z(), Q = N(o, R), J = y((I) => {
|
|
268
|
+
I.trigger === "keyboard" && R.current?.click();
|
|
269
|
+
}, []), X = y(
|
|
270
|
+
(I) => {
|
|
271
|
+
_({
|
|
272
|
+
eventName: "search_result_clicked",
|
|
273
|
+
properties: {
|
|
274
|
+
searchQuery: m,
|
|
275
|
+
title: e.title,
|
|
276
|
+
url: e.url
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
const H = I.metaKey || I.ctrlKey, M = e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : l;
|
|
280
|
+
H || M ? I.preventDefault() : P?.setOpen(!1);
|
|
281
|
+
},
|
|
282
|
+
[
|
|
283
|
+
_,
|
|
284
|
+
m,
|
|
285
|
+
e.title,
|
|
286
|
+
e.url,
|
|
287
|
+
e.shouldOpenInNewTab,
|
|
288
|
+
l,
|
|
289
|
+
P
|
|
290
|
+
]
|
|
291
|
+
), B = w(
|
|
292
|
+
() => e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : l,
|
|
293
|
+
[e.shouldOpenInNewTab, l]
|
|
294
|
+
), V = b === e.id, Y = V || (b === "NONE" || b === f), W = y(
|
|
295
|
+
(I) => {
|
|
296
|
+
const H = I.metaKey || I.ctrlKey, M = e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : l;
|
|
297
|
+
if (H || M) {
|
|
298
|
+
I.preventDefault();
|
|
299
|
+
const $ = d ? G(e.url, m, d) : e.url;
|
|
300
|
+
$ && window.open($, "_blank", "noopener");
|
|
301
|
+
} else
|
|
302
|
+
P?.setOpen(!1);
|
|
303
|
+
},
|
|
304
|
+
[e.url, e.shouldOpenInNewTab, l, d, m, P]
|
|
305
|
+
), Z = w(() => ({
|
|
306
|
+
href: d ? G(e.url, m, d) : e.url,
|
|
283
307
|
isExternal: B,
|
|
284
308
|
appendToUrl: e.appendToUrl,
|
|
285
309
|
children: s,
|
|
286
|
-
id: `aiSearchResults__Item-${e.id}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
310
|
+
id: `aiSearchResults__Item-${e.id}`,
|
|
311
|
+
onClick: W
|
|
312
|
+
}), [
|
|
313
|
+
e.url,
|
|
314
|
+
B,
|
|
315
|
+
e.appendToUrl,
|
|
316
|
+
s,
|
|
317
|
+
e.id,
|
|
318
|
+
d,
|
|
319
|
+
m,
|
|
320
|
+
W
|
|
321
|
+
]);
|
|
322
|
+
return /* @__PURE__ */ a(q, { source: { ...e, isExternal: B }, children: /* @__PURE__ */ a(
|
|
323
|
+
Ee,
|
|
290
324
|
{
|
|
291
|
-
ref:
|
|
325
|
+
ref: Q,
|
|
292
326
|
value: e.id,
|
|
293
327
|
"data-type": e.type,
|
|
294
328
|
"data-breadcrumbs": !!e.breadcrumbs?.length,
|
|
295
|
-
"data-disable-transitions":
|
|
329
|
+
"data-disable-transitions": v(h),
|
|
296
330
|
"data-view": c,
|
|
297
|
-
onSelect:
|
|
298
|
-
onClick:
|
|
299
|
-
"data-selected":
|
|
300
|
-
tabIndex:
|
|
331
|
+
onSelect: O(r, J),
|
|
332
|
+
onClick: O(t, X),
|
|
333
|
+
"data-selected": v(V),
|
|
334
|
+
tabIndex: Y ? 0 : -1,
|
|
301
335
|
...n,
|
|
302
|
-
children: /* @__PURE__ */ a(
|
|
336
|
+
children: /* @__PURE__ */ a(U, { ...Z })
|
|
303
337
|
}
|
|
304
338
|
) });
|
|
305
|
-
}),
|
|
339
|
+
}), Ae = i("div", {
|
|
306
340
|
_id: "aiSearchResults__ItemBreadcrumbs"
|
|
307
|
-
}),
|
|
308
|
-
const { source: t } =
|
|
341
|
+
}), ke = (e) => {
|
|
342
|
+
const { source: t } = p(), { tab: r } = u();
|
|
309
343
|
if (!t.breadcrumbs?.length) return null;
|
|
310
|
-
const { children: s, ...n } = e,
|
|
344
|
+
const { children: s, ...n } = e, l = t.tabs?.find((c) => typeof c != "string" && c[0] === r)?.[1]?.breadcrumbs ?? t.breadcrumbs ?? [];
|
|
311
345
|
return /* @__PURE__ */ a(
|
|
312
|
-
|
|
346
|
+
Ae,
|
|
313
347
|
{
|
|
314
348
|
"aria-hidden": "true",
|
|
315
|
-
children:
|
|
349
|
+
children: A(s, l),
|
|
316
350
|
...n
|
|
317
351
|
}
|
|
318
352
|
);
|
|
319
|
-
},
|
|
353
|
+
}, Le = i(T, {
|
|
320
354
|
_id: "aiSearchResults__ItemBreadcrumbIcon",
|
|
321
355
|
iconKey: "breadcrumbSeparator"
|
|
322
|
-
}),
|
|
356
|
+
}), ye = i(D, {
|
|
323
357
|
_id: "aiSearchResults__ItemIcon"
|
|
324
|
-
}),
|
|
325
|
-
const { source: t } =
|
|
326
|
-
return /* @__PURE__ */ a(
|
|
327
|
-
},
|
|
358
|
+
}), Gt = (e) => {
|
|
359
|
+
const { source: t } = p();
|
|
360
|
+
return /* @__PURE__ */ a(ye, { iconSettings: t.icon, "data-type": t.type, ...e });
|
|
361
|
+
}, Oe = i("span", {
|
|
328
362
|
_id: "aiSearchResults__ItemTitle"
|
|
329
|
-
}),
|
|
330
|
-
const { source: t } =
|
|
331
|
-
return /* @__PURE__ */ a(
|
|
332
|
-
},
|
|
363
|
+
}), jt = (e) => {
|
|
364
|
+
const { source: t } = p();
|
|
365
|
+
return /* @__PURE__ */ a(Oe, { "data-type": t.type, children: t.title, ...e });
|
|
366
|
+
}, Ce = i("span", {
|
|
333
367
|
_id: "aiSearchResults__ItemTag"
|
|
334
|
-
}),
|
|
335
|
-
const { source: t } =
|
|
336
|
-
return /* @__PURE__ */ a(
|
|
337
|
-
},
|
|
368
|
+
}), qt = (e) => {
|
|
369
|
+
const { source: t } = p();
|
|
370
|
+
return /* @__PURE__ */ a(Ce, { "data-type": t.type, children: t.tag, ...e });
|
|
371
|
+
}, xe = i("span", {
|
|
338
372
|
_id: "aiSearchResults__ItemDescription"
|
|
339
|
-
}),
|
|
340
|
-
const { source: t } =
|
|
373
|
+
}), zt = (e) => {
|
|
374
|
+
const { source: t } = p(), { children: r, ...s } = e, n = w(() => t.description ? ie(t.description) : [], [t.description]);
|
|
341
375
|
return n.length ? /* @__PURE__ */ a(
|
|
342
|
-
|
|
376
|
+
xe,
|
|
343
377
|
{
|
|
344
378
|
"data-type": t.type,
|
|
345
379
|
"aria-hidden": "true",
|
|
346
|
-
children:
|
|
380
|
+
children: A(r, n),
|
|
347
381
|
...s
|
|
348
382
|
}
|
|
349
383
|
) : null;
|
|
350
|
-
},
|
|
384
|
+
}, Ne = i("span", {
|
|
351
385
|
_id: "aiSearchResults__ItemDescriptionPart"
|
|
352
|
-
}),
|
|
353
|
-
const { part: t, ...
|
|
386
|
+
}), Jt = (e) => {
|
|
387
|
+
const { part: t, ...r } = e, { source: s } = p();
|
|
354
388
|
return typeof t == "string" ? t : /* @__PURE__ */ a(
|
|
355
|
-
|
|
389
|
+
Ne,
|
|
356
390
|
{
|
|
357
391
|
"data-type": s.type,
|
|
358
392
|
children: t.content,
|
|
359
|
-
"data-highlighted":
|
|
360
|
-
...
|
|
393
|
+
"data-highlighted": v(t.highlighted),
|
|
394
|
+
...r
|
|
361
395
|
}
|
|
362
396
|
);
|
|
363
|
-
},
|
|
397
|
+
}, Be = i(T, {
|
|
364
398
|
_id: "aiSearchResults__ItemIndicator"
|
|
365
|
-
}),
|
|
366
|
-
const { source: t } =
|
|
367
|
-
searchSettings: { view:
|
|
368
|
-
} =
|
|
399
|
+
}), Xt = (e) => {
|
|
400
|
+
const { source: t } = p(), {
|
|
401
|
+
searchSettings: { view: r }
|
|
402
|
+
} = S();
|
|
369
403
|
return /* @__PURE__ */ a(
|
|
370
|
-
|
|
404
|
+
Be,
|
|
371
405
|
{
|
|
372
406
|
iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
|
|
373
|
-
"data-view":
|
|
407
|
+
"data-view": r,
|
|
374
408
|
...e
|
|
375
409
|
}
|
|
376
410
|
);
|
|
377
|
-
},
|
|
411
|
+
}, He = i("div", {
|
|
378
412
|
_id: "aiSearchResults__ItemPreview",
|
|
379
413
|
"aria-hidden": !0
|
|
380
|
-
}),
|
|
414
|
+
}), Yt = (e) => {
|
|
381
415
|
const {
|
|
382
|
-
searchSettings: { view: t, shouldOpenLinksInNewTab:
|
|
383
|
-
} =
|
|
384
|
-
if (o ===
|
|
385
|
-
const
|
|
386
|
-
return c.current =
|
|
416
|
+
searchSettings: { view: t, shouldOpenLinksInNewTab: r }
|
|
417
|
+
} = S(), { results: s, tab: n } = u(), o = g((m) => m.value), l = s[n] ?? [], c = K(null), d = w(() => {
|
|
418
|
+
if (o === f) return c.current;
|
|
419
|
+
const m = l.find((h) => h.id === o);
|
|
420
|
+
return c.current = m ?? null, m;
|
|
387
421
|
}, [o]);
|
|
388
|
-
if (t !== "dual-pane" || o ===
|
|
389
|
-
const
|
|
390
|
-
return /* @__PURE__ */ a(
|
|
391
|
-
},
|
|
422
|
+
if (t !== "dual-pane" || o === f || !d) return null;
|
|
423
|
+
const _ = d.shouldOpenInNewTab !== void 0 ? d.shouldOpenInNewTab : r;
|
|
424
|
+
return /* @__PURE__ */ a(q, { source: { ...d, isExternal: _ }, children: /* @__PURE__ */ a(He, { ...e }) });
|
|
425
|
+
}, Zt = i("div", {
|
|
392
426
|
_id: "aiSearchResults__ItemPreview__Header"
|
|
393
|
-
}),
|
|
427
|
+
}), Me = i(U, {
|
|
394
428
|
_id: "aiSearchResults__ItemPreview__Heading"
|
|
395
|
-
}),
|
|
396
|
-
const { source: t } =
|
|
429
|
+
}), er = (e) => {
|
|
430
|
+
const { source: t } = p();
|
|
397
431
|
return /* @__PURE__ */ a(
|
|
398
|
-
|
|
432
|
+
Me,
|
|
399
433
|
{
|
|
400
434
|
href: t.url,
|
|
401
435
|
isExternal: t.isExternal,
|
|
@@ -404,101 +438,101 @@ const ae = r("div", {
|
|
|
404
438
|
...e
|
|
405
439
|
}
|
|
406
440
|
);
|
|
407
|
-
},
|
|
441
|
+
}, Ke = i("span", {
|
|
408
442
|
_id: "aiSearchResults__ItemPreview__Title"
|
|
409
|
-
}),
|
|
410
|
-
const { source: t } =
|
|
411
|
-
return /* @__PURE__ */ a(
|
|
412
|
-
},
|
|
443
|
+
}), tr = (e) => {
|
|
444
|
+
const { source: t } = p();
|
|
445
|
+
return /* @__PURE__ */ a(Ke, { children: t.title, ...e });
|
|
446
|
+
}, Ue = i(T, {
|
|
413
447
|
_id: "aiSearchResults__ItemPreview__Title__LinkIcon",
|
|
414
448
|
iconKey: "openLinkInNewTab"
|
|
415
|
-
}),
|
|
416
|
-
const { source: t } =
|
|
449
|
+
}), rr = (e) => {
|
|
450
|
+
const { source: t } = p();
|
|
417
451
|
return /* @__PURE__ */ a(
|
|
418
|
-
|
|
452
|
+
Ue,
|
|
419
453
|
{
|
|
420
454
|
iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
|
|
421
455
|
...e
|
|
422
456
|
}
|
|
423
457
|
);
|
|
424
|
-
},
|
|
425
|
-
|
|
458
|
+
}, ir = i(
|
|
459
|
+
ke,
|
|
426
460
|
{
|
|
427
461
|
_id: "aiSearchResults__ItemPreview__Breadcrumbs"
|
|
428
462
|
}
|
|
429
|
-
),
|
|
430
|
-
|
|
463
|
+
), sr = i(
|
|
464
|
+
Le,
|
|
431
465
|
{
|
|
432
466
|
_id: "aiSearchResults__ItemPreview__BreadcrumbIcon"
|
|
433
467
|
}
|
|
434
|
-
),
|
|
468
|
+
), De = i(ce, {
|
|
435
469
|
_id: "aiSearchResults__ItemPreview__Body"
|
|
436
|
-
}),
|
|
437
|
-
const { source: t } =
|
|
470
|
+
}), nr = (e) => {
|
|
471
|
+
const { source: t } = p(), { resultsList: r } = u(), s = r.find((o) => o.id === t.id), {
|
|
438
472
|
searchSettings: { shouldOpenLinksInNewTab: n }
|
|
439
|
-
} =
|
|
473
|
+
} = S();
|
|
440
474
|
return s ? /* @__PURE__ */ a(
|
|
441
|
-
|
|
475
|
+
De,
|
|
442
476
|
{
|
|
443
477
|
shouldOpenLinksInNewTab: n,
|
|
444
478
|
children: s.preview,
|
|
445
479
|
...e
|
|
446
480
|
}
|
|
447
481
|
) : null;
|
|
448
|
-
},
|
|
482
|
+
}, Fe = i("div", {
|
|
449
483
|
_id: "aiSearchResults__ItemPreview__Outline"
|
|
450
|
-
}),
|
|
451
|
-
const { source: t } =
|
|
452
|
-
return
|
|
453
|
-
},
|
|
484
|
+
}), ar = (e) => {
|
|
485
|
+
const { source: t } = p(), { resultsList: r } = u();
|
|
486
|
+
return r.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ a(Fe, { ...e }) : null;
|
|
487
|
+
}, or = i("span", {
|
|
454
488
|
_id: "aiSearchResults__ItemPreview__Outline__Title",
|
|
455
489
|
children: "On this page"
|
|
456
|
-
}),
|
|
490
|
+
}), Qe = i("ul", {
|
|
457
491
|
_id: "aiSearchResults__ItemPreview__Outline__List"
|
|
458
|
-
}),
|
|
459
|
-
const { source: t } =
|
|
492
|
+
}), cr = (e) => {
|
|
493
|
+
const { source: t } = p(), { resultsList: r } = u(), s = r.find((d) => d.id === t.id), n = s?.rootRecord.topLevelHeadings;
|
|
460
494
|
if (!n?.length) return null;
|
|
461
|
-
const o = n.map((
|
|
462
|
-
const
|
|
495
|
+
const o = n.map((d) => {
|
|
496
|
+
const _ = d?.anchor && d?.anchor === s?.content?.anchor, m = d?.anchor === s?.pathHeadings?.[0]?.anchor;
|
|
463
497
|
return {
|
|
464
|
-
...
|
|
465
|
-
isMatch:
|
|
498
|
+
...d,
|
|
499
|
+
isMatch: _ || m
|
|
466
500
|
};
|
|
467
|
-
}), { children:
|
|
468
|
-
return /* @__PURE__ */ a(
|
|
469
|
-
},
|
|
501
|
+
}), { children: l, ...c } = e;
|
|
502
|
+
return /* @__PURE__ */ a(Qe, { children: A(l, o), ...c });
|
|
503
|
+
}, Ve = i(U, {
|
|
470
504
|
_id: "aiSearchResults__ItemPreview__Outline__Item"
|
|
471
|
-
}),
|
|
505
|
+
}), lr = (e) => {
|
|
472
506
|
const {
|
|
473
507
|
searchSettings: { shouldOpenLinksInNewTab: t }
|
|
474
|
-
} =
|
|
475
|
-
return /* @__PURE__ */ a(
|
|
476
|
-
},
|
|
508
|
+
} = S();
|
|
509
|
+
return /* @__PURE__ */ a(Ve, { isExternal: t, ...e });
|
|
510
|
+
}, dr = i(T, {
|
|
477
511
|
_id: "aiSearchResults__ItemPreview__Outline__ItemIcon",
|
|
478
512
|
iconKey: "newLine"
|
|
479
|
-
}),
|
|
513
|
+
}), We = i("span", {
|
|
480
514
|
_id: "aiSearchResults__ItemPreview__Outline__ItemText"
|
|
481
|
-
}),
|
|
482
|
-
|
|
515
|
+
}), ur = (e) => /* @__PURE__ */ a(We, { ...e }), mr = i(
|
|
516
|
+
D,
|
|
483
517
|
{
|
|
484
518
|
_id: "aiSearchResults__ItemPreview__Outline__ItemLinkIcon",
|
|
485
519
|
iconSettings: {
|
|
486
520
|
builtIn: "LuLink"
|
|
487
521
|
}
|
|
488
522
|
}
|
|
489
|
-
),
|
|
523
|
+
), $e = i("div", {
|
|
490
524
|
_id: "aiSearchFooter"
|
|
491
|
-
}),
|
|
525
|
+
}), hr = (e) => {
|
|
492
526
|
const { hasContent: t } = u();
|
|
493
|
-
return /* @__PURE__ */ a(
|
|
494
|
-
},
|
|
527
|
+
return /* @__PURE__ */ a($e, { "data-has-results": v(t), ...e });
|
|
528
|
+
}, Ir = i("div", {
|
|
495
529
|
_id: "aiSearchTagline__Container"
|
|
496
|
-
}),
|
|
530
|
+
}), vr = i("span", {
|
|
497
531
|
_id: "aiSearchTagline__Text",
|
|
498
532
|
children: "Powered by"
|
|
499
|
-
}),
|
|
533
|
+
}), _r = i(te, {
|
|
500
534
|
_id: "aiSearchTagline__Logo"
|
|
501
|
-
}),
|
|
535
|
+
}), pr = i("a", {
|
|
502
536
|
_id: "aiSearchTagline__BrandName",
|
|
503
537
|
children: "inkeep",
|
|
504
538
|
href: "https://www.inkeep.com/",
|
|
@@ -506,104 +540,104 @@ const ae = r("div", {
|
|
|
506
540
|
rel: "noopener noreferrer"
|
|
507
541
|
});
|
|
508
542
|
export {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
543
|
+
At as AskAITrigger,
|
|
544
|
+
kt as AskAITriggerIcon,
|
|
545
|
+
Ot as AskAITriggerIndicator,
|
|
546
|
+
Ct as AskAITriggerIndicatorText,
|
|
547
|
+
Lt as AskAITriggerLabel,
|
|
548
|
+
yt as AskAITriggerQuery,
|
|
549
|
+
gt as Content,
|
|
550
|
+
wt as EmbeddedSearchInputIcon,
|
|
551
|
+
At as EmbeddedSearchPrimitiveAskAITrigger,
|
|
552
|
+
kt as EmbeddedSearchPrimitiveAskAITriggerIcon,
|
|
553
|
+
Ot as EmbeddedSearchPrimitiveAskAITriggerIndicator,
|
|
554
|
+
Ct as EmbeddedSearchPrimitiveAskAITriggerIndicatorText,
|
|
555
|
+
Lt as EmbeddedSearchPrimitiveAskAITriggerLabel,
|
|
556
|
+
yt as EmbeddedSearchPrimitiveAskAITriggerQuery,
|
|
557
|
+
gt as EmbeddedSearchPrimitiveContent,
|
|
558
|
+
hr as EmbeddedSearchPrimitiveFooter,
|
|
559
|
+
ft as EmbeddedSearchPrimitiveInput,
|
|
560
|
+
Tt as EmbeddedSearchPrimitiveInputGroup,
|
|
561
|
+
Et as EmbeddedSearchPrimitiveLoading,
|
|
562
|
+
xt as EmbeddedSearchPrimitiveResults,
|
|
563
|
+
Kt as EmbeddedSearchPrimitiveResultsContent,
|
|
564
|
+
Bt as EmbeddedSearchPrimitiveResultsEmpty,
|
|
565
|
+
$t as EmbeddedSearchPrimitiveResultsItem,
|
|
566
|
+
ke as EmbeddedSearchPrimitiveResultsItemBreadcrumbs,
|
|
567
|
+
zt as EmbeddedSearchPrimitiveResultsItemDescription,
|
|
568
|
+
Jt as EmbeddedSearchPrimitiveResultsItemDescriptionPart,
|
|
569
|
+
Gt as EmbeddedSearchPrimitiveResultsItemIcon,
|
|
570
|
+
Xt as EmbeddedSearchPrimitiveResultsItemIndicator,
|
|
571
|
+
Yt as EmbeddedSearchPrimitiveResultsItemPreview,
|
|
572
|
+
nr as EmbeddedSearchPrimitiveResultsItemPreviewBody,
|
|
573
|
+
sr as EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon,
|
|
574
|
+
er as EmbeddedSearchPrimitiveResultsItemPreviewHeading,
|
|
575
|
+
ar as EmbeddedSearchPrimitiveResultsItemPreviewOutline,
|
|
576
|
+
lr as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem,
|
|
577
|
+
dr as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon,
|
|
578
|
+
mr as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon,
|
|
579
|
+
ur as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText,
|
|
580
|
+
cr as EmbeddedSearchPrimitiveResultsItemPreviewOutlineList,
|
|
581
|
+
or as EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle,
|
|
582
|
+
tr as EmbeddedSearchPrimitiveResultsItemPreviewTitle,
|
|
583
|
+
rr as EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon,
|
|
584
|
+
qt as EmbeddedSearchPrimitiveResultsItemTag,
|
|
585
|
+
jt as EmbeddedSearchPrimitiveResultsItemTitle,
|
|
586
|
+
Wt as EmbeddedSearchPrimitiveResultsList,
|
|
587
|
+
Nt as EmbeddedSearchPrimitiveResultsLoading,
|
|
588
|
+
Ut as EmbeddedSearchPrimitiveResultsScrollArea,
|
|
589
|
+
Dt as EmbeddedSearchPrimitiveResultsScrollAreaViewport,
|
|
590
|
+
Mt as EmbeddedSearchPrimitiveResultsTab,
|
|
591
|
+
Ht as EmbeddedSearchPrimitiveResultsTabList,
|
|
592
|
+
Pt as EmbeddedSearchPrimitiveRoot,
|
|
593
|
+
Rt as EmbeddedSearchPrimitiveWrapper,
|
|
594
|
+
hr as Footer,
|
|
595
|
+
ft as Input,
|
|
596
|
+
Tt as InputGroup,
|
|
597
|
+
wt as InputIcon,
|
|
598
|
+
Et as Loading,
|
|
599
|
+
he as PrimitiveContent,
|
|
600
|
+
Rr as Provider,
|
|
601
|
+
xt as Results,
|
|
602
|
+
Kt as ResultsContent,
|
|
603
|
+
Bt as ResultsEmpty,
|
|
604
|
+
$t as ResultsItem,
|
|
605
|
+
Le as ResultsItemBreadcrumbIcon,
|
|
606
|
+
ke as ResultsItemBreadcrumbs,
|
|
607
|
+
zt as ResultsItemDescription,
|
|
608
|
+
Jt as ResultsItemDescriptionPart,
|
|
609
|
+
Gt as ResultsItemIcon,
|
|
610
|
+
Xt as ResultsItemIndicator,
|
|
611
|
+
Yt as ResultsItemPreview,
|
|
612
|
+
nr as ResultsItemPreviewBody,
|
|
613
|
+
sr as ResultsItemPreviewBreadcrumbIcon,
|
|
614
|
+
ir as ResultsItemPreviewBreadcrumbs,
|
|
615
|
+
Zt as ResultsItemPreviewHeader,
|
|
616
|
+
er as ResultsItemPreviewHeading,
|
|
617
|
+
ar as ResultsItemPreviewOutline,
|
|
618
|
+
lr as ResultsItemPreviewOutlineItem,
|
|
619
|
+
dr as ResultsItemPreviewOutlineItemIcon,
|
|
620
|
+
mr as ResultsItemPreviewOutlineItemLinkIcon,
|
|
621
|
+
ur as ResultsItemPreviewOutlineItemText,
|
|
622
|
+
cr as ResultsItemPreviewOutlineList,
|
|
623
|
+
or as ResultsItemPreviewOutlineTitle,
|
|
624
|
+
tr as ResultsItemPreviewTitle,
|
|
625
|
+
rr as ResultsItemPreviewTitleLinkIcon,
|
|
626
|
+
qt as ResultsItemTag,
|
|
627
|
+
jt as ResultsItemTitle,
|
|
628
|
+
Wt as ResultsList,
|
|
629
|
+
Nt as ResultsLoading,
|
|
630
|
+
Ut as ResultsScrollArea,
|
|
631
|
+
Vt as ResultsScrollAreaCorner,
|
|
632
|
+
Ft as ResultsScrollAreaScrollbar,
|
|
633
|
+
Qt as ResultsScrollAreaThumb,
|
|
634
|
+
Dt as ResultsScrollAreaViewport,
|
|
635
|
+
Mt as ResultsTab,
|
|
636
|
+
Ht as ResultsTabList,
|
|
637
|
+
Pt as Root,
|
|
638
|
+
pr as TaglineBrandName,
|
|
639
|
+
Ir as TaglineContainer,
|
|
640
|
+
_r as TaglineLogo,
|
|
641
|
+
vr as TaglineText,
|
|
642
|
+
Rt as Wrapper
|
|
609
643
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),t=require("react"),f=require("../atoms/api/analytics/events.cjs"),b=require("./config-provider.cjs"),x=require("./user-provider.cjs"),E=t.createContext(void 0),q=({children:e})=>{const{baseSettings:s,componentType:r}=b.useInkeepConfig(),{apiKey:i,analyticsApiBaseUrl:c,tags:a,privacyPreferences:m,env:g,analyticsProperties:v}=s,{userProperties:u}=x.useUser(),l=t.useMemo(()=>({widgetLibraryVersion:"0.5.
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),t=require("react"),f=require("../atoms/api/analytics/events.cjs"),b=require("./config-provider.cjs"),x=require("./user-provider.cjs"),E=t.createContext(void 0),q=({children:e})=>{const{baseSettings:s,componentType:r}=b.useInkeepConfig(),{apiKey:i,analyticsApiBaseUrl:c,tags:a,privacyPreferences:m,env:g,analyticsProperties:v}=s,{userProperties:u}=x.useUser(),l=t.useMemo(()=>({widgetLibraryVersion:"0.5.99",componentType:r,tags:a}),[r,a]),d=!m.optOutAllAnalytics&&g!=="development",P={logEvent:t.useCallback(async n=>{const o={...l,...n.properties,...v},p={eventName:n.eventName,properties:o,userProperties:u},y=["modal_opened","modal_closed"].includes(n.eventName);if(d&&!y){if("conversation"in o&&!o.conversation?.id)return;f.logEvent(p,i,c)}s.onEvent?.(p)},[d,s,i,c,u,l,v])};return B.jsx(E.Provider,{value:P,children:e})},C=()=>{const e=t.useContext(E);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=q;exports.useBaseEvents=C;
|
|
@@ -7,7 +7,7 @@ import { useUser as A } from "./user-provider.js";
|
|
|
7
7
|
const u = B(void 0), $ = ({ children: e }) => {
|
|
8
8
|
const { baseSettings: t, componentType: s } = w(), { apiKey: r, analyticsApiBaseUrl: i, tags: a, privacyPreferences: d, env: E, analyticsProperties: c } = t, { userProperties: v } = A(), p = P(
|
|
9
9
|
() => ({
|
|
10
|
-
widgetLibraryVersion: "0.5.
|
|
10
|
+
widgetLibraryVersion: "0.5.99",
|
|
11
11
|
componentType: s,
|
|
12
12
|
tags: a
|
|
13
13
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/cxkit-primitives",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.99",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Inkeep, Inc. Customer License (IICL) v1.1",
|
|
6
6
|
"homepage": "",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"remark-gfm": "^4.0.1",
|
|
68
68
|
"unist-util-visit": "^5.0.0",
|
|
69
69
|
"use-sync-external-store": "^1.4.0",
|
|
70
|
-
"@inkeep/cxkit-color-mode": "^0.5.
|
|
71
|
-
"@inkeep/cxkit-theme": "0.5.
|
|
72
|
-
"@inkeep/cxkit-types": "0.5.
|
|
70
|
+
"@inkeep/cxkit-color-mode": "^0.5.99",
|
|
71
|
+
"@inkeep/cxkit-theme": "0.5.99",
|
|
72
|
+
"@inkeep/cxkit-types": "0.5.99"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@biomejs/biome": "1.9.4",
|