@bundle-stats/ui 3.2.1-alpha.0 → 3.2.1-beta.9
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 +2 -1
- package/lib/components/browsertime-table/browsertime-table.stories.js +1 -0
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +17 -18
- package/lib/components/job-meta/job-meta.js +1 -1
- package/lib/components/summary/summary.js +52 -34
- package/lib/hooks/search-params.js +1 -1
- package/lib/utils.js +6 -3
- package/lib-esm/app/app.js +60 -50
- package/lib-esm/app/header/header.js +22 -19
- package/lib-esm/components/asset-info/asset-info.js +8 -6
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +2 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +93 -80
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +29 -26
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +6 -5
- package/lib-esm/components/bundle-modules/bundle-modules.js +82 -67
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +9 -6
- package/lib-esm/components/bundle-modules/index.js +6 -3
- package/lib-esm/components/bundle-packages/bundle-packages.js +29 -24
- package/lib-esm/components/component-link.js +7 -6
- package/lib-esm/components/delta/delta.js +7 -6
- package/lib-esm/components/job-meta/job-meta.js +6 -5
- package/lib-esm/components/job-name/job-name.js +14 -11
- package/lib-esm/components/metric/metric.js +10 -9
- package/lib-esm/components/metrics-table/metrics-table.js +24 -20
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +7 -5
- package/lib-esm/components/summary/summary.js +60 -30
- package/lib-esm/components/summary/summary.stories.js +11 -8
- package/lib-esm/components/summary-item/summary-item.js +18 -15
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +17 -14
- package/lib-esm/hooks/rows-filter.js +7 -6
- package/lib-esm/hooks/rows-sort.js +8 -7
- package/lib-esm/hooks/search-params.js +74 -70
- package/lib-esm/layout/footer/footer.js +33 -30
- package/lib-esm/layout/header/header.js +17 -14
- package/lib-esm/layout/header/header.stories.js +45 -30
- package/lib-esm/prototypes/typography.stories.js +5 -4
- package/lib-esm/stories/wrapper.js +20 -14
- package/lib-esm/ui/container/container.js +12 -9
- package/lib-esm/ui/dropdown/dropdown.stories.js +9 -6
- package/lib-esm/ui/file-name/file-name.js +10 -7
- package/lib-esm/ui/filters/filters.container.js +14 -8
- package/lib-esm/ui/filters/filters.js +41 -19
- package/lib-esm/ui/filters/filters.stories.js +4 -3
- package/lib-esm/ui/filters/filters.utils.js +12 -6
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +7 -6
- package/lib-esm/ui/icon/icon.js +16 -13
- package/lib-esm/ui/input/input.js +6 -5
- package/lib-esm/ui/loader/loader.js +10 -7
- package/lib-esm/ui/logo/logo.js +7 -6
- package/lib-esm/ui/logo/logo.stories.js +7 -1
- package/lib-esm/ui/panels/panels.js +10 -7
- package/lib-esm/ui/popover/popover.js +8 -7
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +10 -7
- package/lib-esm/ui/table/table.js +8 -7
- package/lib-esm/ui/tabs/tabs.js +9 -6
- package/lib-esm/ui/toolbar/toolbar.stories.js +10 -7
- package/lib-esm/utils.js +13 -4
- package/package.json +19 -14
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.jsx +15 -15
- package/src/components/job-meta/job-meta.jsx +1 -3
- package/src/components/summary/summary.jsx +26 -10
- package/src/hooks/search-params.js +1 -1
- package/src/utils.jsx +5 -3
|
@@ -14,17 +14,18 @@ export const JobMeta = props => {
|
|
|
14
14
|
const rootClassName = cx(css.root, className);
|
|
15
15
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
16
16
|
className: rootClassName
|
|
17
|
-
}, restProps), meta.map(({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
}, restProps), meta.map((_ref, index) => {
|
|
18
|
+
let {
|
|
19
|
+
title,
|
|
20
|
+
content
|
|
21
|
+
} = _ref;
|
|
21
22
|
const key = index;
|
|
22
23
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
24
|
className: css.item,
|
|
24
25
|
key: key
|
|
25
26
|
}, title && /*#__PURE__*/React.createElement("h2", {
|
|
26
27
|
className: css.itemTitle
|
|
27
|
-
}, title), content.map(item =>
|
|
28
|
+
}, title), content.map(item => item));
|
|
28
29
|
}));
|
|
29
30
|
};
|
|
30
31
|
JobMeta.propTypes = {
|
|
@@ -4,17 +4,20 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { Tooltip } from '../../ui/tooltip';
|
|
6
6
|
import css from './job-name.module.css';
|
|
7
|
-
export const JobName =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
export const JobName = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
as: Component,
|
|
10
|
+
title,
|
|
11
|
+
internalBuildNumber,
|
|
12
|
+
children,
|
|
13
|
+
...restProps
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
16
|
+
className: css.root,
|
|
17
|
+
as: Component,
|
|
18
|
+
title: title
|
|
19
|
+
}, restProps), children || `Job #${internalBuildNumber}`);
|
|
20
|
+
};
|
|
18
21
|
JobName.defaultProps = {
|
|
19
22
|
as: 'span',
|
|
20
23
|
title: '',
|
|
@@ -4,15 +4,16 @@ import cx from 'classnames';
|
|
|
4
4
|
import styles from './metric.module.css'; // Separate value and unit
|
|
5
5
|
|
|
6
6
|
const EXTRACT_VALUE_UNIT_PATTERN = /([\d|.|,| ]*)(\w*|%)$/;
|
|
7
|
-
export const Metric =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
export const Metric = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
className,
|
|
10
|
+
value,
|
|
11
|
+
formatter,
|
|
12
|
+
inline,
|
|
13
|
+
anchored,
|
|
14
|
+
children,
|
|
15
|
+
enhanced
|
|
16
|
+
} = _ref;
|
|
16
17
|
const formattedValue = formatter(value); // eslint-disable-next-line no-unused-vars
|
|
17
18
|
|
|
18
19
|
const [matched, displayValue, displayUnit] = enhanced && formattedValue ? formattedValue.match(EXTRACT_VALUE_UNIT_PATTERN) : [null, formattedValue, null];
|
|
@@ -125,16 +125,17 @@ const getRows = (runs, items, renderRowHeader) => items.map((item, index) => {
|
|
|
125
125
|
};
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
export const MetricsTable =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
export const MetricsTable = _ref => {
|
|
129
|
+
let {
|
|
130
|
+
className,
|
|
131
|
+
renderRowHeader,
|
|
132
|
+
runs,
|
|
133
|
+
items,
|
|
134
|
+
emptyMessage,
|
|
135
|
+
showHeaderSum,
|
|
136
|
+
headerRows,
|
|
137
|
+
title
|
|
138
|
+
} = _ref;
|
|
138
139
|
const {
|
|
139
140
|
headers,
|
|
140
141
|
columnClassNames
|
|
@@ -161,16 +162,19 @@ export const MetricsTable = ({
|
|
|
161
162
|
return /*#__PURE__*/React.createElement(Table.Tr, {
|
|
162
163
|
className: rowClassName
|
|
163
164
|
}, cells.map(header => /*#__PURE__*/React.createElement(Table.Th, header)));
|
|
164
|
-
})), /*#__PURE__*/React.createElement(Table.TBody, null, !_isEmpty(rows) ? rows.map(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
165
|
+
})), /*#__PURE__*/React.createElement(Table.TBody, null, !_isEmpty(rows) ? rows.map(_ref2 => {
|
|
166
|
+
let {
|
|
167
|
+
key,
|
|
168
|
+
className: rowClassName,
|
|
169
|
+
cells
|
|
170
|
+
} = _ref2;
|
|
171
|
+
return /*#__PURE__*/React.createElement(Table.Tr, {
|
|
172
|
+
key: key,
|
|
173
|
+
className: rowClassName
|
|
174
|
+
}, cells.map((cell, index) => /*#__PURE__*/React.createElement(Table.Td, {
|
|
175
|
+
className: columnClassNames[index]
|
|
176
|
+
}, cell)));
|
|
177
|
+
}) : /*#__PURE__*/React.createElement(Table.Tr, null, /*#__PURE__*/React.createElement(Table.Td, {
|
|
174
178
|
className: styles.empty,
|
|
175
179
|
colSpan: (columnClassNames == null ? void 0 : columnClassNames.length) || 1
|
|
176
180
|
}, emptyMessage))));
|
|
@@ -14,11 +14,13 @@ export const MetricsTableOptions = props => {
|
|
|
14
14
|
return /*#__PURE__*/React.createElement(Dropdown, _extends({
|
|
15
15
|
className: className,
|
|
16
16
|
glyph: "menu"
|
|
17
|
-
}, restProps),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
}, restProps), _ref => {
|
|
18
|
+
let {
|
|
19
|
+
MenuItem,
|
|
20
|
+
menu,
|
|
21
|
+
menuItemClassName
|
|
22
|
+
} = _ref;
|
|
23
|
+
|
|
22
24
|
const getButtonOnClick = handler => () => {
|
|
23
25
|
handler();
|
|
24
26
|
menu.toggle();
|
|
@@ -12,38 +12,68 @@ import { FlexStack } from '../../layout/flex-stack';
|
|
|
12
12
|
import { ComponentLink } from '../component-link';
|
|
13
13
|
import { SummaryItem } from '../summary-item';
|
|
14
14
|
import css from './summary.module.css';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
outline: true,
|
|
25
|
-
className: cx(css.root, className)
|
|
26
|
-
}, /*#__PURE__*/React.createElement(FlexStack, {
|
|
27
|
-
className: css.items
|
|
28
|
-
}, Array.from(METRIC_COMPONENT_LINKS).filter(([metricId]) => keys.includes(metricId)).map(([metricId, metricOptions]) => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
29
|
-
as: ({
|
|
30
|
-
className: itemClassName,
|
|
31
|
-
...itemProps
|
|
32
|
-
}) => /*#__PURE__*/React.createElement(Box, _extends({
|
|
15
|
+
|
|
16
|
+
const CustomSummaryItem = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
className,
|
|
19
|
+
metricOptions,
|
|
20
|
+
SummaryItemCustomLink,
|
|
21
|
+
...props
|
|
22
|
+
} = _ref;
|
|
23
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
33
24
|
padding: ['xsmall', 'small'],
|
|
34
|
-
className: cx(
|
|
35
|
-
},
|
|
25
|
+
className: cx(className, css.summaryItemLink)
|
|
26
|
+
}, props, {
|
|
36
27
|
as: SummaryItemCustomLink
|
|
37
|
-
}, metricOptions.link))
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
}, metricOptions.link));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
CustomSummaryItem.propTypes = {
|
|
32
|
+
className: PropTypes.string,
|
|
33
|
+
metricOptions: PropTypes.shape({
|
|
34
|
+
link: PropTypes.any // eslint-disable-line react/forbid-prop-types
|
|
35
|
+
|
|
36
|
+
}).isRequired,
|
|
37
|
+
SummaryItemCustomLink: PropTypes.elementType.isRequired
|
|
38
|
+
};
|
|
39
|
+
CustomSummaryItem.defaultProps = {
|
|
40
|
+
className: ''
|
|
41
|
+
};
|
|
42
|
+
export const Summary = _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
className,
|
|
45
|
+
size,
|
|
46
|
+
keys,
|
|
47
|
+
data,
|
|
48
|
+
loading,
|
|
49
|
+
showSummaryItemDelta,
|
|
50
|
+
summaryItemLink: SummaryItemCustomLink
|
|
51
|
+
} = _ref2;
|
|
52
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
53
|
+
outline: true,
|
|
54
|
+
className: cx(css.root, className)
|
|
55
|
+
}, /*#__PURE__*/React.createElement(FlexStack, {
|
|
56
|
+
className: css.items
|
|
57
|
+
}, Array.from(METRIC_COMPONENT_LINKS).filter(_ref3 => {
|
|
58
|
+
let [metricId] = _ref3;
|
|
59
|
+
return keys.includes(metricId);
|
|
60
|
+
}).map(_ref4 => {
|
|
61
|
+
let [metricId, metricOptions] = _ref4;
|
|
62
|
+
return /*#__PURE__*/React.createElement(SummaryItem, {
|
|
63
|
+
as: CustomSummaryItem,
|
|
64
|
+
className: css.item,
|
|
65
|
+
metricOptions: metricOptions,
|
|
66
|
+
SummaryItemCustomLink: SummaryItemCustomLink,
|
|
67
|
+
size: size,
|
|
68
|
+
key: metricId,
|
|
69
|
+
id: metricId,
|
|
70
|
+
data: _get(data, metricId),
|
|
71
|
+
loading: loading,
|
|
72
|
+
showMetricDescription: true,
|
|
73
|
+
showDelta: showSummaryItemDelta && metricOptions.showDelta !== false
|
|
74
|
+
});
|
|
75
|
+
})));
|
|
76
|
+
};
|
|
47
77
|
Summary.defaultProps = {
|
|
48
78
|
className: '',
|
|
49
79
|
data: null,
|
|
@@ -34,12 +34,15 @@ stories.add('single run', () => /*#__PURE__*/React.createElement(Summary, {
|
|
|
34
34
|
}));
|
|
35
35
|
stories.add('with link', () => /*#__PURE__*/React.createElement(Summary, {
|
|
36
36
|
data: MULTIPLE_JOBS[0].summary,
|
|
37
|
-
summaryItemLink:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
summaryItemLink: _ref => {
|
|
38
|
+
let {
|
|
39
|
+
keyProps,
|
|
40
|
+
...props
|
|
41
|
+
} = _ref;
|
|
42
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
43
|
+
type: "button"
|
|
44
|
+
}, props, {
|
|
45
|
+
onClick: () => alert(JSON.stringify(keyProps))
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
45
48
|
}));
|
|
@@ -12,10 +12,12 @@ import { Metric } from '../metric';
|
|
|
12
12
|
import { Delta } from '../delta';
|
|
13
13
|
import css from './summary-item.module.css';
|
|
14
14
|
|
|
15
|
-
const MetricInfo =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const MetricInfo = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
description,
|
|
18
|
+
url
|
|
19
|
+
} = _ref;
|
|
20
|
+
|
|
19
21
|
// Workaround cases where the parent is a link
|
|
20
22
|
const readMoreOnClick = () => {
|
|
21
23
|
window.open(url);
|
|
@@ -37,17 +39,18 @@ MetricInfo.propTypes = {
|
|
|
37
39
|
MetricInfo.defaultProps = {
|
|
38
40
|
url: ''
|
|
39
41
|
};
|
|
40
|
-
export const SummaryItem =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
export const SummaryItem = _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
className,
|
|
45
|
+
as: Component,
|
|
46
|
+
size,
|
|
47
|
+
id,
|
|
48
|
+
data,
|
|
49
|
+
loading,
|
|
50
|
+
showDelta,
|
|
51
|
+
showMetricDescription,
|
|
52
|
+
...props
|
|
53
|
+
} = _ref2;
|
|
51
54
|
const {
|
|
52
55
|
baseline,
|
|
53
56
|
current
|
|
@@ -7,20 +7,23 @@ import { FlexStack } from '../../layout/flex-stack';
|
|
|
7
7
|
import { Stack } from '../../layout/stack';
|
|
8
8
|
import { Popover } from '../../ui/popover';
|
|
9
9
|
import css from './total-size-type-title.module.css';
|
|
10
|
-
export const TotalSizeTypeTitle =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, /*#__PURE__*/React.createElement(
|
|
18
|
-
|
|
19
|
-
}, /*#__PURE__*/React.createElement(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
export const TotalSizeTypeTitle = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
className
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
15
|
+
space: "xxxsmall",
|
|
16
|
+
className: cx(css.title, className)
|
|
17
|
+
}, /*#__PURE__*/React.createElement("span", null, I18N.ASSET_TOTALS), /*#__PURE__*/React.createElement(Popover, {
|
|
18
|
+
icon: "help"
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
20
|
+
space: "xxxsmall"
|
|
21
|
+
}, /*#__PURE__*/React.createElement("p", null, I18N.ASSET_TOTALS_INFO), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
|
|
22
|
+
href: config.documentation.assets,
|
|
23
|
+
target: "_blank",
|
|
24
|
+
rel: "noreferrer"
|
|
25
|
+
}, I18N.READ_MORE)))));
|
|
26
|
+
};
|
|
24
27
|
TotalSizeTypeTitle.propTypes = {
|
|
25
28
|
className: PropTypes.string
|
|
26
29
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
export const useRowsFilter =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export const useRowsFilter = _ref => {
|
|
3
|
+
let {
|
|
4
|
+
rows,
|
|
5
|
+
searchPattern,
|
|
6
|
+
filters,
|
|
7
|
+
getRowFilter
|
|
8
|
+
} = _ref;
|
|
8
9
|
const filteredRows = useMemo(() => {
|
|
9
10
|
const filterRow = getRowFilter(filters);
|
|
10
11
|
return rows.filter(row => {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import _orderBy from "lodash/orderBy";
|
|
2
2
|
import { useState, useMemo } from 'react';
|
|
3
|
-
export const useRowsSort =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
export const useRowsSort = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
rows,
|
|
6
|
+
sortFields,
|
|
7
|
+
sortBy = 'size',
|
|
8
|
+
sortDirection = 'desc',
|
|
9
|
+
getCustomSort
|
|
10
|
+
} = _ref;
|
|
10
11
|
const [sort, updateSort] = useState({
|
|
11
12
|
field: sortBy,
|
|
12
13
|
direction: sortDirection
|
|
@@ -8,7 +8,7 @@ const ACTION_RESET_ALL = 'RESET_ALL';
|
|
|
8
8
|
const ACTION_SET = 'SET';
|
|
9
9
|
|
|
10
10
|
const getSearchPattern = search => {
|
|
11
|
-
let searchPattern =
|
|
11
|
+
let searchPattern = /.*/;
|
|
12
12
|
|
|
13
13
|
if (!search || !search.trim()) {
|
|
14
14
|
return searchPattern;
|
|
@@ -24,74 +24,77 @@ const getSearchPattern = search => {
|
|
|
24
24
|
return searchPattern;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const getSearchReducer =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
const getSearchReducer = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
defaultFilters,
|
|
30
|
+
allEntriesFilters,
|
|
31
|
+
setParentState
|
|
32
|
+
} = _ref;
|
|
33
|
+
return (state, action) => {
|
|
34
|
+
const {
|
|
35
|
+
type,
|
|
36
|
+
payload
|
|
37
|
+
} = action;
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
switch (type) {
|
|
40
|
+
case ACTION_SET_FILTERS:
|
|
41
|
+
{
|
|
42
|
+
setParentState({
|
|
43
|
+
filters: payload,
|
|
44
|
+
search: state.search
|
|
45
|
+
});
|
|
46
|
+
return { ...state,
|
|
47
|
+
filters: payload
|
|
48
|
+
};
|
|
49
|
+
}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
case ACTION_SET_SEARCH:
|
|
52
|
+
{
|
|
53
|
+
setParentState({
|
|
54
|
+
filters: state.filters,
|
|
55
|
+
search: payload
|
|
56
|
+
});
|
|
57
|
+
return { ...state,
|
|
58
|
+
search: payload,
|
|
59
|
+
searchPattern: getSearchPattern(payload)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
case ACTION_RESET_DEFAULT:
|
|
64
|
+
{
|
|
65
|
+
setParentState({
|
|
66
|
+
filters: defaultFilters,
|
|
67
|
+
search: ''
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
filters: defaultFilters,
|
|
71
|
+
search: '',
|
|
72
|
+
searchPattern: getSearchPattern()
|
|
73
|
+
};
|
|
74
|
+
}
|
|
73
75
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
case ACTION_RESET_ALL:
|
|
77
|
+
{
|
|
78
|
+
setParentState({
|
|
79
|
+
filters: allEntriesFilters,
|
|
80
|
+
search: ''
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
filters: allEntriesFilters,
|
|
84
|
+
search: '',
|
|
85
|
+
searchPattern: getSearchPattern()
|
|
86
|
+
};
|
|
87
|
+
}
|
|
86
88
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
case ACTION_SET:
|
|
90
|
+
{
|
|
91
|
+
return payload;
|
|
92
|
+
}
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
default:
|
|
95
|
+
return state;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
95
98
|
};
|
|
96
99
|
|
|
97
100
|
export const generateState = (filters, search) => ({
|
|
@@ -99,13 +102,14 @@ export const generateState = (filters, search) => ({
|
|
|
99
102
|
search,
|
|
100
103
|
searchPattern: getSearchPattern(search)
|
|
101
104
|
});
|
|
102
|
-
export const useSearchParams =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
export const useSearchParams = _ref2 => {
|
|
106
|
+
let {
|
|
107
|
+
search: parentSearch,
|
|
108
|
+
filters: parentFilters,
|
|
109
|
+
defaultFilters,
|
|
110
|
+
allEntriesFilters,
|
|
111
|
+
setState: setParentState
|
|
112
|
+
} = _ref2;
|
|
109
113
|
// When we pass custom filters, set the other flags to true (allEntries)
|
|
110
114
|
const initialFilters = parentFilters ? _merge({}, allEntriesFilters, parentFilters) : defaultFilters;
|
|
111
115
|
const [{
|
|
@@ -21,36 +21,39 @@ ExternalLink.propTypes = {
|
|
|
21
21
|
/** Link to value */
|
|
22
22
|
to: PropTypes.string.isRequired
|
|
23
23
|
};
|
|
24
|
-
export const Footer =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, /*#__PURE__*/React.createElement(
|
|
36
|
-
|
|
37
|
-
}, /*#__PURE__*/React.createElement(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, /*#__PURE__*/React.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
24
|
+
export const Footer = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
className,
|
|
27
|
+
version
|
|
28
|
+
} = _ref;
|
|
29
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
30
|
+
as: "footer",
|
|
31
|
+
className: cx(css.root, className)
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
33
|
+
padding: ['medium', 'none'],
|
|
34
|
+
className: css.inner
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
36
|
+
space: "xsmall"
|
|
37
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("nav", {
|
|
38
|
+
className: css.nav
|
|
39
|
+
}, /*#__PURE__*/React.createElement(ExternalLink, {
|
|
40
|
+
href: config.githubUrl,
|
|
41
|
+
className: cx(css.navItem, css.navLink),
|
|
42
|
+
title: "In-depth bundle analyzer for webpack(bundle size, assets, modules, packages)"
|
|
43
|
+
}, `BundleStats `, version), /*#__PURE__*/React.createElement("span", {
|
|
44
|
+
className: css.navItem
|
|
45
|
+
}, /*#__PURE__*/React.createElement(ExternalLink, {
|
|
46
|
+
href: `${config.githubUrl}/issues`,
|
|
47
|
+
className: css.navLink,
|
|
48
|
+
title: "Navigate to GitHub and open issue"
|
|
49
|
+
}, "Report issue")), /*#__PURE__*/React.createElement("span", {
|
|
50
|
+
className: css.navItem
|
|
51
|
+
}, /*#__PURE__*/React.createElement("span", null, "Made by "), /*#__PURE__*/React.createElement(ExternalLink, {
|
|
52
|
+
className: css.navLink,
|
|
53
|
+
href: config.siteUrl,
|
|
54
|
+
title: "Go to RelativeCI - Specialized insights for web bundles"
|
|
55
|
+
}, "RelativeCI")))))));
|
|
56
|
+
};
|
|
54
57
|
Footer.defaultProps = {
|
|
55
58
|
className: '',
|
|
56
59
|
version: null
|