@techdocs/cli 0.0.0-nightly-20230101023257 → 0.0.0-nightly-20230103022231
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 +5 -5
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.97fb9765.js → main.cba21e8e.js} +1 -1
- package/dist/embedded-app/static/{main.97fb9765.js.map → main.cba21e8e.js.map} +1 -1
- package/dist/embedded-app/static/module-luxon.4cf2fdd7.js +3 -0
- package/dist/embedded-app/static/module-luxon.4cf2fdd7.js.map +1 -0
- package/dist/embedded-app/static/{runtime.97fb9765.js → runtime.cba21e8e.js} +1 -1
- package/dist/embedded-app/static/{runtime.97fb9765.js.map → runtime.cba21e8e.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.97fb9765.js → vendor.cba21e8e.js} +1 -1
- package/dist/embedded-app/static/{vendor.97fb9765.js.map → vendor.cba21e8e.js.map} +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/module-luxon.8ea19264.js +0 -3
- package/dist/embedded-app/static/module-luxon.8ea19264.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20230103022231
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Updated dependencies
|
|
8
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
9
|
-
- @backstage/config@0.0.0-nightly-
|
|
10
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
8
|
+
- @backstage/catalog-model@0.0.0-nightly-20230103022231
|
|
9
|
+
- @backstage/config@0.0.0-nightly-20230103022231
|
|
10
|
+
- @backstage/backend-common@0.0.0-nightly-20230103022231
|
|
11
11
|
- @backstage/cli-common@0.1.11
|
|
12
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
12
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20230103022231
|
|
13
13
|
|
|
14
14
|
## 1.2.5-next.0
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Backstage is an open platform for building developer portals"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json" crossorigin="use-credentials"/><link rel="icon" href="/favicon.ico"/><link rel="shortcut icon" href="/favicon.ico"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"/><title>Techdocs Preview App</title><script defer="defer" src="/static/runtime.
|
|
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.cba21e8e.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.4cf2fdd7.js"></script><script defer="defer" src="/static/module-octokit.08c0a003.js"></script><script defer="defer" src="/static/module-react-dom.5abdac04.js"></script><script defer="defer" src="/static/module-zod.49ffd80f.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.97cccd01.js"></script><script defer="defer" src="/static/module-remix-run.e15d5a2e.js"></script><script defer="defer" src="/static/vendor.cba21e8e.js"></script><script defer="defer" src="/static/main.cba21e8e.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"})}),_e=({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)(_e,{text:ke})}),Fe)}return H},ae=()=>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)",pe=w=>{const H=(0,Qe.s0)(),ve=(0,Ye.Z)(),ue=(0,Xe.Z)(de),we=Ie(),ke=dn(),Fe=(0,Z.z$)(),it=(0,Z.h_)(g.Dl),Ct=(0,Z.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(),ae(),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)})]})},Re=(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=Re(),{entityMetadata:{value:ke,loading:Fe},entityRef:it,setShadowRoot:Ct}=(0,g.x1)(),Ke=pe(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)(B.Z,{container:!0,children:[(0,h.jsx)(B.Z,{xs:12,item:!0,children:(0,h.jsx)(Te,{})}),ve&&(0,h.jsx)(B.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)(B.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)(B.Z,{container:!0,children:(0,h.jsx)(B.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 fe}});var h=t(52322),r=t(2784),W=t(18671),B=t(60905),g=t(98069),b=t(73250),c=t(61886),P=t(92848),te=t(25271),Q=t(93414),X=t(25248),M=t(76635),z=t(95573);const _=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),fe=ie=>{const{children:T}=ie,L=(0,c.$L)(),Z=(0,X.h_)(X.Ds),{title:A,setTitle:S,subtitle:q,setSubtitle:Te,entityRef:Qe,metadata:{value:Ye,loading:Xe},entityMetadata:{value:Ve,loading:ft}}=(0,c.x1)();(0,r.useEffect)(()=>{!Ye||(S(Ye.site_name),Te(()=>{let{site_description:se}=Ye;return(!se||se==="None")&&(se=""),se}))},[Ye,S,Te]);const je=Z.getOptional("app.title")||"Backstage",Ge=[A,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,X.tg)(z._Z)(),yt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Q.i9,{label:(0,M.capitalize)((Ve==null?void 0:Ve.kind)||"entity"),value:(0,h.jsx)(P.dx,{color:"inherit",entityRef:Qe,title:Ve==null?void 0:Ve.metadata.title,defaultKind:"Component"})}),ot.length>0&&(0,h.jsx)(Q.i9,{label:"Owner",value:(0,h.jsx)(P.rI,{color:"inherit",entityRefs:ot,defaultKind:"group"})}),rt?(0,h.jsx)(Q.i9,{label:"Lifecycle",value:rt}):null,st&&st.type!=="dir"&&st.type!=="file"?(0,h.jsx)(Q.i9,{label:"",value:(0,h.jsxs)(B.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(b.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(B.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:st.target}):null]});return!ft&&Ve===void 0||!Xe&&Ye===void 0?null:(0,h.jsxs)(Q.h4,{type:"Documentation",typeLink:ct,title:A||_,subtitle:q===""?void 0:q||_,children:[(0,h.jsx)(W.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:Ge})}),yt,T,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),B=t(15223),g=t(95544),b=t(80030),c=t(61837),P=t(48348),te=t(47603),Q=t(61886);const X=(0,W.Z)(z=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:z.spacing(3,3,0)}})),M=z=>{const _=X(),[fe,ie]=(0,r.useState)(null),T=(0,r.useCallback)(Qe=>{ie(Qe.currentTarget)},[]),L=(0,r.useCallback)(()=>{ie(null)},[]),{entityMetadata:{value:Z,loading:A}}=(0,Q.x1)(),S=(0,Q.$L)(),q=S.renderComponentsByLocation(Q.oZ.Subheader),Te=S.renderComponentsByLocation(Q.oZ.Settings);return!q&&!Te||A===!1&&!Z?null:(0,h.jsx)(B.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:T,children:(0,h.jsx)(te.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:fe,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(fe),onClose:L,keepMounted:!0,children: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),B=t(61886),g=t(25248),b=t(64279),c=t(77446);function P({contentLoading:fe,content:ie,activeSyncState:T}){return fe||T==="BUILD_READY_RELOAD"||!ie&&T==="CHECKING"?"CHECKING":!ie&&T==="BUILDING"?"INITIAL_BUILD":ie?T==="BUILDING"?"CONTENT_STALE_REFRESHING":T==="BUILD_READY"?"CONTENT_STALE_READY":T==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function te(fe,ie){const T={...fe};switch(ie.type){case"sync":ie.state==="CHECKING"&&(T.buildLog=[]),T.activeSyncState=ie.state,T.syncError=ie.syncError;break;case"contentLoading":T.contentLoading=!0,T.contentError=void 0;break;case"content":typeof ie.path=="string"&&(T.path=ie.path),T.contentLoading=!1,T.content=ie.content,T.contentError=ie.contentError;break;case"buildLog":T.buildLog=T.buildLog.concat(ie.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(T.activeSyncState)&&["contentLoading","content"].includes(ie.type)&&(T.activeSyncState="UP_TO_DATE",T.buildLog=[]),T}function Q(fe,ie,T,L){var Z,A;const[S,q]=(0,r.useReducer)(te,{activeSyncState:"CHECKING",path:L,contentLoading:!0,buildLog:[]}),Te=(0,g.h_)(B.Dl),{retry:Qe}=(0,c.Z)(async()=>{q({type:"contentLoading"});try{const Ve=await Te.getEntityDocs({kind:fe,namespace:ie,name:T},L);return q({type:"content",content:Ve,path:L}),Ve}catch(Ve){q({type:"content",contentError:Ve,path:L})}},[Te,fe,ie,T,L]),Ye=(0,r.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:S.content,reload:Qe},(0,b.default)(async()=>{q({type:"sync",state:"CHECKING"});const Ve=setTimeout(()=>{q({type:"sync",state:"BUILDING"})},1e3);try{switch(await Te.syncEntityDocs({kind:fe,namespace:ie,name:T},je=>{q({type:"buildLog",log:je})})){case"updated":Ye.current.content?q({type:"sync",state:"BUILD_READY"}):(Ye.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)}},[fe,T,ie,Te,q,Ye]),{state:(0,r.useMemo)(()=>P({activeSyncState:S.activeSyncState,contentLoading:S.contentLoading,content:S.content}),[S.activeSyncState,S.content,S.contentLoading]),contentReload:Qe,path:S.path,content:S.content,contentErrorMessage:(Z=S.contentError)===null||Z===void 0?void 0:Z.toString(),syncErrorMessage:(A=S.syncError)===null||A===void 0?void 0:A.toString(),buildLog:S.buildLog}}const X=(0,r.createContext)({}),M=()=>(0,r.useContext)(X),z=({children:fe})=>{const{"*":ie=""}=(0,W.UO)(),{entityRef:T}=(0,B.x1)(),{kind:L,namespace:Z,name:A}=T,S=Q(L,Z,A,ie);return(0,h.jsx)(X.Provider,{value:S,children:fe instanceof Function?fe(S):fe})},_=fe=>ie=>(0,h.jsx)(z,{children:(0,h.jsx)(fe,{...ie})})},95573:function(Rt,Me,t){"use strict";t.d(Me,{Fw:function(){return W},_Z:function(){return r},pd:function(){return B}});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"]}),B=(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),B=t(49378),g=t(38402),b=t(86136),c=t(85256),P=t(93414),te=t(25248),Q=t(65826);const X=(0,W.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),M=Z=>{const{result:A,highlight:S,rank:q,lineClamp:Te=5,asListItem:Qe=!0,asLink:Ye=!0,title:Xe,icon:Ve}=Z,ft=X(),je=(0,te.z$)(),Ge=()=>{je.captureEvent("discover",A.title,{attributes:{to:A.location},value:q})},st=({children:ot})=>Ye?(0,h.jsx)(P.rU,{noTrack:!0,to:A.location,onClick:Ge,children:ot}):(0,h.jsx)(h.Fragment,{children:ot}),gt=()=>{const ot=S!=null&&S.fields.title?(0,h.jsx)(Q.FA,{text:S.fields.title,preTag:S.preTag,postTag:S.postTag}):A.title,ct=S!=null&&S.fields.entityTitle?(0,h.jsx)(Q.FA,{text:S.fields.entityTitle,preTag:S.preTag,postTag:S.postTag}):A.entityTitle,yt=S!=null&&S.fields.name?(0,h.jsx)(Q.FA,{text:S.fields.name,preTag:S.preTag,postTag:S.postTag}):A.name;return(0,h.jsx)(B.Z,{className:ft.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(st,{children:Xe||(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)(Q.FA,{text:S.fields.text,preTag:S.preTag,postTag:S.postTag}):A.text})})},rt=({children:ot})=>Qe?(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 fe=(0,W.Z)(Z=>({root:{width:"100%"},bar:{padding:Z.spacing(1)}})),ie=Z=>Z==null?void 0:Z.document,T=Z=>{const{entityId:A,entityTitle:S,debounceTime:q=150}=Z,[Te,Qe]=(0,r.useState)(!1),Ye=(0,_.s0)(),{setFilters:Xe,result:{loading:Ve,value:ft}}=(0,Q.Rx)(),je=fe(),[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}=A;(0,r.useEffect)(()=>{Xe(yt=>({...yt,kind:gt,namespace:ot,name:rt}))},[gt,ot,rt,Xe]);const ct=(yt,Lt)=>{if(ie(Lt)){const{location:We}=Lt.document;Ye(We)}};return(0,h.jsx)(z.Z,{className:je.bar,variant:"outlined",children:(0,h.jsx)(Q.qO,{classes:{root:je.root},"data-testid":"techdocs-search-bar",size:"small",open:Te,getOptionLabel:()=>"",filterOptions:yt=>yt,onClose:()=>{Qe(!1)},onFocus:()=>{Qe(!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||A.name} docs`,freeSolo:!1})})},L=Z=>{const A={term:"",types:["techdocs"],pageCursor:"",filters:Z.entityId};return(0,h.jsx)(Q.Nd,{initialState:A,children:(0,h.jsx)(T,{...Z})})}},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.
|
|
494
|
+
//# sourceMappingURL=main.cba21e8e.js.map
|