@backstage/core-components 0.16.3-next.0 → 0.16.4-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.16.4-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 9c9f4ff: Added `nestedValuesAsYaml` option to `StructuredMetadataTable` to render data as yaml.
8
+ - 17088d2: Updating the `TaskLogStream` to take up all space in a running task, and also show the last line of the log by default
9
+ - 58ec9e7: Removed older versions of React packages as a preparatory step for upgrading to React 19. This commit does not introduce any functional changes, but removes dependencies on previous React versions, allowing for a cleaner upgrade path in subsequent commits.
10
+ - Updated dependencies
11
+ - @backstage/core-plugin-api@1.10.4-next.0
12
+ - @backstage/version-bridge@1.0.11-next.0
13
+ - @backstage/theme@0.6.4-next.0
14
+ - @backstage/config@1.3.2
15
+ - @backstage/errors@1.2.7
16
+
17
+ ## 0.16.3
18
+
19
+ ### Patch Changes
20
+
21
+ - 4ec6f7b: Allow passing component for `ContentHeader` description
22
+ - Updated dependencies
23
+ - @backstage/core-plugin-api@1.10.3
24
+ - @backstage/config@1.3.2
25
+ - @backstage/errors@1.2.7
26
+ - @backstage/theme@0.6.3
27
+ - @backstage/version-bridge@1.0.10
28
+
3
29
  ## 0.16.3-next.0
4
30
 
5
31
  ### Patch Changes
@@ -2,7 +2,7 @@ import Box from '@material-ui/core/Box';
2
2
  import IconButton from '@material-ui/core/IconButton';
3
3
  import CopyIcon from '@material-ui/icons/FileCopy';
4
4
  import classNames from 'classnames';
5
- import React__default, { useRef, useMemo, useEffect } from 'react';
5
+ import React__default, { useState, useMemo, useEffect } from 'react';
6
6
  import { useLocation } from 'react-router-dom';
7
7
  import AutoSizer from 'react-virtualized-auto-sizer';
8
8
  import { FixedSizeList } from 'react-window';
@@ -15,17 +15,27 @@ import { useLogViewerSelection } from './useLogViewerSelection.esm.js';
15
15
 
16
16
  function RealLogViewer(props) {
17
17
  const classes = useStyles({ classes: props.classes });
18
- const listRef = useRef(null);
18
+ const [fixedListInstance, setFixedListInstance] = useState(null);
19
19
  const processor = useMemo(() => new AnsiProcessor(), []);
20
20
  const lines = processor.process(props.text);
21
21
  const search = useLogViewerSearch(lines);
22
22
  const selection = useLogViewerSelection(lines);
23
23
  const location = useLocation();
24
24
  useEffect(() => {
25
- if (search.resultLine !== void 0 && listRef.current) {
26
- listRef.current.scrollToItem(search.resultLine - 1, "center");
25
+ if (fixedListInstance) {
26
+ fixedListInstance.scrollToItem(lines.length - 1, "end");
27
27
  }
28
- }, [search.resultLine]);
28
+ }, [fixedListInstance, lines]);
29
+ useEffect(() => {
30
+ if (!fixedListInstance) {
31
+ return;
32
+ }
33
+ if (search.resultLine) {
34
+ fixedListInstance.scrollToItem(search.resultLine - 1, "center");
35
+ } else {
36
+ fixedListInstance.scrollToItem(lines.length - 1, "end");
37
+ }
38
+ }, [fixedListInstance, search.resultLine, lines]);
29
39
  useEffect(() => {
30
40
  if (location.hash) {
31
41
  const line = parseInt(location.hash.replace(/\D/g, ""), 10);
@@ -38,7 +48,9 @@ function RealLogViewer(props) {
38
48
  return /* @__PURE__ */ React__default.createElement(AutoSizer, null, ({ height, width }) => /* @__PURE__ */ React__default.createElement(Box, { style: { width, height }, className: classes.root }, /* @__PURE__ */ React__default.createElement(Box, { className: classes.header }, /* @__PURE__ */ React__default.createElement(LogViewerControls, { ...search })), /* @__PURE__ */ React__default.createElement(
39
49
  FixedSizeList,
40
50
  {
41
- ref: listRef,
51
+ ref: (instance) => {
52
+ setFixedListInstance(instance);
53
+ },
42
54
  className: classes.log,
43
55
  height: (height || 480) - HEADER_SIZE,
44
56
  width: width || 640,
@@ -1 +1 @@
1
- {"version":3,"file":"RealLogViewer.esm.js","sources":["../../../src/components/LogViewer/RealLogViewer.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 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 React, { useEffect, useMemo, useRef } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { FixedSizeList } from 'react-window';\n\nimport { 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';\n\nexport interface RealLogViewerProps {\n text: string;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const listRef = useRef<FixedSizeList | null>(null);\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\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (search.resultLine !== undefined && listRef.current) {\n listRef.current.scrollToItem(search.resultLine - 1, 'center');\n }\n }, [search.resultLine]);\n\n useEffect(() => {\n if (location.hash) {\n // #line-6 -> 6\n const line = parseInt(location.hash.replace(/\\D/g, ''), 10);\n selection.setSelection(line, false);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: { shiftKey: boolean; preventDefault: () => void },\n ) => {\n selection.setSelection(line, event.shiftKey);\n };\n\n return (\n <AutoSizer>\n {({ height, width }: { height?: number; width?: number }) => (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n <FixedSizeList\n ref={listRef}\n className={classes.log}\n height={(height || 480) - HEADER_SIZE}\n width={width || 640}\n itemData={search.lines}\n itemSize={20}\n itemCount={search.lines.length}\n >\n {({ index, style, data }) => {\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.shouldShowButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => selection.copySelection()}\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 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 </FixedSizeList>\n </Box>\n )}\n </AutoSizer>\n );\n}\n"],"names":["React","classnames"],"mappings":";;;;;;;;;;;;;;;AAqCO,SAAS,cAAc,KAA2B,EAAA;AACvD,EAAA,MAAM,UAAU,SAAU,CAAA,EAAE,OAAS,EAAA,KAAA,CAAM,SAAS,CAAA;AACpD,EAAM,MAAA,OAAA,GAAU,OAA6B,IAAI,CAAA;AAGjD,EAAA,MAAM,YAAY,OAAQ,CAAA,MAAM,IAAI,aAAc,EAAA,EAAG,EAAE,CAAA;AACvD,EAAA,MAAM,KAAQ,GAAA,SAAA,CAAU,OAAQ,CAAA,KAAA,CAAM,IAAI,CAAA;AAE1C,EAAM,MAAA,MAAA,GAAS,mBAAmB,KAAK,CAAA;AACvC,EAAM,MAAA,SAAA,GAAY,sBAAsB,K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AS,EAAA,CAAA,KAAA,KAAS,gBAAiB,CAAA,UAAA,EAAY,KAAK,CAAA;AAAA,YACpD,UAAY,EAAA,CAAA,KAAA,KAAS,gBAAiB,CAAA,UAAA,EAAY,KAAK;AAAA,WAAA;AAAA,UAEtD;AAAA,SACH;AAAA,wBACAA,cAAA,CAAA,aAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,OAAA;AAAA,YACA,YAAY,MAAO,CAAA,UAAA;AAAA,YACnB,oBACE,EAAA,MAAA,CAAO,UAAe,KAAA,UAAA,GAClB,OAAO,eACP,GAAA,KAAA;AAAA;AAAA;AAER,OACF;AAAA;AAEJ,GAEJ,CAEJ,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"RealLogViewer.esm.js","sources":["../../../src/components/LogViewer/RealLogViewer.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 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 React, { useEffect, useMemo, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { FixedSizeList } 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';\n\nexport interface RealLogViewerProps {\n text: string;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const [fixedListInstance, setFixedListInstance] = useState<FixedSizeList<\n AnsiLine[]\n > | null>(null);\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\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (fixedListInstance) {\n fixedListInstance.scrollToItem(lines.length - 1, 'end');\n }\n }, [fixedListInstance, lines]);\n\n useEffect(() => {\n if (!fixedListInstance) {\n return;\n }\n if (search.resultLine) {\n fixedListInstance.scrollToItem(search.resultLine - 1, 'center');\n } else {\n fixedListInstance.scrollToItem(lines.length - 1, 'end');\n }\n }, [fixedListInstance, search.resultLine, lines]);\n\n useEffect(() => {\n if (location.hash) {\n // #line-6 -> 6\n const line = parseInt(location.hash.replace(/\\D/g, ''), 10);\n selection.setSelection(line, false);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: { shiftKey: boolean; preventDefault: () => void },\n ) => {\n selection.setSelection(line, event.shiftKey);\n };\n\n return (\n <AutoSizer>\n {({ height, width }: { height?: number; width?: number }) => (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n <FixedSizeList\n ref={(instance: FixedSizeList<AnsiLine[]>) => {\n setFixedListInstance(instance);\n }}\n className={classes.log}\n height={(height || 480) - HEADER_SIZE}\n width={width || 640}\n itemData={search.lines}\n itemSize={20}\n itemCount={search.lines.length}\n >\n {({ index, style, data }) => {\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.shouldShowButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => selection.copySelection()}\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 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 </FixedSizeList>\n </Box>\n )}\n </AutoSizer>\n );\n}\n"],"names":["React","classnames"],"mappings":";;;;;;;;;;;;;;;AAqCO,SAAS,cAAc,KAA2B,EAAA;AACvD,EAAA,MAAM,UAAU,SAAU,CAAA,EAAE,OAAS,EAAA,KAAA,CAAM,SAAS,CAAA;AACpD,EAAA,MAAM,CAAC,iBAAA,EAAmB,oBAAoB,CAAA,GAAI,SAExC,IAAI,CAAA;AAGd,EAAA,MAAM,YAAY,OAAQ,CAAA,MAAM,IAAI,aAAc,EAAA,EAAG,EAAE,CAAA;AACvD,EAAA,MAAM,KAAQ,GAAA,SAAA,CAAU,OAAQ,CAAA,KAAA,CAAM,IAAI,CAAA;AAE1C,EAAM,MAAA,MAAA,GAAS,mBAAmB,KAAK,CAAA;AACvC,EAAM,MAAA,SAAA,GAAY,sBAAsB,KAAK,CAAA;AAC7C,EAAA,MAAM,WAAW,WAAY,EAAA;AAE7B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,iBAAmB,EAAA;AACrB,MAAA,iBAAA,CAAkB,YAAa,CAAA,KAAA,CAAM,MAAS,GAAA,CAAA,EAAG,KAAK,CAAA;AAAA;AACxD,GACC,EAAA,CAAC,iBAAmB,EAAA,KAAK,CAAC,CAAA;AAE7B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,iBAAmB,EAAA;AACtB,MAAA;AAAA;AAEF,IAAA,IAA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,WAAW,OAAQ,CAAA,UAAA;AAAA,YACnB,OAAS,EAAA,CAAA,KAAA,KAAS,gBAAiB,CAAA,UAAA,EAAY,KAAK,CAAA;AAAA,YACpD,UAAY,EAAA,CAAA,KAAA,KAAS,gBAAiB,CAAA,UAAA,EAAY,KAAK;AAAA,WAAA;AAAA,UAEtD;AAAA,SACH;AAAA,wBACAA,cAAA,CAAA,aAAA;AAAA,UAAC,OAAA;AAAA,UAAA;AAAA,YACC,IAAA;AAAA,YACA,OAAA;AAAA,YACA,YAAY,MAAO,CAAA,UAAA;AAAA,YACnB,oBACE,EAAA,MAAA,CAAO,UAAe,KAAA,UAAA,GAClB,OAAO,eACP,GAAA,KAAA;AAAA;AAAA;AAER,OACF;AAAA;AAEJ,GAEJ,CAEJ,CAAA;AAEJ;;;;"}
@@ -1,8 +1,10 @@
1
1
  import React__default, { Fragment } from 'react';
2
- import { createStyles, withStyles } from '@material-ui/core/styles';
3
2
  import startCase from 'lodash/startCase';
4
3
  import Typography from '@material-ui/core/Typography';
5
4
  import { MetadataList, MetadataTable, MetadataTableItem, MetadataListItem } from './MetadataTable.esm.js';
5
+ import { CodeSnippet } from '../CodeSnippet/CodeSnippet.esm.js';
6
+ import jsyaml from 'js-yaml';
7
+ import { createStyles, withStyles } from '@material-ui/core/styles';
6
8
 
7
9
  const listStyle = createStyles({
8
10
  root: {
@@ -37,8 +39,25 @@ function toValue(value, options, nested) {
37
39
  if (React__default.isValidElement(value)) {
38
40
  return /* @__PURE__ */ React__default.createElement(Fragment, null, value);
39
41
  }
40
- if (value !== null && typeof value === "object" && !Array.isArray(value)) {
41
- return renderMap(value, options, nested);
42
+ if (value !== null && typeof value === "object") {
43
+ if (options.nestedValuesAsYaml) {
44
+ return /* @__PURE__ */ React__default.createElement(
45
+ CodeSnippet,
46
+ {
47
+ language: "yaml",
48
+ text: jsyaml.dump(value),
49
+ customStyle: {
50
+ background: "transparent",
51
+ lineHeight: "1.4",
52
+ padding: "0",
53
+ margin: 0
54
+ }
55
+ }
56
+ );
57
+ }
58
+ if (!Array.isArray(value)) {
59
+ return renderMap(value, options, nested);
60
+ }
42
61
  }
43
62
  if (Array.isArray(value)) {
44
63
  return renderList(value, options, nested);
@@ -60,9 +79,10 @@ function mapToItems(info, options) {
60
79
  return Object.keys(info).map((key) => /* @__PURE__ */ React__default.createElement(TableItem, { key, title: key, value: info[key], options }));
61
80
  }
62
81
  function StructuredMetadataTable(props) {
63
- const { metadata, dense = true, options = {} } = props;
82
+ const { metadata, dense = true, options } = props;
64
83
  const metadataItems = mapToItems(metadata, {
65
84
  titleFormat: startCase,
85
+ nestedValuesAsYaml: options?.nestedValuesAsYaml ?? false,
66
86
  ...options
67
87
  });
68
88
  return /* @__PURE__ */ React__default.createElement(MetadataTable, { dense }, metadataItems);
@@ -1 +1 @@
1
- {"version":3,"file":"StructuredMetadataTable.esm.js","sources":["../../../src/components/StructuredMetadataTable/StructuredMetadataTable.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { Fragment, ReactElement } from 'react';\nimport {\n withStyles,\n createStyles,\n WithStyles,\n Theme,\n} from '@material-ui/core/styles';\nimport startCase from 'lodash/startCase';\nimport Typography from '@material-ui/core/Typography';\n\nimport {\n MetadataTable,\n MetadataTableItem,\n MetadataList,\n MetadataListItem,\n} from './MetadataTable';\n\nexport type StructuredMetadataTableListClassKey = 'root';\n\nconst listStyle = createStyles({\n root: {\n margin: '0 0',\n listStyleType: 'none',\n },\n});\n\nexport type StructuredMetadataTableNestedListClassKey = 'root';\n\nconst nestedListStyle = (theme: Theme) =>\n createStyles({\n root: {\n ...listStyle.root,\n paddingLeft: theme.spacing(1),\n },\n });\n\ninterface StyleProps extends WithStyles {\n children?: React.ReactNode;\n}\n// Sub Components\nconst StyledList = withStyles(listStyle, {\n name: 'BackstageStructuredMetadataTableList',\n})(({ classes, children }: StyleProps) => (\n <MetadataList classes={classes}>{children}</MetadataList>\n));\nconst StyledNestedList = withStyles(nestedListStyle, {\n name: 'BackstageStructuredMetadataTableNestedList',\n})(({ classes, children }: StyleProps) => (\n <MetadataList classes={classes}>{children}</MetadataList>\n));\n\nfunction renderList(list: Array<any>, options: Options, nested: boolean) {\n const values = list.map((item: any, index: number) => (\n <MetadataListItem key={index}>\n {toValue(item, options, nested)}\n </MetadataListItem>\n ));\n return nested ? (\n <StyledNestedList>{values}</StyledNestedList>\n ) : (\n <StyledList>{values}</StyledList>\n );\n}\n\nfunction renderMap(\n map: { [key: string]: any },\n options: Options,\n nested: boolean,\n) {\n const values = Object.keys(map).map(key => {\n const value = toValue(map[key], options, true);\n return (\n <MetadataListItem key={key}>\n <Typography variant=\"body2\" component=\"span\">\n {`${options.titleFormat(key)}: `}\n </Typography>\n {value}\n </MetadataListItem>\n );\n });\n\n return nested ? (\n <StyledNestedList>{values}</StyledNestedList>\n ) : (\n <StyledList>{values}</StyledList>\n );\n}\n\nfunction toValue(\n value: ReactElement | object | Array<any> | boolean,\n options: Options,\n nested: boolean,\n) {\n if (React.isValidElement(value)) {\n return <Fragment>{value}</Fragment>;\n }\n\n if (value !== null && typeof value === 'object' && !Array.isArray(value)) {\n return renderMap(value, options, nested);\n }\n\n if (Array.isArray(value)) {\n return renderList(value, options, nested);\n }\n\n if (typeof value === 'boolean') {\n return <Fragment>{value ? '✅' : '❌'}</Fragment>;\n }\n\n return (\n <Typography variant=\"body2\" component=\"span\">\n {value}\n </Typography>\n );\n}\nconst ItemValue = ({ value, options }: { value: any; options: Options }) => (\n <Fragment>{toValue(value, options, false)}</Fragment>\n);\n\nconst TableItem = ({\n title,\n value,\n options,\n}: {\n title: string;\n value: any;\n options: Options;\n}) => {\n return (\n <MetadataTableItem title={options.titleFormat(title)}>\n <ItemValue value={value} options={options} />\n </MetadataTableItem>\n );\n};\n\nfunction mapToItems(info: { [key: string]: string }, options: Options) {\n return Object.keys(info).map(key => (\n <TableItem key={key} title={key} value={info[key]} options={options} />\n ));\n}\n\n/** @public */\nexport interface StructuredMetadataTableProps {\n metadata: { [key: string]: any };\n dense?: boolean;\n options?: {\n /**\n * Function to format the keys from the `metadata` object. Defaults to\n * startCase from the lodash library.\n * @param key - A key within the `metadata`\n * @returns Formatted key\n */\n titleFormat?: (key: string) => string;\n };\n}\n\ntype Options = Required<NonNullable<StructuredMetadataTableProps['options']>>;\n\n/** @public */\nexport function StructuredMetadataTable(props: StructuredMetadataTableProps) {\n const { metadata, dense = true, options = {} } = props;\n const metadataItems = mapToItems(metadata, {\n titleFormat: startCase,\n ...options,\n });\n return <MetadataTable dense={dense}>{metadataItems}</MetadataTable>;\n}\n"],"names":["React"],"mappings":";;;;;;AAmCA,MAAM,YAAY,YAAa,CAAA;AAAA,EAC7B,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,KAAA;AAAA,IACR,aAAe,EAAA;AAAA;AAEnB,CAAC,CAAA;AAID,MAAM,eAAA,GAAkB,CAAC,KAAA,KACvB,YAAa,CAAA;AAAA,EACX,IAAM,EAAA;AAAA,IACJ,GAAG,SAAU,CAAA,IAAA;AAAA,IACb,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC;AAAA;AAEhC,CAAC,CAAA;AAMH,MAAM,UAAA,GAAa,WAAW,SAAW,EAAA;AAAA,EACvC,IAAM,EAAA;AACR,CAAC,CAAA,CAAE,CAAC,EAAE,OAAS,EAAA,QAAA,uBACZA,cAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,OAAmB,EAAA,EAAA,QAAS,CAC3C,CAAA;AACD,MAAM,gBAAA,GAAmB,WAAW,eAAiB,EAAA;AAAA,EACnD,I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AkB,EAAA;AACrE,EAAA,OAAO,OAAO,IAAK,CAAA,IAAI,CAAE,CAAA,GAAA,CAAI,yBAC1BA,cAAA,CAAA,aAAA,CAAA,SAAA,EAAA,EAAU,GAAU,EAAA,KAAA,EAAO,KAAK,KAAO,EAAA,IAAA,CAAK,GAAG,CAAA,EAAG,SAAkB,CACtE,CAAA;AACH;AAoBO,SAAS,wBAAwB,KAAqC,EAAA;AAC3E,EAAA,MAAM,EAAE,QAAU,EAAA,KAAA,GAAQ,MAAM,OAAU,GAAA,IAAO,GAAA,KAAA;AACjD,EAAM,MAAA,aAAA,GAAgB,WAAW,QAAU,EAAA;AAAA,IACzC,WAAa,EAAA,SAAA;AAAA,IACb,GAAG;AAAA,GACJ,CAAA;AACD,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,aAAc,CAAA;AACrD;;;;"}
1
+ {"version":3,"file":"StructuredMetadataTable.esm.js","sources":["../../../src/components/StructuredMetadataTable/StructuredMetadataTable.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { Fragment, ReactElement } from 'react';\nimport startCase from 'lodash/startCase';\nimport Typography from '@material-ui/core/Typography';\n\nimport {\n MetadataList,\n MetadataListItem,\n MetadataTable,\n MetadataTableItem,\n} from './MetadataTable';\nimport { CodeSnippet } from '../CodeSnippet';\nimport jsyaml from 'js-yaml';\nimport {\n Theme,\n createStyles,\n WithStyles,\n withStyles,\n} from '@material-ui/core/styles';\n\nexport type StructuredMetadataTableListClassKey = 'root';\n\nconst listStyle = createStyles({\n root: {\n margin: '0 0',\n listStyleType: 'none',\n },\n});\n\nexport type StructuredMetadataTableNestedListClassKey = 'root';\nconst nestedListStyle = (theme: Theme) =>\n createStyles({\n root: {\n ...listStyle.root,\n paddingLeft: theme.spacing(1),\n },\n });\n\ninterface StyleProps extends WithStyles {\n children?: React.ReactNode;\n}\n// Sub Components\nconst StyledList = withStyles(listStyle, {\n name: 'BackstageStructuredMetadataTableList',\n})(({ classes, children }: StyleProps) => (\n <MetadataList classes={classes}>{children}</MetadataList>\n));\nconst StyledNestedList = withStyles(nestedListStyle, {\n name: 'BackstageStructuredMetadataTableNestedList',\n})(({ classes, children }: StyleProps) => (\n <MetadataList classes={classes}>{children}</MetadataList>\n));\n\nfunction renderList(list: Array<any>, options: Options, nested: boolean) {\n const values = list.map((item: any, index: number) => (\n <MetadataListItem key={index}>\n {toValue(item, options, nested)}\n </MetadataListItem>\n ));\n return nested ? (\n <StyledNestedList>{values}</StyledNestedList>\n ) : (\n <StyledList>{values}</StyledList>\n );\n}\n\nfunction renderMap(\n map: { [key: string]: any },\n options: Options,\n nested: boolean,\n) {\n const values = Object.keys(map).map(key => {\n const value = toValue(map[key], options, true);\n return (\n <MetadataListItem key={key}>\n <Typography variant=\"body2\" component=\"span\">\n {`${options.titleFormat(key)}: `}\n </Typography>\n {value}\n </MetadataListItem>\n );\n });\n\n return nested ? (\n <StyledNestedList>{values}</StyledNestedList>\n ) : (\n <StyledList>{values}</StyledList>\n );\n}\n\nfunction toValue(\n value: ReactElement | object | Array<any> | boolean,\n options: Options,\n nested: boolean,\n) {\n if (React.isValidElement(value)) {\n return <Fragment>{value}</Fragment>;\n }\n if (value !== null && typeof value === 'object') {\n if (options.nestedValuesAsYaml) {\n return (\n <CodeSnippet\n language=\"yaml\"\n text={jsyaml.dump(value)}\n customStyle={{\n background: 'transparent',\n lineHeight: '1.4',\n padding: '0',\n margin: 0,\n }}\n />\n );\n }\n if (!Array.isArray(value)) {\n return renderMap(value, options, nested);\n }\n }\n\n if (Array.isArray(value)) {\n return renderList(value, options, nested);\n }\n\n if (typeof value === 'boolean') {\n return <Fragment>{value ? '✅' : '❌'}</Fragment>;\n }\n return (\n <Typography variant=\"body2\" component=\"span\">\n {value}\n </Typography>\n );\n}\nconst ItemValue = ({ value, options }: { value: any; options: Options }) => (\n <Fragment>{toValue(value, options, false)}</Fragment>\n);\n\nconst TableItem = ({\n title,\n value,\n options,\n}: {\n title: string;\n value: any;\n options: Options;\n}) => {\n return (\n <MetadataTableItem title={options.titleFormat(title)}>\n <ItemValue value={value} options={options} />\n </MetadataTableItem>\n );\n};\n\nfunction mapToItems(info: { [key: string]: string }, options: Options) {\n return Object.keys(info).map(key => (\n <TableItem key={key} title={key} value={info[key]} options={options} />\n ));\n}\n\n/** @public */\nexport interface StructuredMetadataTableProps {\n metadata: { [key: string]: any };\n dense?: boolean;\n options?: {\n /**\n * Function to format the keys from the `metadata` object. Defaults to\n * startCase from the lodash library.\n * @param key - A key within the `metadata`\n * @returns Formatted key\n */\n titleFormat?: (key: string) => string;\n nestedValuesAsYaml?: boolean;\n };\n}\n\ntype Options = Required<NonNullable<StructuredMetadataTableProps['options']>>;\n\n/** @public */\nexport function StructuredMetadataTable(props: StructuredMetadataTableProps) {\n const { metadata, dense = true, options } = props;\n const metadataItems = mapToItems(metadata, {\n titleFormat: startCase,\n nestedValuesAsYaml: options?.nestedValuesAsYaml ?? false,\n ...options,\n });\n return <MetadataTable dense={dense}>{metadataItems}</MetadataTable>;\n}\n"],"names":["React"],"mappings":";;;;;;;;AAqCA,MAAM,YAAY,YAAa,CAAA;AAAA,EAC7B,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,KAAA;AAAA,IACR,aAAe,EAAA;AAAA;AAEnB,CAAC,CAAA;AAGD,MAAM,eAAA,GAAkB,CAAC,KAAA,KACvB,YAAa,CAAA;AAAA,EACX,IAAM,EAAA;AAAA,IACJ,GAAG,SAAU,CAAA,IAAA;AAAA,IACb,WAAA,EAA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ACD,EAAO,uBAAAA,cAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,KAAA,EAAA,EAAe,aAAc,CAAA;AACrD;;;;"}
package/dist/index.d.ts CHANGED
@@ -1113,6 +1113,7 @@ interface StructuredMetadataTableProps {
1113
1113
  * @returns Formatted key
1114
1114
  */
1115
1115
  titleFormat?: (key: string) => string;
1116
+ nestedValuesAsYaml?: boolean;
1116
1117
  };
1117
1118
  }
1118
1119
  /** @public */
@@ -1338,10 +1339,15 @@ type ContentHeaderTitleProps = {
1338
1339
  title?: string;
1339
1340
  className?: string;
1340
1341
  };
1342
+ type ContentHeaderDescriptionProps = {
1343
+ description?: string;
1344
+ className?: string;
1345
+ };
1341
1346
  type ContentHeaderProps = {
1342
1347
  title?: ContentHeaderTitleProps['title'];
1343
1348
  titleComponent?: ReactNode;
1344
- description?: string;
1349
+ description?: ContentHeaderDescriptionProps['description'];
1350
+ descriptionComponent?: ReactNode;
1345
1351
  textAlign?: 'left' | 'right' | 'center';
1346
1352
  };
1347
1353
  /**
@@ -49,17 +49,37 @@ const ContentHeaderTitle = ({ title, className }) => /* @__PURE__ */ React__defa
49
49
  },
50
50
  title
51
51
  );
52
+ const ContentHeaderDescription = ({
53
+ description,
54
+ className
55
+ }) => description ? /* @__PURE__ */ React__default.createElement(
56
+ Typography,
57
+ {
58
+ variant: "body2",
59
+ className,
60
+ "data-testid": "header-description"
61
+ },
62
+ description
63
+ ) : null;
52
64
  function ContentHeader(props) {
53
65
  const {
54
66
  description,
55
67
  title,
56
68
  titleComponent: TitleComponent = void 0,
57
69
  children,
70
+ descriptionComponent: DescriptionComponent = void 0,
58
71
  textAlign = "left"
59
72
  } = props;
60
73
  const classes = useStyles({ textAlign })();
61
74
  const renderedTitle = TitleComponent ? TitleComponent : /* @__PURE__ */ React__default.createElement(ContentHeaderTitle, { title, className: classes.title });
62
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Helmet, { title }), /* @__PURE__ */ React__default.createElement(Box, { className: classes.container }, /* @__PURE__ */ React__default.createElement(Box, { className: classes.leftItemsBox }, renderedTitle, description && /* @__PURE__ */ React__default.createElement(Typography, { className: classes.description, variant: "body2" }, description)), /* @__PURE__ */ React__default.createElement(Box, { className: classes.rightItemsBox }, children)));
75
+ const renderedDescription = DescriptionComponent ? DescriptionComponent : /* @__PURE__ */ React__default.createElement(
76
+ ContentHeaderDescription,
77
+ {
78
+ description,
79
+ className: classes.description
80
+ }
81
+ );
82
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Helmet, { title }), /* @__PURE__ */ React__default.createElement(Box, { className: classes.container }, /* @__PURE__ */ React__default.createElement(Box, { className: classes.leftItemsBox }, renderedTitle, renderedDescription), /* @__PURE__ */ React__default.createElement(Box, { className: classes.rightItemsBox }, children)));
63
83
  }
64
84
 
65
85
  export { ContentHeader };
@@ -1 +1 @@
1
- {"version":3,"file":"ContentHeader.esm.js","sources":["../../../src/layout/ContentHeader/ContentHeader.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React, { PropsWithChildren, ReactNode } from 'react';\nimport { Helmet } from 'react-helmet';\n\n/**\n * TODO: favoriteable capability\n */\n\n/** @public */\nexport type ContentHeaderClassKey =\n | 'container'\n | 'leftItemsBox'\n | 'rightItemsBox'\n | 'description'\n | 'title';\n\nconst useStyles = (props: ContentHeaderProps) =>\n makeStyles(\n theme => ({\n container: {\n width: '100%',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n alignItems: 'center',\n marginBottom: theme.spacing(2),\n textAlign: props.textAlign,\n },\n leftItemsBox: {\n flex: '1 1 auto',\n minWidth: 0,\n overflow: 'visible',\n },\n rightItemsBox: {\n flex: '0 1 auto',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n marginLeft: theme.spacing(1),\n minWidth: 0,\n overflow: 'visible',\n },\n description: {},\n title: {\n display: 'inline-flex',\n marginBottom: 0,\n },\n }),\n { name: 'BackstageContentHeader' },\n );\n\ntype ContentHeaderTitleProps = {\n title?: string;\n className?: string;\n};\n\nconst ContentHeaderTitle = ({ title, className }: ContentHeaderTitleProps) => (\n <Typography\n variant=\"h4\"\n component=\"h2\"\n className={className}\n data-testid=\"header-title\"\n >\n {title}\n </Typography>\n);\n\ntype ContentHeaderProps = {\n title?: ContentHeaderTitleProps['title'];\n titleComponent?: ReactNode;\n description?: string;\n textAlign?: 'left' | 'right' | 'center';\n};\n\n/**\n * A header at the top inside a {@link Content}.\n *\n * @public\n *\n */\n\nexport function ContentHeader(props: PropsWithChildren<ContentHeaderProps>) {\n const {\n description,\n title,\n titleComponent: TitleComponent = undefined,\n children,\n textAlign = 'left',\n } = props;\n const classes = useStyles({ textAlign })();\n\n const renderedTitle = TitleComponent ? (\n TitleComponent\n ) : (\n <ContentHeaderTitle title={title} className={classes.title} />\n );\n\n return (\n <>\n <Helmet title={title} />\n <Box className={classes.container}>\n <Box className={classes.leftItemsBox}>\n {renderedTitle}\n {description && (\n <Typography className={classes.description} variant=\"body2\">\n {description}\n </Typography>\n )}\n </Box>\n <Box className={classes.rightItemsBox}>{children}</Box>\n </Box>\n </>\n );\n}\n"],"names":["React"],"mappings":";;;;;;AAiCA,MAAM,SAAA,GAAY,CAAC,KACjB,KAAA,UAAA;AAAA,EACE,CAAU,KAAA,MAAA;AAAA,IACR,S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KAAA,CAAA;AAAA,IACjC,QAAA;AAAA,IACA,SAAY,GAAA;AAAA,GACV,GAAA,KAAA;AACJ,EAAA,MAAM,OAAU,GAAA,SAAA,CAAU,EAAE,SAAA,EAAW,CAAE,EAAA;AAEzC,EAAM,MAAA,aAAA,GAAgB,iBACpB,cAEA,mBAAAA,cAAA,CAAA,aAAA,CAAC,sBAAmB,KAAc,EAAA,SAAA,EAAW,QAAQ,KAAO,EAAA,CAAA;AAG9D,EAAA,uBAEIA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,kBAAAA,cAAA,CAAA,aAAA,CAAC,MAAO,EAAA,EAAA,KAAA,EAAc,mBACrBA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,6BACrBA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,gBACrB,aACA,EAAA,WAAA,oBACEA,cAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,OAAA,CAAQ,WAAa,EAAA,OAAA,EAAQ,WACjD,WACH,CAEJ,CACA,kBAAAA,cAAA,CAAA,aAAA,CAAC,OAAI,SAAW,EAAA,OAAA,CAAQ,aAAgB,EAAA,EAAA,QAAS,CACnD,CACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ContentHeader.esm.js","sources":["../../../src/layout/ContentHeader/ContentHeader.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport Box from '@material-ui/core/Box';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport React, { PropsWithChildren, ReactNode } from 'react';\nimport { Helmet } from 'react-helmet';\n\n/**\n * TODO: favoriteable capability\n */\n\n/** @public */\nexport type ContentHeaderClassKey =\n | 'container'\n | 'leftItemsBox'\n | 'rightItemsBox'\n | 'description'\n | 'title';\n\nconst useStyles = (props: ContentHeaderProps) =>\n makeStyles(\n theme => ({\n container: {\n width: '100%',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-end',\n alignItems: 'center',\n marginBottom: theme.spacing(2),\n textAlign: props.textAlign,\n },\n leftItemsBox: {\n flex: '1 1 auto',\n minWidth: 0,\n overflow: 'visible',\n },\n rightItemsBox: {\n flex: '0 1 auto',\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n marginLeft: theme.spacing(1),\n minWidth: 0,\n overflow: 'visible',\n },\n description: {},\n title: {\n display: 'inline-flex',\n marginBottom: 0,\n },\n }),\n { name: 'BackstageContentHeader' },\n );\n\ntype ContentHeaderTitleProps = {\n title?: string;\n className?: string;\n};\n\nconst ContentHeaderTitle = ({ title, className }: ContentHeaderTitleProps) => (\n <Typography\n variant=\"h4\"\n component=\"h2\"\n className={className}\n data-testid=\"header-title\"\n >\n {title}\n </Typography>\n);\n\ntype ContentHeaderDescriptionProps = {\n description?: string;\n className?: string;\n};\n\nconst ContentHeaderDescription = ({\n description,\n className,\n}: ContentHeaderDescriptionProps) =>\n description ? (\n <Typography\n variant=\"body2\"\n className={className}\n data-testid=\"header-description\"\n >\n {description}\n </Typography>\n ) : null;\n\ntype ContentHeaderProps = {\n title?: ContentHeaderTitleProps['title'];\n titleComponent?: ReactNode;\n description?: ContentHeaderDescriptionProps['description'];\n descriptionComponent?: ReactNode;\n textAlign?: 'left' | 'right' | 'center';\n};\n\n/**\n * A header at the top inside a {@link Content}.\n *\n * @public\n *\n */\n\nexport function ContentHeader(props: PropsWithChildren<ContentHeaderProps>) {\n const {\n description,\n title,\n titleComponent: TitleComponent = undefined,\n children,\n descriptionComponent: DescriptionComponent = undefined,\n textAlign = 'left',\n } = props;\n const classes = useStyles({ textAlign })();\n\n const renderedTitle = TitleComponent ? (\n TitleComponent\n ) : (\n <ContentHeaderTitle title={title} className={classes.title} />\n );\n\n const renderedDescription = DescriptionComponent ? (\n DescriptionComponent\n ) : (\n <ContentHeaderDescription\n description={description}\n className={classes.description}\n />\n );\n\n return (\n <>\n <Helmet title={title} />\n <Box className={classes.container}>\n <Box className={classes.leftItemsBox}>\n {renderedTitle}\n {renderedDescription}\n </Box>\n <Box className={classes.rightItemsBox}>{children}</Box>\n </Box>\n </>\n );\n}\n"],"names":["React"],"mappings":";;;;;;AAiCA,MAAM,SAAA,GAAY,CAAC,KACjB,KAAA,UAAA;AAAA,EACE,CAAU,KAAA,MAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,KAAO,EAAA,MAAA;AAAA,MACP,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,MACf,QAAU,EAAA,MAAA;AAAA,MACV,cAAgB,EAAA,UAAA;AAAA,MAChB,UAAY,EAAA,QAAA;AAAA,MACZ,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC7B,WAAW,KAAM,CAAA;AAAA,KACnB;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,IAAM,EAAA,UAAA;AAAA,MACN,QAAU,EAAA,CAAA;AAAA,MACV,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,aAAe,EAAA;AAAA,MACb,IAAM,EAAA,UAAA;AAAA,MACN,OAAS,EAAA,MAAA;AAAA,MACT,aAAe,EAAA,KAAA;AAAA,MACf,QAAU,EAAA,MAAA;AAAA,MACV,UAAY,EAAA,QAAA;AAAA,MACZ,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MAC3B,QAAU,EAAA,CAAA;AAAA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A;AAAA,IAAA;AAAA,MACC,WAAA;AAAA,MACA,WAAW,OAAQ,CAAA;AAAA;AAAA,GACrB;AAGF,EACE,uBAAAA,cAAA,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA,kBACGA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAO,KAAc,EAAA,CAAA,+CACrB,GAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,SAAA,EAAA,kBACrBA,cAAA,CAAA,aAAA,CAAA,GAAA,EAAA,EAAI,WAAW,OAAQ,CAAA,YAAA,EAAA,EACrB,aACA,EAAA,mBACH,CACA,kBAAAA,cAAA,CAAA,aAAA,CAAC,GAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,aAAA,EAAA,EAAgB,QAAS,CACnD,CACF,CAAA;AAEJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/core-components",
3
- "version": "0.16.3-next.0",
3
+ "version": "0.16.4-next.0",
4
4
  "description": "Core components used by Backstage plugins and apps",
5
5
  "backstage": {
6
6
  "role": "web-library"
@@ -66,11 +66,11 @@
66
66
  "test": "backstage-cli package test"
67
67
  },
68
68
  "dependencies": {
69
- "@backstage/config": "1.3.2-next.0",
70
- "@backstage/core-plugin-api": "1.10.3-next.0",
71
- "@backstage/errors": "1.2.7-next.0",
72
- "@backstage/theme": "0.6.3",
73
- "@backstage/version-bridge": "1.0.10",
69
+ "@backstage/config": "1.3.2",
70
+ "@backstage/core-plugin-api": "1.10.4-next.0",
71
+ "@backstage/errors": "1.2.7",
72
+ "@backstage/theme": "0.6.4-next.0",
73
+ "@backstage/version-bridge": "1.0.11-next.0",
74
74
  "@date-io/core": "^1.3.13",
75
75
  "@material-table/core": "^3.1.0",
76
76
  "@material-ui/core": "^4.12.2",
@@ -85,6 +85,7 @@
85
85
  "d3-shape": "^3.0.0",
86
86
  "d3-zoom": "^3.0.0",
87
87
  "dagre": "^0.8.5",
88
+ "js-yaml": "^4.1.0",
88
89
  "linkify-react": "4.1.3",
89
90
  "linkifyjs": "4.1.3",
90
91
  "lodash": "^4.17.21",
@@ -105,10 +106,10 @@
105
106
  "zod": "^3.22.4"
106
107
  },
107
108
  "devDependencies": {
108
- "@backstage/app-defaults": "1.5.16-next.0",
109
- "@backstage/cli": "0.29.5-next.1",
110
- "@backstage/core-app-api": "1.15.4-next.0",
111
- "@backstage/test-utils": "1.7.4-next.0",
109
+ "@backstage/app-defaults": "1.5.17-next.0",
110
+ "@backstage/cli": "0.30.0-next.1",
111
+ "@backstage/core-app-api": "1.15.5-next.0",
112
+ "@backstage/test-utils": "1.7.5-next.0",
112
113
  "@testing-library/dom": "^10.0.0",
113
114
  "@testing-library/jest-dom": "^6.0.0",
114
115
  "@testing-library/user-event": "^14.0.0",
@@ -133,10 +134,10 @@
133
134
  "react-router-dom": "^6.3.0"
134
135
  },
135
136
  "peerDependencies": {
136
- "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
137
- "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
138
- "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
139
- "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
137
+ "@types/react": "^17.0.0 || ^18.0.0",
138
+ "react": "^17.0.0 || ^18.0.0",
139
+ "react-dom": "^17.0.0 || ^18.0.0",
140
+ "react-router-dom": "^6.3.0"
140
141
  },
141
142
  "peerDependenciesMeta": {
142
143
  "@types/react": {