@techdocs/cli 1.2.0-next.2 → 1.2.0
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 +12 -0
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/static/{main.1f269f7a.js → main.b21eb9fe.js} +2 -2
- package/dist/embedded-app/static/main.b21eb9fe.js.map +1 -0
- package/dist/embedded-app/static/{runtime.1f269f7a.js → runtime.b21eb9fe.js} +1 -1
- package/dist/embedded-app/static/{runtime.1f269f7a.js.map → runtime.b21eb9fe.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.1f269f7a.js → vendor.b21eb9fe.js} +3 -3
- package/dist/embedded-app/static/vendor.b21eb9fe.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/package.json +6 -6
- package/dist/embedded-app/static/main.1f269f7a.js.map +0 -1
- package/dist/embedded-app/static/vendor.1f269f7a.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @techdocs/cli
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 855952db53: Added CLI option `--docker-option` to allow passing additional options to the `docker run` command executed my `serve` and `serve:mkdocs`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
- @backstage/backend-common@0.15.0
|
|
13
|
+
- @backstage/plugin-techdocs-node@1.3.0
|
|
14
|
+
|
|
3
15
|
## 1.2.0-next.2
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -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.b21eb9fe.js"></script><script defer="defer" src="/static/module-material-ui.cd8dff4a.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-yaml.cef9da5e.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-luxon.ee0def5d.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.206c7997.js"></script><script defer="defer" src="/static/module-react-beautiful-dnd.6085a9b0.js"></script><script defer="defer" src="/static/vendor.b21eb9fe.js"></script><script defer="defer" src="/static/main.b21eb9fe.js"></script></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
|
@@ -348,7 +348,7 @@ body {
|
|
|
348
348
|
font-size: var(--md-typeset-font-size);
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
${se.reduce((J,de)=>{var It;const Ce=(It=U.typography.htmlFontSize)!=null?It:16,xe=U.typography[de],{lineHeight:we,fontFamily:pt,fontWeight:Kt,fontSize:zt}=xe,Mt=it=>{let wt=1;return typeof it=="number"&&(wt=it/Ce),typeof it=="string"&&(wt=it.replace("rem","")),`calc(${wt} * var(--md-typeset-font-size))`};return J.concat(`
|
|
351
|
+
${se.reduce((J,de)=>{var It;const Ce=(It=U.typography.htmlFontSize)!=null?It:16,xe=U.typography[de],{lineHeight:we,fontFamily:pt,fontWeight:Kt,fontSize:zt}=xe,Mt=it=>{let wt=1;return typeof it=="number"&&(wt=it/Ce*.6),typeof it=="string"&&(wt=it.replace("rem","")),`calc(${wt} * var(--md-typeset-font-size))`};return J.concat(`
|
|
352
352
|
.md-typeset ${de} {
|
|
353
353
|
color: var(--md-default-fg-color);
|
|
354
354
|
line-height: ${we};
|
|
@@ -489,4 +489,4 @@ ${de.href}
|
|
|
489
489
|
|
|
490
490
|
Feedback:`),zt=(xe==null?void 0:xe.type)==="github"?(0,fe.Pb)(Ce.href,"blob"):Ce.href,Mt=Qe()(zt),It=`/${Mt.organization}/${Mt.name}`,it=de.cloneNode();switch(xe==null?void 0:xe.type){case"gitlab":it.href=`${Ce.origin}${It}/issues/new?issue[title]=${pt}&issue[description]=${Kt}`;break;case"github":it.href=`${Ce.origin}${It}/issues/new?title=${pt}&body=${Kt}`;break;default:return J}return Oe.render(r.createElement(Pe.Z),it),it.style.paddingLeft="5px",it.title="Leave feedback for this page",it.id="git-feedback-link",de==null||de.insertAdjacentElement("beforebegin",it),J};var gt=e(44882);const Rt=()=>U=>{const J=U.querySelector('.md-header label[for="__drawer"]'),de=U.querySelector("article");if(!J||!de)return U;const Ce=J.cloneNode();return Oe.render(r.createElement(gt.Z),Ce),Ce.id="toggle-sidebar",Ce.title="Toggle Sidebar",Ce.classList.add("md-content__button"),Ce.style.setProperty("padding","0 0 0 5px"),Ce.style.setProperty("margin","0.4rem 0 0.4rem 0.4rem"),de==null||de.prepend(Ce),U},ut=()=>U=>(((de,Ce)=>{Array.from(de).filter(xe=>xe.hasAttribute(Ce)).forEach(xe=>{const we=xe.getAttribute(Ce);if(we){we.match(/^https?:\/\//i)&&xe.setAttribute("target","_blank");try{const pt=Ft(window.location.href);xe.setAttribute(Ce,new URL(we,pt).toString())}catch{xe.replaceWith(xe.textContent||we)}}})})(Array.from(U.getElementsByTagName("a")),"href"),U);function Ft(U){const J=new URL(U);return!J.pathname.endsWith("/")&&!J.pathname.endsWith(".html")&&(J.pathname+="/"),J.toString()}const xt=({baseUrl:U,onClick:J})=>de=>(Array.from(de.getElementsByTagName("a")).forEach(Ce=>{Ce.addEventListener("click",xe=>{const pt=Ce.getAttribute("href");!pt||pt.startsWith(U)&&!Ce.hasAttribute("download")&&(xe.preventDefault(),J(xe,pt))})}),de);var bt=e(15459),Pt=e(80030),Vt=e(72379),Gt=e(41547);const dn=(0,bt.Z)(U=>({tooltip:{fontSize:"inherit",color:U.palette.text.primary,margin:0,padding:U.spacing(.5),backgroundColor:"transparent",boxShadow:"none"}}))(Pt.ZP),In=()=>r.createElement(Vt.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"})),Qt=({text:U})=>{const[J,de]=(0,r.useState)(!1),Ce=(0,r.useCallback)(()=>{navigator.clipboard.writeText(U),de(!0)},[U]),xe=(0,r.useCallback)(()=>{de(!1)},[de]);return r.createElement(dn,{title:"Copied to clipboard",placement:"left",open:J,onClose:xe,leaveDelay:1e3},r.createElement("button",{className:"md-clipboard md-icon",onClick:Ce},r.createElement(In,null)))},Zt=U=>J=>{var Ce;const de=J.querySelectorAll("pre > code");for(const xe of de){const we=xe.textContent||"",pt=document.createElement("div");(Ce=xe==null?void 0:xe.parentElement)==null||Ce.prepend(pt),Oe.render(r.createElement(Gt.Z,{theme:U},r.createElement(Qt,{text:we})),pt)}return J},Xe=()=>U=>{var J;return(J=U.querySelector(".md-header"))==null||J.remove(),U},ue=()=>U=>{var J,de;return(J=U.querySelector(".md-footer .md-copyright"))==null||J.remove(),(de=U.querySelector(".md-footer-copyright"))==null||de.remove(),U},j=({onLoading:U,onLoaded:J})=>de=>(U(),de.addEventListener(i.Ox,function Ce(){J(),de.removeEventListener(i.Ox,Ce)}),de),ye=()=>U=>(setTimeout(()=>{var J;if(window.location.hash){const de=window.location.hash.slice(1);(J=U==null?void 0:U.querySelector(`[id="${de}"]`))==null||J.scrollIntoView()}},200),U),Ke=()=>U=>(setTimeout(()=>{const J=U==null?void 0:U.querySelectorAll("li.md-nav__item--active");J.length!==0&&(J.forEach(Ce=>{const xe=Ce==null?void 0:Ce.querySelector("input");xe!=null&&xe.checked||xe==null||xe.click()}),J[J.length-1].scrollIntoView())},200),U),qe=async(U,J)=>{let de;if(typeof U=="string")de=new DOMParser().parseFromString(U,"text/html").documentElement;else if(U instanceof Element)de=U;else throw new Error("dom is not a recognized type");for(const Ce of J)de=await Ce(de);return de},st="screen and (max-width: 76.1875em)",St=U=>{const J=(0,re.s0)(),de=(0,le.Z)(),Ce=(0,Re.Z)(st),xe=pe(),we=z(),pt=(0,D.useApi)(i.Dl),Kt=(0,D.useApi)(Fe.q3),{state:zt,path:Mt,content:It}=(0,O.DK)(),[it,wt]=(0,r.useState)(null),sn=(0,i.ux)(it),Wt=(0,r.useCallback)(()=>{if(!it)return;it.querySelectorAll(".md-sidebar").forEach(Lt=>{var hn,Rn,ln;if(Ce)Lt.style.top="0px";else{const gn=document==null?void 0:document.querySelector(".techdocs-reader-page"),w=(hn=gn==null?void 0:gn.getBoundingClientRect().top)!=null?hn:0;let g=(Rn=it.getBoundingClientRect().top)!=null?Rn:0;const C=it.querySelector(".md-container > .md-tabs"),F=(ln=C==null?void 0:C.getBoundingClientRect().height)!=null?ln:0;g<w&&(g=w),Lt.style.top=`${Math.max(g,0)+F}px`}Lt.style.setProperty("opacity","1")})},[it,Ce]);(0,r.useEffect)(()=>(window.addEventListener("resize",Wt),window.addEventListener("scroll",Wt,!0),()=>{window.removeEventListener("resize",Wt),window.removeEventListener("scroll",Wt,!0)}),[it,Wt]);const nn=(0,r.useCallback)(()=>{if(!it)return;const Ht=it.querySelector(".md-footer");Ht&&(Ht.style.width=`${it.getBoundingClientRect().width}px`)},[it]);(0,r.useEffect)(()=>(window.addEventListener("resize",nn),()=>{window.removeEventListener("resize",nn)}),[it,nn]),(0,r.useEffect)(()=>{sn||(nn(),Wt())},[zt,sn,nn,Wt]);const Bn=(0,r.useCallback)((Ht,Lt)=>qe(Ht,[xe,ce({techdocsStorageApi:pt,entityId:U,path:Lt}),ut(),Rt(),Xe(),ue(),Ge(Kt),we]),[U,Kt,pt,xe,we]),Zn=(0,r.useCallback)(async Ht=>qe(Ht,[ye(),Ke(),Zt(de),xt({baseUrl:window.location.origin,onClick:(Lt,hn)=>{var gn;const Rn=Lt.ctrlKey||Lt.metaKey,ln=new URL(hn);ln.hash?Rn?window.open(`${ln.pathname}${ln.hash}`,"_blank"):(J(`${ln.pathname}${ln.hash}`),(gn=Ht==null?void 0:Ht.querySelector(`#${ln.hash.slice(1)}`))==null||gn.scrollIntoView()):Rn?window.open(ln.pathname,"_blank"):J(ln.pathname)}}),j({onLoading:()=>{},onLoaded:()=>{var Lt;(Lt=Ht.querySelector(".md-nav__title"))==null||Lt.removeAttribute("for")}}),j({onLoading:()=>{Array.from(Ht.querySelectorAll(".md-sidebar")).forEach(hn=>{hn.style.setProperty("opacity","0")})},onLoaded:()=>{}})]),[de,J]);return(0,r.useEffect)(()=>{if(!It)return()=>{};let Ht=!0;return Bn(It,Mt).then(async Lt=>{if(!(Lt!=null&&Lt.innerHTML)||!Ht)return;window.scroll({top:0});const hn=await Zn(Lt);wt(hn)}),()=>{Ht=!1}},[It,Mt,Bn,Zn]),it};var Yt=e(8560);const _t=()=>{const U=(0,i.$L)(),{shadowRoot:J}=(0,i.x1)(),de=J==null?void 0:J.querySelector('[data-md-component="content"]'),Ce=J==null?void 0:J.querySelector('div[data-md-component="sidebar"][data-md-type="navigation"], div[data-md-component="navigation"]');let xe=Ce==null?void 0:Ce.querySelector('[data-techdocs-addons-location="primary sidebar"]');xe||(xe=document.createElement("div"),xe.setAttribute("data-techdocs-addons-location","primary sidebar"),Ce==null||Ce.prepend(xe));const we=J==null?void 0:J.querySelector('div[data-md-component="sidebar"][data-md-type="toc"], div[data-md-component="toc"]');let pt=we==null?void 0:we.querySelector('[data-techdocs-addons-location="secondary sidebar"]');return pt||(pt=document.createElement("div"),pt.setAttribute("data-techdocs-addons-location","secondary sidebar"),we==null||we.prepend(pt)),r.createElement(r.Fragment,null,r.createElement(Yt.Z,{container:xe},U.renderComponentsByLocation(i.oZ.PrimarySidebar)),r.createElement(Yt.Z,{container:de},U.renderComponentsByLocation(i.oZ.Content)),r.createElement(Yt.Z,{container:pt},U.renderComponentsByLocation(i.oZ.SecondarySidebar)))},en=(0,t.Z)({search:{width:"100%","@media (min-width: 76.1875em)":{width:"calc(100% - 34.4rem)",margin:"0 auto"}}}),mn=(0,O.m1)(U=>{var It;const{withSearch:J=!0,onReady:de}=U,Ce=en(),{entityMetadata:{value:xe,loading:we},entityRef:pt,setShadowRoot:Kt}=(0,i.x1)(),zt=St(pt),Mt=(0,r.useCallback)(it=>{Kt(it),de instanceof Function&&de()},[Kt,de]);return we===!1&&!xe?r.createElement(R.ErrorPage,{status:"404",statusMessage:"PAGE NOT FOUND"}):zt?r.createElement(R.Content,null,r.createElement(c.Z,{container:!0},r.createElement(c.Z,{xs:12,item:!0},r.createElement(K,null)),J&&r.createElement(c.Z,{className:Ce.search,xs:"auto",item:!0},r.createElement(f.S,{entityId:pt,entityTitle:(It=xe==null?void 0:xe.metadata)==null?void 0:It.title})),r.createElement(c.Z,{xs:12,item:!0},r.createElement(i.VA,{element:zt,onAppend:Mt},r.createElement(_t,null))))):r.createElement(R.Content,null,r.createElement(c.Z,{container:!0},r.createElement(c.Z,{xs:12,item:!0},r.createElement(K,null))))}),Xt=null},99954:function(ne,s,e){"use strict";e.d(s,{S:function(){return E}});var r=e(2784),t=e(18671),c=e(98069),i=e(73250),R=e(56338),f=e(17429),o=e(48023),u=e(82339),m=e(36964),y=e(68725);const h=r.createElement(c.Z,{animation:"wave",variant:"text",height:40}),E=S=>{const{children:b}=S,L=(0,R.$L)(),$=(0,m.useApi)(m.configApiRef),{title:B,setTitle:D,subtitle:x,setSubtitle:O,entityRef:M,metadata:{value:K,loading:re},entityMetadata:{value:le,loading:Re}}=(0,R.x1)();(0,r.useEffect)(()=>{!K||(D(ht=>{const{site_name:lt}=K;return ht||lt}),O(ht=>{let{site_description:lt}=K;return(!lt||lt==="None")&&(lt="Home"),ht||lt}))},[K,D,O]);const Fe=$.getOptional("app.title")||"Backstage",Be=[B,x,Fe].filter(Boolean).join(" | "),{locationMetadata:He,spec:ve}=le||{},Je=ve==null?void 0:ve.lifecycle,tt=le?(0,f.getEntityRelations)(le,o.S4):[],Tt=(0,m.useRouteRef)(y._Z)(),At=r.createElement(r.Fragment,null,r.createElement(u.HeaderLabel,{label:"Component",value:r.createElement(f.EntityRefLink,{color:"inherit",entityRef:M,title:le==null?void 0:le.metadata.title,defaultKind:"Component"})}),tt.length>0&&r.createElement(u.HeaderLabel,{label:"Owner",value:r.createElement(f.EntityRefLinks,{color:"inherit",entityRefs:tt,defaultKind:"group"})}),Je?r.createElement(u.HeaderLabel,{label:"Lifecycle",value:Je}):null,He&&He.type!=="dir"&&He.type!=="file"?r.createElement(u.HeaderLabel,{label:"",value:r.createElement("a",{href:He.target,target:"_blank",rel:"noopener noreferrer"},r.createElement(i.Z,{style:{marginTop:"-25px",fill:"#fff"}}))}):null);return!Re&&le===void 0||!re&&K===void 0?null:r.createElement(u.Header,{type:"Documentation",typeLink:Tt,title:B||h,subtitle:x||h},r.createElement(t.Z,{titleTemplate:"%s"},r.createElement("title",null,Be)),At,b,L.renderComponentsByLocation(R.oZ.Header))}},16172:function(ne,s,e){"use strict";e.d(s,{b:function(){return h}});var r=e(2784),t=e(79692),c=e(15223),i=e(95544),R=e(80030),f=e(61837),o=e(48348),u=e(47603),m=e(56338);const y=(0,t.Z)(E=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:E.spacing(3,3,0)}})),h=({toolbarProps:E})=>{const S=y(),[b,L]=(0,r.useState)(null),$=(0,r.useCallback)(re=>{L(re.currentTarget)},[]),B=(0,r.useCallback)(()=>{L(null)},[]),{entityMetadata:{value:D,loading:x}}=(0,m.x1)(),O=(0,m.$L)(),M=O.renderComponentsByLocation(m.oZ.Subheader),K=O.renderComponentsByLocation(m.oZ.Settings);return!M&&!K||x===!1&&!D?null:r.createElement(c.Z,{classes:S,...E},r.createElement(i.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap"},M,K?r.createElement(r.Fragment,null,r.createElement(R.ZP,{title:"Settings"},r.createElement(f.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:$},r.createElement(u.Z,null))),r.createElement(o.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:b,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(b),onClose:B,keepMounted:!0},K)):null))}},2263:function(ne,s,e){"use strict";e.d(s,{DK:function(){return h},m1:function(){return S}});var r=e(2784),t=e(10289),c=e(56338),i=e(36964),R=e(64279),f=e(77446);function o({contentLoading:b,content:L,activeSyncState:$}){return b||$==="BUILD_READY_RELOAD"||!L&&$==="CHECKING"?"CHECKING":!L&&$==="BUILDING"?"INITIAL_BUILD":L?$==="BUILDING"?"CONTENT_STALE_REFRESHING":$==="BUILD_READY"?"CONTENT_STALE_READY":$==="ERROR"?"CONTENT_STALE_ERROR":"CONTENT_FRESH":"CONTENT_NOT_FOUND"}function u(b,L){const $={...b};switch(L.type){case"sync":L.state==="CHECKING"&&($.buildLog=[]),$.activeSyncState=L.state,$.syncError=L.syncError;break;case"contentLoading":$.contentLoading=!0,$.contentError=void 0;break;case"content":typeof L.path=="string"&&($.path=L.path),$.contentLoading=!1,$.content=L.content,$.contentError=L.contentError;break;case"buildLog":$.buildLog=$.buildLog.concat(L.log);break;default:throw new Error}return["BUILD_READY","BUILD_READY_RELOAD"].includes($.activeSyncState)&&["contentLoading","content"].includes(L.type)&&($.activeSyncState="UP_TO_DATE",$.buildLog=[]),$}function m(b,L,$,B){var le,Re;const[D,x]=(0,r.useReducer)(u,{activeSyncState:"CHECKING",path:B,contentLoading:!0,buildLog:[]}),O=(0,i.useApi)(c.Dl),{retry:M}=(0,f.Z)(async()=>{x({type:"contentLoading"});try{const Fe=await O.getEntityDocs({kind:b,namespace:L,name:$},B);return x({type:"content",content:Fe,path:B}),Fe}catch(Fe){x({type:"content",contentError:Fe,path:B})}},[O,b,L,$,B]),K=(0,r.useRef)({content:void 0,reload:()=>{}});return K.current={content:D.content,reload:M},(0,R.default)(async()=>{x({type:"sync",state:"CHECKING"});const Fe=setTimeout(()=>{x({type:"sync",state:"BUILDING"})},1e3);try{switch(await O.syncEntityDocs({kind:b,namespace:L,name:$},He=>{x({type:"buildLog",log:He})})){case"updated":K.current.content?x({type:"sync",state:"BUILD_READY"}):(K.current.reload(),x({type:"sync",state:"BUILD_READY_RELOAD"}));break;case"cached":x({type:"sync",state:"UP_TO_DATE"});break;default:x({type:"sync",state:"ERROR",syncError:new Error("Unexpected return state")});break}}catch(Be){x({type:"sync",state:"ERROR",syncError:Be})}finally{clearTimeout(Fe)}},[b,$,L,O,x,K]),{state:(0,r.useMemo)(()=>o({activeSyncState:D.activeSyncState,contentLoading:D.contentLoading,content:D.content}),[D.activeSyncState,D.content,D.contentLoading]),contentReload:M,path:D.path,content:D.content,contentErrorMessage:(le=D.contentError)==null?void 0:le.toString(),syncErrorMessage:(Re=D.syncError)==null?void 0:Re.toString(),buildLog:D.buildLog}}const y=(0,r.createContext)({}),h=()=>(0,r.useContext)(y),E=({children:b})=>{const{"*":L=""}=(0,t.UO)(),{entityRef:$}=(0,c.x1)(),{kind:B,namespace:D,name:x}=$,O=m(B,D,x,L);return r.createElement(y.Provider,{value:O},b instanceof Function?b(O):b)},S=b=>L=>r.createElement(E,null,r.createElement(b,{...L}))},96393:function(ne,s,e){"use strict";e.d(s,{Fq:function(){return i.F},SE:function(){return c.S}});var r=e(2263),t=e(26220),c=e(99954),i=e(16639),R=e(16172)},68725:function(ne,s,e){"use strict";e.d(s,{Fw:function(){return c},_Z:function(){return t},pd:function(){return i}});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"]}),i=(0,r.createRouteRef)({id:"techdocs:catalog-reader-view"})},47861:function(ne,s,e){"use strict";e.d(s,{S:function(){return K}});var r=e(2784),t=e(79692),c=e(49378),i=e(38402),R=e(86136),f=e(85256),o=e(82339),u=e(36964),m=e(74450);const y=(0,t.Z)({flexContainer:{flexWrap:"wrap"},itemText:{width:"100%",marginBottom:"1rem"}}),h=re=>{const{result:le,highlight:Re,rank:Fe,lineClamp:Be=5,asListItem:He=!0,asLink:ve=!0,title:Je,icon:tt}=re,Tt=y(),At=(0,u.useAnalytics)(),Ie=()=>{At.captureEvent("discover",le.title,{attributes:{to:le.location},value:Fe})},mt=()=>{const ee=Re!=null&&Re.fields.title?r.createElement(m.FA,{text:Re.fields.title,preTag:Re.preTag,postTag:Re.postTag}):le.title,pe=Re!=null&&Re.fields.entityTitle?r.createElement(m.FA,{text:Re.fields.entityTitle,preTag:Re.preTag,postTag:Re.postTag}):le.entityTitle,be=Re!=null&&Re.fields.name?r.createElement(m.FA,{text:Re.fields.name,preTag:Re.preTag,postTag:Re.postTag}):le.name;return r.createElement(c.Z,{className:Tt.itemText,primaryTypographyProps:{variant:"h6"},primary:Je||r.createElement(r.Fragment,null,ee," | ",pe!=null?pe:be," docs"),secondary:r.createElement("span",{style:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:Be,overflow:"hidden"}},Re!=null&&Re.fields.text?r.createElement(m.FA,{text:Re.fields.text,preTag:Re.preTag,postTag:Re.postTag}):le.text)})},ht=({children:ee})=>ve?r.createElement(o.Link,{noTrack:!0,to:le.location,onClick:Ie},ee):r.createElement(r.Fragment,null,ee),lt=({children:ee})=>He?r.createElement(r.Fragment,null,r.createElement(i.Z,{alignItems:"flex-start"},tt&&r.createElement(R.Z,null,tt),r.createElement("div",{className:Tt.flexContainer},ee)),r.createElement(f.Z,{component:"li"})):r.createElement(r.Fragment,null,ee);return r.createElement(ht,null,r.createElement(lt,null,r.createElement(mt,null)))};var E=e(86619),S=e(50581),b=e(61837),L=e(4614),$=e(21853),B=e(88013),D=e(10289),x=e(48760);const O=(0,t.Z)({root:{width:"100%"}}),M=re=>{const{entityId:le,entityTitle:Re,debounceTime:Fe=150}=re,[Be,He]=(0,r.useState)(!1),ve=(0,D.s0)(),{term:Je,setTerm:tt,setFilters:Tt,result:{loading:At,value:Ie}}=(0,m.Rx)(),mt=O(),[ht,lt]=(0,r.useState)([]);(0,r.useEffect)(()=>{let se=!0;if(se&&Ie){const ae=Ie.results.slice(0,10);lt(ae)}return()=>{se=!1}},[At,Ie]);const[ee,pe]=(0,r.useState)(Je);(0,x.Z)(()=>tt(ee),Fe,[ee]);const{kind:be,name:We,namespace:et}=le;(0,r.useEffect)(()=>{Tt(se=>({...se,kind:be,namespace:et,name:We}))},[be,et,We,Tt]);const at=se=>{Be||He(!0),pe(se.target.value)},yt=(se,ae)=>{if(ae!=null&&ae.document){const{location:Ye}=ae.document;ve(Ye)}};return r.createElement(B.ZP,{classes:{root:mt.root},"data-testid":"techdocs-search-bar",size:"small",open:Be,getOptionLabel:()=>"",filterOptions:se=>se,onClose:()=>{He(!1)},onFocus:()=>{He(!0)},onChange:yt,blurOnSelect:!0,noOptionsText:"No results found",value:null,options:ht,renderOption:({document:se,highlight:ae})=>r.createElement(h,{result:se,lineClamp:3,asListItem:!1,asLink:!1,title:se.title,highlight:ae}),loading:At,renderInput:se=>r.createElement(E.Z,{...se,"data-testid":"techdocs-search-bar-input",variant:"outlined",fullWidth:!0,placeholder:`Search ${Re||le.name} docs`,value:ee,onChange:at,InputProps:{...se.InputProps,startAdornment:r.createElement(S.Z,{position:"start"},r.createElement(b.Z,{"aria-label":"Query",disabled:!0},r.createElement($.Z,null))),endAdornment:r.createElement(r.Fragment,null,At?r.createElement(L.Z,{color:"inherit",size:20}):null,se.InputProps.endAdornment)}})})},K=re=>{const le={term:"",types:["techdocs"],pageCursor:"",filters:re.entityId};return r.createElement(m.Nd,{initialState:le},r.createElement(M,{...re}))}},98157:function(){},53260:function(){}},function(ne){var s=function(r){return ne(ne.s=r)};ne.O(0,[2370,6202,9284,9035,2126,7012,2194,4983,3222,6816,5218,4736],function(){return s(88649),s(90775)});var e=ne.O()}]);})();
|
|
491
491
|
|
|
492
|
-
//# sourceMappingURL=main.
|
|
492
|
+
//# sourceMappingURL=main.b21eb9fe.js.map
|