@techdocs/cli 0.0.0-nightly-20230224022922 → 0.0.0-nightly-20230226023329
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.a281b7b7.js → main.0fb15187.js} +1 -1
- package/dist/embedded-app/static/{main.a281b7b7.js.map → main.0fb15187.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.a281b7b7.js → runtime.0fb15187.js} +1 -1
- package/dist/embedded-app/static/{runtime.a281b7b7.js.map → runtime.0fb15187.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.a281b7b7.js → vendor.0fb15187.js} +3 -3
- package/dist/embedded-app/static/{vendor.a281b7b7.js.map → vendor.0fb15187.js.map} +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20230226023329
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies
|
|
12
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
13
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
14
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
12
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20230226023329
|
|
13
|
+
- @backstage/backend-common@0.0.0-nightly-20230226023329
|
|
14
|
+
- @backstage/catalog-model@0.0.0-nightly-20230226023329
|
|
15
15
|
- @backstage/cli-common@0.1.11
|
|
16
16
|
- @backstage/config@1.0.6
|
|
17
17
|
|
|
@@ -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.0fb15187.js"></script><script defer="defer" src="/static/module-material-ui.617f168b.js"></script><script defer="defer" src="/static/module-lodash.b0e3bf8c.js"></script><script defer="defer" src="/static/module-date-fns.eeb6d2d2.js"></script><script defer="defer" src="/static/module-yaml.2570b3eb.js"></script><script defer="defer" src="/static/module-ajv.be583887.js"></script><script defer="defer" src="/static/module-material-table.2aa637a9.js"></script><script defer="defer" src="/static/module-luxon.f096b58d.js"></script><script defer="defer" src="/static/module-octokit.10809b9e.js"></script><script defer="defer" src="/static/module-react-dom.d698fbed.js"></script><script defer="defer" src="/static/module-zod.cdb212b6.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.c3c3faee.js"></script><script defer="defer" src="/static/module-remix-run.4d35bb97.js"></script><script defer="defer" src="/static/vendor.0fb15187.js"></script><script defer="defer" src="/static/main.0fb15187.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -500,4 +500,4 @@ ${K.href}
|
|
|
500
500
|
|
|
501
501
|
Feedback:`),mt=(de==null?void 0:de.type)==="github"?(0,pn.BT)(ce.href,"blob"):ce.href,Et=ct()(mt),tt=`/${Et.organization}/${Et.name}`,Ze=K.cloneNode();switch(de==null?void 0:de.type){case"gitlab":Ze.href=`${ce.origin}${tt}/issues/new?issue[title]=${st}&issue[description]=${He}`;break;case"github":Ze.href=`${ce.origin}${tt}/issues/new?title=${st}&body=${He}`;break;default:return C}return Ln.render(r.createElement(Un.Z),Ze),Ze.style.paddingLeft="5px",Ze.title="Leave feedback for this page",Ze.id="git-feedback-link",K==null||K.insertAdjacentElement("beforebegin",Ze),C};var Cn=t(44882);const ln=()=>m=>{const C=m.querySelector('.md-header label[for="__drawer"]'),Z=m.querySelector("article");if(!C||!Z)return m;const K=C.cloneNode();return Ln.render(r.createElement(Cn.Z),K),K.id="toggle-sidebar",K.title="Toggle Sidebar",K.classList.add("md-content__button"),K.style.setProperty("padding","0 0 0 5px"),K.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),Z==null||Z.prepend(K),m},kn=()=>m=>(((Z,K)=>{Array.from(Z).filter(ce=>ce.hasAttribute(K)).forEach(ce=>{const de=ce.getAttribute(K);if(de){de.match(/^https?:\/\//i)&&ce.setAttribute("target","_blank");try{const Re=Mn(window.location.href);ce.setAttribute(K,new URL(de,Re).toString())}catch{ce.replaceWith(ce.textContent||de)}}})})(Array.from(m.getElementsByTagName("a")),"href"),m);function Mn(m){const C=new URL(m);return!C.pathname.endsWith("/")&&!C.pathname.endsWith(".html")&&(C.pathname+="/"),C.toString()}const wn=({baseUrl:m,onClick:C})=>Z=>(Array.from(Z.getElementsByTagName("a")).forEach(K=>{K.addEventListener("click",ce=>{const Re=K.getAttribute("href");Re&&Re.startsWith(m)&&!K.hasAttribute("download")&&(ce.preventDefault(),C(ce,Re))})}),Z);var Gn=t(15459),ve=t(80030),re=t(72379),Pe=t(41547);const Ie=(0,Gn.Z)(m=>({tooltip:{fontSize:"inherit",color:m.palette.text.primary,margin:0,padding:m.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(ve.ZP),Ve=()=>(0,h.jsx)(re.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"})}),ht=({text:m})=>{const[C,Z]=(0,r.useState)(!1),K=(0,r.useCallback)(()=>{window.navigator.clipboard.writeText(m),Z(!0)},[m]),ce=(0,r.useCallback)(()=>{Z(!1)},[Z]);return(0,h.jsx)(Ie,{title:"Copied to clipboard",placement:"left",open:C,onClose:ce,leaveDelay:1e3,children:(0,h.jsx)(Se.Z,{className:"md-clipboard md-icon",onClick:K,children:(0,h.jsx)(Ve,{})})})},Gt=m=>C=>{const Z=C.querySelectorAll("pre > code");for(const ce of Z){var K;const de=ce.textContent||"",Re=document.createElement("div");ce==null||(K=ce.parentElement)===null||K===void 0||K.prepend(Re),Ln.render((0,h.jsx)(Pe.Z,{theme:m,children:(0,h.jsx)(ht,{text:de})}),Re)}return C},kt=()=>m=>{var C;return(C=m.querySelector(".md-header"))===null||C===void 0||C.remove(),m},le=()=>m=>{var C,Z;return(C=m.querySelector(".md-footer .md-copyright"))===null||C===void 0||C.remove(),(Z=m.querySelector(".md-footer-copyright"))===null||Z===void 0||Z.remove(),m},W=({onLoading:m,onLoaded:C})=>Z=>(m(),Z.addEventListener(g.Ox,function K(){C(),Z.removeEventListener(g.Ox,K)}),Z),he=()=>m=>(m.addEventListener(g.Ox,function C(){if(window.location.hash){var Z;const K=window.location.hash.slice(1);(Z=m==null?void 0:m.querySelector(`[id="${K}"]`))===null||Z===void 0||Z.scrollIntoView()}m.removeEventListener(g.Ox,C)}),m),We=()=>m=>(setTimeout(()=>{const C=m==null?void 0:m.querySelectorAll("li.md-nav__item--active");C.length!==0&&(C.forEach(K=>{const ce=K==null?void 0:K.querySelector("input");ce!=null&&ce.checked||ce==null||ce.click()}),C[C.length-1].scrollIntoView())},200),m),ut=async(m,C)=>{let Z;if(typeof m=="string")Z=new DOMParser().parseFromString(m,"text/html").documentElement;else if(m instanceof Element)Z=m;else throw new Error("dom is not a recognized type");for(const K of C)Z=await K(Z);return Z},ze="screen and (max-width: 76.1875em)",It=m=>{const C=(0,_e.s0)(),Z=(0,Ye.Z)(),K=(0,dt.Z)(ze),ce=Le(),de=xn(),Re=(0,z.z$)(),st=(0,z.h_)(g.Dl),He=(0,z.h_)(Me.q3),{state:mt,path:Et,content:tt}=(0,R.DK)(),[Ze,pt]=(0,r.useState)(null),At=(0,g.ux)(Ze),Vt=(0,r.useCallback)(()=>{if(!Ze)return;Ze.querySelectorAll(".md-sidebar").forEach(nt=>{if(K)nt.style.top="0px";else{const an=document==null?void 0:document.querySelector(".techdocs-reader-page");var Qe;const zn=(Qe=an==null?void 0:an.getBoundingClientRect().top)!==null&&Qe!==void 0?Qe:0;var Kt;let Xn=(Kt=Ze.getBoundingClientRect().top)!==null&&Kt!==void 0?Kt:0;const gn=Ze.querySelector(".md-container > .md-tabs");var fn;const Kn=(fn=gn==null?void 0:gn.getBoundingClientRect().height)!==null&&fn!==void 0?fn:0;Xn<zn&&(Xn=zn),nt.style.top=`${Math.max(Xn,0)+Kn}px`}nt.style.setProperty("opacity","1")})},[Ze,K]);(0,r.useEffect)(()=>(window.addEventListener("resize",Vt),window.addEventListener("scroll",Vt,!0),()=>{window.removeEventListener("resize",Vt),window.removeEventListener("scroll",Vt,!0)}),[Ze,Vt]);const Dt=(0,r.useCallback)(()=>{if(!Ze)return;const Rt=Ze.querySelector(".md-footer");Rt&&(Rt.style.width=`${Ze.getBoundingClientRect().width}px`)},[Ze]);(0,r.useEffect)(()=>(window.addEventListener("resize",Dt),()=>{window.removeEventListener("resize",Dt)}),[Ze,Dt]),(0,r.useEffect)(()=>{At||(Dt(),Vt())},[mt,At,Dt,Vt]);const Mt=(0,r.useCallback)((Rt,nt)=>ut(Rt,[ce,Rn({techdocsStorageApi:st,entityId:m,path:nt}),kn(),ln(),kt(),le(),Pn(He),de]),[m,He,st,ce,de]),Ht=(0,r.useCallback)(async Rt=>ut(Rt,[he(),We(),Gt(Z),wn({baseUrl:window.location.origin,onClick:(nt,Qe)=>{var Kt;const fn=nt.ctrlKey||nt.metaKey,an=new URL(Qe),zn=`${an.pathname}${an.search}${an.hash}`,Xn=((Kt=nt.target)===null||Kt===void 0?void 0:Kt.innerText)||Qe,gn=Qe.replace(window.location.origin,"");if(Re.captureEvent("click",Xn,{attributes:{to:gn}}),an.hash)if(fn)window.open(zn,"_blank");else{var Kn;C(zn),(Kn=Rt==null?void 0:Rt.querySelector(`[id="${an.hash.slice(1)}"]`))===null||Kn===void 0||Kn.scrollIntoView()}else fn?window.open(zn,"_blank"):C(zn)}}),W({onLoading:()=>{},onLoaded:()=>{var nt;(nt=Rt.querySelector(".md-nav__title"))===null||nt===void 0||nt.removeAttribute("for")}}),W({onLoading:()=>{Array.from(Rt.querySelectorAll(".md-sidebar")).forEach(Qe=>{Qe.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[Z,C,Re]);return(0,r.useEffect)(()=>{if(!tt)return()=>{};let Rt=!0;return Mt(tt,Et).then(async nt=>{if(!(nt!=null&&nt.innerHTML)||!Rt)return;window.scroll({top:0});const Qe=await Ht(nt);pt(Qe)}),()=>{Rt=!1}},[tt,Et,Mt,Ht]),Ze};var Jt=t(8560);const rn=()=>{const m=(0,g.$L)(),{shadowRoot:C}=(0,g.x1)(),Z=C==null?void 0:C.querySelector('[data-md-component="content"]'),K=C==null?void 0:C.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let ce=K==null?void 0:K.querySelector('[data-techdocs-addons-location="primary sidebar"]');ce||(ce=document.createElement("div"),ce.setAttribute("data-techdocs-addons-location","primary sidebar"),K==null||K.prepend(ce));const de=C==null?void 0:C.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Re=de==null?void 0:de.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Re||(Re=document.createElement("div"),Re.setAttribute("data-techdocs-addons-location","secondary sidebar"),de==null||de.prepend(Re)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Jt.Z,{container:ce,children:m.renderComponentsByLocation(g.oZ.PrimarySidebar)}),(0,h.jsx)(Jt.Z,{container:Z,children:m.renderComponentsByLocation(g.oZ.Content)}),(0,h.jsx)(Jt.Z,{container:Re,children:m.renderComponentsByLocation(g.oZ.SecondarySidebar)})]})},on=(0,M.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),q=(0,R.m1)(m=>{var C;const{withSearch:Z=!0,onReady:K}=m,ce=on(),{entityMetadata:{value:de,loading:Re},entityRef:st,setShadowRoot:He}=(0,g.x1)(),mt=It(st),Et=(0,r.useCallback)(tt=>{He(tt),K instanceof Function&&K()},[He,K]);return Re===!1&&!de?(0,h.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):mt?(0,h.jsx)(y.VY,{children:(0,h.jsxs)(P.Z,{container:!0,children:[(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(Ae,{})}),Z&&(0,h.jsx)(P.Z,{className:ce.search,xs:"auto",item:!0,children:(0,h.jsx)(a.S,{entityId:st,entityTitle:de==null||(C=de.metadata)===null||C===void 0?void 0:C.title})}),(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(g.VA,{element:mt,onAppend:Et,children:(0,h.jsx)(rn,{})})})]})}):(0,h.jsx)(y.VY,{children:(0,h.jsx)(P.Z,{container:!0,children:(0,h.jsx)(P.Z,{xs:12,item:!0,children:(0,h.jsx)(Ae,{})})})})}),G=null},93225:function(bt,Oe,t){"use strict";t.d(Oe,{S:function(){return se}});var h=t(52322),r=t(2784),M=t(18671),P=t(60905),g=t(98069),y=t(73250),a=t(61886),$=t(40303),Se=t(25271),J=t(23196),H=t(60871),I=t(76635),T=t(95573);const X=(0,h.jsx)(g.Z,{animation:"wave",variant:"text",height:40}),se=ne=>{const{children:k}=ne,E=(0,a.$L)(),z=(0,H.h_)(H.Ds),{title:N,setTitle:R,subtitle:oe,setSubtitle:Ae,entityRef:_e,metadata:{value:Ye,loading:dt},entityMetadata:{value:Me,loading:at}}=(0,a.x1)();(0,r.useEffect)(()=>{Ye&&(R(Ye.site_name),Ae(()=>{let{site_description:ge}=Ye;return(!ge||ge==="None")&&(ge=""),ge}))},[Ye,R,Ae]);const ot=z.getOptional("app.title")||"Backstage",et=[N,oe,ot].filter(Boolean).join(" | "),{locationMetadata:Ge,spec:$e}=Me||{},St=$e==null?void 0:$e.lifecycle,gt=Me?(0,$.hF)(Me,Se.S4):[],Ct=(0,H.tg)(T._Z)(),Nt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(J.i9,{label:(0,I.capitalize)((Me==null?void 0:Me.kind)||"entity"),value:(0,h.jsx)($.dx,{color:"inherit",entityRef:_e,title:Me==null?void 0:Me.metadata.title,defaultKind:"Component"})}),gt.length>0&&(0,h.jsx)(J.i9,{label:"Owner",value:(0,h.jsx)($.rI,{color:"inherit",entityRefs:gt,defaultKind:"group"})}),St?(0,h.jsx)(J.i9,{label:"Lifecycle",value:St}):null,Ge&&Ge.type!=="dir"&&Ge.type!=="file"?(0,h.jsx)(J.i9,{label:"",value:(0,h.jsxs)(P.Z,{container:!0,direction:"column",alignItems:"center",style:{color:"#fff"},children:[(0,h.jsx)(P.Z,{style:{padding:0},item:!0,children:(0,h.jsx)(y.Z,{style:{marginTop:"-25px"}})}),(0,h.jsx)(P.Z,{style:{padding:0},item:!0,children:"Source"})]}),url:Ge.target}):null]});return!at&&Me===void 0||!dt&&Ye===void 0?null:(0,h.jsxs)(J.h4,{type:"Documentation",typeLink:Ct,title:N||X,subtitle:oe===""?void 0:oe||X,children:[(0,h.jsx)(M.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:et})}),Nt,k,E.renderComponentsByLocation(a.oZ.Header)]})}},65124:function(bt,Oe,t){"use strict";t.d(Oe,{b:function(){return I}});var h=t(52322),r=t(2784),M=t(79692),P=t(15223),g=t(95544),y=t(80030),a=t(61837),$=t(48348),Se=t(47603),J=t(61886);const H=(0,M.Z)(T=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:T.spacing(3,3,0)}})),I=T=>{const X=H(),[se,ne]=(0,r.useState)(null),k=(0,r.useCallback)(_e=>{ne(_e.currentTarget)},[]),E=(0,r.useCallback)(()=>{ne(null)},[]),{entityMetadata:{value:z,loading:N}}=(0,J.x1)(),R=(0,J.$L)(),oe=R.renderComponentsByLocation(J.oZ.Subheader),Ae=R.renderComponentsByLocation(J.oZ.Settings);return!oe&&!Ae||N===!1&&!z?null:(0,h.jsx)(P.Z,{classes:X,...T.toolbarProps,children:(0,h.jsxs)(g.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[oe,Ae?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.ZP,{title:"Settings",children:(0,h.jsx)(a.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:k,children:(0,h.jsx)(Se.Z,{})})}),(0,h.jsx)($.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:se,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(se),onClose:E,keepMounted:!0,children:Ae})]}):null]})})}},95481:function(bt,Oe,t){"use strict";t.d(Oe,{DK:function(){return I},m1:function(){return X}});var h=t(52322),r=t(2784),M=t(79635),P=t(61886),g=t(60871),y=t(64279),a=t(77446);function $({contentLoading:se,content:ne,activeSyncState:k}){return se||k==="BUILD_READY_RELOAD"||!ne&&k==="CHECKING"?"CHECKING":!ne&&k==="BUILDING"?"INITIAL_BUILD":ne?k==="BUILDING"?"CONTENT_STALE_REFRESHING":k==="BUILD_READY"?"CONTENT_STALE_READY":k==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function Se(se,ne){const k={...se};switch(ne.type){case"sync":ne.state==="CHECKING"&&(k.buildLog=[]),k.activeSyncState=ne.state,k.syncError=ne.syncError;break;case"contentLoading":k.contentLoading=!0,k.contentError=void 0;break;case"content":typeof ne.path=="string"&&(k.path=ne.path),k.contentLoading=!1,k.content=ne.content,k.contentError=ne.contentError;break;case"buildLog":k.buildLog=k.buildLog.concat(ne.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(k.activeSyncState)&&["contentLoading","content"].includes(ne.type)&&(k.activeSyncState="UP_TO_DATE",k.buildLog=[]),k}function J(se,ne,k,E){var z,N;const[R,oe]=(0,r.useReducer)(Se,{activeSyncState:"CHECKING",path:E,contentLoading:!0,buildLog:[]}),Ae=(0,g.h_)(P.Dl),{retry:_e}=(0,a.Z)(async()=>{oe({type:"contentLoading"});try{const Me=await Ae.getEntityDocs({kind:se,namespace:ne,name:k},E);return oe({type:"content",content:Me,path:E}),Me}catch(Me){oe({type:"content",contentError:Me,path:E})}},[Ae,se,ne,k,E]),Ye=(0,r.useRef)({content:void 0,reload:()=>{}});return Ye.current={content:R.content,reload:_e},(0,y.default)(async()=>{oe({type:"sync",state:"CHECKING"});const Me=setTimeout(()=>{oe({type:"sync",state:"BUILDING"})},1e3);try{switch(await Ae.syncEntityDocs({kind:se,namespace:ne,name:k},ot=>{oe({type:"buildLog",log:ot})})){case"updated":Ye.current.content?oe({type:"sync",state:"BUILD_READY"}):(Ye.current.reload(),oe({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":oe({type:"sync",state:"UP_TO_DATE"});break;default:oe({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(at){oe({type:"sync",state:"ERROR",syncError:at})}finally{clearTimeout(Me)}},[se,k,ne,Ae,oe,Ye]),{state:(0,r.useMemo)(()=>$({activeSyncState:R.activeSyncState,contentLoading:R.contentLoading,content:R.content}),[R.activeSyncState,R.content,R.contentLoading]),contentReload:_e,path:R.path,content:R.content,contentErrorMessage:(z=R.contentError)===null||z===void 0?void 0:z.toString(),syncErrorMessage:(N=R.syncError)===null||N===void 0?void 0:N.toString(),buildLog:R.buildLog}}const H=(0,r.createContext)({}),I=()=>(0,r.useContext)(H),T=({children:se})=>{const{"*":ne=""}=(0,M.UO)(),{entityRef:k}=(0,P.x1)(),{kind:E,namespace:z,name:N}=k,R=J(E,z,N,ne);return(0,h.jsx)(H.Provider,{value:R,children:se instanceof Function?se(R):se})},X=se=>ne=>(0,h.jsx)(T,{children:(0,h.jsx)(se,{...ne})})},95573:function(bt,Oe,t){"use strict";t.d(Oe,{Fw:function(){return M},_Z:function(){return r},pd:function(){return P}});var h=t(60871);const r=(0,h.NT)({id:"techdocs:index-page"}),M=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),P=(0,h.NT)({id:"techdocs:catalog-reader-view"})},55511:function(bt,Oe,t){"use strict";t.r(Oe),t.d(Oe,{TechDocsSearchResultListItem:function(){return J}});var h=t(52322),r=t(2784),M=t(79692),P=t(49378),g=t(86136),y=t(90436),a=t(23196),$=t(15096);const Se=(0,M.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),J=H=>{const{result:I,highlight:T,lineClamp:X=5,asListItem:se=!0,asLink:ne=!0,title:k,icon:E}=H,z=Se(),N=({children:Ae})=>ne?(0,h.jsx)(a.rU,{noTrack:!0,to:I.location,children:Ae}):(0,h.jsx)(h.Fragment,{children:Ae}),R=()=>{const Ae=T!=null&&T.fields.title?(0,h.jsx)($.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):I.title,_e=T!=null&&T.fields.entityTitle?(0,h.jsx)($.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):I.entityTitle,Ye=T!=null&&T.fields.name?(0,h.jsx)($.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):I.name;return I?(0,h.jsx)(P.Z,{className:z.itemText,primaryTypographyProps:{variant:"h6"},primary:(0,h.jsx)(N,{children:k||(0,h.jsxs)(h.Fragment,{children:[Ae," | ",_e!=null?_e:Ye," docs"]})}),secondary:(0,h.jsx)(y.Z,{component:"span",style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:X,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)($.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):I.text})}):null},oe=({children:Ae})=>se?(0,h.jsxs)(h.Fragment,{children:[E&&(0,h.jsx)(g.Z,{children:typeof E=="function"?E(I):E}),(0,h.jsx)("div",{className:z.flexContainer,children:Ae})]}):(0,h.jsx)(h.Fragment,{children:Ae});return(0,h.jsx)(oe,{children:(0,h.jsx)(R,{})})}},22478:function(bt,Oe,t){"use strict";t.d(Oe,{S:function(){return H}});var h=t(52322),r=t(15096),M=t(79692),P=t(27556),g=t(2784),y=t(79635),a=t(55511);const $=(0,M.Z)(I=>({root:{width:"100%"},bar:{padding:I.spacing(1)}})),Se=I=>I==null?void 0:I.document,J=I=>{const{entityId:T,entityTitle:X,debounceTime:se=150}=I,[ne,k]=(0,g.useState)(!1),E=(0,y.s0)(),{setFilters:z,result:{loading:N,value:R}}=(0,r.Rx)(),oe=$(),[Ae,_e]=(0,g.useState)([]);(0,g.useEffect)(()=>{let ot=!0;if(ot&&R){const et=R.results.slice(0,10);_e(et)}return()=>{ot=!1}},[N,R]);const{kind:Ye,name:dt,namespace:Me}=T;(0,g.useEffect)(()=>{z(ot=>({...ot,kind:Ye,namespace:Me,name:dt}))},[Ye,Me,dt,z]);const at=(ot,et)=>{if(Se(et)){const{location:Ge}=et.document;E(Ge)}};return(0,h.jsx)(P.Z,{className:oe.bar,variant:"outlined",children:(0,h.jsx)(r.qO,{classes:{root:oe.root},"data-testid":"techdocs-search-bar",size:"small",open:ne,getOptionLabel:()=>"",filterOptions:ot=>ot,onClose:()=>{k(!1)},onFocus:()=>{k(!0)},onChange:at,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:Ae,renderOption:({document:ot,highlight:et})=>(0,h.jsx)(a.TechDocsSearchResultListItem,{result:ot,lineClamp:3,asListItem:!1,asLink:!1,title:ot.title,highlight:et}),loading:N,inputDebounceTime:se,inputPlaceholder:`Search ${X||T.name} docs`,freeSolo:!1})})},H=I=>{const T={term:"",types:["techdocs"],pageCursor:"",filters:I.entityId};return(0,h.jsx)(r.Nd,{initialState:T,children:(0,h.jsx)(J,{...I})})}},53260:function(){}},function(bt){var Oe=function(h){return bt(bt.s=h)};bt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,5924,4736],function(){return Oe(6290)});var t=bt.O()}]);})();
|
|
502
502
|
|
|
503
|
-
//# sourceMappingURL=main.
|
|
503
|
+
//# sourceMappingURL=main.0fb15187.js.map
|