@techdocs/cli 0.0.0-nightly-20230614022819 → 0.0.0-nightly-20230615022435

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,13 +1,13 @@
1
1
  # @techdocs/cli
2
2
 
3
- ## 0.0.0-nightly-20230614022819
3
+ ## 0.0.0-nightly-20230615022435
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/backend-common@0.0.0-nightly-20230614022819
9
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20230614022819
10
- - @backstage/catalog-model@0.0.0-nightly-20230614022819
8
+ - @backstage/backend-common@0.0.0-nightly-20230615022435
9
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20230615022435
10
+ - @backstage/catalog-model@0.0.0-nightly-20230615022435
11
11
  - @backstage/cli-common@0.1.12
12
12
  - @backstage/config@1.0.7
13
13
 
@@ -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.f4c9013f.js"></script><script defer="defer" src="/static/module-material-ui.09dab505.js"></script><script defer="defer" src="/static/module-lodash.4c9a1319.js"></script><script defer="defer" src="/static/module-date-fns.eeb6d2d2.js"></script><script defer="defer" src="/static/module-yaml.af9b4f42.js"></script><script defer="defer" src="/static/module-ajv.be583887.js"></script><script defer="defer" src="/static/module-material-table.e97c8359.js"></script><script defer="defer" src="/static/module-luxon.a1854eb9.js"></script><script defer="defer" src="/static/module-octokit.fe13bd50.js"></script><script defer="defer" src="/static/module-react-dom.d698fbed.js"></script><script defer="defer" src="/static/module-react-router.a589137b.js"></script><script defer="defer" src="/static/module-react-router-dom.cf49e816.js"></script><script defer="defer" src="/static/module-zod.49079951.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.c3c3faee.js"></script><script defer="defer" src="/static/vendor.f4c9013f.js"></script><script defer="defer" src="/static/main.f4c9013f.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.6e7d0eee.js"></script><script defer="defer" src="/static/module-material-ui.09dab505.js"></script><script defer="defer" src="/static/module-lodash.4c9a1319.js"></script><script defer="defer" src="/static/module-date-fns.eeb6d2d2.js"></script><script defer="defer" src="/static/module-yaml.af9b4f42.js"></script><script defer="defer" src="/static/module-ajv.be583887.js"></script><script defer="defer" src="/static/module-material-table.e97c8359.js"></script><script defer="defer" src="/static/module-luxon.a1854eb9.js"></script><script defer="defer" src="/static/module-octokit.a126d1a6.js"></script><script defer="defer" src="/static/module-react-dom.d698fbed.js"></script><script defer="defer" src="/static/module-react-router.a589137b.js"></script><script defer="defer" src="/static/module-react-router-dom.cf49e816.js"></script><script defer="defer" src="/static/module-zod.49079951.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.c3c3faee.js"></script><script defer="defer" src="/static/vendor.6e7d0eee.js"></script><script defer="defer" src="/static/main.6e7d0eee.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
@@ -519,4 +519,4 @@ ${M.href}
519
519
 
520
520
  Feedback:`),Tt=(ye==null?void 0:ye.type)==="github"?(0,Sn.BT)(ue.href,"blob"):ue.href,jt=on()(Tt),st=`/${jt.organization}/${jt.name}`,Ne=M.cloneNode();switch(ye==null?void 0:ye.type){case"gitlab":Ne.href=`${ue.origin}${st}/issues/new?issue[title]=${ot}&issue[description]=${ht}`;break;case"github":Ne.href=`${ue.origin}${st}/issues/new?title=${ot}&body=${ht}`;break;default:return O}return rn.render(p.createElement(Yt.Z),Ne),Ne.style.paddingLeft="5px",Ne.title="Leave feedback for this page",Ne.id="git-feedback-link",M==null||M.insertAdjacentElement("beforebegin",Ne),O};var Fn=n(44882);const nt=()=>v=>{const O=v.querySelector('.md-header label[for="__drawer"]'),J=v.querySelector("article");if(!O||!J)return v;const M=O.cloneNode();return rn.render(p.createElement(Fn.Z),M),M.id="toggle-sidebar",M.title="Toggle Sidebar",M.classList.add("md-content__button"),M.style.setProperty("padding","0 0 0 5px"),M.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),J==null||J.prepend(M),v},sn=()=>v=>(((J,M)=>{Array.from(J).filter(ue=>ue.hasAttribute(M)).forEach(ue=>{const ye=ue.getAttribute(M);if(ye){ye.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const Me=Jt(window.location.href);ue.setAttribute(M,new URL(ye,Me).toString())}catch{ue.replaceWith(ue.textContent||ye)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Jt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const rt=({baseUrl:v,onClick:O})=>J=>(Array.from(J.getElementsByTagName("a")).forEach(M=>{M.addEventListener("click",ue=>{const Me=M.getAttribute("href");Me&&Me.startsWith(v)&&!M.hasAttribute("download")&&(ue.preventDefault(),O(ue,Me))})}),J);var In=n(15459),Qt=n(80030),Pn=n(72379),Nn=n(41547),Ln=n(95074);const Zn=(0,In.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Qt.ZP),Se=()=>(0,r.jsx)(Pn.Z,{children:(0,r.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"})}),ce=({text:v})=>{const[O,J]=(0,p.useState)(!1),[,M]=(0,Ln.Z)(),ue=(0,p.useCallback)(()=>{M(v),J(!0)},[v,M]),ye=(0,p.useCallback)(()=>{J(!1)},[J]);return(0,r.jsx)(Zn,{title:"Copied to clipboard",placement:"left",open:O,onClose:ye,leaveDelay:1e3,children:(0,r.jsx)(L.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(Se,{})})})},Ie=v=>O=>{const J=O.querySelectorAll("pre > code");for(const ue of J){var M;const ye=ue.textContent||"",Me=document.createElement("div");ue==null||(M=ue.parentElement)===null||M===void 0||M.prepend(Me),rn.render((0,r.jsx)(Nn.Z,{theme:v,children:(0,r.jsx)(ce,{text:ye})}),Me)}return O},Ue=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Ve=()=>v=>{var O,J;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(J=v.querySelector(".md-footer-copyright"))===null||J===void 0||J.remove(),v},le=({onLoading:v,onLoaded:O})=>J=>(v(),J.addEventListener(z.Ox,function M(){O(),J.removeEventListener(z.Ox,M)}),J),U=()=>v=>(v.addEventListener(z.Ox,function O(){if(window.location.hash){var J;const M=window.location.hash.slice(1);(J=v==null?void 0:v.querySelector(`[id="${M}"]`))===null||J===void 0||J.scrollIntoView()}v.removeEventListener(z.Ox,O)}),v),he=()=>v=>(setTimeout(()=>{const O=v==null?void 0:v.querySelectorAll("li.md-nav__item--active");O.length!==0&&(O.forEach(M=>{const ue=M==null?void 0:M.querySelector("input");ue!=null&&ue.checked||ue==null||ue.click()}),O[O.length-1].scrollIntoView())},200),v),$e=async(v,O)=>{let J;if(typeof v=="string")J=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)J=v;else throw new Error("dom is not a recognized type");for(const M of O)J=await M(J);return J};var Ke=n(73557);function Je(v,O){const J=new URL(O),M=`${J.origin}${J.pathname.replace(/\/$/,"")}`,ue=v.replace(M,"").replace(/^\/+/,""),ye=new URL(`http://localhost/${ue}`);return`${ye.pathname}${ye.search}${ye.hash}`}function Ft(){const v=(0,Ke.s0)(),J=(0,H.h_)(H.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let ye=ue;if(J)try{ye=Je(ue,J)}catch{}v(ye)},[v,J])}const Vt="screen and (max-width: 76.1875em)",en=v=>{const O=Ft(),J=(0,je.Z)(),M=(0,Pe.Z)(Vt),ue=Gt(),ye=pn(),Me=(0,H.z$)(),ot=(0,H.h_)(z.Dl),ht=(0,H.h_)(N.q3),{state:Tt,path:jt,content:st}=(0,R.DK)(),[Ne,Ut]=(0,p.useState)(null),qt=(0,z.ux)(Ne),bt=(0,p.useCallback)(()=>{if(!Ne)return;Ne.querySelectorAll(".md-sidebar").forEach(He=>{if(M)He.style.top="0px";else{const sr=document==null?void 0:document.querySelector(".techdocs-reader-page");var Lt;const mr=(Lt=sr==null?void 0:sr.getBoundingClientRect().top)!==null&&Lt!==void 0?Lt:0;var xn;let Gn=(xn=Ne.getBoundingClientRect().top)!==null&&xn!==void 0?xn:0;const cn=Ne.querySelector(".md-container > .md-tabs");var nn;const ir=(nn=cn==null?void 0:cn.getBoundingClientRect().height)!==null&&nn!==void 0?nn:0;Gn<mr&&(Gn=mr),He.style.top=`${Math.max(Gn,0)+ir}px`}He.style.setProperty("opacity","1")})},[Ne,M]);(0,p.useEffect)(()=>(window.addEventListener("resize",bt),window.addEventListener("scroll",bt,!0),()=>{window.removeEventListener("resize",bt),window.removeEventListener("scroll",bt,!0)}),[Ne,bt]);const Nt=(0,p.useCallback)(()=>{if(!Ne)return;const vt=Ne.querySelector(".md-footer");vt&&(vt.style.width=`${Ne.getBoundingClientRect().width}px`)},[Ne]);(0,p.useEffect)(()=>(window.addEventListener("resize",Nt),()=>{window.removeEventListener("resize",Nt)}),[Ne,Nt]),(0,p.useEffect)(()=>{qt||(Nt(),bt())},[Tt,qt,Nt,bt]);const gn=(0,p.useCallback)((vt,He)=>$e(vt,[ue,_t({techdocsStorageApi:ot,entityId:v,path:He}),sn(),nt(),Ue(),Ve(),En(ht),ye]),[v,ht,ot,ue,ye]),Cn=(0,p.useCallback)(async vt=>$e(vt,[U(),he(),Ie(J),rt({baseUrl:window.location.origin,onClick:(He,Lt)=>{var xn;const nn=He.ctrlKey||He.metaKey,sr=new URL(Lt),mr=((xn=He.target)===null||xn===void 0?void 0:xn.innerText)||Lt,Gn=Lt.replace(window.location.origin,"");if(Me.captureEvent("click",mr,{attributes:{to:Gn}}),sr.hash)if(nn)window.open(Lt,"_blank");else{var cn;O(Lt),(cn=vt==null?void 0:vt.querySelector(`[id="${sr.hash.slice(1)}"]`))===null||cn===void 0||cn.scrollIntoView()}else nn?window.open(Lt,"_blank"):O(Lt)}}),le({onLoading:()=>{},onLoaded:()=>{var He;(He=vt.querySelector(".md-nav__title"))===null||He===void 0||He.removeAttribute("for")}}),le({onLoading:()=>{Array.from(vt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[J,O,Me]);return(0,p.useEffect)(()=>{if(!st)return()=>{};let vt=!0;return gn(st,jt).then(async He=>{if(!(He!=null&&He.innerHTML)||!vt)return;window.scroll({top:0});const Lt=await Cn(He);Ut(Lt)}),()=>{vt=!1}},[st,jt,gn,Cn]),Ne};var Xt=n(8560);const tn=()=>{const v=(0,z.$L)(),{shadowRoot:O}=(0,z.x1)(),J=O==null?void 0:O.querySelector('[data-md-component="content"]'),M=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ue=M==null?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');ue||(ue=document.createElement("div"),ue.setAttribute("data-techdocs-addons-location","primary sidebar"),M==null||M.prepend(ue));const ye=O==null?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Me=ye==null?void 0:ye.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Me||(Me=document.createElement("div"),Me.setAttribute("data-techdocs-addons-location","secondary sidebar"),ye==null||ye.prepend(Me)),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xt.Z,{container:ue,children:v.renderComponentsByLocation(z.oZ.PrimarySidebar)}),(0,r.jsx)(Xt.Z,{container:J,children:v.renderComponentsByLocation(z.oZ.Content)}),(0,r.jsx)(Xt.Z,{container:Me,children:v.renderComponentsByLocation(z.oZ.SecondarySidebar)})]})},_=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),X=(0,R.m1)(v=>{var O;const{withSearch:J=!0,onReady:M}=v,ue=_(),{entityMetadata:{value:ye,loading:Me},entityRef:ot,setShadowRoot:ht}=(0,z.x1)(),Tt=en(ot),jt=(0,p.useCallback)(st=>{ht(st),M instanceof Function&&M()},[ht,M]);return Me===!1&&!ye?(0,r.jsx)(g.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):Tt?(0,r.jsx)(g.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})}),J&&(0,r.jsx)(f.Z,{className:ue.search,xs:"auto",item:!0,children:(0,r.jsx)(u.S,{entityId:ot,entityTitle:ye==null||(O=ye.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(z.VA,{element:Tt,onAppend:jt,children:(0,r.jsx)(tn,{})})})]})}):(0,r.jsx)(g.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(G,{})})})})}),ee=null},93225:function(Ct,ke,n){"use strict";n.d(ke,{S:function(){return oe}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),z=n(98069),g=n(60364),u=n(73250),D=n(61886),ge=n(39709),de=n(25271),V=n(53974),te=n(60871),L=n(76635),A=n(95573);const ae=(0,r.jsx)(z.Z,{animation:"wave",variant:"text",height:40}),oe=ie=>{const{palette:{common:{white:q}}}=(0,g.Z)(),{children:H}=ie,T=(0,D.$L)(),R=(0,te.h_)(te.Ds),{title:P,setTitle:G,subtitle:je,setSubtitle:Pe,entityRef:N,metadata:{value:_e,loading:at},entityMetadata:{value:It,loading:zt}}=(0,D.x1)();(0,p.useEffect)(()=>{_e&&(G(_e.site_name),Pe(()=>{let{site_description:Ce}=_e;return(!Ce||Ce==="None")&&(Ce=""),Ce}))},[_e,G,Pe]);const xt=R.getOptional("app.title")||"Backstage",Zt=[P,je,xt].filter(Boolean).join(" | "),{locationMetadata:Dt,spec:et}=It||{},lt=et==null?void 0:et.lifecycle,yt=It?(0,ge.hF)(It,de.S4):[],At=(0,te.tg)(A._Z)(),$t=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.i9,{label:(0,L.capitalize)((It==null?void 0:It.kind)||"entity"),value:(0,r.jsx)(ge.dx,{color:"inherit",entityRef:N,title:It==null?void 0:It.metadata.title,defaultKind:"Component"})}),yt.length>0&&(0,r.jsx)(V.i9,{label:"Owner",value:(0,r.jsx)(ge.rI,{color:"inherit",entityRefs:yt,defaultKind:"group"})}),lt?(0,r.jsx)(V.i9,{label:"Lifecycle",value:lt}):null,Dt&&Dt.type!=="dir"&&Dt.type!=="file"?(0,r.jsx)(V.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:q},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(u.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Dt.target}):null]});return!zt&&It===void 0||!at&&_e===void 0?null:(0,r.jsxs)(V.h4,{type:"Documentation",typeLink:At,title:P||ae,subtitle:je===""?void 0:je||ae,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:Zt})}),$t,H,T.renderComponentsByLocation(D.oZ.Header)]})}},65124:function(Ct,ke,n){"use strict";n.d(ke,{b:function(){return te}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),z=n(95544),g=n(80030),u=n(61837),D=n(48348),ge=n(47603),de=n(61886);const V=(0,W.Z)(L=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:L.spacing(3,3,0),"@media print":{display:"none"}}})),te=L=>{const A=V(),[ae,oe]=(0,p.useState)(null),ie=(0,p.useCallback)(je=>{oe(je.currentTarget)},[]),q=(0,p.useCallback)(()=>{oe(null)},[]),{entityMetadata:{value:H,loading:T}}=(0,de.x1)(),R=(0,de.$L)(),P=R.renderComponentsByLocation(de.oZ.Subheader),G=R.renderComponentsByLocation(de.oZ.Settings);return!P&&!G||T===!1&&!H?null:(0,r.jsx)(f.Z,{classes:A,...L.toolbarProps,children:(0,r.jsxs)(z.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,G?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.ZP,{title:"Settings",children:(0,r.jsx)(u.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ie,children:(0,r.jsx)(ge.Z,{})})}),(0,r.jsx)(D.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ae,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ae),onClose:q,keepMounted:!0,children:(0,r.jsx)("div",{children:G})})]}):null]})})}},95481:function(Ct,ke,n){"use strict";n.d(ke,{DK:function(){return te},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),z=n(60871),g=n(64279),u=n(77446);function D({contentLoading:ae,content:oe,activeSyncState:ie}){return ae||ie==="BUILD_READY_RELOAD"||!oe&&ie==="CHECKING"?"CHECKING":!oe&&ie==="BUILDING"?"INITIAL_BUILD":oe?ie==="BUILDING"?"CONTENT_STALE_REFRESHING":ie==="BUILD_READY"?"CONTENT_STALE_READY":ie==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ge(ae,oe){const ie={...ae};switch(oe.type){case"sync":oe.state==="CHECKING"&&(ie.buildLog=[]),ie.activeSyncState=oe.state,ie.syncError=oe.syncError;break;case"contentLoading":ie.contentLoading=!0,ie.contentError=void 0;break;case"content":typeof oe.path=="string"&&(ie.path=oe.path),ie.contentLoading=!1,ie.content=oe.content,ie.contentError=oe.contentError;break;case"buildLog":ie.buildLog=ie.buildLog.concat(oe.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ie.activeSyncState)&&["contentLoading","content"].includes(oe.type)&&(ie.activeSyncState="UP_TO_DATE",ie.buildLog=[]),ie}function de(ae,oe,ie,q){var H,T;const[R,P]=(0,p.useReducer)(ge,{activeSyncState:"CHECKING",path:q,contentLoading:!0,buildLog:[]}),G=(0,z.h_)(f.Dl),{retry:je}=(0,u.Z)(async()=>{P({type:"contentLoading"});try{const _e=await G.getEntityDocs({kind:ae,namespace:oe,name:ie},q);return P({type:"content",content:_e,path:q}),_e}catch(_e){P({type:"content",contentError:_e,path:q})}},[G,ae,oe,ie,q]),Pe=(0,p.useRef)({content:void 0,reload:()=>{}});return Pe.current={content:R.content,reload:je},(0,g.default)(async()=>{P({type:"sync",state:"CHECKING"});const _e=setTimeout(()=>{P({type:"sync",state:"BUILDING"})},1e3);try{switch(await G.syncEntityDocs({kind:ae,namespace:oe,name:ie},It=>{P({type:"buildLog",log:It})})){case"updated":Pe.current.content?P({type:"sync",state:"BUILD_READY"}):(Pe.current.reload(),P({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":P({type:"sync",state:"UP_TO_DATE"});break;default:P({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){P({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(_e)}},[ae,ie,oe,G,P,Pe]),{state:(0,p.useMemo)(()=>D({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:je,path:R.path,content:R.content,contentErrorMessage:(H=R.contentError)===null||H===void 0?void 0:H.toString(),syncErrorMessage:(T=R.syncError)===null||T===void 0?void 0:T.toString(),buildLog:R.buildLog}}const V=(0,p.createContext)({}),te=()=>(0,p.useContext)(V),L=ae=>{const{children:oe}=ae,{"*":ie=""}=(0,W.UO)(),{entityRef:q}=(0,f.x1)(),{kind:H,namespace:T,name:R}=q,P=de(H,T,R,ie);return(0,r.jsx)(V.Provider,{value:P,children:oe instanceof Function?oe(P):oe})},A=ae=>oe=>(0,r.jsx)(L,{children:(0,r.jsx)(ae,{...oe})})},95573:function(Ct,ke,n){"use strict";n.d(ke,{Fw:function(){return W},_Z:function(){return p},pd:function(){return f}});var r=n(60871);const p=(0,r.NT)({id:"techdocs:index-page"}),W=(0,r.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.NT)({id:"techdocs:catalog-reader-view"})},55511:function(Ct,ke,n){"use strict";n.r(ke),n.d(ke,{TechDocsSearchResultListItem:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),z=n(86136),g=n(90436),u=n(53974),D=n(15096);const ge=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),de=V=>{const{result:te,highlight:L,lineClamp:A=5,asListItem:ae=!0,asLink:oe=!0,title:ie,icon:q}=V,H=ge(),T=({children:G})=>oe?(0,r.jsx)(u.rU,{noTrack:!0,to:te.location,children:G}):(0,r.jsx)(r.Fragment,{children:G}),R=()=>{const G=L!=null&&L.fields.title?(0,r.jsx)(D.FA,{text:L.fields.title,preTag:L.preTag,postTag:L.postTag}):te.title,je=L!=null&&L.fields.entityTitle?(0,r.jsx)(D.FA,{text:L.fields.entityTitle,preTag:L.preTag,postTag:L.postTag}):te.entityTitle,Pe=L!=null&&L.fields.name?(0,r.jsx)(D.FA,{text:L.fields.name,preTag:L.preTag,postTag:L.postTag}):te.name;return te?(0,r.jsx)(f.Z,{className:H.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:ie||(0,r.jsxs)(r.Fragment,{children:[G," | ",je!=null?je:Pe," docs"]})}),secondary:(0,r.jsx)(g.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:L!=null&&L.fields.text?(0,r.jsx)(D.FA,{text:L.fields.text,preTag:L.preTag,postTag:L.postTag}):te.text})}):null},P=({children:G})=>ae?(0,r.jsxs)(r.Fragment,{children:[q&&(0,r.jsx)(z.Z,{children:typeof q=="function"?q(te):q}),(0,r.jsx)("div",{className:H.flexContainer,children:G})]}):(0,r.jsx)(r.Fragment,{children:G});return(0,r.jsx)(P,{children:(0,r.jsx)(R,{})})}},22478:function(Ct,ke,n){"use strict";n.d(ke,{S:function(){return D}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),z=n(55511);const g=ge=>ge==null?void 0:ge.document,u=ge=>{const{entityId:de,entityTitle:V,debounceTime:te=150}=ge,[L,A]=(0,W.useState)(!1),ae=(0,f.s0)(),{setFilters:oe,result:{loading:ie,value:q}}=(0,p.Rx)(),[H,T]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Pe=!0;if(Pe&&q){const N=q.results.slice(0,10);T(N)}return()=>{Pe=!1}},[ie,q]);const{kind:R,name:P,namespace:G}=de;(0,W.useEffect)(()=>{oe(Pe=>({...Pe,kind:R,namespace:G,name:P}))},[R,G,P,oe]);const je=(Pe,N)=>{if(g(N)){const{location:_e}=N.document;ae(_e)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:L,getOptionLabel:()=>"",filterOptions:Pe=>Pe,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:je,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:H,renderOption:({document:Pe,highlight:N})=>(0,r.jsx)(z.TechDocsSearchResultListItem,{result:Pe,lineClamp:3,asListItem:!1,asLink:!1,title:Pe.title,highlight:N}),loading:ie,inputDebounceTime:te,inputPlaceholder:`Search ${V||de.name} docs`,freeSolo:!1})},D=ge=>{const de={term:"",types:["techdocs"],pageCursor:"",filters:ge.entityId};return(0,r.jsx)(p.Nd,{initialState:de,children:(0,r.jsx)(u,{...ge})})}},53260:function(){}},function(Ct){var ke=function(r){return Ct(Ct.s=r)};Ct.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return ke(30966)});var n=Ct.O()}]);})();
521
521
 
522
- //# sourceMappingURL=main.f4c9013f.js.map
522
+ //# sourceMappingURL=main.6e7d0eee.js.map