@techdocs/cli 0.0.0-nightly-20220702024817 → 0.0.0-nightly-20220705025009
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 +4 -4
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.701559d1.js → main.a8e4c7a4.js} +1 -1
- package/dist/embedded-app/static/{main.701559d1.js.map → main.a8e4c7a4.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.701559d1.js → runtime.a8e4c7a4.js} +1 -1
- package/dist/embedded-app/static/{runtime.701559d1.js.map → runtime.a8e4c7a4.js.map} +1 -1
- package/dist/embedded-app/static/vendor.a8e4c7a4.js +102 -0
- package/dist/embedded-app/static/vendor.a8e4c7a4.js.map +1 -0
- package/package.json +5 -5
- package/dist/embedded-app/static/vendor.701559d1.js +0 -103
- package/dist/embedded-app/static/vendor.701559d1.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-20220705025009
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- a5d73da942: Fix the flag parsing for `legacyCopyReadmeMdToIndexMd` in `techdocs-cli generate` command, and decouple it's logic from the `techdocs-ref` flag.
|
|
8
8
|
- 14ce0d9347: Fixed a bug that prevented docker images from being pulled by default when generating TechDocs.
|
|
9
9
|
- Updated dependencies
|
|
10
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
11
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
12
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
10
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20220705025009
|
|
11
|
+
- @backstage/backend-common@0.0.0-nightly-20220705025009
|
|
12
|
+
- @backstage/catalog-model@0.0.0-nightly-20220705025009
|
|
13
13
|
|
|
14
14
|
## 1.1.3-next.1
|
|
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.a8e4c7a4.js"></script><script defer="defer" src="/static/module-material-ui.1e05f502.js"></script><script defer="defer" src="/static/module-lodash.32f2edbb.js"></script><script defer="defer" src="/static/module-date-fns.667c4862.js"></script><script defer="defer" src="/static/module-ajv.f2ae340e.js"></script><script defer="defer" src="/static/module-material-table.cd3af251.js"></script><script defer="defer" src="/static/module-yaml.63d08f2d.js"></script><script defer="defer" src="/static/module-hot-loader.baa19dda.js"></script><script defer="defer" src="/static/module-jss.df150ef8.js"></script><script defer="defer" src="/static/module-zod.2193e794.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.6085a9b0.js"></script><script defer="defer" src="/static/vendor.a8e4c7a4.js"></script><script defer="defer" src="/static/main.a8e4c7a4.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -484,4 +484,4 @@ ${Ae.href}
|
|
|
484
484
|
|
|
485
485
|
Feedback:`),jt=(Ie==null?void 0:Ie.type)==="github"?(0,ie.Pb)(be.href,"blob"):be.href,Yt=Re()(jt),Nt=`/${Yt.organization}/${Yt.name}`,et=Ae.cloneNode();switch(Ie==null?void 0:Ie.type){case"gitlab":et.href=`${be.origin}${Nt}/issues/new?issue[title]=${dt}&issue[description]=${It}`;break;case"github":et.href=`${be.origin}${Nt}/issues/new?title=${dt}&body=${It}`;break;default:return ae}return Te.render(r.createElement(ue.Z),et),et.style.paddingLeft="5px",et.title="Leave feedback for this page",et.id="git-feedback-link",Ae==null||Ae.insertAdjacentElement("beforebegin",et),ae};var He=e(44882);const Et=()=>x=>{const ae=x.querySelector('.md-header label[for="__drawer"]'),Ae=x.querySelector("article");if(!ae||!Ae)return x;const be=ae.cloneNode();return Te.render(r.createElement(He.Z),be),be.id="toggle-sidebar",be.title="Toggle Sidebar",be.classList.add("md-content__button"),be.style.setProperty("padding","0 0 0 5px"),be.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Ae==null||Ae.prepend(be),x},Tt=()=>x=>(((Ae,be)=>{Array.from(Ae).filter(Ie=>Ie.hasAttribute(be)).forEach(Ie=>{const mt=Ie.getAttribute(be);if(mt){mt.match(/^https?:\/\//i)&&Ie.setAttribute("target","_blank");try{const dt=ut(window.location.href);Ie.setAttribute(be,new URL(mt,dt).toString())}catch{Ie.replaceWith(Ie.textContent||mt)}}})})(Array.from(x.getElementsByTagName("a")),"href"),x);function ut(x){const ae=new URL(x);return!ae.pathname.endsWith("/")&&!ae.pathname.endsWith(".html")&&(ae.pathname+="/"),ae.toString()}const bt=({baseUrl:x,onClick:ae})=>Ae=>(Array.from(Ae.getElementsByTagName("a")).forEach(be=>{be.addEventListener("click",Ie=>{const dt=be.getAttribute("href");!dt||dt.startsWith(x)&&!be.hasAttribute("download")&&(Ie.preventDefault(),ae(Ie,dt))})}),Ae);var Lt=e(15459),Ft=e(80030),Ot=e(72379),Wt=e(41547);const St=(0,Lt.Z)(x=>({tooltip:{fontSize:"inherit",color:x.palette.text.primary,margin:0,padding:x.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Ft.ZP),at=()=>r.createElement(Ot.Z,null,r.createElement("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"})),Nn=({text:x})=>{const[ae,Ae]=(0,r.useState)(!1),be=(0,r.useCallback)(()=>{navigator.clipboard.writeText(x),Ae(!0)},[x]),Ie=(0,r.useCallback)(()=>{Ae(!1)},[Ae]);return r.createElement(St,{title:"Copied to clipboard",placement:"left",open:ae,onClose:Ie,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:be},r.createElement(at,null)))},re=x=>ae=>{var be;const Ae=ae.querySelectorAll("pre > code");for(const Ie of Ae){const mt=Ie.textContent||"",dt=document.createElement("div");(be=Ie==null?void 0:Ie.parentElement)==null||be.prepend(dt),Te.render(r.createElement(Wt.Z,{theme:x},r.createElement(Nn,{text:mt})),dt)}return ae},V=()=>x=>{var ae;return(ae=x.querySelector(".md-header"))==null||ae.remove(),x},ce=()=>x=>{var ae,Ae;return(ae=x.querySelector(".md-footer .md-copyright"))==null||ae.remove(),(Ae=x.querySelector(".md-footer-copyright"))==null||Ae.remove(),x},ze=({onLoading:x,onLoaded:ae})=>Ae=>(x(),Ae.addEventListener(u.Ox,function be(){ae(),Ae.removeEventListener(u.Ox,be)}),Ae),qe=()=>x=>(setTimeout(()=>{var ae;if(window.location.hash){const Ae=window.location.hash.slice(1);(ae=x==null?void 0:x.querySelector(`[id="${Ae}"]`))==null||ae.scrollIntoView()}},200),x),_e=async(x,ae)=>{let Ae;if(typeof x=="string")Ae=new DOMParser().parseFromString(x,"text/html").documentElement;else if(x instanceof Element)Ae=x;else throw new Error("dom is not a recognized type");for(const be of ae)Ae=await be(Ae);return Ae},Pt="screen and (max-width: 76.1875em)",Ut=x=>{const ae=(0,te.s0)(),Ae=(0,fe.Z)(),be=(0,Se.Z)(Pt),Ie=Ne(),mt=Q(),dt=(0,b.useApi)(u.Dl),It=(0,b.useApi)($e.q3),{state:jt,path:Yt,content:Nt}=(0,D.DK)(),[et,$t]=(0,r.useState)(null),qt=(0,u.ux)(et),Vt=(0,r.useCallback)(()=>{if(!et)return;et.querySelectorAll(".md-sidebar").forEach(zt=>{var dn,vn,fn;if(be)zt.style.top="0px";else{const An=document==null?void 0:document.querySelector(".techdocs-reader-page"),Zn=(dn=An==null?void 0:An.getBoundingClientRect().top)!=null?dn:0;let w=(vn=et.getBoundingClientRect().top)!=null?vn:0;const h=et.querySelector(".md-container > .md-tabs"),S=(fn=h==null?void 0:h.getBoundingClientRect().height)!=null?fn:0;w<Zn&&(w=Zn),zt.style.top=`${Math.max(w,0)+S}px`}zt.style.setProperty("opacity","1")})},[et,be]);(0,r.useEffect)(()=>(window.addEventListener("resize",Vt),window.addEventListener("scroll",Vt,!0),()=>{window.removeEventListener("resize",Vt),window.removeEventListener("scroll",Vt,!0)}),[et,Vt]);const Gt=(0,r.useCallback)(()=>{if(!et)return;const Jt=et.querySelector(".md-footer");Jt&&(Jt.style.width=`${et.getBoundingClientRect().width}px`)},[et]);(0,r.useEffect)(()=>(window.addEventListener("resize",Gt),()=>{window.removeEventListener("resize",Gt)}),[et,Gt]),(0,r.useEffect)(()=>{qt||(Gt(),Vt())},[jt,qt,Gt,Vt]);const un=(0,r.useCallback)((Jt,zt)=>_e(Jt,[Ie,X({techdocsStorageApi:dt,entityId:x,path:zt}),Tt(),Et(),V(),ce(),Ke(It),mt]),[x,It,dt,Ie,mt]),Rn=(0,r.useCallback)(async Jt=>_e(Jt,[qe(),re(Ae),bt({baseUrl:window.location.origin,onClick:(zt,dn)=>{var An;const vn=zt.ctrlKey||zt.metaKey,fn=new URL(dn);fn.hash?vn?window.open(`${fn.pathname}${fn.hash}`,"_blank"):(ae(`${fn.pathname}${fn.hash}`),(An=Jt==null?void 0:Jt.querySelector(`#${fn.hash.slice(1)}`))==null||An.scrollIntoView()):vn?window.open(fn.pathname,"_blank"):ae(fn.pathname)}}),ze({onLoading:()=>{},onLoaded:()=>{var zt;(zt=Jt.querySelector(".md-nav__title"))==null||zt.removeAttribute("for")}}),ze({onLoading:()=>{Array.from(Jt.querySelectorAll(".md-sidebar")).forEach(dn=>{dn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Ae,ae]);return(0,r.useEffect)(()=>{if(!Nt)return()=>{};let Jt=!0;return un(Nt,Yt).then(async zt=>{if(!(zt!=null&&zt.innerHTML)||!Jt)return;window.scroll({top:0});const dn=await Rn(zt);$t(dn)}),()=>{Jt=!1}},[Nt,Yt,un,Rn]),et};var Ht=e(8560);const an=()=>{const x=(0,u.$L)(),{shadowRoot:ae}=(0,u.x1)(),Ae=ae==null?void 0:ae.querySelector('[data-md-component="content"]'),be=ae==null?void 0:ae.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ie=be==null?void 0:be.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ie||(Ie=document.createElement("div"),Ie.setAttribute("data-techdocs-addons-location","primary sidebar"),be==null||be.prepend(Ie));const mt=ae==null?void 0:ae.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let dt=mt==null?void 0:mt.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return dt||(dt=document.createElement("div"),dt.setAttribute("data-techdocs-addons-location","secondary sidebar"),mt==null||mt.prepend(dt)),r.createElement(r.Fragment,null,r.createElement(Ht.Z,{container:Ie},x.renderComponentsByLocation(u.oZ.PrimarySidebar)),r.createElement(Ht.Z,{container:Ae},x.renderComponentsByLocation(u.oZ.Content)),r.createElement(Ht.Z,{container:dt},x.renderComponentsByLocation(u.oZ.SecondarySidebar)))},pn=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),Bt=(0,D.m1)(x=>{var Nt;const{withSearch:ae=!0,onReady:Ae}=x,be=pn(),{entityMetadata:{value:Ie,loading:mt},entityRef:dt,setShadowRoot:It}=(0,u.x1)(),jt=Ut(dt),Yt=(0,r.useCallback)(et=>{It(et),Ae instanceof Function&&Ae()},[It,Ae]);return mt===!1&&!Ie?r.createElement(A.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):jt?r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(k,null)),ae&&r.createElement(l.Z,{className:be.search,xs:"auto",item:!0},r.createElement(m.S,{entityId:dt,entityTitle:(Nt=Ie==null?void 0:Ie.metadata)==null?void 0:Nt.title})),r.createElement(l.Z,{xs:12,item:!0},r.createElement(u.VA,{element:jt,onAppend:Yt},r.createElement(an,null))))):r.createElement(A.Content,null,r.createElement(l.Z,{container:!0},r.createElement(l.Z,{xs:12,item:!0},r.createElement(k,null))))}),nn=null},99954:function(ee,s,e){"use strict";e.d(s,{S:function(){return E}});var r=e(2784),t=e(18671),l=e(98069),u=e(73250),A=e(26136),m=e(17429),o=e(48023),c=e(82339),f=e(36964),y=e(68725);const p=r.createElement(l.Z,{animation:"wave",variant:"text",height:40}),E=C=>{const{children:L}=C,B=(0,A.$L)(),z=(0,f.useApi)(f.configApiRef),{title:M,setTitle:b,subtitle:O,setSubtitle:D,entityRef:U,metadata:{value:k,loading:te},entityMetadata:{value:fe,loading:Se}}=(0,A.x1)();(0,r.useEffect)(()=>{!k||(b(je=>{const{site_name:le}=k;return je||le}),D(je=>{let{site_description:le}=k;return(!le||le==="None")&&(le="Home"),je||le}))},[k,b,D]);const $e=z.getOptional("app.title")||"Backstage",ye=[M,O,$e].filter(Boolean).join(" | "),{locationMetadata:We,spec:tt}=fe||{},nt=tt==null?void 0:tt.lifecycle,st=fe?(0,m.getEntityRelations)(fe,o.S4):[],Ct=(0,f.useRouteRef)(y._Z)(),At=r.createElement(r.Fragment,null,r.createElement(c.HeaderLabel,{label:"Component",value:r.createElement(m.EntityRefLink,{color:"inherit",entityRef:U,title:fe==null?void 0:fe.metadata.title,defaultKind:"Component"})}),st.length>0&&r.createElement(c.HeaderLabel,{label:"Owner",value:r.createElement(m.EntityRefLinks,{color:"inherit",entityRefs:st,defaultKind:"group"})}),nt?r.createElement(c.HeaderLabel,{label:"Lifecycle",value:nt}):null,We&&We.type!=="dir"&&We.type!=="file"?r.createElement(c.HeaderLabel,{label:"",value:r.createElement("a",{href:We.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(u.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Se&&fe===void 0||!te&&k===void 0?null:r.createElement(c.Header,{type:"Documentation",typeLink:Ct,title:M||p,subtitle:O||p},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,ye)),At,L,B.renderComponentsByLocation(A.oZ.Header))}},16172:function(ee,s,e){"use strict";e.d(s,{b:function(){return p}});var r=e(2784),t=e(79692),l=e(15223),u=e(95544),A=e(80030),m=e(61837),o=e(48348),c=e(47603),f=e(26136);const y=(0,t.Z)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0)}})),p=({toolbarProps:E})=>{const C=y(),[L,B]=(0,r.useState)(null),z=(0,r.useCallback)(te=>{B(te.currentTarget)},[]),M=(0,r.useCallback)(()=>{B(null)},[]),{entityMetadata:{value:b,loading:O}}=(0,f.x1)(),D=(0,f.$L)(),U=D.renderComponentsByLocation(f.oZ.Subheader),k=D.renderComponentsByLocation(f.oZ.Settings);return!U&&!k||O===!1&&!b?null:r.createElement(l.Z,{classes:C,...E},r.createElement(u.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},U,k?r.createElement(r.Fragment,null,r.createElement(A.ZP,{title:"Settings"},r.createElement(m.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:z},r.createElement(c.Z,null))),r.createElement(o.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(L),onClose:M,keepMounted:!0},k)):null))}},2263:function(ee,s,e){"use strict";e.d(s,{DK:function(){return p},m1:function(){return C}});var r=e(2784),t=e(10289),l=e(26136),u=e(36964),A=e(64279),m=e(77446);function o({contentLoading:L,content:B,activeSyncState:z}){return L||z==="BUILD_READY_RELOAD"||!B&&z==="CHECKING"?"CHECKING":!B&&z==="BUILDING"?"INITIAL_BUILD":B?z==="BUILDING"?"CONTENT_STALE_REFRESHING":z==="BUILD_READY"?"CONTENT_STALE_READY":z==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function c(L,B){const z={...L};switch(B.type){case"sync":B.state==="CHECKING"&&(z.buildLog=[]),z.activeSyncState=B.state,z.syncError=B.syncError;break;case"contentLoading":z.contentLoading=!0,z.contentError=void 0;break;case"content":typeof B.path=="string"&&(z.path=B.path),z.contentLoading=!1,z.content=B.content,z.contentError=B.contentError;break;case"buildLog":z.buildLog=z.buildLog.concat(B.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(z.activeSyncState)&&["contentLoading","content"].includes(B.type)&&(z.activeSyncState="UP_TO_DATE",z.buildLog=[]),z}function f(L,B,z,M){var fe,Se;const[b,O]=(0,r.useReducer)(c,{activeSyncState:"CHECKING",path:M,contentLoading:!0,buildLog:[]}),D=(0,u.useApi)(l.Dl),{retry:U}=(0,m.Z)(async()=>{O({type:"contentLoading"});try{const $e=await D.getEntityDocs({kind:L,namespace:B,name:z},M);return O({type:"content",content:$e,path:M}),$e}catch($e){O({type:"content",contentError:$e,path:M})}},[D,L,B,z,M]),k=(0,r.useRef)({content:void 0,reload:()=>{}});return k.current={content:b.content,reload:U},(0,A.default)(async()=>{O({type:"sync",state:"CHECKING"});const $e=setTimeout(()=>{O({type:"sync",state:"BUILDING"})},1e3);try{switch(await D.syncEntityDocs({kind:L,namespace:B,name:z},We=>{O({type:"buildLog",log:We})})){case"updated":k.current.content?O({type:"sync",state:"BUILD_READY"}):(k.current.reload(),O({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":O({type:"sync",state:"UP_TO_DATE"});break;default:O({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ye){O({type:"sync",state:"ERROR",syncError:ye})}finally{clearTimeout($e)}},[L,z,B,D,O,k]),{state:(0,r.useMemo)(()=>o({activeSyncState:b.activeSyncState,contentLoading:b.contentLoading,content:b.content}),[b.activeSyncState,b.content,b.contentLoading]),contentReload:U,path:b.path,content:b.content,contentErrorMessage:(fe=b.contentError)==null?void 0:fe.toString(),syncErrorMessage:(Se=b.syncError)==null?void 0:Se.toString(),buildLog:b.buildLog}}const y=(0,r.createContext)({}),p=()=>(0,r.useContext)(y),E=({children:L})=>{const{"*":B=""}=(0,t.UO)(),{entityRef:z}=(0,l.x1)(),{kind:M,namespace:b,name:O}=z,D=f(M,b,O,B);return r.createElement(y.Provider,{value:D},L instanceof Function?L(D):L)},C=L=>B=>r.createElement(E,null,r.createElement(L,{...B}))},96393:function(ee,s,e){"use strict";e.d(s,{Fq:function(){return u.F},SE:function(){return l.S}});var r=e(2263),t=e(26220),l=e(99954),u=e(63126),A=e(16172)},68725:function(ee,s,e){"use strict";e.d(s,{Fw:function(){return l},_Z:function(){return t},pd:function(){return u}});var r=e(36964);const t=(0,r.createRouteRef)({id:"techdocs:index-page"}),l=(0,r.createRouteRef)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),u=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(ee,s,e){"use strict";e.d(s,{S:function(){return k}});var r=e(2784),t=e(79692),l=e(49378),u=e(38402),A=e(86136),m=e(85256),o=e(82339),c=e(36964),f=e(74450);const y=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),p=te=>{const{result:fe,highlight:Se,rank:$e,lineClamp:ye=5,asListItem:We=!0,asLink:tt=!0,title:nt,icon:st}=te,Ct=y(),At=(0,c.useAnalytics)(),Pe=()=>{At.captureEvent("discover",fe.title,{attributes:{to:fe.location},value:$e})},vt=()=>{const me=Se!=null&&Se.fields.title?r.createElement(f.FA,{text:Se.fields.title,preTag:Se.preTag,postTag:Se.postTag}):fe.title,Ne=Se!=null&&Se.fields.entityTitle?r.createElement(f.FA,{text:Se.fields.entityTitle,preTag:Se.preTag,postTag:Se.postTag}):fe.entityTitle,Be=Se!=null&&Se.fields.name?r.createElement(f.FA,{text:Se.fields.name,preTag:Se.preTag,postTag:Se.postTag}):fe.name;return r.createElement(l.Z,{className:Ct.itemText,primaryTypographyProps:{variant:"h6"},primary:nt||r.createElement(r.Fragment,null,me," | ",Ne!=null?Ne:Be," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:ye,overflow:"hidden"}},Se!=null&&Se.fields.text?r.createElement(f.FA,{text:Se.fields.text,preTag:Se.preTag,postTag:Se.postTag}):fe.text)})},je=({children:me})=>tt?r.createElement(o.Link,{noTrack:!0,to:fe.location,onClick:Pe},me):r.createElement(r.Fragment,null,me),le=({children:me})=>We?r.createElement(r.Fragment,null,r.createElement(u.Z,{alignItems:"flex-start"},st&&r.createElement(A.Z,null,st),r.createElement("div",{className:Ct.flexContainer},me)),r.createElement(m.Z,{component:"li"})):r.createElement(r.Fragment,null,me);return r.createElement(je,null,r.createElement(le,null,r.createElement(vt,null)))};var E=e(86619),C=e(50581),L=e(61837),B=e(4614),z=e(21853),M=e(88013),b=e(10289),O=e(48760);const D=(0,t.Z)({root:{width:"100%"}}),U=te=>{const{entityId:fe,entityTitle:Se,debounceTime:$e=150}=te,[ye,We]=(0,r.useState)(!1),tt=(0,b.s0)(),{term:nt,setTerm:st,setFilters:Ct,result:{loading:At,value:Pe}}=(0,f.Rx)(),vt=D(),[je,le]=(0,r.useState)([]);(0,r.useEffect)(()=>{let se=!0;if(se&&Pe){const he=Pe.results.slice(0,10);le(he)}return()=>{se=!1}},[At,Pe]);const[me,Ne]=(0,r.useState)(nt);(0,O.Z)(()=>st(me),$e,[me]);const{kind:Be,name:Xe,namespace:pt}=fe;(0,r.useEffect)(()=>{Ct(se=>({...se,kind:Be,namespace:pt,name:Xe}))},[Be,pt,Xe,Ct]);const Ge=se=>{ye||We(!0),Ne(se.target.value)},Rt=(se,he)=>{if(he!=null&&he.document){const{location:rt}=he.document;tt(rt)}};return r.createElement(M.ZP,{classes:{root:vt.root},"data-testid":"techdocs-search-bar",size:"small",open:ye,getOptionLabel:()=>"",filterOptions:se=>se,onClose:()=>{We(!1)},onFocus:()=>{We(!0)},onChange:Rt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:je,renderOption:({document:se,highlight:he})=>r.createElement(p,{result:se,lineClamp:3,asListItem:!1,asLink:!1,title:se.title,highlight:he}),loading:At,renderInput:se=>r.createElement(E.Z,{...se,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${Se||fe.name} docs`,value:me,onChange:Ge,InputProps:{...se.InputProps,startAdornment:r.createElement(C.Z,{position:"start"},r.createElement(L.Z,{"aria-label":"Query",disabled:!0},r.createElement(z.Z,null))),endAdornment:r.createElement(r.Fragment,null,At?r.createElement(B.Z,{color:"inherit",size:20}):null,se.InputProps.endAdornment)}})})},k=te=>{const fe={term:"",types:["techdocs"],pageCursor:"",filters:te.entityId};return r.createElement(f.Nd,{initialState:fe},r.createElement(U,{...te}))}},98157:function(){},53260:function(){}},function(ee){var s=function(r){return ee(ee.s=r)};ee.O(0,[2370,6202,9284,2126,7012,9035,4983,3222,6816,5218,4736],function(){return s(88649),s(90775)});var e=ee.O()}]);})();
|
|
486
486
|
|
|
487
|
-
//# sourceMappingURL=main.
|
|
487
|
+
//# sourceMappingURL=main.a8e4c7a4.js.map
|