@techdocs/cli 0.0.0-nightly-20220712025512 → 0.0.0-nightly-20220713025014

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/CHANGELOG.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # @techdocs/cli
2
2
 
3
- ## 0.0.0-nightly-20220712025512
3
+ ## 0.0.0-nightly-20220713025014
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - a5d73da942: Fix the flag parsing for `legacyCopyReadmeMdToIndexMd` in `techdocs-cli generate` command, and decouple it's logic from the `techdocs-ref` flag.
8
8
  - 14ce0d9347: Fixed a bug that prevented docker images from being pulled by default when generating TechDocs.
9
9
  - Updated dependencies
10
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20220712025512
11
- - @backstage/backend-common@0.0.0-nightly-20220712025512
12
- - @backstage/catalog-model@0.0.0-nightly-20220712025512
10
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20220713025014
11
+ - @backstage/backend-common@0.0.0-nightly-20220713025014
12
+ - @backstage/catalog-model@0.0.0-nightly-20220713025014
13
13
 
14
14
  ## 1.1.3-next.1
15
15
 
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.cd7e8eac.js"></script><script defer="defer" src="/static/module-material-ui.1e05f502.js"></script><script defer="defer" src="/static/module-lodash.32f2edbb.js"></script><script defer="defer" src="/static/module-date-fns.667c4862.js"></script><script defer="defer" src="/static/module-yaml.0874c6f8.js"></script><script defer="defer" src="/static/module-ajv.f2ae340e.js"></script><script defer="defer" src="/static/module-material-table.cd3af251.js"></script><script defer="defer" src="/static/module-luxon.7b575f16.js"></script><script defer="defer" src="/static/module-hot-loader.baa19dda.js"></script><script defer="defer" src="/static/module-jss.df150ef8.js"></script><script defer="defer" src="/static/module-zod.2193e794.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.6085a9b0.js"></script><script defer="defer" src="/static/vendor.cd7e8eac.js"></script><script defer="defer" src="/static/main.cd7e8eac.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.7d435ca8.js"></script><script defer="defer" src="/static/module-material-ui.1e05f502.js"></script><script defer="defer" src="/static/module-lodash.32f2edbb.js"></script><script defer="defer" src="/static/module-date-fns.667c4862.js"></script><script defer="defer" src="/static/module-yaml.0874c6f8.js"></script><script defer="defer" src="/static/module-ajv.f2ae340e.js"></script><script defer="defer" src="/static/module-material-table.cd3af251.js"></script><script defer="defer" src="/static/module-luxon.ee0def5d.js"></script><script defer="defer" src="/static/module-hot-loader.baa19dda.js"></script><script defer="defer" src="/static/module-jss.df150ef8.js"></script><script defer="defer" src="/static/module-zod.2193e794.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.6085a9b0.js"></script><script defer="defer" src="/static/vendor.7d435ca8.js"></script><script defer="defer" src="/static/main.7d435ca8.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -484,4 +484,4 @@ ${ye.href}
484
484
 
485
485
  Feedback:`),en=(Pe==null?void 0:Pe.type)==="github"?(0,le.Pb)(Se.href,"blob"):Se.href,Kt=Ce()(en),Mt=`/${Kt.organization}/${Kt.name}`,ot=ye.cloneNode();switch(Pe==null?void 0:Pe.type){case"gitlab":ot.href=`${Se.origin}${Mt}/issues/new?issue[title]=${vt}&issue[description]=${Tt}`;break;case"github":ot.href=`${Se.origin}${Mt}/issues/new?title=${vt}&body=${Tt}`;break;default:return re}return be.render(r.createElement(de.Z),ot),ot.style.paddingLeft="5px",ot.title="Leave feedback for this page",ot.id="git-feedback-link",ye==null||ye.insertAdjacentElement("beforebegin",ot),re};var je=e(44882);const gt=()=>x=>{const re=x.querySelector('.md-header label[for="__drawer"]'),ye=x.querySelector("article");if(!re||!ye)return x;const Se=re.cloneNode();return be.render(r.createElement(je.Z),Se),Se.id="toggle-sidebar",Se.title="Toggle Sidebar",Se.classList.add("md-content__button"),Se.style.setProperty("padding","0 0 0 5px"),Se.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ye==null||ye.prepend(Se),x},Rt=()=>x=>(((ye,Se)=>{Array.from(ye).filter(Pe=>Pe.hasAttribute(Se)).forEach(Pe=>{const ct=Pe.getAttribute(Se);if(ct){ct.match(/^https?:\/\//i)&&Pe.setAttribute("target","_blank");try{const vt=lt(window.location.href);Pe.setAttribute(Se,new URL(ct,vt).toString())}catch{Pe.replaceWith(Pe.textContent||ct)}}})})(Array.from(x.getElementsByTagName("a")),"href"),x);function lt(x){const re=new URL(x);return!re.pathname.endsWith("/")&&!re.pathname.endsWith(".html")&&(re.pathname+="/"),re.toString()}const Ct=({baseUrl:x,onClick:re})=>ye=>(Array.from(ye.getElementsByTagName("a")).forEach(Se=>{Se.addEventListener("click",Pe=>{const vt=Se.getAttribute("href");!vt||vt.startsWith(x)&&!Se.hasAttribute("download")&&(Pe.preventDefault(),re(Pe,vt))})}),ye);var Lt=e(15459),xt=e(80030),Pt=e(72379),wt=e(41547);const $t=(0,Lt.Z)(x=>({tooltip:{fontSize:"inherit",color:x.palette.text.primary,margin:0,padding:x.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(xt.ZP),hn=()=>r.createElement(Pt.Z,null,r.createElement("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})),Un=({text:x})=>{const[re,ye]=(0,r.useState)(!1),Se=(0,r.useCallback)(()=>{navigator.clipboard.writeText(x),ye(!0)},[x]),Pe=(0,r.useCallback)(()=>{ye(!1)},[ye]);return r.createElement($t,{title:"Copied to clipboard",placement:"left",open:re,onClose:Pe,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:Se},r.createElement(hn,null)))},oe=x=>re=>{var Se;const ye=re.querySelectorAll("pre > code");for(const Pe of ye){const ct=Pe.textContent||"",vt=document.createElement("div");(Se=Pe==null?void 0:Pe.parentElement)==null||Se.prepend(vt),be.render(r.createElement(wt.Z,{theme:x},r.createElement(Un,{text:ct})),vt)}return re},W=()=>x=>{var re;return(re=x.querySelector(".md-header"))==null||re.remove(),x},Q=()=>x=>{var re,ye;return(re=x.querySelector(".md-footer .md-copyright"))==null||re.remove(),(ye=x.querySelector(".md-footer-copyright"))==null||ye.remove(),x},We=({onLoading:x,onLoaded:re})=>ye=>(x(),ye.addEventListener(u.Ox,function Se(){re(),ye.removeEventListener(u.Ox,Se)}),ye),Xe=()=>x=>(setTimeout(()=>{var re;if(window.location.hash){const ye=window.location.hash.slice(1);(re=x==null?void 0:x.querySelector(`[id="${ye}"]`))==null||re.scrollIntoView()}},200),x),tt=async(x,re)=>{let ye;if(typeof x=="string")ye=new DOMParser().parseFromString(x,"text/html").documentElement;else if(x instanceof Element)ye=x;else throw new Error("dom is not a recognized type");for(const Se of re)ye=await Se(ye);return ye},bt="screen and (max-width: 76.1875em)",Zt=x=>{const re=(0,ne.s0)(),ye=(0,me.Z)(),Se=(0,Re.Z)(bt),Pe=Ze(),ct=X(),vt=(0,I.useApi)(u.Dl),Tt=(0,I.useApi)($e.q3),{state:en,path:Kt,content:Mt}=(0,B.DK)(),[ot,Dt]=(0,r.useState)(null),rn=(0,u.ux)(ot),zt=(0,r.useCallback)(()=>{if(!ot)return;ot.querySelectorAll(".md-sidebar").forEach(Nt=>{var Yt,yn,ln;if(Se)Nt.style.top="0px";else{const vn=document==null?void 0:document.querySelector(".techdocs-reader-page"),Nn=(Yt=vn==null?void 0:vn.getBoundingClientRect().top)!=null?Yt:0;let Sn=(yn=ot.getBoundingClientRect().top)!=null?yn:0;const w=ot.querySelector(".md-container > .md-tabs"),h=(ln=w==null?void 0:w.getBoundingClientRect().height)!=null?ln:0;Sn<Nn&&(Sn=Nn),Nt.style.top=`${Math.max(Sn,0)+h}px`}Nt.style.setProperty("opacity","1")})},[ot,Se]);(0,r.useEffect)(()=>(window.addEventListener("resize",zt),window.addEventListener("scroll",zt,!0),()=>{window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt,!0)}),[ot,zt]);const Xt=(0,r.useCallback)(()=>{if(!ot)return;const kt=ot.querySelector(".md-footer");kt&&(kt.style.width=`${ot.getBoundingClientRect().width}px`)},[ot]);(0,r.useEffect)(()=>(window.addEventListener("resize",Xt),()=>{window.removeEventListener("resize",Xt)}),[ot,Xt]),(0,r.useEffect)(()=>{rn||(Xt(),zt())},[en,rn,Xt,zt]);const tn=(0,r.useCallback)((kt,Nt)=>tt(kt,[Pe,q({techdocsStorageApi:vt,entityId:x,path:Nt}),Rt(),gt(),W(),Q(),ke(Tt),ct]),[x,Tt,vt,Pe,ct]),gn=(0,r.useCallback)(async kt=>tt(kt,[Xe(),oe(ye),Ct({baseUrl:window.location.origin,onClick:(Nt,Yt)=>{var vn;const yn=Nt.ctrlKey||Nt.metaKey,ln=new URL(Yt);ln.hash?yn?window.open(`${ln.pathname}${ln.hash}`,"_blank"):(re(`${ln.pathname}${ln.hash}`),(vn=kt==null?void 0:kt.querySelector(`#${ln.hash.slice(1)}`))==null||vn.scrollIntoView()):yn?window.open(ln.pathname,"_blank"):re(ln.pathname)}}),We({onLoading:()=>{},onLoaded:()=>{var Nt;(Nt=kt.querySelector(".md-nav__title"))==null||Nt.removeAttribute("for")}}),We({onLoading:()=>{Array.from(kt.querySelectorAll(".md-sidebar")).forEach(Yt=>{Yt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ye,re]);return(0,r.useEffect)(()=>{if(!Mt)return()=>{};let kt=!0;return tn(Mt,Kt).then(async Nt=>{if(!(Nt!=null&&Nt.innerHTML)||!kt)return;window.scroll({top:0});const Yt=await gn(Nt);Dt(Yt)}),()=>{kt=!1}},[Mt,Kt,tn,gn]),ot};var Ut=e(8560);const sn=()=>{const x=(0,u.$L)(),{shadowRoot:re}=(0,u.x1)(),ye=re==null?void 0:re.querySelector('[data-md-component="content"]'),Se=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Pe=Se==null?void 0:Se.querySelector('[data-techdocs-addons-location="primary sidebar"]');Pe||(Pe=document.createElement("div"),Pe.setAttribute("data-techdocs-addons-location","primary sidebar"),Se==null||Se.prepend(Pe));const ct=re==null?void 0:re.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let vt=ct==null?void 0:ct.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return vt||(vt=document.createElement("div"),vt.setAttribute("data-techdocs-addons-location","secondary sidebar"),ct==null||ct.prepend(vt)),r.createElement(r.Fragment,null,r.createElement(Ut.Z,{container:Pe},x.renderComponentsByLocation(u.oZ.PrimarySidebar)),r.createElement(Ut.Z,{container:ye},x.renderComponentsByLocation(u.oZ.Content)),r.createElement(Ut.Z,{container:vt},x.renderComponentsByLocation(u.oZ.SecondarySidebar)))},fn=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Qt=(0,B.m1)(x=>{var Mt;const{withSearch:re=!0,onReady:ye}=x,Se=fn(),{entityMetadata:{value:Pe,loading:ct},entityRef:vt,setShadowRoot:Tt}=(0,u.x1)(),en=Zt(vt),Kt=(0,r.useCallback)(ot=>{Tt(ot),ye instanceof Function&&ye()},[Tt,ye]);return ct===!1&&!Pe?r.createElement(A.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):en?r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(k,null)),re&&r.createElement(l.Z,{className:Se.search,xs:"auto",item:!0},r.createElement(m.S,{entityId:vt,entityTitle:(Mt=Pe==null?void 0:Pe.metadata)==null?void 0:Mt.title})),r.createElement(l.Z,{xs:12,item:!0},r.createElement(u.VA,{element:en,onAppend:Kt},r.createElement(sn,null))))):r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(k,null))))}),pn=null},99954:function(te,s,e){"use strict";e.d(s,{S:function(){return E}});var r=e(2784),t=e(18671),l=e(98069),u=e(73250),A=e(26136),m=e(17429),o=e(48023),c=e(82339),f=e(36964),y=e(68725);const p=r.createElement(l.Z,{animation:"wave",variant:"text",height:40}),E=C=>{const{children:L}=C,F=(0,A.$L)(),H=(0,f.useApi)(f.configApiRef),{title:M,setTitle:I,subtitle:O,setSubtitle:B,entityRef:U,metadata:{value:k,loading:ne},entityMetadata:{value:me,loading:Re}}=(0,A.x1)();(0,r.useEffect)(()=>{!k||(I(Ye=>{const{site_name:ce}=k;return Ye||ce}),B(Ye=>{let{site_description:ce}=k;return(!ce||ce==="None")&&(ce="Home"),Ye||ce}))},[k,I,B]);const $e=H.getOptional("app.title")||"Backstage",pe=[M,O,$e].filter(Boolean).join(" | "),{locationMetadata:He,spec:_e}=me||{},qe=_e==null?void 0:_e.lifecycle,mt=me?(0,m.getEntityRelations)(me,o.S4):[],St=(0,f.useRouteRef)(y._Z)(),Et=r.createElement(r.Fragment,null,r.createElement(c.HeaderLabel,{label:"Component",value:r.createElement(m.EntityRefLink,{color:"inherit",entityRef:U,title:me==null?void 0:me.metadata.title,defaultKind:"Component"})}),mt.length>0&&r.createElement(c.HeaderLabel,{label:"Owner",value:r.createElement(m.EntityRefLinks,{color:"inherit",entityRefs:mt,defaultKind:"group"})}),qe?r.createElement(c.HeaderLabel,{label:"Lifecycle",value:qe}):null,He&&He.type!=="dir"&&He.type!=="file"?r.createElement(c.HeaderLabel,{label:"",value:r.createElement("a",{href:He.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(u.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Re&&me===void 0||!ne&&k===void 0?null:r.createElement(c.Header,{type:"Documentation",typeLink:St,title:M||p,subtitle:O||p},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,pe)),Et,L,F.renderComponentsByLocation(A.oZ.Header))}},16172:function(te,s,e){"use strict";e.d(s,{b:function(){return p}});var r=e(2784),t=e(79692),l=e(15223),u=e(95544),A=e(80030),m=e(61837),o=e(48348),c=e(47603),f=e(26136);const y=(0,t.Z)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0)}})),p=({toolbarProps:E})=>{const C=y(),[L,F]=(0,r.useState)(null),H=(0,r.useCallback)(ne=>{F(ne.currentTarget)},[]),M=(0,r.useCallback)(()=>{F(null)},[]),{entityMetadata:{value:I,loading:O}}=(0,f.x1)(),B=(0,f.$L)(),U=B.renderComponentsByLocation(f.oZ.Subheader),k=B.renderComponentsByLocation(f.oZ.Settings);return!U&&!k||O===!1&&!I?null:r.createElement(l.Z,{classes:C,...E},r.createElement(u.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},U,k?r.createElement(r.Fragment,null,r.createElement(A.ZP,{title:"Settings"},r.createElement(m.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:H},r.createElement(c.Z,null))),r.createElement(o.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(L),onClose:M,keepMounted:!0},k)):null))}},2263:function(te,s,e){"use strict";e.d(s,{DK:function(){return p},m1:function(){return C}});var r=e(2784),t=e(10289),l=e(26136),u=e(36964),A=e(64279),m=e(77446);function o({contentLoading:L,content:F,activeSyncState:H}){return L||H==="BUILD_READY_RELOAD"||!F&&H==="CHECKING"?"CHECKING":!F&&H==="BUILDING"?"INITIAL_BUILD":F?H==="BUILDING"?"CONTENT_STALE_REFRESHING":H==="BUILD_READY"?"CONTENT_STALE_READY":H==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function c(L,F){const H={...L};switch(F.type){case"sync":F.state==="CHECKING"&&(H.buildLog=[]),H.activeSyncState=F.state,H.syncError=F.syncError;break;case"contentLoading":H.contentLoading=!0,H.contentError=void 0;break;case"content":typeof F.path=="string"&&(H.path=F.path),H.contentLoading=!1,H.content=F.content,H.contentError=F.contentError;break;case"buildLog":H.buildLog=H.buildLog.concat(F.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(H.activeSyncState)&&["contentLoading","content"].includes(F.type)&&(H.activeSyncState="UP_TO_DATE",H.buildLog=[]),H}function f(L,F,H,M){var me,Re;const[I,O]=(0,r.useReducer)(c,{activeSyncState:"CHECKING",path:M,contentLoading:!0,buildLog:[]}),B=(0,u.useApi)(l.Dl),{retry:U}=(0,m.Z)(async()=>{O({type:"contentLoading"});try{const $e=await B.getEntityDocs({kind:L,namespace:F,name:H},M);return O({type:"content",content:$e,path:M}),$e}catch($e){O({type:"content",contentError:$e,path:M})}},[B,L,F,H,M]),k=(0,r.useRef)({content:void 0,reload:()=>{}});return k.current={content:I.content,reload:U},(0,A.default)(async()=>{O({type:"sync",state:"CHECKING"});const $e=setTimeout(()=>{O({type:"sync",state:"BUILDING"})},1e3);try{switch(await B.syncEntityDocs({kind:L,namespace:F,name:H},He=>{O({type:"buildLog",log:He})})){case"updated":k.current.content?O({type:"sync",state:"BUILD_READY"}):(k.current.reload(),O({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":O({type:"sync",state:"UP_TO_DATE"});break;default:O({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(pe){O({type:"sync",state:"ERROR",syncError:pe})}finally{clearTimeout($e)}},[L,H,F,B,O,k]),{state:(0,r.useMemo)(()=>o({activeSyncState:I.activeSyncState,contentLoading:I.contentLoading,content:I.content}),[I.activeSyncState,I.content,I.contentLoading]),contentReload:U,path:I.path,content:I.content,contentErrorMessage:(me=I.contentError)==null?void 0:me.toString(),syncErrorMessage:(Re=I.syncError)==null?void 0:Re.toString(),buildLog:I.buildLog}}const y=(0,r.createContext)({}),p=()=>(0,r.useContext)(y),E=({children:L})=>{const{"*":F=""}=(0,t.UO)(),{entityRef:H}=(0,l.x1)(),{kind:M,namespace:I,name:O}=H,B=f(M,I,O,F);return r.createElement(y.Provider,{value:B},L instanceof Function?L(B):L)},C=L=>F=>r.createElement(E,null,r.createElement(L,{...F}))},96393:function(te,s,e){"use strict";e.d(s,{Fq:function(){return u.F},SE:function(){return l.S}});var r=e(2263),t=e(26220),l=e(99954),u=e(63126),A=e(16172)},68725:function(te,s,e){"use strict";e.d(s,{Fw:function(){return l},_Z:function(){return t},pd:function(){return u}});var r=e(36964);const t=(0,r.createRouteRef)({id:"techdocs:index-page"}),l=(0,r.createRouteRef)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(te,s,e){"use strict";e.d(s,{S:function(){return k}});var r=e(2784),t=e(79692),l=e(49378),u=e(38402),A=e(86136),m=e(85256),o=e(82339),c=e(36964),f=e(74450);const y=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),p=ne=>{const{result:me,highlight:Re,rank:$e,lineClamp:pe=5,asListItem:He=!0,asLink:_e=!0,title:qe,icon:mt}=ne,St=y(),Et=(0,c.useAnalytics)(),Ie=()=>{Et.captureEvent("discover",me.title,{attributes:{to:me.location},value:$e})},ft=()=>{const ue=Re!=null&&Re.fields.title?r.createElement(f.FA,{text:Re.fields.title,preTag:Re.preTag,postTag:Re.postTag}):me.title,Ze=Re!=null&&Re.fields.entityTitle?r.createElement(f.FA,{text:Re.fields.entityTitle,preTag:Re.preTag,postTag:Re.postTag}):me.entityTitle,Oe=Re!=null&&Re.fields.name?r.createElement(f.FA,{text:Re.fields.name,preTag:Re.preTag,postTag:Re.postTag}):me.name;return r.createElement(l.Z,{className:St.itemText,primaryTypographyProps:{variant:"h6"},primary:qe||r.createElement(r.Fragment,null,ue," | ",Ze!=null?Ze:Oe," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:pe,overflow:"hidden"}},Re!=null&&Re.fields.text?r.createElement(f.FA,{text:Re.fields.text,preTag:Re.preTag,postTag:Re.postTag}):me.text)})},Ye=({children:ue})=>_e?r.createElement(o.Link,{noTrack:!0,to:me.location,onClick:Ie},ue):r.createElement(r.Fragment,null,ue),ce=({children:ue})=>He?r.createElement(r.Fragment,null,r.createElement(u.Z,{alignItems:"flex-start"},mt&&r.createElement(A.Z,null,mt),r.createElement("div",{className:St.flexContainer},ue)),r.createElement(m.Z,{component:"li"})):r.createElement(r.Fragment,null,ue);return r.createElement(Ye,null,r.createElement(ce,null,r.createElement(ft,null)))};var E=e(86619),C=e(50581),L=e(61837),F=e(4614),H=e(21853),M=e(88013),I=e(10289),O=e(48760);const B=(0,t.Z)({root:{width:"100%"}}),U=ne=>{const{entityId:me,entityTitle:Re,debounceTime:$e=150}=ne,[pe,He]=(0,r.useState)(!1),_e=(0,I.s0)(),{term:qe,setTerm:mt,setFilters:St,result:{loading:Et,value:Ie}}=(0,f.Rx)(),ft=B(),[Ye,ce]=(0,r.useState)([]);(0,r.useEffect)(()=>{let ie=!0;if(ie&&Ie){const ge=Ie.results.slice(0,10);ce(ge)}return()=>{ie=!1}},[Et,Ie]);const[ue,Ze]=(0,r.useState)(qe);(0,O.Z)(()=>mt(ue),$e,[ue]);const{kind:Oe,name:Ke,namespace:ht}=me;(0,r.useEffect)(()=>{St(ie=>({...ie,kind:Oe,namespace:ht,name:Ke}))},[Oe,ht,Ke,St]);const Ge=ie=>{pe||He(!0),Ze(ie.target.value)},At=(ie,ge)=>{if(ge!=null&&ge.document){const{location:et}=ge.document;_e(et)}};return r.createElement(M.ZP,{classes:{root:ft.root},"data-testid":"techdocs-search-bar",size:"small",open:pe,getOptionLabel:()=>"",filterOptions:ie=>ie,onClose:()=>{He(!1)},onFocus:()=>{He(!0)},onChange:At,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ye,renderOption:({document:ie,highlight:ge})=>r.createElement(p,{result:ie,lineClamp:3,asListItem:!1,asLink:!1,title:ie.title,highlight:ge}),loading:Et,renderInput:ie=>r.createElement(E.Z,{...ie,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${Re||me.name} docs`,value:ue,onChange:Ge,InputProps:{...ie.InputProps,startAdornment:r.createElement(C.Z,{position:"start"},r.createElement(L.Z,{"aria-label":"Query",disabled:!0},r.createElement(H.Z,null))),endAdornment:r.createElement(r.Fragment,null,Et?r.createElement(F.Z,{color:"inherit",size:20}):null,ie.InputProps.endAdornment)}})})},k=ne=>{const me={term:"",types:["techdocs"],pageCursor:"",filters:ne.entityId};return r.createElement(f.Nd,{initialState:me},r.createElement(U,{...ne}))}},98157:function(){},53260:function(){}},function(te){var s=function(r){return te(te.s=r)};te.O(0,[2370,6202,9284,9035,2126,7012,2194,4983,3222,6816,5218,4736],function(){return s(88649),s(90775)});var e=te.O()}]);})();
486
486
 
487
- //# sourceMappingURL=main.cd7e8eac.js.map
487
+ //# sourceMappingURL=main.7d435ca8.js.map