@techdocs/cli 1.10.2 → 1.10.3-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/commands/serve/mkdocs.cjs.js +4 -5
- package/dist/commands/serve/mkdocs.cjs.js.map +1 -1
- package/dist/commands/serve/serve.cjs.js +4 -5
- package/dist/commands/serve/serve.cjs.js.map +1 -1
- package/dist/commands/serve/utils.cjs.js +7 -10
- package/dist/commands/serve/utils.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +227 -230
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/1155.1bc918a1.chunk.js +10 -0
- package/dist/embedded-app/static/{1155.c6c120ba.chunk.js.map → 1155.1bc918a1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1335.e649d01a.chunk.js → 1335.d9759037.chunk.js} +2 -2
- package/dist/embedded-app/static/{1335.e649d01a.chunk.js.map → 1335.d9759037.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1749.ecaae025.chunk.js → 1749.aa6bc589.chunk.js} +2 -2
- package/dist/embedded-app/static/{1749.ecaae025.chunk.js.map → 1749.aa6bc589.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1994.90be16c3.chunk.js → 1994.ca9d4fc1.chunk.js} +2 -2
- package/dist/embedded-app/static/{1994.90be16c3.chunk.js.map → 1994.ca9d4fc1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2295.676254a6.chunk.js → 2295.3f44c986.chunk.js} +2 -2
- package/dist/embedded-app/static/{2295.676254a6.chunk.js.map → 2295.3f44c986.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4591.8c1cd36f.chunk.js +2 -0
- package/dist/embedded-app/static/4591.8c1cd36f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{4648.42e253c5.chunk.js → 4648.68d2c6ff.chunk.js} +2 -2
- package/dist/embedded-app/static/{4648.42e253c5.chunk.js.map → 4648.68d2c6ff.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5574.3e0b1b01.chunk.js → 5574.723a5e64.chunk.js} +2 -2
- package/dist/embedded-app/static/{5574.3e0b1b01.chunk.js.map → 5574.723a5e64.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7203.f047878f.chunk.js → 6138.ca5f4dea.chunk.js} +2 -2
- package/dist/embedded-app/static/{6138.72f63616.chunk.js.map → 6138.ca5f4dea.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6270.33cbf043.chunk.js +2 -0
- package/dist/embedded-app/static/{6270.0cf24ebb.chunk.js.map → 6270.33cbf043.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7186.96e6edf9.chunk.js +2 -0
- package/dist/embedded-app/static/{7186.c0fa7899.chunk.js.map → 7186.96e6edf9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6138.72f63616.chunk.js → 7203.7288c4e0.chunk.js} +2 -2
- package/dist/embedded-app/static/{7203.f047878f.chunk.js.map → 7203.7288c4e0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7226.99db194a.chunk.js +2 -0
- package/dist/embedded-app/static/{7226.f8fc7544.chunk.js.map → 7226.99db194a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7382.688a734f.chunk.js → 7382.836db1c7.chunk.js} +2 -2
- package/dist/embedded-app/static/{7382.688a734f.chunk.js.map → 7382.836db1c7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7526.601d8e47.chunk.js +2 -0
- package/dist/embedded-app/static/{7526.a9e2aca8.chunk.js.map → 7526.601d8e47.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8125.d73ed16d.chunk.js → 8125.2e82046f.chunk.js} +3 -3
- package/dist/embedded-app/static/{8125.d73ed16d.chunk.js.map → 8125.2e82046f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9050.47091371.chunk.js → 9050.1b486cae.chunk.js} +2 -2
- package/dist/embedded-app/static/{9050.47091371.chunk.js.map → 9050.1b486cae.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9230.57f4ae14.chunk.js → 9230.02b12ff0.chunk.js} +2 -2
- package/dist/embedded-app/static/{9230.57f4ae14.chunk.js.map → 9230.02b12ff0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9579.46a875e3.chunk.js → 9579.beaea584.chunk.js} +2 -2
- package/dist/embedded-app/static/{9579.46a875e3.chunk.js.map → 9579.beaea584.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.1e025874.js +550 -0
- package/dist/embedded-app/static/main.1e025874.js.map +1 -0
- package/dist/embedded-app/static/{runtime.1ed9627a.js → runtime.a358dfe6.js} +2 -2
- package/dist/embedded-app/static/runtime.a358dfe6.js.map +1 -0
- package/dist/embedded-app/static/vendor.4b7983a7.js +2 -0
- package/dist/embedded-app/static/vendor.4b7983a7.js.map +1 -0
- package/dist/lib/mkdocsServer.cjs.js +10 -10
- package/dist/lib/mkdocsServer.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/1155.c6c120ba.chunk.js +0 -10
- package/dist/embedded-app/static/4591.c7904e2c.chunk.js +0 -2
- package/dist/embedded-app/static/4591.c7904e2c.chunk.js.map +0 -1
- package/dist/embedded-app/static/6270.0cf24ebb.chunk.js +0 -2
- package/dist/embedded-app/static/7186.c0fa7899.chunk.js +0 -2
- package/dist/embedded-app/static/7226.f8fc7544.chunk.js +0 -2
- package/dist/embedded-app/static/7526.a9e2aca8.chunk.js +0 -2
- package/dist/embedded-app/static/main.a9a0a87c.js +0 -550
- package/dist/embedded-app/static/main.a9a0a87c.js.map +0 -1
- package/dist/embedded-app/static/runtime.1ed9627a.js.map +0 -1
- package/dist/embedded-app/static/vendor.5686e88b.js +0 -2
- package/dist/embedded-app/static/vendor.5686e88b.js.map +0 -1
- package/dist/lib/run.cjs.js +0 -58
- package/dist/lib/run.cjs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/2295.676254a6.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/ArrowForward.js","webpack://techdocs-cli-embedded-app/../core-components/src/layout/BottomLink/BottomLink.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/InfoCard/InfoCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/translation.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLabelsCard/EntityLabelsEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLabelsCard/EntityLabelsCard.tsx"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\"\n}), 'ArrowForward');\n\nexports.default = _default;","/*\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 Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ArrowIcon from '@material-ui/icons/ArrowForward';\nimport { MouseEvent } from 'react';\nimport { Link } from '../../components/Link';\n\n/** @public */\nexport type BottomLinkClassKey = 'root' | 'boxTitle' | 'arrow';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n maxWidth: 'fit-content',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n boxTitle: {\n margin: 0,\n color: theme.palette.textSubtle,\n },\n arrow: {\n color: theme.palette.textSubtle,\n },\n }),\n { name: 'BackstageBottomLink' },\n);\n\n/** @public */\nexport type BottomLinkProps = {\n link: string;\n title: string;\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n};\n\n/**\n * Footer with link used in {@link InfoCard } and {@link TabbedCard}\n *\n * @public\n *\n */\nexport function BottomLink(props: BottomLinkProps) {\n const { link, title, onClick } = props;\n const classes = useStyles();\n\n return (\n <Box>\n <Divider />\n <Link to={link} onClick={onClick} underline=\"none\">\n <Box display=\"flex\" alignItems=\"center\" className={classes.root}>\n <Box className={classes.boxTitle} fontWeight=\"fontWeightBold\" m={1}>\n <Typography>\n <strong>{title}</strong>\n </Typography>\n </Box>\n <ArrowIcon className={classes.arrow} />\n </Box>\n </Link>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Typography from '@material-ui/core/Typography';\nimport { PropsWithChildren, ComponentClass, Component, ErrorInfo } from 'react';\nimport { LinkButton } from '../../components/LinkButton';\nimport { ErrorPanel } from '../../components/ErrorPanel';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype SlackChannel = {\n name: string;\n href?: string;\n};\n\n/** @public */\nexport type ErrorBoundaryProps = PropsWithChildren<{\n slackChannel?: string | SlackChannel;\n onError?: (error: Error, errorInfo: string) => null;\n}>;\n\ntype State = {\n error?: Error;\n errorInfo?: ErrorInfo;\n};\n\nconst SlackLink = (props: { slackChannel?: string | SlackChannel }) => {\n const { slackChannel } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n if (!slackChannel) {\n return null;\n } else if (typeof slackChannel === 'string') {\n return (\n <Typography>{t('errorBoundary.title', { slackChannel })}</Typography>\n );\n } else if (!slackChannel.href) {\n return (\n <Typography>\n {t('errorBoundary.title', {\n slackChannel: slackChannel.name,\n })}\n </Typography>\n );\n }\n\n return (\n <LinkButton to={slackChannel.href} variant=\"contained\">\n {slackChannel.name}\n </LinkButton>\n );\n};\n\n/** @public */\nexport const ErrorBoundary: ComponentClass<\n ErrorBoundaryProps,\n State\n> = class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {\n error: undefined,\n errorInfo: undefined,\n };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // eslint-disable-next-line no-console\n console.error(`ErrorBoundary, error: ${error}`, { error, errorInfo });\n this.setState({ error, errorInfo });\n }\n\n render() {\n const { slackChannel, children } = this.props;\n const { error } = this.state;\n\n if (!error) {\n return children;\n }\n\n return (\n <ErrorPanel title=\"Something Went Wrong\" error={error}>\n <SlackLink slackChannel={slackChannel} />\n </ErrorPanel>\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 Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader, { CardHeaderProps } from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { ReactNode } from 'react';\nimport { BottomLink, BottomLinkProps } from '../BottomLink';\nimport { ErrorBoundary, ErrorBoundaryProps } from '../ErrorBoundary';\n\n/** @public */\nexport type InfoCardClassKey =\n | 'noPadding'\n | 'header'\n | 'headerTitle'\n | 'headerSubheader'\n | 'headerAvatar'\n | 'headerAction'\n | 'headerContent';\n\nconst useStyles = makeStyles(\n theme => ({\n noPadding: {\n padding: 0,\n '&:last-child': {\n paddingBottom: 0,\n },\n },\n contentAlignBottom: {\n display: 'flex',\n alignItems: 'self-end',\n },\n header: {\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n headerTitle: {\n fontWeight: theme.typography.fontWeightBold,\n },\n headerSubheader: {\n paddingTop: theme.spacing(1),\n },\n headerAvatar: {},\n headerAction: {},\n headerContent: {},\n subheader: {\n display: 'flex',\n },\n }),\n { name: 'BackstageInfoCard' },\n);\n\n/** @public */\nexport type CardActionsTopRightClassKey = 'root';\n\nconst CardActionsTopRight = withStyles(\n theme => ({\n root: {\n display: 'inline-block',\n padding: theme.spacing(8, 8, 0, 0),\n float: 'right',\n },\n }),\n { name: 'BackstageInfoCardCardActionsTopRight' },\n)(CardActions);\n\nconst VARIANT_STYLES = {\n card: {\n flex: {\n display: 'flex',\n flexDirection: 'column',\n },\n fullHeight: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItem: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n breakInside: 'avoid-page',\n '@media print': {\n height: 'auto',\n },\n },\n },\n cardContent: {\n fullHeight: {\n flex: 1,\n },\n gridItem: {\n flex: 1,\n },\n },\n};\n\n/** @public */\nexport type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';\n\n/**\n * InfoCard is used to display a paper-styled block on the screen, similar to a panel.\n *\n * You can custom style an InfoCard with the 'className' (outer container) and 'cardClassName' (inner container)\n * props. This is typically used with the material-ui makeStyles mechanism.\n *\n * The InfoCard serves as an error boundary. As a result, if you provide an 'errorBoundaryProps' property this\n * specifies the extra information to display in the error component that is displayed if an error occurs\n * in any descendent components.\n *\n * By default the InfoCard has no custom layout of its children, but is treated as a block element. A\n * couple common variants are provided and can be specified via the variant property:\n *\n * When the InfoCard is displayed as a grid item within a grid, you may want items to have the same height for all items.\n * Set to the 'gridItem' variant to display the InfoCard with full height suitable for Grid:\n *\n * `<InfoCard variant=\"gridItem\">...</InfoCard>`\n */\nexport type Props = {\n title?: ReactNode;\n subheader?: ReactNode;\n divider?: boolean;\n deepLink?: BottomLinkProps;\n /** @deprecated Use errorBoundaryProps instead */\n slackChannel?: string;\n errorBoundaryProps?: ErrorBoundaryProps;\n variant?: InfoCardVariants;\n alignContent?: 'normal' | 'bottom';\n children?: ReactNode;\n headerStyle?: object;\n headerProps?: CardHeaderProps;\n icon?: ReactNode;\n action?: ReactNode;\n actionsClassName?: string;\n actions?: ReactNode;\n cardClassName?: string;\n actionsTopRight?: ReactNode;\n className?: string;\n noPadding?: boolean;\n titleTypographyProps?: object;\n subheaderTypographyProps?: object;\n};\n\n/**\n * Material-ui card with header , content and actions footer\n *\n * @public\n *\n */\nexport function InfoCard(props: Props): JSX.Element {\n const {\n title,\n subheader,\n divider = true,\n deepLink,\n slackChannel,\n errorBoundaryProps,\n variant,\n alignContent = 'normal',\n children,\n headerStyle,\n headerProps,\n icon,\n action,\n actionsClassName,\n actions,\n cardClassName,\n actionsTopRight,\n className,\n noPadding,\n titleTypographyProps,\n subheaderTypographyProps,\n } = props;\n const classes = useStyles();\n /**\n * If variant is specified, we build up styles for that particular variant for both\n * the Card and the CardContent (since these need to be synced)\n */\n let calculatedStyle = {};\n let calculatedCardStyle = {};\n if (variant) {\n const variants = variant.split(/[\\s]+/g);\n variants.forEach(name => {\n calculatedStyle = {\n ...calculatedStyle,\n ...VARIANT_STYLES.card[name as keyof (typeof VARIANT_STYLES)['card']],\n };\n calculatedCardStyle = {\n ...calculatedCardStyle,\n ...VARIANT_STYLES.cardContent[\n name as keyof (typeof VARIANT_STYLES)['cardContent']\n ],\n };\n });\n }\n\n const cardSubTitle = () => {\n if (!subheader && !icon) {\n return null;\n }\n\n return (\n <div data-testid=\"info-card-subheader\">\n {subheader && <div className={classes.subheader}>{subheader}</div>}\n {icon}\n </div>\n );\n };\n\n const errProps: ErrorBoundaryProps =\n errorBoundaryProps || (slackChannel ? { slackChannel } : {});\n\n return (\n <Card style={calculatedStyle} className={className}>\n <ErrorBoundary {...errProps}>\n {title && (\n <CardHeader\n classes={{\n root: classNames(classes.header),\n title: classes.headerTitle,\n subheader: classes.headerSubheader,\n avatar: classes.headerAvatar,\n action: classes.headerAction,\n content: classes.headerContent,\n }}\n title={title}\n subheader={cardSubTitle()}\n action={action}\n style={{ ...headerStyle }}\n titleTypographyProps={titleTypographyProps}\n subheaderTypographyProps={subheaderTypographyProps}\n {...headerProps}\n />\n )}\n {actionsTopRight && (\n <CardActionsTopRight>{actionsTopRight}</CardActionsTopRight>\n )}\n {divider && <Divider />}\n <CardContent\n className={classNames(cardClassName, {\n [classes.noPadding]: noPadding,\n [classes.contentAlignBottom]: alignContent === 'bottom',\n })}\n style={calculatedCardStyle}\n >\n {children}\n </CardContent>\n {actions && (\n <CardActions className={actionsClassName}>{actions}</CardActions>\n )}\n {deepLink && <BottomLink {...deepLink} />}\n </ErrorBoundary>\n </Card>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\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 { 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 2023 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n lifecycle: 'Lifecycle',\n Owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates. Click here to delete.',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\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 Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst ENTITY_YAML = `metadata:\n name: example\n labels:\n javaVersion: 1.2.3`;\n\n/** @public */\nexport type EntityLabelsEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles(\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: 'PluginCatalogEntityLabelsEmptyState' },\n);\n\nexport function EntityLabelsEmptyState() {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <>\n <Typography variant=\"body1\">\n {t('entityLabelsCard.emptyDescription')}\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional\"\n >\n {t('entityLabelsCard.readMoreButtonTitle')}\n </Button>\n </>\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n InfoCardVariants,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { EntityLabelsEmptyState } from './EntityLabelsEmptyState';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport interface EntityLabelsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nconst useStyles = makeStyles(_ => ({\n key: {\n fontWeight: 'bold',\n },\n}));\n\nexport const EntityLabelsCard = (props: EntityLabelsCardProps) => {\n const { variant, title } = props;\n const { entity } = useEntity();\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const columns: TableColumn<{ key: string; value: string }>[] = [\n {\n render: row => {\n return (\n <Typography className={classes.key} variant=\"body2\">\n {row.key}\n </Typography>\n );\n },\n },\n {\n field: 'value',\n },\n ];\n\n const labels = entity?.metadata?.labels;\n\n return (\n <InfoCard title={title || t('entityLabelsCard.title')} variant={variant}>\n {!labels || Object.keys(labels).length === 0 ? (\n <EntityLabelsEmptyState />\n ) : (\n <Table\n columns={columns}\n data={Object.keys(labels).map(labelKey => ({\n key: labelKey,\n value: labels[labelKey],\n }))}\n options={{\n search: false,\n showTitle: true,\n loadingType: 'linear',\n header: false,\n padding: 'dense',\n pageSize: 5,\n toolbar: false,\n paging: Object.keys(labels).length > 5,\n }}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["useStyles","makeStyles","theme","BottomLink","props","link","title","onClick","classes","Box","Divider","Link","Typography","ArrowIcon","SlackLink","slackChannel","t","useTranslationRef","coreComponentsTranslationRef","LinkButton","ErrorBoundary","Component","undefined","error","errorInfo","console","children","ErrorPanel","CardActionsTopRight","withStyles","CardActions","InfoCard","subheader","divider","deepLink","errorBoundaryProps","variant","alignContent","headerStyle","headerProps","icon","action","actionsClassName","actions","cardClassName","actionsTopRight","className","noPadding","titleTypographyProps","subheaderTypographyProps","calculatedStyle","calculatedCardStyle","variants","name","VARIANT_STYLES","Card","CardHeader","classNames","CardContent","NewEntityContext","createVersionedContext","AsyncEntityProvider","entity","loading","refresh","createVersionedValueMap","AnalyticsContext","stringifyEntityRef","useEntity","versionedHolder","useVersionedContext","Error","value","useAsyncEntity","catalogTranslationRef","createTranslationRef","ENTITY_YAML","EntityLabelsEmptyState","CodeSnippet","Button","_","EntityLabelsCard","columns","row","labels","Object","Table","labelKey"],"mappings":"+IAEA,IAAI,EAAyB,EAAQ,MAEjC,EAA0B,EAAQ,MAKtC,UAAe,CAAG,KAAK,EAEvB,IAAI,EAAQ,EAAwB,EAAQ,OAQ5C,UAAe,CAJA,AAAC,GAAG,AAFE,EAAuB,EAAQ,QAElB,OAAO,AAAD,EAAiB,EAAM,aAAa,CAAC,OAAQ,CACnF,EAAG,2DACL,GAAI,e,oMCUJ,IAAMA,EAAYC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAChBC,AAAAA,GAAU,EACR,KAAM,CACJ,SAAU,cACV,QAASA,EAAM,OAAO,CAAC,EAAG,EAAG,EAAG,IAClC,EACA,SAAU,CACR,OAAQ,EACR,MAAOA,EAAM,OAAO,CAAC,UAAU,AACjC,EACA,MAAO,CACL,MAAOA,EAAM,OAAO,CAAC,UAAU,AACjC,CACF,GACA,CAAE,KAAM,qBAAsB,GAgBzB,SAASC,EAAWC,CAAsB,EAC/C,GAAM,CAAEC,KAAAA,CAAI,CAAEC,MAAAA,CAAK,CAAEC,QAAAA,CAAO,CAAE,CAAGH,EAC3BI,EAAUR,IAEhB,MACE,WAACS,EAAAA,CAAGA,CAAAA,C,UACF,UAACC,EAAAA,CAAOA,CAAAA,CAAAA,GACR,UAACC,EAAAA,EAAIA,CAAAA,CAAC,GAAIN,EAAM,QAASE,EAAS,UAAU,O,SAC1C,WAACE,EAAAA,CAAGA,CAAAA,CAAC,QAAQ,OAAO,WAAW,SAAS,UAAWD,EAAQ,IAAI,C,UAC7D,UAACC,EAAAA,CAAGA,CAAAA,CAAC,UAAWD,EAAQ,QAAQ,CAAE,WAAW,iBAAiB,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ACT,KAAMG,OAAO,IAAI,CAACD,GAAQ,GAAG,CAACG,AAAAA,GAAa,EACzC,IAAKA,EACL,MAAOH,CAAM,CAACG,EAAS,AACzB,IACA,QAAS,CACP,OAAQ,GACR,UAAW,GACX,YAAa,SACb,OAAQ,GACR,QAAS,QACT,SAAU,EACV,QAAS,GACT,OAAQF,OAAO,IAAI,CAACD,GAAQ,MAAM,CAAG,CACvC,C,GAjBF,UAACP,EAAsBA,CAAAA,E,EAsB/B,C"}
|
|
1
|
+
{"version":3,"file":"static/2295.3f44c986.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/ArrowForward.js","webpack://techdocs-cli-embedded-app/../core-components/src/layout/BottomLink/BottomLink.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/InfoCard/InfoCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useEntity.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/translation.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLabelsCard/EntityLabelsEmptyState.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/EntityLabelsCard/EntityLabelsCard.tsx"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\"\n}), 'ArrowForward');\n\nexports.default = _default;","/*\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 Box from '@material-ui/core/Box';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ArrowIcon from '@material-ui/icons/ArrowForward';\nimport { MouseEvent } from 'react';\nimport { Link } from '../../components/Link';\n\n/** @public */\nexport type BottomLinkClassKey = 'root' | 'boxTitle' | 'arrow';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n maxWidth: 'fit-content',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n boxTitle: {\n margin: 0,\n color: theme.palette.textSubtle,\n },\n arrow: {\n color: theme.palette.textSubtle,\n },\n }),\n { name: 'BackstageBottomLink' },\n);\n\n/** @public */\nexport type BottomLinkProps = {\n link: string;\n title: string;\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n};\n\n/**\n * Footer with link used in {@link InfoCard } and {@link TabbedCard}\n *\n * @public\n *\n */\nexport function BottomLink(props: BottomLinkProps) {\n const { link, title, onClick } = props;\n const classes = useStyles();\n\n return (\n <Box>\n <Divider />\n <Link to={link} onClick={onClick} underline=\"none\">\n <Box display=\"flex\" alignItems=\"center\" className={classes.root}>\n <Box className={classes.boxTitle} fontWeight=\"fontWeightBold\" m={1}>\n <Typography>\n <strong>{title}</strong>\n </Typography>\n </Box>\n <ArrowIcon className={classes.arrow} />\n </Box>\n </Link>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Typography from '@material-ui/core/Typography';\nimport { PropsWithChildren, ComponentClass, Component, ErrorInfo } from 'react';\nimport { LinkButton } from '../../components/LinkButton';\nimport { ErrorPanel } from '../../components/ErrorPanel';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype SlackChannel = {\n name: string;\n href?: string;\n};\n\n/** @public */\nexport type ErrorBoundaryProps = PropsWithChildren<{\n slackChannel?: string | SlackChannel;\n onError?: (error: Error, errorInfo: string) => null;\n}>;\n\ntype State = {\n error?: Error;\n errorInfo?: ErrorInfo;\n};\n\nconst SlackLink = (props: { slackChannel?: string | SlackChannel }) => {\n const { slackChannel } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n if (!slackChannel) {\n return null;\n } else if (typeof slackChannel === 'string') {\n return (\n <Typography>{t('errorBoundary.title', { slackChannel })}</Typography>\n );\n } else if (!slackChannel.href) {\n return (\n <Typography>\n {t('errorBoundary.title', {\n slackChannel: slackChannel.name,\n })}\n </Typography>\n );\n }\n\n return (\n <LinkButton to={slackChannel.href} variant=\"contained\">\n {slackChannel.name}\n </LinkButton>\n );\n};\n\n/** @public */\nexport const ErrorBoundary: ComponentClass<\n ErrorBoundaryProps,\n State\n> = class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {\n error: undefined,\n errorInfo: undefined,\n };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // eslint-disable-next-line no-console\n console.error(`ErrorBoundary, error: ${error}`, { error, errorInfo });\n this.setState({ error, errorInfo });\n }\n\n render() {\n const { slackChannel, children } = this.props;\n const { error } = this.state;\n\n if (!error) {\n return children;\n }\n\n return (\n <ErrorPanel title=\"Something Went Wrong\" error={error}>\n <SlackLink slackChannel={slackChannel} />\n </ErrorPanel>\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 Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader, { CardHeaderProps } from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { ReactNode } from 'react';\nimport { BottomLink, BottomLinkProps } from '../BottomLink';\nimport { ErrorBoundary, ErrorBoundaryProps } from '../ErrorBoundary';\n\n/** @public */\nexport type InfoCardClassKey =\n | 'noPadding'\n | 'header'\n | 'headerTitle'\n | 'headerSubheader'\n | 'headerAvatar'\n | 'headerAction'\n | 'headerContent';\n\nconst useStyles = makeStyles(\n theme => ({\n noPadding: {\n padding: 0,\n '&:last-child': {\n paddingBottom: 0,\n },\n },\n contentAlignBottom: {\n display: 'flex',\n alignItems: 'self-end',\n },\n header: {\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n headerTitle: {\n fontWeight: theme.typography.fontWeightBold,\n },\n headerSubheader: {\n paddingTop: theme.spacing(1),\n },\n headerAvatar: {},\n headerAction: {},\n headerContent: {},\n subheader: {\n display: 'flex',\n },\n }),\n { name: 'BackstageInfoCard' },\n);\n\n/** @public */\nexport type CardActionsTopRightClassKey = 'root';\n\nconst CardActionsTopRight = withStyles(\n theme => ({\n root: {\n display: 'inline-block',\n padding: theme.spacing(8, 8, 0, 0),\n float: 'right',\n },\n }),\n { name: 'BackstageInfoCardCardActionsTopRight' },\n)(CardActions);\n\nconst VARIANT_STYLES = {\n card: {\n flex: {\n display: 'flex',\n flexDirection: 'column',\n },\n fullHeight: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItem: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n breakInside: 'avoid-page',\n '@media print': {\n height: 'auto',\n },\n },\n },\n cardContent: {\n fullHeight: {\n flex: 1,\n },\n gridItem: {\n flex: 1,\n },\n },\n};\n\n/** @public */\nexport type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';\n\n/**\n * InfoCard is used to display a paper-styled block on the screen, similar to a panel.\n *\n * You can custom style an InfoCard with the 'className' (outer container) and 'cardClassName' (inner container)\n * props. This is typically used with the material-ui makeStyles mechanism.\n *\n * The InfoCard serves as an error boundary. As a result, if you provide an 'errorBoundaryProps' property this\n * specifies the extra information to display in the error component that is displayed if an error occurs\n * in any descendent components.\n *\n * By default the InfoCard has no custom layout of its children, but is treated as a block element. A\n * couple common variants are provided and can be specified via the variant property:\n *\n * When the InfoCard is displayed as a grid item within a grid, you may want items to have the same height for all items.\n * Set to the 'gridItem' variant to display the InfoCard with full height suitable for Grid:\n *\n * `<InfoCard variant=\"gridItem\">...</InfoCard>`\n */\nexport type Props = {\n title?: ReactNode;\n subheader?: ReactNode;\n divider?: boolean;\n deepLink?: BottomLinkProps;\n /** @deprecated Use errorBoundaryProps instead */\n slackChannel?: string;\n errorBoundaryProps?: ErrorBoundaryProps;\n variant?: InfoCardVariants;\n alignContent?: 'normal' | 'bottom';\n children?: ReactNode;\n headerStyle?: object;\n headerProps?: CardHeaderProps;\n icon?: ReactNode;\n action?: ReactNode;\n actionsClassName?: string;\n actions?: ReactNode;\n cardClassName?: string;\n actionsTopRight?: ReactNode;\n className?: string;\n noPadding?: boolean;\n titleTypographyProps?: object;\n subheaderTypographyProps?: object;\n};\n\n/**\n * Material-ui card with header , content and actions footer\n *\n * @public\n *\n */\nexport function InfoCard(props: Props): JSX.Element {\n const {\n title,\n subheader,\n divider = true,\n deepLink,\n slackChannel,\n errorBoundaryProps,\n variant,\n alignContent = 'normal',\n children,\n headerStyle,\n headerProps,\n icon,\n action,\n actionsClassName,\n actions,\n cardClassName,\n actionsTopRight,\n className,\n noPadding,\n titleTypographyProps,\n subheaderTypographyProps,\n } = props;\n const classes = useStyles();\n /**\n * If variant is specified, we build up styles for that particular variant for both\n * the Card and the CardContent (since these need to be synced)\n */\n let calculatedStyle = {};\n let calculatedCardStyle = {};\n if (variant) {\n const variants = variant.split(/[\\s]+/g);\n variants.forEach(name => {\n calculatedStyle = {\n ...calculatedStyle,\n ...VARIANT_STYLES.card[name as keyof (typeof VARIANT_STYLES)['card']],\n };\n calculatedCardStyle = {\n ...calculatedCardStyle,\n ...VARIANT_STYLES.cardContent[\n name as keyof (typeof VARIANT_STYLES)['cardContent']\n ],\n };\n });\n }\n\n const cardSubTitle = () => {\n if (!subheader && !icon) {\n return null;\n }\n\n return (\n <div data-testid=\"info-card-subheader\">\n {subheader && <div className={classes.subheader}>{subheader}</div>}\n {icon}\n </div>\n );\n };\n\n const errProps: ErrorBoundaryProps =\n errorBoundaryProps || (slackChannel ? { slackChannel } : {});\n\n return (\n <Card style={calculatedStyle} className={className}>\n <ErrorBoundary {...errProps}>\n {title && (\n <CardHeader\n classes={{\n root: classNames(classes.header),\n title: classes.headerTitle,\n subheader: classes.headerSubheader,\n avatar: classes.headerAvatar,\n action: classes.headerAction,\n content: classes.headerContent,\n }}\n title={title}\n subheader={cardSubTitle()}\n action={action}\n style={{ ...headerStyle }}\n titleTypographyProps={titleTypographyProps}\n subheaderTypographyProps={subheaderTypographyProps}\n {...headerProps}\n />\n )}\n {actionsTopRight && (\n <CardActionsTopRight>{actionsTopRight}</CardActionsTopRight>\n )}\n {divider && <Divider />}\n <CardContent\n className={classNames(cardClassName, {\n [classes.noPadding]: noPadding,\n [classes.contentAlignBottom]: alignContent === 'bottom',\n })}\n style={calculatedCardStyle}\n >\n {children}\n </CardContent>\n {actions && (\n <CardActions className={actionsClassName}>{actions}</CardActions>\n )}\n {deepLink && <BottomLink {...deepLink} />}\n </ErrorBoundary>\n </Card>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\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 { 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 2023 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 { createTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @alpha */\nexport const catalogTranslationRef = createTranslationRef({\n id: 'catalog',\n messages: {\n indexPage: {\n title: `{{orgName}} Catalog`,\n createButtonTitle: 'Create',\n supportButtonContent: 'All your software catalog entities',\n },\n aboutCard: {\n title: 'About',\n refreshButtonTitle: 'Schedule entity refresh',\n editButtonTitle: 'Edit Metadata',\n createSimilarButtonTitle: 'Create something similar',\n refreshScheduledMessage: 'Refresh scheduled',\n launchTemplate: 'Launch Template',\n viewTechdocs: 'View TechDocs',\n viewSource: 'View Source',\n descriptionField: {\n label: 'Description',\n value: 'No description',\n },\n ownerField: {\n label: 'Owner',\n value: 'No Owner',\n },\n domainField: {\n label: 'Domain',\n value: 'No Domain',\n },\n systemField: {\n label: 'System',\n value: 'No System',\n },\n parentComponentField: {\n label: 'Parent Component',\n value: 'No Parent Component',\n },\n typeField: {\n label: 'Type',\n },\n lifecycleField: {\n label: 'Lifecycle',\n },\n tagsField: {\n label: 'Tags',\n value: 'No Tags',\n },\n targetsField: {\n label: 'Targets',\n },\n },\n searchResultItem: {\n lifecycle: 'Lifecycle',\n Owner: 'Owner',\n },\n catalogTable: {\n warningPanelTitle: 'Could not fetch catalog entities.',\n viewActionTitle: 'View',\n editActionTitle: 'Edit',\n starActionTitle: 'Add to favorites',\n unStarActionTitle: 'Remove from favorites',\n },\n dependencyOfComponentsCard: {\n title: 'Dependency of components',\n emptyMessage: 'No component depends on this component',\n },\n dependsOnComponentsCard: {\n title: 'Depends on components',\n emptyMessage: 'No component is a dependency of this component',\n },\n dependsOnResourcesCard: {\n title: 'Depends on resources',\n emptyMessage: 'No resource is a dependency of this component',\n },\n entityContextMenu: {\n copiedMessage: 'Copied!',\n moreButtonTitle: 'More',\n inspectMenuTitle: 'Inspect entity',\n copyURLMenuTitle: 'Copy entity URL',\n unregisterMenuTitle: 'Unregister entity',\n },\n entityLabelsCard: {\n title: 'Labels',\n emptyDescription:\n 'No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityLabels: {\n warningPanelTitle: 'Entity not found',\n ownerLabel: 'Owner',\n lifecycleLabel: 'Lifecycle',\n },\n entityLinksCard: {\n title: 'Links',\n emptyDescription:\n 'No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:',\n readMoreButtonTitle: 'Read more',\n },\n entityNotFound: {\n title: 'Entity was not found',\n description:\n 'Want to help us build this? Check out our Getting Started documentation.',\n docButtonTitle: 'DOCS',\n },\n deleteEntity: {\n dialogTitle: 'Are you sure you want to delete this entity?',\n deleteButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n description:\n 'This entity is not referenced by any location and is therefore not receiving updates. Click here to delete.',\n },\n entityProcessingErrorsDescription: 'The error below originates from',\n entityRelationWarningDescription:\n \"This entity has relations to other entities, which can't be found in the catalog.\\n Entities not found are: \",\n hasComponentsCard: {\n title: 'Has components',\n emptyMessage: 'No component is part of this system',\n },\n hasResourcesCard: {\n title: 'Has resources',\n emptyMessage: 'No resource is part of this system',\n },\n hasSubcomponentsCard: {\n title: 'Has subcomponents',\n emptyMessage: 'No subcomponent is part of this component',\n },\n hasSubdomainsCard: {\n title: 'Has subdomains',\n emptyMessage: 'No subdomain is part of this domain',\n },\n hasSystemsCard: {\n title: 'Has systems',\n emptyMessage: 'No system is part of this domain',\n },\n relatedEntitiesCard: {\n emptyHelpLinkTitle: 'Learn how to change this',\n },\n systemDiagramCard: {\n title: 'System Diagram',\n description: 'Use pinch & zoom to move around the diagram.',\n edgeLabels: {\n partOf: 'part of',\n provides: 'provides',\n dependsOn: 'depends on',\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 Button from '@material-ui/core/Button';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst ENTITY_YAML = `metadata:\n name: example\n labels:\n javaVersion: 1.2.3`;\n\n/** @public */\nexport type EntityLabelsEmptyStateClassKey = 'code';\n\nconst useStyles = makeStyles(\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: 'PluginCatalogEntityLabelsEmptyState' },\n);\n\nexport function EntityLabelsEmptyState() {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <>\n <Typography variant=\"body1\">\n {t('entityLabelsCard.emptyDescription')}\n </Typography>\n <div className={classes.code}>\n <CodeSnippet\n text={ENTITY_YAML}\n language=\"yaml\"\n showLineNumbers\n highlightedNumbers={[3, 4, 5, 6]}\n customStyle={{ background: 'inherit', fontSize: '115%' }}\n />\n </div>\n <Button\n variant=\"contained\"\n color=\"primary\"\n target=\"_blank\"\n href=\"https://backstage.io/docs/features/software-catalog/descriptor-format#labels-optional\"\n >\n {t('entityLabelsCard.readMoreButtonTitle')}\n </Button>\n </>\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 { useEntity } from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n InfoCardVariants,\n Table,\n TableColumn,\n} from '@backstage/core-components';\nimport { EntityLabelsEmptyState } from './EntityLabelsEmptyState';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport interface EntityLabelsCardProps {\n variant?: InfoCardVariants;\n title?: string;\n}\n\nconst useStyles = makeStyles(_ => ({\n key: {\n fontWeight: 'bold',\n },\n}));\n\nexport const EntityLabelsCard = (props: EntityLabelsCardProps) => {\n const { variant, title } = props;\n const { entity } = useEntity();\n const classes = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const columns: TableColumn<{ key: string; value: string }>[] = [\n {\n render: row => {\n return (\n <Typography className={classes.key} variant=\"body2\">\n {row.key}\n </Typography>\n );\n },\n },\n {\n field: 'value',\n },\n ];\n\n const labels = entity?.metadata?.labels;\n\n return (\n <InfoCard title={title || t('entityLabelsCard.title')} variant={variant}>\n {!labels || Object.keys(labels).length === 0 ? (\n <EntityLabelsEmptyState />\n ) : (\n <Table\n columns={columns}\n data={Object.keys(labels).map(labelKey => ({\n key: labelKey,\n value: labels[labelKey],\n }))}\n options={{\n search: false,\n showTitle: true,\n loadingType: 'linear',\n header: false,\n padding: 'dense',\n pageSize: 5,\n toolbar: false,\n paging: Object.keys(labels).length > 5,\n }}\n />\n )}\n </InfoCard>\n );\n};\n"],"names":["useStyles","makeStyles","theme","BottomLink","props","link","title","onClick","classes","Box","Divider","Link","Typography","ArrowIcon","SlackLink","slackChannel","t","useTranslationRef","coreComponentsTranslationRef","LinkButton","ErrorBoundary","Component","undefined","error","errorInfo","console","children","ErrorPanel","CardActionsTopRight","withStyles","CardActions","InfoCard","subheader","divider","deepLink","errorBoundaryProps","variant","alignContent","headerStyle","headerProps","icon","action","actionsClassName","actions","cardClassName","actionsTopRight","className","noPadding","titleTypographyProps","subheaderTypographyProps","calculatedStyle","calculatedCardStyle","variants","name","VARIANT_STYLES","Card","CardHeader","classNames","CardContent","NewEntityContext","createVersionedContext","AsyncEntityProvider","entity","loading","refresh","createVersionedValueMap","AnalyticsContext","stringifyEntityRef","useEntity","versionedHolder","useVersionedContext","Error","value","useAsyncEntity","catalogTranslationRef","createTranslationRef","ENTITY_YAML","EntityLabelsEmptyState","CodeSnippet","Button","_","EntityLabelsCard","columns","row","labels","Object","Table","labelKey"],"mappings":"+IAEA,IAAI,EAAyB,EAAQ,MAEjC,EAA0B,EAAQ,MAKtC,UAAe,CAAG,KAAK,EAEvB,IAAI,EAAQ,EAAwB,EAAQ,OAQ5C,UAAe,CAJA,AAAC,GAAG,AAFE,EAAuB,EAAQ,QAElB,OAAO,AAAD,EAAiB,EAAM,aAAa,CAAC,OAAQ,CACnF,EAAG,2DACL,GAAI,e,oMCUJ,IAAMA,EAAYC,AAAAA,GAAAA,EAAAA,CAAAA,AAAAA,EAChBC,AAAAA,GAAU,EACR,KAAM,CACJ,SAAU,cACV,QAASA,EAAM,OAAO,CAAC,EAAG,EAAG,EAAG,IAClC,EACA,SAAU,CACR,OAAQ,EACR,MAAOA,EAAM,OAAO,CAAC,UAAU,AACjC,EACA,MAAO,CACL,MAAOA,EAAM,OAAO,CAAC,UAAU,AACjC,CACF,GACA,CAAE,KAAM,qBAAsB,GAgBzB,SAASC,EAAWC,CAAsB,EAC/C,GAAM,CAAEC,KAAAA,CAAI,CAAEC,MAAAA,CAAK,CAAEC,QAAAA,CAAO,CAAE,CAAGH,EAC3BI,EAAUR,IAEhB,MACE,WAACS,EAAA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AAE,QAAQ,Q,SACzC2E,EAAI,GAAG,A,EAIhB,EACA,CACE,MAAO,OACT,EACD,CAEKC,EAAStB,GAAQ,UAAU,OAEjC,MACE,UAAC/B,EAAAA,CAAQA,CAAAA,CAAC,MAAOzB,GAASU,EAAE,0BAA2B,QAASoB,E,SAC7D,AAACgD,GAAUC,AAA+B,IAA/BA,OAAO,IAAI,CAACD,GAAQ,MAAM,CAGpC,UAACE,EAAAA,CAAKA,CAAAA,CACJ,QAASJ,EACT,KAAMG,OAAO,IAAI,CAACD,GAAQ,GAAG,CAACG,AAAAA,GAAa,EACzC,IAAKA,EACL,MAAOH,CAAM,CAACG,EAAS,AACzB,IACA,QAAS,CACP,OAAQ,GACR,UAAW,GACX,YAAa,SACb,OAAQ,GACR,QAAS,QACT,SAAU,EACV,QAAS,GACT,OAAQF,OAAO,IAAI,CAACD,GAAQ,MAAM,CAAG,CACvC,C,GAjBF,UAACP,EAAsBA,CAAAA,E,EAsB/B,C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["4591"],{69890:function(e,t,n){n.d(t,{RealLogViewer:()=>Y});var r=n(31085),i=n(9720),l=n(29365),s=n(99594),o=n(53373),a=n.n(o),d=n(14041),c=n(18690),u=n(19686),h=n(84392);let f=(0,n(84774).A)(),g=/\n\r?/g,m=Object.fromEntries(Object.entries({1:e=>({...e,bold:!0}),3:e=>({...e,italic:!0}),4:e=>({...e,underline:!0}),22:({bold:e,...t})=>t,23:({italic:e,...t})=>t,24:({underline:e,...t})=>t,30:e=>({...e,foreground:"black"}),31:e=>({...e,foreground:"red"}),32:e=>({...e,foreground:"green"}),33:e=>({...e,foreground:"yellow"}),34:e=>({...e,foreground:"blue"}),35:e=>({...e,foreground:"magenta"}),36:e=>({...e,foreground:"cyan"}),37:e=>({...e,foreground:"white"}),39:({foreground:e,...t})=>t,90:e=>({...e,foreground:"grey"}),40:e=>({...e,background:"black"}),41:e=>({...e,background:"red"}),42:e=>({...e,background:"green"}),43:e=>({...e,background:"yellow"}),44:e=>({...e,background:"blue"}),45:e=>({...e,background:"magenta"}),46:e=>({...e,background:"cyan"}),47:e=>({...e,background:"white"}),49:({background:e,...t})=>t}).map(([e,t])=>[`\x1b[${e}m`,t]));class p{text;lineNumber;chunks;constructor(e=1,t=[]){this.lineNumber=e,this.chunks=t,this.text=t.map(e=>e.text).join("").toLocaleLowerCase("en-US")}lastChunk(){return this.chunks[this.chunks.length-1]}replaceLastChunk(e){e&&(this.chunks.splice(this.chunks.length-1,1,...e),this.text=this.chunks.map(e=>e.text).join("").toLocaleLowerCase("en-US"))}}class x{text="";lines=[];process(e){if(this.text===e)return this.lines;if(this.text&&e.startsWith(this.text)){let t=this.lines.length>0?this.lines.length-1:0,n=this.lines[t]??new p,r=n.lastChunk(),i=this.processLines((r?.text??"")+e.slice(this.text.length),r?.modifiers,n?.lineNumber);n.replaceLastChunk(i[0]?.chunks),this.lines[t]=n,this.lines=this.lines.concat(i.slice(1))}else this.lines=this.processLines(e);return this.text=e,this.lines}processLines=(e,t={},n=1)=>{let r=[],i=t,l=n,s=0;for(g.lastIndex=0;;){let t=g.exec(e);if(!t){let t=this.processText(e.slice(s),i);return r.push(new p(l,t)),r}let n=e.slice(s,t.index);s=t.index+t[0].length;let o=this.processText(n,i);r.push(new p(l,o)),i=o[o.length-1].modifiers??i,l+=1}};processText=(e,t)=>{let n=[],r=t,i=0;for(f.lastIndex=0;;){let t=f.exec(e);if(!t)return n.push({text:e.slice(i),modifiers:r}),n;let l=e.slice(i,t.index);n.push({text:l,modifiers:r}),i=t.index+t[0].length,r=this.processCode(t[0],r)}};processCode=(e,t)=>m[e]?.(t)??t}var k=n(95479),b=n.n(k),y=n(60075),A=n(60603);let j=({attributes:e,content:t})=>{let{href:n,...i}=e;return(0,r.jsx)(A.N_,{to:n,...i,children:t})};function S({line:e,classes:t,searchText:n,highlightResultIndex:i,setRowHeight:l}){let s=(0,d.useRef)(null),o=(0,d.useMemo)(()=>(function(e,t){let n=function(e,t){if(!t||!e.includes(t))return;let n=[],r=0;for(;;){let i=e.indexOf(t,r);if(-1===i)break;let l=i+t.length;n.push({start:i,end:l}),r=l}return n}(e.text,t);if(!n)return e.chunks;let r=[],i=0,l=0,s=n[0];for(let t of e.chunks){let{text:e,modifiers:o}=t;if(!s||i+e.length<s.start){r.push(t),i+=e.length;continue}let a=0;for(;s;){let t=Math.max(s.start-i,0);if(t>e.length)break;let d=Math.min(s.end-i,e.length);if(t>a&&r.push({text:e.slice(a,t),modifiers:o}),d>t&&r.push({modifiers:o,highlight:l,text:e.slice(t,d)}),a=d,s.end-i===d)l+=1,s=n[l];else break}a<e.length&&r.push({text:e.slice(a),modifiers:o}),i+=e.length}return r})(e,n),[e,n]);(0,d.useEffect)(()=>{s.current&&l&&l(e.lineNumber,s.current.offsetHeight)},[e.lineNumber,l]);let c=(0,d.useMemo)(()=>o.map(({text:e,modifiers:n,highlight:s},o)=>(0,r.jsx)("span",{className:a()(function(e,t){let n=[];if(t.bold&&n.push(e.modifierBold),t.italic&&n.push(e.modifierItalic),t.underline&&n.push(e.modifierUnderline),t.foreground){let r=`modifierForeground${b()(t.foreground)}`;n.push(e[r])}if(t.background){let r=`modifierBackground${b()(t.background)}`;n.push(e[r])}return n.length>0?n.join(" "):void 0}(t,n),void 0!==s&&(s===i?t.textSelectedHighlight:t.textHighlight),{[t.textWrap]:!!l}),children:(0,r.jsx)(y.A,{options:{render:j},children:e})},o)),[o,i,t,l]);return(0,r.jsx)("span",{ref:s,children:c})}var w=n(89595),C=n(16249),v=n(72501),B=n(68887),L=n(63798),N=n(65859),I=n(89332);function M(e){let{t}=(0,w.i)(I.O),{resultCount:n,resultIndexStep:i,toggleShouldFilter:s}=e,o=e.resultIndex??0;return(0,r.jsxs)(r.Fragment,{children:[void 0!==n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{size:"small",onClick:()=>i(!0),children:(0,r.jsx)(B.default,{})}),(0,r.jsxs)(v.A,{children:[Math.min(o+1,n),"/",n]}),(0,r.jsx)(l.A,{size:"small",onClick:()=>i(),children:(0,r.jsx)(L.default,{})})]}),(0,r.jsx)(C.A,{size:"small",variant:"standard",placeholder:t("logViewer.searchField.placeholder"),value:e.searchInput,onKeyPress:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey||e.altKey?s():i(e.shiftKey))},onChange:t=>e.setSearchInput(t.target.value)}),(0,r.jsx)(l.A,{size:"small",onClick:s,children:e.shouldFilter?(0,r.jsx)(N.default,{color:"primary"}):(0,r.jsx)(N.default,{color:"disabled"})})]})}var F=n(58837),E=n(268),R=n(4499),z=n(95186),H=n(38084),T=n(54024),_=n(40935),K=n(85229),$=n(42020),W=n(6456);let O=(0,F.A)(e=>({root:{background:e.palette.background.paper},header:{height:40,display:"flex",alignItems:"center",justifyContent:"flex-end"},log:{fontFamily:'"Monaco", monospace',fontSize:e.typography.pxToRem(12),lineHeight:"20px"},line:{position:"relative",whiteSpace:"pre",display:"flex",alignItems:"flex-start","&:hover":{background:e.palette.action.hover}},lineSelected:{background:e.palette.action.selected,"&:hover":{background:e.palette.action.selected}},lineCopyButton:{position:"absolute",paddingTop:0,paddingBottom:0,"&:hover":{color:e.palette.linkHover}},lineNumber:{display:"inline-block",textAlign:"end",width:60,paddingRight:e.spacing(1),marginRight:e.spacing(1),cursor:"pointer",flexShrink:0,color:R.A["300"],borderRight:`1px solid ${R.A["700"]}`},textHighlight:{background:(0,E.X4)(e.palette.info.main,.15)},textSelectedHighlight:{background:(0,E.X4)(e.palette.info.main,.4)},modifierBold:{fontWeight:e.typography.fontWeightBold},modifierItalic:{fontStyle:"italic"},modifierUnderline:{textDecoration:"underline"},modifierForegroundBlack:{color:z.A.black},modifierForegroundRed:{color:H.A["500"]},modifierForegroundGreen:{color:T.A["500"]},modifierForegroundYellow:{color:_.A["500"]},modifierForegroundBlue:{color:R.A["500"]},modifierForegroundMagenta:{color:K.A["500"]},modifierForegroundCyan:{color:$.A["500"]},modifierForegroundWhite:{color:z.A.white},modifierForegroundGrey:{color:W.A["500"]},modifierBackgroundBlack:{background:z.A.black},modifierBackgroundRed:{background:H.A["500"]},modifierBackgroundGreen:{background:T.A["500"]},modifierBackgroundYellow:{background:_.A["500"]},modifierBackgroundBlue:{background:R.A["500"]},modifierBackgroundMagenta:{background:K.A["500"]},modifierBackgroundCyan:{background:$.A["500"]},modifierBackgroundWhite:{background:z.A.white},modifierBackgroundGrey:{background:W.A["500"]},textWrap:{whiteSpace:"pre-wrap",wordBreak:"break-all"}}),{name:"BackstageLogViewer"});var G=n(54633),U=n(50509),D=n(151),V=n(11688),X=n(38097);function Y(e){let t=O({classes:e.classes}),[n,o]=(0,d.useState)(null),f=e.textWrap??!1,g=(0,d.useRef)({}),m=(0,d.useMemo)(()=>new x,[]).process(e.text),[p,k]=(0,d.useState)(!1),b=function(e){let[t,n]=(0,d.useState)(""),r=t.toLocaleLowerCase("en-US"),[i,l]=(0,d.useState)(0),[s,o]=(0,G.e)(!1),a=(0,d.useMemo)(()=>(function(e,t){if(!t)return{lines:e};let n=[],r=[];for(let i of e)if(i.text.includes(t)){n.push(i);let e=0,l=0;for(;;){let n=i.text.indexOf(t,e);if(-1===n)break;r.push({lineNumber:i.lineNumber,lineIndex:l++}),e=n+t.length}}return{lines:n,results:r}})(e,r),[e,r]),c=a.results?a.results[Math.min(i,a.results.length-1)]:void 0,u=a.results?.length;return{lines:s?a.lines:e,searchText:r,searchInput:t,setSearchInput:n,shouldFilter:s,toggleShouldFilter:o,resultCount:u,resultIndex:i,resultIndexStep:e=>{if(e){if(void 0!==u){let e=Math.min(i-1,u-2);l(e<0?u-1:e)}}else if(void 0!==u){let e=i+1;l(e>=u?0:e)}},resultLine:c?.lineNumber,resultLineIndex:c?.lineIndex}}(m),y=function(e){let t=(0,U.gf)(D.m),[n,r]=(0,d.useState)([]),[{error:i},l]=(0,V.A)();(0,d.useEffect)(()=>{i&&t.post(i)},[i,t]);let s=(e,t)=>{let n=e.filter(e=>e.start-1===t||e.end+1===t);if(0===n.length)return e;let r={start:Math.min(t,...n.map(e=>e.start)),end:Math.max(t,...n.map(e=>e.end))};return[...e.filter(e=>!n.includes(e)&&(e.start!==t||e.end!==t)),r]};return{shouldShowCopyButton:e=>n.some(t=>t.start===e),isSelected:e=>!!n&&n.some(t=>t.start<=e&&(t.end??t.start)>=e),setSelection(e,t,i){r(r=>{let l=r.find(t=>t.start<=e&&t.end>=e),o=r.filter(e=>e!==l);if(!t&&!i)return l&&l.start===l.end?[]:[{start:e,end:e}];if(t){if(0===r.length)return[{start:e,end:e}];if(l)return l.start===l.end?o:[...o,{start:l.start,end:e}];let t=((e,t)=>{let r;if(0===n.length)return;let i=Number.MAX_SAFE_INTEGER;return e.forEach(e=>{let n=Math.min(Math.abs(e.start-t),Math.abs(e.end-t));n<i&&(i=n,r=e)}),r})(r,e);return t?t.start<e?s([...o.filter(e=>e!==t),{start:t.start,end:e}],e):s([...o.filter(e=>e!==t),{start:e,end:t.end}],e):r}return i?l?l.start===l.end?o:[...o,...l.start<e?[{start:l.start,end:e-1}]:[],...l.end>e?[{start:e+1,end:l.end}]:[]]:s([...r,{start:e,end:e}],e):[]})},copySelection(t){let r=n.find(e=>e.start===t);r&&l(e.slice(r.start-1,r.end).map(e=>e.chunks.map(e=>e.text).join("")).join("\n"))},getHash(){if(0===n.length)return"";let e=n.map(e=>e.start===e.end?`${e.start}`:`${e.start}-${e.end}`);return`#lines-${e.join(",")}`},selectAll(e){let t=e.match(/#lines-([\d,-]+)/),n=[];t&&t[1].split(",").forEach(e=>{let[t,r]=e.split("-").map(Number);n.push({start:t,end:r??t})}),r(n)}}}(m),A=(0,c.zy)();(0,d.useEffect)(()=>{n&&n.scrollToItem(m.length-1,"end")},[n,m]),(0,d.useEffect)(()=>{n&&(b.resultLine?n.scrollToItem(b.resultLine-1,"center"):n.scrollToItem(m.length-1,"end"))},[n,b.resultLine,m]),(0,d.useEffect)(()=>{let e=y.getHash();e.length>0&&history.replaceState(null,"",e)},[y]),(0,d.useEffect)(()=>{A.hash&&y.selectAll(A.hash)},[]);let j=(e,t)=>{t.preventDefault(),y.setSelection(e,t.shiftKey,t.metaKey||t.ctrlKey)};function w(e,t){f&&n&&(n.resetAfterIndex(0),g.current[e-1]=t)}function C(e){return g.current[e]||20}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Ay,{children:({height:e,width:n})=>{let d={ref:o,className:t.log,height:(e||480)-40,width:n||640,itemData:b.lines,itemCount:b.lines.length},c=({index:e,style:n,data:o})=>{let d=o[e],{lineNumber:c}=d;return(0,r.jsxs)(i.A,{style:{...n},className:a()(t.line,{[t.lineSelected]:y.isSelected(c)}),children:[y.shouldShowCopyButton(c)&&(0,r.jsx)(l.A,{"data-testid":"copy-button",size:"small",className:t.lineCopyButton,onClick:()=>{y.copySelection(c),k(!0)},children:(0,r.jsx)(s.default,{fontSize:"inherit"})}),(0,r.jsx)("a",{role:"row",target:"_self",href:`#line-${c}`,className:t.lineNumber,onClick:e=>j(c,e),onKeyPress:e=>j(c,e),children:c}),(0,r.jsx)(S,{setRowHeight:f?w:void 0,line:d,classes:t,searchText:b.searchText,highlightResultIndex:b.resultLine===c?b.resultLineIndex:void 0})]})};return(0,r.jsxs)(i.A,{style:{width:n,height:e},className:t.root,children:[(0,r.jsx)(i.A,{className:t.header,children:(0,r.jsx)(M,{...b})}),f?(0,r.jsx)(h._m,{...d,itemSize:C,children:c}):(0,r.jsx)(h.Y1,{...d,itemSize:20,children:c})]})}}),(0,r.jsx)(X.A,{open:p,autoHideDuration:3e3,onClose:()=>k(!1),message:"Lines copied to clipboard",anchorOrigin:{vertical:"bottom",horizontal:"center"}})]})}}}]);
|
|
2
|
+
//# sourceMappingURL=4591.8c1cd36f.chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/4591.8c1cd36f.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/AnsiProcessor.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogLine.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogViewerControls.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/styles.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/RealLogViewer.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSearch.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSelection.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 ansiRegexMaker from 'ansi-regex';\n\nconst ansiRegex = ansiRegexMaker();\nconst newlineRegex = /\\n\\r?/g;\n\n// A mapping of how each escape code changes the modifiers\nconst codeModifiers = Object.fromEntries(\n Object.entries({\n 1: m => ({ ...m, bold: true }),\n 3: m => ({ ...m, italic: true }),\n 4: m => ({ ...m, underline: true }),\n 22: ({ bold: _, ...m }) => m,\n 23: ({ italic: _, ...m }) => m,\n 24: ({ underline: _, ...m }) => m,\n 30: m => ({ ...m, foreground: 'black' }),\n 31: m => ({ ...m, foreground: 'red' }),\n 32: m => ({ ...m, foreground: 'green' }),\n 33: m => ({ ...m, foreground: 'yellow' }),\n 34: m => ({ ...m, foreground: 'blue' }),\n 35: m => ({ ...m, foreground: 'magenta' }),\n 36: m => ({ ...m, foreground: 'cyan' }),\n 37: m => ({ ...m, foreground: 'white' }),\n 39: ({ foreground: _, ...m }) => m,\n 90: m => ({ ...m, foreground: 'grey' }),\n 40: m => ({ ...m, background: 'black' }),\n 41: m => ({ ...m, background: 'red' }),\n 42: m => ({ ...m, background: 'green' }),\n 43: m => ({ ...m, background: 'yellow' }),\n 44: m => ({ ...m, background: 'blue' }),\n 45: m => ({ ...m, background: 'magenta' }),\n 46: m => ({ ...m, background: 'cyan' }),\n 47: m => ({ ...m, background: 'white' }),\n 49: ({ background: _, ...m }) => m,\n } as Record<string, (m: ChunkModifiers) => ChunkModifiers>).map(\n ([code, modifier]) => [`\\x1b[${code}m`, modifier],\n ),\n);\n\nexport type AnsiColor =\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'grey';\n\nexport interface ChunkModifiers {\n foreground?: AnsiColor;\n background?: AnsiColor;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n}\n\nexport interface AnsiChunk {\n text: string;\n modifiers: ChunkModifiers;\n}\n\nexport class AnsiLine {\n text: string;\n readonly lineNumber: number;\n readonly chunks: AnsiChunk[];\n\n constructor(lineNumber: number = 1, chunks: AnsiChunk[] = []) {\n this.lineNumber = lineNumber;\n this.chunks = chunks;\n this.text = chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n\n lastChunk(): AnsiChunk | undefined {\n return this.chunks[this.chunks.length - 1];\n }\n\n replaceLastChunk(newChunks?: AnsiChunk[]) {\n if (newChunks) {\n this.chunks.splice(this.chunks.length - 1, 1, ...newChunks);\n this.text = this.chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n }\n}\n\nexport class AnsiProcessor {\n private text: string = '';\n private lines: AnsiLine[] = [];\n\n /**\n * Processes a chunk of text while keeping internal state that optimizes\n * subsequent processing that appends to the text.\n */\n process(text: string): AnsiLine[] {\n if (this.text === text) {\n return this.lines;\n }\n\n if (this.text && text.startsWith(this.text)) {\n const lastLineIndex = this.lines.length > 0 ? this.lines.length - 1 : 0;\n const lastLine = this.lines[lastLineIndex] ?? new AnsiLine();\n const lastChunk = lastLine.lastChunk();\n\n const newLines = this.processLines(\n (lastChunk?.text ?? '') + text.slice(this.text.length),\n lastChunk?.modifiers,\n lastLine?.lineNumber,\n );\n lastLine.replaceLastChunk(newLines[0]?.chunks);\n\n this.lines[lastLineIndex] = lastLine;\n this.lines = this.lines.concat(newLines.slice(1));\n } else {\n this.lines = this.processLines(text);\n }\n this.text = text;\n\n return this.lines;\n }\n\n // Split a chunk of text up into lines and process each line individually\n private processLines = (\n text: string,\n modifiers: ChunkModifiers = {},\n startingLineNumber: number = 1,\n ): AnsiLine[] => {\n const lines: AnsiLine[] = [];\n\n let currentModifiers = modifiers;\n let currentLineNumber = startingLineNumber;\n\n let prevIndex = 0;\n newlineRegex.lastIndex = 0;\n for (;;) {\n const match = newlineRegex.exec(text);\n if (!match) {\n const chunks = this.processText(\n text.slice(prevIndex),\n currentModifiers,\n );\n lines.push(new AnsiLine(currentLineNumber, chunks));\n return lines;\n }\n\n const line = text.slice(prevIndex, match.index);\n prevIndex = match.index + match[0].length;\n\n const chunks = this.processText(line, currentModifiers);\n lines.push(new AnsiLine(currentLineNumber, chunks));\n\n // Modifiers that are active in the last chunk are carried over to the next line\n currentModifiers =\n chunks[chunks.length - 1].modifiers ?? currentModifiers;\n currentLineNumber += 1;\n }\n };\n\n // Processing of a one individual text chunk\n private processText = (\n fullText: string,\n modifiers: ChunkModifiers,\n ): AnsiChunk[] => {\n const chunks: AnsiChunk[] = [];\n\n let currentModifiers = modifiers;\n\n let prevIndex = 0;\n ansiRegex.lastIndex = 0;\n for (;;) {\n const match = ansiRegex.exec(fullText);\n if (!match) {\n chunks.push({\n text: fullText.slice(prevIndex),\n modifiers: currentModifiers,\n });\n return chunks;\n }\n\n const text = fullText.slice(prevIndex, match.index);\n chunks.push({ text, modifiers: currentModifiers });\n\n // For every escape code that we encounter we keep track of where the\n // next chunk of text starts, and what modifiers it has\n prevIndex = match.index + match[0].length;\n currentModifiers = this.processCode(match[0], currentModifiers);\n }\n };\n\n private processCode = (\n code: string,\n modifiers: ChunkModifiers,\n ): ChunkModifiers => {\n return codeModifiers[code]?.(modifiers) ?? modifiers;\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useMemo, useRef } from 'react';\nimport { AnsiChunk, AnsiLine, ChunkModifiers } from './AnsiProcessor';\nimport startCase from 'lodash/startCase';\nimport classnames from 'classnames';\nimport { useStyles } from './styles';\nimport Linkify from 'linkify-react';\nimport { Link } from '../Link';\n\nexport function getModifierClasses(\n classes: ReturnType<typeof useStyles>,\n modifiers: ChunkModifiers,\n) {\n const classNames = new Array<string>();\n if (modifiers.bold) {\n classNames.push(classes.modifierBold);\n }\n if (modifiers.italic) {\n classNames.push(classes.modifierItalic);\n }\n if (modifiers.underline) {\n classNames.push(classes.modifierUnderline);\n }\n if (modifiers.foreground) {\n const key = `modifierForeground${startCase(\n modifiers.foreground,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n if (modifiers.background) {\n const key = `modifierBackground${startCase(\n modifiers.background,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n return classNames.length > 0 ? classNames.join(' ') : undefined;\n}\n\nexport function findSearchResults(text: string, searchText: string) {\n if (!searchText || !text.includes(searchText)) {\n return undefined;\n }\n const searchResults = new Array<{ start: number; end: number }>();\n let offset = 0;\n for (;;) {\n const start = text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n const end = start + searchText.length;\n searchResults.push({ start, end });\n offset = end;\n }\n return searchResults;\n}\n\nexport interface HighlightAnsiChunk extends AnsiChunk {\n highlight?: number;\n}\n\nexport function calculateHighlightedChunks(\n line: AnsiLine,\n searchText: string,\n): HighlightAnsiChunk[] {\n const results = findSearchResults(line.text, searchText);\n if (!results) {\n return line.chunks;\n }\n\n const chunks = new Array<HighlightAnsiChunk>();\n\n let lineOffset = 0;\n let resultIndex = 0;\n let result = results[resultIndex];\n for (const chunk of line.chunks) {\n const { text, modifiers } = chunk;\n if (!result || lineOffset + text.length < result.start) {\n chunks.push(chunk);\n lineOffset += text.length;\n continue;\n }\n\n let localOffset = 0;\n while (result) {\n const localStart = Math.max(result.start - lineOffset, 0);\n if (localStart > text.length) {\n break; // The next result is not in this chunk\n }\n\n const localEnd = Math.min(result.end - lineOffset, text.length);\n\n const hasTextBeforeResult = localStart > localOffset;\n if (hasTextBeforeResult) {\n chunks.push({ text: text.slice(localOffset, localStart), modifiers });\n }\n const hasResultText = localEnd > localStart;\n if (hasResultText) {\n chunks.push({\n modifiers,\n highlight: resultIndex,\n text: text.slice(localStart, localEnd),\n });\n }\n\n localOffset = localEnd;\n\n const foundCompleteResult = result.end - lineOffset === localEnd;\n if (foundCompleteResult) {\n resultIndex += 1;\n result = results[resultIndex];\n } else {\n break; // The rest of the result is in the following chunks\n }\n }\n\n const hasTextAfterResult = localOffset < text.length;\n if (hasTextAfterResult) {\n chunks.push({ text: text.slice(localOffset), modifiers });\n }\n\n lineOffset += text.length;\n }\n\n return chunks;\n}\n\nconst renderLink = ({\n attributes,\n content,\n}: {\n attributes: { [attr: string]: any };\n content: string;\n}) => {\n const { href, ...props } = attributes;\n return (\n <Link to={href} {...props}>\n {content}\n </Link>\n );\n};\n\nexport interface LogLineProps {\n line: AnsiLine;\n classes: ReturnType<typeof useStyles>;\n searchText: string;\n highlightResultIndex?: number;\n setRowHeight?: (index: number, size: number) => void;\n}\n\nexport function LogLine({\n line,\n classes,\n searchText,\n highlightResultIndex,\n setRowHeight,\n}: LogLineProps) {\n const lineRef = useRef<HTMLSpanElement>(null);\n const chunks = useMemo(\n () => calculateHighlightedChunks(line, searchText),\n [line, searchText],\n );\n\n useEffect(() => {\n if (lineRef.current && setRowHeight) {\n setRowHeight(line.lineNumber, lineRef.current.offsetHeight);\n }\n }, [line.lineNumber, setRowHeight]);\n\n const elements = useMemo(\n () =>\n chunks.map(({ text, modifiers, highlight }, index) => (\n // eslint-disable-next-line react/forbid-elements\n <span\n key={index}\n className={classnames(\n getModifierClasses(classes, modifiers),\n highlight !== undefined &&\n (highlight === highlightResultIndex\n ? classes.textSelectedHighlight\n : classes.textHighlight),\n { [classes.textWrap]: !!setRowHeight },\n )}\n >\n <Linkify options={{ render: renderLink }}>{text}</Linkify>\n </span>\n )),\n [chunks, highlightResultIndex, classes, setRowHeight],\n );\n\n return <span ref={lineRef}>{elements}</span>;\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 { KeyboardEvent } from 'react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport IconButton from '@material-ui/core/IconButton';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { LogViewerSearch } from './useLogViewerSearch';\n\nexport interface LogViewerControlsProps extends LogViewerSearch {}\n\nexport function LogViewerControls(props: LogViewerControlsProps) {\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const { resultCount, resultIndexStep, toggleShouldFilter } = props;\n const resultIndex = props.resultIndex ?? 0;\n\n const handleKeyPress = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n if (event.metaKey || event.ctrlKey || event.altKey) {\n toggleShouldFilter();\n } else {\n resultIndexStep(event.shiftKey);\n }\n }\n };\n\n return (\n <>\n {resultCount !== undefined && (\n <>\n <IconButton size=\"small\" onClick={() => resultIndexStep(true)}>\n <ChevronLeftIcon />\n </IconButton>\n <Typography>\n {Math.min(resultIndex + 1, resultCount)}/{resultCount}\n </Typography>\n <IconButton size=\"small\" onClick={() => resultIndexStep()}>\n <ChevronRightIcon />\n </IconButton>\n </>\n )}\n <TextField\n size=\"small\"\n variant=\"standard\"\n placeholder={t('logViewer.searchField.placeholder')}\n value={props.searchInput}\n onKeyPress={handleKeyPress}\n onChange={e => props.setSearchInput(e.target.value)}\n />\n <IconButton size=\"small\" onClick={toggleShouldFilter}>\n {props.shouldFilter ? (\n <FilterListIcon color=\"primary\" />\n ) : (\n <FilterListIcon color=\"disabled\" />\n )}\n </IconButton>\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport * as colors from '@material-ui/core/colors';\n\nexport const HEADER_SIZE = 40;\n\n/** @public Class keys for overriding LogViewer styles */\nexport type LogViewerClassKey =\n | 'root'\n | 'header'\n | 'log'\n | 'line'\n | 'lineSelected'\n | 'lineCopyButton'\n | 'lineNumber'\n | 'textHighlight'\n | 'textSelectedHighlight'\n | 'modifierBold'\n | 'modifierItalic'\n | 'modifierUnderline'\n | 'modifierForegroundBlack'\n | 'modifierForegroundRed'\n | 'modifierForegroundGreen'\n | 'modifierForegroundYellow'\n | 'modifierForegroundBlue'\n | 'modifierForegroundMagenta'\n | 'modifierForegroundCyan'\n | 'modifierForegroundWhite'\n | 'modifierForegroundGrey'\n | 'modifierBackgroundBlack'\n | 'modifierBackgroundRed'\n | 'modifierBackgroundGreen'\n | 'modifierBackgroundYellow'\n | 'modifierBackgroundBlue'\n | 'modifierBackgroundMagenta'\n | 'modifierBackgroundCyan'\n | 'modifierBackgroundWhite'\n | 'modifierBackgroundGrey';\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n background: theme.palette.background.paper,\n },\n header: {\n height: HEADER_SIZE,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n log: {\n fontFamily: '\"Monaco\", monospace',\n fontSize: theme.typography.pxToRem(12),\n lineHeight: '20px',\n },\n line: {\n position: 'relative',\n whiteSpace: 'pre',\n display: 'flex',\n alignItems: 'flex-start',\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n },\n lineSelected: {\n background: theme.palette.action.selected,\n\n '&:hover': {\n background: theme.palette.action.selected,\n },\n },\n lineCopyButton: {\n position: 'absolute',\n paddingTop: 0,\n paddingBottom: 0,\n '&:hover': {\n color: theme.palette.linkHover,\n },\n },\n lineNumber: {\n display: 'inline-block',\n textAlign: 'end',\n width: 60,\n paddingRight: theme.spacing(1),\n marginRight: theme.spacing(1),\n cursor: 'pointer',\n flexShrink: 0,\n color: colors.blue[300],\n borderRight: `1px solid ${colors.blue[700]}`,\n },\n textHighlight: {\n background: alpha(theme.palette.info.main, 0.15),\n },\n textSelectedHighlight: {\n background: alpha(theme.palette.info.main, 0.4),\n },\n modifierBold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n modifierItalic: {\n fontStyle: 'italic',\n },\n modifierUnderline: {\n textDecoration: 'underline',\n },\n modifierForegroundBlack: {\n color: colors.common.black,\n },\n modifierForegroundRed: {\n color: colors.red[500],\n },\n modifierForegroundGreen: {\n color: colors.green[500],\n },\n modifierForegroundYellow: {\n color: colors.yellow[500],\n },\n modifierForegroundBlue: {\n color: colors.blue[500],\n },\n modifierForegroundMagenta: {\n color: colors.purple[500],\n },\n modifierForegroundCyan: {\n color: colors.cyan[500],\n },\n modifierForegroundWhite: {\n color: colors.common.white,\n },\n modifierForegroundGrey: {\n color: colors.grey[500],\n },\n modifierBackgroundBlack: {\n background: colors.common.black,\n },\n modifierBackgroundRed: {\n background: colors.red[500],\n },\n modifierBackgroundGreen: {\n background: colors.green[500],\n },\n modifierBackgroundYellow: {\n background: colors.yellow[500],\n },\n modifierBackgroundBlue: {\n background: colors.blue[500],\n },\n modifierBackgroundMagenta: {\n background: colors.purple[500],\n },\n modifierBackgroundCyan: {\n background: colors.cyan[500],\n },\n modifierBackgroundWhite: {\n background: colors.common.white,\n },\n modifierBackgroundGrey: {\n background: colors.grey[500],\n },\n textWrap: {\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-all',\n },\n }),\n { name: 'BackstageLogViewer' },\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 Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport classnames from 'classnames';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { FixedSizeList, VariableSizeList } from 'react-window';\n\nimport { AnsiLine, AnsiProcessor } from './AnsiProcessor';\nimport { LogLine } from './LogLine';\nimport { LogViewerControls } from './LogViewerControls';\nimport { HEADER_SIZE, useStyles } from './styles';\nimport { useLogViewerSearch } from './useLogViewerSearch';\nimport { useLogViewerSelection } from './useLogViewerSelection';\nimport Snackbar from '@material-ui/core/Snackbar';\n\nexport interface RealLogViewerProps {\n text: string;\n textWrap?: boolean;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const [listInstance, setListInstance] = useState<\n VariableSizeList<AnsiLine[]> | FixedSizeList<AnsiLine[]> | null\n >(null);\n const shouldTextWrap = props.textWrap ?? false;\n const heights = useRef<{ [key: number]: number }>({});\n\n // The processor keeps state that optimizes appending to the text\n const processor = useMemo(() => new AnsiProcessor(), []);\n const lines = processor.process(props.text);\n const [showCopyInfo, setShowCopyInfo] = useState(false);\n\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (listInstance) {\n listInstance.scrollToItem(lines.length - 1, 'end');\n }\n }, [listInstance, lines]);\n\n useEffect(() => {\n if (!listInstance) {\n return;\n }\n if (search.resultLine) {\n listInstance.scrollToItem(search.resultLine - 1, 'center');\n } else {\n listInstance.scrollToItem(lines.length - 1, 'end');\n }\n }, [listInstance, search.resultLine, lines]);\n\n useEffect(() => {\n const hash = selection.getHash();\n if (hash.length > 0) {\n history.replaceState(null, '', hash);\n }\n }, [selection]);\n\n useEffect(() => {\n if (location.hash) {\n selection.selectAll(location.hash);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: {\n shiftKey: boolean;\n metaKey: boolean;\n ctrlKey: boolean;\n preventDefault: () => void;\n },\n ) => {\n event.preventDefault();\n selection.setSelection(\n line,\n event.shiftKey,\n event.metaKey || event.ctrlKey,\n );\n };\n\n const handleCopySelection = (line: number) => {\n selection.copySelection(line);\n setShowCopyInfo(true);\n };\n\n function setRowHeight(index: number, size: number) {\n if (shouldTextWrap && listInstance) {\n (listInstance as VariableSizeList<AnsiLine[]>).resetAfterIndex(0);\n // lineNumber is 1-based but index is 0-based\n heights.current[index - 1] = size;\n }\n }\n\n function getRowHeight(index: number) {\n return heights.current[index] || 20;\n }\n\n return (\n <>\n <AutoSizer>\n {({ height, width }: { height?: number; width?: number }) => {\n const commonProps = {\n ref: setListInstance,\n className: classes.log,\n height: (height || 480) - HEADER_SIZE,\n width: width || 640,\n itemData: search.lines,\n itemCount: search.lines.length,\n };\n\n const renderItem = ({\n index,\n style,\n data,\n }: {\n index: number;\n style: React.CSSProperties;\n data: AnsiLine[];\n }) => {\n const line = data[index];\n const { lineNumber } = line;\n return (\n <Box\n style={{ ...style }}\n className={classnames(classes.line, {\n [classes.lineSelected]: selection.isSelected(lineNumber),\n })}\n >\n {selection.shouldShowCopyButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => handleCopySelection(lineNumber)}\n >\n <CopyIcon fontSize=\"inherit\" />\n </IconButton>\n )}\n <a\n role=\"row\"\n target=\"_self\"\n href={`#line-${lineNumber}`}\n className={classes.lineNumber}\n onClick={event => handleSelectLine(lineNumber, event)}\n onKeyPress={event => handleSelectLine(lineNumber, event)}\n >\n {lineNumber}\n </a>\n <LogLine\n setRowHeight={shouldTextWrap ? setRowHeight : undefined}\n line={line}\n classes={classes}\n searchText={search.searchText}\n highlightResultIndex={\n search.resultLine === lineNumber\n ? search.resultLineIndex\n : undefined\n }\n />\n </Box>\n );\n };\n\n return (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n {shouldTextWrap ? (\n <VariableSizeList<AnsiLine[]>\n {...commonProps}\n itemSize={getRowHeight}\n >\n {renderItem}\n </VariableSizeList>\n ) : (\n <FixedSizeList<AnsiLine[]> {...commonProps} itemSize={20}>\n {renderItem}\n </FixedSizeList>\n )}\n </Box>\n );\n }}\n </AutoSizer>\n <Snackbar\n open={showCopyInfo}\n autoHideDuration={3000}\n onClose={() => setShowCopyInfo(false)}\n message=\"Lines copied to clipboard\"\n anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}\n />\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMemo, useState } from 'react';\nimport { useToggle } from '@react-hookz/web';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function applySearchFilter(lines: AnsiLine[], searchText: string) {\n if (!searchText) {\n return { lines };\n }\n\n const matchingLines = [];\n const searchResults = [];\n for (const line of lines) {\n if (line.text.includes(searchText)) {\n matchingLines.push(line);\n\n let offset = 0;\n let lineResultIndex = 0;\n for (;;) {\n const start = line.text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n searchResults.push({\n lineNumber: line.lineNumber,\n lineIndex: lineResultIndex++,\n });\n offset = start + searchText.length;\n }\n }\n }\n\n return {\n lines: matchingLines,\n results: searchResults,\n };\n}\n\nexport interface LogViewerSearch {\n lines: AnsiLine[];\n\n searchText: string;\n searchInput: string;\n setSearchInput: (searchInput: string) => void;\n\n shouldFilter: boolean;\n toggleShouldFilter: () => void;\n\n resultCount: number | undefined;\n resultIndex: number | undefined;\n resultIndexStep: (decrement?: boolean) => void;\n\n resultLine: number | undefined;\n resultLineIndex: number | undefined;\n}\n\nexport function useLogViewerSearch(lines: AnsiLine[]): LogViewerSearch {\n const [searchInput, setSearchInput] = useState('');\n const searchText = searchInput.toLocaleLowerCase('en-US');\n\n const [resultIndex, setResultIndex] = useState<number>(0);\n\n const [shouldFilter, toggleShouldFilter] = useToggle(false);\n\n const filter = useMemo(\n () => applySearchFilter(lines, searchText),\n [lines, searchText],\n );\n\n const searchResult = filter.results\n ? filter.results[Math.min(resultIndex, filter.results.length - 1)]\n : undefined;\n const resultCount = filter.results?.length;\n\n const resultIndexStep = (decrement?: boolean) => {\n if (decrement) {\n if (resultCount !== undefined) {\n const next = Math.min(resultIndex - 1, resultCount - 2);\n setResultIndex(next < 0 ? resultCount - 1 : next);\n }\n } else {\n if (resultCount !== undefined) {\n const next = resultIndex + 1;\n setResultIndex(next >= resultCount ? 0 : next);\n }\n }\n };\n\n return {\n lines: shouldFilter ? filter.lines : lines,\n searchText,\n searchInput,\n setSearchInput,\n shouldFilter,\n toggleShouldFilter,\n resultCount,\n resultIndex,\n resultIndexStep,\n resultLine: searchResult?.lineNumber,\n resultLineIndex: searchResult?.lineIndex,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { AnsiLine } from './AnsiProcessor';\n\ntype Selection = {\n start: number;\n end: number;\n};\n\nexport function useLogViewerSelection(lines: AnsiLine[]) {\n const errorApi = useApi(errorApiRef);\n const [selections, setSelections] = useState<Selection[]>([]);\n\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n const findClosestSelection = (\n allSelections: Selection[],\n line: number,\n ): Selection | undefined => {\n if (selections.length === 0) {\n return undefined;\n }\n let minDistance = Number.MAX_SAFE_INTEGER;\n let closestSelection: Selection | undefined = undefined;\n\n allSelections.forEach(s => {\n const distance = Math.min(\n Math.abs(s.start - line),\n Math.abs(s.end - line),\n );\n if (distance < minDistance) {\n minDistance = distance;\n closestSelection = s;\n }\n });\n\n return closestSelection;\n };\n\n const mergeNeighbouringSelections = (\n allSelections: Selection[],\n line: number,\n ): Selection[] => {\n // Merge selections if they're next to each other\n const neighboringSelections = allSelections.filter(\n s => s.start - 1 === line || s.end + 1 === line,\n );\n if (neighboringSelections.length === 0) {\n return allSelections;\n }\n const newSelection = {\n start: Math.min(line, ...neighboringSelections.map(s => s.start)),\n end: Math.max(line, ...neighboringSelections.map(s => s.end)),\n };\n\n return [\n ...allSelections.filter(\n s =>\n !neighboringSelections.includes(s) &&\n !(s.start === line && s.end === line),\n ),\n newSelection,\n ];\n };\n\n return {\n shouldShowCopyButton(line: number) {\n // show copy button at the beginning of each selection\n return selections.some(s => s.start === line);\n },\n isSelected(line: number) {\n if (!selections) {\n return false;\n }\n // check if line is in any selection range\n return selections.some(\n s => s.start <= line && (s.end ?? s.start) >= line,\n );\n },\n setSelection(line: number, addRange: boolean, addNewSelection: boolean) {\n setSelections(currentSelections => {\n const clickedSelection = currentSelections.find(\n s => s.start <= line && s.end >= line,\n );\n const otherSelections = currentSelections.filter(\n s => s !== clickedSelection,\n );\n\n if (!addRange && !addNewSelection) {\n // Normal click -> select only this line if nothing or multiple lines are selected\n if (\n !clickedSelection ||\n clickedSelection.start !== clickedSelection.end\n ) {\n return [{ start: line, end: line }];\n }\n // Clear selection if single line is selected\n return [];\n }\n\n if (addRange) {\n // Shift+click -> extend/reduce selection\n if (currentSelections.length === 0) {\n // No existing selection -> create new selection\n return [{ start: line, end: line }];\n }\n\n if (clickedSelection) {\n // Clicked inside an existing selection -> reduce selection\n if (clickedSelection.start === clickedSelection.end) {\n // Single line selection -> remove it\n return otherSelections;\n }\n // Reduce selection\n return [\n ...otherSelections,\n { start: clickedSelection.start, end: line },\n ];\n }\n\n // Extend the closest selection to the new line\n const closestSelection = findClosestSelection(\n currentSelections,\n line,\n );\n if (!closestSelection) {\n // Can't actually happen\n return currentSelections;\n }\n if (closestSelection.start < line) {\n // Add lines before the selection\n return mergeNeighbouringSelections(\n [\n ...otherSelections.filter(s => s !== closestSelection),\n { start: closestSelection.start, end: line },\n ],\n line,\n );\n }\n // Add lines after the selection\n return mergeNeighbouringSelections(\n [\n ...otherSelections.filter(s => s !== closestSelection),\n { start: line, end: closestSelection!.end },\n ],\n line,\n );\n }\n\n if (addNewSelection) {\n // Ctrl/Cmd+click -> add new selection\n if (!clickedSelection) {\n // Just add new selection\n return mergeNeighbouringSelections(\n [...currentSelections, { start: line, end: line }],\n line,\n );\n }\n if (clickedSelection.start === clickedSelection.end) {\n // Single line selection -> remove it\n return otherSelections;\n }\n // Multi line selection -> split it\n return [\n ...otherSelections,\n ...(clickedSelection.start < line\n ? [{ start: clickedSelection.start, end: line - 1 }]\n : []),\n ...(clickedSelection.end > line\n ? [{ start: line + 1, end: clickedSelection.end }]\n : []),\n ];\n }\n\n return [];\n });\n },\n copySelection(line: number) {\n const selection = selections.find(s => s.start === line);\n if (!selection) {\n return;\n }\n const copyText = lines\n .slice(selection.start - 1, selection.end)\n .map(l => l.chunks.map(c => c.text).join(''))\n .join('\\n');\n copyToClipboard(copyText);\n },\n getHash() {\n if (selections.length === 0) {\n return '';\n }\n const parts = selections.map(s => {\n if (s.start === s.end) {\n return `${s.start}`;\n }\n return `${s.start}-${s.end}`;\n });\n return `#lines-${parts.join(',')}`;\n },\n selectAll(hash: string) {\n const match = hash.match(/#lines-([\\d,-]+)/);\n const s: Selection[] = [];\n if (match) {\n const ranges = match[1].split(',');\n ranges.forEach(r => {\n const [start, end] = r.split('-').map(Number);\n s.push({ start, end: end ?? start });\n });\n }\n setSelections(s);\n },\n };\n}\n"],"names":["ansiRegex","ansiRegexMaker","newlineRegex","codeModifiers","Object","m","_","code","modifier","AnsiLine","lineNumber","chunks","c","newChunks","AnsiProcessor","text","lastLineIndex","lastLine","lastChunk","newLines","modifiers","startingLineNumber","lines","currentModifiers","currentLineNumber","prevIndex","match","line","fullText","renderLink","attributes","content","href","props","Link","LogLine","classes","searchText","highlightResultIndex","setRowHeight","lineRef","useRef","useMemo","calculateHighlightedChunks","results","findSearchResults","searchResults","Array","offset","start","end","lineOffset","resultIndex","result","chunk","localOffset","localStart","Math","localEnd","hasTextBeforeResult","hasResultText","hasTextAfterResult","useEffect","elements","highlight","index","classnames","getModifierClasses","classNames","key","startCase","undefined","Linkify","LogViewerControls","t","useTranslationRef","coreComponentsTranslationRef","resultCount","resultIndexStep","toggleShouldFilter","IconButton","ChevronLeftIcon","Typography","ChevronRightIcon","TextField","event","e","FilterListIcon","useStyles","makeStyles","theme","colors","alpha","RealLogViewer","listInstance","setListInstance","useState","shouldTextWrap","heights","processor","showCopyInfo","setShowCopyInfo","search","useLogViewerSearch","searchInput","setSearchInput","setResultIndex","shouldFilter","useToggle","filter","applySearchFilter","matchingLines","lineResultIndex","searchResult","decrement","next","selection","useLogViewerSelection","errorApi","useApi","errorApiRef","selections","setSelections","error","copyToClipboard","useCopyToClipboard","mergeNeighbouringSelections","allSelections","neighboringSelections","s","newSelection","addRange","addNewSelection","currentSelections","clickedSelection","otherSelections","closestSelection","findClosestSelection","minDistance","Number","distance","l","parts","hash","ranges","r","location","useLocation","history","handleSelectLine","size","getRowHeight","AutoSizer","height","width","commonProps","renderItem","style","data","Box","CopyIcon","VariableSizeList","FixedSizeList","Snackbar"],"mappings":"2RAkBA,IAAMA,EAAYC,AAAAA,GAAAA,A,SAAAA,CAAAA,AAAAA,IACZC,EAAe,SAGfC,EAAgBC,OAAO,WAAW,CACtCA,OAAO,OAAO,CAAC,CACb,EAAGC,AAAAA,GAAM,EAAE,GAAGA,CAAC,CAAE,KAAM,EAAK,GAC5B,EAAGA,AAAAA,GAAM,EAAE,GAAGA,CAAC,CAAE,OAAQ,EAAK,GAC9B,EAAGA,AAAAA,GAAM,EAAE,GAAGA,CAAC,CAAE,UAAW,EA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,CAAC,CAC3B,UAAW0B,EAAQ,UAAU,CAC7B,QAASiD,AAAAA,GAASgE,EAAiB3I,EAAY2E,GAC/C,WAAYA,AAAAA,GAASgE,EAAiB3I,EAAY2E,G,SAEjD3E,C,GAEH,UAACyB,EAAOA,CACN,aAAc8D,EAAiB1D,EAAegC,OAC9C,KAAM5C,EACN,QAASS,EACT,WAAYkE,EAAO,UAAU,CAC7B,qBACEA,EAAO,UAAU,GAAK5F,EAClB4F,EAAO,eAAe,CACtB/B,M,KAKd,EAEA,MACE,WAACwF,EAAAA,CAAGA,CAAAA,CAAC,MAAO,CAAEL,MAAAA,EAAOD,OAAAA,CAAO,EAAG,UAAWrH,EAAQ,IAAI,C,UACpD,UAAC2H,EAAAA,CAAGA,CAAAA,CAAC,UAAW3H,EAAQ,MAAM,C,SAC5B,UAACqC,EAAiBA,CAAE,GAAG6B,CAAM,A,KAE9BL,EACC,UAACgE,EAAAA,EAAgBA,CAAAA,CACd,GAAGN,CAAW,CACf,SAAUJ,E,SAETK,C,GAGH,UAACM,EAAAA,EAAaA,CAAAA,CAAc,GAAGP,CAAW,CAAE,SAAU,G,SACnDC,C,KAKX,C,GAEF,UAACO,EAAAA,CAAQA,CAAAA,CACP,KAAM/D,EACN,iBAAkB,IAClB,QAAS,IAAMC,EAAgB,IAC/B,QAAQ,4BACR,aAAc,CAAE,SAAU,SAAU,WAAY,QAAS,C,KAIjE,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["4648"],{52235:function(e,t,n){var i=n(4293),a=n(78920);t.default=void 0;var o=a(n(14041));t.default=(0,i(n(74044)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},98557:function(e,t,n){n.d(t,{M:()=>l});var i=n(31085),a=n(58837),o=n(71677),s=n(72501);let r=(0,a.A)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:e})=>e||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function l(e){let t=r(e);return(0,i.jsx)(o.Ay,{title:e.title??(e.text||""),placement:e.placement,children:(0,i.jsx)(s.A,{className:t.typo,variant:"inherit",children:e.text})})}},89439:function(e,t,n){n.d(t,{n:()=>M});var i=n(31085),a=n(40703),o=n(59469),s=n(48653),r=n(45685),l=n(37197),c=n(58837),d=n(24568),m=n(53373),u=n.n(m),p=n(9720),y=n(72501),h=n(52235),f=n(60603);let g=(0,c.A)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function x(e){let{link:t,title:n,onClick:a}=e,o=g();return(0,i.jsxs)(p.A,{children:[(0,i.jsx)(l.A,{}),(0,i.jsx)(f.N_,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(p.A,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(p.A,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(y.A,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(h.default,{className:o.arrow})]})})]})}var C=n(14041),b=n(45463),v=n(60691),j=n(89332),w=n(55994);let E=e=>{let{slackChannel:t}=e,{t:n}=(0,w.i)(j.O);return t?"string"==typeof t?(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(b.z,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t.name})}):null},A=class extends C.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:n}=this.state;return n?(0,i.jsx)(v.b,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(E,{slackChannel:e})}):t}},T=(0,c.A)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),S=(0,d.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.A),k={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"}}},L={fullHeight:{flex:1},gridItem:{flex:1}};function M(e){let{title:t,subheader:n,divider:c=!0,deepLink:d,slackChannel:m,errorBoundaryProps:p,variant:y,alignContent:h="normal",children:f,headerStyle:g,headerProps:C,icon:b,action:v,actionsClassName:j,actions:w,cardClassName:E,actionsTopRight:M,className:R,noPadding:N,titleTypographyProps:B,subheaderTypographyProps:O}=e,D=T(),K={},I={};return y&&y.split(/[\s]+/g).forEach(e=>{K={...K,...k[e]},I={...I,...L[e]}}),(0,i.jsx)(a.A,{style:K,className:R,children:(0,i.jsxs)(A,{...p||(m?{slackChannel:m}:{}),children:[t&&(0,i.jsx)(r.A,{classes:{root:u()(D.header),title:D.headerTitle,subheader:D.headerSubheader,avatar:D.headerAvatar,action:D.headerAction,content:D.headerContent},title:t,subheader:n||b?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:D.subheader,children:n}),b]}):null,action:v,style:{...g},titleTypographyProps:B,subheaderTypographyProps:O,...C}),M&&(0,i.jsx)(S,{children:M}),c&&(0,i.jsx)(l.A,{}),(0,i.jsx)(s.A,{className:u()(E,{[D.noPadding]:N,[D.contentAlignBottom]:"bottom"===h}),style:I,children:f}),w&&(0,i.jsx)(o.A,{className:j,children:w}),d&&(0,i.jsx)(x,{...d})]})})}},65671:function(e,t,n){n.d(t,{s:()=>g});var i=n(31085),a=n(58837),o=n(96403),s=n(98557),r=n(53320),l=n(7537),c=n(76025),d=n(53987),m=n(19857);let u=Object.freeze({createEntityRefColumn(e){let{defaultKind:t}=e;function n(e){return e.metadata?.title||(0,l.S)(e,{defaultKind:t})}return{title:(0,i.jsx)(m.g,{translationKey:"name"}),highlight:!0,customFilterAndSearch:(e,t)=>n(t).includes(e),customSort:(e,t)=>n(e).localeCompare(n(t)),render:e=>(0,i.jsx)(c.z,{entityRef:e,defaultKind:t,title:e.metadata?.title})}},createEntityRelationColumn(e){let{title:t,relation:n,defaultKind:a,filter:o}=e;function s(e){return(0,r.t)(e,n,o)}function c(e){return s(e).map(e=>(0,l.S)(e,{defaultKind:a})).join(", ")}return{title:t,customFilterAndSearch:(e,t)=>c(t).includes(e),customSort:(e,t)=>c(e).localeCompare(c(t)),render:e=>(0,i.jsx)(d.i,{entityRefs:s(e),defaultKind:a})}},createOwnerColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"owner"}),relation:o.vv,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"domain"}),relation:o.jn,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"system"}),relation:o.jn,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"description"}),field:"metadata.description",render:e=>(0,i.jsx)(s.M,{text:e.metadata.description,placement:"bottom-start",line:2})}),createSpecLifecycleColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"lifecycle"}),field:"spec.lifecycle"}),createSpecTypeColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"type"}),field:"spec.type"})}),p=[u.createEntityRefColumn({defaultKind:"system"}),u.createDomainColumn(),u.createOwnerColumn(),u.createMetadataDescriptionColumn()],y=[u.createEntityRefColumn({defaultKind:"component"}),u.createSystemColumn(),u.createOwnerColumn(),u.createSpecTypeColumn(),u.createSpecLifecycleColumn(),u.createMetadataDescriptionColumn()];var h=n(28499);let f=(0,a.A)(e=>({empty:{padding:e.spacing(2),display:"flex",justifyContent:"center"}})),g=e=>{let{entities:t,title:n,emptyContent:a,variant:o="gridItem",columns:s,tableOptions:r={}}=e,l=f(),c={minWidth:"0",width:"100%"};return"gridItem"===o&&(c.height="calc(100% - 10px)"),(0,i.jsx)(h.X,{columns:s,title:n,style:c,emptyContent:a&&(0,i.jsx)("div",{className:l.empty,children:a}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...r},data:t})};g.columns=u,g.systemEntityColumns=p,g.componentEntityColumns=y},19857:function(e,t,n){n.d(t,{g:()=>o});var i=n(55994),a=n(79811);let o=({translationKey:e})=>{let{t}=(0,i.i)(a.j);return t(`entityTableColumnTitle.${e}`)}},22845:function(e,t,n){n.d(t,{T7:()=>c,TY:()=>m,tN:()=>d});var i=n(31085),a=n(58077),o=n(92829),s=n(9135),r=n(20549);let l=(0,s.tK)("entity-context"),c=e=>{let{children:t,entity:n,loading:s,error:c,refresh:d}=e;return(0,i.jsx)(l.Provider,{value:(0,r.B)({1:{entity:n,loading:s,error:c,refresh:d}}),children:(0,i.jsx)(o.Ig,{attributes:{...n?{entityRef:(0,a.U2)(n)}:void 0},children:t})})};function d(){let e=(0,s.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw 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:t.entity}}function m(){let e=(0,s.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:i,error:a,refresh:o}=t;return{entity:n,loading:i,error:a,refresh:o}}},50010:function(e,t,n){n.d(t,{W:()=>i});let i=(0,n(75493).h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:"This entity has relations to other entities, which can't be found in the catalog.\n Entities not found are: ",hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},68859:function(e,t,n){n.d(t,{HasSystemsCard:()=>c});var i=n(31085),a=n(96403),o=n(79842),s=n(44849),r=n(50010),l=n(55994);function c(e){let{t}=(0,l.i)(r.W),{variant:n="gridItem",title:c=t("hasSystemsCard.title"),columns:d=o.MW,tableOptions:m={}}=e;return(0,i.jsx)(s.p,{variant:n,title:c,entityKind:"System",relationType:a.sA,columns:d,asRenderableEntities:o.vy,emptyMessage:t("hasSystemsCard.emptyMessage"),emptyHelpLink:o.iU,tableOptions:m})}},44849:function(e,t,n){n.d(t,{p:()=>T});var i=n(31085),a=n(72501),o=n(22845),s=n(58077),r=n(5712),l=n(73466),c=n(76272),d=n(65671),m=n(89439),u=n(55489),p=n(58837),y=n(37197),h=n(8109),f=n(5951),g=n(4809),x=n(55555),C=n(60691);let b=(0,p.A)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function v(e){let{title:t,error:n,defaultExpanded:a}=e,o=b();if("ResponseError"!==n.name)return(0,i.jsx)(C.b,{title:t??n.message,defaultExpanded:a,error:n});let{body:s,cause:r}=n,{request:l,response:c}=s,d=`${c.statusCode}: ${r.name}`,m=l&&`${l.method} ${l.url}`,u=r.message.replace(/\\n/g,"\n"),p=r.stack?.replace(/\\n/g,"\n"),v=JSON.stringify(s,void 0,2);return(0,i.jsxs)(C.b,{title:t??n.message,defaultExpanded:a,error:{name:d,message:u,stack:p},children:[m&&(0,i.jsxs)(h.A,{alignItems:"flex-start",children:[(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Request",secondary:l?`${m}`:void 0}),(0,i.jsx)(x.l,{text:m})]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.A,{component:"li",className:o.divider}),(0,i.jsx)(h.A,{alignItems:"flex-start",children:(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Full Error as JSON"})}),(0,i.jsx)(g.z,{language:"json",text:v,showCopyCodeButton:!0})]})]})}var j=n(60603),w=n(79842),E=n(50010),A=n(55994);let T=e=>{let{variant:t="gridItem",title:n,columns:p,entityKind:y,relationType:h,emptyMessage:f,emptyHelpLink:g,asRenderableEntities:x,tableOptions:C={}}=e,{t:b}=(0,A.i)(E.W),{entity:w}=(0,o.tN)(),{entities:T,loading:S,error:k}=function(e,t){let n=t?.type?.toLocaleLowerCase("en-US"),i=t?.kind?.toLocaleLowerCase("en-US"),a=(0,r.gf)(c.v),{loading:o,value:d,error:m}=(0,l.A)(async()=>{let t=e.relations?.filter(e=>(!n||e.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,s.KU)(e.targetRef).kind===i));if(!t?.length)return[];let{items:o}=await a.getEntitiesByRefs({entityRefs:t.map(e=>e.targetRef)});return o.filter(e=>!!e)},[e,n,i]);return{entities:d,loading:o,error:m}}(w,{type:h,kind:y});return S?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(u.k,{})}):k?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(v,{error:k})}):(0,i.jsx)(d.s,{title:n,variant:t,emptyContent:(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)(a.A,{variant:"body1",children:f}),(0,i.jsx)(a.A,{variant:"body2",children:(0,i.jsx)(j.N_,{to:g,externalLinkIcon:!0,children:b("relatedEntitiesCard.emptyHelpLinkTitle")})})]}),columns:p,entities:x(T||[]),tableOptions:C})};T.componentEntityColumns=w.mz,T.componentEntityHelpLink=w.e2,T.asComponentEntities=w.xJ,T.resourceEntityColumns=w.v9,T.resourceEntityHelpLink=w.nz,T.asResourceEntities=w.eB,T.systemEntityColumns=w.MW,T.systemEntityHelpLink=w.iU,T.asSystemEntities=w.vy,T.domainEntityColums=w.xO,T.domainEntityHelpLink=w.Xr,T.asDomainEntities=w.QS},79842:function(e,t,n){n.d(t,{MW:()=>d,QS:()=>h,Xr:()=>y,e2:()=>o,eB:()=>c,iU:()=>m,mz:()=>a,nz:()=>l,v9:()=>r,vy:()=>u,xJ:()=>s,xO:()=>p});var i=n(65671);let a=[i.s.columns.createEntityRefColumn({defaultKind:"component"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],o="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",s=e=>e,r=[i.s.columns.createEntityRefColumn({defaultKind:"resource"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",c=e=>e,d=[i.s.columns.createEntityRefColumn({defaultKind:"system"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],m="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",u=e=>e,p=[i.s.columns.createEntityRefColumn({defaultKind:"domain"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",h=e=>e}}]);
|
|
2
|
-
//# sourceMappingURL=4648.
|
|
1
|
+
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["4648"],{52235:function(e,t,n){var i=n(4293),a=n(78920);t.default=void 0;var o=a(n(14041));t.default=(0,i(n(74044)).default)(o.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},98557:function(e,t,n){n.d(t,{M:()=>l});var i=n(31085),a=n(58837),o=n(71677),s=n(72501);let r=(0,a.A)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:e})=>e||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function l(e){let t=r(e);return(0,i.jsx)(o.Ay,{title:e.title??(e.text||""),placement:e.placement,children:(0,i.jsx)(s.A,{className:t.typo,variant:"inherit",children:e.text})})}},89439:function(e,t,n){n.d(t,{n:()=>M});var i=n(31085),a=n(40703),o=n(59469),s=n(48653),r=n(45685),l=n(37197),c=n(58837),d=n(24568),m=n(53373),u=n.n(m),p=n(9720),y=n(72501),h=n(52235),f=n(60603);let g=(0,c.A)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function x(e){let{link:t,title:n,onClick:a}=e,o=g();return(0,i.jsxs)(p.A,{children:[(0,i.jsx)(l.A,{}),(0,i.jsx)(f.N_,{to:t,onClick:a,underline:"none",children:(0,i.jsxs)(p.A,{display:"flex",alignItems:"center",className:o.root,children:[(0,i.jsx)(p.A,{className:o.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,i.jsx)(y.A,{children:(0,i.jsx)("strong",{children:n})})}),(0,i.jsx)(h.default,{className:o.arrow})]})})]})}var C=n(14041),b=n(45463),v=n(60691),j=n(89332),w=n(89595);let E=e=>{let{slackChannel:t}=e,{t:n}=(0,w.i)(j.O);return t?"string"==typeof t?(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t})}):t.href?(0,i.jsx)(b.z,{to:t.href,variant:"contained",children:t.name}):(0,i.jsx)(y.A,{children:n("errorBoundary.title",{slackChannel:t.name})}):null},A=class extends C.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:n}=this.state;return n?(0,i.jsx)(v.b,{title:"Something Went Wrong",error:n,children:(0,i.jsx)(E,{slackChannel:e})}):t}},T=(0,c.A)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),S=(0,d.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(o.A),k={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"}}},L={fullHeight:{flex:1},gridItem:{flex:1}};function M(e){let{title:t,subheader:n,divider:c=!0,deepLink:d,slackChannel:m,errorBoundaryProps:p,variant:y,alignContent:h="normal",children:f,headerStyle:g,headerProps:C,icon:b,action:v,actionsClassName:j,actions:w,cardClassName:E,actionsTopRight:M,className:R,noPadding:N,titleTypographyProps:B,subheaderTypographyProps:O}=e,D=T(),K={},I={};return y&&y.split(/[\s]+/g).forEach(e=>{K={...K,...k[e]},I={...I,...L[e]}}),(0,i.jsx)(a.A,{style:K,className:R,children:(0,i.jsxs)(A,{...p||(m?{slackChannel:m}:{}),children:[t&&(0,i.jsx)(r.A,{classes:{root:u()(D.header),title:D.headerTitle,subheader:D.headerSubheader,avatar:D.headerAvatar,action:D.headerAction,content:D.headerContent},title:t,subheader:n||b?(0,i.jsxs)("div",{"data-testid":"info-card-subheader",children:[n&&(0,i.jsx)("div",{className:D.subheader,children:n}),b]}):null,action:v,style:{...g},titleTypographyProps:B,subheaderTypographyProps:O,...C}),M&&(0,i.jsx)(S,{children:M}),c&&(0,i.jsx)(l.A,{}),(0,i.jsx)(s.A,{className:u()(E,{[D.noPadding]:N,[D.contentAlignBottom]:"bottom"===h}),style:I,children:f}),w&&(0,i.jsx)(o.A,{className:j,children:w}),d&&(0,i.jsx)(x,{...d})]})})}},65671:function(e,t,n){n.d(t,{s:()=>g});var i=n(31085),a=n(58837),o=n(96403),s=n(98557),r=n(53320),l=n(7537),c=n(76025),d=n(53987),m=n(19857);let u=Object.freeze({createEntityRefColumn(e){let{defaultKind:t}=e;function n(e){return e.metadata?.title||(0,l.S)(e,{defaultKind:t})}return{title:(0,i.jsx)(m.g,{translationKey:"name"}),highlight:!0,customFilterAndSearch:(e,t)=>n(t).includes(e),customSort:(e,t)=>n(e).localeCompare(n(t)),render:e=>(0,i.jsx)(c.z,{entityRef:e,defaultKind:t,title:e.metadata?.title})}},createEntityRelationColumn(e){let{title:t,relation:n,defaultKind:a,filter:o}=e;function s(e){return(0,r.t)(e,n,o)}function c(e){return s(e).map(e=>(0,l.S)(e,{defaultKind:a})).join(", ")}return{title:t,customFilterAndSearch:(e,t)=>c(t).includes(e),customSort:(e,t)=>c(e).localeCompare(c(t)),render:e=>(0,i.jsx)(d.i,{entityRefs:s(e),defaultKind:a})}},createOwnerColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"owner"}),relation:o.vv,defaultKind:"group"})},createDomainColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"domain"}),relation:o.jn,defaultKind:"domain",filter:{kind:"domain"}})},createSystemColumn(){return this.createEntityRelationColumn({title:(0,i.jsx)(m.g,{translationKey:"system"}),relation:o.jn,defaultKind:"system",filter:{kind:"system"}})},createMetadataDescriptionColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"description"}),field:"metadata.description",render:e=>(0,i.jsx)(s.M,{text:e.metadata.description,placement:"bottom-start",line:2})}),createSpecLifecycleColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"lifecycle"}),field:"spec.lifecycle"}),createSpecTypeColumn:()=>({title:(0,i.jsx)(m.g,{translationKey:"type"}),field:"spec.type"})}),p=[u.createEntityRefColumn({defaultKind:"system"}),u.createDomainColumn(),u.createOwnerColumn(),u.createMetadataDescriptionColumn()],y=[u.createEntityRefColumn({defaultKind:"component"}),u.createSystemColumn(),u.createOwnerColumn(),u.createSpecTypeColumn(),u.createSpecLifecycleColumn(),u.createMetadataDescriptionColumn()];var h=n(28499);let f=(0,a.A)(e=>({empty:{padding:e.spacing(2),display:"flex",justifyContent:"center"}})),g=e=>{let{entities:t,title:n,emptyContent:a,variant:o="gridItem",columns:s,tableOptions:r={}}=e,l=f(),c={minWidth:"0",width:"100%"};return"gridItem"===o&&(c.height="calc(100% - 10px)"),(0,i.jsx)(h.X,{columns:s,title:n,style:c,emptyContent:a&&(0,i.jsx)("div",{className:l.empty,children:a}),options:{search:!1,paging:!1,actionsColumnIndex:-1,padding:"dense",draggable:!1,...r},data:t})};g.columns=u,g.systemEntityColumns=p,g.componentEntityColumns=y},19857:function(e,t,n){n.d(t,{g:()=>o});var i=n(89595),a=n(79811);let o=({translationKey:e})=>{let{t}=(0,i.i)(a.j);return t(`entityTableColumnTitle.${e}`)}},22845:function(e,t,n){n.d(t,{T7:()=>c,TY:()=>m,tN:()=>d});var i=n(31085),a=n(58077),o=n(92829),s=n(9135),r=n(20549);let l=(0,s.tK)("entity-context"),c=e=>{let{children:t,entity:n,loading:s,error:c,refresh:d}=e;return(0,i.jsx)(l.Provider,{value:(0,r.B)({1:{entity:n,loading:s,error:c,refresh:d}}),children:(0,i.jsx)(o.Ig,{attributes:{...n?{entityRef:(0,a.U2)(n)}:void 0},children:t})})};function d(){let e=(0,s.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw 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:t.entity}}function m(){let e=(0,s.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:i,error:a,refresh:o}=t;return{entity:n,loading:i,error:a,refresh:o}}},50010:function(e,t,n){n.d(t,{W:()=>i});let i=(0,n(97386).h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:"This entity has relations to other entities, which can't be found in the catalog.\n Entities not found are: ",hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},68859:function(e,t,n){n.d(t,{HasSystemsCard:()=>c});var i=n(31085),a=n(96403),o=n(79842),s=n(44849),r=n(50010),l=n(89595);function c(e){let{t}=(0,l.i)(r.W),{variant:n="gridItem",title:c=t("hasSystemsCard.title"),columns:d=o.MW,tableOptions:m={}}=e;return(0,i.jsx)(s.p,{variant:n,title:c,entityKind:"System",relationType:a.sA,columns:d,asRenderableEntities:o.vy,emptyMessage:t("hasSystemsCard.emptyMessage"),emptyHelpLink:o.iU,tableOptions:m})}},44849:function(e,t,n){n.d(t,{p:()=>T});var i=n(31085),a=n(72501),o=n(22845),s=n(58077),r=n(50509),l=n(73466),c=n(76272),d=n(65671),m=n(89439),u=n(55489),p=n(58837),y=n(37197),h=n(8109),f=n(5951),g=n(4809),x=n(55555),C=n(60691);let b=(0,p.A)(e=>({text:{fontFamily:"monospace",whiteSpace:"pre",overflowX:"auto",marginRight:e.spacing(2)},divider:{margin:e.spacing(2)}}),{name:"BackstageResponseErrorPanel"});function v(e){let{title:t,error:n,defaultExpanded:a}=e,o=b();if("ResponseError"!==n.name)return(0,i.jsx)(C.b,{title:t??n.message,defaultExpanded:a,error:n});let{body:s,cause:r}=n,{request:l,response:c}=s,d=`${c.statusCode}: ${r.name}`,m=l&&`${l.method} ${l.url}`,u=r.message.replace(/\\n/g,"\n"),p=r.stack?.replace(/\\n/g,"\n"),v=JSON.stringify(s,void 0,2);return(0,i.jsxs)(C.b,{title:t??n.message,defaultExpanded:a,error:{name:d,message:u,stack:p},children:[m&&(0,i.jsxs)(h.A,{alignItems:"flex-start",children:[(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Request",secondary:l?`${m}`:void 0}),(0,i.jsx)(x.l,{text:m})]}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y.A,{component:"li",className:o.divider}),(0,i.jsx)(h.A,{alignItems:"flex-start",children:(0,i.jsx)(f.A,{classes:{secondary:o.text},primary:"Full Error as JSON"})}),(0,i.jsx)(g.z,{language:"json",text:v,showCopyCodeButton:!0})]})]})}var j=n(60603),w=n(79842),E=n(50010),A=n(89595);let T=e=>{let{variant:t="gridItem",title:n,columns:p,entityKind:y,relationType:h,emptyMessage:f,emptyHelpLink:g,asRenderableEntities:x,tableOptions:C={}}=e,{t:b}=(0,A.i)(E.W),{entity:w}=(0,o.tN)(),{entities:T,loading:S,error:k}=function(e,t){let n=t?.type?.toLocaleLowerCase("en-US"),i=t?.kind?.toLocaleLowerCase("en-US"),a=(0,r.gf)(c.v),{loading:o,value:d,error:m}=(0,l.A)(async()=>{let t=e.relations?.filter(e=>(!n||e.type.toLocaleLowerCase("en-US")===n)&&(!i||(0,s.KU)(e.targetRef).kind===i));if(!t?.length)return[];let{items:o}=await a.getEntitiesByRefs({entityRefs:t.map(e=>e.targetRef)});return o.filter(e=>!!e)},[e,n,i]);return{entities:d,loading:o,error:m}}(w,{type:h,kind:y});return S?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(u.k,{})}):k?(0,i.jsx)(m.n,{variant:t,title:n,children:(0,i.jsx)(v,{error:k})}):(0,i.jsx)(d.s,{title:n,variant:t,emptyContent:(0,i.jsxs)("div",{style:{textAlign:"center"},children:[(0,i.jsx)(a.A,{variant:"body1",children:f}),(0,i.jsx)(a.A,{variant:"body2",children:(0,i.jsx)(j.N_,{to:g,externalLinkIcon:!0,children:b("relatedEntitiesCard.emptyHelpLinkTitle")})})]}),columns:p,entities:x(T||[]),tableOptions:C})};T.componentEntityColumns=w.mz,T.componentEntityHelpLink=w.e2,T.asComponentEntities=w.xJ,T.resourceEntityColumns=w.v9,T.resourceEntityHelpLink=w.nz,T.asResourceEntities=w.eB,T.systemEntityColumns=w.MW,T.systemEntityHelpLink=w.iU,T.asSystemEntities=w.vy,T.domainEntityColums=w.xO,T.domainEntityHelpLink=w.Xr,T.asDomainEntities=w.QS},79842:function(e,t,n){n.d(t,{MW:()=>d,QS:()=>h,Xr:()=>y,e2:()=>o,eB:()=>c,iU:()=>m,mz:()=>a,nz:()=>l,v9:()=>r,vy:()=>u,xJ:()=>s,xO:()=>p});var i=n(65671);let a=[i.s.columns.createEntityRefColumn({defaultKind:"component"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],o="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component",s=e=>e,r=[i.s.columns.createEntityRefColumn({defaultKind:"resource"}),i.s.columns.createOwnerColumn(),i.s.columns.createSpecTypeColumn(),i.s.columns.createSpecLifecycleColumn(),i.s.columns.createMetadataDescriptionColumn()],l="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource",c=e=>e,d=[i.s.columns.createEntityRefColumn({defaultKind:"system"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],m="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system",u=e=>e,p=[i.s.columns.createEntityRefColumn({defaultKind:"domain"}),i.s.columns.createOwnerColumn(),i.s.columns.createMetadataDescriptionColumn()],y="https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain",h=e=>e}}]);
|
|
2
|
+
//# sourceMappingURL=4648.68d2c6ff.chunk.js.map
|