@redocly/theme 0.30.1 → 0.30.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.
@@ -16,7 +16,7 @@ const MenuItem_1 = require("../../components/Menu/MenuItem");
16
16
  function MenuItemSwitch(props) {
17
17
  var _a;
18
18
  const type = (0, getMenuType_1.getMenuType)(props.item);
19
- const { Drilldown, handleBack, handleExpand, isExpanded: drilldownIsExpanded, prevActiveItem, } = (0, useDrilldown_1.useDrilldown)(props);
19
+ const { Drilldown, handleBack, handleExpand, isExpanded: drilldownIsExpanded, } = (0, useDrilldown_1.useDrilldown)(props);
20
20
  const { MenuGroup, handleGroupClick, isExpanded } = (0, useMenuGroup_1.useMenuGroup)(props.item);
21
21
  switch (type) {
22
22
  case types_1.MenuType.Separator:
@@ -31,7 +31,7 @@ function MenuItemSwitch(props) {
31
31
  }
32
32
  return (react_1.default.createElement(Group, { item: props.item, isExpanded: isExpanded, toggleExpanded: handleGroupClick }, props.children));
33
33
  case types_1.MenuType.DrillDown:
34
- return (react_1.default.createElement(Drilldown, { item: props.item, isExpanded: drilldownIsExpanded, back: handleBack, expand: handleExpand, prevActiveItem: prevActiveItem }, props.children));
34
+ return (react_1.default.createElement(Drilldown, { item: props.item, isExpanded: drilldownIsExpanded, back: handleBack, expand: handleExpand }, props.children));
35
35
  default:
36
36
  return react_1.default.createElement(MenuItem_1.MenuItem, Object.assign({}, props));
37
37
  }
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import type { DrilldownMenuProps } from '../../components/Sidebar/types';
3
- export declare function DrilldownMenu({ item, back, prevActiveItem, children, className, }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element;
3
+ export declare function DrilldownMenu({ item, back, children, className, }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element;
@@ -33,15 +33,12 @@ const BackButton_1 = require("../../components/Sidebar/BackButton");
33
33
  const DrilldownMenuItem_1 = require("../../components/Sidebar/DrilldownMenuItem");
34
34
  const hooks_1 = require("../../mocks/hooks");
35
35
  const Menu_1 = require("../../components/Menu");
36
- function DrilldownMenu({ item, back, prevActiveItem, children, className, }) {
36
+ function DrilldownMenu({ item, back, children, className, }) {
37
37
  const { translate } = (0, hooks_1.useTranslate)();
38
- const label = item.label === (prevActiveItem === null || prevActiveItem === void 0 ? void 0 : prevActiveItem.label) || !(prevActiveItem === null || prevActiveItem === void 0 ? void 0 : prevActiveItem.label)
39
- ? translate('theme.sidebar.menu.backLabel', 'Back')
40
- : prevActiveItem === null || prevActiveItem === void 0 ? void 0 : prevActiveItem.label;
41
38
  return (react_1.default.createElement(MenuContainer, { "data-component-name": "Sidebar/DrilldownMenu", className: className },
42
39
  react_1.default.createElement(MenuContent, null,
43
40
  react_1.default.createElement(MenuWrapper, null,
44
- react_1.default.createElement(BackButton_1.BackButton, { back: back, "data-translation-key": "theme.sidebar.menu.backLabel" }, label),
41
+ react_1.default.createElement(BackButton_1.BackButton, { back: back, "data-translation-key": "theme.sidebar.menu.backLabel" }, translate('theme.sidebar.menu.backLabel', 'Back')),
45
42
  react_1.default.createElement(Menu_1.MenuLinkItem, { item: item },
46
43
  react_1.default.createElement(DrilldownMenuItem_1.DrilldownMenuItem, { item: item }))),
47
44
  children)));
@@ -10,7 +10,6 @@ export interface ItemState extends NavItem {
10
10
  export interface DrilldownMenuProps {
11
11
  back: () => void;
12
12
  item: ItemState;
13
- prevActiveItem?: ItemState;
14
13
  className?: string;
15
14
  }
16
15
  export interface MenuItemProps {
package/lib/config.d.ts CHANGED
@@ -282,7 +282,7 @@ declare const scorecardConfigSchema: {
282
282
  readonly additionalProperties: true;
283
283
  readonly required: readonly ["levels"];
284
284
  readonly properties: {
285
- readonly failBuildIfBelowMinimum: {
285
+ readonly ignoreNonCompliant: {
286
286
  readonly type: "boolean";
287
287
  readonly default: false;
288
288
  };
@@ -1851,7 +1851,7 @@ export declare const themeConfigSchema: {
1851
1851
  readonly additionalProperties: true;
1852
1852
  readonly required: readonly ["levels"];
1853
1853
  readonly properties: {
1854
- readonly failBuildIfBelowMinimum: {
1854
+ readonly ignoreNonCompliant: {
1855
1855
  readonly type: "boolean";
1856
1856
  readonly default: false;
1857
1857
  };
package/lib/config.js CHANGED
@@ -264,7 +264,7 @@ const scorecardConfigSchema = {
264
264
  additionalProperties: true,
265
265
  required: ['levels'],
266
266
  properties: {
267
- failBuildIfBelowMinimum: { type: 'boolean', default: false },
267
+ ignoreNonCompliant: { type: 'boolean', default: false },
268
268
  teamMetadataProperty: {
269
269
  type: 'object',
270
270
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.30.1",
3
+ "version": "0.30.2",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -19,7 +19,6 @@ export function MenuItemSwitch(props: PropsWithChildren<MenuItemProps>) {
19
19
  handleBack,
20
20
  handleExpand,
21
21
  isExpanded: drilldownIsExpanded,
22
- prevActiveItem,
23
22
  } = useDrilldown(props);
24
23
 
25
24
  const { MenuGroup, handleGroupClick, isExpanded } = useMenuGroup(props.item);
@@ -52,7 +51,6 @@ export function MenuItemSwitch(props: PropsWithChildren<MenuItemProps>) {
52
51
  isExpanded={drilldownIsExpanded}
53
52
  back={handleBack}
54
53
  expand={handleExpand}
55
- prevActiveItem={prevActiveItem}
56
54
  >
57
55
  {props.children}
58
56
  </Drilldown>
@@ -10,22 +10,17 @@ import { MenuLinkItem } from '@theme/components/Menu';
10
10
  export function DrilldownMenu({
11
11
  item,
12
12
  back,
13
- prevActiveItem,
14
13
  children,
15
14
  className,
16
15
  }: React.PropsWithChildren<DrilldownMenuProps>): JSX.Element {
17
16
  const { translate } = useTranslate();
18
- const label =
19
- item.label === prevActiveItem?.label || !prevActiveItem?.label
20
- ? translate('theme.sidebar.menu.backLabel', 'Back')
21
- : prevActiveItem?.label;
22
17
 
23
18
  return (
24
19
  <MenuContainer data-component-name="Sidebar/DrilldownMenu" className={className}>
25
20
  <MenuContent>
26
21
  <MenuWrapper>
27
22
  <BackButton back={back} data-translation-key="theme.sidebar.menu.backLabel">
28
- {label}
23
+ {translate('theme.sidebar.menu.backLabel', 'Back')}
29
24
  </BackButton>
30
25
  <MenuLinkItem item={item}>
31
26
  <DrilldownMenuItem item={item} />
@@ -12,7 +12,6 @@ export interface ItemState extends NavItem {
12
12
  export interface DrilldownMenuProps {
13
13
  back: () => void;
14
14
  item: ItemState;
15
- prevActiveItem?: ItemState;
16
15
  className?: string;
17
16
  }
18
17
 
package/src/config.ts CHANGED
@@ -303,7 +303,7 @@ const scorecardConfigSchema = {
303
303
  additionalProperties: true,
304
304
  required: ['levels'],
305
305
  properties: {
306
- failBuildIfBelowMinimum: { type: 'boolean', default: false },
306
+ ignoreNonCompliant: { type: 'boolean', default: false },
307
307
  teamMetadataProperty: {
308
308
  type: 'object',
309
309
  properties: {