@techdocs/cli 1.6.0 → 1.6.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/embedded-app/.config-schema.json +52 -28
  3. package/dist/embedded-app/index.html +1 -1
  4. package/dist/embedded-app/static/{1032.d8d4547a.chunk.js → 1032.88fa9fda.chunk.js} +2 -2
  5. package/dist/embedded-app/static/{1032.d8d4547a.chunk.js.map → 1032.88fa9fda.chunk.js.map} +1 -1
  6. package/dist/embedded-app/static/{1105.250209d9.chunk.js → 1105.2ef0665c.chunk.js} +2 -2
  7. package/dist/embedded-app/static/{1105.250209d9.chunk.js.map → 1105.2ef0665c.chunk.js.map} +1 -1
  8. package/dist/embedded-app/static/1600.ef4a7196.chunk.js +3 -0
  9. package/dist/embedded-app/static/1600.ef4a7196.chunk.js.map +1 -0
  10. package/dist/embedded-app/static/{184.3d7fb6d2.chunk.js → 184.8fc549e9.chunk.js} +2 -2
  11. package/dist/embedded-app/static/{184.3d7fb6d2.chunk.js.map → 184.8fc549e9.chunk.js.map} +1 -1
  12. package/dist/embedded-app/static/{2440.8c636d46.chunk.js → 2440.2451b337.chunk.js} +2 -2
  13. package/dist/embedded-app/static/{2440.8c636d46.chunk.js.map → 2440.2451b337.chunk.js.map} +1 -1
  14. package/dist/embedded-app/static/{3487.ca0b20dd.chunk.js → 3487.1c93df49.chunk.js} +2 -2
  15. package/dist/embedded-app/static/{3487.ca0b20dd.chunk.js.map → 3487.1c93df49.chunk.js.map} +1 -1
  16. package/dist/embedded-app/static/{3893.18294a43.chunk.js → 3893.118c937c.chunk.js} +1 -1
  17. package/dist/embedded-app/static/{3893.18294a43.chunk.js.map → 3893.118c937c.chunk.js.map} +1 -1
  18. package/dist/embedded-app/static/4109.6335d16f.chunk.js +3 -0
  19. package/dist/embedded-app/static/4109.6335d16f.chunk.js.map +1 -0
  20. package/dist/embedded-app/static/{4966.9cb67949.chunk.js → 4966.e30bae7f.chunk.js} +1 -1
  21. package/dist/embedded-app/static/{4966.9cb67949.chunk.js.map → 4966.e30bae7f.chunk.js.map} +1 -1
  22. package/dist/embedded-app/static/{5458.e6517aa6.chunk.js → 5458.abed4572.chunk.js} +2 -2
  23. package/dist/embedded-app/static/{5458.e6517aa6.chunk.js.map → 5458.abed4572.chunk.js.map} +1 -1
  24. package/dist/embedded-app/static/{5877.829aa767.chunk.js → 5877.c521a57f.chunk.js} +1 -1
  25. package/dist/embedded-app/static/{5877.829aa767.chunk.js.map → 5877.c521a57f.chunk.js.map} +1 -1
  26. package/dist/embedded-app/static/{5914.92b59b3e.chunk.js → 5914.111b8c95.chunk.js} +2 -2
  27. package/dist/embedded-app/static/{5914.92b59b3e.chunk.js.map → 5914.111b8c95.chunk.js.map} +1 -1
  28. package/dist/embedded-app/static/{6051.84051083.chunk.js → 6051.9eefea24.chunk.js} +1 -1
  29. package/dist/embedded-app/static/{6051.84051083.chunk.js.map → 6051.9eefea24.chunk.js.map} +1 -1
  30. package/dist/embedded-app/static/{7670.4e34a90d.chunk.js → 7670.9faef6c0.chunk.js} +1 -1
  31. package/dist/embedded-app/static/{7670.4e34a90d.chunk.js.map → 7670.9faef6c0.chunk.js.map} +1 -1
  32. package/dist/embedded-app/static/{7750.3b7f34f8.chunk.js → 7750.cb06dc85.chunk.js} +1 -1
  33. package/dist/embedded-app/static/{7750.3b7f34f8.chunk.js.map → 7750.cb06dc85.chunk.js.map} +1 -1
  34. package/dist/embedded-app/static/{7893.8b70980c.chunk.js → 7893.e406114c.chunk.js} +2 -2
  35. package/dist/embedded-app/static/{7893.8b70980c.chunk.js.map → 7893.e406114c.chunk.js.map} +1 -1
  36. package/dist/embedded-app/static/{8629.18b8b029.chunk.js → 8629.34b012ba.chunk.js} +1 -1
  37. package/dist/embedded-app/static/{8629.18b8b029.chunk.js.map → 8629.34b012ba.chunk.js.map} +1 -1
  38. package/dist/embedded-app/static/{8662.e8af541f.chunk.js → 8662.7243a5c6.chunk.js} +1 -1
  39. package/dist/embedded-app/static/{8662.e8af541f.chunk.js.map → 8662.7243a5c6.chunk.js.map} +1 -1
  40. package/dist/embedded-app/static/{8951.b8daca92.chunk.js → 8951.6ae94626.chunk.js} +1 -1
  41. package/dist/embedded-app/static/{8951.b8daca92.chunk.js.map → 8951.6ae94626.chunk.js.map} +1 -1
  42. package/dist/embedded-app/static/{9545.1f2986d6.chunk.js → 9545.8e4a2868.chunk.js} +2 -2
  43. package/dist/embedded-app/static/{9545.1f2986d6.chunk.js.map → 9545.8e4a2868.chunk.js.map} +1 -1
  44. package/dist/embedded-app/static/{967.00bc7a39.chunk.js → 967.dadcb6bd.chunk.js} +3 -3
  45. package/dist/embedded-app/static/{967.00bc7a39.chunk.js.map → 967.dadcb6bd.chunk.js.map} +1 -1
  46. package/dist/embedded-app/static/{9770.5cb016d6.chunk.js → 9770.2d75fe33.chunk.js} +2 -2
  47. package/dist/embedded-app/static/{9770.5cb016d6.chunk.js.map → 9770.2d75fe33.chunk.js.map} +1 -1
  48. package/dist/embedded-app/static/main.167d1cf0.js +487 -0
  49. package/dist/embedded-app/static/main.167d1cf0.js.map +1 -0
  50. package/dist/embedded-app/static/module-lodash.fa492ce2.js +29 -0
  51. package/dist/embedded-app/static/module-lodash.fa492ce2.js.map +1 -0
  52. package/dist/embedded-app/static/{module-material-table.0f5635dd.js → module-material-table.3c68edc1.js} +1 -1
  53. package/dist/embedded-app/static/{module-material-table.0f5635dd.js.map → module-material-table.3c68edc1.js.map} +1 -1
  54. package/dist/embedded-app/static/{module-material-ui.bdbd8daa.js → module-material-ui.263ce9b5.js} +7 -7
  55. package/dist/embedded-app/static/module-material-ui.263ce9b5.js.map +1 -0
  56. package/dist/embedded-app/static/{module-react-beautiful-dnd.62627182.js → module-react-beautiful-dnd.0ca788d0.js} +1 -1
  57. package/dist/embedded-app/static/{module-react-beautiful-dnd.62627182.js.map → module-react-beautiful-dnd.0ca788d0.js.map} +1 -1
  58. package/dist/embedded-app/static/module-react-dom.f7ae1c8b.js +26 -0
  59. package/dist/embedded-app/static/module-react-dom.f7ae1c8b.js.map +1 -0
  60. package/dist/embedded-app/static/{module-react-router-dom.65ce4c09.js → module-react-router-dom.8eff32d7.js} +1 -1
  61. package/dist/embedded-app/static/{module-react-router-dom.65ce4c09.js.map → module-react-router-dom.8eff32d7.js.map} +1 -1
  62. package/dist/embedded-app/static/{module-react-router.652daaf3.js → module-react-router.05179f87.js} +1 -1
  63. package/dist/embedded-app/static/{module-react-router.652daaf3.js.map → module-react-router.05179f87.js.map} +1 -1
  64. package/dist/embedded-app/static/{runtime.02409009.js → runtime.167d1cf0.js} +2 -2
  65. package/dist/embedded-app/static/{runtime.02409009.js.map → runtime.167d1cf0.js.map} +1 -1
  66. package/dist/embedded-app/static/vendor.167d1cf0.js +167 -0
  67. package/dist/embedded-app/static/vendor.167d1cf0.js.map +1 -0
  68. package/dist/index.cjs.js +1 -1
  69. package/package.json +4 -4
  70. package/dist/embedded-app/static/1600.1ec85d5a.chunk.js +0 -3
  71. package/dist/embedded-app/static/1600.1ec85d5a.chunk.js.map +0 -1
  72. package/dist/embedded-app/static/2924.b96e10c0.chunk.js +0 -3
  73. package/dist/embedded-app/static/2924.b96e10c0.chunk.js.map +0 -1
  74. package/dist/embedded-app/static/main.02409009.js +0 -487
  75. package/dist/embedded-app/static/main.02409009.js.map +0 -1
  76. package/dist/embedded-app/static/module-lodash.adfd55fe.js +0 -29
  77. package/dist/embedded-app/static/module-lodash.adfd55fe.js.map +0 -1
  78. package/dist/embedded-app/static/module-material-ui.bdbd8daa.js.map +0 -1
  79. package/dist/embedded-app/static/module-react-dom.07625e59.js +0 -25
  80. package/dist/embedded-app/static/module-react-dom.07625e59.js.map +0 -1
  81. package/dist/embedded-app/static/vendor.02409009.js +0 -159
  82. package/dist/embedded-app/static/vendor.02409009.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"static/967.00bc7a39.chunk.js","mappings":"sMAwBO,SAAS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nF,QAASA,EAAU,GAAGtE,EAAM0J,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":""}
1
+ {"version":3,"file":"static/967.dadcb6bd.chunk.js","mappings":"sMAwBO,SAASA,EACdC,EAAiD,CAEjD,SAAOC,EAAAA,IAAU,CACnB,C,sJCOA,MAAMC,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,EAAI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AAAA,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":""}
@@ -1,5 +1,5 @@
1
- "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9770],{27597:function(z,g,t){var e,T=t(71600),x=t(34590);e={value:!0},g.Z=void 0;var d=x(t(2784)),l=T(t(50175)),D=(0,l.default)(d.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");g.Z=D},29862:function(z,g,t){t.d(g,{t:function(){return T}});var e=t(2784);function T(x){x===void 0&&(x=!1);var d=(0,e.useRef)(x),l=(0,e.useCallback)(function(){return d.current},[]);return(0,e.useEffect)(function(){return d.current=!0,function(){d.current=!1}},[]),l}},15277:function(z,g,t){var e,T,x;(function(d,l){if(!0)T=[g,t(2784),t(13980)],e=l,x=typeof e=="function"?e.apply(g,T):e,x!==void 0&&(z.exports=x);else var D})(void 0,function(d,l,D){"use strict";Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0;var M=Z(l),f=Z(D);function Z(a){return a&&a.__esModule?a:{default:a}}function c(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(r){return typeof r}:c=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},c(a)}function L(a,o){if(a==null)return{};var r=h(a,o),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);for(i=0;i<s.length;i++)n=s[i],!(o.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(a,n)&&(r[n]=a[n])}return r}function h(a,o){if(a==null)return{};var r={},n=Object.keys(a),i,s;for(s=0;s<n.length;s++)i=n[s],!(o.indexOf(i)>=0)&&(r[i]=a[i]);return r}function R(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}function W(a,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}function B(a,o,r){return o&&W(a.prototype,o),r&&W(a,r),a}function y(a,o){return o&&(c(o)==="object"||typeof o=="function")?o:O(a)}function j(a){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},j(a)}function O(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function C(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(o&&o.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),o&&p(a,o)}function p(a,o){return p=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},p(a,o)}function b(a,o,r){return o in a?Object.defineProperty(a,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[o]=r,a}var H=1e-4,I=function(o,r){return Math.abs(o-r)<H},m=function(a){C(o,a);function o(){var r,n;R(this,o);for(var i=arguments.length,s=new Array(i),P=0;P<i;P++)s[P]=arguments[P];return n=y(this,(r=j(o)).call.apply(r,[this].concat(s))),b(O(n),"onResize",function(){n.rafId&&window.cancelAnimationFrame(n.rafId),n.rafId=window.requestAnimationFrame(n.update.bind(O(n)))}),b(O(n),"onToggled",function(E){typeof n.props.onToggled=="function"&&setTimeout(function(){return n.props.onToggled(E)},0)}),b(O(n),"onTruncated",function(){typeof n.props.onTruncated=="function"&&setTimeout(function(){return n.props.onTruncated()},0)}),b(O(n),"onCalculated",function(){typeof n.props.onCalculated=="function"&&setTimeout(function(){return n.props.onCalculated()},0)}),b(O(n),"update",function(){var E=window.getComputedStyle(n.scope),K=[E["font-weight"],E["font-style"],E["font-size"],E["font-family"],E["letter-spacing"]].join(" ");n.canvas.font=K,n.forceUpdate()}),n}return B(o,[{key:"componentDidMount",value:function(){var n=document.createElement("canvas"),i=document.createDocumentFragment(),s=window.getComputedStyle(this.scope),P=[s["font-weight"],s["font-style"],s["font-size"],s["font-family"]].join(" ");i.appendChild(n),this.canvas=n.getContext("2d"),this.canvas.font=P,this.forceUpdate(),window.addEventListener("resize",this.onResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize),this.rafId&&window.cancelAnimationFrame(this.rafId)}},{key:"measureWidth",value:function(n){return this.canvas.measureText(n).width}},{key:"getRenderText",value:function(){var n=this.props,i=n.containerClassName,s=n.element,P=n.line,E=n.onCalculated,K=n.onTruncated,w=n.onToggled,u=n.text,F=n.textElement,S=n.textTruncateChild,J=n.truncateText,tt=n.maxCalculateTimes,V=L(n,["containerClassName","element","line","onCalculated","onTruncated","onToggled","text","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),$=this.scope.getBoundingClientRect().width;if($===0)return null;var q=this.measureWidth(u);if($>q||I($,q))return this.onToggled(!1),(0,l.createElement)(F,V,u);var G="";if(S&&typeof S.type=="string"){var _=S.type;(_.indexOf("span")>=0||_.indexOf("a")>=0)&&(G=S.props.children)}for(var v=1,N=u.length,A="",k=0,U=0,X=P,Y=0,Q=!1,rt=!1,et=0,nt=-1,ot="",at=0;X-- >0;){for(ot=X?"":J+(G?" "+G:"");v<=N;)if(A=u.substr(U,v),Y=this.measureWidth(A+ot),Y<$)k=u.indexOf(" ",v+1),k===-1?(v+=1,Q=!1):(Q=!0,v=k);else{do{if(at++>=tt)break;A=u.substr(U,v),X||v--,A[A.length-1]===" "&&(A=u.substr(U,v-1)),Q?(nt=A.lastIndexOf(" "),nt>-1?(v=nt,X&&v++,A=u.substr(U,v)):(v--,A=u.substr(U,v))):(v--,A=u.substr(U,v)),Y=this.measureWidth(A+ot)}while((Y>$||I(Y,$))&&A.length>0);U+=v;break}if(v>=N){U=N;break}Q&&!rt&&u.substr(et,v).indexOf(" ")===-1&&(rt=u.substr(et,v).indexOf(" ")===-1,X--),et=v+1}return U===N?(this.onToggled(!1),(0,l.createElement)(F,V,u)):(this.onTruncated(),this.onToggled(!0),M.default.createElement("span",V,(0,l.createElement)(F,V,u.substr(0,U)+J+" "),S))}},{key:"render",value:function(){var n=this,i=this.props,s=i.element,P=i.text,E=i.style,K=E===void 0?{}:E,w=i.containerClassName,u=i.line,F=i.onCalculated,S=i.onTruncated,J=i.onToggled,tt=i.textElement,V=i.textTruncateChild,$=i.truncateText,q=i.maxCalculateTimes,G=L(i,["element","text","style","containerClassName","line","onCalculated","onTruncated","onToggled","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),_=K.fontWeight,v=K.fontStyle,N=K.fontSize,A=K.fontFamily,k=this.scope&&u?this.getRenderText():(0,l.createElement)(tt,G,P),U={ref:function(Y){n.scope=Y},className:w,style:{overflow:"hidden",fontWeight:_,fontStyle:v,fontSize:N,fontFamily:A}};return this.scope&&this.onCalculated(),(0,l.createElement)(s,U,k)}}]),o}(l.Component);b(m,"propTypes",{containerClassName:f.default.string,element:f.default.string,line:f.default.oneOfType([f.default.number,f.default.bool]),onCalculated:f.default.func,onTruncated:f.default.func,onToggled:f.default.func,text:f.default.string,textElement:f.default.elementType,textTruncateChild:f.default.node,truncateText:f.default.string,maxCalculateTimes:f.default.number}),b(m,"defaultProps",{element:"div",line:1,text:"",textElement:"span",truncateText:"\u2026",maxCalculateTimes:10}),d.default=m,z.exports=d.default})},59119:function(z,g,t){t.d(g,{O:function(){return Z}});var e=t(52322),T=t(79692),x=t(80030),d=t(2784),l=t(15277),D=t.n(l),M=t(29862);const f=(0,T.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Z(c){const[L,h]=(0,d.useState)(!1),R=(0,M.t)(),W=f(),B=j=>{R()&&h(j)};var y;return(0,e.jsx)(x.ZP,{title:(y=c.title)!==null&&y!==void 0?y:c.text||"",placement:c.placement,disableHoverListener:!L,children:(0,e.jsx)(D(),{text:c.text,line:c.line,onToggled:B,containerClassName:W.container})})}},1546:function(z,g,t){t.d(g,{r:function(){return a}});var e=t(52322),T=t(94339),x=t(14503),d=t(24579),l=t(32552),D=t(85256),M=t(79692),f=t(15459),Z=t(72779),c=t.n(Z),L=t(2784),h=t(62774),R=t(90436),W=t(27597),B=t(98864);const y=(0,M.Z)(o=>({root:{maxWidth:"fit-content",padding:o.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:o.palette.textSubtle},arrow:{color:o.palette.textSubtle}}),{name:"BackstageBottomLink"});function j(o){const{link:r,title:n,onClick:i}=o,s=y();return(0,e.jsxs)(h.Z,{children:[(0,e.jsx)(D.Z,{}),(0,e.jsx)(B.rU,{to:r,onClick:i,underline:"none",children:(0,e.jsxs)(h.Z,{display:"flex",alignItems:"center",className:s.root,children:[(0,e.jsx)(h.Z,{className:s.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,e.jsx)(R.Z,{children:(0,e.jsx)("strong",{children:n})})}),(0,e.jsx)(W.Z,{className:s.arrow})]})})]})}var O=t(15929),C=t(74359);const p=o=>{const{slackChannel:r}=o;if(r){if(typeof r=="string")return(0,e.jsxs)(R.Z,{children:["Please contact ",r," for help."]});if(!r.href)return(0,e.jsxs)(R.Z,{children:["Please contact ",r.name," for help."]})}else return null;return(0,e.jsx)(O.Q,{to:r.href,variant:"contained",children:r.name})},b=class extends L.Component{componentDidCatch(r,n){console.error(`ErrorBoundary, error: ${r}, info: ${n}`),this.setState({error:r,errorInfo:n})}render(){const{slackChannel:r,children:n}=this.props,{error:i}=this.state;return i?(0,e.jsx)(C.y,{title:"Something Went Wrong",error:i,children:(0,e.jsx)(p,{slackChannel:r})}):n}constructor(r){super(r),this.state={error:void 0,errorInfo:void 0}}},H=(0,M.Z)(o=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:o.spacing(2,2,2,2.5)},headerTitle:{fontWeight:o.typography.fontWeightBold},headerSubheader:{paddingTop:o.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),I=(0,f.Z)(o=>({root:{display:"inline-block",padding:o.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(x.Z),m={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function a(o){const{title:r,subheader:n,divider:i=!0,deepLink:s,slackChannel:P,errorBoundaryProps:E,variant:K,children:w,headerStyle:u,headerProps:F,icon:S,action:J,actionsClassName:tt,actions:V,cardClassName:$,actionsTopRight:q,className:G,noPadding:_,titleTypographyProps:v}=o,N=H();let A={},k={};K&&K.split(/[\s]+/g).forEach(Q=>{A={...A,...m.card[Q]},k={...k,...m.cardContent[Q]}});const U=()=>!n&&!S?null:(0,e.jsxs)("div",{className:N.headerSubheader,"data-testid":"info-card-subheader",children:[n&&(0,e.jsx)("div",{className:N.subheader,children:n}),S]}),X=E||(P?{slackChannel:P}:{});return(0,e.jsx)(T.Z,{style:A,className:G,children:(0,e.jsxs)(b,{...X,children:[r&&(0,e.jsx)(l.Z,{classes:{root:N.header,title:N.headerTitle,subheader:N.headerSubheader,avatar:N.headerAvatar,action:N.headerAction,content:N.headerContent},title:r,subheader:U(),action:J,style:{...u},titleTypographyProps:v,...F}),q&&(0,e.jsx)(I,{children:q}),i&&(0,e.jsx)(D.Z,{}),(0,e.jsx)(d.Z,{className:c()($,{[N.noPadding]:_}),style:k,children:w}),V&&(0,e.jsx)(x.Z,{className:tt,children:V}),s&&(0,e.jsx)(j,{...s})]})})}},48283:function(z,g,t){t.d(g,{u:function(){return B}});var e=t(52322),T=t(79692),x=t(2784),d=t(8709),l=t(59119),D=t(75435),M=t(86540),f=t(41748),Z=t(68138);const c=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function O(C){var p;return((p=C.metadata)===null||p===void 0?void 0:p.title)||(0,M.$)(C,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(C,p){return O(p).includes(C)},customSort(C,p){return O(C).localeCompare(O(p))},render:C=>{var p;return(0,e.jsx)(f.d,{entityRef:C,defaultKind:j,title:(p=C.metadata)===null||p===void 0?void 0:p.title})}}},createEntityRelationColumn(y){const{title:j,relation:O,defaultKind:C,filter:p}=y;function b(I){return(0,D.h)(I,O,p)}function H(I){return b(I).map(m=>(0,M.$)(m,{defaultKind:C})).join(", ")}return{title:j,customFilterAndSearch(I,m){return H(m).includes(I)},customSort(I,m){return H(I).localeCompare(H(m))},render:I=>(0,e.jsx)(Z.r,{entityRefs:b(I),defaultKind:C})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:d.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:d.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:d.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,e.jsx)(l.O,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),L=[c.createEntityRefColumn({defaultKind:"system"}),c.createDomainColumn(),c.createOwnerColumn(),c.createMetadataDescriptionColumn()],h=[c.createEntityRefColumn({defaultKind:"component"}),c.createSystemColumn(),c.createOwnerColumn(),c.createSpecTypeColumn(),c.createSpecLifecycleColumn(),c.createMetadataDescriptionColumn()];var R=t(84462);const W=(0,T.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),B=y=>{const{entities:j,title:O,emptyContent:C,variant:p="gridItem",columns:b,tableOptions:H={}}=y,I=W(),m={minWidth:"0",width:"100%"};return p==="gridItem"&&(m.height="calc(100% - 10px)"),(0,e.jsx)(R.i,{columns:b,title:O,style:m,emptyContent:C&&(0,e.jsx)("div",{className:I.empty,children:C}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...H},data:j})};B.columns=c,B.systemEntityColumns=L,B.componentEntityColumns=h},96641:function(z,g,t){t.d(g,{X2:function(){return c},h$:function(){return f}});var e=t(52322),T=t(74314),x=t(72388),d=t(29651),l=t(68993),D=t(2784);const M=(0,d.CT)("entity-context"),f=h=>{const{children:R,entity:W,loading:B,error:y,refresh:j}=h,O={entity:W,loading:B,error:y,refresh:j};return(0,e.jsx)(M.Provider,{value:(0,l.E)({1:O}),children:(0,e.jsx)(x.fC,{attributes:{...W?{entityRef:(0,T.eE)(W)}:void 0},children:R})})},Z=h=>_jsx(f,{entity:h.entity,loading:!Boolean(h.entity),error:void 0,refresh:void 0,children:h.children});function c(){const h=(0,d.Vt)("entity-context");if(!h)throw new Error("Entity context is not available");const R=h.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 L(){const h=useVersionedContext("entity-context");if(!h)throw new Error("Entity context is not available");const R=h.atVersion(1);if(!R)throw new Error("EntityContext v1 not available");const{entity:W,loading:B,error:y,refresh:j}=R;return{entity:W,loading:B,error:y,refresh:j}}},79770:function(z,g,t){t.r(g),t.d(g,{HasResourcesCard:function(){return D}});var e=t(52322),T=t(8709),x=t(2784),d=t(30083),l=t(19431);function D(M){const{variant:f="gridItem",title:Z="Has resources"}=M;return(0,e.jsx)(d.f,{variant:f,title:Z,entityKind:"Resource",relationType:T.aS,columns:l.xp,asRenderableEntities:l.$c,emptyMessage:"No resource is part of this system",emptyHelpLink:l.Uc})}},30083:function(z,g,t){t.d(g,{f:function(){return I}});var e=t(52322),T=t(90436),x=t(96641),d=t(74314),l=t(44394),D=t(64279),M=t(88624);function f(m,a){var o,r;const n=a==null||(o=a.type)===null||o===void 0?void 0:o.toLocaleLowerCase("en-US"),i=a==null||(r=a.kind)===null||r===void 0?void 0:r.toLocaleLowerCase("en-US"),s=(0,l.h_)(M.A),{loading:P,value:E,error:K}=(0,D.default)(async()=>{var w;const u=(w=m.relations)===null||w===void 0?void 0:w.filter(S=>(!n||S.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,d.of)(S.targetRef).kind===i));if(!(u!=null&&u.length))return[];const{items:F}=await s.getEntitiesByRefs({entityRefs:u.map(S=>S.targetRef)});return F.filter(S=>Boolean(S))},[m,n,i]);return{entities:E,loading:P,error:K}}var Z=t(48283),c=t(2784),L=t(1546),h=t(55015),R=t(79692),W=t(85256),B=t(38402),y=t(49378),j=t(9791),O=t(58033),C=t(74359);const p=(0,R.Z)(m=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:m.spacing(2)},divider:{margin:m.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function b(m){var a;const{title:o,error:r,defaultExpanded:n}=m,i=p();if(r.name!=="ResponseError")return(0,e.jsx)(C.y,{title:o!=null?o:r.message,defaultExpanded:n,error:r});const{body:s,cause:P}=r,{request:E,response:K}=s,w=`${K.statusCode}: ${P.name}`,u=E&&`${E.method} ${E.url}`,F=P.message.replace(/\\n/g,`
1
+ "use strict";(()=>{(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([[9770],{27597:function(z,g,t){var e,T=t(71600),x=t(34590);e={value:!0},g.Z=void 0;var d=x(t(2784)),l=T(t(50175)),D=(0,l.default)(d.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");g.Z=D},29862:function(z,g,t){t.d(g,{t:function(){return T}});var e=t(2784);function T(x){x===void 0&&(x=!1);var d=(0,e.useRef)(x),l=(0,e.useCallback)(function(){return d.current},[]);return(0,e.useEffect)(function(){return d.current=!0,function(){d.current=!1}},[]),l}},15277:function(z,g,t){var e,T,x;(function(d,l){if(!0)T=[g,t(2784),t(13980)],e=l,x=typeof e=="function"?e.apply(g,T):e,x!==void 0&&(z.exports=x);else var D})(void 0,function(d,l,D){"use strict";Object.defineProperty(d,"__esModule",{value:!0}),d.default=void 0;var M=Z(l),f=Z(D);function Z(a){return a&&a.__esModule?a:{default:a}}function c(a){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(r){return typeof r}:c=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},c(a)}function L(a,o){if(a==null)return{};var r=h(a,o),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);for(i=0;i<s.length;i++)n=s[i],!(o.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(a,n)&&(r[n]=a[n])}return r}function h(a,o){if(a==null)return{};var r={},n=Object.keys(a),i,s;for(s=0;s<n.length;s++)i=n[s],!(o.indexOf(i)>=0)&&(r[i]=a[i]);return r}function R(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}function W(a,o){for(var r=0;r<o.length;r++){var n=o[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}function B(a,o,r){return o&&W(a.prototype,o),r&&W(a,r),a}function y(a,o){return o&&(c(o)==="object"||typeof o=="function")?o:O(a)}function j(a){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},j(a)}function O(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function C(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(o&&o.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),o&&p(a,o)}function p(a,o){return p=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},p(a,o)}function b(a,o,r){return o in a?Object.defineProperty(a,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[o]=r,a}var H=1e-4,I=function(o,r){return Math.abs(o-r)<H},m=function(a){C(o,a);function o(){var r,n;R(this,o);for(var i=arguments.length,s=new Array(i),P=0;P<i;P++)s[P]=arguments[P];return n=y(this,(r=j(o)).call.apply(r,[this].concat(s))),b(O(n),"onResize",function(){n.rafId&&window.cancelAnimationFrame(n.rafId),n.rafId=window.requestAnimationFrame(n.update.bind(O(n)))}),b(O(n),"onToggled",function(E){typeof n.props.onToggled=="function"&&setTimeout(function(){return n.props.onToggled(E)},0)}),b(O(n),"onTruncated",function(){typeof n.props.onTruncated=="function"&&setTimeout(function(){return n.props.onTruncated()},0)}),b(O(n),"onCalculated",function(){typeof n.props.onCalculated=="function"&&setTimeout(function(){return n.props.onCalculated()},0)}),b(O(n),"update",function(){var E=window.getComputedStyle(n.scope),K=[E["font-weight"],E["font-style"],E["font-size"],E["font-family"],E["letter-spacing"]].join(" ");n.canvas.font=K,n.forceUpdate()}),n}return B(o,[{key:"componentDidMount",value:function(){var n=document.createElement("canvas"),i=document.createDocumentFragment(),s=window.getComputedStyle(this.scope),P=[s["font-weight"],s["font-style"],s["font-size"],s["font-family"]].join(" ");i.appendChild(n),this.canvas=n.getContext("2d"),this.canvas.font=P,this.forceUpdate(),window.addEventListener("resize",this.onResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onResize),this.rafId&&window.cancelAnimationFrame(this.rafId)}},{key:"measureWidth",value:function(n){return this.canvas.measureText(n).width}},{key:"getRenderText",value:function(){var n=this.props,i=n.containerClassName,s=n.element,P=n.line,E=n.onCalculated,K=n.onTruncated,w=n.onToggled,u=n.text,F=n.textElement,S=n.textTruncateChild,J=n.truncateText,tt=n.maxCalculateTimes,V=L(n,["containerClassName","element","line","onCalculated","onTruncated","onToggled","text","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),$=this.scope.getBoundingClientRect().width;if($===0)return null;var q=this.measureWidth(u);if($>q||I($,q))return this.onToggled(!1),(0,l.createElement)(F,V,u);var G="";if(S&&typeof S.type=="string"){var _=S.type;(_.indexOf("span")>=0||_.indexOf("a")>=0)&&(G=S.props.children)}for(var v=1,N=u.length,A="",k=0,U=0,X=P,Y=0,Q=!1,rt=!1,et=0,nt=-1,ot="",at=0;X-- >0;){for(ot=X?"":J+(G?" "+G:"");v<=N;)if(A=u.substr(U,v),Y=this.measureWidth(A+ot),Y<$)k=u.indexOf(" ",v+1),k===-1?(v+=1,Q=!1):(Q=!0,v=k);else{do{if(at++>=tt)break;A=u.substr(U,v),X||v--,A[A.length-1]===" "&&(A=u.substr(U,v-1)),Q?(nt=A.lastIndexOf(" "),nt>-1?(v=nt,X&&v++,A=u.substr(U,v)):(v--,A=u.substr(U,v))):(v--,A=u.substr(U,v)),Y=this.measureWidth(A+ot)}while((Y>$||I(Y,$))&&A.length>0);U+=v;break}if(v>=N){U=N;break}Q&&!rt&&u.substr(et,v).indexOf(" ")===-1&&(rt=u.substr(et,v).indexOf(" ")===-1,X--),et=v+1}return U===N?(this.onToggled(!1),(0,l.createElement)(F,V,u)):(this.onTruncated(),this.onToggled(!0),M.default.createElement("span",V,(0,l.createElement)(F,V,u.substr(0,U)+J+" "),S))}},{key:"render",value:function(){var n=this,i=this.props,s=i.element,P=i.text,E=i.style,K=E===void 0?{}:E,w=i.containerClassName,u=i.line,F=i.onCalculated,S=i.onTruncated,J=i.onToggled,tt=i.textElement,V=i.textTruncateChild,$=i.truncateText,q=i.maxCalculateTimes,G=L(i,["element","text","style","containerClassName","line","onCalculated","onTruncated","onToggled","textElement","textTruncateChild","truncateText","maxCalculateTimes"]),_=K.fontWeight,v=K.fontStyle,N=K.fontSize,A=K.fontFamily,k=this.scope&&u?this.getRenderText():(0,l.createElement)(tt,G,P),U={ref:function(Y){n.scope=Y},className:w,style:{overflow:"hidden",fontWeight:_,fontStyle:v,fontSize:N,fontFamily:A}};return this.scope&&this.onCalculated(),(0,l.createElement)(s,U,k)}}]),o}(l.Component);b(m,"propTypes",{containerClassName:f.default.string,element:f.default.string,line:f.default.oneOfType([f.default.number,f.default.bool]),onCalculated:f.default.func,onTruncated:f.default.func,onToggled:f.default.func,text:f.default.string,textElement:f.default.elementType,textTruncateChild:f.default.node,truncateText:f.default.string,maxCalculateTimes:f.default.number}),b(m,"defaultProps",{element:"div",line:1,text:"",textElement:"span",truncateText:"\u2026",maxCalculateTimes:10}),d.default=m,z.exports=d.default})},59119:function(z,g,t){t.d(g,{O:function(){return Z}});var e=t(52322),T=t(79692),x=t(80030),d=t(2784),l=t(15277),D=t.n(l),M=t(29862);const f=(0,T.Z)({container:{overflow:"visible !important"}},{name:"BackstageOverflowTooltip"});function Z(c){const[L,h]=(0,d.useState)(!1),R=(0,M.t)(),W=f(),B=j=>{R()&&h(j)};var y;return(0,e.jsx)(x.ZP,{title:(y=c.title)!==null&&y!==void 0?y:c.text||"",placement:c.placement,disableHoverListener:!L,children:(0,e.jsx)(D(),{text:c.text,line:c.line,onToggled:B,containerClassName:W.container})})}},1546:function(z,g,t){t.d(g,{r:function(){return a}});var e=t(52322),T=t(94339),x=t(14503),d=t(24579),l=t(32552),D=t(85256),M=t(79692),f=t(15459),Z=t(72779),c=t.n(Z),L=t(2784),h=t(62774),R=t(90436),W=t(27597),B=t(98864);const y=(0,M.Z)(o=>({root:{maxWidth:"fit-content",padding:o.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:o.palette.textSubtle},arrow:{color:o.palette.textSubtle}}),{name:"BackstageBottomLink"});function j(o){const{link:r,title:n,onClick:i}=o,s=y();return(0,e.jsxs)(h.Z,{children:[(0,e.jsx)(D.Z,{}),(0,e.jsx)(B.rU,{to:r,onClick:i,underline:"none",children:(0,e.jsxs)(h.Z,{display:"flex",alignItems:"center",className:s.root,children:[(0,e.jsx)(h.Z,{className:s.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,e.jsx)(R.Z,{children:(0,e.jsx)("strong",{children:n})})}),(0,e.jsx)(W.Z,{className:s.arrow})]})})]})}var O=t(15929),C=t(74359);const p=o=>{const{slackChannel:r}=o;if(r){if(typeof r=="string")return(0,e.jsxs)(R.Z,{children:["Please contact ",r," for help."]});if(!r.href)return(0,e.jsxs)(R.Z,{children:["Please contact ",r.name," for help."]})}else return null;return(0,e.jsx)(O.Q,{to:r.href,variant:"contained",children:r.name})},b=class extends L.Component{componentDidCatch(r,n){console.error(`ErrorBoundary, error: ${r}, info: ${n}`),this.setState({error:r,errorInfo:n})}render(){const{slackChannel:r,children:n}=this.props,{error:i}=this.state;return i?(0,e.jsx)(C.y,{title:"Something Went Wrong",error:i,children:(0,e.jsx)(p,{slackChannel:r})}):n}constructor(r){super(r),this.state={error:void 0,errorInfo:void 0}}},H=(0,M.Z)(o=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},header:{padding:o.spacing(2,2,2,2.5)},headerTitle:{fontWeight:o.typography.fontWeightBold},headerSubheader:{paddingTop:o.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),I=(0,f.Z)(o=>({root:{display:"inline-block",padding:o.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(x.Z),m={card:{flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},cardContent:{fullHeight:{flex:1},gridItem:{flex:1}}};function a(o){const{title:r,subheader:n,divider:i=!0,deepLink:s,slackChannel:P,errorBoundaryProps:E,variant:K,children:w,headerStyle:u,headerProps:F,icon:S,action:J,actionsClassName:tt,actions:V,cardClassName:$,actionsTopRight:q,className:G,noPadding:_,titleTypographyProps:v}=o,N=H();let A={},k={};K&&K.split(/[\s]+/g).forEach(Q=>{A={...A,...m.card[Q]},k={...k,...m.cardContent[Q]}});const U=()=>!n&&!S?null:(0,e.jsxs)("div",{className:N.headerSubheader,"data-testid":"info-card-subheader",children:[n&&(0,e.jsx)("div",{className:N.subheader,children:n}),S]}),X=E||(P?{slackChannel:P}:{});return(0,e.jsx)(T.Z,{style:A,className:G,children:(0,e.jsxs)(b,{...X,children:[r&&(0,e.jsx)(l.Z,{classes:{root:N.header,title:N.headerTitle,subheader:N.headerSubheader,avatar:N.headerAvatar,action:N.headerAction,content:N.headerContent},title:r,subheader:U(),action:J,style:{...u},titleTypographyProps:v,...F}),q&&(0,e.jsx)(I,{children:q}),i&&(0,e.jsx)(D.Z,{}),(0,e.jsx)(d.Z,{className:c()($,{[N.noPadding]:_}),style:k,children:w}),V&&(0,e.jsx)(x.Z,{className:tt,children:V}),s&&(0,e.jsx)(j,{...s})]})})}},48283:function(z,g,t){t.d(g,{u:function(){return B}});var e=t(52322),T=t(79692),x=t(2784),d=t(8709),l=t(59119),D=t(75435),M=t(86540),f=t(84719),Z=t(51194);const c=Object.freeze({createEntityRefColumn(y){const{defaultKind:j}=y;function O(C){var p;return((p=C.metadata)===null||p===void 0?void 0:p.title)||(0,M.$)(C,{defaultKind:j})}return{title:"Name",highlight:!0,customFilterAndSearch(C,p){return O(p).includes(C)},customSort(C,p){return O(C).localeCompare(O(p))},render:C=>{var p;return(0,e.jsx)(f.d,{entityRef:C,defaultKind:j,title:(p=C.metadata)===null||p===void 0?void 0:p.title})}}},createEntityRelationColumn(y){const{title:j,relation:O,defaultKind:C,filter:p}=y;function b(I){return(0,D.h)(I,O,p)}function H(I){return b(I).map(m=>(0,M.$)(m,{defaultKind:C})).join(", ")}return{title:j,customFilterAndSearch(I,m){return H(m).includes(I)},customSort(I,m){return H(I).localeCompare(H(m))},render:I=>(0,e.jsx)(Z.r,{entityRefs:b(I),defaultKind:C})}},createOwnerColumn(){return this.createEntityRelationColumn({title:"Owner",relation:d.S4,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:"Domain",relation:d.cz,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:"System",relation:d.cz,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn(){return{title:"Description",field:"metadata.description",render:y=>(0,e.jsx)(l.O,{text:y.metadata.description,placement:"bottom-start",line:2})}},createSpecLifecycleColumn(){return{title:"Lifecycle",field:"spec.lifecycle"}},createSpecTypeColumn(){return{title:"Type",field:"spec.type"}}}),L=[c.createEntityRefColumn({defaultKind:"system"}),c.createDomainColumn(),c.createOwnerColumn(),c.createMetadataDescriptionColumn()],h=[c.createEntityRefColumn({defaultKind:"component"}),c.createSystemColumn(),c.createOwnerColumn(),c.createSpecTypeColumn(),c.createSpecLifecycleColumn(),c.createMetadataDescriptionColumn()];var R=t(84462);const W=(0,T.Z)(y=>({empty:{padding:y.spacing(2),display:"flex",justifyContent:"center"}})),B=y=>{const{entities:j,title:O,emptyContent:C,variant:p="gridItem",columns:b,tableOptions:H={}}=y,I=W(),m={minWidth:"0",width:"100%"};return p==="gridItem"&&(m.height="calc(100% - 10px)"),(0,e.jsx)(R.i,{columns:b,title:O,style:m,emptyContent:C&&(0,e.jsx)("div",{className:I.empty,children:C}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...H},data:j})};B.columns=c,B.systemEntityColumns=L,B.componentEntityColumns=h},96641:function(z,g,t){t.d(g,{X2:function(){return c},h$:function(){return f}});var e=t(52322),T=t(74314),x=t(72388),d=t(29651),l=t(68993),D=t(2784);const M=(0,d.CT)("entity-context"),f=h=>{const{children:R,entity:W,loading:B,error:y,refresh:j}=h,O={entity:W,loading:B,error:y,refresh:j};return(0,e.jsx)(M.Provider,{value:(0,l.E)({1:O}),children:(0,e.jsx)(x.fC,{attributes:{...W?{entityRef:(0,T.eE)(W)}:void 0},children:R})})},Z=h=>_jsx(f,{entity:h.entity,loading:!Boolean(h.entity),error:void 0,refresh:void 0,children:h.children});function c(){const h=(0,d.Vt)("entity-context");if(!h)throw new Error("Entity context is not available");const R=h.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 L(){const h=useVersionedContext("entity-context");if(!h)throw new Error("Entity context is not available");const R=h.atVersion(1);if(!R)throw new Error("EntityContext v1 not available");const{entity:W,loading:B,error:y,refresh:j}=R;return{entity:W,loading:B,error:y,refresh:j}}},79770:function(z,g,t){t.r(g),t.d(g,{HasResourcesCard:function(){return D}});var e=t(52322),T=t(8709),x=t(2784),d=t(30083),l=t(19431);function D(M){const{variant:f="gridItem",title:Z="Has resources"}=M;return(0,e.jsx)(d.f,{variant:f,title:Z,entityKind:"Resource",relationType:T.aS,columns:l.xp,asRenderableEntities:l.$c,emptyMessage:"No resource is part of this system",emptyHelpLink:l.Uc})}},30083:function(z,g,t){t.d(g,{f:function(){return I}});var e=t(52322),T=t(90436),x=t(96641),d=t(74314),l=t(44394),D=t(64279),M=t(88624);function f(m,a){var o,r;const n=a==null||(o=a.type)===null||o===void 0?void 0:o.toLocaleLowerCase("en-US"),i=a==null||(r=a.kind)===null||r===void 0?void 0:r.toLocaleLowerCase("en-US"),s=(0,l.h_)(M.A),{loading:P,value:E,error:K}=(0,D.default)(async()=>{var w;const u=(w=m.relations)===null||w===void 0?void 0:w.filter(S=>(!n||S.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,d.of)(S.targetRef).kind===i));if(!(u!=null&&u.length))return[];const{items:F}=await s.getEntitiesByRefs({entityRefs:u.map(S=>S.targetRef)});return F.filter(S=>Boolean(S))},[m,n,i]);return{entities:E,loading:P,error:K}}var Z=t(48283),c=t(2784),L=t(1546),h=t(55015),R=t(79692),W=t(85256),B=t(38402),y=t(49378),j=t(9791),O=t(58033),C=t(74359);const p=(0,R.Z)(m=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:m.spacing(2)},divider:{margin:m.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function b(m){var a;const{title:o,error:r,defaultExpanded:n}=m,i=p();if(r.name!=="ResponseError")return(0,e.jsx)(C.y,{title:o!=null?o:r.message,defaultExpanded:n,error:r});const{body:s,cause:P}=r,{request:E,response:K}=s,w=`${K.statusCode}: ${P.name}`,u=E&&`${E.method} ${E.url}`,F=P.message.replace(/\\n/g,`
2
2
  `),S=(a=P.stack)===null||a===void 0?void 0:a.replace(/\\n/g,`
3
3
  `),J=JSON.stringify(s,void 0,2);return(0,e.jsxs)(C.y,{title:o!=null?o:r.message,defaultExpanded:n,error:{name:w,message:F,stack:S},children:[u&&(0,e.jsxs)(B.Z,{alignItems:"flex-start",children:[(0,e.jsx)(y.Z,{classes:{secondary:i.text},primary:"Request",secondary:E?`${u}`:void 0}),(0,e.jsx)(O.b,{text:u})]}),(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(W.Z,{component:"li",className:i.divider}),(0,e.jsx)(B.Z,{alignItems:"flex-start",children:(0,e.jsx)(y.Z,{classes:{secondary:i.text},primary:"Full Error as JSON"})}),(0,e.jsx)(j.O,{language:"json",text:J,showCopyCodeButton:!0})]})]})}var H=t(98864);function I(m){const{variant:a="gridItem",title:o,columns:r,entityKind:n,relationType:i,emptyMessage:s,emptyHelpLink:P,asRenderableEntities:E,tableOptions:K={}}=m,{entity:w}=(0,x.X2)(),{entities:u,loading:F,error:S}=f(w,{type:i,kind:n});return F?(0,e.jsx)(L.r,{variant:a,title:o,children:(0,e.jsx)(h.E,{})}):S?(0,e.jsx)(L.r,{variant:a,title:o,children:(0,e.jsx)(b,{error:S})}):(0,e.jsx)(Z.u,{title:o,variant:a,emptyContent:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)(T.Z,{variant:"body1",children:s}),(0,e.jsx)(T.Z,{variant:"body2",children:(0,e.jsx)(H.rU,{to:P,children:"Learn how to change this."})})]}),columns:r,entities:E(u||[]),tableOptions:K})}},19431:function(z,g,t){t.d(g,{$c:function(){return M},AE:function(){return x},D:function(){return d},G5:function(){return Z},Uc:function(){return D},_v:function(){return f},el:function(){return c},we:function(){return T},xp:function(){return l}});var e=t(48283);const T=[e.u.columns.createEntityRefColumn({defaultKind:"component"}),e.u.columns.createOwnerColumn(),e.u.columns.createSpecTypeColumn(),e.u.columns.createSpecLifecycleColumn(),e.u.columns.createMetadataDescriptionColumn()],x="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",d=L=>L,l=[e.u.columns.createEntityRefColumn({defaultKind:"resource"}),e.u.columns.createOwnerColumn(),e.u.columns.createSpecTypeColumn(),e.u.columns.createSpecLifecycleColumn(),e.u.columns.createMetadataDescriptionColumn()],D="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",M=L=>L,f=[e.u.columns.createEntityRefColumn({defaultKind:"system"}),e.u.columns.createOwnerColumn(),e.u.columns.createMetadataDescriptionColumn()],Z="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",c=L=>L}}]);})();
4
4
 
5
- //# sourceMappingURL=9770.5cb016d6.chunk.js.map
5
+ //# sourceMappingURL=9770.2d75fe33.chunk.js.map