@techdocs/cli 0.0.0-nightly-20230623023228 → 0.0.0-nightly-20230625023740

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-20230623023228
3
+ ## 0.0.0-nightly-20230625023740
4
4
 
5
5
  ### Patch Changes
6
6
 
7
7
  - Updated dependencies
8
- - @backstage/backend-common@0.0.0-nightly-20230623023228
9
- - @backstage/catalog-model@0.0.0-nightly-20230623023228
10
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20230623023228
8
+ - @backstage/backend-common@0.0.0-nightly-20230625023740
9
+ - @backstage/catalog-model@0.0.0-nightly-20230625023740
10
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20230625023740
11
11
  - @backstage/cli-common@0.1.12
12
12
  - @backstage/config@1.0.8
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.928ac0fe.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.928ac0fe.js"></script><script defer="defer" src="/static/main.928ac0fe.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.49a8a453.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.49a8a453.js"></script><script defer="defer" src="/static/main.49a8a453.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 @@ ${tt.href}
519
519
 
520
520
  Feedback:`),qt=((be=bt)===null||be===void 0?void 0:be.type)==="github"?(0,bn.BT)(yt.href,"blob"):yt.href,jt=on()(qt),Zt=`/${jt.organization}/${jt.name}`,_t=tt.cloneNode();switch((ke=bt)===null||ke===void 0?void 0:ke.type){case"gitlab":_t.href=`${yt.origin}${Zt}/issues/new?issue[title]=${Oe}&issue[description]=${wt}`;break;case"github":_t.href=`${yt.origin}${Zt}/issues/new?title=${Oe}&body=${wt}`;break;default:return O}return mn.render(p.createElement(hn.Z),_t),_t.style.paddingLeft="5px",_t.title="Leave feedback for this page",_t.id="git-feedback-link",(Qe=tt)===null||Qe===void 0||Qe.insertAdjacentElement("beforebegin",_t),O};var Cn=n(44882);const Xe=()=>v=>{var O;const M=v.querySelector('.md-header label[for="__drawer"]'),G=v.querySelector("article");if(!M||!G)return v;const ue=M.cloneNode();return mn.render(p.createElement(Cn.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"),(O=G)===null||O===void 0||O.prepend(ue),v},Jt=()=>v=>(((M,G)=>{Array.from(M).filter(ue=>ue.hasAttribute(G)).forEach(ue=>{const be=ue.getAttribute(G);if(be){be.match(/^https?:\/\//i)&&ue.setAttribute("target","_blank");try{const ke=Vt(window.location.href);ue.setAttribute(G,new URL(be,ke).toString())}catch{ue.replaceWith(ue.textContent||be)}}})})(Array.from(v.getElementsByTagName("a")),"href"),v);function Vt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const Ye=({baseUrl:v,onClick:O})=>M=>(Array.from(M.getElementsByTagName("a")).forEach(G=>{G.addEventListener("click",ue=>{const ke=G.getAttribute("href");ke&&ke.startsWith(v)&&!G.hasAttribute("download")&&(ue.preventDefault(),O(ue,ke))})}),M);var An=n(15459),sn=n(80030),Bn=n(72379),Tn=n(41547),Rn=n(95074);const Hn=(0,An.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(sn.ZP),Ln=()=>(0,r.jsx)(Bn.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"})}),Gn=({text:v})=>{const[O,M]=(0,p.useState)(!1),[,G]=(0,Rn.Z)(),ue=(0,p.useCallback)(()=>{G(v),M(!0)},[v,G]),be=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(Hn,{title:"Copied to clipboard",placement:"left",open:O,onClose:be,leaveDelay:1e3,children:(0,r.jsx)($.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(Ln,{})})})},we=v=>O=>{const M=O.querySelectorAll("pre > code");for(const be of M){var G,ue;const ke=be.textContent||"",Qe=document.createElement("div");(ue=be)===null||ue===void 0||(G=ue.parentElement)===null||G===void 0||G.prepend(Qe),mn.render((0,r.jsx)(Tn.Z,{theme:v,children:(0,r.jsx)(Gn,{text:ke})}),Qe)}return O},pe=()=>v=>{var O;return(O=v.querySelector(".md-header"))===null||O===void 0||O.remove(),v},Re=()=>v=>{var O,M;return(O=v.querySelector(".md-footer .md-copyright"))===null||O===void 0||O.remove(),(M=v.querySelector(".md-footer-copyright"))===null||M===void 0||M.remove(),v},H=({onLoading:v,onLoaded:O})=>M=>(v(),M.addEventListener(V.Ox,function G(){O(),M.removeEventListener(V.Ox,G)}),M),N=()=>v=>(v.addEventListener(V.Ox,function O(){if(window.location.hash){var M,G;const ue=window.location.hash.slice(1);(G=v)===null||G===void 0||(M=G.querySelector(`[id="${ue}"]`))===null||M===void 0||M.scrollIntoView()}v.removeEventListener(V.Ox,O)}),v),ae=()=>v=>(setTimeout(()=>{var O;const M=(O=v)===null||O===void 0?void 0:O.querySelectorAll("li.md-nav__item--active");M.length!==0&&(M.forEach(ue=>{var be,ke;const Qe=(be=ue)===null||be===void 0?void 0:be.querySelector("input");if(!(!((ke=Qe)===null||ke===void 0)&&ke.checked)){var tt;(tt=Qe)===null||tt===void 0||tt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ae=async(v,O)=>{let M;if(typeof v=="string")M=new DOMParser().parseFromString(v,"text/html").documentElement;else if(v instanceof Element)M=v;else throw new Error("dom is not a recognized type");for(const G of O)M=await G(M);return M};var Ze=n(73557);function qe(v,O){const M=new URL(O),G=`${M.origin}${M.pathname.replace(/\/$/,"")}`,ue=v.replace(G,"").replace(/^\/+/,""),be=new URL(`http://localhost/${ue}`);return`${be.pathname}${be.search}${be.hash}`}function Pt(){const v=(0,Ze.s0)(),M=(0,K.h_)(K.Ds).getOptionalString("app.baseUrl");return(0,p.useCallback)(ue=>{let be=ue;if(M)try{be=qe(ue,M)}catch{}v(be)},[v,M])}const $t="screen and (max-width: 76.1875em)",Qt=v=>{const O=Pt(),M=(0,xe.Z)(),G=(0,Se.Z)($t),ue=Ht(),be=gn(),ke=(0,K.z$)(),Qe=(0,K.h_)(V.Dl),tt=(0,K.h_)(B.q3),{state:yt,path:bt,content:ct}=(0,w.DK)(),[Oe,wt]=(0,p.useState)(null),qt=(0,V.ux)(Oe),jt=(0,p.useCallback)(()=>{if(!Oe)return;Oe.querySelectorAll(".md-sidebar").forEach(mt=>{if(G)mt.style.top="0px";else{var Lt,Wt,en;const vn=(Lt=document)===null||Lt===void 0?void 0:Lt.querySelector(".techdocs-reader-page");var gr;const Un=(gr=(Wt=vn)===null||Wt===void 0?void 0:Wt.getBoundingClientRect().top)!==null&&gr!==void 0?gr:0;var mr;let vr=(mr=Oe.getBoundingClientRect().top)!==null&&mr!==void 0?mr:0;const Fr=Oe.querySelector(".md-container > .md-tabs");var Xn;const Mn=(Xn=(en=Fr)===null||en===void 0?void 0:en.getBoundingClientRect().height)!==null&&Xn!==void 0?Xn:0;vr<Un&&(vr=Un),mt.style.top=`${Math.max(vr,0)+Mn}px`}mt.style.setProperty("opacity","1")})},[Oe,G]);(0,p.useEffect)(()=>(window.addEventListener("resize",jt),window.addEventListener("scroll",jt,!0),()=>{window.removeEventListener("resize",jt),window.removeEventListener("scroll",jt,!0)}),[Oe,jt]);const Zt=(0,p.useCallback)(()=>{if(!Oe)return;const Bt=Oe.querySelector(".md-footer");Bt&&(Bt.style.width=`${Oe.getBoundingClientRect().width}px`)},[Oe]);(0,p.useEffect)(()=>(window.addEventListener("resize",Zt),()=>{window.removeEventListener("resize",Zt)}),[Oe,Zt]),(0,p.useEffect)(()=>{qt||(Zt(),jt())},[yt,qt,Zt,jt]);const _t=(0,p.useCallback)((Bt,mt)=>Ae(Bt,[ue,ln({techdocsStorageApi:Qe,entityId:v,path:mt}),Jt(),Xe(),pe(),Re(),pn(tt),be]),[v,tt,Qe,ue,be]),wn=(0,p.useCallback)(async Bt=>Ae(Bt,[N(),ae(),we(M),Ye({baseUrl:window.location.origin,onClick:(mt,Lt)=>{var Wt;const en=mt.ctrlKey||mt.metaKey,gr=new URL(Lt),mr=((Wt=mt.target)===null||Wt===void 0?void 0:Wt.innerText)||Lt,Xn=Lt.replace(window.location.origin,"");if(ke.captureEvent("click",mr,{attributes:{to:Xn}}),gr.hash)if(en)window.open(Lt,"_blank");else{var vn,Un;O(Lt),(Un=Bt)===null||Un===void 0||(vn=Un.querySelector(`[id="${gr.hash.slice(1)}"]`))===null||vn===void 0||vn.scrollIntoView()}else en?window.open(Lt,"_blank"):O(Lt)}}),H({onLoading:()=>{},onLoaded:()=>{var mt;(mt=Bt.querySelector(".md-nav__title"))===null||mt===void 0||mt.removeAttribute("for")}}),H({onLoading:()=>{Array.from(Bt.querySelectorAll(".md-sidebar")).forEach(Lt=>{Lt.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[M,O,ke]);return(0,p.useEffect)(()=>{if(!ct)return()=>{};let Bt=!0;return _t(ct,bt).then(async mt=>{var Lt;if(!(!((Lt=mt)===null||Lt===void 0)&&Lt.innerHTML)||!Bt)return;window.scroll({top:0});const Wt=await wn(mt);wt(Wt)}),()=>{Bt=!1}},[ct,bt,_t,wn]),Oe};var Xt=n(8560);const an=()=>{var v,O,M,G,ue;const be=(0,V.$L)(),{shadowRoot:ke}=(0,V.x1)(),Qe=(v=ke)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),tt=(O=ke)===null||O===void 0?void 0:O.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let yt=(M=tt)===null||M===void 0?void 0:M.querySelector('[data-techdocs-addons-location="primary sidebar"]');if(!yt){var bt;yt=document.createElement("div"),yt.setAttribute("data-techdocs-addons-location","primary sidebar"),(bt=tt)===null||bt===void 0||bt.prepend(yt)}const ct=(G=ke)===null||G===void 0?void 0:G.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Oe=(ue=ct)===null||ue===void 0?void 0:ue.querySelector('[data-techdocs-addons-location="secondary sidebar"]');if(!Oe){var wt;Oe=document.createElement("div"),Oe.setAttribute("data-techdocs-addons-location","secondary sidebar"),(wt=ct)===null||wt===void 0||wt.prepend(Oe)}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Xt.Z,{container:yt,children:be.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,r.jsx)(Xt.Z,{container:Qe,children:be.renderComponentsByLocation(V.oZ.Content)}),(0,r.jsx)(Xt.Z,{container:Oe,children:be.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},ne=(0,W.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"},"@media print":{display:"none"}}}),te=(0,w.m1)(v=>{var O,M;const{withSearch:G=!0,onReady:ue}=v,be=ne(),{entityMetadata:{value:ke,loading:Qe},entityRef:tt,setShadowRoot:yt}=(0,V.x1)(),bt=Qt(tt),ct=(0,p.useCallback)(Oe=>{yt(Oe),ue instanceof Function&&ue()},[yt,ue]);return Qe===!1&&!ke?(0,r.jsx)(m.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):bt?(0,r.jsx)(m.VY,{children:(0,r.jsxs)(f.Z,{container:!0,children:[(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(Z,{})}),G&&(0,r.jsx)(f.Z,{className:be.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:tt,entityTitle:(M=ke)===null||M===void 0||(O=M.metadata)===null||O===void 0?void 0:O.title})}),(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(V.VA,{element:bt,onAppend:ct,children:(0,r.jsx)(an,{})})})]})}):(0,r.jsx)(m.VY,{children:(0,r.jsx)(f.Z,{container:!0,children:(0,r.jsx)(f.Z,{xs:12,item:!0,children:(0,r.jsx)(Z,{})})})})}),Y=null},93225:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return se}});var r=n(52322),p=n(2784),W=n(18671),f=n(60905),V=n(98069),m=n(60364),h=n(73250),F=n(61886),ve=n(39709),ce=n(25271),z=n(53974),de=n(60871),$=n(76635),A=n(95573);const oe=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),se=ee=>{var X,K,T;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ee,Z=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Se,setTitle:B,subtitle:Ge,setSubtitle:xt,entityRef:Nt,metadata:{value:zt,loading:Tt},entityMetadata:{value:Ft,loading:Yt}}=(0,F.x1)();(0,p.useEffect)(()=>{zt&&(B(zt.site_name),xt(()=>{let{site_description:rt}=zt;return(!rt||rt==="None")&&(rt=""),rt}))},[zt,B,xt]);const dt=xe.getOptional("app.title")||"Backstage",ut=[Se,Ge,dt].filter(Boolean).join(" | "),{locationMetadata:St,spec:lt}=Ft||{},Ut=(X=lt)===null||X===void 0?void 0:X.lifecycle,Ht=Ft?(0,ve.hF)(Ft,ce.S4):[],Ce=(0,de.tg)(A._Z)(),$e=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,$.capitalize)(((K=Ft)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ve.dx,{color:"inherit",entityRef:Nt,title:(T=Ft)===null||T===void 0?void 0:T.metadata.title,defaultKind:"Component"})}),Ht.length>0&&(0,r.jsx)(z.i9,{label:"Owner",value:(0,r.jsx)(ve.rI,{color:"inherit",entityRefs:Ht,defaultKind:"group"})}),Ut?(0,r.jsx)(z.i9,{label:"Lifecycle",value:Ut}):null,St&&St.type!=="dir"&&St.type!=="file"?(0,r.jsx)(z.i9,{label:"",value:(0,r.jsxs)(f.Z,{container:!0,direction:"column",alignItems:"center",style:{color:w},children:[(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:(0,r.jsx)(h.Z,{style:{marginTop:"-25px"}})}),(0,r.jsx)(f.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:St.target}):null]});return!Yt&&Ft===void 0||!Tt&&zt===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:Ce,title:Se||oe,subtitle:Ge===""?void 0:Ge||oe,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),$e,I,Z.renderComponentsByLocation(F.oZ.Header)]})}},65124:function(It,Pe,n){"use strict";n.d(Pe,{b:function(){return de}});var r=n(52322),p=n(2784),W=n(79692),f=n(15223),V=n(95544),m=n(80030),h=n(61837),F=n(48348),ve=n(47603),ce=n(61886);const z=(0,W.Z)($=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:$.spacing(3,3,0),"@media print":{display:"none"}}})),de=$=>{const A=z(),[oe,se]=(0,p.useState)(null),ee=(0,p.useCallback)(xe=>{se(xe.currentTarget)},[]),X=(0,p.useCallback)(()=>{se(null)},[]),{entityMetadata:{value:K,loading:T}}=(0,ce.x1)(),w=(0,ce.$L)(),I=w.renderComponentsByLocation(ce.oZ.Subheader),Z=w.renderComponentsByLocation(ce.oZ.Settings);return!I&&!Z||T===!1&&!K?null:(0,r.jsx)(f.Z,{classes:A,...$.toolbarProps,children:(0,r.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[I,Z?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.ZP,{title:"Settings",children:(0,r.jsx)(h.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:ee,children:(0,r.jsx)(ve.Z,{})})}),(0,r.jsx)(F.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:oe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(oe),onClose:X,keepMounted:!0,children:(0,r.jsx)("div",{children:Z})})]}):null]})})}},95481:function(It,Pe,n){"use strict";n.d(Pe,{DK:function(){return de},m1:function(){return A}});var r=n(52322),p=n(2784),W=n(73557),f=n(61886),V=n(60871),m=n(64279),h=n(77446);function F({contentLoading:oe,content:se,activeSyncState:ee}){return oe||ee==="BUILD_READY_RELOAD"||!se&&ee==="CHECKING"?"CHECKING":!se&&ee==="BUILDING"?"INITIAL_BUILD":se?ee==="BUILDING"?"CONTENT_STALE_REFRESHING":ee==="BUILD_READY"?"CONTENT_STALE_READY":ee==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ve(oe,se){const ee={...oe};switch(se.type){case"sync":se.state==="CHECKING"&&(ee.buildLog=[]),ee.activeSyncState=se.state,ee.syncError=se.syncError;break;case"contentLoading":ee.contentLoading=!0,ee.contentError=void 0;break;case"content":typeof se.path=="string"&&(ee.path=se.path),ee.contentLoading=!1,ee.content=se.content,ee.contentError=se.contentError;break;case"buildLog":ee.buildLog=ee.buildLog.concat(se.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ee.activeSyncState)&&["contentLoading","content"].includes(se.type)&&(ee.activeSyncState="UP_TO_DATE",ee.buildLog=[]),ee}function ce(oe,se,ee,X){var K,T;const[w,I]=(0,p.useReducer)(ve,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),Z=(0,V.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{I({type:"contentLoading"});try{const Ge=await Z.getEntityDocs({kind:oe,namespace:se,name:ee},X);return I({type:"content",content:Ge,path:X}),Ge}catch(Ge){I({type:"content",contentError:Ge,path:X})}},[Z,oe,se,ee,X]),Se=(0,p.useRef)({content:void 0,reload:()=>{}});return Se.current={content:w.content,reload:xe},(0,m.default)(async()=>{I({type:"sync",state:"CHECKING"});const Ge=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await Z.syncEntityDocs({kind:oe,namespace:se,name:ee},Nt=>{I({type:"buildLog",log:Nt})})){case"updated":Se.current.content?I({type:"sync",state:"BUILD_READY"}):(Se.current.reload(),I({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":I({type:"sync",state:"UP_TO_DATE"});break;default:I({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(xt){I({type:"sync",state:"ERROR",syncError:xt})}finally{clearTimeout(Ge)}},[oe,ee,se,Z,I,Se]),{state:(0,p.useMemo)(()=>F({activeSyncState:w.activeSyncState,contentLoading:w.contentLoading,content:w.content}),[w.activeSyncState,w.content,w.contentLoading]),contentReload:xe,path:w.path,content:w.content,contentErrorMessage:(K=w.contentError)===null||K===void 0?void 0:K.toString(),syncErrorMessage:(T=w.syncError)===null||T===void 0?void 0:T.toString(),buildLog:w.buildLog}}const z=(0,p.createContext)({}),de=()=>(0,p.useContext)(z),$=oe=>{const{children:se}=oe,{"*":ee=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:T,name:w}=X,I=ce(K,T,w,ee);return(0,r.jsx)(z.Provider,{value:I,children:se instanceof Function?se(I):se})},A=oe=>se=>(0,r.jsx)($,{children:(0,r.jsx)(oe,{...se})})},95573:function(It,Pe,n){"use strict";n.d(Pe,{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(It,Pe,n){"use strict";n.r(Pe),n.d(Pe,{TechDocsSearchResultListItem:function(){return ce}});var r=n(52322),p=n(2784),W=n(79692),f=n(49378),V=n(86136),m=n(90436),h=n(53974),F=n(15096);const ve=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),ce=z=>{const{result:de,highlight:$,lineClamp:A=5,asListItem:oe=!0,asLink:se=!0,title:ee,icon:X}=z,K=ve(),T=({children:Z})=>se?(0,r.jsx)(h.rU,{noTrack:!0,to:de.location,children:Z}):(0,r.jsx)(r.Fragment,{children:Z}),w=()=>{var Z,xe,Se,B;const Ge=!((Z=$)===null||Z===void 0)&&Z.fields.title?(0,r.jsx)(F.FA,{text:$.fields.title,preTag:$.preTag,postTag:$.postTag}):de.title,xt=!((xe=$)===null||xe===void 0)&&xe.fields.entityTitle?(0,r.jsx)(F.FA,{text:$.fields.entityTitle,preTag:$.preTag,postTag:$.postTag}):de.entityTitle,Nt=!((Se=$)===null||Se===void 0)&&Se.fields.name?(0,r.jsx)(F.FA,{text:$.fields.name,preTag:$.preTag,postTag:$.postTag}):de.name;return de?(0,r.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(T,{children:ee||(0,r.jsxs)(r.Fragment,{children:[Ge," | ",xt!=null?xt:Nt," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((B=$)===null||B===void 0)&&B.fields.text?(0,r.jsx)(F.FA,{text:$.fields.text,preTag:$.preTag,postTag:$.postTag}):de.text})}):null},I=({children:Z})=>oe?(0,r.jsxs)(r.Fragment,{children:[X&&(0,r.jsx)(V.Z,{children:typeof X=="function"?X(de):X}),(0,r.jsx)("div",{className:K.flexContainer,children:Z})]}):(0,r.jsx)(r.Fragment,{children:Z});return(0,r.jsx)(I,{children:(0,r.jsx)(w,{})})}},22478:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return F}});var r=n(52322),p=n(15096),W=n(2784),f=n(73557),V=n(55511);const m=ve=>{var ce;return(ce=ve)===null||ce===void 0?void 0:ce.document},h=ve=>{const{entityId:ce,entityTitle:z,debounceTime:de=150}=ve,[$,A]=(0,W.useState)(!1),oe=(0,f.s0)(),{setFilters:se,result:{loading:ee,value:X}}=(0,p.Rx)(),[K,T]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Se=!0;if(Se&&X){const B=X.results.slice(0,10);T(B)}return()=>{Se=!1}},[ee,X]);const{kind:w,name:I,namespace:Z}=ce;(0,W.useEffect)(()=>{se(Se=>({...Se,kind:w,namespace:Z,name:I}))},[w,Z,I,se]);const xe=(Se,B)=>{if(m(B)){const{location:Ge}=B.document;oe(Ge)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:$,getOptionLabel:()=>"",filterOptions:Se=>Se,onClose:()=>{A(!1)},onFocus:()=>{A(!0)},onChange:xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:K,renderOption:({document:Se,highlight:B})=>(0,r.jsx)(V.TechDocsSearchResultListItem,{result:Se,lineClamp:3,asListItem:!1,asLink:!1,title:Se.title,highlight:B}),loading:ee,inputDebounceTime:de,inputPlaceholder:`Search ${z||ce.name} docs`,freeSolo:!1})},F=ve=>{const ce={term:"",types:["techdocs"],pageCursor:"",filters:ve.entityId};return(0,r.jsx)(p.Nd,{initialState:ce,children:(0,r.jsx)(h,{...ve})})}},53260:function(){}},function(It){var Pe=function(r){return It(It.s=r)};It.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,242,5109,6816,5218,4736],function(){return Pe(30966)});var n=It.O()}]);})();
521
521
 
522
- //# sourceMappingURL=main.928ac0fe.js.map
522
+ //# sourceMappingURL=main.49a8a453.js.map