@techdocs/cli 1.6.1-next.0 → 1.6.1-next.2

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/embedded-app/.config-schema.json +151 -151
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/1059.84ba853b.chunk.js +10 -0
  5. package/dist/embedded-app/static/1059.84ba853b.chunk.js.map +1 -0
  6. package/dist/embedded-app/static/3510.6d8cb98c.chunk.js +3 -0
  7. package/dist/embedded-app/static/3510.6d8cb98c.chunk.js.map +1 -0
  8. package/dist/embedded-app/static/8096.60ff0c3e.chunk.js +11 -0
  9. package/dist/embedded-app/static/8096.60ff0c3e.chunk.js.map +1 -0
  10. package/dist/embedded-app/static/main.21f1591c.js +487 -0
  11. package/dist/embedded-app/static/main.21f1591c.js.map +1 -0
  12. package/dist/embedded-app/static/{runtime.167d1cf0.js → runtime.21f1591c.js} +2 -2
  13. package/dist/embedded-app/static/{runtime.167d1cf0.js.map → runtime.21f1591c.js.map} +1 -1
  14. package/dist/embedded-app/static/vendor.21f1591c.js +206 -0
  15. package/dist/embedded-app/static/vendor.21f1591c.js.map +1 -0
  16. package/dist/index.cjs.js +1 -1
  17. package/package.json +4 -4
  18. package/dist/embedded-app/static/4966.e30bae7f.chunk.js +0 -49
  19. package/dist/embedded-app/static/4966.e30bae7f.chunk.js.map +0 -1
  20. package/dist/embedded-app/static/7893.e406114c.chunk.js +0 -3
  21. package/dist/embedded-app/static/7893.e406114c.chunk.js.map +0 -1
  22. package/dist/embedded-app/static/967.dadcb6bd.chunk.js +0 -11
  23. package/dist/embedded-app/static/967.dadcb6bd.chunk.js.map +0 -1
  24. package/dist/embedded-app/static/main.167d1cf0.js +0 -487
  25. package/dist/embedded-app/static/main.167d1cf0.js.map +0 -1
  26. package/dist/embedded-app/static/vendor.167d1cf0.js +0 -167
  27. package/dist/embedded-app/static/vendor.167d1cf0.js.map +0 -1
@@ -1,3 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[7893],{96641:function(se,$,t){t.d($,{X2:function(){return B},h$:function(){return S}});var n=t(52322),A=t(74314),U=t(72388),R=t(29651),x=t(68993),P=t(2784);const z=(0,R.CT)("entity-context"),S=c=>{const{children:f,entity:j,loading:w,error:h,refresh:u}=c,v={entity:j,loading:w,error:h,refresh:u};return(0,n.jsx)(z.Provider,{value:(0,x.E)({1:v}),children:(0,n.jsx)(U.fC,{attributes:{...j?{entityRef:(0,A.eE)(j)}:void 0},children:f})})},J=c=>_jsx(S,{entity:c.entity,loading:!Boolean(c.entity),error:void 0,refresh:void 0,children:c.children});function B(){const c=(0,R.Vt)("entity-context");if(!c)throw new Error("Entity context is not available");const f=c.atVersion(1);if(!f)throw new Error("EntityContext v1 not available");if(!f.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:f.entity}}function H(){const c=useVersionedContext("entity-context");if(!c)throw new Error("Entity context is not available");const f=c.atVersion(1);if(!f)throw new Error("EntityContext v1 not available");const{entity:j,loading:w,error:h,refresh:u}=f;return{entity:j,loading:w,error:h,refresh:u}}},37893:function(se,$,t){t.r($),t.d($,{AboutCard:function(){return et},AboutContent:function(){return he},AboutField:function(){return L}});var n=t(52322),A=t(34106),U=t(90663),R=t(74314),x=t(79692),P=t(94339),z=t(32552),S=t(61837),J=t(85256),B=t(24579),H=t(98864),c=t(2784),f=t(72779),j=t.n(f),w=t(35292),h=t(62774),u=t(90436);const v=(0,x.Z)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function k({color:e="primary",disabled:a=!1,href:o="#",icon:s=(0,n.jsx)(w.Z,{}),label:r,onClick:l,title:d}){const p=v();return a?(0,n.jsxs)(h.Z,{title:d,className:j()(p.link,p.disabled),children:[s,(0,n.jsx)(u.Z,{variant:"caption",component:"span",className:p.label,children:r})]}):(0,n.jsxs)(H.rU,{title:d,className:j()(p.link,p[e]),to:o,onClick:l,children:[s,(0,n.jsx)(u.Z,{variant:"caption",component:"span",className:p.label,children:r})]})}const b=(0,x.Z)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3)}}),{name:"BackstageHeaderIconLinkRow"});function m(e){const{links:a}=e,o=b();return(0,n.jsx)("nav",{className:o.links,children:a.map((s,r)=>(0,n.jsx)(k,{...s},r+1))})}var G=t(91657),te=t(73250),re=t(80851);const ye=e=>{const{type:a}=e,o=(0,re.q)(),s=te.Z;var r;const l=a&&(r=o.getSystemIcon(a))!==null&&r!==void 0?r:s;return(0,n.jsx)(l,{})};var X=t(44394),fe=t(78847),ge=t(58513),le=t(37321),ve=t(96641),be=t(88624),de=t(51547);function xe(e,a){var o;const s=(o=e.metadata.annotations)===null||o===void 0?void 0:o[U.M6];if(s)try{const r=(0,de.Ou)(s),l=a.byUrl(r.target);return{locationTargetUrl:r.target,integrationType:l==null?void 0:l.type}}catch{return}}var ce=t(65524),Q=t(8709),Y=t(75435),q=t(51194),pe=t(60905),je=t(7089),ke=t(28865),Le=t(60251),Ce=t(9791);const Te=(0,x.Z)(e=>({markdown:{"& table":{borderCollapse:"collapse",border:`1px solid ${e.palette.border}`},"& th, & td":{border:`1px solid ${e.palette.border}`,padding:e.spacing(1)},"& td":{wordBreak:"break-word",overflow:"hidden",verticalAlign:"middle",lineHeight:"1",margin:0,padding:e.spacing(3,2,3,2.5),borderBottom:0},"& th":{backgroundColor:e.palette.background.paper},"& tr":{backgroundColor:e.palette.background.paper},"& tr:nth-child(odd)":{backgroundColor:e.palette.background.default},"& a":{color:e.palette.link},"& img":{maxWidth:"100%"}}}),{name:"BackstageMarkdownContent"}),me=(e,a)=>a?typeof a=="string"?e+a:c.Children.toArray(a.props.children).reduce(me,e):e,Z=({level:e,children:a})=>{const r=c.Children.toArray(a).reduce(me,"").toLocaleLowerCase("en-US").replace(/\W/g,"-");return c.createElement(`h${e}`,{id:r},a)},Ae={code:({inline:e,className:a,children:o,...s})=>{const r=String(o).replace(/\n+$/,""),l=/language-(\w+)/.exec(a||"");return!e&&l?(0,n.jsx)(Ce.O,{language:l[1],text:r}):(0,n.jsx)("code",{className:a,...s,children:o})},h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z};function Ee(e){const{content:a,dialect:o="gfm",linkTarget:s,transformLinkUri:r,transformImageUri:l,className:d}=e,p=Te();return(0,n.jsx)(ke.D,{remarkPlugins:o==="gfm"?[Le.Z]:[],className:`${p.markdown} ${d}`,children:a,components:Ae,linkTarget:s,transformLinkUri:r,transformImageUri:l})}var Se=t(2532);const we=(0,x.Z)(e=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function L(e){const{label:a,value:o,gridSizes:s,children:r}=e,l=we(),d=(0,Se.v)(r,y=>y.getElements()),p=d.length>0?d:(0,n.jsx)(u.Z,{variant:"body2",className:l.value,children:o||"unknown"});return(0,n.jsxs)(pe.Z,{item:!0,...s,children:[(0,n.jsx)(u.Z,{variant:"h2",className:l.label,children:a}),p]})}var Ie=t(24851);const Oe=(0,x.Z)({description:{wordBreak:"break-word"}});function $e(e,a,o){if(a==="url"||e.includes("://"))return e;const s=o.type==="file"?`file://${o.target}`:o.target;return a==="file"||o.type==="file"?new URL(e,s).href:s}function he(e){var a,o,s,r,l,d,p,y;const{entity:i}=e,ie=Oe(),_=i.kind.toLocaleLowerCase("en-US")==="system",K=i.kind.toLocaleLowerCase("en-US")==="resource",I=i.kind.toLocaleLowerCase("en-US")==="component",E=i.kind.toLocaleLowerCase("en-US")==="api",W=i.kind.toLocaleLowerCase("en-US")==="template",C=i.kind.toLocaleLowerCase("en-US")==="location",N=i.kind.toLocaleLowerCase("en-US")==="group",T=(0,Y.h)(i,Q.cz,{kind:"system"}),D=(0,Y.h)(i,Q.cz,{kind:"component"}),F=(0,Y.h)(i,Q.cz,{kind:"domain"}),ee=(0,Y.h)(i,Q.S4);let M;try{M=(0,de.CV)(i)}catch{M=void 0}return(0,n.jsxs)(pe.Z,{container:!0,children:[(0,n.jsx)(L,{label:"Description",gridSizes:{xs:12},children:(0,n.jsx)(Ee,{className:ie.description,content:(i==null||(a=i.metadata)===null||a===void 0?void 0:a.description)||"No description"})}),(0,n.jsx)(L,{label:"Owner",value:"No Owner",gridSizes:{xs:12,sm:6,lg:4},children:ee.length>0&&(0,n.jsx)(q.r,{entityRefs:ee,defaultKind:"group"})}),(_||F.length>0)&&(0,n.jsx)(L,{label:"Domain",value:"No Domain",gridSizes:{xs:12,sm:6,lg:4},children:F.length>0&&(0,n.jsx)(q.r,{entityRefs:F,defaultKind:"domain"})}),(E||I||K||T.length>0)&&(0,n.jsx)(L,{label:"System",value:"No System",gridSizes:{xs:12,sm:6,lg:4},children:T.length>0&&(0,n.jsx)(q.r,{entityRefs:T,defaultKind:"system"})}),I&&D.length>0&&(0,n.jsx)(L,{label:"Parent Component",value:"No Parent Component",gridSizes:{xs:12,sm:6,lg:4},children:(0,n.jsx)(q.r,{entityRefs:D,defaultKind:"component"})}),(E||I||K||W||N||C||typeof(i==null||(o=i.spec)===null||o===void 0?void 0:o.type)=="string")&&(0,n.jsx)(L,{label:"Type",value:i==null||(s=i.spec)===null||s===void 0?void 0:s.type,gridSizes:{xs:12,sm:6,lg:4}}),(E||I||typeof(i==null||(r=i.spec)===null||r===void 0?void 0:r.lifecycle)=="string")&&(0,n.jsx)(L,{label:"Lifecycle",value:i==null||(l=i.spec)===null||l===void 0?void 0:l.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,n.jsx)(L,{label:"Tags",value:"No Tags",gridSizes:{xs:12,sm:6,lg:4},children:((i==null||(d=i.metadata)===null||d===void 0?void 0:d.tags)||[]).map(g=>(0,n.jsx)(je.Z,{size:"small",label:g},g))}),C&&((i==null||(p=i.spec)===null||p===void 0?void 0:p.targets)||(i==null||(y=i.spec)===null||y===void 0?void 0:y.target))&&(0,n.jsx)(L,{label:"Targets",gridSizes:{xs:12},children:(0,n.jsx)(Ie.s,{cols:1,items:(i.spec.targets||[i.spec.target]).map(g=>g).map(g=>{var O;return{text:g,href:$e(g,(i==null||(O=i.spec)===null||O===void 0?void 0:O.type)||"unknown",M)}})})})]})}var Ue=t(52866),Re=t(88188),Pe=t(30254),Ze=t(27604),Ne=t(27991),De=t.n(Ne),Me=JSON.parse(`{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that's common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}`),Ve=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),ze=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),Be=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');const ue=new Map,He=[Ve,Me,ze,Be];function Ge(e){if(!(e!=null&&e.length))throw new TypeError("Unknown error");const a=e[0];throw new TypeError(`${a.instancePath||"<root>"} ${a.message}${a.params?` - ${Object.entries(a.params).map(([o,s])=>`${o}: ${s}`).join(", ")}`:""}`)}function Ke(e,a={}){var o;const s=(o=a==null?void 0:a.disableCache)!==null&&o!==void 0?o:!1,r=s?"":JSON.stringify(e);if(!s){const y=ue.get(r);if(y)return y}const l=We(e),d=new(De())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});l.length&&d.addSchema(l,void 0,void 0,!0);const p=d.compile(e);return s||ue.set(r,p),p}function We(e){if(typeof e!="object")return[];const a=new Set;e.$id&&a.add(e.$id);const o=new Array,s=[e];for(;s.length;){const r=s.pop();for(const l of Fe(r))if(!a.has(l)){a.add(l);const d=He.find(p=>p.$id===l);d&&(o.push(d),s.push(d))}}return o}function*Fe(e){const a=[e];for(;a.length;){const o=a.pop();if(typeof o=="object"&&o)for(const[s,r]of Object.entries(o))s==="$ref"&&typeof r=="string"?yield r.split("#")[0]:a.push(r)}}function Je(e){const a=Ke(e);return o=>{var s;if(a(o)===!0)return o;const l=(s=a.errors)===null||s===void 0?void 0:s.filter(d=>["/kind","/apiVersion"].includes(d.instancePath));if(l!=null&&l.length&&l.every(d=>d.keyword==="enum"))return!1;throw Ge(a.errors)}}var Xe=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","type":"website","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}');const Qe=Je(Xe),at={async check(e){return Qe(e)===e}},Ye=e=>e.apiVersion==="scaffolder.backstage.io/v1beta3"&&e.kind==="Template",qe="backstage.io/techdocs-ref",ne="backstage.io/techdocs-entity",_e=(0,x.Z)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function et(e){var a,o,s,r,l;const{variant:d}=e,p=(0,re.q)(),y=_e(),{entity:i}=(0,ve.X2)(),ie=(0,X.h_)(G.q),_=(0,X.h_)(be.A),K=(0,X.h_)(fe.$),I=(0,X.h_)(ge.V),E=(0,le.t)(ce.jU),W=(0,le.t)(ce.ql),C=xe(i,ie),N=(a=i.metadata.annotations)===null||a===void 0?void 0:a[A.Tf];let T;if(!((o=i.metadata.annotations)===null||o===void 0)&&o[ne])try{var D;T=(0,R.of)((D=i.metadata.annotations)===null||D===void 0?void 0:D[ne])}catch{T=void 0}const F={label:"View Source",disabled:!C,icon:(0,n.jsx)(ye,{type:C==null?void 0:C.integrationType}),href:C==null?void 0:C.locationTargetUrl},ee={label:"View TechDocs",disabled:!(!((s=i.metadata.annotations)===null||s===void 0)&&s[qe]||!((r=i.metadata.annotations)===null||r===void 0)&&r[ne])||!E,icon:(0,n.jsx)(Pe.Z,{}),href:E&&E(T?{namespace:T.namespace||A.zG,kind:T.kind,name:T.name}:{namespace:i.metadata.namespace||A.zG,kind:i.kind,name:i.metadata.name})},M=[F,ee];if(Ye(i)){var g;const oe=(g=p.getSystemIcon("scaffolder"))!==null&&g!==void 0?g:Re.Z,it={label:"Launch Template",icon:(0,n.jsx)(oe,{}),disabled:!W,href:W&&W({templateName:i.metadata.name,namespace:i.metadata.namespace||A.zG})};M.push(it)}let O="";d==="gridItem"?O=y.gridItemCard:d==="fullHeight"&&(O=y.fullHeightCard);let ae="";d==="gridItem"?ae=y.gridItemCardContent:d==="fullHeight"&&(ae=y.fullHeightCardContent);const V=(l=i.metadata.annotations)===null||l===void 0?void 0:l[U.P1],tt=(V==null?void 0:V.startsWith("url:"))||(V==null?void 0:V.startsWith("file:")),nt=(0,c.useCallback)(async()=>{try{await _.refreshEntity((0,R.eE)(i)),K.post({message:"Refresh scheduled",severity:"info",display:"transient"})}catch(oe){I.post(oe)}},[_,K,I,i]);return(0,n.jsxs)(P.Z,{className:O,children:[(0,n.jsx)(z.Z,{title:"About",action:(0,n.jsxs)(n.Fragment,{children:[tt&&(0,n.jsx)(S.Z,{"aria-label":"Refresh",title:"Schedule entity refresh",onClick:nt,children:(0,n.jsx)(Ue.Z,{})}),(0,n.jsx)(S.Z,{component:H.rU,"aria-label":"Edit",disabled:!N,title:"Edit Metadata",to:N!=null?N:"#",children:(0,n.jsx)(Ze.Z,{})})]}),subheader:(0,n.jsx)(m,{links:M})}),(0,n.jsx)(J.Z,{}),(0,n.jsx)(B.Z,{className:ae,children:(0,n.jsx)(he,{entity:i})})]})}},24851:function(se,$,t){t.d($,{s:function(){return w}});var n=t(52322),A=t(90348),U=t(11861),R=t(2784),x=t(79692),P=t(62774),z=t(90436),S=t(52160),J=t(98864);const B=(0,x.Z)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function H(h){const{href:u,text:v,Icon:k}=h,b=B();return(0,n.jsxs)(P.Z,{display:"flex",children:[(0,n.jsx)(P.Z,{mr:1,className:b.svgIcon,children:(0,n.jsx)(z.Z,{component:"div",children:k?(0,n.jsx)(k,{}):(0,n.jsx)(S.Z,{})})}),(0,n.jsx)(P.Z,{flexGrow:"1",children:(0,n.jsx)(J.rU,{to:u,target:"_blank",rel:"noopener",children:v||u})})]})}var c=t(41156);const f={xs:1,sm:1,md:1,lg:2,xl:3};function j(h){const u=[(0,c.Z)(m=>m.breakpoints.up("xl"))?"xl":null,(0,c.Z)(m=>m.breakpoints.up("lg"))?"lg":null,(0,c.Z)(m=>m.breakpoints.up("md"))?"md":null,(0,c.Z)(m=>m.breakpoints.up("sm"))?"sm":null,(0,c.Z)(m=>m.breakpoints.up("xs"))?"xs":null];let v=1;if(typeof h=="number")v=h;else{var k;const m=(k=u.find(G=>G!==null))!==null&&k!==void 0?k:"xs";var b;v=(b=h==null?void 0:h[m])!==null&&b!==void 0?b:f[m]}return v}function w(h){const{items:u,cols:v=void 0}=h,k=j(v);return(0,n.jsx)(A.Z,{rowHeight:"auto",cols:k,children:u.map(({text:b,href:m,Icon:G},te)=>(0,n.jsx)(U.Z,{children:(0,n.jsx)(H,{href:m,text:b!=null?b:m,Icon:G})},te))})}}}]);})();
2
-
3
- //# sourceMappingURL=7893.e406114c.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/7893.e406114c.chunk.js","mappings":"kRAmCA,MAAMA,KAAmBC,EAAAA,IACvB,gBAAgB,EAqBLC,EAAuBC,GAAAA,CAClC,KAAM,CAAEC,SAAAA,EAAUC,OAAAA,EAAQC,QAAAA,EAASC,MAAAA,EAAOC,QAAAA,CAAQ,EAAIL,EAChDM,EAAQ,CAAEJ,OAAAA,EAAQC,QAAAA,EAASC,MAAAA,EAAOC,QAAAA,CAAQ,EAGhD,SACE,OAACR,EAAiBU,SAAQ,CAACD,SAAOE,EAAAA,GAAwB,CAAE,EAAGF,CAAM,CAAC,E,YACpE,OAACG,EAAAA,GAAgBA,CACfC,WAAY,CACV,GAAIR,EAAS,CAAES,aAAWC,EAAAA,IAAmBV,CAAM,CAAE,EAAIW,MAC3D,E,SAECZ,C,IAIT,EAiBaa,EAAkBd,GAC7B,KAACD,EAAAA,CACCG,OAAQF,EAAME,OACdC,QAAS,CAACY,QAAQf,EAAME,MAAM,EAC9BE,MAAOS,OACPR,QAASQ,OACTZ,SAAUD,EAAMC,Q,GAUb,SAASe,GAAAA,CAGd,MAAMC,KAAkBC,EAAAA,IACtB,gBAAgB,EAGlB,GAAI,CAACD,EACH,MAAM,IAAIE,MAAM,iCAAiC,E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,CAAI,EAExC,SACE,OAAC8I,EAAAA,EAASA,CAACC,UAAU,OAAO/I,KAAM2I,E,SAC/B1I,EAAMxH,IAAI,CAAC,CAAEnC,KAAAA,EAAMa,KAAAA,EAAM8B,KAAAA,CAAK,EAAG+P,QAChC,OAACC,EAAAA,EAAaA,C,YACZ,OAACnB,EAAQA,CAAC3Q,KAAMA,EAAMb,KAAMA,GAAAA,KAAAA,EAAQa,EAAM8B,KAAMA,C,IAD9B+P,EAAC,CAADA,C,EAM5B,C","sources":["webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntity.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/HeaderIconLinkRow/IconLinkVertical.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/HeaderIconLinkRow/HeaderIconLinkRow.tsx","webpack://techdocs-cli-embedded-app/../integration-react/src/components/ScmIntegrationIcon/ScmIntegrationIcon.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/utils/getEntitySourceLocation.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/MarkdownContent/MarkdownContent.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/AboutCard/AboutField.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/AboutCard/AboutContent.tsx","webpack://techdocs-cli-embedded-app/../catalog-model/src/validation/ajv.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/validation/entityKindSchemaValidator.ts","webpack://techdocs-cli-embedded-app/../../plugins/scaffolder-common/src/TemplateEntityV1beta3.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/AboutCard/AboutCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/IconLink.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/useDynamicColumns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLinksCard/LinksGridList.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { AnalyticsContext } from '@backstage/core-plugin-api';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport React, { ReactNode } from 'react';\n\n/** @public */\nexport type EntityLoadingStatus<TEntity extends Entity = Entity> = {\n entity?: TEntity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nconst NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n);\n\n/**\n * Properties for the AsyncEntityProvider component.\n *\n * @public\n */\nexport interface AsyncEntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n}\n\n/**\n * Provides a loaded entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const AsyncEntityProvider = (props: AsyncEntityProviderProps) => {\n const { children, entity, loading, error, refresh } = props;\n const value = { entity, loading, error, refresh };\n // We provide both the old and the new context, since\n // consumers might be doing things like `useContext(EntityContext)`\n return (\n <NewEntityContext.Provider value={createVersionedValueMap({ 1: value })}>\n <AnalyticsContext\n attributes={{\n ...(entity ? { entityRef: stringifyEntityRef(entity) } : undefined),\n }}\n >\n {children}\n </AnalyticsContext>\n </NewEntityContext.Provider>\n );\n};\n\n/**\n * Properties for the EntityProvider component.\n *\n * @public\n */\nexport interface EntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n}\n\n/**\n * Provides an entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const EntityProvider = (props: EntityProviderProps) => (\n <AsyncEntityProvider\n entity={props.entity}\n loading={!Boolean(props.entity)}\n error={undefined}\n refresh={undefined}\n children={props.children}\n />\n);\n\n/**\n * Grab the current entity from the context, throws if the entity has not yet been loaded\n * or is not available.\n *\n * @public\n */\nexport function useEntity<TEntity extends Entity = Entity>(): {\n entity: TEntity;\n} {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n if (!value.entity) {\n throw new Error(\n 'useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.',\n );\n }\n\n return { entity: value.entity as TEntity };\n}\n\n/**\n * Grab the current entity from the context, provides loading state and errors, and the ability to refresh.\n *\n * @public\n */\nexport function useAsyncEntity<\n TEntity extends Entity = Entity,\n>(): EntityLoadingStatus<TEntity> {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n const { entity, loading, error, refresh } = value;\n return { entity: entity as TEntity, loading, error, refresh };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport classnames from 'classnames';\nimport { makeStyles } from '@material-ui/core/styles';\nimport LinkIcon from '@material-ui/icons/Link';\nimport { Link } from '../Link';\nimport Box from '@material-ui/core/Box';\nimport Typography from '@material-ui/core/Typography';\n\nexport type IconLinkVerticalProps = {\n color?: 'primary' | 'secondary';\n disabled?: boolean;\n href?: string;\n icon?: React.ReactNode;\n label: string;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n title?: string;\n};\n\n/** @public */\nexport type IconLinkVerticalClassKey =\n | 'link'\n | 'disabled'\n | 'primary'\n | 'secondary'\n | 'label';\n\nconst useIconStyles = makeStyles(\n theme => ({\n link: {\n display: 'grid',\n justifyItems: 'center',\n gridGap: 4,\n textAlign: 'center',\n },\n disabled: {\n color: theme.palette.text.secondary,\n cursor: 'default',\n },\n primary: {\n color: theme.palette.primary.main,\n },\n secondary: {\n color: theme.palette.secondary.main,\n },\n label: {\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n letterSpacing: 1.2,\n },\n }),\n { name: 'BackstageIconLinkVertical' },\n);\n\n/** @public */\nexport function IconLinkVertical({\n color = 'primary',\n disabled = false,\n href = '#',\n icon = <LinkIcon />,\n label,\n onClick,\n title,\n}: IconLinkVerticalProps) {\n const classes = useIconStyles();\n\n if (disabled) {\n return (\n <Box title={title} className={classnames(classes.link, classes.disabled)}>\n {icon}\n <Typography\n variant=\"caption\"\n component=\"span\"\n className={classes.label}\n >\n {label}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Link\n title={title}\n className={classnames(classes.link, classes[color])}\n to={href}\n onClick={onClick}\n >\n {icon}\n <Typography variant=\"caption\" component=\"span\" className={classes.label}>\n {label}\n </Typography>\n </Link>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { makeStyles } from '@material-ui/core/styles';\nimport React from 'react';\nimport { IconLinkVertical, IconLinkVerticalProps } from './IconLinkVertical';\n\n/** @public */\nexport type HeaderIconLinkRowClassKey = 'links';\n\nconst useStyles = makeStyles(\n theme => ({\n links: {\n margin: theme.spacing(2, 0),\n display: 'grid',\n gridAutoFlow: 'column',\n gridAutoColumns: 'min-content',\n gridGap: theme.spacing(3),\n },\n }),\n { name: 'BackstageHeaderIconLinkRow' },\n);\n\ntype Props = {\n links: IconLinkVerticalProps[];\n};\n\n/**\n * HTML nav tag with links mapped inside\n *\n * @public\n *\n */\nexport function HeaderIconLinkRow(props: Props) {\n const { links } = props;\n const classes = useStyles();\n return (\n <nav className={classes.links}>\n {links.map((link, index) => (\n <IconLinkVertical key={index + 1} {...link} />\n ))}\n </nav>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport CodeIcon from '@material-ui/icons/Code';\nimport React from 'react';\nimport { useApp } from '@backstage/core-plugin-api';\n\n/**\n * Props for {@link ScmIntegrationIcon}.\n *\n * @public\n */\nexport type ScmIntegrationIconProps = {\n /**\n * The integration type, e.g. \"github\".\n */\n type?: string;\n};\n\n/**\n * An icon that represents a certain SCM integration.\n *\n * @public\n */\nexport const ScmIntegrationIcon = (props: ScmIntegrationIconProps) => {\n const { type } = props;\n const app = useApp();\n const DefaultIcon = CodeIcon;\n const Icon = type ? app.getSystemIcon(type) ?? DefaultIcon : DefaultIcon;\n return <Icon />;\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ANNOTATION_SOURCE_LOCATION,\n Entity,\n parseLocationRef,\n} from '@backstage/catalog-model';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\n\n/** @public */\nexport type EntitySourceLocation = {\n locationTargetUrl: string;\n integrationType?: string;\n};\n\n/** @public */\nexport function getEntitySourceLocation(\n entity: Entity,\n scmIntegrationsApi: ScmIntegrationRegistry,\n): EntitySourceLocation | undefined {\n const sourceLocation =\n entity.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION];\n\n if (!sourceLocation) {\n return undefined;\n }\n\n try {\n const sourceLocationRef = parseLocationRef(sourceLocation);\n const integration = scmIntegrationsApi.byUrl(sourceLocationRef.target);\n return {\n locationTargetUrl: sourceLocationRef.target,\n integrationType: integration?.type,\n };\n } catch {\n return undefined;\n }\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport ReactMarkdown, { Options } from 'react-markdown';\nimport gfm from 'remark-gfm';\nimport React from 'react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { CodeSnippet } from '../CodeSnippet';\nimport { HeadingProps } from 'react-markdown/lib/ast-to-react';\n\nexport type MarkdownContentClassKey = 'markdown';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n markdown: {\n '& table': {\n borderCollapse: 'collapse',\n border: `1px solid ${theme.palette.border}`,\n },\n '& th, & td': {\n border: `1px solid ${theme.palette.border}`,\n padding: theme.spacing(1),\n },\n '& td': {\n wordBreak: 'break-word',\n overflow: 'hidden',\n verticalAlign: 'middle',\n lineHeight: '1',\n margin: 0,\n padding: theme.spacing(3, 2, 3, 2.5),\n borderBottom: 0,\n },\n '& th': {\n backgroundColor: theme.palette.background.paper,\n },\n '& tr': {\n backgroundColor: theme.palette.background.paper,\n },\n '& tr:nth-child(odd)': {\n backgroundColor: theme.palette.background.default,\n },\n\n '& a': {\n color: theme.palette.link,\n },\n '& img': {\n maxWidth: '100%',\n },\n },\n }),\n { name: 'BackstageMarkdownContent' },\n);\n\ntype Props = {\n content: string;\n dialect?: 'gfm' | 'common-mark';\n linkTarget?: Options['linkTarget'];\n transformLinkUri?: (href: string) => string;\n transformImageUri?: (href: string) => string;\n className?: string;\n};\n\nconst flatten = (text: string, child: any): string => {\n if (!child) return text;\n\n return typeof child === 'string'\n ? text + child\n : React.Children.toArray(child.props.children).reduce(flatten, text);\n};\n\nconst headingRenderer = ({ level, children }: HeadingProps) => {\n const childrenArray = React.Children.toArray(children);\n const text = childrenArray.reduce(flatten, '');\n const slug = text.toLocaleLowerCase('en-US').replace(/\\W/g, '-');\n return React.createElement(`h${level}`, { id: slug }, children);\n};\n\nconst components: Options['components'] = {\n code: ({ inline, className, children, ...props }) => {\n const text = String(children).replace(/\\n+$/, '');\n const match = /language-(\\w+)/.exec(className || '');\n return !inline && match ? (\n <CodeSnippet language={match[1]} text={text} />\n ) : (\n <code className={className} {...props}>\n {children}\n </code>\n );\n },\n h1: headingRenderer,\n h2: headingRenderer,\n h3: headingRenderer,\n h4: headingRenderer,\n h5: headingRenderer,\n h6: headingRenderer,\n};\n\n/**\n * Renders markdown with the default dialect {@link https://github.github.com/gfm/ | gfm - GitHub flavored Markdown} to backstage theme styled HTML.\n *\n * @remarks\n * If you just want to render to plain {@link https://commonmark.org/ | CommonMark}, set the dialect to `'common-mark'`\n */\nexport function MarkdownContent(props: Props) {\n const {\n content,\n dialect = 'gfm',\n linkTarget,\n transformLinkUri,\n transformImageUri,\n className,\n } = props;\n const classes = useStyles();\n return (\n <ReactMarkdown\n remarkPlugins={dialect === 'gfm' ? [gfm] : []}\n className={`${classes.markdown} ${className}`}\n children={content}\n components={components}\n linkTarget={linkTarget}\n transformLinkUri={transformLinkUri}\n transformImageUri={transformImageUri}\n />\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useElementFilter } from '@backstage/core-plugin-api';\nimport { Grid, makeStyles, Typography } from '@material-ui/core';\nimport React from 'react';\n\nconst useStyles = makeStyles(theme => ({\n value: {\n fontWeight: 'bold',\n overflow: 'hidden',\n lineHeight: '24px',\n wordBreak: 'break-word',\n },\n label: {\n color: theme.palette.text.secondary,\n textTransform: 'uppercase',\n fontSize: '10px',\n fontWeight: 'bold',\n letterSpacing: 0.5,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n },\n}));\n\n/**\n * Props for {@link AboutField}.\n *\n * @public\n */\nexport interface AboutFieldProps {\n label: string;\n value?: string;\n gridSizes?: Record<string, number>;\n children?: React.ReactNode;\n}\n\n/** @public */\nexport function AboutField(props: AboutFieldProps) {\n const { label, value, gridSizes, children } = props;\n const classes = useStyles();\n\n const childElements = useElementFilter(children, c => c.getElements());\n\n // Content is either children or a string prop `value`\n const content =\n childElements.length > 0 ? (\n childElements\n ) : (\n <Typography variant=\"body2\" className={classes.value}>\n {value || `unknown`}\n </Typography>\n );\n return (\n <Grid item {...gridSizes}>\n <Typography variant=\"h2\" className={classes.label}>\n {label}\n </Typography>\n {content}\n </Grid>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n getEntitySourceLocation,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { JsonArray } from '@backstage/types';\nimport { Chip, Grid, makeStyles } from '@material-ui/core';\nimport { MarkdownContent } from '@backstage/core-components';\nimport React from 'react';\nimport { AboutField } from './AboutField';\nimport { LinksGridList } from '../EntityLinksCard/LinksGridList';\n\nconst useStyles = makeStyles({\n description: {\n wordBreak: 'break-word',\n },\n});\n\n/**\n * Props for {@link AboutContent}.\n *\n * @public\n */\nexport interface AboutContentProps {\n entity: Entity;\n}\n\nfunction getLocationTargetHref(\n target: string,\n type: string,\n entitySourceLocation: {\n type: string;\n target: string;\n },\n): string {\n if (type === 'url' || target.includes('://')) {\n return target;\n }\n\n const srcLocationUrl =\n entitySourceLocation.type === 'file'\n ? `file://${entitySourceLocation.target}`\n : entitySourceLocation.target;\n\n if (type === 'file' || entitySourceLocation.type === 'file') {\n return new URL(target, srcLocationUrl).href;\n }\n\n return srcLocationUrl;\n}\n\n/** @public */\nexport function AboutContent(props: AboutContentProps) {\n const { entity } = props;\n const classes = useStyles();\n const isSystem = entity.kind.toLocaleLowerCase('en-US') === 'system';\n const isResource = entity.kind.toLocaleLowerCase('en-US') === 'resource';\n const isComponent = entity.kind.toLocaleLowerCase('en-US') === 'component';\n const isAPI = entity.kind.toLocaleLowerCase('en-US') === 'api';\n const isTemplate = entity.kind.toLocaleLowerCase('en-US') === 'template';\n const isLocation = entity.kind.toLocaleLowerCase('en-US') === 'location';\n const isGroup = entity.kind.toLocaleLowerCase('en-US') === 'group';\n\n const partOfSystemRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'system',\n });\n const partOfComponentRelations = getEntityRelations(\n entity,\n RELATION_PART_OF,\n {\n kind: 'component',\n },\n );\n const partOfDomainRelations = getEntityRelations(entity, RELATION_PART_OF, {\n kind: 'domain',\n });\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n\n let entitySourceLocation:\n | {\n type: string;\n target: string;\n }\n | undefined;\n try {\n entitySourceLocation = getEntitySourceLocation(entity);\n } catch (e) {\n entitySourceLocation = undefined;\n }\n\n return (\n <Grid container>\n <AboutField label=\"Description\" gridSizes={{ xs: 12 }}>\n <MarkdownContent\n className={classes.description}\n content={entity?.metadata?.description || 'No description'}\n />\n </AboutField>\n <AboutField\n label=\"Owner\"\n value=\"No Owner\"\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n >\n {ownedByRelations.length > 0 && (\n <EntityRefLinks entityRefs={ownedByRelations} defaultKind=\"group\" />\n )}\n </AboutField>\n {(isSystem || partOfDomainRelations.length > 0) && (\n <AboutField\n label=\"Domain\"\n value=\"No Domain\"\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n >\n {partOfDomainRelations.length > 0 && (\n <EntityRefLinks\n entityRefs={partOfDomainRelations}\n defaultKind=\"domain\"\n />\n )}\n </AboutField>\n )}\n {(isAPI ||\n isComponent ||\n isResource ||\n partOfSystemRelations.length > 0) && (\n <AboutField\n label=\"System\"\n value=\"No System\"\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n >\n {partOfSystemRelations.length > 0 && (\n <EntityRefLinks\n entityRefs={partOfSystemRelations}\n defaultKind=\"system\"\n />\n )}\n </AboutField>\n )}\n {isComponent && partOfComponentRelations.length > 0 && (\n <AboutField\n label=\"Parent Component\"\n value=\"No Parent Component\"\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n >\n <EntityRefLinks\n entityRefs={partOfComponentRelations}\n defaultKind=\"component\"\n />\n </AboutField>\n )}\n {(isAPI ||\n isComponent ||\n isResource ||\n isTemplate ||\n isGroup ||\n isLocation ||\n typeof entity?.spec?.type === 'string') && (\n <AboutField\n label=\"Type\"\n value={entity?.spec?.type as string}\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n />\n )}\n {(isAPI ||\n isComponent ||\n typeof entity?.spec?.lifecycle === 'string') && (\n <AboutField\n label=\"Lifecycle\"\n value={entity?.spec?.lifecycle as string}\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n />\n )}\n <AboutField\n label=\"Tags\"\n value=\"No Tags\"\n gridSizes={{ xs: 12, sm: 6, lg: 4 }}\n >\n {(entity?.metadata?.tags || []).map(t => (\n <Chip key={t} size=\"small\" label={t} />\n ))}\n </AboutField>\n {isLocation && (entity?.spec?.targets || entity?.spec?.target) && (\n <AboutField label=\"Targets\" gridSizes={{ xs: 12 }}>\n <LinksGridList\n cols={1}\n items={((entity.spec.targets as JsonArray) || [entity.spec.target])\n .map(target => target as string)\n .map(target => ({\n text: target,\n href: getLocationTargetHref(\n target,\n (entity?.spec?.type || 'unknown') as string,\n entitySourceLocation!,\n ),\n }))}\n />\n </AboutField>\n )}\n </Grid>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Ajv, { Schema, ValidateFunction } from 'ajv';\nimport entitySchema from '../schema/Entity.schema.json';\nimport entityEnvelopeSchema from '../schema/EntityEnvelope.schema.json';\nimport entityMetaSchema from '../schema/EntityMeta.schema.json';\nimport commonSchema from '../schema/shared/common.schema.json';\n\n// A local cache of compiled schemas, to avoid duplicate work.\n// The keys are JSON stringified versions of the schema\nconst compiledSchemaCache = new Map<string, ValidateFunction<unknown>>();\n\n// The core schemas that others can depend on\nconst refDependencyCandidates = [\n entityEnvelopeSchema,\n entitySchema,\n entityMetaSchema,\n commonSchema,\n];\n\nexport function throwAjvError(\n errors: ValidateFunction<unknown>['errors'],\n): never {\n if (!errors?.length) {\n throw new TypeError('Unknown error');\n }\n\n const error = errors[0];\n throw new TypeError(\n `${error.instancePath || '<root>'} ${error.message}${\n error.params\n ? ` - ${Object.entries(error.params)\n .map(([key, val]) => `${key}: ${val}`)\n .join(', ')}`\n : ''\n }`,\n );\n}\n\n// Compiles the given schema, and makes sure to also grab any core dependencies\n// that it depends on\nexport function compileAjvSchema(\n schema: Schema,\n options: { disableCache?: boolean } = {},\n): ValidateFunction<unknown> {\n const disableCache = options?.disableCache ?? false;\n const cacheKey = disableCache ? '' : JSON.stringify(schema);\n\n if (!disableCache) {\n const cached = compiledSchemaCache.get(cacheKey);\n if (cached) {\n return cached;\n }\n }\n\n const extraSchemas = getExtraSchemas(schema);\n const ajv = new Ajv({\n allowUnionTypes: true,\n allErrors: true,\n validateSchema: true,\n });\n if (extraSchemas.length) {\n ajv.addSchema(extraSchemas, undefined, undefined, true);\n }\n const compiled = ajv.compile(schema);\n\n if (!disableCache) {\n compiledSchemaCache.set(cacheKey, compiled);\n }\n\n return compiled;\n}\n\n// Find refs in the given schema and recursively in all known schemas it\n// targets, collecting that list of schemas as we go\nfunction getExtraSchemas(schema: Schema): Schema[] {\n if (typeof schema !== 'object') {\n return [];\n }\n\n const seen = new Set<string>();\n if (schema.$id) {\n seen.add(schema.$id);\n }\n\n const selected = new Array<Schema>();\n\n const todo: Schema[] = [schema];\n while (todo.length) {\n const current = todo.pop()!;\n\n for (const ref of getAllRefs(current)) {\n if (!seen.has(ref)) {\n seen.add(ref);\n\n const match = refDependencyCandidates.find(c => c.$id === ref);\n if (match) {\n selected.push(match);\n todo.push(match);\n }\n }\n }\n }\n\n return selected;\n}\n\n// Naively step through the entire schema looking for \"$ref\": \"x\" pairs. The\n// resulting iterator may contain duplicates. Ignores fragments, i.e. for a ref\n// of \"a#b\", it will just yield \"a\".\nfunction* getAllRefs(schema: Schema): Iterable<string> {\n const todo: any[] = [schema];\n while (todo.length) {\n const current = todo.pop()!;\n if (typeof current === 'object' && current) {\n for (const [key, value] of Object.entries(current)) {\n if (key === '$ref' && typeof value === 'string') {\n yield value.split('#')[0];\n } else {\n todo.push(value);\n }\n }\n }\n }\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Schema } from 'ajv';\nimport { Entity } from '../entity';\nimport { compileAjvSchema, throwAjvError } from './ajv';\n\n/**\n * Creates a validation function that takes some arbitrary data, and either\n * returns that data cast to a `T` if it matches that schema, or `false` if the\n * schema apiVersion/kind didn't apply to that data, or throws a\n * {@link globals#TypeError} describing actual errors.\n *\n * @remarks\n *\n * This validator is highly specialized, in that it has special treatment of\n * the `kind` and `apiVersion` root keys. This only works if your schema has\n * their rule set to `\"enum\"`:\n *\n * ```\n * \"apiVersion\": {\n * \"enum\": [\"backstage.io/v1alpha1\", \"backstage.io/v1beta1\"]\n * },\n * \"kind\": {\n * \"enum\": [\"Group\"]\n * },\n * ```\n *\n * In the above example, the created validator will return `false` if and only\n * if the kind and/or apiVersion mismatch.\n *\n * Note that this validator is only meant for applying the base schema checks;\n * it does not take custom policies or additional processor based validation\n * into account.\n *\n * The given schema may contain `$ref` references to the following, which are\n * resolved automatically for you:\n *\n * - {@link Entity}\n *\n * - {@link EntityEnvelope}\n *\n * - {@link EntityMeta}\n *\n * - `common#<id>`\n * @see {@link https://github.com/backstage/backstage/tree/master/packages/catalog-model/src/schema}\n *\n * @public\n */\nexport function entityKindSchemaValidator<T extends Entity>(\n schema: unknown,\n): (data: unknown) => T | false {\n const validate = compileAjvSchema(schema as Schema);\n\n return data => {\n const result = validate(data);\n if (result === true) {\n return data as T;\n }\n\n // Only in the case where kind and/or apiVersion have enum mismatches AND\n // have NO other errors, we call it a soft error.\n const softCandidates = validate.errors?.filter(e =>\n ['/kind', '/apiVersion'].includes(e.instancePath),\n );\n if (\n softCandidates?.length &&\n softCandidates.every(e => e.keyword === 'enum')\n ) {\n return false;\n }\n\n throw throwAjvError(validate.errors);\n };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ANNOTATION_EDIT_URL,\n ANNOTATION_LOCATION,\n CompoundEntityRef,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n Card,\n CardContent,\n CardHeader,\n Divider,\n IconButton,\n makeStyles,\n} from '@material-ui/core';\nimport {\n HeaderIconLinkRow,\n IconLinkVerticalProps,\n InfoCardVariants,\n Link,\n} from '@backstage/core-components';\nimport React, { useCallback } from 'react';\nimport {\n ScmIntegrationIcon,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport {\n alertApiRef,\n errorApiRef,\n useApi,\n useApp,\n useRouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n getEntitySourceLocation,\n useEntity,\n} from '@backstage/plugin-catalog-react';\nimport { createFromTemplateRouteRef, viewTechDocRouteRef } from '../../routes';\n\nimport { AboutContent } from './AboutContent';\nimport CachedIcon from '@material-ui/icons/Cached';\nimport CreateComponentIcon from '@material-ui/icons/AddCircleOutline';\nimport DocsIcon from '@material-ui/icons/Description';\nimport EditIcon from '@material-ui/icons/Edit';\nimport { isTemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport { parseEntityRef } from '@backstage/catalog-model';\n\nconst TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\nconst useStyles = makeStyles({\n gridItemCard: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n },\n fullHeightCard: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItemCardContent: {\n flex: 1,\n },\n fullHeightCardContent: {\n flex: 1,\n },\n});\n\n/**\n * Props for {@link EntityAboutCard}.\n *\n * @public\n */\nexport interface AboutCardProps {\n variant?: InfoCardVariants;\n}\n\n/**\n * Exported publicly via the EntityAboutCard\n */\nexport function AboutCard(props: AboutCardProps) {\n const { variant } = props;\n const app = useApp();\n const classes = useStyles();\n const { entity } = useEntity();\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n const catalogApi = useApi(catalogApiRef);\n const alertApi = useApi(alertApiRef);\n const errorApi = useApi(errorApiRef);\n const viewTechdocLink = useRouteRef(viewTechDocRouteRef);\n const templateRoute = useRouteRef(createFromTemplateRouteRef);\n\n const entitySourceLocation = getEntitySourceLocation(\n entity,\n scmIntegrationsApi,\n );\n const entityMetadataEditUrl =\n entity.metadata.annotations?.[ANNOTATION_EDIT_URL];\n\n let techdocsRef: CompoundEntityRef | undefined;\n\n if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) {\n try {\n techdocsRef = parseEntityRef(\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION],\n );\n // not a fan of this but we don't care if the parseEntityRef fails\n } catch {\n techdocsRef = undefined;\n }\n }\n\n const viewInSource: IconLinkVerticalProps = {\n label: 'View Source',\n disabled: !entitySourceLocation,\n icon: <ScmIntegrationIcon type={entitySourceLocation?.integrationType} />,\n href: entitySourceLocation?.locationTargetUrl,\n };\n const viewInTechDocs: IconLinkVerticalProps = {\n label: 'View TechDocs',\n disabled:\n !(\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]\n ) || !viewTechdocLink,\n icon: <DocsIcon />,\n href:\n viewTechdocLink &&\n (techdocsRef\n ? viewTechdocLink({\n namespace: techdocsRef.namespace || DEFAULT_NAMESPACE,\n kind: techdocsRef.kind,\n name: techdocsRef.name,\n })\n : viewTechdocLink({\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n kind: entity.kind,\n name: entity.metadata.name,\n })),\n };\n\n const subHeaderLinks = [viewInSource, viewInTechDocs];\n\n if (isTemplateEntityV1beta3(entity)) {\n const Icon = app.getSystemIcon('scaffolder') ?? CreateComponentIcon;\n\n const launchTemplate: IconLinkVerticalProps = {\n label: 'Launch Template',\n icon: <Icon />,\n disabled: !templateRoute,\n href:\n templateRoute &&\n templateRoute({\n templateName: entity.metadata.name,\n namespace: entity.metadata.namespace || DEFAULT_NAMESPACE,\n }),\n };\n\n subHeaderLinks.push(launchTemplate);\n }\n\n let cardClass = '';\n if (variant === 'gridItem') {\n cardClass = classes.gridItemCard;\n } else if (variant === 'fullHeight') {\n cardClass = classes.fullHeightCard;\n }\n\n let cardContentClass = '';\n if (variant === 'gridItem') {\n cardContentClass = classes.gridItemCardContent;\n } else if (variant === 'fullHeight') {\n cardContentClass = classes.fullHeightCardContent;\n }\n\n const entityLocation = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n // Limiting the ability to manually refresh to the less expensive locations\n const allowRefresh =\n entityLocation?.startsWith('url:') || entityLocation?.startsWith('file:');\n const refreshEntity = useCallback(async () => {\n try {\n await catalogApi.refreshEntity(stringifyEntityRef(entity));\n alertApi.post({\n message: 'Refresh scheduled',\n severity: 'info',\n display: 'transient',\n });\n } catch (e) {\n errorApi.post(e);\n }\n }, [catalogApi, alertApi, errorApi, entity]);\n\n return (\n <Card className={cardClass}>\n <CardHeader\n title=\"About\"\n action={\n <>\n {allowRefresh && (\n <IconButton\n aria-label=\"Refresh\"\n title=\"Schedule entity refresh\"\n onClick={refreshEntity}\n >\n <CachedIcon />\n </IconButton>\n )}\n <IconButton\n component={Link}\n aria-label=\"Edit\"\n disabled={!entityMetadataEditUrl}\n title=\"Edit Metadata\"\n to={entityMetadataEditUrl ?? '#'}\n >\n <EditIcon />\n </IconButton>\n </>\n }\n subheader={<HeaderIconLinkRow links={subHeaderLinks} />}\n />\n <Divider />\n <CardContent className={cardContentClass}>\n <AboutContent entity={entity} />\n </CardContent>\n </Card>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles, Box, Typography } from '@material-ui/core';\nimport LanguageIcon from '@material-ui/icons/Language';\nimport React from 'react';\nimport { Link } from '@backstage/core-components';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nconst useStyles = makeStyles({\n svgIcon: {\n display: 'inline-block',\n '& svg': {\n display: 'inline-block',\n fontSize: 'inherit',\n verticalAlign: 'baseline',\n },\n },\n});\n\nexport function IconLink(props: {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}) {\n const { href, text, Icon } = props;\n const classes = useStyles();\n\n return (\n <Box display=\"flex\">\n <Box mr={1} className={classes.svgIcon}>\n <Typography component=\"div\">\n {Icon ? <Icon /> : <LanguageIcon />}\n </Typography>\n </Box>\n <Box flexGrow=\"1\">\n <Link to={href} target=\"_blank\" rel=\"noopener\">\n {text || href}\n </Link>\n </Box>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Theme, useMediaQuery } from '@material-ui/core';\nimport { Breakpoint, ColumnBreakpoints } from './types';\n\nconst colDefaults: ColumnBreakpoints = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 2,\n xl: 3,\n};\n\nexport function useDynamicColumns(\n cols: ColumnBreakpoints | number | undefined,\n): number {\n const matches: (Breakpoint | null)[] = [\n useMediaQuery((theme: Theme) => theme.breakpoints.up('xl')) ? 'xl' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('lg')) ? 'lg' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('md')) ? 'md' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('sm')) ? 'sm' : null,\n useMediaQuery((theme: Theme) => theme.breakpoints.up('xs')) ? 'xs' : null,\n ];\n\n let numOfCols = 1;\n\n if (typeof cols === 'number') {\n numOfCols = cols;\n } else {\n const breakpoint = matches.find(k => k !== null) ?? 'xs';\n numOfCols = cols?.[breakpoint] ?? colDefaults[breakpoint];\n }\n\n return numOfCols;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ImageList, ImageListItem } from '@material-ui/core';\nimport React from 'react';\nimport { IconLink } from './IconLink';\nimport { ColumnBreakpoints } from './types';\nimport { useDynamicColumns } from './useDynamicColumns';\nimport { IconComponent } from '@backstage/core-plugin-api';\n\nexport interface LinksGridListItem {\n href: string;\n text?: string;\n Icon?: IconComponent;\n}\n\ninterface LinksGridListProps {\n items: LinksGridListItem[];\n cols?: ColumnBreakpoints | number;\n}\n\nexport function LinksGridList(props: LinksGridListProps) {\n const { items, cols = undefined } = props;\n const numOfCols = useDynamicColumns(cols);\n\n return (\n <ImageList rowHeight=\"auto\" cols={numOfCols}>\n {items.map(({ text, href, Icon }, i) => (\n <ImageListItem key={i}>\n <IconLink href={href} text={text ?? href} Icon={Icon} />\n </ImageListItem>\n ))}\n </ImageList>\n );\n}\n"],"names":["NewEntityContext","createVersionedContext","AsyncEntityProvider","props","children","entity","loading","error","refresh","value","Provider","createVersionedValueMap","AnalyticsContext","attributes","entityRef","stringifyEntityRef","undefined","EntityProvider","Boolean","useEntity","versionedHolder","useVersionedContext","Error","atVersion","useAsyncEntity","useIconStyles","makeStyles","theme","link","display","justifyItems","gridGap","textAlign","disabled","color","palette","text","secondary","cursor","primary","main","label","textTransform","fontWeight","typography","fontWeightBold","letterSpacing","name","IconLinkVertical","href","icon","LinkIcon","onClick","title","classes","Box","className","classnames","Typography","variant","component","Link","to","useStyles","links","margin","spacing","gridAutoFlow","gridAutoColumns","HeaderIconLinkRow","nav","map","index","ScmIntegrationIcon","type","app","useApp","DefaultIcon","CodeIcon","Icon","getSystemIcon","getEntitySourceLocation","scmIntegrationsApi","sourceLocation","metadata","annotations","ANNOTATION_SOURCE_LOCATION","sourceLocationRef","parseLocationRef","integration","byUrl","target","locationTargetUrl","integrationType","markdown","borderCollapse","border","padding","wordBreak","overflow","verticalAlign","lineHeight","borderBottom","backgroundColor","background","paper","default","maxWidth","flatten","child","React","toArray","reduce","headingRenderer","level","slug","toLocaleLowerCase","replace","id","components","code","inline","String","match","exec","CodeSnippet","language","h1","h2","h3","h4","h5","h6","MarkdownContent","content","dialect","linkTarget","transformLinkUri","transformImageUri","ReactMarkdown","remarkPlugins","gfm","fontSize","whiteSpace","AboutField","gridSizes","childElements","useElementFilter","c","getElements","length","Grid","item","description","getLocationTargetHref","entitySourceLocation","includes","srcLocationUrl","URL","AboutContent","isSystem","kind","isResource","isComponent","isAPI","isTemplate","isLocation","isGroup","partOfSystemRelations","getEntityRelations","RELATION_PART_OF","partOfComponentRelations","partOfDomainRelations","ownedByRelations","RELATION_OWNED_BY","container","xs","sm","lg","EntityRefLinks","entityRefs","defaultKind","spec","lifecycle","tags","t","Chip","size","targets","LinksGridList","cols","items","compiledSchemaCache","Map","refDependencyCandidates","entityEnvelopeSchema","entitySchema","entityMetaSchema","commonSchema","throwAjvError","errors","TypeError","instancePath","message","params","Object","entries","key","val","join","compileAjvSchema","schema","options","disableCache","cacheKey","JSON","stringify","cached","get","extraSchemas","getExtraSchemas","ajv","Ajv","allowUnionTypes","allErrors","validateSchema","addSchema","compiled","compile","set","seen","Set","$id","add","selected","Array","todo","current","pop","ref","getAllRefs","has","find","push","split","entityKindSchemaValidator","validate","data","softCandidates","filter","e","every","keyword","validator","templateEntityV1beta3Validator","check","isTemplateEntityV1beta3","apiVersion","TECHDOCS_ANNOTATION","TECHDOCS_EXTERNAL_ANNOTATION","gridItemCard","flexDirection","height","marginBottom","fullHeightCard","gridItemCardContent","flex","fullHeightCardContent","AboutCard","useApi","scmIntegrationsApiRef","catalogApi","catalogApiRef","alertApi","alertApiRef","errorApi","errorApiRef","viewTechdocLink","useRouteRef","viewTechDocRouteRef","templateRoute","createFromTemplateRouteRef","entityMetadataEditUrl","ANNOTATION_EDIT_URL","techdocsRef","parseEntityRef","viewInSource","viewInTechDocs","DocsIcon","namespace","DEFAULT_NAMESPACE","subHeaderLinks","CreateComponentIcon","launchTemplate","templateName","cardClass","cardContentClass","entityLocation","ANNOTATION_LOCATION","allowRefresh","startsWith","refreshEntity","useCallback","post","severity","Card","CardHeader","action","IconButton","aria-label","CachedIcon","EditIcon","subheader","Divider","CardContent","svgIcon","IconLink","mr","LanguageIcon","flexGrow","rel","colDefaults","md","xl","useDynamicColumns","matches","useMediaQuery","breakpoints","up","numOfCols","breakpoint","k","ImageList","rowHeight","i","ImageListItem"],"sourceRoot":""}
@@ -1,11 +0,0 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[967,8662],{61811:function(p,c,t){t.d(c,{O:function(){return _}});var n=t(73557);function _(l){return(0,n.UO)()}},96641:function(p,c,t){t.d(c,{X2:function(){return x},h$:function(){return M}});var n=t(52322),_=t(74314),l=t(72388),v=t(29651),D=t(68993),O=t(2784);const f=(0,v.CT)("entity-context"),M=s=>{const{children:r,entity:m,loading:u,error:g,refresh:E}=s,y={entity:m,loading:u,error:g,refresh:E};return(0,n.jsx)(f.Provider,{value:(0,D.E)({1:y}),children:(0,n.jsx)(l.fC,{attributes:{...m?{entityRef:(0,_.eE)(m)}:void 0},children:r})})},I=s=>_jsx(M,{entity:s.entity,loading:!Boolean(s.entity),error:void 0,refresh:void 0,children:s.children});function x(){const s=(0,v.Vt)("entity-context");if(!s)throw new Error("Entity context is not available");const r=s.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");if(!r.entity)throw new Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:r.entity}}function j(){const s=useVersionedContext("entity-context");if(!s)throw new Error("Entity context is not available");const r=s.atVersion(1);if(!r)throw new Error("EntityContext v1 not available");const{entity:m,loading:u,error:g,refresh:E}=r;return{entity:m,loading:u,error:g,refresh:E}}},80967:function(p,c,t){t.r(c),t.d(c,{EmbeddedDocsRouter:function(){return $},Router:function(){return U},isTechDocsAvailable:function(){return R}});var n=t(52322),_=t(2784),l=t(73557),v=t(74314),D=t(4577),O=t(77873),f=t(24992);const M="backstage.io/techdocs-entity",I=({entity:o})=>{var e;let a=(0,v.iB)(o);if(!((e=o.metadata.annotations)===null||e===void 0)&&e[M])try{var i;a=(0,v.of)((i=o.metadata.annotations)===null||i===void 0?void 0:i[M])}catch{}return(0,n.jsxs)(D.I6,{entityRef:a,children:[(0,n.jsx)(f.b,{}),(0,n.jsx)(O.F,{withSearch:!1})]})};var x=t(62774),j=t(77277),s=t(79692),r=t(90436),m=t(9791),u=t(98864),g=t(70249),E=t(96641);const y=(0,s.Z)(o=>({code:{borderRadius:6,margin:o.spacing(2,0),background:o.palette.type==="dark"?"#444":o.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function C(o,e){var a,i;const d=(e==null?void 0:e.kind)||"Component",W=(e==null?void 0:e.metadata.name)||"example",K=(e==null||(a=e.spec)===null||a===void 0?void 0:a.type)||"website",S=(e==null||(i=e.spec)===null||i===void 0?void 0:i.owner)||"user:default/guest",H=`apiVersion: backstage.io/v1alpha1
2
- kind: ${d}
3
- metadata:
4
- name: ${W}
5
- annotations:${o.map(b=>`
6
- ${b}: value`).join("")}
7
- spec:
8
- type: ${K}
9
- owner: ${S}`;let N=6;const Z=[];return o.forEach(()=>{Z.push(N),N++}),{yamlText:H,lineNumbers:Z}}function T(o,e="Component"){const a=o.length<=1;return(0,n.jsxs)(n.Fragment,{children:["The ",a?"annotation":"annotations"," ",o.map(i=>(0,n.jsx)("code",{children:i})).reduce((i,d)=>(0,n.jsxs)(n.Fragment,{children:[i,", ",d]}))," ",a?"is":"are"," missing. You need to add the"," ",a?"annotation":"annotations"," to your ",e," if you want to enable this tool."]})}function L(o){let e;try{e=(0,E.X2)().entity}catch{}const{annotation:a,readMoreUrl:i}=o,d=Array.isArray(a)?a:[a],W=i||"https://backstage.io/docs/features/software-catalog/well-known-annotations",K=y(),S=(e==null?void 0:e.kind)||"Component",{yamlText:H,lineNumbers:N}=C(d,e);return(0,n.jsx)(g.u,{missing:"field",title:"Missing Annotation",description:T(d,S),action:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(r.Z,{variant:"body1",children:["Add the annotation to your ",S," YAML as shown in the highlighted example below:"]}),(0,n.jsx)(x.Z,{className:K.code,children:(0,n.jsx)(m.O,{text:H,language:"yaml",showLineNumbers:!0,highlightedNumbers:N,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,n.jsx)(j.Z,{color:"primary",component:u.rU,to:W,children:"Read more"})]})})}var B=t(18662),A=t(31685);const P="backstage.io/techdocs-ref",h="backstage.io/techdocs-entity",R=o=>{var e,a,i,d;return Boolean(o==null||(a=o.metadata)===null||a===void 0||(e=a.annotations)===null||e===void 0?void 0:e[P])||Boolean(o==null||(d=o.metadata)===null||d===void 0||(i=d.annotations)===null||i===void 0?void 0:i[h])},U=()=>(0,n.jsxs)(l.Z5,{children:[(0,n.jsx)(l.AW,{path:"/",element:(0,n.jsx)(B.TechDocsIndexPage,{})}),(0,n.jsx)(l.AW,{path:"/:namespace/:kind/:name/*",element:(0,n.jsx)(A.I,{})})]}),$=o=>{var e,a;const{children:i}=o,{entity:d}=(0,E.X2)(),W=(0,l.V$)([{path:"/*",element:(0,n.jsx)(I,{entity:d}),children:[{path:"*",element:i}]}]);return((e=d.metadata.annotations)===null||e===void 0?void 0:e[P])||((a=d.metadata.annotations)===null||a===void 0?void 0:a[h])?W:(0,n.jsx)(L,{annotation:[P]})}},18662:function(p,c,t){t.r(c),t.d(c,{TechDocsIndexPage:function(){return D}});var n=t(52322),_=t(2784),l=t(73557),v=t(29895);const D=O=>(0,l.pC)()||(0,n.jsx)(v.u,{...O})},31685:function(p,c,t){t.d(c,{I:function(){return m},r:function(){return r}});var n=t(52322),_=t(2784),l=t(73557),v=t(67880),D=t(2296),O=t(68979),f=t(77873),M=t(65386),I=t(24992),x=t(95573),j=t(61811),s=t(62584);const r=u=>{const{withSearch:g,withHeader:E=!0}=u;return(0,n.jsxs)(v.T,{themeId:"documentation",children:[E&&(0,n.jsx)(M.S,{}),(0,n.jsx)(I.b,{}),(0,n.jsx)(f.F,{withSearch:g})]})},m=u=>{const{kind:g,name:E,namespace:y}=(0,j.O)(x.Fw),{children:C,entityRef:T={kind:g,name:E,namespace:y}}=u,L=(0,l.pC)();if(!C){const P=(L?_.Children.toArray(L.props.children):[]).flatMap(h=>{var R,U;return(U=h==null||(R=h.props)===null||R===void 0?void 0:R.children)!==null&&U!==void 0?U:[]}).find(h=>!(0,s.I)(h,D.Zz)&&!(0,s.I)(h,D.jM));return(0,n.jsx)(O.Z,{entityRef:T,children:P||(0,n.jsx)(r,{})})}return(0,n.jsx)(O.Z,{entityRef:T,children:({metadata:B,entityMetadata:A,onReady:P})=>(0,n.jsx)("div",{className:"techdocs-reader-page",children:(0,n.jsx)(v.T,{themeId:"documentation",children:C instanceof Function?C({entityRef:T,techdocsMetadataValue:B.value,entityMetadataValue:A.value,onReady:P}):C})})})}},24992:function(p,c,t){t.d(c,{b:function(){return m}});var n=t(52322),_=t(2784),l=t(79692),v=t(15223),D=t(62774),O=t(80030),f=t(61837),M=t(48348),I=t(47603),x=t(68979),j=t(2296),s=t(57058);const r=(0,l.Z)(u=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:u.spacing(3,3,0),"@media print":{display:"none"}}})),m=u=>{const g=r(),[E,y]=(0,_.useState)(null),C=(0,_.useCallback)(R=>{y(R.currentTarget)},[]),T=(0,_.useCallback)(()=>{y(null)},[]),{entityMetadata:{value:L,loading:B}}=(0,x.x)(),A=(0,j.$L)(),P=A.renderComponentsByLocation(s.o.Subheader),h=A.renderComponentsByLocation(s.o.Settings);return!P&&!h||B===!1&&!L?null:(0,n.jsx)(v.Z,{classes:g,...u.toolbarProps,children:(0,n.jsxs)(D.Z,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[P,h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(O.ZP,{title:"Settings",children:(0,n.jsx)(f.Z,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:C,children:(0,n.jsx)(I.Z,{})})}),(0,n.jsx)(M.Z,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:Boolean(E),onClose:T,keepMounted:!0,children:(0,n.jsx)("div",{children:h})})]}):null]})})}}}]);})();
10
-
11
- //# sourceMappingURL=967.dadcb6bd.chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"static/967.dadcb6bd.chunk.js","mappings":"sMAwBO,SAASA,EACdC,EAAiD,CAEjD,SA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AAM0J,a,YACnC,QAAC5E,EAAAA,EAAGA,CACFwD,QAAQ,OACRqB,eAAe,WACfC,MAAM,OACNC,SAAS,O,UAERV,EACAI,KACC,oB,aACE,OAACO,EAAAA,GAAOA,CAACrF,MAAM,W,YACb,OAACsF,EAAAA,EAAUA,CACTC,gBAAc,iCACdC,gBAAc,OACdC,QAASxB,E,YAET,OAACyB,EAAAA,EAAYA,CAAAA,CAAAA,C,QAGjB,OAACC,EAAAA,EAAIA,CACHC,GAAG,iCACHC,mBAAoB,KACpB/B,SAAUA,EACVgC,aAAc,CAAEC,SAAU,SAAUC,WAAY,OAAQ,EACxDC,KAAM3J,QAAQwH,CAAQ,EACtBoC,QAAS7B,EACT8B,YAAW,G,YAEX,OAAC/C,MAAAA,C,SAAK0B,C,QAGR,I,KAIZ,C","sources":["webpack://techdocs-cli-embedded-app/../core-plugin-api/src/routing/useRouteRefParams.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/EntityPageDocs.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/EmptyState/MissingAnnotationEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/Router.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/home/components/TechDocsIndexPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport { RouteRef, AnyParams, SubRouteRef } from './types';\n\n/**\n * React hook for retrieving dynamic params from the current URL.\n * @param _routeRef - Ref of the current route.\n * @public\n */\nexport function useRouteRefParams<Params extends AnyParams>(\n _routeRef: RouteRef<Params> | SubRouteRef<Params>,\n): Params {\n return useParams() as Params;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { AnalyticsContext } from '@backstage/core-plugin-api';\nimport {\n createVersionedContext,\n createVersionedValueMap,\n useVersionedContext,\n} from '@backstage/version-bridge';\nimport React, { ReactNode } from 'react';\n\n/** @public */\nexport type EntityLoadingStatus<TEntity extends Entity = Entity> = {\n entity?: TEntity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n};\n\n// This context has support for multiple concurrent versions of this package.\n// It is currently used in parallel with the old context in order to provide\n// a smooth transition, but will eventually be the only context we use.\nconst NewEntityContext = createVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n);\n\n/**\n * Properties for the AsyncEntityProvider component.\n *\n * @public\n */\nexport interface AsyncEntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n loading: boolean;\n error?: Error;\n refresh?: VoidFunction;\n}\n\n/**\n * Provides a loaded entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const AsyncEntityProvider = (props: AsyncEntityProviderProps) => {\n const { children, entity, loading, error, refresh } = props;\n const value = { entity, loading, error, refresh };\n // We provide both the old and the new context, since\n // consumers might be doing things like `useContext(EntityContext)`\n return (\n <NewEntityContext.Provider value={createVersionedValueMap({ 1: value })}>\n <AnalyticsContext\n attributes={{\n ...(entity ? { entityRef: stringifyEntityRef(entity) } : undefined),\n }}\n >\n {children}\n </AnalyticsContext>\n </NewEntityContext.Provider>\n );\n};\n\n/**\n * Properties for the EntityProvider component.\n *\n * @public\n */\nexport interface EntityProviderProps {\n children: ReactNode;\n entity?: Entity;\n}\n\n/**\n * Provides an entity to be picked up by the `useEntity` hook.\n *\n * @public\n */\nexport const EntityProvider = (props: EntityProviderProps) => (\n <AsyncEntityProvider\n entity={props.entity}\n loading={!Boolean(props.entity)}\n error={undefined}\n refresh={undefined}\n children={props.children}\n />\n);\n\n/**\n * Grab the current entity from the context, throws if the entity has not yet been loaded\n * or is not available.\n *\n * @public\n */\nexport function useEntity<TEntity extends Entity = Entity>(): {\n entity: TEntity;\n} {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n if (!value.entity) {\n throw new Error(\n 'useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.',\n );\n }\n\n return { entity: value.entity as TEntity };\n}\n\n/**\n * Grab the current entity from the context, provides loading state and errors, and the ability to refresh.\n *\n * @public\n */\nexport function useAsyncEntity<\n TEntity extends Entity = Entity,\n>(): EntityLoadingStatus<TEntity> {\n const versionedHolder = useVersionedContext<{ 1: EntityLoadingStatus }>(\n 'entity-context',\n );\n\n if (!versionedHolder) {\n throw new Error('Entity context is not available');\n }\n const value = versionedHolder.atVersion(1);\n if (!value) {\n throw new Error('EntityContext v1 not available');\n }\n\n const { entity, loading, error, refresh } = value;\n return { entity: entity as TEntity, loading, error, refresh };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n getCompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\n\nimport React from 'react';\nimport { TechDocsReaderPage } from './plugin';\nimport { TechDocsReaderPageContent } from './reader/components/TechDocsReaderPageContent';\nimport { TechDocsReaderPageSubheader } from './reader/components/TechDocsReaderPageSubheader';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\ntype EntityPageDocsProps = { entity: Entity };\n\nexport const EntityPageDocs = ({ entity }: EntityPageDocsProps) => {\n let entityRef = getCompoundEntityRef(entity);\n\n if (entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]) {\n try {\n entityRef = parseEntityRef(\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION],\n );\n } catch {\n // not a fan of this but we don't care if the parseEntityRef fails\n }\n }\n\n return (\n <TechDocsReaderPage entityRef={entityRef}>\n <TechDocsReaderPageSubheader />\n <TechDocsReaderPageContent withSearch={false} />\n </TechDocsReaderPage>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BackstageTheme } from '@backstage/theme';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\n\nimport { CodeSnippet } from '../CodeSnippet';\nimport { Link } from '../Link';\nimport { EmptyState } from './EmptyState';\n\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\n\ntype Props = {\n annotation: string | string[];\n readMoreUrl?: string;\n};\n\nexport type MissingAnnotationEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles<BackstageTheme>(\n theme => ({\n code: {\n borderRadius: 6,\n margin: theme.spacing(2, 0),\n background:\n theme.palette.type === 'dark' ? '#444' : theme.palette.common.white,\n },\n }),\n { name: 'BackstageMissingAnnotationEmptyState' },\n);\n\nfunction generateYamlExample(\n annotations: string[],\n entity?: Entity,\n): { yamlText: string; lineNumbers: number[] } {\n const kind = entity?.kind || 'Component';\n const name = entity?.metadata.name || 'example';\n const type = entity?.spec?.type || 'website';\n const owner = entity?.spec?.owner || 'user:default/guest';\n\n const yamlText = `apiVersion: backstage.io/v1alpha1\nkind: ${kind}\nmetadata:\n name: ${name}\n annotations:${annotations.map(ann => `\\n ${ann}: value`).join('')}\nspec:\n type: ${type}\n owner: ${owner}`;\n\n let line = 6; // Line 6 is the line number that annotations are added to.\n const lineNumbers: number[] = [];\n annotations.forEach(() => {\n lineNumbers.push(line);\n line++;\n });\n\n return {\n yamlText,\n lineNumbers,\n };\n}\n\nfunction generateDescription(annotations: string[], entityKind = 'Component') {\n const isSingular = annotations.length <= 1;\n return (\n <>\n The {isSingular ? 'annotation' : 'annotations'}{' '}\n {annotations\n .map(ann => <code>{ann}</code>)\n .reduce((prev, curr) => (\n <>\n {prev}, {curr}\n </>\n ))}{' '}\n {isSingular ? 'is' : 'are'} missing. You need to add the{' '}\n {isSingular ? 'annotation' : 'annotations'} to your {entityKind} if you\n want to enable this tool.\n </>\n );\n}\n\nexport function MissingAnnotationEmptyState(props: Props) {\n let entity: Entity | undefined;\n try {\n const entityContext = useEntity();\n entity = entityContext.entity;\n } catch (err) {\n // ignore when entity context doesnt exist\n }\n\n const { annotation, readMoreUrl } = props;\n const annotations = Array.isArray(annotation) ? annotation : [annotation];\n const url =\n readMoreUrl ||\n 'https://backstage.io/docs/features/software-catalog/well-known-annotations';\n const classes = useStyles();\n\n const entityKind = entity?.kind || 'Component';\n const { yamlText, lineNumbers } = generateYamlExample(annotations, entity);\n return (\n <EmptyState\n missing=\"field\"\n title=\"Missing Annotation\"\n description={generateDescription(annotations, entityKind)}\n action={\n <>\n <Typography variant=\"body1\">\n Add the annotation to your {entityKind} YAML as shown in the\n highlighted example below:\n </Typography>\n <Box className={classes.code}>\n <CodeSnippet\n text={yamlText}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={lineNumbers}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </Box>\n <Button color=\"primary\" component={Link} to={url}>\n Read more\n </Button>\n </>\n }\n />\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { PropsWithChildren } from 'react';\nimport { Route, Routes, useRoutes } from 'react-router-dom';\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityPageDocs } from './EntityPageDocs';\nimport { MissingAnnotationEmptyState } from '@backstage/core-components';\nimport { TechDocsIndexPage } from './home/components/TechDocsIndexPage';\nimport { TechDocsReaderPage } from './reader/components/TechDocsReaderPage';\nimport { useEntity } from '@backstage/plugin-catalog-react';\n\nconst TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';\n\nconst TECHDOCS_EXTERNAL_ANNOTATION = 'backstage.io/techdocs-entity';\n\n/**\n * Helper that takes in entity and returns true/false if TechDocs is available for the entity\n *\n * @public\n */\nexport const isTechDocsAvailable = (entity: Entity) =>\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]) ||\n Boolean(entity?.metadata?.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION]);\n\n/**\n * Responsible for registering routes for TechDocs, TechDocs Homepage and separate TechDocs page\n *\n * @public\n */\nexport const Router = () => {\n return (\n <Routes>\n <Route path=\"/\" element={<TechDocsIndexPage />} />\n <Route\n path=\"/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n />\n </Routes>\n );\n};\n\n/**\n * Responsible for registering route to view docs on Entity page\n *\n * @public\n */\nexport const EmbeddedDocsRouter = (props: PropsWithChildren<{}>) => {\n const { children } = props;\n const { entity } = useEntity();\n\n // Using objects instead of <Route> elements, otherwise \"outlet\" will be null on sub-pages and add-ons won't render\n const element = useRoutes([\n {\n path: '/*',\n element: <EntityPageDocs entity={entity} />,\n children: [\n {\n path: '*',\n element: children,\n },\n ],\n },\n ]);\n\n const projectId =\n entity.metadata.annotations?.[TECHDOCS_ANNOTATION] ||\n entity.metadata.annotations?.[TECHDOCS_EXTERNAL_ANNOTATION];\n\n if (!projectId) {\n return <MissingAnnotationEmptyState annotation={[TECHDOCS_ANNOTATION]} />;\n }\n\n return element;\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport { TableColumn, TableProps } from '@backstage/core-components';\nimport { UserListFilterKind } from '@backstage/plugin-catalog-react';\nimport { DefaultTechDocsHome } from './DefaultTechDocsHome';\nimport { DocsTableRow } from './Tables';\n\n/**\n * Props for {@link TechDocsIndexPage}\n *\n * @public\n */\nexport type TechDocsIndexPageProps = {\n initialFilter?: UserListFilterKind;\n columns?: TableColumn<DocsTableRow>[];\n actions?: TableProps<DocsTableRow>['actions'];\n};\n\nexport const TechDocsIndexPage = (props: TechDocsIndexPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultTechDocsHome {...props} />;\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode, Children, ReactElement } from 'react';\nimport { useOutlet } from 'react-router-dom';\n\nimport { Page } from '@backstage/core-components';\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport {\n TECHDOCS_ADDONS_WRAPPER_KEY,\n TECHDOCS_ADDONS_KEY,\n TechDocsReaderPageProvider,\n} from '@backstage/plugin-techdocs-react';\n\nimport { TechDocsReaderPageRenderFunction } from '../../../types';\n\nimport { TechDocsReaderPageContent } from '../TechDocsReaderPageContent';\nimport { TechDocsReaderPageHeader } from '../TechDocsReaderPageHeader';\nimport { TechDocsReaderPageSubheader } from '../TechDocsReaderPageSubheader';\nimport { rootDocsRouteRef } from '../../../routes';\nimport {\n getComponentData,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\n\n/* An explanation for the multiple ways of customizing the TechDocs reader page\n\nPlease refer to this page on the microsite for the latest recommended approach:\nhttps://backstage.io/docs/features/techdocs/how-to-guides#how-to-customize-the-techdocs-reader-page\n\nThe <TechDocsReaderPage> component is responsible for rendering the <TechDocsReaderPageProvider> and\nits contained version of a <Page>, which in turn renders the <TechDocsReaderPageContent>.\n\nHistorically, there have been different approaches on how this <Page> can be customized, and how the\n<TechDocsReaderPageContent> inside could be exchanged for a custom implementation (which was not\npossible before). Also, the current implementation supports every scenario to avoid breaking default\nconfigurations of TechDocs.\n\nIn particular, there are 4 different TechDocs page configurations:\n\nCONFIGURATION 1: <TechDocsReaderPage> only, no children\n\n<Route path=\"/docs/:namespace/:kind/:name/*\" element={<TechDocsReaderPage />} >\n\nThis is the simplest way to use TechDocs. Only a full page is passed, assuming that it comes with\nits content inside. Since we allowed customizing it, we started providing <TechDocsReaderLayout> as\na default implementation (which contains <TechDocsReaderPageContent>).\n\nCONFIGURATION 2 (not advised): <TechDocsReaderPage> with element children\n\n<Route\n path=\"/docs/:namespace/:kind/:name/*\"\n element={\n <TechDocsReaderPage>\n {techdocsPage}\n </TechDocsReaderPage>\n }\n/>\n\nPreviously, there were two ways of passing children to <TechDocsReaderPage>: either as elements (as\nshown above), or as a render function (described below in CONFIGURATION 3). The \"techdocsPage\" is\nlocated in packages/app/src/components/techdocs and is the default implementation of the content\ninside.\n\nCONFIGURATION 3 (not advised): <TechDocsReaderPage> with render function as child\n\n<Route\n path=\"/docs/:namespace/:kind/:name/*\"\n element={\n <TechDocsReaderPage>\n {({ metadata, entityMetadata, onReady }) => (\n techdocsPage\n )}\n </TechDocsReaderPage>\n }\n/>\n\nSimilar to CONFIGURATION 2, the direct children will be passed to the <TechDocsReaderPage> but in\nthis case interpreted as render prop.\n\nCONFIGURATION 4: <TechDocsReaderPage> and provided content in <Route>\n\n<Route\n path=\"/docs/:namespace/:kind/:name/*\"\n element={<TechDocsReaderPage />}\n>\n {techDocsPage}\n <TechDocsAddons>\n <ExpandableNavigation />\n <ReportIssue />\n <TextSize />\n <LightBox />\n </TechDocsAddons>\n</Route>\n\nThis is the current state in packages/app/src/App.tsx and moved the location of children from inside\nthe element prop in the <Route> to the children of the <Route>. Then, in <TechDocsReaderPage> they\nare retrieved using the useOutlet hook from React Router.\n\nNOTE: Render functions are no longer supported in this approach.\n*/\n\n/**\n * Props for {@link TechDocsReaderLayout}\n * @public\n */\nexport type TechDocsReaderLayoutProps = {\n /**\n * Show or hide the header, defaults to true.\n */\n withHeader?: boolean;\n /**\n * Show or hide the content search bar, defaults to true.\n */\n withSearch?: boolean;\n};\n\n/**\n * Default TechDocs reader page structure composed with a header and content\n * @public\n */\nexport const TechDocsReaderLayout = (props: TechDocsReaderLayoutProps) => {\n const { withSearch, withHeader = true } = props;\n return (\n <Page themeId=\"documentation\">\n {withHeader && <TechDocsReaderPageHeader />}\n <TechDocsReaderPageSubheader />\n <TechDocsReaderPageContent withSearch={withSearch} />\n </Page>\n );\n};\n\n/**\n * @public\n */\nexport type TechDocsReaderPageProps = {\n entityRef?: CompoundEntityRef;\n children?: TechDocsReaderPageRenderFunction | ReactNode;\n};\n\n/**\n * An addon-aware implementation of the TechDocsReaderPage.\n *\n * @public\n */\nexport const TechDocsReaderPage = (props: TechDocsReaderPageProps) => {\n const { kind, name, namespace } = useRouteRefParams(rootDocsRouteRef);\n const { children, entityRef = { kind, name, namespace } } = props;\n\n const outlet = useOutlet();\n\n if (!children) {\n const childrenList = outlet ? Children.toArray(outlet.props.children) : [];\n\n const grandChildren = childrenList.flatMap<ReactElement>(\n child => (child as ReactElement)?.props?.children ?? [],\n );\n\n const page: React.ReactNode = grandChildren.find(\n grandChild =>\n !getComponentData(grandChild, TECHDOCS_ADDONS_WRAPPER_KEY) &&\n !getComponentData(grandChild, TECHDOCS_ADDONS_KEY),\n );\n\n // As explained above, \"page\" is configuration 4 and <TechDocsReaderLayout> is 1\n return (\n <TechDocsReaderPageProvider entityRef={entityRef}>\n {(page as JSX.Element) || <TechDocsReaderLayout />}\n </TechDocsReaderPageProvider>\n );\n }\n\n // As explained above, a render function is configuration 3 and React element is 2\n return (\n <TechDocsReaderPageProvider entityRef={entityRef}>\n {({ metadata, entityMetadata, onReady }) => (\n <div className=\"techdocs-reader-page\">\n <Page themeId=\"documentation\">\n {children instanceof Function\n ? children({\n entityRef,\n techdocsMetadataValue: metadata.value,\n entityMetadataValue: entityMetadata.value,\n onReady,\n })\n : children}\n </Page>\n </div>\n )}\n </TechDocsReaderPageProvider>\n );\n};\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { MouseEvent, useState, useCallback } from 'react';\n\nimport {\n Box,\n makeStyles,\n Toolbar,\n ToolbarProps,\n Menu,\n Tooltip,\n IconButton,\n} from '@material-ui/core';\nimport SettingsIcon from '@material-ui/icons/Settings';\n\nimport {\n TechDocsAddonLocations as locations,\n useTechDocsAddons,\n useTechDocsReaderPage,\n} from '@backstage/plugin-techdocs-react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n gridArea: 'pageSubheader',\n flexDirection: 'column',\n minHeight: 'auto',\n padding: theme.spacing(3, 3, 0),\n '@media print': {\n display: 'none',\n },\n },\n}));\n\n/**\n * Renders the reader page subheader.\n * Please use the Tech Docs add-ons to customize it\n * @public\n */\nexport const TechDocsReaderPageSubheader = (props: {\n toolbarProps?: ToolbarProps;\n}) => {\n const classes = useStyles();\n const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);\n\n const handleClick = useCallback((event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n }, []);\n\n const handleClose = useCallback(() => {\n setAnchorEl(null);\n }, []);\n\n const {\n entityMetadata: { value: entityMetadata, loading: entityMetadataLoading },\n } = useTechDocsReaderPage();\n\n const addons = useTechDocsAddons();\n\n const subheaderAddons = addons.renderComponentsByLocation(\n locations.Subheader,\n );\n\n const settingsAddons = addons.renderComponentsByLocation(locations.Settings);\n\n if (!subheaderAddons && !settingsAddons) return null;\n\n // No entity metadata = 404. Don't render subheader on 404.\n if (entityMetadataLoading === false && !entityMetadata) return null;\n\n return (\n <Toolbar classes={classes} {...props.toolbarProps}>\n <Box\n display=\"flex\"\n justifyContent=\"flex-end\"\n width=\"100%\"\n flexWrap=\"wrap\"\n >\n {subheaderAddons}\n {settingsAddons ? (\n <>\n <Tooltip title=\"Settings\">\n <IconButton\n aria-controls=\"tech-docs-reader-page-settings\"\n aria-haspopup=\"true\"\n onClick={handleClick}\n >\n <SettingsIcon />\n </IconButton>\n </Tooltip>\n <Menu\n id=\"tech-docs-reader-page-settings\"\n getContentAnchorEl={null}\n anchorEl={anchorEl}\n anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}\n open={Boolean(anchorEl)}\n onClose={handleClose}\n keepMounted\n >\n <div>{settingsAddons}</div>\n </Menu>\n </>\n ) : null}\n </Box>\n </Toolbar>\n );\n};\n"],"names":["useRouteRefParams","_routeRef","useParams","NewEntityContext","createVersionedContext","AsyncEntityProvider","props","children","entity","loading","error","refresh","value","Provider","createVersionedValueMap","AnalyticsContext","attributes","entityRef","stringifyEntityRef","undefined","EntityProvider","Boolean","useEntity","versionedHolder","useVersionedContext","Error","atVersion","useAsyncEntity","TECHDOCS_EXTERNAL_ANNOTATION","EntityPageDocs","getCompoundEntityRef","metadata","annotations","parseEntityRef","TechDocsReaderPage","TechDocsReaderPageSubheader","TechDocsReaderPageContent","withSearch","useStyles","makeStyles","theme","code","borderRadius","margin","spacing","background","palette","type","common","white","name","generateYamlExample","kind","spec","owner","yamlText","map","ann","join","line","lineNumbers","forEach","push","generateDescription","entityKind","isSingular","length","reduce","prev","curr","MissingAnnotationEmptyState","annotation","readMoreUrl","Array","isArray","url","classes","EmptyState","missing","title","description","action","Typography","variant","Box","className","CodeSnippet","text","language","showLineNumbers","highlightedNumbers","customStyle","fontSize","Button","color","component","Link","to","TECHDOCS_ANNOTATION","isTechDocsAvailable","Router","Routes","Route","path","element","TechDocsIndexPage","EmbeddedDocsRouter","useRoutes","useOutlet","DefaultTechDocsHome","TechDocsReaderLayout","withHeader","Page","themeId","TechDocsReaderPageHeader","namespace","rootDocsRouteRef","outlet","page","Children","toArray","flatMap","child","find","grandChild","getComponentData","TECHDOCS_ADDONS_WRAPPER_KEY","TECHDOCS_ADDONS_KEY","TechDocsReaderPageProvider","entityMetadata","onReady","div","Function","techdocsMetadataValue","entityMetadataValue","root","gridArea","flexDirection","minHeight","padding","display","anchorEl","setAnchorEl","useState","handleClick","useCallback","event","currentTarget","handleClose","entityMetadataLoading","useTechDocsReaderPage","addons","useTechDocsAddons","subheaderAddons","renderComponentsByLocation","locations","Subheader","settingsAddons","Settings","Toolbar","toolbarProps","justifyContent","width","flexWrap","Tooltip","IconButton","aria-controls","aria-haspopup","onClick","SettingsIcon","Menu","id","getContentAnchorEl","anchorOrigin","vertical","horizontal","open","onClose","keepMounted"],"sourceRoot":""}