@techdocs/cli 0.0.0-nightly-20221016030406 → 0.0.0-nightly-20221017030331
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.c7280e49.js → main.5e3c320b.js} +1 -1
- package/dist/embedded-app/static/{main.c7280e49.js.map → main.5e3c320b.js.map} +1 -1
- package/dist/embedded-app/static/{runtime.c7280e49.js → runtime.5e3c320b.js} +1 -1
- package/dist/embedded-app/static/{runtime.c7280e49.js.map → runtime.5e3c320b.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.c7280e49.js → vendor.5e3c320b.js} +1 -1
- package/dist/embedded-app/static/{vendor.c7280e49.js.map → vendor.5e3c320b.js.map} +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20221017030331
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
option.
|
|
16
16
|
|
|
17
17
|
- Updated dependencies
|
|
18
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
19
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
20
|
-
- @backstage/plugin-techdocs-node@0.0.0-nightly-
|
|
18
|
+
- @backstage/catalog-model@0.0.0-nightly-20221017030331
|
|
19
|
+
- @backstage/backend-common@0.0.0-nightly-20221017030331
|
|
20
|
+
- @backstage/plugin-techdocs-node@0.0.0-nightly-20221017030331
|
|
21
21
|
- @backstage/cli-common@0.1.10
|
|
22
|
-
- @backstage/config@0.0.0-nightly-
|
|
22
|
+
- @backstage/config@0.0.0-nightly-20221017030331
|
|
23
23
|
|
|
24
24
|
## 1.2.2-next.2
|
|
25
25
|
|
|
@@ -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.5e3c320b.js"></script><script defer="defer" src="/static/module-material-ui.e3edf608.js"></script><script defer="defer" src="/static/module-lodash.0cada415.js"></script><script defer="defer" src="/static/module-date-fns.d70f4cc3.js"></script><script defer="defer" src="/static/module-yaml.b5c4d531.js"></script><script defer="defer" src="/static/module-ajv.fca02de5.js"></script><script defer="defer" src="/static/module-material-table.5d56e1cb.js"></script><script defer="defer" src="/static/module-luxon.f67513b2.js"></script><script defer="defer" src="/static/module-octokit.d25711cc.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/vendor.5e3c320b.js"></script><script defer="defer" src="/static/main.5e3c320b.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -489,4 +489,4 @@ ${de.href}
|
|
|
489
489
|
|
|
490
490
|
Feedback:`),vt=(Ie==null?void 0:Ie.type)==="github"?(0,on.Pb)(Ce.href,"blob"):Ce.href,st=Vt()(vt),pt=`/${st.organization}/${st.name}`,At=de.cloneNode();switch(Ie==null?void 0:Ie.type){case"gitlab":At.href=`${Ce.origin}${pt}/issues/new?issue[title]=${rt}&issue[description]=${xt}`;break;case"github":At.href=`${Ce.origin}${pt}/issues/new?title=${rt}&body=${xt}`;break;default:return W}return cn.render(n.createElement(En.Z),At),At.style.paddingLeft="5px",At.title="Leave feedback for this page",At.id="git-feedback-link",de==null||de.insertAdjacentElement("beforebegin",At),W};var An=t(44882);const Ut=()=>b=>{const W=b.querySelector('.md-header label[for="__drawer"]'),fe=b.querySelector("article");if(!W||!fe)return b;const de=W.cloneNode();return cn.render(n.createElement(An.Z),de),de.id="toggle-sidebar",de.title="Toggle Sidebar",de.classList.add("md-content__button"),de.style.setProperty("padding","0 0 0 5px"),de.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),fe==null||fe.prepend(de),b},dn=()=>b=>(((fe,de)=>{Array.from(fe).filter(Ce=>Ce.hasAttribute(de)).forEach(Ce=>{const Ie=Ce.getAttribute(de);if(Ie){Ie.match(/^https?:\/\//i)&&Ce.setAttribute("target","_blank");try{const Ne=un(window.location.href);Ce.setAttribute(de,new URL(Ie,Ne).toString())}catch{Ce.replaceWith(Ce.textContent||Ie)}}})})(Array.from(b.getElementsByTagName("a")),"href"),b);function un(b){const W=new URL(b);return!W.pathname.endsWith("/")&&!W.pathname.endsWith(".html")&&(W.pathname+="/"),W.toString()}const Sn=({baseUrl:b,onClick:W})=>fe=>(Array.from(fe.getElementsByTagName("a")).forEach(de=>{de.addEventListener("click",Ce=>{const Ne=de.getAttribute("href");!Ne||Ne.startsWith(b)&&!de.hasAttribute("download")&&(Ce.preventDefault(),W(Ce,Ne))})}),fe);var Tn=t(15459),pn=t(80030),ge=t(72379),ee=t(41547);const Ae=(0,Tn.Z)(b=>({tooltip:{fontSize:"inherit",color:b.palette.text.primary,margin:0,padding:b.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(pn.ZP),Ue=()=>(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:b})=>{const[W,fe]=(0,n.useState)(!1),de=(0,n.useCallback)(()=>{navigator.clipboard.writeText(b),fe(!0)},[b]),Ce=(0,n.useCallback)(()=>{fe(!1)},[fe]);return(0,h.jsx)(Ae,{title:"Copied to clipboard",placement:"left",open:W,onClose:Ce,leaveDelay:1e3,children:(0,h.jsx)("button",{className:"md-clipboard md-icon",onClick:de,children:(0,h.jsx)(Ue,{})})})},et=b=>W=>{const fe=W.querySelectorAll("pre > code");for(const Ce of fe){var de;const Ie=Ce.textContent||"",Ne=document.createElement("div");Ce==null||(de=Ce.parentElement)===null||de===void 0||de.prepend(Ne),cn.render((0,h.jsx)(ee.Z,{theme:b,children:(0,h.jsx)(_e,{text:Ie})}),Ne)}return W},Y=()=>b=>{var W;return(W=b.querySelector(".md-header"))===null||W===void 0||W.remove(),b},O=()=>b=>{var W,fe;return(W=b.querySelector(".md-footer .md-copyright"))===null||W===void 0||W.remove(),(fe=b.querySelector(".md-footer-copyright"))===null||fe===void 0||fe.remove(),b},ae=({onLoading:b,onLoaded:W})=>fe=>(b(),fe.addEventListener(V.Ox,function de(){W(),fe.removeEventListener(V.Ox,de)}),fe),We=()=>b=>(setTimeout(()=>{if(window.location.hash){var W;const fe=window.location.hash.slice(1);(W=b==null?void 0:b.querySelector(`[id="${fe}"]`))===null||W===void 0||W.scrollIntoView()}},200),b),U=()=>b=>(setTimeout(()=>{const W=b==null?void 0:b.querySelectorAll("li.md-nav__item--active");W.length!==0&&(W.forEach(de=>{const Ce=de==null?void 0:de.querySelector("input");Ce!=null&&Ce.checked||Ce==null||Ce.click()}),W[W.length-1].scrollIntoView())},200),b),Z=async(b,W)=>{let fe;if(typeof b=="string")fe=new DOMParser().parseFromString(b,"text/html").documentElement;else if(b instanceof Element)fe=b;else throw new Error("dom is not a recognized type");for(const de of W)fe=await de(fe);return fe},he="screen and (max-width: 76.1875em)",ye=b=>{const W=(0,Ke.s0)(),fe=(0,Ge.Z)(),de=(0,Ee.Z)(he),Ce=Te(),Ie=ln(),Ne=(0,$.h_)(V.Dl),rt=(0,$.h_)(Je.q3),{state:xt,path:vt,content:st}=(0,T.DK)(),[pt,At]=(0,n.useState)(null),Et=(0,V.ux)(pt),It=(0,n.useCallback)(()=>{if(!pt)return;pt.querySelectorAll(".md-sidebar").forEach(C=>{if(de)C.style.top="0px";else{const J=document==null?void 0:document.querySelector(".techdocs-reader-page");var u;const xe=(u=J==null?void 0:J.getBoundingClientRect().top)!==null&&u!==void 0?u:0;var x;let we=(x=pt.getBoundingClientRect().top)!==null&&x!==void 0?x:0;const $e=pt.querySelector(".md-container > .md-tabs");var j;const it=(j=$e==null?void 0:$e.getBoundingClientRect().height)!==null&&j!==void 0?j:0;we<xe&&(we=xe),C.style.top=`${Math.max(we,0)+it}px`}C.style.setProperty("opacity","1")})},[pt,de]);(0,n.useEffect)(()=>(window.addEventListener("resize",It),window.addEventListener("scroll",It,!0),()=>{window.removeEventListener("resize",It),window.removeEventListener("scroll",It,!0)}),[pt,It]);const Dt=(0,n.useCallback)(()=>{if(!pt)return;const Zt=pt.querySelector(".md-footer");Zt&&(Zt.style.width=`${pt.getBoundingClientRect().width}px`)},[pt]);(0,n.useEffect)(()=>(window.addEventListener("resize",Dt),()=>{window.removeEventListener("resize",Dt)}),[pt,Dt]),(0,n.useEffect)(()=>{Et||(Dt(),It())},[xt,Et,Dt,It]);const In=(0,n.useCallback)((Zt,C)=>Z(Zt,[Ce,jn({techdocsStorageApi:Ne,entityId:b,path:C}),dn(),Ut(),Y(),O(),bn(rt),Ie]),[b,rt,Ne,Ce,Ie]),Dn=(0,n.useCallback)(async Zt=>Z(Zt,[We(),U(),et(fe),Sn({baseUrl:window.location.origin,onClick:(C,u)=>{const x=C.ctrlKey||C.metaKey,j=new URL(u);if(j.hash)if(x)window.open(`${j.pathname}${j.hash}`,"_blank");else{var J;W(`${j.pathname}${j.hash}`),(J=Zt==null?void 0:Zt.querySelector(`[id="${j.hash.slice(1)}"]`))===null||J===void 0||J.scrollIntoView()}else x?window.open(j.pathname,"_blank"):W(j.pathname)}}),ae({onLoading:()=>{},onLoaded:()=>{var C;(C=Zt.querySelector(".md-nav__title"))===null||C===void 0||C.removeAttribute("for")}}),ae({onLoading:()=>{Array.from(Zt.querySelectorAll(".md-sidebar")).forEach(u=>{u.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[fe,W]);return(0,n.useEffect)(()=>{if(!st)return()=>{};let Zt=!0;return In(st,vt).then(async C=>{if(!(C!=null&&C.innerHTML)||!Zt)return;window.scroll({top:0});const u=await Dn(C);At(u)}),()=>{Zt=!1}},[st,vt,In,Dn]),pt};var be=t(8560);const De=()=>{const b=(0,V.$L)(),{shadowRoot:W}=(0,V.x1)(),fe=W==null?void 0:W.querySelector('[data-md-component="content"]'),de=W==null?void 0:W.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let Ce=de==null?void 0:de.querySelector('[data-techdocs-addons-location="primary sidebar"]');Ce||(Ce=document.createElement("div"),Ce.setAttribute("data-techdocs-addons-location","primary sidebar"),de==null||de.prepend(Ce));const Ie=W==null?void 0:W.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let Ne=Ie==null?void 0:Ie.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return Ne||(Ne=document.createElement("div"),Ne.setAttribute("data-techdocs-addons-location","secondary sidebar"),Ie==null||Ie.prepend(Ne)),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(be.Z,{container:Ce,children:b.renderComponentsByLocation(V.oZ.PrimarySidebar)}),(0,h.jsx)(be.Z,{container:fe,children:b.renderComponentsByLocation(V.oZ.Content)}),(0,h.jsx)(be.Z,{container:Ne,children:b.renderComponentsByLocation(V.oZ.SecondarySidebar)})]})},Oe=(0,m.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),He=(0,T.m1)(b=>{var W;const{withSearch:fe=!0,onReady:de}=b,Ce=Oe(),{entityMetadata:{value:Ie,loading:Ne},entityRef:rt,setShadowRoot:xt}=(0,V.x1)(),vt=ye(rt),st=(0,n.useCallback)(pt=>{xt(pt),de instanceof Function&&de()},[xt,de]);return Ne===!1&&!Ie?(0,h.jsx)(y.mf,{status:"404",statusMessage:"PAGE NOT FOUND"}):vt?(0,h.jsx)(y.VY,{children:(0,h.jsxs)(R.Z,{container:!0,children:[(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})}),fe&&(0,h.jsx)(R.Z,{className:Ce.search,xs:"auto",item:!0,children:(0,h.jsx)(l.S,{entityId:rt,entityTitle:Ie==null||(W=Ie.metadata)===null||W===void 0?void 0:W.title})}),(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(V.VA,{element:vt,onAppend:st,children:(0,h.jsx)(De,{})})})]})}):(0,h.jsx)(y.VY,{children:(0,h.jsx)(R.Z,{container:!0,children:(0,h.jsx)(R.Z,{xs:12,item:!0,children:(0,h.jsx)(Se,{})})})})}),qe=null},93225:function(jt,Me,t){"use strict";t.d(Me,{S:function(){return X}});var h=t(52322),n=t(2784),m=t(18671),R=t(98069),V=t(73250),y=t(61886),l=t(43297),P=t(25271),ne=t(71399),q=t(25248),_=t(95573);const F=(0,h.jsx)(R.Z,{animation:"wave",variant:"text",height:40}),X=Q=>{const{children:ue}=Q,le=(0,y.$L)(),L=(0,q.h_)(q.Ds),{title:I,setTitle:$,subtitle:E,setSubtitle:T,entityRef:te,metadata:{value:Se,loading:Ke},entityMetadata:{value:Ge,loading:Ee}}=(0,y.x1)();(0,n.useEffect)(()=>{!Se||($(Se.site_name),T(()=>{let{site_description:gt}=Se;return(!gt||gt==="None")&&(gt="Home"),gt}))},[Se,$,T]);const Je=L.getOptional("app.title")||"Backstage",ft=[I,E,Je].filter(Boolean).join(" | "),{locationMetadata:Ze,spec:ke}=Ge||{},nt=ke==null?void 0:ke.lifecycle,at=Ge?(0,l.hF)(Ge,P.S4):[],ut=(0,q.tg)(_._Z)(),lt=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne.i9,{label:"Component",value:(0,h.jsx)(l.dx,{color:"inherit",entityRef:te,title:Ge==null?void 0:Ge.metadata.title,defaultKind:"Component"})}),at.length>0&&(0,h.jsx)(ne.i9,{label:"Owner",value:(0,h.jsx)(l.rI,{color:"inherit",entityRefs:at,defaultKind:"group"})}),nt?(0,h.jsx)(ne.i9,{label:"Lifecycle",value:nt}):null,Ze&&Ze.type!=="dir"&&Ze.type!=="file"?(0,h.jsx)(ne.i9,{label:"",value:(0,h.jsx)("a",{href:Ze.target,target:"_blank",rel:"noopener noreferrer",children:(0,h.jsx)(V.Z,{style:{marginTop:"-25px",fill:"#fff"}})})}):null]});return!Ee&&Ge===void 0||!Ke&&Se===void 0?null:(0,h.jsxs)(ne.h4,{type:"Documentation",typeLink:ut,title:I||F,subtitle:E||F,children:[(0,h.jsx)(m.Z,{titleTemplate:"%s",children:(0,h.jsx)("title",{children:ft})}),lt,ue,le.renderComponentsByLocation(y.oZ.Header)]})}},65124:function(jt,Me,t){"use strict";t.d(Me,{b:function(){return F}});var h=t(52322),n=t(2784),m=t(79692),R=t(15223),V=t(95544),y=t(80030),l=t(61837),P=t(48348),ne=t(47603),q=t(61886);const _=(0,m.Z)(X=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:X.spacing(3,3,0)}})),F=X=>{const Q=_(),[ue,le]=(0,n.useState)(null),L=(0,n.useCallback)(Ke=>{le(Ke.currentTarget)},[]),I=(0,n.useCallback)(()=>{le(null)},[]),{entityMetadata:{value:$,loading:E}}=(0,q.x1)(),T=(0,q.$L)(),te=T.renderComponentsByLocation(q.oZ.Subheader),Se=T.renderComponentsByLocation(q.oZ.Settings);return!te&&!Se||E===!1&&!$?null:(0,h.jsx)(R.Z,{classes:Q,...X.toolbarProps,children:(0,h.jsxs)(V.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[te,Se?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(y.ZP,{title:"Settings",children:(0,h.jsx)(l.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:L,children:(0,h.jsx)(ne.Z,{})})}),(0,h.jsx)(P.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:ue,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(ue),onClose:I,keepMounted:!0,children:Se})]}):null]})})}},95481:function(jt,Me,t){"use strict";t.d(Me,{DK:function(){return F},m1:function(){return Q}});var h=t(52322),n=t(2784),m=t(10289),R=t(61886),V=t(25248),y=t(64279),l=t(77446);function P({contentLoading:ue,content:le,activeSyncState:L}){return ue||L==="BUILD_READY_RELOAD"||!le&&L==="CHECKING"?"CHECKING":!le&&L==="BUILDING"?"INITIAL_BUILD":le?L==="BUILDING"?"CONTENT_STALE_REFRESHING":L==="BUILD_READY"?"CONTENT_STALE_READY":L==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function ne(ue,le){const L={...ue};switch(le.type){case"sync":le.state==="CHECKING"&&(L.buildLog=[]),L.activeSyncState=le.state,L.syncError=le.syncError;break;case"contentLoading":L.contentLoading=!0,L.contentError=void 0;break;case"content":typeof le.path=="string"&&(L.path=le.path),L.contentLoading=!1,L.content=le.content,L.contentError=le.contentError;break;case"buildLog":L.buildLog=L.buildLog.concat(le.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes(L.activeSyncState)&&["contentLoading","content"].includes(le.type)&&(L.activeSyncState="UP_TO_DATE",L.buildLog=[]),L}function q(ue,le,L,I){var $,E;const[T,te]=(0,n.useReducer)(ne,{activeSyncState:"CHECKING",path:I,contentLoading:!0,buildLog:[]}),Se=(0,V.h_)(R.Dl),{retry:Ke}=(0,l.Z)(async()=>{te({type:"contentLoading"});try{const Je=await Se.getEntityDocs({kind:ue,namespace:le,name:L},I);return te({type:"content",content:Je,path:I}),Je}catch(Je){te({type:"content",contentError:Je,path:I})}},[Se,ue,le,L,I]),Ge=(0,n.useRef)({content:void 0,reload:()=>{}});return Ge.current={content:T.content,reload:Ke},(0,y.default)(async()=>{te({type:"sync",state:"CHECKING"});const Je=setTimeout(()=>{te({type:"sync",state:"BUILDING"})},1e3);try{switch(await Se.syncEntityDocs({kind:ue,namespace:le,name:L},Ze=>{te({type:"buildLog",log:Ze})})){case"updated":Ge.current.content?te({type:"sync",state:"BUILD_READY"}):(Ge.current.reload(),te({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":te({type:"sync",state:"UP_TO_DATE"});break;default:te({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(ft){te({type:"sync",state:"ERROR",syncError:ft})}finally{clearTimeout(Je)}},[ue,L,le,Se,te,Ge]),{state:(0,n.useMemo)(()=>P({activeSyncState:T.activeSyncState,contentLoading:T.contentLoading,content:T.content}),[T.activeSyncState,T.content,T.contentLoading]),contentReload:Ke,path:T.path,content:T.content,contentErrorMessage:($=T.contentError)===null||$===void 0?void 0:$.toString(),syncErrorMessage:(E=T.syncError)===null||E===void 0?void 0:E.toString(),buildLog:T.buildLog}}const _=(0,n.createContext)({}),F=()=>(0,n.useContext)(_),X=({children:ue})=>{const{"*":le=""}=(0,m.UO)(),{entityRef:L}=(0,R.x1)(),{kind:I,namespace:$,name:E}=L,T=q(I,$,E,le);return(0,h.jsx)(_.Provider,{value:T,children:ue instanceof Function?ue(T):ue})},Q=ue=>le=>(0,h.jsx)(X,{children:(0,h.jsx)(ue,{...le})})},95573:function(jt,Me,t){"use strict";t.d(Me,{Fw:function(){return m},_Z:function(){return n},pd:function(){return R}});var h=t(25248);const n=(0,h.NT)({id:"techdocs:index-page"}),m=(0,h.NT)({id:"techdocs:reader-page",params:["namespace","kind","name"]}),R=(0,h.NT)({id:"techdocs:catalog-reader-view"})},17339:function(jt,Me,t){"use strict";t.d(Me,{S:function(){return I}});var h=t(52322),n=t(2784),m=t(79692),R=t(49378),V=t(38402),y=t(86136),l=t(85256),P=t(71399),ne=t(25248),q=t(65826);const _=(0,m.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),F=$=>{const{result:E,highlight:T,rank:te,lineClamp:Se=5,asListItem:Ke=!0,asLink:Ge=!0,title:Ee,icon:Je}=$,ft=_(),Ze=(0,ne.z$)(),ke=()=>{Ze.captureEvent("discover",E.title,{attributes:{to:E.location},value:te})},nt=()=>{const lt=T!=null&&T.fields.title?(0,h.jsx)(q.FA,{text:T.fields.title,preTag:T.preTag,postTag:T.postTag}):E.title,ot=T!=null&&T.fields.entityTitle?(0,h.jsx)(q.FA,{text:T.fields.entityTitle,preTag:T.preTag,postTag:T.postTag}):E.entityTitle,dt=T!=null&&T.fields.name?(0,h.jsx)(q.FA,{text:T.fields.name,preTag:T.preTag,postTag:T.postTag}):E.name;return(0,h.jsx)(R.Z,{className:ft.itemText,primaryTypographyProps:{variant:"h6"},primary:Ee||(0,h.jsxs)(h.Fragment,{children:[lt," | ",ot!=null?ot:dt," docs"]}),secondary:(0,h.jsx)("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Se,overflow:"hidden"},children:T!=null&&T.fields.text?(0,h.jsx)(q.FA,{text:T.fields.text,preTag:T.preTag,postTag:T.postTag}):E.text})})},at=({children:lt})=>Ge?(0,h.jsx)(P.rU,{noTrack:!0,to:E.location,onClick:ke,children:lt}):(0,h.jsx)(h.Fragment,{children:lt}),ut=({children:lt})=>Ke?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(V.Z,{alignItems:"flex-start",children:[Je&&(0,h.jsx)(y.Z,{children:Je}),(0,h.jsx)("div",{className:ft.flexContainer,children:lt})]}),(0,h.jsx)(l.Z,{component:"li"})]}):(0,h.jsx)(h.Fragment,{children:lt});return(0,h.jsx)(at,{children:(0,h.jsx)(ut,{children:(0,h.jsx)(nt,{})})})};var X=t(27556),Q=t(10289);const ue=(0,m.Z)($=>({root:{width:"100%"},bar:{padding:$.spacing(1)}})),le=$=>$==null?void 0:$.document,L=$=>{const{entityId:E,entityTitle:T,debounceTime:te=150}=$,[Se,Ke]=(0,n.useState)(!1),Ge=(0,Q.s0)(),{setFilters:Ee,result:{loading:Je,value:ft}}=(0,q.Rx)(),Ze=ue(),[ke,nt]=(0,n.useState)([]);(0,n.useEffect)(()=>{let dt=!0;if(dt&&ft){const gt=ft.results.slice(0,10);nt(gt)}return()=>{dt=!1}},[Je,ft]);const{kind:at,name:ut,namespace:lt}=E;(0,n.useEffect)(()=>{Ee(dt=>({...dt,kind:at,namespace:lt,name:ut}))},[at,lt,ut,Ee]);const ot=(dt,gt)=>{if(le(gt)){const{location:Be}=gt.document;Ge(Be)}};return(0,h.jsx)(X.Z,{className:Ze.bar,variant:"outlined",children:(0,h.jsx)(q.qO,{classes:{root:Ze.root},"data-testid":"techdocs-search-bar",size:"small",open:Se,getOptionLabel:()=>"",filterOptions:dt=>dt,onClose:()=>{Ke(!1)},onFocus:()=>{Ke(!0)},onChange:ot,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:ke,renderOption:({document:dt,highlight:gt})=>(0,h.jsx)(F,{result:dt,lineClamp:3,asListItem:!1,asLink:!1,title:dt.title,highlight:gt}),loading:Je,inputDebounceTime:te,inputPlaceholder:`Search ${T||E.name} docs`,freeSolo:!1})})},I=$=>{const E={term:"",types:["techdocs"],pageCursor:"",filters:$.entityId};return(0,h.jsx)(q.Nd,{initialState:E,children:(0,h.jsx)(L,{...$})})}},53260:function(){}},function(jt){var Me=function(h){return jt(jt.s=h)};jt.O(0,[2370,6202,9284,9035,2126,7012,2194,1410,427,6816,5218,4736],function(){return Me(96215)});var t=jt.O()}]);})();
|
|
491
491
|
|
|
492
|
-
//# sourceMappingURL=main.
|
|
492
|
+
//# sourceMappingURL=main.5e3c320b.js.map
|