@backstage/core-components 0.12.0 → 0.12.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.d.ts +29 -20
- package/dist/index.esm.js +7 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/core-components
|
|
2
2
|
|
|
3
|
+
## 0.12.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ea4a5be8f3: Create a variable for minimum height and add a prop named 'fit' for determining if the graph height should grow or be contained.
|
|
8
|
+
- 64a579a998: Add items prop to SupportButton. This prop can be used to override the items that would otherwise be grabbed from the config.
|
|
9
|
+
- 3280711113: Updated dependency `msw` to `^0.49.0`.
|
|
10
|
+
- 19356df560: Updated dependency `zen-observable` to `^0.9.0`.
|
|
11
|
+
- 17a8e32f39: Updated dependency `rc-progress` to `3.4.1`.
|
|
12
|
+
- dfc8edf9c5: Internal refactor to avoid usage of deprecated symbols.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/core-plugin-api@1.1.1-next.0
|
|
15
|
+
- @backstage/config@1.0.5-next.0
|
|
16
|
+
- @backstage/errors@1.1.4-next.0
|
|
17
|
+
- @backstage/theme@0.2.16
|
|
18
|
+
- @backstage/version-bridge@1.0.2
|
|
19
|
+
|
|
3
20
|
## 0.12.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -518,6 +518,14 @@ interface DependencyGraphProps<NodeData, EdgeData> extends React__default.SVGPro
|
|
|
518
518
|
* Default: 'curveMonotoneX'
|
|
519
519
|
*/
|
|
520
520
|
curve?: 'curveStepBefore' | 'curveMonotoneX';
|
|
521
|
+
/**
|
|
522
|
+
* Controls if the graph should be contained or grow
|
|
523
|
+
*
|
|
524
|
+
* @remarks
|
|
525
|
+
*
|
|
526
|
+
* Default: 'grow'
|
|
527
|
+
*/
|
|
528
|
+
fit?: 'grow' | 'contain';
|
|
521
529
|
}
|
|
522
530
|
/**
|
|
523
531
|
* Graph component used to visualize relations between entities
|
|
@@ -979,8 +987,29 @@ declare type Props$6 = {
|
|
|
979
987
|
};
|
|
980
988
|
declare function StructuredMetadataTable(props: Props$6): JSX.Element;
|
|
981
989
|
|
|
990
|
+
declare type SetQueryParams<T> = (params: T) => void;
|
|
991
|
+
declare function useQueryParamState<T>(stateName: string,
|
|
992
|
+
/** @deprecated Don't configure a custom debouceTime */
|
|
993
|
+
debounceTime?: number): [T | undefined, SetQueryParams<T>];
|
|
994
|
+
|
|
995
|
+
declare type SupportItemLink = {
|
|
996
|
+
url: string;
|
|
997
|
+
title: string;
|
|
998
|
+
};
|
|
999
|
+
declare type SupportItem = {
|
|
1000
|
+
title: string;
|
|
1001
|
+
icon?: string;
|
|
1002
|
+
links: SupportItemLink[];
|
|
1003
|
+
};
|
|
1004
|
+
declare type SupportConfig = {
|
|
1005
|
+
url: string;
|
|
1006
|
+
items: SupportItem[];
|
|
1007
|
+
};
|
|
1008
|
+
declare function useSupportConfig(): SupportConfig;
|
|
1009
|
+
|
|
982
1010
|
declare type SupportButtonProps = {
|
|
983
1011
|
title?: string;
|
|
1012
|
+
items?: SupportItem[];
|
|
984
1013
|
children?: React__default.ReactNode;
|
|
985
1014
|
};
|
|
986
1015
|
declare type SupportButtonClassKey = 'popoverList';
|
|
@@ -1120,26 +1149,6 @@ declare type WarningProps = {
|
|
|
1120
1149
|
*/
|
|
1121
1150
|
declare function WarningPanel(props: WarningProps): JSX.Element;
|
|
1122
1151
|
|
|
1123
|
-
declare type SetQueryParams<T> = (params: T) => void;
|
|
1124
|
-
declare function useQueryParamState<T>(stateName: string,
|
|
1125
|
-
/** @deprecated Don't configure a custom debouceTime */
|
|
1126
|
-
debounceTime?: number): [T | undefined, SetQueryParams<T>];
|
|
1127
|
-
|
|
1128
|
-
declare type SupportItemLink = {
|
|
1129
|
-
url: string;
|
|
1130
|
-
title: string;
|
|
1131
|
-
};
|
|
1132
|
-
declare type SupportItem = {
|
|
1133
|
-
title: string;
|
|
1134
|
-
icon?: string;
|
|
1135
|
-
links: SupportItemLink[];
|
|
1136
|
-
};
|
|
1137
|
-
declare type SupportConfig = {
|
|
1138
|
-
url: string;
|
|
1139
|
-
items: SupportItem[];
|
|
1140
|
-
};
|
|
1141
|
-
declare function useSupportConfig(): SupportConfig;
|
|
1142
|
-
|
|
1143
1152
|
declare type IconComponentProps = ComponentProps<IconComponent>;
|
|
1144
1153
|
/**
|
|
1145
1154
|
* Broken Image Icon
|
package/dist/index.esm.js
CHANGED
|
@@ -644,6 +644,7 @@ function DependencyGraph(props) {
|
|
|
644
644
|
defs,
|
|
645
645
|
zoom = "enabled",
|
|
646
646
|
curve = "curveMonotoneX",
|
|
647
|
+
fit = "grow",
|
|
647
648
|
...svgProps
|
|
648
649
|
} = props;
|
|
649
650
|
const theme = useTheme$1();
|
|
@@ -662,6 +663,8 @@ function DependencyGraph(props) {
|
|
|
662
663
|
const [graphEdges, setGraphEdges] = React.useState([]);
|
|
663
664
|
const maxWidth = Math.max(graphWidth, containerWidth);
|
|
664
665
|
const maxHeight = Math.max(graphHeight, containerHeight);
|
|
666
|
+
const minHeight = Math.min(graphHeight, containerHeight);
|
|
667
|
+
const scalableHeight = fit === "grow" ? maxHeight : minHeight;
|
|
665
668
|
const containerRef = React.useMemo(
|
|
666
669
|
() => debounce((node) => {
|
|
667
670
|
if (!node) {
|
|
@@ -803,7 +806,7 @@ function DependencyGraph(props) {
|
|
|
803
806
|
ref: containerRef,
|
|
804
807
|
...svgProps,
|
|
805
808
|
width: "100%",
|
|
806
|
-
height:
|
|
809
|
+
height: scalableHeight,
|
|
807
810
|
viewBox: `0 0 ${maxWidth} ${maxHeight}`
|
|
808
811
|
}, /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("marker", {
|
|
809
812
|
id: ARROW_MARKER_ID,
|
|
@@ -3263,8 +3266,8 @@ const SupportListItem = ({ item }) => {
|
|
|
3263
3266
|
}));
|
|
3264
3267
|
};
|
|
3265
3268
|
function SupportButton(props) {
|
|
3266
|
-
const { title, children } = props;
|
|
3267
|
-
const { items } = useSupportConfig();
|
|
3269
|
+
const { title, items, children } = props;
|
|
3270
|
+
const { items: configItems } = useSupportConfig();
|
|
3268
3271
|
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
3269
3272
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
3270
3273
|
const classes = useStyles$o();
|
|
@@ -3314,7 +3317,7 @@ function SupportButton(props) {
|
|
|
3314
3317
|
}, title)), React.Children.map(children, (child, i) => /* @__PURE__ */ React.createElement(ListItem, {
|
|
3315
3318
|
alignItems: "flex-start",
|
|
3316
3319
|
key: `child-${i}`
|
|
3317
|
-
}, child)), items
|
|
3320
|
+
}, child)), (items != null ? items : configItems).map((item, i) => /* @__PURE__ */ React.createElement(SupportListItem, {
|
|
3318
3321
|
item,
|
|
3319
3322
|
key: `item-${i}`
|
|
3320
3323
|
}))), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button$1, {
|