@techdocs/cli 0.0.0-nightly-20230106022925 → 0.0.0-nightly-20230108022900

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-20230106022925
3
+ ## 0.0.0-nightly-20230108022900
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/backend-common@0.0.0-nightly-20230106022925
9
- - @backstage/catalog-model@0.0.0-nightly-20230106022925
10
- - @backstage/config@0.0.0-nightly-20230106022925
8
+ - @backstage/backend-common@0.0.0-nightly-20230108022900
9
+ - @backstage/catalog-model@0.0.0-nightly-20230108022900
10
+ - @backstage/config@0.0.0-nightly-20230108022900
11
11
  - @backstage/cli-common@0.1.11
12
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20230106022925
12
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20230108022900
13
13
 
14
14
  ## 1.2.5-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.d30c73dd.js"></script><script defer="defer" src="/static/module-material-ui.8008c157.js"></script><script defer="defer" src="/static/module-lodash.f07e54c1.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.07e5c2aa.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.9cc2c5ac.js"></script><script defer="defer" src="/static/module-octokit.08c0a003.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/module-remix-run.e15d5a2e.js"></script><script defer="defer" src="/static/vendor.d30c73dd.js"></script><script defer="defer" src="/static/main.d30c73dd.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.363a394f.js"></script><script defer="defer" src="/static/module-material-ui.8008c157.js"></script><script defer="defer" src="/static/module-lodash.f07e54c1.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.07e5c2aa.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.9cc2c5ac.js"></script><script defer="defer" src="/static/module-octokit.c67cdf8f.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/module-remix-run.e15d5a2e.js"></script><script defer="defer" src="/static/vendor.363a394f.js"></script><script defer="defer" src="/static/main.363a394f.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:`),it=(Oe==null?void 0:Oe.type)==="github"?(0,In.BT)(Ce.href,"blob"):Ce.href,ft=Xt()(it),xt=`/${ft.organization}/${ft.name}`,at=ue.cloneNode();switch(Oe==null?void 0:Oe.type){case"gitlab":at.href=`${Ce.origin}${xt}/issues/new?issue[title]=${dt}&issue[description]=${Et}`;break;case"github":at.href=`${Ce.origin}${xt}/issues/new?title=${dt}&body=${Et}`;break;default:return H}return yn.render(r.createElement(Un.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 zn=t(44882);const fn=()=>C=>{const H=C.querySelector('.md-header label[for="__drawer"]'),me=C.querySelector("article");if(!H||!me)return C;const ue=H.cloneNode();return yn.render(r.createElement(zn.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),C},xn=()=>C=>(((me,ue)=>{Array.from(me).filter(Ce=>Ce.hasAttribute(ue)).forEach(Ce=>{const Oe=Ce.getAttribute(ue);if(Oe){Oe.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Fe=bn(window.location.href);Ce.setAttribute(ue,new URL(Oe,Fe).toString())}catch{Ce.replaceWith(Ce.textContent||Oe)}}})})(Array.from(C.getElementsByTagName("a")),"href"),C);function bn(C){const H=new URL(C);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Pn=({baseUrl:C,onClick:H})=>me=>(Array.from(me.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",Ce=>{const Fe=ue.getAttribute("href");!Fe||Fe.startsWith(C)&&!ue.hasAttribute("download")&&(Ce.preventDefault(),H(Ce,Fe))})}),me);var kn=t(15459),Sn=t(80030),ge=t(72379),ee=t(41547);const Re=(0,kn.Z)(C=>({tooltip:{fontSize:"inherit",color:C.palette.text.primary,margin:0,padding:C.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Sn.ZP),Ne=()=>(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"})}),et=({text:C})=>{const[H,me]=(0,r.useState)(!1),ue=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(C),me(!0)},[C]),Ce=(0,r.useCallback)(()=>{me(!1)},[me]);return(0,h.jsx)(Re,{title:"Copied to clipboard",placement:"left",open:H,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Ne,{})})})},jt=C=>H=>{const me=H.querySelectorAll("pre > code");for(const Ce of me){var ue;const Oe=Ce.textContent||"",Fe=document.createElement("div");Ce==null||(ue=Ce.parentElement)===null||ue===void 0||ue.prepend(Fe),yn.render((0,h.jsx)(ee.Z,{theme:C,children:(0,h.jsx)(et,{text:Oe})}),Fe)}return H},ie=()=>C=>{var H;return(H=C.querySelector(".md-header"))===null||H===void 0||H.remove(),C},k=()=>C=>{var H,me;return(H=C.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(me=C.querySelector(".md-footer-copyright"))===null||me===void 0||me.remove(),C},ce=({onLoading:C,onLoaded:H})=>me=>(C(),me.addEventListener(g.Ox,function ue(){H(),me.removeEventListener(g.Ox,ue)}),me),Be=()=>C=>(setTimeout(()=>{if(window.location.hash){var H;const me=window.location.hash.slice(1);(H=C==null?void 0:C.querySelector(`[id="${me}"]`))===null||H===void 0||H.scrollIntoView()}},200),C),Z=()=>C=>(setTimeout(()=>{const H=C==null?void 0:C.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),C),U=async(C,H)=>{let me;if(typeof C=="string")me=new DOMParser().parseFromString(C,"text/html").documentElement;else if(C instanceof Element)me=C;else throw new Error("dom is not a recognized type");for(const ue of H)me=await ue(me);return me},de="screen and (max-width: 76.1875em)",pe=C=>{const H=(0,Xe.s0)(),me=(0,Qe.Z)(),ue=(0,qe.Z)(de),Ce=Pe(),Oe=hn(),Fe=(0,D.z$)(),dt=(0,D.h_)(g.Dl),Et=(0,D.h_)(He.q3),{state:it,path:ft,content:xt}=(0,S.DK)(),[at,Bt]=(0,r.useState)(null),Mt=(0,g.ux)(at),zt=(0,r.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Nt=>{if(ue)Nt.style.top="0px";else{const wn=document==null?void 0:document.querySelector(".techdocs-reader-page");var rn;const jn=(rn=wn==null?void 0:wn.getBoundingClientRect().top)!==null&&rn!==void 0?rn:0;var On;let Gn=(On=at.getBoundingClientRect().top)!==null&&On!==void 0?On:0;const gn=at.querySelector(".md-container > .md-tabs");var Qn;const Rn=(Qn=gn==null?void 0:gn.getBoundingClientRect().height)!==null&&Qn!==void 0?Qn:0;Gn<jn&&(Gn=jn),Nt.style.top=`${Math.max(Gn,0)+Rn}px`}Nt.style.setProperty("opacity","1")})},[at,ue]);(0,r.useEffect)(()=>(window.addEventListener("resize",zt),window.addEventListener("scroll",zt,!0),()=>{window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt,!0)}),[at,zt]);const qt=(0,r.useCallback)(()=>{if(!at)return;const Dt=at.querySelector(".md-footer");Dt&&(Dt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,r.useEffect)(()=>(window.addEventListener("resize",qt),()=>{window.removeEventListener("resize",qt)}),[at,qt]),(0,r.useEffect)(()=>{Mt||(qt(),zt())},[it,Mt,qt,zt]);const Wn=(0,r.useCallback)((Dt,Nt)=>U(Dt,[Ce,Fn({techdocsStorageApi:dt,entityId:C,path:Nt}),xn(),fn(),ie(),k(),Mn(Et),Oe]),[C,Et,dt,Ce,Oe]),Cn=(0,r.useCallback)(async Dt=>U(Dt,[Be(),Z(),jt(me),Pn({baseUrl:window.location.origin,onClick:(Nt,rn)=>{var On;const Qn=Nt.ctrlKey||Nt.metaKey,wn=new URL(rn),jn=`${wn.pathname}${wn.search}${wn.hash}`,Gn=((On=Nt.target)===null||On===void 0?void 0:On.innerText)||rn,gn=rn.replace(window.location.origin,"");if(Fe.captureEvent("click",Gn,{attributes:{to:gn}}),wn.hash)if(Qn)window.open(jn,"_blank");else{var Rn;H(jn),(Rn=Dt==null?void 0:Dt.querySelector(`[id="${wn.hash.slice(1)}"]`))===null||Rn===void 0||Rn.scrollIntoView()}else Qn?window.open(jn,"_blank"):H(jn)}}),ce({onLoading:()=>{},onLoaded:()=>{var Nt;(Nt=Dt.querySelector(".md-nav__title"))===null||Nt===void 0||Nt.removeAttribute("for")}}),ce({onLoading:()=>{Array.from(Dt.querySelectorAll(".md-sidebar")).forEach(rn=>{rn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[me,H,Fe]);return(0,r.useEffect)(()=>{if(!xt)return()=>{};let Dt=!0;return Wn(xt,ft).then(async Nt=>{if(!(Nt!=null&&Nt.innerHTML)||!Dt)return;window.scroll({top:0});const rn=await Cn(Nt);Bt(rn)}),()=>{Dt=!1}},[xt,ft,Wn,Cn]),at};var be=t(8560);const $e=()=>{const C=(0,g.$L)(),{shadowRoot:H}=(0,g.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 Oe=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=Oe==null?void 0:Oe.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),Oe==null||Oe.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:C.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:me,children:C.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(be.Z,{container:Fe,children:C.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Ee=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ue=(0,S.m1)(C=>{var H;const{withSearch:me=!0,onReady:ue}=C,Ce=Ee(),{entityMetadata:{value:Oe,loading:Fe},entityRef:dt,setShadowRoot:Et}=(0,g.x1)(),it=pe(dt),ft=(0,r.useCallback)(xt=>{Et(xt),ue instanceof Function&&ue()},[Et,ue]);return Fe===!1&&!Oe?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):it?(0,h.jsx)(b.VY,{children:(0,h.jsxs)($.Z,{container:!0,children:[(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})}),me&&(0,h.jsx)($.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:dt,entityTitle:Oe==null||(H=Oe.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:it,onAppend:ft,children:(0,h.jsx)($e,{})})})]})}):(0,h.jsx)(b.VY,{children:(0,h.jsx)($.Z,{container:!0,children:(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(Le,{})})})})}),nt=null},93225:function(Rt,ze,t){"use strict";t.d(ze,{S:function(){return fe}});var h=t(52322),r=t(2784),W=t(18671),$=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(56941),te=t(25271),Q=t(93414),X=t(25248),z=t(76635),M=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),fe=le=>{const{children:T}=le,L=(0,c.$L)(),D=(0,X.h_)(X.Ds),{title:A,setTitle:S,subtitle:q,setSubtitle:Le,entityRef:Xe,metadata:{value:Qe,loading:qe},entityMetadata:{value:He,loading:mt}}=(0,c.x1)();(0,r.useEffect)(()=>{!Qe||(S(Qe.site_name),Le(()=>{let{site_description:oe}=Qe;return(!oe||oe==="None")&&(oe=""),oe}))},[Qe,S,Le]);const Te=D.getOptional("app.title")||"Backstage",Ye=[A,q,Te].filter(Boolean).join(" | "),{locationMetadata:st,spec:vt}=He||{},rt=vt==null?void 0:vt.lifecycle,ot=He?(0,P.hF)(He,te.S4):[],ct=(0,X.tg)(M._Z)(),bt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.i9,{label:(0,z.capitalize)((He==null?void 0:He.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Xe,title:He==null?void 0:He.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(Q.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(Q.i9,{label:"",value:(0,h.jsxs)($.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)($.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)($.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:st.target}):null]});return!mt&&He===void 0||!qe&&Qe===void 0?null:(0,h.jsxs)(Q.h4,{type:"Documentation",typeLink:ct,title:A||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ye})}),bt,T,L.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(Rt,ze,t){"use strict";t.d(ze,{b:function(){return z}});var h=t(52322),r=t(2784),W=t(79692),$=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),Q=t(61886);const X=(0,W.Z)(M=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:M.spacing(3,3,0)}})),z=M=>{const _=X(),[fe,le]=(0,r.useState)(null),T=(0,r.useCallback)(Xe=>{le(Xe.currentTarget)},[]),L=(0,r.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:D,loading:A}}=(0,Q.x1)(),S=(0,Q.$L)(),q=S.renderComponentsByLocation(Q.oZ.Subheader),Le=S.renderComponentsByLocation(Q.oZ.Settings);return!q&&!Le||A===!1&&!D?null:(0,h.jsx)($.Z,{classes:_,...M.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[q,Le?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(b.ZP,{title:"Settings",children:(0,h.jsx)(c.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:T,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:fe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(fe),onClose:L,keepMounted:!0,children:Le})]}):null]})})}},95481:function(Rt,ze,t){"use strict";t.d(ze,{DK:function(){return z},m1:function(){return _}});var h=t(52322),r=t(2784),W=t(79635),$=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:fe,content:le,activeSyncState:T}){return fe||T==="BUILD_READY_RELOAD"||!le&&T==="CHECKING"?"CHECKING":!le&&T==="BUILDING"?"INITIAL_BUILD":le?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(fe,le){const T={...fe};switch(le.type){case"sync":le.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=le.state,T.syncError=le.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof le.path=="string"&&(T.path=le.path),T.contentLoading=!1,T.content=le.content,T.contentError=le.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function Q(fe,le,T,L){var D,A;const[S,q]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Le=(0,g.h_)($.Dl),{retry:Xe}=(0,c.Z)(async()=>{q({type:"contentLoading"});try{const He=await Le.getEntityDocs({kind:fe,namespace:le,name:T},L);return q({type:"content",content:He,path:L}),He}catch(He){q({type:"content",contentError:He,path:L})}},[Le,fe,le,T,L]),Qe=(0,r.useRef)({content:void 0,reload:()=>{}});return Qe.current={content:S.content,reload:Xe},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const He=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Le.syncEntityDocs({kind:fe,namespace:le,name:T},Te=>{q({type:"buildLog",log:Te})})){case"updated":Qe.current.content?q({type:"sync",state:"BUILD_READY"}):(Qe.current.reload(),q({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":q({type:"sync",state:"UP_TO_DATE"});break;default:q({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(mt){q({type:"sync",state:"ERROR",syncError:mt})}finally{clearTimeout(He)}},[fe,T,le,Le,q,Qe]),{state:(0,r.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:Xe,path:S.path,content:S.content,contentErrorMessage:(D=S.contentError)===null||D===void 0?void 0:D.toString(),syncErrorMessage:(A=S.syncError)===null||A===void 0?void 0:A.toString(),buildLog:S.buildLog}}const X=(0,r.createContext)({}),z=()=>(0,r.useContext)(X),M=({children:fe})=>{const{"*":le=""}=(0,W.UO)(),{entityRef:T}=(0,$.x1)(),{kind:L,namespace:D,name:A}=T,S=Q(L,D,A,le);return(0,h.jsx)(X.Provider,{value:S,children:fe instanceof Function?fe(S):fe})},_=fe=>le=>(0,h.jsx)(M,{children:(0,h.jsx)(fe,{...le})})},95573:function(Rt,ze,t){"use strict";t.d(ze,{Fw:function(){return W},_Z:function(){return r},pd:function(){return $}});var h=t(25248);const r=(0,h.NT)({id:"techdocs:index-page"}),W=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),$=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(Rt,ze,t){"use strict";t.d(ze,{S:function(){return L}});var h=t(52322),r=t(2784),W=t(79692),$=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(93414),te=t(25248),Q=t(65826);const X=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),z=D=>{const{result:A,highlight:S,rank:q,lineClamp:Le=5,asListItem:Xe=!0,asLink:Qe=!0,title:qe,icon:He}=D,mt=X(),Te=(0,te.z$)(),Ye=()=>{Te.captureEvent("discover",A.title,{attributes:{to:A.location},value:q})},st=({children:ot})=>Qe?(0,h.jsx)(P.rU,{noTrack:!0,to:A.location,onClick:Ye,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),vt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(Q.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):A.title,ct=S!=null&&S.fields.entityTitle?(0,h.jsx)(Q.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):A.entityTitle,bt=S!=null&&S.fields.name?(0,h.jsx)(Q.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):A.name;return(0,h.jsx)($.Z,{className:mt.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:qe||(0,h.jsxs)(h.Fragment,{children:[ot," | ",ct!=null?ct:bt," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Le,overflow:"hidden"},children:S!=null&&S.fields.text?(0,h.jsx)(Q.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):A.text})})},rt=({children:ot})=>Xe?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[He&&(0,h.jsx)(b.Z,{children:He}),(0,h.jsx)("div",{className:mt.flexContainer,children:ot})]}),(0,h.jsx)(c.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:ot});return(0,h.jsx)(rt,{children:(0,h.jsx)(vt,{})})};var M=t(27556),_=t(79635);const fe=(0,W.Z)(D=>({root:{width:"100%"},bar:{padding:D.spacing(1)}})),le=D=>D==null?void 0:D.document,T=D=>{const{entityId:A,entityTitle:S,debounceTime:q=150}=D,[Le,Xe]=(0,r.useState)(!1),Qe=(0,_.s0)(),{setFilters:qe,result:{loading:He,value:mt}}=(0,Q.Rx)(),Te=fe(),[Ye,st]=(0,r.useState)([]);(0,r.useEffect)(()=>{let bt=!0;if(bt&&mt){const Lt=mt.results.slice(0,10);st(Lt)}return()=>{bt=!1}},[He,mt]);const{kind:vt,name:rt,namespace:ot}=A;(0,r.useEffect)(()=>{qe(bt=>({...bt,kind:vt,namespace:ot,name:rt}))},[vt,ot,rt,qe]);const ct=(bt,Lt)=>{if(le(Lt)){const{location:Ve}=Lt.document;Qe(Ve)}};return(0,h.jsx)(M.Z,{className:Te.bar,variant:"outlined",children:(0,h.jsx)(Q.qO,{classes:{root:Te.root},"data-testid":"techdocs-search-bar",size:"small",open:Le,getOptionLabel:()=>"",filterOptions:bt=>bt,onClose:()=>{Xe(!1)},onFocus:()=>{Xe(!0)},onChange:ct,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ye,renderOption:({document:bt,highlight:Lt})=>(0,h.jsx)(z,{result:bt,lineClamp:3,asListItem:!1,asLink:!1,title:bt.title,highlight:Lt}),loading:He,inputDebounceTime:q,inputPlaceholder:`Search ${S||A.name} docs`,freeSolo:!1})})},L=D=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:D.entityId};return(0,h.jsx)(Q.Nd,{initialState:A,children:(0,h.jsx)(T,{...D})})}},53260:function(){}},function(Rt){var ze=function(h){return Rt(Rt.s=h)};Rt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return ze(51102)});var t=Rt.O()}]);})();
493
493
 
494
- //# sourceMappingURL=main.d30c73dd.js.map
494
+ //# sourceMappingURL=main.363a394f.js.map