@techdocs/cli 0.0.0-nightly-20221219022033 → 0.0.0-nightly-20221220022526

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,16 +1,16 @@
1
1
  # @techdocs/cli
2
2
 
3
- ## 0.0.0-nightly-20221219022033
3
+ ## 0.0.0-nightly-20221220022526
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - 8015ff1258: Tweaked wording to use inclusive terminology
8
8
  - Updated dependencies
9
- - @backstage/backend-common@0.0.0-nightly-20221219022033
10
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20221219022033
11
- - @backstage/cli-common@0.0.0-nightly-20221219022033
12
- - @backstage/catalog-model@0.0.0-nightly-20221219022033
13
- - @backstage/config@0.0.0-nightly-20221219022033
9
+ - @backstage/backend-common@0.0.0-nightly-20221220022526
10
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20221220022526
11
+ - @backstage/cli-common@0.0.0-nightly-20221220022526
12
+ - @backstage/catalog-model@0.0.0-nightly-20221220022526
13
+ - @backstage/config@0.0.0-nightly-20221220022526
14
14
 
15
15
  ## 1.2.4-next.3
16
16
 
@@ -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.8b0c4c2f.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.2efe45a5.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.8ea19264.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/module-remix-run.e15d5a2e.js"></script><script defer="defer" src="/static/vendor.8b0c4c2f.js"></script><script defer="defer" src="/static/main.8b0c4c2f.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.11038605.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.2efe45a5.js"></script><script defer="defer" src="/static/module-material-table.ac270938.js"></script><script defer="defer" src="/static/module-luxon.8ea19264.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/module-remix-run.e15d5a2e.js"></script><script defer="defer" src="/static/vendor.11038605.js"></script><script defer="defer" src="/static/main.11038605.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:`),Ke=(ke==null?void 0:ke.type)==="github"?(0,En.BT)(we.href,"blob"):we.href,ht=Qt()(Ke),vt=`/${ht.organization}/${ht.name}`,at=ue.cloneNode();switch(ke==null?void 0:ke.type){case"gitlab":at.href=`${we.origin}${vt}/issues/new?issue[title]=${it}&issue[description]=${Ct}`;break;case"github":at.href=`${we.origin}${vt}/issues/new?title=${it}&body=${Ct}`;break;default:return H}return mn.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 hn=()=>w=>{const H=w.querySelector('.md-header label[for="__drawer"]'),ve=w.querySelector("article");if(!H||!ve)return w;const ue=H.cloneNode();return mn.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"),ve==null||ve.prepend(ue),w},vn=()=>w=>(((ve,ue)=>{Array.from(ve).filter(we=>we.hasAttribute(ue)).forEach(we=>{const ke=we.getAttribute(ue);if(ke){ke.match(/^https?:\/\//i)&&we.setAttribute("target","_blank");try{const Fe=yn(window.location.href);we.setAttribute(ue,new URL(ke,Fe).toString())}catch{we.replaceWith(we.textContent||ke)}}})})(Array.from(w.getElementsByTagName("a")),"href"),w);function yn(w){const H=new URL(w);return!H.pathname.endsWith("/")&&!H.pathname.endsWith(".html")&&(H.pathname+="/"),H.toString()}const Ln=({baseUrl:w,onClick:H})=>ve=>(Array.from(ve.getElementsByTagName("a")).forEach(ue=>{ue.addEventListener("click",we=>{const Fe=ue.getAttribute("href");!Fe||Fe.startsWith(w)&&!ue.hasAttribute("download")&&(we.preventDefault(),H(we,Fe))})}),ve);var Pn=t(15459),xn=t(80030),ge=t(72379),ee=t(41547);const Ee=(0,Pn.Z)(w=>({tooltip:{fontSize:"inherit",color:w.palette.text.primary,margin:0,padding:w.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(xn.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"})}),qe=({text:w})=>{const[H,ve]=(0,r.useState)(!1),ue=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(w),ve(!0)},[w]),we=(0,r.useCallback)(()=>{ve(!1)},[ve]);return(0,h.jsx)(Ee,{title:"Copied to clipboard",placement:"left",open:H,onClose:we,leaveDelay:1e3,children:(0,h.jsx)(te.Z,{className:"md-clipboard md-icon",onClick:ue,children:(0,h.jsx)(Ne,{})})})},wt=w=>H=>{const ve=H.querySelectorAll("pre > code");for(const we of ve){var ue;const ke=we.textContent||"",Fe=document.createElement("div");we==null||(ue=we.parentElement)===null||ue===void 0||ue.prepend(Fe),mn.render((0,h.jsx)(ee.Z,{theme:w,children:(0,h.jsx)(qe,{text:ke})}),Fe)}return H},ie=()=>w=>{var H;return(H=w.querySelector(".md-header"))===null||H===void 0||H.remove(),w},k=()=>w=>{var H,ve;return(H=w.querySelector(".md-footer .md-copyright"))===null||H===void 0||H.remove(),(ve=w.querySelector(".md-footer-copyright"))===null||ve===void 0||ve.remove(),w},ce=({onLoading:w,onLoaded:H})=>ve=>(w(),ve.addEventListener(g.Ox,function ue(){H(),ve.removeEventListener(g.Ox,ue)}),ve),Oe=()=>w=>(setTimeout(()=>{if(window.location.hash){var H;const ve=window.location.hash.slice(1);(H=w==null?void 0:w.querySelector(`[id="${ve}"]`))===null||H===void 0||H.scrollIntoView()}},200),w),D=()=>w=>(setTimeout(()=>{const H=w==null?void 0:w.querySelectorAll("li.md-nav__item--active");H.length!==0&&(H.forEach(ue=>{const we=ue==null?void 0:ue.querySelector("input");we!=null&&we.checked||we==null||we.click()}),H[H.length-1].scrollIntoView())},200),w),U=async(w,H)=>{let ve;if(typeof w=="string")ve=new DOMParser().parseFromString(w,"text/html").documentElement;else if(w instanceof Element)ve=w;else throw new Error("dom is not a recognized type");for(const ue of H)ve=await ue(ve);return ve},de="screen and (max-width: 76.1875em)",fe=w=>{const H=(0,et.s0)(),ve=(0,Xe.Z)(),ue=(0,Ye.Z)(de),we=Ie(),ke=dn(),Fe=(0,O.z$)(),it=(0,O.h_)(g.Dl),Ct=(0,O.h_)(Ve.q3),{state:Ke,path:ht,content:vt}=(0,S.DK)(),[at,Tt]=(0,r.useState)(null),Ut=(0,g.ux)(at),Mt=(0,r.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(zt=>{if(ue)zt.style.top="0px";else{const Sn=document==null?void 0:document.querySelector(".techdocs-reader-page");var _t;const pn=(_t=Sn==null?void 0:Sn.getBoundingClientRect().top)!==null&&_t!==void 0?_t:0;var kn;let Hn=(kn=at.getBoundingClientRect().top)!==null&&kn!==void 0?kn:0;const ln=at.querySelector(".md-container > .md-tabs");var Jn;const On=(Jn=ln==null?void 0:ln.getBoundingClientRect().height)!==null&&Jn!==void 0?Jn:0;Hn<pn&&(Hn=pn),zt.style.top=`${Math.max(Hn,0)+On}px`}zt.style.setProperty("opacity","1")})},[at,ue]);(0,r.useEffect)(()=>(window.addEventListener("resize",Mt),window.addEventListener("scroll",Mt,!0),()=>{window.removeEventListener("resize",Mt),window.removeEventListener("scroll",Mt,!0)}),[at,Mt]);const Wn=(0,r.useCallback)(()=>{if(!at)return;const Nt=at.querySelector(".md-footer");Nt&&(Nt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,r.useEffect)(()=>(window.addEventListener("resize",Wn),()=>{window.removeEventListener("resize",Wn)}),[at,Wn]),(0,r.useEffect)(()=>{Ut||(Wn(),Mt())},[Ke,Ut,Wn,Mt]);const Vn=(0,r.useCallback)((Nt,zt)=>U(Nt,[we,Fn({techdocsStorageApi:it,entityId:w,path:zt}),vn(),hn(),ie(),k(),Mn(Ct),ke]),[w,Ct,it,we,ke]),bn=(0,r.useCallback)(async Nt=>U(Nt,[Oe(),D(),wt(ve),Ln({baseUrl:window.location.origin,onClick:(zt,_t)=>{var kn;const Jn=zt.ctrlKey||zt.metaKey,Sn=new URL(_t),pn=`${Sn.pathname}${Sn.search}${Sn.hash}`,Hn=((kn=zt.target)===null||kn===void 0?void 0:kn.innerText)||_t,ln=_t.replace(window.location.origin,"");if(Fe.captureEvent("click",Hn,{attributes:{to:ln}}),Sn.hash)if(Jn)window.open(pn,"_blank");else{var On;H(pn),(On=Nt==null?void 0:Nt.querySelector(`[id="${Sn.hash.slice(1)}"]`))===null||On===void 0||On.scrollIntoView()}else Jn?window.open(pn,"_blank"):H(pn)}}),ce({onLoading:()=>{},onLoaded:()=>{var zt;(zt=Nt.querySelector(".md-nav__title"))===null||zt===void 0||zt.removeAttribute("for")}}),ce({onLoading:()=>{Array.from(Nt.querySelectorAll(".md-sidebar")).forEach(_t=>{_t.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ve,H,Fe]);return(0,r.useEffect)(()=>{if(!vt)return()=>{};let Nt=!0;return Vn(vt,ht).then(async zt=>{if(!(zt!=null&&zt.innerHTML)||!Nt)return;window.scroll({top:0});const _t=await bn(zt);Tt(_t)}),()=>{Nt=!1}},[vt,ht,Vn,bn]),at};var ye=t(8560);const Pe=()=>{const w=(0,g.$L)(),{shadowRoot:H}=(0,g.x1)(),ve=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 we=ue==null?void 0:ue.querySelector('[data-techdocs-addons-location="primary sidebar"]');we||(we=document.createElement("div"),we.setAttribute("data-techdocs-addons-location","primary sidebar"),ue==null||ue.prepend(we));const ke=H==null?void 0:H.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Fe=ke==null?void 0:ke.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Fe||(Fe=document.createElement("div"),Fe.setAttribute("data-techdocs-addons-location","secondary sidebar"),ke==null||ke.prepend(Fe)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ye.Z,{container:we,children:w.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(ye.Z,{container:ve,children:w.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(ye.Z,{container:Fe,children:w.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},Le=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Ue=(0,S.m1)(w=>{var H;const{withSearch:ve=!0,onReady:ue}=w,we=Le(),{entityMetadata:{value:ke,loading:Fe},entityRef:it,setShadowRoot:Ct}=(0,g.x1)(),Ke=fe(it),ht=(0,r.useCallback)(vt=>{Ct(vt),ue instanceof Function&&ue()},[Ct,ue]);return Fe===!1&&!ke?(0,h.jsx)(b.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Ke?(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)(Te,{})}),ve&&(0,h.jsx)($.Z,{className:we.search,xs:"auto",item:!0,children:(0,h.jsx)(c.S,{entityId:it,entityTitle:ke==null||(H=ke.metadata)===null||H===void 0?void 0:H.title})}),(0,h.jsx)($.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:Ke,onAppend:ht,children:(0,h.jsx)(Pe,{})})})]})}):(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)(Te,{})})})})}),nt=null},93225:function(Rt,Me,t){"use strict";t.d(Me,{S:function(){return ae}});var h=t(52322),r=t(2784),W=t(18671),$=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(92848),te=t(25271),X=t(93414),Q=t(25248),M=t(76635),z=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),ae=le=>{const{children:A}=le,L=(0,c.$L)(),O=(0,Q.h_)(Q.Ds),{title:T,setTitle:S,subtitle:q,setSubtitle:Te,entityRef:et,metadata:{value:Xe,loading:Ye},entityMetadata:{value:Ve,loading:ft}}=(0,c.x1)();(0,r.useEffect)(()=>{!Xe||(S(Xe.site_name),Te(()=>{let{site_description:se}=Xe;return(!se||se==="None")&&(se=""),se}))},[Xe,S,Te]);const je=O.getOptional("app.title")||"Backstage",Ge=[T,q,je].filter(Boolean).join(" | "),{locationMetadata:st,spec:gt}=Ve||{},rt=gt==null?void 0:gt.lifecycle,ot=Ve?(0,P.hF)(Ve,te.S4):[],ct=(0,Q.tg)(z._Z)(),yt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(X.i9,{label:(0,M.capitalize)((Ve==null?void 0:Ve.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:et,title:Ve==null?void 0:Ve.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(X.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(X.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(X.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!ft&&Ve===void 0||!Ye&&Xe===void 0?null:(0,h.jsxs)(X.h4,{type:"Documentation",typeLink:ct,title:T||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ge})}),yt,A,L.renderComponentsByLocation(c.oZ.Header)]})}},65124:function(Rt,Me,t){"use strict";t.d(Me,{b:function(){return M}});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),X=t(61886);const Q=(0,W.Z)(z=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:z.spacing(3,3,0)}})),M=z=>{const _=Q(),[ae,le]=(0,r.useState)(null),A=(0,r.useCallback)(et=>{le(et.currentTarget)},[]),L=(0,r.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:O,loading:T}}=(0,X.x1)(),S=(0,X.$L)(),q=S.renderComponentsByLocation(X.oZ.Subheader),Te=S.renderComponentsByLocation(X.oZ.Settings);return!q&&!Te||T===!1&&!O?null:(0,h.jsx)($.Z,{classes:_,...z.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[q,Te?(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:A,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:L,keepMounted:!0,children:Te})]}):null]})})}},95481:function(Rt,Me,t){"use strict";t.d(Me,{DK:function(){return M},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:ae,content:le,activeSyncState:A}){return ae||A==="BUILD_READY_RELOAD"||!le&&A==="CHECKING"?"CHECKING":!le&&A==="BUILDING"?"INITIAL_BUILD":le?A==="BUILDING"?"CONTENT_STALE_REFRESHING":A==="BUILD_READY"?"CONTENT_STALE_READY":A==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(ae,le){const A={...ae};switch(le.type){case"sync":le.state==="CHECKING"&&(A.buildLog=[]),A.activeSyncState=le.state,A.syncError=le.syncError;break;case"contentLoading":A.contentLoading=!0,A.contentError=void 0;break;case"content":typeof le.path=="string"&&(A.path=le.path),A.contentLoading=!1,A.content=le.content,A.contentError=le.contentError;break;case"buildLog":A.buildLog=A.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(A.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(A.activeSyncState="UP_TO_DATE",A.buildLog=[]),A}function X(ae,le,A,L){var O,T;const[S,q]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Te=(0,g.h_)($.Dl),{retry:et}=(0,c.Z)(async()=>{q({type:"contentLoading"});try{const Ve=await Te.getEntityDocs({kind:ae,namespace:le,name:A},L);return q({type:"content",content:Ve,path:L}),Ve}catch(Ve){q({type:"content",contentError:Ve,path:L})}},[Te,ae,le,A,L]),Xe=(0,r.useRef)({content:void 0,reload:()=>{}});return Xe.current={content:S.content,reload:et},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const Ve=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Te.syncEntityDocs({kind:ae,namespace:le,name:A},je=>{q({type:"buildLog",log:je})})){case"updated":Xe.current.content?q({type:"sync",state:"BUILD_READY"}):(Xe.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(ft){q({type:"sync",state:"ERROR",syncError:ft})}finally{clearTimeout(Ve)}},[ae,A,le,Te,q,Xe]),{state:(0,r.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:et,path:S.path,content:S.content,contentErrorMessage:(O=S.contentError)===null||O===void 0?void 0:O.toString(),syncErrorMessage:(T=S.syncError)===null||T===void 0?void 0:T.toString(),buildLog:S.buildLog}}const Q=(0,r.createContext)({}),M=()=>(0,r.useContext)(Q),z=({children:ae})=>{const{"*":le=""}=(0,W.UO)(),{entityRef:A}=(0,$.x1)(),{kind:L,namespace:O,name:T}=A,S=X(L,O,T,le);return(0,h.jsx)(Q.Provider,{value:S,children:ae instanceof Function?ae(S):ae})},_=ae=>le=>(0,h.jsx)(z,{children:(0,h.jsx)(ae,{...le})})},95573:function(Rt,Me,t){"use strict";t.d(Me,{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,Me,t){"use strict";t.d(Me,{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),X=t(65826);const Q=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),M=O=>{const{result:T,highlight:S,rank:q,lineClamp:Te=5,asListItem:et=!0,asLink:Xe=!0,title:Ye,icon:Ve}=O,ft=Q(),je=(0,te.z$)(),Ge=()=>{je.captureEvent("discover",T.title,{attributes:{to:T.location},value:q})},st=({children:ot})=>Xe?(0,h.jsx)(P.rU,{noTrack:!0,to:T.location,onClick:Ge,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),gt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(X.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):T.title,ct=S!=null&&S.fields.entityTitle?(0,h.jsx)(X.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):T.entityTitle,yt=S!=null&&S.fields.name?(0,h.jsx)(X.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):T.name;return(0,h.jsx)($.Z,{className:ft.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:Ye||(0,h.jsxs)(h.Fragment,{children:[ot," | ",ct!=null?ct:yt," docs"]})}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Te,overflow:"hidden"},children:S!=null&&S.fields.text?(0,h.jsx)(X.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):T.text})})},rt=({children:ot})=>et?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(g.Z,{alignItems:"flex-start",children:[Ve&&(0,h.jsx)(b.Z,{children:Ve}),(0,h.jsx)("div",{className:ft.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)(gt,{})})};var z=t(27556),_=t(79635);const ae=(0,W.Z)(O=>({root:{width:"100%"},bar:{padding:O.spacing(1)}})),le=O=>O==null?void 0:O.document,A=O=>{const{entityId:T,entityTitle:S,debounceTime:q=150}=O,[Te,et]=(0,r.useState)(!1),Xe=(0,_.s0)(),{setFilters:Ye,result:{loading:Ve,value:ft}}=(0,X.Rx)(),je=ae(),[Ge,st]=(0,r.useState)([]);(0,r.useEffect)(()=>{let yt=!0;if(yt&&ft){const Lt=ft.results.slice(0,10);st(Lt)}return()=>{yt=!1}},[Ve,ft]);const{kind:gt,name:rt,namespace:ot}=T;(0,r.useEffect)(()=>{Ye(yt=>({...yt,kind:gt,namespace:ot,name:rt}))},[gt,ot,rt,Ye]);const ct=(yt,Lt)=>{if(le(Lt)){const{location:We}=Lt.document;Xe(We)}};return(0,h.jsx)(z.Z,{className:je.bar,variant:"outlined",children:(0,h.jsx)(X.qO,{classes:{root:je.root},"data-testid":"techdocs-search-bar",size:"small",open:Te,getOptionLabel:()=>"",filterOptions:yt=>yt,onClose:()=>{et(!1)},onFocus:()=>{et(!0)},onChange:ct,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ge,renderOption:({document:yt,highlight:Lt})=>(0,h.jsx)(M,{result:yt,lineClamp:3,asListItem:!1,asLink:!1,title:yt.title,highlight:Lt}),loading:Ve,inputDebounceTime:q,inputPlaceholder:`Search ${S||T.name} docs`,freeSolo:!1})})},L=O=>{const T={term:"",types:["techdocs"],pageCursor:"",filters:O.entityId};return(0,h.jsx)(X.Nd,{initialState:T,children:(0,h.jsx)(A,{...O})})}},53260:function(){}},function(Rt){var Me=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 Me(51102)});var t=Rt.O()}]);})();
493
493
 
494
- //# sourceMappingURL=main.8b0c4c2f.js.map
494
+ //# sourceMappingURL=main.11038605.js.map