@techdocs/cli 0.0.0-nightly-20220531024457 → 0.0.0-nightly-20220601025619
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 +14 -4
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.3ee52840.js → main.4753763b.js} +1 -1
- package/dist/embedded-app/static/{main.3ee52840.js.map → main.4753763b.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.3ee52840.js → runtime.4753763b.js} +1 -1
- package/dist/embedded-app/static/{runtime.3ee52840.js.map → runtime.4753763b.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.3ee52840.js → vendor.4753763b.js} +30 -30
- package/dist/embedded-app/static/vendor.4753763b.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +5 -5
- package/dist/embedded-app/static/vendor.3ee52840.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20220601025619
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- bff65e6958: Updated sidebar-related logic to use `<SidebarPinStateProvider>` + `useSidebarPinState()` and/or `<SidebarOpenStateProvider>` + `useSidebarOpenState()` from `@backstage/core-components`.
|
|
8
8
|
- Updated dependencies
|
|
9
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
10
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
11
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
9
|
+
- @backstage/backend-common@0.0.0-nightly-20220601025619
|
|
10
|
+
- @backstage/catalog-model@0.0.0-nightly-20220601025619
|
|
11
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20220601025619
|
|
12
|
+
|
|
13
|
+
## 1.1.2-next.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- bff65e6958: Updated sidebar-related logic to use `<SidebarPinStateProvider>` + `useSidebarPinState()` and/or `<SidebarOpenStateProvider>` + `useSidebarOpenState()` from `@backstage/core-components`.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/backend-common@0.13.6-next.1
|
|
20
|
+
- @backstage/catalog-model@1.0.3-next.0
|
|
21
|
+
- @backstage/plugin-techdocs-node@1.1.2-next.1
|
|
12
22
|
|
|
13
23
|
## 1.1.2-next.0
|
|
14
24
|
|
|
@@ -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.4753763b.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.9873d8f6.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-react-beautiful-dnd.6085a9b0.js"></script><script defer="defer" src="/static/vendor.4753763b.js"></script><script defer="defer" src="/static/main.4753763b.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 @@ ${ge.href}
|
|
|
484
484
|
|
|
485
485
|
Feedback:`),Mt=(Se==null?void 0:Se.type)==="github"?(0,de.Pb)(Ae.href,"blob"):Ae.href,Rt=De()(Mt),Tt=`/${Rt.organization}/${Rt.name}`,at=ge.cloneNode();switch(Se==null?void 0:Se.type){case"gitlab":at.href=`${Ae.origin}${Tt}/issues/new?issue[title]=${et}&issue[description]=${Nt}`;break;case"github":at.href=`${Ae.origin}${Tt}/issues/new?title=${et}&body=${Nt}`;break;default:return te}return Oe.render(r.createElement(ye.Z),at),at.style.paddingLeft="5px",at.title="Leave feedback for this page",at.id="git-feedback-link",ge==null||ge.insertAdjacentElement("beforebegin",at),te};var pt=e(44882);const Zt=()=>D=>{const te=D.querySelector('.md-header label[for="__drawer"]'),ge=D.querySelector("article");if(!te||!ge)return D;const Ae=te.cloneNode();return Oe.render(r.createElement(pt.Z),Ae),Ae.id="toggle-sidebar",Ae.title="Toggle Sidebar",Ae.classList.add("md-content__button"),Ae.style.setProperty("padding","0 0 0 5px"),Ae.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),ge==null||ge.prepend(Ae),D},Dt=()=>D=>(((ge,Ae)=>{Array.from(ge).filter(Se=>Se.hasAttribute(Ae)).forEach(Se=>{const Ge=Se.getAttribute(Ae);if(Ge){Ge.match(/^https?:\/\//i)&&Se.setAttribute("target","_blank");try{const et=ft(window.location.href);Se.setAttribute(Ae,new URL(Ge,et).toString())}catch{Se.replaceWith(Se.textContent||Ge)}}})})(Array.from(D.getElementsByTagName("a")),"href"),D);function ft(D){const te=new URL(D);return!te.pathname.endsWith("/")&&!te.pathname.endsWith(".html")&&(te.pathname+="/"),te.toString()}const Ft=({baseUrl:D,onClick:te})=>ge=>(Array.from(ge.getElementsByTagName("a")).forEach(Ae=>{Ae.addEventListener("click",Se=>{const et=Ae.getAttribute("href");!et||et.startsWith(D)&&!Ae.hasAttribute("download")&&(Se.preventDefault(),te(Se,et))})}),ge);var zt=e(15459),Jt=e(80030),yn=e(72379),En=e(41547);const Ct=(0,zt.Z)(D=>({tooltip:{fontSize:"inherit",color:D.palette.text.primary,margin:0,padding:D.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Jt.ZP),nt=()=>r.createElement(yn.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"})),Vt=({text:D})=>{const[te,ge]=(0,r.useState)(!1),Ae=(0,r.useCallback)(()=>{navigator.clipboard.writeText(D),ge(!0)},[D]),Se=(0,r.useCallback)(()=>{ge(!1)},[ge]);return r.createElement(Ct,{title:"Copied to clipboard",placement:"left",open:te,onClose:Se,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:Ae},r.createElement(nt,null)))},ne=D=>te=>{var Ae;const ge=te.querySelectorAll("pre > code");for(const Se of ge){const Ge=Se.textContent||"",et=document.createElement("div");(Ae=Se==null?void 0:Se.parentElement)==null||Ae.prepend(et),Oe.render(r.createElement(En.Z,{theme:D},r.createElement(Vt,{text:Ge})),et)}return te},V=()=>D=>{var te;return(te=D.querySelector(".md-header"))==null||te.remove(),D},ce=()=>D=>{var te,ge;return(te=D.querySelector(".md-footer .md-copyright"))==null||te.remove(),(ge=D.querySelector(".md-footer-copyright"))==null||ge.remove(),D},Ue=({onLoading:D,onLoaded:te})=>ge=>(D(),ge.addEventListener(f.Ox,function Ae(){te(),ge.removeEventListener(f.Ox,Ae)}),ge),ke=()=>D=>(setTimeout(()=>{var te;if(window.location.hash){const ge=window.location.hash.slice(1);(te=D==null?void 0:D.querySelector(`[id="${ge}"]`))==null||te.scrollIntoView()}},200),D),qe=async(D,te)=>{let ge;if(typeof D=="string")ge=new DOMParser().parseFromString(D,"text/html").documentElement;else if(D instanceof Element)ge=D;else throw new Error("dom is not a recognized type");for(const Ae of te)ge=await Ae(ge);return ge},mt="screen and (max-width: 76.1875em)",Bt=D=>{const te=(0,J.s0)(),ge=(0,me.Z)(),Ae=(0,Be.Z)(mt),Se=Me(),Ge=ae(),et=(0,T.useApi)(f.Dl),Nt=(0,T.useApi)(Le.q3),{state:Mt,path:Rt,content:Tt}=(0,F.DK)(),[at,Wt]=(0,r.useState)(null),Qt=(0,f.ux)(at),wt=(0,r.useCallback)(()=>{if(!at)return;at.querySelectorAll(".md-sidebar").forEach(Lt=>{var un,hn;if(Ae)Lt.style.top="0px";else{const qt=(un=at.getBoundingClientRect().top)!=null?un:0,sn=at.querySelector(".md-container > .md-tabs"),Hn=(hn=sn==null?void 0:sn.getBoundingClientRect().height)!=null?hn:0;Lt.style.top=`${Math.max(qt,0)+Hn}px`}Lt.style.setProperty("opacity","1")})},[at,Ae]);(0,r.useEffect)(()=>(window.addEventListener("resize",wt),window.addEventListener("scroll",wt,!0),()=>{window.removeEventListener("resize",wt),window.removeEventListener("scroll",wt,!0)}),[at,wt]);const $t=(0,r.useCallback)(()=>{if(!at)return;const bt=at.querySelector(".md-footer");bt&&(bt.style.width=`${at.getBoundingClientRect().width}px`)},[at]);(0,r.useEffect)(()=>(window.addEventListener("resize",$t),()=>{window.removeEventListener("resize",$t)}),[at,$t]),(0,r.useEffect)(()=>{Qt||($t(),wt())},[Mt,Qt,$t,wt]);const tn=(0,r.useCallback)((bt,Lt)=>qe(bt,[Se,oe({techdocsStorageApi:et,entityId:D,path:Lt}),Dt(),Zt(),V(),ce(),tt(Nt),Ge]),[D,Nt,et,Se,Ge]),Cn=(0,r.useCallback)(async bt=>qe(bt,[ke(),ne(ge),Ft({baseUrl:window.location.origin,onClick:(Lt,un)=>{var sn;const hn=Lt.ctrlKey||Lt.metaKey,qt=new URL(un);qt.hash?hn?window.open(`${qt.pathname}${qt.hash}`,"_blank"):(te(`${qt.pathname}${qt.hash}`),(sn=bt==null?void 0:bt.querySelector(`#${qt.hash.slice(1)}`))==null||sn.scrollIntoView()):hn?window.open(qt.pathname,"_blank"):te(qt.pathname)}}),Ue({onLoading:()=>{},onLoaded:()=>{var Lt;(Lt=bt.querySelector(".md-nav__title"))==null||Lt.removeAttribute("for")}}),Ue({onLoading:()=>{Array.from(bt.querySelectorAll(".md-sidebar")).forEach(un=>{un.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[ge,te]);return(0,r.useEffect)(()=>{if(!Tt)return()=>{};let bt=!0;return tn(Tt,Rt).then(async Lt=>{if(!(Lt!=null&&Lt.innerHTML)||!bt)return;window.scroll({top:0});const un=await Cn(Lt);Wt(un)}),()=>{bt=!1}},[Tt,Rt,tn,Cn]),at};var Gt=e(8560);const nn=()=>{const D=(0,f.$L)(),{shadowRoot:te}=(0,f.x1)(),ge=te==null?void 0:te.querySelector('[data-md-component="content"]'),Ae=te==null?void 0:te.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Se=Ae==null?void 0:Ae.querySelector('[data-techdocs-addons-location="primary sidebar"]');Se||(Se=document.createElement("div"),Se.setAttribute("data-techdocs-addons-location","primary sidebar"),Ae==null||Ae.prepend(Se));const Ge=te==null?void 0:te.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let et=Ge==null?void 0:Ge.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return et||(et=document.createElement("div"),et.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ge==null||Ge.prepend(et)),r.createElement(r.Fragment,null,r.createElement(Gt.Z,{container:Se},D.renderComponentsByLocation(f.oZ.PrimarySidebar)),r.createElement(Gt.Z,{container:ge},D.renderComponentsByLocation(f.oZ.Content)),r.createElement(Gt.Z,{container:et},D.renderComponentsByLocation(f.oZ.SecondarySidebar)))},rn=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),At=(0,F.m1)(D=>{const{withSearch:te=!0,onReady:ge}=D,Ae=rn(),{entityMetadata:{value:Se,loading:Ge},entityRef:et,setShadowRoot:Nt}=(0,f.x1)(),Mt=Bt(et),Rt=(0,r.useCallback)(Tt=>{Nt(Tt),ge instanceof Function&&ge()},[Nt,ge]);return Ge===!1&&!Se?r.createElement(A.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):Mt?r.createElement(A.Content,null,r.createElement(c.Z,{container:!0},r.createElement(c.Z,{xs:12,item:!0},r.createElement(G,null)),te&&r.createElement(c.Z,{className:Ae.search,xs:"auto",item:!0},r.createElement(m.S,{entityId:et})),r.createElement(c.Z,{xs:12,item:!0},r.createElement(f.VA,{element:Mt,onAppend:Rt},r.createElement(nn,null))))):r.createElement(A.Content,null,r.createElement(c.Z,{container:!0},r.createElement(c.Z,{xs:12,item:!0},r.createElement(G,null))))}),Kt=null},99954:function(_,s,e){"use strict";e.d(s,{S:function(){return v}});var r=e(2784),t=e(18671),c=e(98069),f=e(73250),A=e(26136),m=e(53479),a=e(48023),i=e(82339),d=e(36964),y=e(68725);const p=r.createElement(c.Z,{animation:"wave",variant:"text",height:40}),v=b=>{const{children:L}=b,w=(0,A.$L)(),z=(0,d.useApi)(d.configApiRef),{title:x,setTitle:T,subtitle:I,setSubtitle:F,entityRef:M,metadata:{value:G,loading:J},entityMetadata:{value:me,loading:Be}}=(0,A.x1)();(0,r.useEffect)(()=>{!G||(T(He=>{const{site_name:re}=G;return He||re}),F(He=>{let{site_description:re}=G;return(!re||re==="None")&&(re="Home"),He||re}))},[G,T,F]);const Le=z.getOptional("app.title")||"Backstage",le=[I,x,Le].filter(Boolean).join(" | "),{locationMetadata:Ne,spec:ze}=me||{},Ye=ze==null?void 0:ze.lifecycle,_e=me?(0,m.getEntityRelations)(me,a.S4):[],it=(0,d.useRouteRef)(y._Z)(),lt=r.createElement(r.Fragment,null,r.createElement(i.HeaderLabel,{label:"Component",value:r.createElement(m.EntityRefLink,{color:"inherit",entityRef:M,defaultKind:"Component"})}),_e.length>0&&r.createElement(i.HeaderLabel,{label:"Owner",value:r.createElement(m.EntityRefLinks,{color:"inherit",entityRefs:_e,defaultKind:"group"})}),Ye?r.createElement(i.HeaderLabel,{label:"Lifecycle",value:Ye}):null,Ne&&Ne.type!=="dir"&&Ne.type!=="file"?r.createElement(i.HeaderLabel,{label:"",value:r.createElement("a",{href:Ne.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(f.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Be&&me===void 0||!J&&G===void 0?null:r.createElement(i.Header,{type:"Documentation",typeLink:it,title:x||p,subtitle:I||p},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,le)),lt,L,w.renderComponentsByLocation(A.oZ.Header))}},16172:function(_,s,e){"use strict";e.d(s,{b:function(){return p}});var r=e(2784),t=e(79692),c=e(15223),f=e(95544),A=e(80030),m=e(61837),a=e(48348),i=e(47603),d=e(26136);const y=(0,t.Z)(v=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:v.spacing(3,3,0)}})),p=({toolbarProps:v})=>{const b=y(),[L,w]=(0,r.useState)(null),z=(0,r.useCallback)(J=>{w(J.currentTarget)},[]),x=(0,r.useCallback)(()=>{w(null)},[]),{entityMetadata:{value:T,loading:I}}=(0,d.x1)(),F=(0,d.$L)(),M=F.renderComponentsByLocation(d.oZ.Subheader),G=F.renderComponentsByLocation(d.oZ.Settings);return!M&&!G||I===!1&&!T?null:r.createElement(c.Z,{classes:b,...v},r.createElement(f.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},M,G?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(i.Z,null))),r.createElement(a.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:L,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(L),onClose:x,keepMounted:!0},G)):null))}},2263:function(_,s,e){"use strict";e.d(s,{DK:function(){return p},m1:function(){return b}});var r=e(2784),t=e(10289),c=e(26136),f=e(36964),A=e(64279),m=e(77446);function a({contentLoading:L,content:w,activeSyncState:z}){return L||z==="BUILD_READY_RELOAD"||!w&&z==="CHECKING"?"CHECKING":!w&&z==="BUILDING"?"INITIAL_BUILD":w?z==="BUILDING"?"CONTENT_STALE_REFRESHING":z==="BUILD_READY"?"CONTENT_STALE_READY":z==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function i(L,w){const z={...L};switch(w.type){case"sync":w.state==="CHECKING"&&(z.buildLog=[]),z.activeSyncState=w.state,z.syncError=w.syncError;break;case"contentLoading":z.contentLoading=!0,z.contentError=void 0;break;case"content":typeof w.path=="string"&&(z.path=w.path),z.contentLoading=!1,z.content=w.content,z.contentError=w.contentError;break;case"buildLog":z.buildLog=z.buildLog.concat(w.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(z.activeSyncState)&&["contentLoading","content"].includes(w.type)&&(z.activeSyncState="UP_TO_DATE",z.buildLog=[]),z}function d(L,w,z,x){var me,Be;const[T,I]=(0,r.useReducer)(i,{activeSyncState:"CHECKING",path:x,contentLoading:!0,buildLog:[]}),F=(0,f.useApi)(c.Dl),{retry:M}=(0,m.Z)(async()=>{I({type:"contentLoading"});try{const Le=await F.getEntityDocs({kind:L,namespace:w,name:z},x);return I({type:"content",content:Le,path:x}),Le}catch(Le){I({type:"content",contentError:Le,path:x})}},[F,L,w,z,x]),G=(0,r.useRef)({content:void 0,reload:()=>{}});return G.current={content:T.content,reload:M},(0,A.default)(async()=>{I({type:"sync",state:"CHECKING"});const Le=setTimeout(()=>{I({type:"sync",state:"BUILDING"})},1e3);try{switch(await F.syncEntityDocs({kind:L,namespace:w,name:z},Ne=>{I({type:"buildLog",log:Ne})})){case"updated":G.current.content?I({type:"sync",state:"BUILD_READY"}):(G.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(le){I({type:"sync",state:"ERROR",syncError:le})}finally{clearTimeout(Le)}},[L,z,w,F,I,G]),{state:(0,r.useMemo)(()=>a({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:M,path:T.path,content:T.content,contentErrorMessage:(me=T.contentError)==null?void 0:me.toString(),syncErrorMessage:(Be=T.syncError)==null?void 0:Be.toString(),buildLog:T.buildLog}}const y=(0,r.createContext)({}),p=()=>(0,r.useContext)(y),v=({children:L})=>{const{"*":w=""}=(0,t.UO)(),{entityRef:z}=(0,c.x1)(),{kind:x,namespace:T,name:I}=z,F=d(x,T,I,w);return r.createElement(y.Provider,{value:F},L instanceof Function?L(F):L)},b=L=>w=>r.createElement(v,null,r.createElement(L,{...w}))},96393:function(_,s,e){"use strict";e.d(s,{Fq:function(){return f.F},SE:function(){return c.S}});var r=e(2263),t=e(26220),c=e(99954),f=e(63126),A=e(16172)},68725:function(_,s,e){"use strict";e.d(s,{Fw:function(){return c},_Z:function(){return t},pd:function(){return f}});var r=e(36964);const t=(0,r.createRouteRef)({id:"techdocs:index-page"}),c=(0,r.createRouteRef)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),f=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(_,s,e){"use strict";e.d(s,{S:function(){return F}});var r=e(2784),t=e(79692),c=e(49378),f=e(38402),A=e(85256),m=e(82339),a=e(73624);const i=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),d=M=>{const{result:G,highlight:J,lineClamp:me=5,asListItem:Be=!0,asLink:Le=!0,title:le}=M,Ne=i(),ze=()=>{const it=J!=null&&J.fields.title?r.createElement(a.FA,{text:J.fields.title,preTag:J.preTag,postTag:J.postTag}):G.title,lt=J!=null&&J.fields.entityTitle?r.createElement(a.FA,{text:J.fields.entityTitle,preTag:J.preTag,postTag:J.postTag}):G.entityTitle,Te=J!=null&&J.fields.name?r.createElement(a.FA,{text:J.fields.name,preTag:J.preTag,postTag:J.postTag}):G.name;return r.createElement(c.Z,{className:Ne.itemText,primaryTypographyProps:{variant:"h6"},primary:le||r.createElement(r.Fragment,null,it," | ",lt!=null?lt:Te," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:me,overflow:"hidden"}},J!=null&&J.fields.text?r.createElement(a.FA,{text:J.fields.text,preTag:J.preTag,postTag:J.postTag}):G.text)})},Ye=({children:it})=>Le?r.createElement(m.Link,{to:G.location},it):r.createElement(r.Fragment,null,it),_e=({children:it})=>Be?r.createElement(r.Fragment,null,r.createElement(f.Z,{alignItems:"flex-start",className:Ne.flexContainer},it),r.createElement(A.Z,{component:"li"})):r.createElement(r.Fragment,null,it);return r.createElement(Ye,null,r.createElement(_e,null,r.createElement(ze,null)))};var y=e(86619),p=e(50581),v=e(61837),b=e(4614),L=e(21853),w=e(88013),z=e(10289),x=e(48760);const T=(0,t.Z)({root:{width:"100%"}}),I=M=>{const{entityId:G,debounceTime:J=150}=M,[me,Be]=(0,r.useState)(!1),Le=(0,z.s0)(),{term:le,setTerm:Ne,setFilters:ze,result:{loading:Ye,value:_e}}=(0,a.Rx)(),it=T(),[lt,Te]=(0,r.useState)([]);(0,r.useEffect)(()=>{let Ve=!0;if(Ve&&_e){const Ze=_e.results.slice(0,10);Te(Ze)}return()=>{Ve=!1}},[Ye,_e]);const[st,He]=(0,r.useState)(le);(0,x.Z)(()=>Ne(st),J,[st]);const{kind:re,name:he,namespace:Me}=G;(0,r.useEffect)(()=>{ze(Ve=>({...Ve,kind:re,namespace:Me,name:he}))},[re,Me,he,ze]);const be=Ve=>{me||Be(!0),He(Ve.target.value)},Xe=(Ve,Ze)=>{if(Ze!=null&&Ze.document){const{location:ut}=Ze.document;Le(ut)}};return r.createElement(w.ZP,{classes:{root:it.root},"data-testid":"techdocs-search-bar",size:"small",open:me,getOptionLabel:()=>"",filterOptions:Ve=>Ve,onClose:()=>{Be(!1)},onFocus:()=>{Be(!0)},onChange:Xe,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:lt,renderOption:({document:Ve,highlight:Ze})=>r.createElement(d,{result:Ve,lineClamp:3,asListItem:!1,asLink:!1,title:Ve.title,highlight:Ze}),loading:Ye,renderInput:Ve=>r.createElement(y.Z,{...Ve,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${G.name} docs`,value:st,onChange:be,InputProps:{...Ve.InputProps,startAdornment:r.createElement(p.Z,{position:"start"},r.createElement(v.Z,{"aria-label":"Query",disabled:!0},r.createElement(L.Z,null))),endAdornment:r.createElement(r.Fragment,null,Ye?r.createElement(b.Z,{color:"inherit",size:20}):null,Ve.InputProps.endAdornment)}})})},F=M=>{const G={term:"",types:["techdocs"],pageCursor:"",filters:M.entityId};return r.createElement(a.Nd,{initialState:G},r.createElement(I,{...M}))}},98157:function(){},53260:function(){}},function(_){var s=function(r){return _(_.s=r)};_.O(0,[2370,6202,9284,2126,7012,9035,4983,3222,5218,4736],function(){return s(88649),s(46054)});var e=_.O()}]);})();
|
|
486
486
|
|
|
487
|
-
//# sourceMappingURL=main.
|
|
487
|
+
//# sourceMappingURL=main.4753763b.js.map
|