@techdocs/cli 1.4.5-next.0 → 1.4.5-next.1

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,5 +1,16 @@
1
1
  # @techdocs/cli
2
2
 
3
+ ## 1.4.5-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-common@0.19.2-next.1
9
+ - @backstage/plugin-techdocs-node@1.7.4-next.1
10
+ - @backstage/catalog-model@1.4.1
11
+ - @backstage/cli-common@0.1.12
12
+ - @backstage/config@1.0.8
13
+
3
14
  ## 1.4.5-next.0
4
15
 
5
16
  ### Patch Changes
@@ -862,7 +862,15 @@
862
862
  "visibility": "secret",
863
863
  "anyOf": [
864
864
  {
865
- "$ref": "#/definitions/Partial<{[key:string]:unknown;password:string;}>"
865
+ "type": "object",
866
+ "additionalProperties": {},
867
+ "properties": {
868
+ "password": {
869
+ "description": "Password that belongs to the client User",
870
+ "visibility": "secret",
871
+ "type": "string"
872
+ }
873
+ }
866
874
  },
867
875
  {
868
876
  "type": "string"
@@ -1189,18 +1197,6 @@
1189
1197
  "app",
1190
1198
  "backend"
1191
1199
  ],
1192
- "definitions": {
1193
- "Partial<{[key:string]:unknown;password:string;}>": {
1194
- "type": "object",
1195
- "properties": {
1196
- "password": {
1197
- "description": "Password that belongs to the client User",
1198
- "visibility": "secret",
1199
- "type": "string"
1200
- }
1201
- }
1202
- }
1203
- },
1204
1200
  "$schema": "http://json-schema.org/draft-07/schema#"
1205
1201
  }
1206
1202
  },
@@ -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.bb345c39.js"></script><script defer="defer" src="/static/module-material-ui.1afbaa53.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.1d463a12.js"></script><script defer="defer" src="/static/module-luxon.a1854eb9.js"></script><script defer="defer" src="/static/module-octokit.7416db07.js"></script><script defer="defer" src="/static/module-react-dom.bd3fd0c6.js"></script><script defer="defer" src="/static/module-react-router.d2e96318.js"></script><script defer="defer" src="/static/module-react-router-dom.ef191c8f.js"></script><script defer="defer" src="/static/module-zod.49079951.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.ad887878.js"></script><script defer="defer" src="/static/vendor.bb345c39.js"></script><script defer="defer" src="/static/main.bb345c39.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.4b0555c5.js"></script><script defer="defer" src="/static/module-material-ui.1afbaa53.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.1d463a12.js"></script><script defer="defer" src="/static/module-luxon.a1854eb9.js"></script><script defer="defer" src="/static/module-octokit.7416db07.js"></script><script defer="defer" src="/static/module-react-dom.bd3fd0c6.js"></script><script defer="defer" src="/static/module-react-router.d2e96318.js"></script><script defer="defer" src="/static/module-react-router-dom.ef191c8f.js"></script><script defer="defer" src="/static/module-zod.49079951.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.ad887878.js"></script><script defer="defer" src="/static/vendor.4b0555c5.js"></script><script defer="defer" src="/static/main.4b0555c5.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 @@ ${nt.href}
519
519
 
520
520
  Feedback:`),_t=((be=bt)===null||be===void 0?void 0:be.type)==="github"?(0,Sn.BT)(yt.href,"blob"):yt.href,jt=on()(_t),Ft=`/${jt.organization}/${jt.name}`,qt=nt.cloneNode();switch((ke=bt)===null||ke===void 0?void 0:ke.type){case"gitlab":qt.href=`${yt.origin}${Ft}/issues/new?issue[title]=${Oe}&issue[description]=${wt}`;break;case"github":qt.href=`${yt.origin}${Ft}/issues/new?title=${Oe}&body=${wt}`;break;default:return O}return vn.render(p.createElement(hn.Z),qt),qt.style.paddingLeft="5px",qt.title="Leave feedback for this page",qt.id="git-feedback-link",(Xe=nt)===null||Xe===void 0||Xe.insertAdjacentElement("beforebegin",qt),O};var wn=n(44882);const _e=()=>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 vn.render(p.createElement(wn.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=Wt(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 Wt(v){const O=new URL(v);return!O.pathname.endsWith("/")&&!O.pathname.endsWith(".html")&&(O.pathname+="/"),O.toString()}const Je=({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 Tn=n(15459),sn=n(80030),Dn=n(72379),Rn=n(41547),In=n(95074);const Kn=(0,Tn.Z)(v=>({tooltip:{fontSize:"inherit",color:v.palette.text.primary,margin:0,padding:v.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(sn.ZP),On=()=>(0,r.jsx)(Dn.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"})}),Yn=({text:v})=>{const[O,M]=(0,p.useState)(!1),[,G]=(0,In.Z)(),ue=(0,p.useCallback)(()=>{G(v),M(!0)},[v,G]),be=(0,p.useCallback)(()=>{M(!1)},[M]);return(0,r.jsx)(Kn,{title:"Copied to clipboard",placement:"left",open:O,onClose:be,leaveDelay:1e3,children:(0,r.jsx)(D.Z,{style:{color:"inherit"},className:"md-clipboard md-icon",onClick:ue,children:(0,r.jsx)(On,{})})})},we=v=>O=>{const M=O.querySelectorAll("pre > code");for(const be of M){var G,ue;const ke=be.textContent||"",Xe=document.createElement("div");(ue=be)===null||ue===void 0||(G=ue.parentElement)===null||G===void 0||G.prepend(Xe),vn.render((0,r.jsx)(Rn.Z,{theme:v,children:(0,r.jsx)(Yn,{text:ke})}),Xe)}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),le=()=>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 Xe=(be=ue)===null||be===void 0?void 0:be.querySelector("input");if(!(!((ke=Xe)===null||ke===void 0)&&ke.checked)){var nt;(nt=Xe)===null||nt===void 0||nt.click()}}),M[M.length-1].scrollIntoView())},200),v),Ee=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 Ue=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,Ue.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=mn(),ke=(0,K.z$)(),Xe=(0,K.h_)(V.Dl),nt=(0,K.h_)(k.q3),{state:yt,path:bt,content:ct}=(0,w.DK)(),[Oe,wt]=(0,p.useState)(null),_t=(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,Mt,en;const yn=(Lt=document)===null||Lt===void 0?void 0:Lt.querySelector(".techdocs-reader-page");var pr;const Mn=(pr=(Mt=yn)===null||Mt===void 0?void 0:Mt.getBoundingClientRect().top)!==null&&pr!==void 0?pr:0;var fr;let gr=(fr=Oe.getBoundingClientRect().top)!==null&&fr!==void 0?fr:0;const Nr=Oe.querySelector(".md-container > .md-tabs");var _n;const zn=(_n=(en=Nr)===null||en===void 0?void 0:en.getBoundingClientRect().height)!==null&&_n!==void 0?_n:0;gr<Mn&&(gr=Mn),mt.style.top=`${Math.max(gr,0)+zn}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 Ft=(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",Ft),()=>{window.removeEventListener("resize",Ft)}),[Oe,Ft]),(0,p.useEffect)(()=>{_t||(Ft(),jt())},[yt,_t,Ft,jt]);const qt=(0,p.useCallback)((Bt,mt)=>Ee(Bt,[ue,ln({techdocsStorageApi:Xe,entityId:v,path:mt}),Jt(),_e(),pe(),Re(),pn(nt),be]),[v,nt,Xe,ue,be]),jn=(0,p.useCallback)(async Bt=>Ee(Bt,[N(),le(),we(M),Je({baseUrl:window.location.origin,onClick:(mt,Lt)=>{var Mt;const en=mt.ctrlKey||mt.metaKey,pr=new URL(Lt),fr=((Mt=mt.target)===null||Mt===void 0?void 0:Mt.innerText)||Lt,_n=Lt.replace(window.location.origin,"");if(ke.captureEvent("click",fr,{attributes:{to:_n}}),pr.hash)if(en)window.open(Lt,"_blank");else{var yn,Mn;O(Lt),(Mn=Bt)===null||Mn===void 0||(yn=Mn.querySelector(`[id="${pr.hash.slice(1)}"]`))===null||yn===void 0||yn.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 qt(ct,bt).then(async mt=>{var Lt;if(!(!((Lt=mt)===null||Lt===void 0)&&Lt.innerHTML)||!Bt)return;window.scroll({top:0});const Mt=await jn(mt);wt(Mt)}),()=>{Bt=!1}},[ct,bt,qt,jn]),Oe};var Xt=n(8560);const an=()=>{var v,O,M,G,ue;const be=(0,V.$L)(),{shadowRoot:ke}=(0,V.x1)(),Xe=(v=ke)===null||v===void 0?void 0:v.querySelector('[data-md-component="content"]'),nt=(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=nt)===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=nt)===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:Xe,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:Xe},entityRef:nt,setShadowRoot:yt}=(0,V.x1)(),bt=Qt(nt),ct=(0,p.useCallback)(Oe=>{yt(Oe),ue instanceof Function&&ue()},[yt,ue]);return Xe===!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)(U,{})}),G&&(0,r.jsx)(f.Z,{className:be.search,xs:"auto",item:!0,children:(0,r.jsx)(h.S,{entityId:nt,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)(U,{})})})})}),Y=null},93225:function(It,Pe,n){"use strict";n.d(Pe,{S:function(){return ie}});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),D=n(76635),A=n(95573);const se=(0,r.jsx)(V.Z,{animation:"wave",variant:"text",height:40}),ie=ee=>{var X,K,R;const{palette:{common:{white:w}}}=(0,m.Z)(),{children:I}=ee,U=(0,F.$L)(),xe=(0,de.h_)(de.Ds),{title:Se,setTitle:k,subtitle:Ke,setSubtitle:xt,entityRef:Dt,metadata:{value:Ut,loading:Tt},entityMetadata:{value:Nt,loading:Yt}}=(0,F.x1)();(0,p.useEffect)(()=>{Ut&&(k(Ut.site_name),xt(()=>{let{site_description:rt}=Ut;return(!rt||rt==="None")&&(rt=""),rt}))},[Ut,k,xt]);const dt=xe.getOptional("app.title")||"Backstage",ut=[Se,Ke,dt].filter(Boolean).join(" | "),{locationMetadata:St,spec:lt}=Nt||{},Zt=(X=lt)===null||X===void 0?void 0:X.lifecycle,Ht=Nt?(0,ve.hF)(Nt,ce.S4):[],Ce=(0,de.tg)(A._Z)(),$e=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z.i9,{label:(0,D.capitalize)(((K=Nt)===null||K===void 0?void 0:K.kind)||"entity"),value:(0,r.jsx)(ve.dx,{color:"inherit",entityRef:Dt,title:(R=Nt)===null||R===void 0?void 0:R.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"})}),Zt?(0,r.jsx)(z.i9,{label:"Lifecycle",value:Zt}):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&&Nt===void 0||!Tt&&Ut===void 0?null:(0,r.jsxs)(z.h4,{type:"Documentation",typeLink:Ce,title:Se||se,subtitle:Ke===""?void 0:Ke||se,children:[(0,r.jsx)(W.Z,{titleTemplate:"%s",children:(0,r.jsx)("title",{children:ut})}),$e,I,U.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)(D=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:D.spacing(3,3,0),"@media print":{display:"none"}}})),de=D=>{const A=z(),[se,ie]=(0,p.useState)(null),ee=(0,p.useCallback)(xe=>{ie(xe.currentTarget)},[]),X=(0,p.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:K,loading:R}}=(0,ce.x1)(),w=(0,ce.$L)(),I=w.renderComponentsByLocation(ce.oZ.Subheader),U=w.renderComponentsByLocation(ce.oZ.Settings);return!I&&!U||R===!1&&!K?null:(0,r.jsx)(f.Z,{classes:A,...D.toolbarProps,children:(0,r.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[I,U?(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:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:X,keepMounted:!0,children:(0,r.jsx)("div",{children:U})})]}):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:se,content:ie,activeSyncState:ee}){return se||ee==="BUILD_READY_RELOAD"||!ie&&ee==="CHECKING"?"CHECKING":!ie&&ee==="BUILDING"?"INITIAL_BUILD":ie?ee==="BUILDING"?"CONTENT_STALE_REFRESHING":ee==="BUILD_READY"?"CONTENT_STALE_READY":ee==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ve(se,ie){const ee={...se};switch(ie.type){case"sync":ie.state==="CHECKING"&&(ee.buildLog=[]),ee.activeSyncState=ie.state,ee.syncError=ie.syncError;break;case"contentLoading":ee.contentLoading=!0,ee.contentError=void 0;break;case"content":typeof ie.path=="string"&&(ee.path=ie.path),ee.contentLoading=!1,ee.content=ie.content,ee.contentError=ie.contentError;break;case"buildLog":ee.buildLog=ee.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(ee.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(ee.activeSyncState="UP_TO_DATE",ee.buildLog=[]),ee}function ce(se,ie,ee,X){var K,R;const[w,I]=(0,p.useReducer)(ve,{activeSyncState:"CHECKING",path:X,contentLoading:!0,buildLog:[]}),U=(0,V.h_)(f.Dl),{retry:xe}=(0,h.Z)(async()=>{I({type:"contentLoading"});try{const Ke=await U.getEntityDocs({kind:se,namespace:ie,name:ee},X);return I({type:"content",content:Ke,path:X}),Ke}catch(Ke){I({type:"content",contentError:Ke,path:X})}},[U,se,ie,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 Ke=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await U.syncEntityDocs({kind:se,namespace:ie,name:ee},Dt=>{I({type:"buildLog",log:Dt})})){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(Ke)}},[se,ee,ie,U,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:(R=w.syncError)===null||R===void 0?void 0:R.toString(),buildLog:w.buildLog}}const z=(0,p.createContext)({}),de=()=>(0,p.useContext)(z),D=se=>{const{children:ie}=se,{"*":ee=""}=(0,W.UO)(),{entityRef:X}=(0,f.x1)(),{kind:K,namespace:R,name:w}=X,I=ce(K,R,w,ee);return(0,r.jsx)(z.Provider,{value:I,children:ie instanceof Function?ie(I):ie})},A=se=>ie=>(0,r.jsx)(D,{children:(0,r.jsx)(se,{...ie})})},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:D,lineClamp:A=5,asListItem:se=!0,asLink:ie=!0,title:ee,icon:X}=z,K=ve(),R=({children:U})=>ie?(0,r.jsx)(h.rU,{noTrack:!0,to:de.location,children:U}):(0,r.jsx)(r.Fragment,{children:U}),w=()=>{var U,xe,Se,k;const Ke=!((U=D)===null||U===void 0)&&U.fields.title?(0,r.jsx)(F.FA,{text:D.fields.title,preTag:D.preTag,postTag:D.postTag}):de.title,xt=!((xe=D)===null||xe===void 0)&&xe.fields.entityTitle?(0,r.jsx)(F.FA,{text:D.fields.entityTitle,preTag:D.preTag,postTag:D.postTag}):de.entityTitle,Dt=!((Se=D)===null||Se===void 0)&&Se.fields.name?(0,r.jsx)(F.FA,{text:D.fields.name,preTag:D.preTag,postTag:D.postTag}):de.name;return de?(0,r.jsx)(f.Z,{className:K.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,r.jsx)(R,{children:ee||(0,r.jsxs)(r.Fragment,{children:[Ke," | ",xt!=null?xt:Dt," docs"]})}),secondary:(0,r.jsx)(m.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:A,overflow:"hidden"},color:"textSecondary",variant:"body2",children:!((k=D)===null||k===void 0)&&k.fields.text?(0,r.jsx)(F.FA,{text:D.fields.text,preTag:D.preTag,postTag:D.postTag}):de.text})}):null},I=({children:U})=>se?(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:U})]}):(0,r.jsx)(r.Fragment,{children:U});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,[D,A]=(0,W.useState)(!1),se=(0,f.s0)(),{setFilters:ie,result:{loading:ee,value:X}}=(0,p.Rx)(),[K,R]=(0,W.useState)([]);(0,W.useEffect)(()=>{let Se=!0;if(Se&&X){const k=X.results.slice(0,10);R(k)}return()=>{Se=!1}},[ee,X]);const{kind:w,name:I,namespace:U}=ce;(0,W.useEffect)(()=>{ie(Se=>({...Se,kind:w,namespace:U,name:I}))},[w,U,I,ie]);const xe=(Se,k)=>{if(m(k)){const{location:Ke}=k.document;se(Ke)}};return(0,r.jsx)(p.qO,{"data-testid":"techdocs-search-bar",size:"small",open:D,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:k})=>(0,r.jsx)(V.TechDocsSearchResultListItem,{result:Se,lineClamp:3,asListItem:!1,asLink:!1,title:Se.title,highlight:k}),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(48514)});var n=It.O()}]);})();
521
521
 
522
- //# sourceMappingURL=main.bb345c39.js.map
522
+ //# sourceMappingURL=main.4b0555c5.js.map