@techdocs/cli 1.12.0 → 1.12.1-next.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 +11 -0
- package/dist/commands/generate/generate.cjs.js.map +1 -1
- package/dist/commands/index.cjs.js.map +1 -1
- package/dist/commands/migrate/migrate.cjs.js.map +1 -1
- package/dist/commands/publish/publish.cjs.js.map +1 -1
- package/dist/commands/serve/mkdocs.cjs.js.map +1 -1
- package/dist/commands/serve/serve.cjs.js.map +1 -1
- package/dist/commands/serve/utils.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +48 -47
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/123.bc6a54ead4a3.chunk.js +2 -0
- package/dist/embedded-app/static/123.bc6a54ead4a3.chunk.js.map +1 -0
- package/dist/embedded-app/static/1659.9fe64c5d9180.chunk.js +2 -0
- package/dist/embedded-app/static/1659.9fe64c5d9180.chunk.js.map +1 -0
- package/dist/embedded-app/static/1749.99ba95728e00.chunk.js.map +1 -1
- package/dist/embedded-app/static/1767.511a3dc76c96.chunk.js +2 -0
- package/dist/embedded-app/static/1767.511a3dc76c96.chunk.js.map +1 -0
- package/dist/embedded-app/static/1994.7736057c2e9f.chunk.js.map +1 -1
- package/dist/embedded-app/static/{2063.c6396ce3e9c9.chunk.js → 2063.be81f1843585.chunk.js} +3 -3
- package/dist/embedded-app/static/2063.be81f1843585.chunk.js.map +1 -0
- package/dist/embedded-app/static/3031.f2ee3495211a.chunk.js +2 -0
- package/dist/embedded-app/static/{3031.cd0a0f1ddfd2.chunk.js.map → 3031.f2ee3495211a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/3554.78dd0c182f6c.chunk.js.map +1 -1
- package/dist/embedded-app/static/4587.f762d58ffd52.chunk.js +2 -0
- package/dist/embedded-app/static/4587.f762d58ffd52.chunk.js.map +1 -0
- package/dist/embedded-app/static/{4609.b1c67dc7cac2.chunk.js → 4609.9d9e4473afcc.chunk.js} +6 -6
- package/dist/embedded-app/static/4609.9d9e4473afcc.chunk.js.map +1 -0
- package/dist/embedded-app/static/4648.cd5b8df48435.chunk.js.map +1 -1
- package/dist/embedded-app/static/4876.fa3ad2676113.chunk.js +2 -0
- package/dist/embedded-app/static/4876.fa3ad2676113.chunk.js.map +1 -0
- package/dist/embedded-app/static/5877.73f1d4863c15.chunk.js +2 -0
- package/dist/embedded-app/static/5877.73f1d4863c15.chunk.js.map +1 -0
- package/dist/embedded-app/static/6138.f15d6245c80d.chunk.js.map +1 -1
- package/dist/embedded-app/static/6206.3e7f13e11c59.chunk.js.map +1 -1
- package/dist/embedded-app/static/6949.beeb90ede97f.chunk.js.map +1 -1
- package/dist/embedded-app/static/7203.8b3d94b34b16.chunk.js.map +1 -1
- package/dist/embedded-app/static/9050.bd63e0a33f06.chunk.js.map +1 -1
- package/dist/embedded-app/static/9230.422824f655e0.chunk.js.map +1 -1
- package/dist/embedded-app/static/main.2b07c1548609.js +2 -0
- package/dist/embedded-app/static/main.2b07c1548609.js.map +1 -0
- package/dist/embedded-app/static/module-zod.da562d5b5226.js +56 -0
- package/dist/embedded-app/static/module-zod.da562d5b5226.js.map +1 -0
- package/dist/embedded-app/static/{runtime.720cb48cd7ae.js → runtime.f472dc4c479f.js} +2 -2
- package/dist/embedded-app/static/{runtime.720cb48cd7ae.js.map → runtime.f472dc4c479f.js.map} +1 -1
- package/dist/embedded-app/static/{vendor.470d3e8ecef1.js → vendor.d2c73d5e1e09.js} +2 -2
- package/dist/embedded-app/static/{vendor.470d3e8ecef1.js.map → vendor.d2c73d5e1e09.js.map} +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/lib/PublisherConfig.cjs.js.map +1 -1
- package/dist/lib/etag.cjs.js.map +1 -1
- package/dist/lib/httpServer.cjs.js.map +1 -1
- package/dist/lib/livereload.cjs.js.map +1 -1
- package/dist/lib/mkdocsServer.cjs.js.map +1 -1
- package/dist/lib/utility.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/dist/package.json.cjs.js.map +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/123.91ba1b809deb.chunk.js +0 -2
- package/dist/embedded-app/static/123.91ba1b809deb.chunk.js.map +0 -1
- package/dist/embedded-app/static/1659.a99e4eb674e0.chunk.js +0 -2
- package/dist/embedded-app/static/1659.a99e4eb674e0.chunk.js.map +0 -1
- package/dist/embedded-app/static/1767.5aca18e1057b.chunk.js +0 -2
- package/dist/embedded-app/static/1767.5aca18e1057b.chunk.js.map +0 -1
- package/dist/embedded-app/static/2063.c6396ce3e9c9.chunk.js.map +0 -1
- package/dist/embedded-app/static/3031.cd0a0f1ddfd2.chunk.js +0 -2
- package/dist/embedded-app/static/4587.d1220800a7d6.chunk.js +0 -2
- package/dist/embedded-app/static/4587.d1220800a7d6.chunk.js.map +0 -1
- package/dist/embedded-app/static/4609.b1c67dc7cac2.chunk.js.map +0 -1
- package/dist/embedded-app/static/4876.67117dbbe8d1.chunk.js +0 -2
- package/dist/embedded-app/static/4876.67117dbbe8d1.chunk.js.map +0 -1
- package/dist/embedded-app/static/5877.8ad98e3207c5.chunk.js +0 -2
- package/dist/embedded-app/static/5877.8ad98e3207c5.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.9b48363c4ffa.js +0 -2
- package/dist/embedded-app/static/main.9b48363c4ffa.js.map +0 -1
- package/dist/embedded-app/static/module-zod.faf74f910029.js +0 -38
- package/dist/embedded-app/static/module-zod.faf74f910029.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["3031"],{45463(e,t,i){i.d(t,{z:()=>l});var n=i(31085),r=i(64947),a=i(14041),s=i(60603);let o=(0,a.forwardRef)((e,t)=>(0,n.jsx)(s.$h,{ref:t,...e,color:"initial"})),l=(0,a.forwardRef)((e,t)=>(0,n.jsx)(r.A,{ref:t,component:o,...e}))},45794(e,t,i){i.d(t,{Y:()=>P});var n=i(31085),r=i(91189),a=i(50509),s=i(19735),o=i(77125),l=i(64947),c=i(93453),d=i(29365),g=i(68804),u=i(5951),h=i(26343),p=i(28233),m=i(55197),f=i(58837),y=i(72501),x=i(5893),j=i(14041),I=i(23838),A=i(55940),b=i(60603),k=i(89332),w=i(89595);let v=(0,f.A)({popoverList:{minWidth:260,maxWidth:400},menuItem:{whiteSpace:"normal"}},{name:"BackstageSupportButton"}),S=({icon:e})=>{let t=(0,r.n)(),i=e?t.getSystemIcon(e)??A.NT:A.NT;return(0,n.jsx)(i,{})},B=({link:e})=>(0,n.jsx)(b.N_,{to:e.url,children:e.title??e.url}),C=({item:e})=>(0,n.jsxs)(h.A,{button:!1,children:[(0,n.jsx)(g.A,{children:(0,n.jsx)(S,{icon:e.icon})}),(0,n.jsx)(u.A,{primary:e.title,secondary:e.links?.reduce((e,t,i)=>[...e,i>0&&(0,n.jsx)("br",{},i),(0,n.jsx)(B,{link:t},t.url)],[])})]});function P(e){let{t}=(0,w.i)(k.O),{title:i,items:r,children:g}=e,{items:u}=(0,I.l)(),[f,b]=(0,j.useState)(!1),[S,B]=(0,j.useState)(null),P=v(),T=(0,a.gf)(s.U).getOptionalConfig("app.support"),N=(0,x.A)(e=>e.breakpoints.down("sm")),E=e=>{B(e.currentTarget),b(!0)},O=()=>{b(!1)};return T?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.A,{display:"flex",ml:1,children:N?(0,n.jsx)(d.A,{color:"primary",size:"small",onClick:E,"data-testid":"support-button","aria-label":"Support",children:(0,n.jsx)(A.NT,{})}):(0,n.jsx)(l.A,{"data-testid":"support-button","aria-label":"Support",color:"primary",onClick:E,startIcon:(0,n.jsx)(A.NT,{}),children:t("supportButton.title")})}),(0,n.jsxs)(m.Ay,{"data-testid":"support-button-popover",open:f,anchorEl:S,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},onClose:O,children:[(0,n.jsxs)(p.A,{className:P.popoverList,autoFocusItem:!!S,children:[i&&(0,n.jsx)(h.A,{button:!1,alignItems:"flex-start",className:P.menuItem,children:(0,n.jsx)(y.A,{variant:"subtitle1",children:i})}),j.Children.map(g,(e,t)=>(0,n.jsx)(h.A,{button:!1,alignItems:"flex-start",className:P.menuItem,children:e},`child-${t}`)),(r??u).map((e,t)=>(0,n.jsx)(C,{item:e},`item-${t}`))]}),(0,n.jsx)(c.A,{children:(0,n.jsx)(l.A,{color:"primary",onClick:O,"aria-label":"Close",children:t("supportButton.close")})})]})]}):null}},77981(e,t,i){i.d(t,{SupportButton:()=>n.Y,SignInPage:()=>et});var n=i(45794),r=i(31085),a=i(50509),s=i(19735),o=i(53996);class l{getUserId(){return"guest"}async getIdToken(){}getProfile(){return{email:"guest@example.com",displayName:"Guest"}}async getProfileInfo(){return{email:"guest@example.com",displayName:"Guest"}}async getBackstageIdentity(){let e="user:default/guest";return{type:"user",userEntityRef:e,ownershipEntityRefs:[e]}}async getCredentials(){return{}}async signOut(){}}class c{result;constructor(e){this.result=e}getUserId(){return this.result.userId}static fromResult(e){return new c(e)}async getIdToken(){return this.result.getIdToken?.()}getProfile(){return this.result.profile}async getProfileInfo(){return this.result.profile}async getBackstageIdentity(){let e=await this.getIdToken();if(!e){let e=`user:default/${this.getUserId()}`;return{type:"user",userEntityRef:e,ownershipEntityRefs:[e]}}let{sub:t,ent:i}=function(e){let[t,i,n]=e.split(".");return JSON.parse(window.atob(i))}(e);return{type:"user",userEntityRef:t,ownershipEntityRefs:i??[]}}async getCredentials(){return{token:await this.result.getIdToken?.()}}async signOut(){return this.result.signOut?.()}}class d{profilePromise;static createGuest(){return new l}static fromLegacy(e){return c.fromResult(e)}static create(e){return new d(e.identity,e.authApi,e.profile)}identity;authApi;profile;constructor(e,t,i){this.identity=e,this.authApi=t,this.profile=i}getUserId(){let e=this.identity.userEntityRef,t=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(e);if(!t)throw TypeError(`Invalid user entity reference "${e}"`);return t[3]}async getIdToken(){return(await this.authApi.getBackstageIdentity()).token}getProfile(){if(!this.profile)throw Error("The identity API does not implement synchronous profile fetching, use getProfileInfo() instead");return this.profile}async getProfileInfo(){if(this.profilePromise)return await this.profilePromise;try{return this.profilePromise=this.authApi.getProfile(),await this.profilePromise}catch(e){throw this.profilePromise=void 0,e}}async getBackstageIdentity(){return this.identity}async getCredentials(){return{token:(await this.authApi.getBackstageIdentity()).token}}async signOut(){return this.authApi.signOut()}}var g=i(64947),u=i(42899),h=i(72501),p=i(14041),m=i(76842),f=i(55489),y=i(84391),x=i(15179),j=i(70111),I=i(89439),A=i(12439),b=i(151),k=i(58837);let w=(0,k.A)({container:{padding:0,listStyle:"none"},item:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"400px",margin:0,padding:0}},{name:"BackstageSignInPage"}),v=({children:e})=>{let t=w();return(0,r.jsx)(u.A,{component:"li",item:!0,classes:t,children:e})};var S=i(55963),B=i(89332),C=i(89595);let P=async(e,t)=>{let i=e.get(t),n=await i.getBackstageIdentity({optional:!0});if(!n)return;let r=await i.getProfile();return d.create({identity:n.identity,profile:r,authApi:i})};var T=i(33947),N=i(31533);let E=N.Ik({providerInfo:N.Ik({}).catchall(N.L5()).optional(),profile:N.Ik({email:N.Yj().optional(),displayName:N.Yj().optional(),picture:N.Yj().optional()}),backstageIdentity:N.Ik({token:N.Yj(),identity:N.Ik({type:N.eu("user"),userEntityRef:N.Yj(),ownershipEntityRefs:N.YO(N.Yj())})})});class O{options;abortController;state;constructor(e){this.options=e,this.abortController=new AbortController,this.state={type:"empty"}}async start(){await this.getSessionAsync()}getUserId(){let{backstageIdentity:e}=this.getSessionSync(),t=e.identity.userEntityRef,i=/^([^:/]+:)?([^:/]+\/)?([^:/]+)$/.exec(t);if(!i)throw TypeError(`Invalid user entity reference "${t}"`);return i[3]}async getIdToken(){return(await this.getSessionAsync()).backstageIdentity.token}getProfile(){return this.getSessionSync().profile}async getProfileInfo(){return(await this.getSessionAsync()).profile}async getBackstageIdentity(){return(await this.getSessionAsync()).backstageIdentity.identity}async getCredentials(){return{token:(await this.getSessionAsync()).backstageIdentity.token}}async signOut(){this.abortController.abort()}getSessionSync(){if("active"===this.state.type)return this.state.session;if("fetching"===this.state.type&&this.state.previous)return this.state.previous;throw Error("No session available. Try reloading your browser page.")}async getSessionAsync(){if("fetching"===this.state.type)return this.state.promise;if("active"===this.state.type&&new Date<this.state.expiresAt)return this.state.session;let e="active"===this.state.type?this.state.session:void 0,t=this.fetchSession().then(e=>(this.state={type:"active",session:e,expiresAt:function(e){let t,i,n=new Date(Date.now()+3e5);if(!e)return n;let[r,a,s]=e.split("."),o=JSON.parse((i=(t=a.replace(/-/g,"+").replace(/_/g,"/")).padEnd(4*Math.ceil(t.length/4),"="),window.atob(i)));return"number"!=typeof o.exp?n:new Date(1e3*o.exp-3e5)}(e.backstageIdentity.token)},e),e=>{throw this.state={type:"failed",error:e},e});return this.state={type:"fetching",promise:t,previous:e},t}async fetchSession(){let e=await this.options.discoveryApi.getBaseUrl("auth"),t=new Headers("function"==typeof this.options.headers?await this.options.headers():this.options.headers);t.set("X-Requested-With","XMLHttpRequest");let i=await fetch(`${e}/${this.options.provider}/refresh`,{signal:this.abortController.signal,headers:t,credentials:"include"});if(!i.ok)throw await T.o.fromResponse(i);return E.parse(await i.json())}}var R=i(71531),$=i(48472);let D=async e=>{try{return await e.getBackstageIdentity()}catch(e){if("ResponseError"===e.name&&"NotFoundError"===e.cause.name)return;throw e}},W=async e=>{let t="true"===localStorage.getItem("enableLegacyGuestToken"),i=new O({provider:"guest",discoveryApi:e.get(R.I)}),n=await D(i).catch(e=>{console.warn(`Failed to sign in as a guest, ${e}`)});if(n||t){if(n&&t){if(!confirm("You are currently using the legacy guest token, but you have the new guest backend module installed. Do you want to use the new module?"))return new l;localStorage.removeItem("enableLegacyGuestToken")}else if(t)return new l;return i}};var Y=i(80824),z=i(95061),H=i(16249),U=i(51253),L=i(3514),F=i.n(L);let _=/^[a-z0-9_\-]+\.[a-z0-9_\-]+\.[a-z0-9_\-]+$/i,G=(0,k.A)(e=>({form:{display:"flex",flexFlow:"column nowrap"},button:{alignSelf:"center",marginTop:e.spacing(2)},subTitle:{whiteSpace:"pre-line"}}),{name:"BackstageCustomProvider"}),q=e=>{let{ref:t,...i}=e;return{inputRef:t,...i}},M=async()=>void 0;class J{config;constructor(e){this.config=e}static from(e){return new J(e)}getUserId(){if(!this.config.identityApi.getUserId)throw Error("SignOutProxy IdentityApi.getUserId is not implemented");return this.config.identityApi.getUserId()}getIdToken(){if(!this.config.identityApi.getIdToken)throw Error("SignOutProxy IdentityApi.getIdToken is not implemented");return this.config.identityApi.getIdToken()}getProfile(){if(!this.config.identityApi.getProfile)throw Error("SignOutProxy IdentityApi.getProfile is not implemented");return this.config.identityApi.getProfile()}getProfileInfo(){return this.config.identityApi.getProfileInfo()}getBackstageIdentity(){return this.config.identityApi.getBackstageIdentity()}getCredentials(){return this.config.identityApi.getCredentials()}signOut(){return this.config.signOut()}}var K=i(73657);let X="@backstage/core:SignInPage:provider",Q={guest:{Component:({onSignInStarted:e,onSignInSuccess:t,onSignInFailure:i})=>{let n=(0,a.gf)(R.I),[s,o]=(0,$.A)("enableLegacyGuestToken"),{t:c}=(0,C.i)(B.O),d=async()=>{e();let r=new O({provider:"guest",discoveryApi:n});if(!await D(r).catch(e=>{console.warn(`Failed to sign in as a guest, ${e}`)})){if(confirm("Failed to sign in as a guest using the auth backend. Do you want to fallback to the legacy guest token?")){o(!0),t(new l);return}throw i(),Error("You cannot sign in as a guest, you must either enable the legacy guest token or configure the auth backend to support guest sign in.")}t(r)};return(0,r.jsx)(v,{children:(0,r.jsx)(I.n,{title:"Guest",variant:"fullHeight",actions:(0,r.jsx)(g.A,{color:"primary",variant:"outlined",onClick:d,children:c("signIn.guestProvider.enter")}),children:(0,r.jsx)(h.A,{variant:"body1",style:{whiteSpace:"pre-line"},children:c("signIn.guestProvider.subtitle")})})})},loader:W},custom:{Component:({onSignInStarted:e,onSignInSuccess:t})=>{let i=G(),{t:n}=(0,C.i)(B.O),{register:a,handleSubmit:s,formState:o}=(0,Y.mN)({mode:"onChange"}),{errors:l}=o;return(0,r.jsx)(v,{children:(0,r.jsxs)(I.n,{title:n("signIn.customProvider.title"),variant:"fullHeight",children:[(0,r.jsx)(h.A,{variant:"body1",className:i.subTitle,children:n("signIn.customProvider.subtitle")}),(0,r.jsxs)("form",{className:i.form,onSubmit:s(({userId:i,idToken:n})=>{e(),t(d.fromLegacy({userId:i,getIdToken:void 0!==n?async()=>n:void 0,profile:{email:`${i}@example.com`}}))}),children:[(0,r.jsxs)(z.A,{children:[(0,r.jsx)(H.A,{...q(a("userId",{required:!0})),label:n("signIn.customProvider.userId"),margin:"normal",error:!!l.userId}),l.userId&&(0,r.jsx)(U.A,{error:!0,children:l.userId.message})]}),(0,r.jsxs)(z.A,{children:[(0,r.jsx)(H.A,{...q(a("idToken",{required:!1,validate:e=>!e||_.test(e)||n("signIn.customProvider.tokenInvalid")})),label:n("signIn.customProvider.idToken"),margin:"normal",autoComplete:"off",error:!!l.idToken}),l.idToken&&(0,r.jsx)(U.A,{error:!0,children:l.idToken.message})]}),(0,r.jsx)(g.A,{type:"submit",color:"primary",variant:"outlined",className:i.button,disabled:!o?.isDirty||!F()(l),children:n("signIn.customProvider.continue")})]})]})})},loader:M},common:{Component:({config:e,onSignInStarted:t,onSignInSuccess:i,onSignInFailure:n})=>{let{apiRef:s,title:o,message:l}=e,c=(0,a.gf)(s),u=(0,a.gf)(b.m),{t:p}=(0,C.i)(B.O),m=async()=>{try{t();let e=await c.getBackstageIdentity({instantPopup:!0});if(!e)throw n(),Error(`The ${o} provider is not configured to support sign-in`);let r=await c.getProfile();i(d.create({identity:e.identity,profile:r,authApi:c}))}catch(e){n(),u.post(new S.HK(p("signIn.loginFailed"),e))}};return(0,r.jsx)(v,{children:(0,r.jsx)(I.n,{variant:"fullHeight",title:o,actions:(0,r.jsx)(g.A,{color:"primary",variant:"outlined",onClick:m,children:p("signIn.title")}),children:(0,r.jsx)(h.A,{variant:"body1",children:l})})})},loader:P}};function V(e,t){if(e in t)throw Error(`"${e}" ID is duplicated. IDs of identity providers have to be unique.`)}let Z=({onSignInSuccess:e,providers:t=[],title:i,titleComponent:n,align:l="left"})=>{let c=(0,a.gf)(s.U),d=w(),[g,h]=((e,t)=>{let i=(0,a.gf)(b.m),n=(0,a.Q2)(),[s,l]=(0,p.useState)(!0),c=(0,o.s)(),{t:d}=(0,C.i)(B.O),[g,u]=(0,K.useSearchParams)();(0,m.u)(()=>{let e=g.get("error");e&&i.post(new S.HK(d("signIn.loginFailed"),Error(e)))});let h=(0,p.useCallback)(async e=>{t(J.from({identityApi:e,signOut:async()=>{localStorage.removeItem(X),await e.signOut?.(),c.captureEvent("signOut","success")}})),c.captureEvent("signIn","success")},[t,c]);return(0,p.useLayoutEffect)(()=>{if(!s)return;let t=localStorage.getItem(X);if(null===t)return void l(!1);let r=e[t];if(!r)return void l(!1);let a=!1;return r.components.loader(n,r.config?.apiRef).then(e=>{a?localStorage.removeItem(X):e?h(e):l(!1)}).catch(e=>{localStorage.removeItem(X),a||(i.post(e),l(!1))}),()=>{a=!0}},[s,i,t,n,e,h]),[s,(0,p.useMemo)(()=>Object.keys(e).map(t=>{let i=e[t],{Component:n}=i.components;return(0,r.jsx)(n,{config:i.config,onSignInStarted:()=>{localStorage.setItem(X,i?.config?.id||i.id)},onSignInSuccess:e=>{h(e)},onSignInFailure:()=>{localStorage.removeItem(X)}},i.id)}),[e,h])]})(t.reduce((e,t)=>{if("string"==typeof t)return V(t,e),e[t]={components:Q[t],id:t},e;let{id:i}=t;return V(i,e),e[i]={components:Q.common,id:i,config:t},e},{}),e);return g?(0,r.jsx)(f.k,{}):(0,r.jsxs)(A.Y,{themeId:"home",children:[(0,r.jsx)(j.Y,{title:c.getString("app.title")}),(0,r.jsxs)(y.U,{children:[(i||n)&&(0,r.jsx)(x.d,{title:i,titleComponent:n,textAlign:l}),(0,r.jsx)(u.A,{container:!0,justifyContent:"center"===l?l:"flex-start",spacing:2,component:"ul",classes:d,children:h})]})]})},ee=({provider:e,auto:t,onSignInSuccess:i,ErrorComponent:n})=>{let l=w(),c=(0,a.gf)(e.apiRef),x=(0,a.gf)(s.U),{t:b}=(0,C.i)(B.O),k=(0,o.s)(),[S,P]=(0,p.useState)(),[T,N]=(0,p.useState)(!1),[E,O]=(0,K.useSearchParams)(),R=E.get("error"),$=async({checkExisting:n,showPopup:r})=>{try{let a;if(n&&(a=await c.getBackstageIdentity({optional:!0})),!a&&(r||t)&&!R&&(N(!0),!(a=await c.getBackstageIdentity({instantPopup:!0}))))throw Error(`The ${e.title} provider is not configured to support sign-in`);if(!a)return void N(!0);let s=await c.getProfile();i(d.create({identity:a.identity,authApi:c,profile:s})),k.captureEvent("signIn","success")}catch(e){P(e),N(!0)}};return(0,m.u)(()=>{R&&P(Error(R)),$({checkExisting:!0})}),T?(0,r.jsxs)(A.Y,{themeId:"home",children:[(0,r.jsx)(j.Y,{title:x.getString("app.title")}),(0,r.jsx)(y.U,{children:(0,r.jsx)(u.A,{container:!0,justifyContent:"center",spacing:2,component:"ul",classes:l,children:(0,r.jsx)(v,{children:(0,r.jsxs)(I.n,{variant:"fullHeight",title:e.title,actions:(0,r.jsx)(g.A,{color:"primary",variant:"outlined",onClick:()=>{$({showPopup:!0})},children:b("signIn.title")}),children:[(0,r.jsx)(h.A,{variant:"body1",children:e.message}),S&&"PopupRejectedError"!==S.name&&(n?(0,r.jsx)(n,{error:S}):(0,r.jsx)(h.A,{variant:"body1",color:"error",children:S.message}))]})})})})]}):(0,r.jsx)(f.k,{})};function et(e){return"provider"in e?(0,r.jsx)(ee,{...e}):(0,r.jsx)(Z,{...e})}},4103(e,t,i){i.d(t,{B:()=>m});var n=i(31085),r=i(77125),a=i(38311),s=i(58007),o=i(8109),l=i(55197),c=i(7031),d=i(72501),g=i(14041);let u=(0,c.A)({root:{textDecoration:"underline",cursor:"pointer"}},{name:"BackstageBreadcrumbsClickableText"})(d.A),h=(0,c.A)({root:{textDecoration:"underline",color:"inherit"}},{name:"BackstageBreadcrumbsStyledBox"})(r.A),p=(0,c.A)({root:{fontStyle:"italic"}},{name:"BreadcrumbsCurrentPage"})(r.A);function m(e){let{children:t,...i}=e,[r,c]=(0,g.useState)(null),d=g.Children.toArray(t),[m,f,...y]=d,x=y.length?y.pop():d[d.length-1],j=d.length>3;return(0,n.jsxs)(g.Fragment,{children:[(0,n.jsxs)(a.A,{"aria-label":"breadcrumb",...i,children:[d.length>1&&(0,n.jsx)(h,{clone:!0,children:m}),d.length>2&&(0,n.jsx)(h,{clone:!0,children:f}),j&&(0,n.jsx)(u,{onClick:e=>{c(e.currentTarget)},children:"..."}),(0,n.jsx)(p,{children:x})]}),(0,n.jsx)(l.Ay,{open:!!r,anchorEl:r,onClose:()=>{c(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,n.jsx)(s.A,{children:y.map((e,t)=>(0,n.jsx)(o.A,{button:!0,children:(0,n.jsx)(h,{clone:!0,children:e})},t))})})]})}},84391(e,t,i){i.d(t,{U:()=>l});var n=i(31085),r=i(58837),a=i(53373),s=i.n(a);let o=(0,r.A)(e=>({root:{gridArea:"pageContent",minWidth:0,paddingTop:e.spacing(3),paddingBottom:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},stretch:{display:"flex",flexDirection:"column",flexGrow:1},noPadding:{padding:0}}),{name:"BackstageContent"});function l(e){let{className:t,stretch:i,noPadding:r,children:a,...l}=e,c=o();return(0,n.jsx)("article",{...l,className:s()(c.root,t,{[c.stretch]:i,[c.noPadding]:r}),children:a})}},15179(e,t,i){i.d(t,{d:()=>d});var n=i(31085),r=i(77125),a=i(58837),s=i(72501),o=i(93285);let l=({title:e,className:t})=>(0,n.jsx)(s.A,{variant:"h4",component:"h2",className:t,"data-testid":"header-title",children:e}),c=({description:e,className:t})=>e?(0,n.jsx)(s.A,{variant:"body2",className:t,"data-testid":"header-description",children:e}):null;function d(e){let t,{description:i,title:s,titleComponent:d,children:g,descriptionComponent:u,textAlign:h="left"}=e,p=(t={textAlign:h},(0,a.A)(e=>({container:{width:"100%",display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-end",alignItems:"center",marginBottom:e.spacing(2),textAlign:t.textAlign},leftItemsBox:{flex:"1 1 auto",minWidth:0,overflow:"visible"},rightItemsBox:{flex:"0 1 auto",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",marginLeft:e.spacing(1),minWidth:0,overflow:"visible"},description:{},title:{display:"inline-flex",marginBottom:0}}),{name:"BackstageContentHeader"}))(),m=d||(0,n.jsx)(l,{title:s,className:p.title}),f=u||(0,n.jsx)(c,{description:i,className:p.description});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.m,{title:s}),(0,n.jsxs)(r.A,{className:p.container,children:[(0,n.jsxs)(r.A,{className:p.leftItemsBox,children:[m,f]}),(0,n.jsx)(r.A,{className:p.rightItemsBox,children:g})]})]})}},70111(e,t,i){i.d(t,{Y:()=>j});var n=i(31085),r=i(50509),a=i(19735),s=i(77125),o=i(42899),l=i(58837),c=i(71677),d=i(72501),g=i(93285),u=i(60603),h=i(4103),p=i(96919);let m=(0,l.A)(e=>({header:{gridArea:"pageHeader",padding:e.spacing(3),width:"100%",boxShadow:e.shadows[4],position:"relative",zIndex:100,display:"flex",flexDirection:"row",alignItems:"center",backgroundImage:e.page.backgroundImage,backgroundPosition:"center",backgroundSize:"cover",[e.breakpoints.down("sm")]:{flexWrap:"wrap"}},leftItemsBox:{maxWidth:"100%",flexGrow:1},rightItemsBox:{width:"auto",alignItems:"center"},title:{color:e.page.fontColor,wordBreak:"break-word",fontSize:e.typography.h3.fontSize,marginBottom:0},subtitle:{color:e.page.fontColor,opacity:.8,display:"inline-block",marginTop:e.spacing(1),maxWidth:"75ch"},type:{textTransform:"uppercase",fontSize:11,opacity:.8,marginBottom:e.spacing(1),color:e.page.fontColor},breadcrumb:{color:e.page.fontColor},breadcrumbType:{fontSize:"inherit",opacity:.7,marginRight:-e.spacing(.3),marginBottom:e.spacing(.3)},breadcrumbTitle:{fontSize:"inherit",marginLeft:-e.spacing(.3),marginBottom:e.spacing(.3)}}),{name:"BackstageHeader"}),f=({type:e,typeLink:t,classes:i,pageTitle:r})=>e?t?(0,n.jsxs)(h.B,{className:i.breadcrumb,children:[(0,n.jsx)(u.N_,{to:t,children:e}),(0,n.jsx)(d.A,{children:r})]}):(0,n.jsx)(d.A,{className:i.type,children:e}):null,y=({pageTitle:e,classes:t,tooltip:i})=>{let{contentRef:r}=(0,p.H)(),a=(0,n.jsx)(d.A,{ref:r,tabIndex:-1,className:t.title,variant:"h1",children:e});return i?(0,n.jsx)(c.Ay,{title:i,placement:"top-start",children:a}):a},x=({classes:e,subtitle:t})=>t?"string"!=typeof t?(0,n.jsx)(n.Fragment,{children:t}):(0,n.jsx)(d.A,{className:e.subtitle,variant:"subtitle2",component:"span",children:t}):null;function j(e){let{children:t,pageTitleOverride:i,style:l,subtitle:c,title:d,tooltip:u,type:h,typeLink:p}=e,j=m(),I=(0,r.gf)(a.U).getOptionalString("app.title")||"Backstage",A=i||d,b=d||i,k=`${A} | %s | ${I}`,w=`${A} | ${I}`;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g.m,{titleTemplate:k,defaultTitle:w}),(0,n.jsxs)("header",{style:l,className:j.header,"data-backstage-core-header":"",children:[(0,n.jsxs)(s.A,{className:j.leftItemsBox,children:[(0,n.jsx)(f,{classes:j,type:h,typeLink:p,pageTitle:b}),(0,n.jsx)(y,{classes:j,pageTitle:b,tooltip:u}),(0,n.jsx)(x,{classes:j,subtitle:c})]}),(0,n.jsx)(o.A,{container:!0,className:j.rightItemsBox,spacing:4,children:t})]})]})}},89439(e,t,i){i.d(t,{n:()=>T});var n=i(31085),r=i(40703),a=i(59469),s=i(48653),o=i(45685),l=i(37197),c=i(58837),d=i(7031),g=i(53373),u=i.n(g),h=i(77125),p=i(72501),m=i(52235),f=i(60603);let y=(0,c.A)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function x(e){let{link:t,title:i,onClick:r}=e,a=y();return(0,n.jsxs)(h.A,{children:[(0,n.jsx)(l.A,{}),(0,n.jsx)(f.N_,{to:t,onClick:r,underline:"none",children:(0,n.jsxs)(h.A,{display:"flex",alignItems:"center",className:a.root,children:[(0,n.jsx)(h.A,{className:a.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,n.jsx)(p.A,{children:(0,n.jsx)("strong",{children:i})})}),(0,n.jsx)(m.default,{className:a.arrow})]})})]})}var j=i(14041),I=i(45463),A=i(60691),b=i(89332),k=i(89595);let w=e=>{let{slackChannel:t}=e,{t:i}=(0,k.i)(b.O);return t?"string"==typeof t?(0,n.jsx)(p.A,{children:i("errorBoundary.title",{slackChannel:t})}):t.href?(0,n.jsx)(I.z,{to:t.href,variant:"contained",children:t.name}):(0,n.jsx)(p.A,{children:i("errorBoundary.title",{slackChannel:t.name})}):null},v=class extends j.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:i}=this.state;return i?(0,n.jsx)(A.b,{title:"Something Went Wrong",error:i,children:(0,n.jsx)(w,{slackChannel:e})}):t}},S=(0,c.A)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),B=(0,d.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(a.A),C={flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},P={fullHeight:{flex:1},gridItem:{flex:1}};function T(e){let{title:t,subheader:i,divider:c=!0,deepLink:d,slackChannel:g,errorBoundaryProps:h,variant:p,alignContent:m="normal",children:f,headerStyle:y,headerProps:j,icon:I,action:A,actionsClassName:b,actions:k,cardClassName:w,actionsTopRight:T,className:N,noPadding:E,titleTypographyProps:O,subheaderTypographyProps:R}=e,$=S(),D={},W={};return p&&p.split(/[\s]+/g).forEach(e=>{D={...D,...C[e]},W={...W,...P[e]}}),(0,n.jsx)(r.A,{style:D,className:N,children:(0,n.jsxs)(v,{...h||(g?{slackChannel:g}:{}),children:[t&&(0,n.jsx)(o.A,{classes:{root:u()($.header),title:$.headerTitle,subheader:$.headerSubheader,avatar:$.headerAvatar,action:$.headerAction,content:$.headerContent},title:t,subheader:i||I?(0,n.jsxs)("div",{"data-testid":"info-card-subheader",children:[i&&(0,n.jsx)("div",{className:$.subheader,children:i}),I]}):null,action:A,style:{...y},titleTypographyProps:O,subheaderTypographyProps:R,...j}),T&&(0,n.jsx)(B,{children:T}),c&&(0,n.jsx)(l.A,{}),(0,n.jsx)(s.A,{className:u()(w,{[$.noPadding]:E,[$.contentAlignBottom]:"bottom"===m}),style:W,children:f}),k&&(0,n.jsx)(a.A,{className:b,children:k}),d&&(0,n.jsx)(x,{...d})]})})}},12439(e,t,i){i.d(t,{Y:()=>c});var n=i(31085),r=i(58837),a=i(50868),s=i(53373),o=i.n(s);let l=(0,r.A)(e=>({root:{display:"grid",gridTemplateAreas:"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'",gridTemplateRows:"max-content auto 1fr",gridTemplateColumns:"auto 1fr auto",overflowY:"auto",height:"100vh",[e.breakpoints.down("xs")]:{height:"100%"},"@media print":{display:"block",height:"auto",overflowY:"inherit"}}}),{name:"BackstagePage"});function c(e){let{themeId:t,className:i,children:r}=e,s=l();return(0,n.jsx)(a.A,{theme:e=>({...e,page:e.getPageTheme({themeId:t})}),children:(0,n.jsx)("main",{className:o()(s.root,i),"data-backstage-core-page":"",children:r})})}}}]);
|
|
2
|
+
//# sourceMappingURL=3031.f2ee3495211a.chunk.js.map
|