@techdocs/cli 0.0.0-nightly-20221124023258 → 0.0.0-nightly-20221126023145

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-20221124023258
3
+ ## 0.0.0-nightly-20221126023145
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/backend-common@0.0.0-nightly-20221124023258
9
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20221124023258
10
- - @backstage/catalog-model@0.0.0-nightly-20221124023258
8
+ - @backstage/backend-common@0.0.0-nightly-20221126023145
9
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20221126023145
10
+ - @backstage/catalog-model@0.0.0-nightly-20221126023145
11
11
  - @backstage/cli-common@0.1.10
12
- - @backstage/config@0.0.0-nightly-20221124023258
12
+ - @backstage/config@0.0.0-nightly-20221126023145
13
13
 
14
14
  ## 1.2.4-next.0
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.46e63078.js"></script><script defer="defer" src="/static/module-material-ui.8008c157.js"></script><script defer="defer" src="/static/module-lodash.0cada415.js"></script><script defer="defer" src="/static/module-date-fns.7dd2cc1f.js"></script><script defer="defer" src="/static/module-yaml.b5c4d531.js"></script><script defer="defer" src="/static/module-ajv.2efe45a5.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.1ec72e86.js"></script><script defer="defer" src="/static/module-octokit.ea8cd5cc.js"></script><script defer="defer" src="/static/module-react-dom.5abdac04.js"></script><script defer="defer" src="/static/module-zod.49ffd80f.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.97cccd01.js"></script><script defer="defer" src="/static/vendor.46e63078.js"></script><script defer="defer" src="/static/main.46e63078.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.33b5991d.js"></script><script defer="defer" src="/static/module-material-ui.8008c157.js"></script><script defer="defer" src="/static/module-lodash.0cada415.js"></script><script defer="defer" src="/static/module-date-fns.7dd2cc1f.js"></script><script defer="defer" src="/static/module-yaml.cb32d5ca.js"></script><script defer="defer" src="/static/module-ajv.2efe45a5.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.1ec72e86.js"></script><script defer="defer" src="/static/module-octokit.ea8cd5cc.js"></script><script defer="defer" src="/static/module-react-dom.5abdac04.js"></script><script defer="defer" src="/static/module-zod.49ffd80f.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.97cccd01.js"></script><script defer="defer" src="/static/vendor.33b5991d.js"></script><script defer="defer" src="/static/main.33b5991d.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -491,4 +491,4 @@ ${ue.href}
491
491
 
492
492
  Feedback:`),ut=(ke==null?void 0:ke.type)==="github"?(0,ln.BT)(Ce.href,"blob"):Ce.href,et=Kt()(ut),St=`/${et.organization}/${et.name}`,at=ue.cloneNode();switch(ke==null?void 0:ke.type){case"gitlab":at.href=`${Ce.origin}${St}/issues/new?issue[title]=${ot}&issue[description]=${ht}`;break;case"github":at.href=`${Ce.origin}${St}/issues/new?title=${ot}&body=${ht}`;break;default:return H}return gn.render(n.createElement(Dn.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",ue==null||ue.insertAdjacentElement("beforebegin",at),H};var Nn=t(44882);const Yt=()=>S=>{const H=S.querySelector('.md-header label[for="__drawer"]'),me=S.querySelector("article");if(!H||!me)return S;const ue=H.cloneNode();return gn.render(n.createElement(Nn.Z),ue),ue.id="toggle-sidebar",ue.title="Toggle Sidebar",ue.classList.add("md-content__button"),ue.style.setProperty("padding","0 0 0 5px"),ue.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),me==null||me.prepend(ue),S},mn=()=>S=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const ke=Ce.getAttribute(ue);if(ke){ke.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ne=cn(window.location.href);Ce.setAttribute(ue,new URL(ke,Ne).toString())}catch{Ce.replaceWith(Ce.textContent||ke)}}})})(Array.from(S.getElementsByTagName("a")),"href"),S);function cn(S){const H=new URL(S);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Rn=({baseUrl:S,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Ne=ue.getAttribute("href");!Ne||Ne.startsWith(S)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Ne))})}),me);var Fn=t(15459),Cn=t(80030),ge=t(72379),te=t(41547);const Ee=(0,Fn.Z)(S=>({tooltip:{fontSize:"inherit",color:S.palette.text.primary,margin:0,padding:S.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Cn.ZP),De=()=>(0,h.jsx)(ge.Z,{children:(0,h.jsx)("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"})}),qe=({text:S})=>{const[H,me]=(0,n.useState)(!1),ue=(0,n.useCallback)(()=>{window.navigator.clipboard.writeText(S),me(!0)},[S]),Ce=(0,n.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Ee,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(De,{})})})},xt=S=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const ke=Ce.textContent||"",Ne=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Ne),gn.render((0,h.jsx)(te.Z,{theme:S,children:(0,h.jsx)(qe,{text:ke})}),Ne)}return H},ae=()=>S=>{var H;return(H=S.querySelector(".md-header"))===null||H===void 0||H.remove(),S},P=()=>S=>{var H,me;return(H=S.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=S.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),S},q=({onLoading:S,onLoaded:H})=>me=>(S(),me.addEventListener(V.Ox,function ue(){H(),me.removeEventListener(V.Ox,ue)}),me),Ke=()=>S=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=S==null?void 0:S.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),S),U=()=>S=>(setTimeout(()=>{const H=S==null?void 0:S.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const Ce=ue==null?void 0:ue.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),H[H.length-1].scrollIntoView())},200),S),Z=async(S,H)=>{let me;if(typeof S=="string")me=new DOMParser().parseFromString(S,"text/html").documentElement;else if(S instanceof Element)me=S;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},ce="screen and (max-width: 76.1875em)",pe=S=>{const H=(0,Je.s0)(),me=(0,Ze.Z)(),ue=(0,je.Z)(ce),Ce=Re(),ke=fn(),Ne=(0,$.z$)(),ot=(0,$.h_)(V.Dl),ht=(0,$.h_)(We.q3),{state:ut,path:et,content:St}=(0,T.DK)(),[at,Tt]=(0,n.useState)(null),Bt=(0,V.ux)(at),Nt=(0,n.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Ft=>{if(ue)Ft.style.top="0px";else{const jn=document==null?void 0:document.querySelector(".techdocs-reader-page");var dn;const Un=(dn=jn==null?void 0:jn.getBoundingClientRect().top)!==null&&dn!==void 0?dn:0;var yn;let xn=(yn=at.getBoundingClientRect().top)!==null&&yn!==void 0?yn:0;const tn=at.querySelector(".md-container > .md-tabs");var Mn;const En=(Mn=tn==null?void 0:tn.getBoundingClientRect().height)!==null&&Mn!==void 0?Mn:0;xn<Un&&(xn=Un),Ft.style.top=`${Math.max(xn,0)+En}px`}Ft.style.setProperty("opacity","1")})},[at,ue]);(0,n.useEffect)(()=>(window.addEventListener("resize",Nt),window.addEventListener("scroll",Nt,!0),()=>{window.removeEventListener("resize",Nt),window.removeEventListener("scroll",Nt,!0)}),[at,Nt]);const vn=(0,n.useCallback)(()=>{if(!at)return;const Ut=at.querySelector(".md-footer");Ut&&(Ut.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,n.useEffect)(()=>(window.addEventListener("resize",vn),()=>{window.removeEventListener("resize",vn)}),[at,vn]),(0,n.useEffect)(()=>{Bt||(vn(),Nt())},[ut,Bt,vn,Nt]);const Gn=(0,n.useCallback)((Ut,Ft)=>Z(Ut,[Ce,Zn({techdocsStorageApi:ot,entityId:S,path:Ft}),mn(),Yt(),ae(),P(),In(ht),ke]),[S,ht,ot,Ce,ke]),wn=(0,n.useCallback)(async Ut=>Z(Ut,[Ke(),U(),xt(me),Rn({baseUrl:window.location.origin,onClick:(Ft,dn)=>{var yn;const Mn=Ft.ctrlKey||Ft.metaKey,jn=new URL(dn),Un=`${jn.pathname}${jn.search}${jn.hash}`,xn=((yn=Ft.target)===null||yn===void 0?void 0:yn.innerText)||dn,tn=dn.replace(window.location.origin,"");if(Ne.captureEvent("click",xn,{attributes:{to:tn}}),jn.hash)if(Mn)window.open(Un,"_blank");else{var En;H(Un),(En=Ut==null?void 0:Ut.querySelector(`[id="${jn.hash.slice(1)}"]`))===null||En===void 0||En.scrollIntoView()}else Mn?window.open(Un,"_blank"):H(Un)}}),q({onLoading:()=>{},onLoaded:()=>{var Ft;(Ft=Ut.querySelector(".md-nav__title"))===null||Ft===void 0||Ft.removeAttribute("for")}}),q({onLoading:()=>{Array.from(Ut.querySelectorAll(".md-sidebar")).forEach(dn=>{dn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H,Ne]);return(0,n.useEffect)(()=>{if(!St)return()=>{};let Ut=!0;return Gn(St,et).then(async Ft=>{if(!(Ft!=null&&Ft.innerHTML)||!Ut)return;window.scroll({top:0});const dn=await wn(Ft);Tt(dn)}),()=>{Ut=!1}},[St,et,Gn,wn]),at};var be=t(8560);const Be=()=>{const S=(0,V.$L)(),{shadowRoot:H}=(0,V.x1)(),me=H==null?void 0:H.querySelector('[data-md-component="content"]'),ue=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(Ce));const ke=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ne=ke==null?void 0:ke.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ne||(Ne=document.createElement("div"),Ne.setAttribute("data-techdocs-addons-location","secondary sidebar"),ke==null||ke.prepend(Ne)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:S.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:me,children:S.renderComponentsByLocation(V.oZ.Content)}),(0,h.jsx)(be.Z,{container:Ne,children:S.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},Oe=(0,g.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),He=(0,T.m1)(S=>{var H;const{withSearch:me=!0,onReady:ue}=S,Ce=Oe(),{entityMetadata:{value:ke,loading:Ne},entityRef:ot,setShadowRoot:ht}=(0,V.x1)(),ut=pe(ot),et=(0,n.useCallback)(St=>{ht(St),ue instanceof Function&&ue()},[ht,ue]);return Ne===!1&&!ke?(0,h.jsx)(x.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):ut?(0,h.jsx)(x.VY,{children:(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})}),me&&(0,h.jsx)(R.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:ot,entityTitle:ke==null||(H=ke.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(V.VA,{element:ut,onAppend:et,children:(0,h.jsx)(Be,{})})})]})}):(0,h.jsx)(x.VY,{children:(0,h.jsx)(R.Z,{container:!0,children:(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Ie,{})})})})}),st=null},93225:function(jt,Fe,t){"use strict";t.d(Fe,{S:function(){return he}});var h=t(52322),n=t(2784),g=t(18671),R=t(60905),V=t(98069),x=t(73250),l=t(61886),I=t(43297),ne=t(25271),J=t(93414),Q=t(25248),D=t(76635),X=t(95573);const _=(0,h.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),he=ie=>{const{children:E}=ie,L=(0,l.$L)(),$=(0,Q.h_)(Q.Ds),{title:A,setTitle:T,subtitle:ee,setSubtitle:Ie,entityRef:Je,metadata:{value:Ze,loading:je},entityMetadata:{value:We,loading:gt}}=(0,l.x1)();(0,n.useEffect)(()=>{!Ze||(T(Ze.site_name),Ie(()=>{let{site_description:re}=Ze;return(!re||re==="None")&&(re=""),re}))},[Ze,T,Ie]);const nt=$.getOptional("app.title")||"Backstage",Me=[A,ee,nt].filter(Boolean).join(" | "),{locationMetadata:ze,spec:Qe}=We||{},rt=Qe==null?void 0:Qe.lifecycle,ct=We?(0,I.hF)(We,ne.S4):[],lt=(0,Q.tg)(X._Z)(),mt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(J.i9,{label:(0,D.capitalize)((We==null?void 0:We.kind)||"entity"),value:(0,h.jsx)(I.dx,{color:"inherit",entityRef:Je,title:We==null?void 0:We.metadata.title,defaultKind:"Component"})}),ct.length>0&&(0,h.jsx)(J.i9,{label:"Owner",value:(0,h.jsx)(I.rI,{color:"inherit",entityRefs:ct,defaultKind:"group"})}),rt?(0,h.jsx)(J.i9,{label:"Lifecycle",value:rt}):null,ze&&ze.type!=="dir"&&ze.type!=="file"?(0,h.jsx)(J.i9,{label:"",value:(0,h.jsxs)(R.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(R.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(x.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(R.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:ze.target}):null]});return!gt&&We===void 0||!je&&Ze===void 0?null:(0,h.jsxs)(J.h4,{type:"Documentation",typeLink:lt,title:A||_,subtitle:ee===""?void 0:ee||_,children:[(0,h.jsx)(g.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Me})}),mt,E,L.renderComponentsByLocation(l.oZ.Header)]})}},65124:function(jt,Fe,t){"use strict";t.d(Fe,{b:function(){return D}});var h=t(52322),n=t(2784),g=t(79692),R=t(15223),V=t(95544),x=t(80030),l=t(61837),I=t(48348),ne=t(47603),J=t(61886);const Q=(0,g.Z)(X=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:X.spacing(3,3,0)}})),D=X=>{const _=Q(),[he,ie]=(0,n.useState)(null),E=(0,n.useCallback)(Je=>{ie(Je.currentTarget)},[]),L=(0,n.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:$,loading:A}}=(0,J.x1)(),T=(0,J.$L)(),ee=T.renderComponentsByLocation(J.oZ.Subheader),Ie=T.renderComponentsByLocation(J.oZ.Settings);return!ee&&!Ie||A===!1&&!$?null:(0,h.jsx)(R.Z,{classes:_,...X.toolbarProps,children:(0,h.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[ee,Ie?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(x.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:E,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(I.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(he),onClose:L,keepMounted:!0,children:Ie})]}):null]})})}},95481:function(jt,Fe,t){"use strict";t.d(Fe,{DK:function(){return D},m1:function(){return _}});var h=t(52322),n=t(2784),g=t(10289),R=t(61886),V=t(25248),x=t(64279),l=t(77446);function I({contentLoading:he,content:ie,activeSyncState:E}){return he||E==="BUILD_READY_RELOAD"||!ie&&E==="CHECKING"?"CHECKING":!ie&&E==="BUILDING"?"INITIAL_BUILD":ie?E==="BUILDING"?"CONTENT_STALE_REFRESHING":E==="BUILD_READY"?"CONTENT_STALE_READY":E==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(he,ie){const E={...he};switch(ie.type){case"sync":ie.state==="CHECKING"&&(E.buildLog=[]),E.activeSyncState=ie.state,E.syncError=ie.syncError;break;case"contentLoading":E.contentLoading=!0,E.contentError=void 0;break;case"content":typeof ie.path=="string"&&(E.path=ie.path),E.contentLoading=!1,E.content=ie.content,E.contentError=ie.contentError;break;case"buildLog":E.buildLog=E.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(E.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(E.activeSyncState="UP_TO_DATE",E.buildLog=[]),E}function J(he,ie,E,L){var $,A;const[T,ee]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Ie=(0,V.h_)(R.Dl),{retry:Je}=(0,l.Z)(async()=>{ee({type:"contentLoading"});try{const We=await Ie.getEntityDocs({kind:he,namespace:ie,name:E},L);return ee({type:"content",content:We,path:L}),We}catch(We){ee({type:"content",contentError:We,path:L})}},[Ie,he,ie,E,L]),Ze=(0,n.useRef)({content:void 0,reload:()=>{}});return Ze.current={content:T.content,reload:Je},(0,x.default)(async()=>{ee({type:"sync",state:"CHECKING"});const We=setTimeout(()=>{ee({type:"sync",state:"BUILDING"})},1e3);try{switch(await Ie.syncEntityDocs({kind:he,namespace:ie,name:E},nt=>{ee({type:"buildLog",log:nt})})){case"updated":Ze.current.content?ee({type:"sync",state:"BUILD_READY"}):(Ze.current.reload(),ee({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":ee({type:"sync",state:"UP_TO_DATE"});break;default:ee({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(gt){ee({type:"sync",state:"ERROR",syncError:gt})}finally{clearTimeout(We)}},[he,E,ie,Ie,ee,Ze]),{state:(0,n.useMemo)(()=>I({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Je,path:T.path,content:T.content,contentErrorMessage:($=T.contentError)===null||$===void 0?void 0:$.toString(),syncErrorMessage:(A=T.syncError)===null||A===void 0?void 0:A.toString(),buildLog:T.buildLog}}const Q=(0,n.createContext)({}),D=()=>(0,n.useContext)(Q),X=({children:he})=>{const{"*":ie=""}=(0,g.UO)(),{entityRef:E}=(0,R.x1)(),{kind:L,namespace:$,name:A}=E,T=J(L,$,A,ie);return(0,h.jsx)(Q.Provider,{value:T,children:he instanceof Function?he(T):he})},_=he=>ie=>(0,h.jsx)(X,{children:(0,h.jsx)(he,{...ie})})},95573:function(jt,Fe,t){"use strict";t.d(Fe,{Fw:function(){return g},_Z:function(){return n},pd:function(){return R}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),g=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),R=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(jt,Fe,t){"use strict";t.d(Fe,{S:function(){return L}});var h=t(52322),n=t(2784),g=t(79692),R=t(49378),V=t(38402),x=t(86136),l=t(85256),I=t(93414),ne=t(25248),J=t(65826);const Q=(0,g.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),D=$=>{const{result:A,highlight:T,rank:ee,lineClamp:Ie=5,asListItem:Je=!0,asLink:Ze=!0,title:je,icon:We}=$,gt=Q(),nt=(0,ne.z$)(),Me=()=>{nt.captureEvent("discover",A.title,{attributes:{to:A.location},value:ee})},ze=()=>{const ct=T!=null&&T.fields.title?(0,h.jsx)(J.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):A.title,lt=T!=null&&T.fields.entityTitle?(0,h.jsx)(J.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):A.entityTitle,mt=T!=null&&T.fields.name?(0,h.jsx)(J.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):A.name;return(0,h.jsx)(R.Z,{className:gt.itemText,primaryTypographyProps:{variant:"h6"},primary:je||(0,h.jsxs)(h.Fragment,{children:[ct," | ",lt!=null?lt:mt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Ie,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(J.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):A.text})})},Qe=({children:ct})=>Ze?(0,h.jsx)(I.rU,{noTrack:!0,to:A.location,onClick:Me,children:ct}):(0,h.jsx)(h.Fragment,{children:ct}),rt=({children:ct})=>Je?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(V.Z,{alignItems:"flex-start",children:[We&&(0,h.jsx)(x.Z,{children:We}),(0,h.jsx)("div",{className:gt.flexContainer,children:ct})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ct});return(0,h.jsx)(Qe,{children:(0,h.jsx)(rt,{children:(0,h.jsx)(ze,{})})})};var X=t(27556),_=t(10289);const he=(0,g.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),ie=$=>$==null?void 0:$.document,E=$=>{const{entityId:A,entityTitle:T,debounceTime:ee=150}=$,[Ie,Je]=(0,n.useState)(!1),Ze=(0,_.s0)(),{setFilters:je,result:{loading:We,value:gt}}=(0,J.Rx)(),nt=he(),[Me,ze]=(0,n.useState)([]);(0,n.useEffect)(()=>{let mt=!0;if(mt&&gt){const vt=gt.results.slice(0,10);ze(vt)}return()=>{mt=!1}},[We,gt]);const{kind:Qe,name:rt,namespace:ct}=A;(0,n.useEffect)(()=>{je(mt=>({...mt,kind:Qe,namespace:ct,name:rt}))},[Qe,ct,rt,je]);const lt=(mt,vt)=>{if(ie(vt)){const{location:Ge}=vt.document;Ze(Ge)}};return(0,h.jsx)(X.Z,{className:nt.bar,variant:"outlined",children:(0,h.jsx)(J.qO,{classes:{root:nt.root},"data-testid":"techdocs-search-bar",size:"small",open:Ie,getOptionLabel:()=>"",filterOptions:mt=>mt,onClose:()=>{Je(!1)},onFocus:()=>{Je(!0)},onChange:lt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Me,renderOption:({document:mt,highlight:vt})=>(0,h.jsx)(D,{result:mt,lineClamp:3,asListItem:!1,asLink:!1,title:mt.title,highlight:vt}),loading:We,inputDebounceTime:ee,inputPlaceholder:`Search ${T||A.name} docs`,freeSolo:!1})})},L=$=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(J.Nd,{initialState:A,children:(0,h.jsx)(E,{...$})})}},53260:function(){}},function(jt){var Fe=function(h){return jt(jt.s=h)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Fe(96215)});var t=jt.O()}]);})();
493
493
 
494
- //# sourceMappingURL=main.46e63078.js.map
494
+ //# sourceMappingURL=main.33b5991d.js.map