@backstage/core-components 0.11.2-next.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @backstage/core-components
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - bde1e8c8e2: Added `curve` prop to the `DependencyGraph` component to select the type of layout
8
+ - 882101cd9b: Deep-import LightAsync component to improve module-import speed
9
+ - 0d0f30d87e: Fixed layout for core-components docs where table was broken by splitting with code sample
10
+ - Updated dependencies
11
+ - @backstage/core-plugin-api@1.0.7
12
+ - @backstage/config@1.0.3
13
+ - @backstage/errors@1.1.2
14
+ - @backstage/theme@0.2.16
15
+ - @backstage/version-bridge@1.0.1
16
+
17
+ ## 0.11.2-next.2
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+ - @backstage/config@1.0.3-next.2
23
+ - @backstage/core-plugin-api@1.0.7-next.2
24
+ - @backstage/errors@1.1.2-next.2
25
+ - @backstage/theme@0.2.16
26
+ - @backstage/version-bridge@1.0.1
27
+
3
28
  ## 0.11.2-next.1
4
29
 
5
30
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -510,6 +510,14 @@ interface DependencyGraphProps<NodeData, EdgeData> extends React__default.SVGPro
510
510
  * Default: `enabled`
511
511
  */
512
512
  zoom?: 'enabled' | 'disabled' | 'enable-on-click';
513
+ /**
514
+ * A factory for curve generators addressing both lines and areas.
515
+ *
516
+ * @remarks
517
+ *
518
+ * Default: 'curveMonotoneX'
519
+ */
520
+ curve?: 'curveStepBefore' | 'curveMonotoneX';
513
521
  }
514
522
  /**
515
523
  * Graph component used to visualize relations between entities
@@ -593,6 +601,7 @@ declare type ResponseErrorPanelClassKey = 'text' | 'divider';
593
601
  /**
594
602
  * Renders a warning panel as the effect of a failed server request.
595
603
  *
604
+ * @remarks
596
605
  * Has special treatment for ResponseError errors, to display rich
597
606
  * server-provided information about what happened.
598
607
  */
@@ -682,6 +691,7 @@ interface LogViewerProps {
682
691
  /**
683
692
  * A component that displays logs in a scrollable text area.
684
693
  *
694
+ * @remarks
685
695
  * The LogViewer has support for search and filtering, as well as displaying
686
696
  * text content with ANSI color escape codes.
687
697
  *
@@ -707,10 +717,10 @@ declare type Props$b = {
707
717
  className?: string;
708
718
  };
709
719
  /**
710
- * MarkdownContent
711
- * --
712
- * Renders markdown with the default dialect [gfm - GitHub flavored Markdown](https://github.github.com/gfm/) to backstage theme styled HTML.
713
- * If you just want to render to plain [CommonMark](https://commonmark.org/), set the dialect to `'common-mark'`
720
+ * Renders markdown with the default dialect {@link https://github.github.com/gfm/ | gfm - GitHub flavored Markdown} to backstage theme styled HTML.
721
+ *
722
+ * @remarks
723
+ * If you just want to render to plain {@link https://commonmark.org/ | CommonMark}, set the dialect to `'common-mark'`
714
724
  */
715
725
  declare function MarkdownContent(props: Props$b): JSX.Element;
716
726
 
@@ -984,6 +994,7 @@ declare type SubRoute$1 = {
984
994
  * TabbedLayout is a compound component, which allows you to define a layout for
985
995
  * pages using a sub-navigation mechanism.
986
996
  *
997
+ * @remarks
987
998
  * Consists of two parts: TabbedLayout and TabbedLayout.Route
988
999
  *
989
1000
  * @example
@@ -1090,7 +1101,7 @@ declare type WarningProps = {
1090
1101
  children?: React__default.ReactNode;
1091
1102
  };
1092
1103
  /**
1093
- * WarningPanel. Show a user friendly error message to a user similar to
1104
+ * Show a user friendly error message to a user similar to
1094
1105
  * ErrorPanel except that the warning panel only shows the warning message to
1095
1106
  * the user.
1096
1107
  *
@@ -1312,6 +1323,7 @@ declare type ItemCardProps = {
1312
1323
  * This card type has been deprecated. Instead use plain MUI Card and helpers
1313
1324
  * where appropriate.
1314
1325
  *
1326
+ * @example
1315
1327
  * ```
1316
1328
  * <Card>
1317
1329
  * <CardMedia>
@@ -1347,6 +1359,7 @@ declare type ItemCardGridProps = Partial<WithStyles<typeof styles$1>> & {
1347
1359
  * A default grid to use when arranging "item cards" - cards that let users
1348
1360
  * select among several options.
1349
1361
  *
1362
+ * @remarks
1350
1363
  * The immediate children are expected to be MUI Card components.
1351
1364
  *
1352
1365
  * Styles for the grid can be overridden using the `classes` prop, e.g.:
@@ -1391,6 +1404,7 @@ declare type ItemCardHeaderProps = Partial<WithStyles<typeof styles>> & {
1391
1404
  * A simple card header, rendering a default look for "item cards" - cards that
1392
1405
  * are arranged in a grid for users to select among several options.
1393
1406
  *
1407
+ * @remarks
1394
1408
  * This component expects to be placed within a MUI `<CardMedia>`.
1395
1409
  *
1396
1410
  * Styles for the header can be overridden using the `classes` prop, e.g.:
@@ -1442,12 +1456,12 @@ declare type ProxiedSignInPageProps = SignInPageProps & {
1442
1456
  */
1443
1457
  declare const ProxiedSignInPage: (props: ProxiedSignInPageProps) => JSX.Element | null;
1444
1458
 
1445
- /** @public **/
1459
+ /** @public */
1446
1460
  declare type SidebarOptions = {
1447
1461
  drawerWidthClosed?: number;
1448
1462
  drawerWidthOpen?: number;
1449
1463
  };
1450
- /** @public **/
1464
+ /** @public */
1451
1465
  declare type SubmenuOptions = {
1452
1466
  drawerWidthClosed?: number;
1453
1467
  drawerWidthOpen?: number;
@@ -1498,6 +1512,7 @@ declare type MobileSidebarProps = {
1498
1512
  /**
1499
1513
  * A navigation component for mobile screens, which sticks to the bottom.
1500
1514
  *
1515
+ * @remarks
1501
1516
  * It alternates the normal sidebar by grouping the `SidebarItems` based on provided `SidebarGroup`s
1502
1517
  * either rendering them as a link or an overlay menu.
1503
1518
  * If no `SidebarGroup`s are provided the sidebar content is wrapped in an default overlay menu.
@@ -1529,6 +1544,7 @@ interface SidebarGroupProps extends BottomNavigationActionProps {
1529
1544
  /**
1530
1545
  * Groups items of the `Sidebar` together.
1531
1546
  *
1547
+ * @remarks
1532
1548
  * On bigger screens, this won't have any effect at the moment.
1533
1549
  * On small screens, it will add an action to the bottom navigation - either triggering an overlay menu or acting as a link
1534
1550
  *
@@ -1550,6 +1566,7 @@ declare type SidebarSubmenuItemDropdownItem = {
1550
1566
  /**
1551
1567
  * Holds submenu item content.
1552
1568
  *
1569
+ * @remarks
1553
1570
  * title: Text content of submenu item
1554
1571
  * subtitle: A subtitle displayed under the main title
1555
1572
  * to: Path to navigate to when item is clicked
@@ -1660,6 +1677,7 @@ declare type SidebarItemProps = SidebarItemLinkProps | SidebarItemButtonProps |
1660
1677
  /**
1661
1678
  * Creates a `SidebarItem`
1662
1679
  *
1680
+ * @remarks
1663
1681
  * If children contain a `SidebarSubmenu` component the `SidebarItem` will have a expandable submenu
1664
1682
  */
1665
1683
  declare const SidebarItem: (props: SidebarItemProps) => JSX.Element;
@@ -1678,6 +1696,8 @@ declare const SidebarDivider: React__default.ComponentType<React__default.ClassA
1678
1696
  declare const SidebarScrollWrapper: React__default.ComponentType<React__default.ClassAttributes<HTMLDivElement> & React__default.HTMLAttributes<HTMLDivElement> & StyledComponentProps<"root">>;
1679
1697
  /**
1680
1698
  * A button which allows you to expand the sidebar when clicked.
1699
+ *
1700
+ * @remarks
1681
1701
  * Use optionally to replace sidebar's expand-on-hover feature with expand-on-click.
1682
1702
  *
1683
1703
  * If you are using this you might want to set the `disableExpandOnHover` of the `Sidebar` to `true`.
@@ -1815,7 +1835,7 @@ declare type SignInProviderConfig = {
1815
1835
  message: string;
1816
1836
  apiRef: ApiRef<ProfileInfoApi & BackstageIdentityApi & SessionApi>;
1817
1837
  };
1818
- /** @public **/
1838
+ /** @public */
1819
1839
  declare type IdentityProviders = ('guest' | 'custom' | SignInProviderConfig)[];
1820
1840
 
1821
1841
  declare type MultiSignInPageProps = SignInPageProps & {
package/dist/index.esm.js CHANGED
@@ -551,7 +551,7 @@ function DefaultLabel({ edge: { label } }) {
551
551
  const useStyles$N = makeStyles$1(
552
552
  (theme) => ({
553
553
  path: {
554
- strokeWidth: 2,
554
+ strokeWidth: 1,
555
555
  stroke: theme.palette.textSubtle,
556
556
  fill: "none",
557
557
  transition: `${theme.transitions.duration.shortest}ms`
@@ -565,12 +565,12 @@ const useStyles$N = makeStyles$1(
565
565
  const renderDefault = (props) => /* @__PURE__ */ React.createElement(DefaultLabel, {
566
566
  ...props
567
567
  });
568
- const createPath = d3Shape.line().x((d) => d.x).y((d) => d.y).curve(d3Shape.curveMonotoneX);
569
568
  function Edge({
570
569
  render = renderDefault,
571
570
  setEdge,
572
571
  id,
573
- edge
572
+ edge,
573
+ curve
574
574
  }) {
575
575
  const { x = 0, y = 0, width, height, points } = edge;
576
576
  const labelProps = edge;
@@ -591,6 +591,10 @@ function Edge({
591
591
  }
592
592
  }, [edge, height, width, setEdge, id]);
593
593
  let path = "";
594
+ const createPath = React.useMemo(
595
+ () => d3Shape.line().x((d) => d.x).y((d) => d.y).curve(d3Shape[curve]),
596
+ [curve]
597
+ );
594
598
  if (points) {
595
599
  const finitePoints = points.filter(
596
600
  (point) => isFinite(point.x) && isFinite(point.y)
@@ -600,7 +604,6 @@ function Edge({
600
604
  return /* @__PURE__ */ React.createElement(React.Fragment, null, path && /* @__PURE__ */ React.createElement("path", {
601
605
  "data-testid": EDGE_TEST_ID,
602
606
  className: classes.path,
603
- markerEnd: `url(#${ARROW_MARKER_ID})`,
604
607
  d: path
605
608
  }), labelProps.label ? /* @__PURE__ */ React.createElement("g", {
606
609
  ref: labelRef,
@@ -633,6 +636,7 @@ function DependencyGraph(props) {
633
636
  renderLabel,
634
637
  defs,
635
638
  zoom = "enabled",
639
+ curve = "curveMonotoneX",
636
640
  ...svgProps
637
641
  } = props;
638
642
  const theme = useTheme$1();
@@ -823,7 +827,8 @@ function DependencyGraph(props) {
823
827
  id: e,
824
828
  setEdge,
825
829
  render: renderLabel,
826
- edge
830
+ edge,
831
+ curve
827
832
  });
828
833
  }), graphNodes.map((id) => {
829
834
  const node = graph.current.node(id);