@bundle-stats/ui 3.2.0-beta.1 → 3.2.1-beta.10
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/.babelrc.js +3 -3
- package/CHANGELOG.md +11 -4
- package/lib/assets/icons/arrow.svg +1 -0
- package/lib/assets/icons/cancel.svg +1 -0
- package/lib/assets/icons/clock.svg +1 -0
- package/lib/assets/icons/close.svg +1 -0
- package/lib/assets/icons/commit.svg +1 -0
- package/lib/assets/icons/filter.svg +1 -0
- package/lib/assets/icons/help.svg +1 -0
- package/lib/assets/icons/menu.svg +1 -0
- package/lib/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/lib/assets/icons/warning.svg +1 -0
- package/lib/assets/icons.svg +1 -0
- package/lib/components/browsertime-table/browsertime-table.stories.js +1 -0
- package/lib/components/bundle-assets/bundle-assets.js +3 -3
- package/lib/components/bundle-assets/bundle-assets.stories.js +19 -7
- package/lib/components/bundle-assets/bundle-assets.utils.js +95 -28
- package/lib/components/bundle-assets/index.js +115 -4
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +17 -18
- package/lib/components/bundle-modules/bundle-modules.js +3 -3
- package/lib/components/bundle-modules/bundle-modules.utils.js +152 -0
- package/lib/components/bundle-modules/index.js +135 -4
- package/lib/components/bundle-packages/bundle-packages.js +3 -3
- package/lib/components/bundle-packages/{bundle-packages.container.js → bundle-packages.utils.js} +8 -42
- package/lib/components/bundle-packages/index.js +111 -3
- package/lib/components/job-meta/job-meta.js +1 -1
- package/lib/components/metrics-table/metrics-table.js +3 -7
- package/lib/components/metrics-table-search/metrics-table-search.js +2 -1
- package/lib/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/lib/components/summary/summary.js +52 -34
- package/lib/hooks/rows-filter.js +28 -0
- package/lib/hooks/rows-sort.js +54 -0
- package/lib/{hocs/with-search.js → hooks/search-params.js} +16 -65
- package/lib/layout/box/box.js +2 -2
- package/lib/layout/stack/stack.js +13 -3
- package/lib/ui/icon/icon.js +4 -191
- package/lib/ui/sort-dropdown/sort-dropdown.js +12 -13
- package/lib/ui/sort-dropdown/sort-dropdown.stories.js +2 -2
- package/lib/utils.js +6 -3
- package/lib-esm/app/app.js +60 -70
- package/lib-esm/app/app.stories.js +50 -71
- package/lib-esm/app/header/header.js +5 -3
- package/lib-esm/assets/icons/arrow.svg +1 -0
- package/lib-esm/assets/icons/cancel.svg +1 -0
- package/lib-esm/assets/icons/clock.svg +1 -0
- package/lib-esm/assets/icons/close.svg +1 -0
- package/lib-esm/assets/icons/commit.svg +1 -0
- package/lib-esm/assets/icons/filter.svg +1 -0
- package/lib-esm/assets/icons/help.svg +1 -0
- package/lib-esm/assets/icons/menu.svg +1 -0
- package/lib-esm/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/lib-esm/assets/icons/warning.svg +1 -0
- package/lib-esm/assets/icons.svg +1 -0
- package/lib-esm/components/asset-info/asset-info.js +21 -17
- package/lib-esm/components/asset-info/asset-info.stories.js +29 -33
- package/lib-esm/components/browsertime-table/browsertime-table.js +6 -4
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +11 -14
- package/lib-esm/components/bundle-assets/bundle-assets.constants.js +17 -15
- package/lib-esm/components/bundle-assets/bundle-assets.js +107 -97
- package/lib-esm/components/bundle-assets/bundle-assets.stories.js +58 -63
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +65 -21
- package/lib-esm/components/bundle-assets/index.js +89 -2
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +51 -53
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.stories.js +9 -13
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +14 -13
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +13 -19
- package/lib-esm/components/bundle-modules/bundle-modules.constants.js +17 -15
- package/lib-esm/components/bundle-modules/bundle-modules.js +112 -110
- package/lib-esm/components/bundle-modules/bundle-modules.stories.js +46 -58
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +98 -0
- package/lib-esm/components/bundle-modules/index.js +114 -3
- package/lib-esm/components/bundle-packages/bundle-packages.constants.js +17 -15
- package/lib-esm/components/bundle-packages/bundle-packages.js +71 -69
- package/lib-esm/components/bundle-packages/bundle-packages.stories.js +34 -46
- package/lib-esm/components/bundle-packages/bundle-packages.utils.js +44 -0
- package/lib-esm/components/bundle-packages/index.js +87 -2
- package/lib-esm/components/component-link.js +10 -13
- package/lib-esm/components/delta/delta.js +8 -6
- package/lib-esm/components/delta/delta.stories.js +26 -38
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.js +11 -9
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +20 -26
- package/lib-esm/components/job-header/job-header.js +14 -11
- package/lib-esm/components/job-header/job-header.stories.js +12 -18
- package/lib-esm/components/job-meta/job-meta.js +15 -18
- package/lib-esm/components/job-meta/job-meta.stories.js +10 -12
- package/lib-esm/components/job-name/job-name.js +9 -12
- package/lib-esm/components/job-name/job-name.stories.js +15 -23
- package/lib-esm/components/jobs-header/jobs-header.js +12 -12
- package/lib-esm/components/jobs-header/jobs-header.stories.js +80 -86
- package/lib-esm/components/lighthouse-table/lighthouse-table.js +6 -4
- package/lib-esm/components/lighthouse-table/lighthouse-table.stories.js +10 -14
- package/lib-esm/components/metric/metric.js +15 -19
- package/lib-esm/components/metric/metric.stories.js +36 -58
- package/lib-esm/components/metrics-table/metrics-table.js +128 -139
- package/lib-esm/components/metrics-table/metrics-table.stories.js +27 -35
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +16 -19
- package/lib-esm/components/metrics-table-options/metrics-table-options.stories.js +6 -12
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +17 -18
- package/lib-esm/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/lib-esm/components/metrics-table-search/metrics-table-search.stories.js +4 -9
- package/lib-esm/components/metrics-table-title/metrics-table-title.js +9 -7
- package/lib-esm/components/module-info/module-info.js +15 -13
- package/lib-esm/components/module-info/module-info.stories.js +20 -22
- package/lib-esm/components/summary/summary.js +52 -36
- package/lib-esm/components/summary/summary.stories.js +31 -46
- package/lib-esm/components/summary-item/summary-item.js +27 -28
- package/lib-esm/components/summary-item/summary-item.stories.js +40 -50
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +4 -2
- package/lib-esm/constants.js +25 -30
- package/lib-esm/hooks/rows-filter.js +20 -0
- package/lib-esm/hooks/rows-sort.js +22 -0
- package/lib-esm/hooks/search-params.js +170 -0
- package/lib-esm/layout/box/box.js +14 -21
- package/lib-esm/layout/box/box.stories.js +34 -46
- package/lib-esm/layout/flex-stack/flex-stack.js +9 -12
- package/lib-esm/layout/flex-stack/flex-stack.stories.js +39 -49
- package/lib-esm/layout/footer/footer.js +11 -11
- package/lib-esm/layout/footer/footer.stories.js +7 -11
- package/lib-esm/layout/header/header.js +10 -14
- package/lib-esm/layout/header/header.stories.js +50 -44
- package/lib-esm/layout/stack/stack.js +13 -8
- package/lib-esm/layout/stack/stack.stories.js +39 -49
- package/lib-esm/layout/sub-header/sub-header.js +14 -12
- package/lib-esm/layout/sub-header/sub-header.stories.js +57 -69
- package/lib-esm/prototypes/typography.stories.js +49 -58
- package/lib-esm/query-state.js +13 -16
- package/lib-esm/stories/wrapper.js +6 -12
- package/lib-esm/ui/alert/alert.js +6 -4
- package/lib-esm/ui/alert/alert.stories.js +14 -24
- package/lib-esm/ui/container/container.js +6 -9
- package/lib-esm/ui/container/container.stories.js +15 -17
- package/lib-esm/ui/dropdown/dropdown.js +13 -11
- package/lib-esm/ui/dropdown/dropdown.stories.js +22 -26
- package/lib-esm/ui/empty-set/empty-set.js +12 -12
- package/lib-esm/ui/empty-set/empty-set.stories.js +11 -19
- package/lib-esm/ui/file-name/file-name.js +6 -4
- package/lib-esm/ui/file-name/file-name.stories.js +12 -16
- package/lib-esm/ui/filters/filters.container.js +57 -76
- package/lib-esm/ui/filters/filters.js +71 -77
- package/lib-esm/ui/filters/filters.stories.js +82 -100
- package/lib-esm/ui/filters/filters.utils.js +26 -24
- package/lib-esm/ui/filters/index.js +1 -1
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +68 -78
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.stories.js +67 -77
- package/lib-esm/ui/icon/icon.js +13 -202
- package/lib-esm/ui/icon/icon.stories.js +16 -24
- package/lib-esm/ui/input/input.js +7 -10
- package/lib-esm/ui/input/input.stories.js +8 -12
- package/lib-esm/ui/loader/loader.js +6 -9
- package/lib-esm/ui/loader/loader.stories.js +5 -9
- package/lib-esm/ui/logo/logo.constants.js +6 -6
- package/lib-esm/ui/logo/logo.js +15 -15
- package/lib-esm/ui/logo/logo.stories.js +14 -22
- package/lib-esm/ui/panels/panels.js +13 -23
- package/lib-esm/ui/panels/panels.stories.js +14 -16
- package/lib-esm/ui/popover/popover.js +11 -9
- package/lib-esm/ui/popover/popover.stories.js +7 -11
- package/lib-esm/ui/skeleton/skeleton.js +6 -9
- package/lib-esm/ui/skeleton/skeleton.stories.js +2 -4
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +38 -38
- package/lib-esm/ui/sort-dropdown/sort-dropdown.stories.js +14 -16
- package/lib-esm/ui/table/table.js +26 -31
- package/lib-esm/ui/table/table.stories.js +84 -102
- package/lib-esm/ui/tabs/tabs.js +13 -21
- package/lib-esm/ui/tabs/tabs.stories.js +4 -6
- package/lib-esm/ui/toolbar/toolbar.js +7 -5
- package/lib-esm/ui/toolbar/toolbar.stories.js +14 -16
- package/lib-esm/ui/tooltip/tooltip.js +13 -16
- package/lib-esm/ui/tooltip/tooltip.stories.js +8 -12
- package/lib-esm/utils.js +20 -24
- package/package.json +30 -33
- package/src/assets/icons/arrow.svg +1 -0
- package/src/assets/icons/cancel.svg +1 -0
- package/src/assets/icons/clock.svg +1 -0
- package/src/assets/icons/close.svg +1 -0
- package/src/assets/icons/commit.svg +1 -0
- package/src/assets/icons/filter.svg +1 -0
- package/src/assets/icons/help.svg +1 -0
- package/src/assets/icons/menu.svg +1 -0
- package/src/{ui/icon/assets → assets/icons}/sort.svg +0 -0
- package/src/assets/icons/warning.svg +1 -0
- package/src/assets/icons.svg +1 -0
- package/src/components/bundle-assets/bundle-assets.jsx +3 -3
- package/src/components/bundle-assets/bundle-assets.utils.js +96 -17
- package/src/components/bundle-assets/index.jsx +89 -0
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.jsx +15 -15
- package/src/components/bundle-modules/bundle-modules.jsx +3 -3
- package/src/components/bundle-modules/bundle-modules.utils.js +101 -0
- package/src/components/bundle-modules/index.jsx +107 -0
- package/src/components/bundle-packages/bundle-packages.jsx +3 -3
- package/src/components/bundle-packages/bundle-packages.utils.js +47 -0
- package/src/components/bundle-packages/index.jsx +84 -0
- package/src/components/job-meta/job-meta.jsx +1 -3
- package/src/components/metrics-table/metrics-table.jsx +2 -7
- package/src/components/metrics-table-search/metrics-table-search.jsx +1 -0
- package/src/components/metrics-table-search/metrics-table-search.module.css +2 -1
- package/src/components/summary/summary.jsx +26 -10
- package/src/hooks/rows-filter.js +16 -0
- package/src/hooks/rows-sort.js +24 -0
- package/src/hooks/search-params.js +153 -0
- package/src/layout/box/box.jsx +1 -1
- package/src/layout/stack/stack.jsx +2 -2
- package/src/ui/icon/icon.jsx +7 -42
- package/src/ui/sort-dropdown/sort-dropdown.jsx +11 -11
- package/src/utils.jsx +5 -3
- package/lib/components/bundle-assets/bundle-assets.container.js +0 -140
- package/lib/components/bundle-modules/bundle-modules.container.js +0 -222
- package/lib/hocs/with-custom-sort.js +0 -75
- package/lib/hocs/with-filtered-items.js +0 -54
- package/lib/ui/icon/assets/arrow.svg +0 -4
- package/lib/ui/icon/assets/branch.svg +0 -3
- package/lib/ui/icon/assets/cancel.svg +0 -4
- package/lib/ui/icon/assets/clock.svg +0 -3
- package/lib/ui/icon/assets/close.svg +0 -4
- package/lib/ui/icon/assets/commit.svg +0 -3
- package/lib/ui/icon/assets/filter.svg +0 -4
- package/lib/ui/icon/assets/help.svg +0 -4
- package/lib/ui/icon/assets/job.svg +0 -3
- package/lib/ui/icon/assets/menu.svg +0 -4
- package/lib/ui/icon/assets/package.svg +0 -3
- package/lib/ui/icon/assets/pull-request.svg +0 -3
- package/lib/ui/icon/assets/repository.svg +0 -3
- package/lib/ui/icon/assets/warning.svg +0 -4
- package/lib-esm/components/bundle-assets/bundle-assets.container.js +0 -119
- package/lib-esm/components/bundle-modules/bundle-modules.container.js +0 -175
- package/lib-esm/components/bundle-packages/bundle-packages.container.js +0 -91
- package/lib-esm/hocs/with-custom-sort.js +0 -43
- package/lib-esm/hocs/with-filtered-items.js +0 -35
- package/lib-esm/hocs/with-search.js +0 -214
- package/lib-esm/ui/icon/assets/arrow.svg +0 -4
- package/lib-esm/ui/icon/assets/branch.svg +0 -3
- package/lib-esm/ui/icon/assets/cancel.svg +0 -4
- package/lib-esm/ui/icon/assets/clock.svg +0 -3
- package/lib-esm/ui/icon/assets/close.svg +0 -4
- package/lib-esm/ui/icon/assets/commit.svg +0 -3
- package/lib-esm/ui/icon/assets/filter.svg +0 -4
- package/lib-esm/ui/icon/assets/help.svg +0 -4
- package/lib-esm/ui/icon/assets/job.svg +0 -3
- package/lib-esm/ui/icon/assets/menu.svg +0 -4
- package/lib-esm/ui/icon/assets/package.svg +0 -3
- package/lib-esm/ui/icon/assets/pull-request.svg +0 -3
- package/lib-esm/ui/icon/assets/repository.svg +0 -3
- package/lib-esm/ui/icon/assets/warning.svg +0 -4
- package/src/components/bundle-assets/bundle-assets.container.js +0 -146
- package/src/components/bundle-assets/index.js +0 -4
- package/src/components/bundle-modules/bundle-modules.container.js +0 -158
- package/src/components/bundle-modules/index.js +0 -4
- package/src/components/bundle-packages/bundle-packages.container.js +0 -93
- package/src/components/bundle-packages/index.js +0 -4
- package/src/hocs/with-custom-sort.jsx +0 -35
- package/src/hocs/with-filtered-items.jsx +0 -34
- package/src/hocs/with-search.jsx +0 -184
- package/src/ui/icon/assets/arrow.svg +0 -4
- package/src/ui/icon/assets/branch.svg +0 -3
- package/src/ui/icon/assets/cancel.svg +0 -4
- package/src/ui/icon/assets/clock.svg +0 -3
- package/src/ui/icon/assets/close.svg +0 -4
- package/src/ui/icon/assets/commit.svg +0 -3
- package/src/ui/icon/assets/filter.svg +0 -4
- package/src/ui/icon/assets/help.svg +0 -4
- package/src/ui/icon/assets/job.svg +0 -3
- package/src/ui/icon/assets/menu.svg +0 -4
- package/src/ui/icon/assets/package.svg +0 -3
- package/src/ui/icon/assets/pull-request.svg +0 -3
- package/src/ui/icon/assets/repository.svg +0 -3
- package/src/ui/icon/assets/warning.svg +0 -4
|
@@ -38,12 +38,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
38
38
|
var SortDropdown = function SortDropdown(props) {
|
|
39
39
|
var className = props.className,
|
|
40
40
|
label = props.label,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
fields = props.fields,
|
|
42
|
+
field = props.field,
|
|
43
43
|
direction = props.direction,
|
|
44
44
|
onChange = props.onChange;
|
|
45
45
|
var rootClassName = (0, _classnames["default"])(_sortDropdownModule["default"].root, className);
|
|
46
|
-
var customLabel =
|
|
46
|
+
var customLabel = fields[field] ? "Ordered by ".concat(fields[field].label) : label;
|
|
47
47
|
return /*#__PURE__*/_react["default"].createElement(_dropdown.Dropdown, {
|
|
48
48
|
className: rootClassName,
|
|
49
49
|
label: customLabel,
|
|
@@ -55,10 +55,10 @@ var SortDropdown = function SortDropdown(props) {
|
|
|
55
55
|
menuItemClassName = _ref.menuItemClassName,
|
|
56
56
|
menuItemActiveClassName = _ref.menuItemActiveClassName;
|
|
57
57
|
|
|
58
|
-
var getButtonOnClick = function getButtonOnClick(
|
|
58
|
+
var getButtonOnClick = function getButtonOnClick(newField, newDirection) {
|
|
59
59
|
return function () {
|
|
60
60
|
onChange({
|
|
61
|
-
|
|
61
|
+
field: newField,
|
|
62
62
|
direction: newDirection
|
|
63
63
|
});
|
|
64
64
|
menu.toggle();
|
|
@@ -67,25 +67,24 @@ var SortDropdown = function SortDropdown(props) {
|
|
|
67
67
|
|
|
68
68
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
69
69
|
className: _sortDropdownModule["default"].items
|
|
70
|
-
}, Object.entries(
|
|
70
|
+
}, Object.entries(fields).map(function (_ref2) {
|
|
71
71
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
72
72
|
key = _ref3[0],
|
|
73
73
|
item = _ref3[1];
|
|
74
74
|
|
|
75
75
|
var buttonProps = direction === 'asc' ? {
|
|
76
|
-
className:
|
|
76
|
+
className: _sortDropdownModule["default"].itemAsc,
|
|
77
77
|
onClick: getButtonOnClick(key, 'desc'),
|
|
78
78
|
title: "Order data by ".concat(item.label, " descending")
|
|
79
79
|
} : {
|
|
80
|
-
className: _sortDropdownModule["default"].itemButton,
|
|
81
80
|
onClick: getButtonOnClick(key, 'asc'),
|
|
82
81
|
title: "Order data by ".concat(item.label, " ascending")
|
|
83
82
|
};
|
|
84
|
-
var isActive =
|
|
83
|
+
var isActive = field === key;
|
|
85
84
|
return /*#__PURE__*/_react["default"].createElement(MenuItem, _extends({
|
|
86
85
|
key: key
|
|
87
86
|
}, menu, buttonProps, {
|
|
88
|
-
className: (0, _classnames["default"])(menuItemClassName, _sortDropdownModule["default"].item, isActive && menuItemActiveClassName, isActive && _sortDropdownModule["default"].active)
|
|
87
|
+
className: (0, _classnames["default"])(buttonProps.className, menuItemClassName, _sortDropdownModule["default"].item, isActive && menuItemActiveClassName, isActive && _sortDropdownModule["default"].active)
|
|
89
88
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
90
89
|
className: _sortDropdownModule["default"].itemLabel
|
|
91
90
|
}, item.label), /*#__PURE__*/_react["default"].createElement(_icon.Icon, {
|
|
@@ -101,14 +100,14 @@ SortDropdown.defaultProps = {
|
|
|
101
100
|
className: '',
|
|
102
101
|
label: 'Order by',
|
|
103
102
|
onChange: function onChange() {},
|
|
104
|
-
|
|
103
|
+
field: '',
|
|
105
104
|
direction: 'asc'
|
|
106
105
|
};
|
|
107
106
|
SortDropdown.propTypes = {
|
|
108
107
|
className: _propTypes["default"].string,
|
|
109
108
|
label: _propTypes["default"].string,
|
|
110
|
-
|
|
109
|
+
fields: _propTypes["default"].shape(_defineProperty({}, _propTypes["default"].string, _propTypes["default"].string)).isRequired,
|
|
111
110
|
onChange: _propTypes["default"].func,
|
|
112
|
-
|
|
111
|
+
field: _propTypes["default"].string,
|
|
113
112
|
direction: _propTypes["default"].string
|
|
114
113
|
};
|
|
@@ -19,7 +19,7 @@ stories.add('default', function () {
|
|
|
19
19
|
onChange: function onChange(state) {
|
|
20
20
|
console.log(state); // eslint-disable-line no-console
|
|
21
21
|
},
|
|
22
|
-
|
|
22
|
+
fields: {
|
|
23
23
|
filename: {
|
|
24
24
|
label: 'Filename'
|
|
25
25
|
},
|
|
@@ -27,6 +27,6 @@ stories.add('default', function () {
|
|
|
27
27
|
label: 'Size'
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
field: "size"
|
|
31
31
|
});
|
|
32
32
|
});
|
package/lib/utils.js
CHANGED
|
@@ -45,14 +45,17 @@ var getRenderChildWithClassName = function getRenderChildWithClassName(className
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
var props = child.props;
|
|
49
|
+
|
|
50
|
+
if (!props) {
|
|
49
51
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
52
|
className: className
|
|
51
53
|
}, child);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
return /*#__PURE__*/_react["default"].cloneElement(child, _objectSpread(_objectSpread({},
|
|
55
|
-
className: (0, _classnames["default"])(className,
|
|
56
|
+
return /*#__PURE__*/_react["default"].cloneElement(child, _objectSpread(_objectSpread({}, props), {}, {
|
|
57
|
+
className: (0, _classnames["default"])(className, props.className) // eslint-disable-line react/prop-types
|
|
58
|
+
|
|
56
59
|
}));
|
|
57
60
|
};
|
|
58
61
|
};
|
package/lib-esm/app/app.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
var _excluded = ["jobs", "version"];
|
|
2
|
-
|
|
3
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
2
|
|
|
5
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
-
|
|
7
3
|
import React, { useEffect } from 'react';
|
|
8
4
|
import PropTypes from 'prop-types';
|
|
9
5
|
import { HashRouter, NavLink, Route, Switch, useLocation } from 'react-router-dom';
|
|
@@ -27,21 +23,22 @@ import I18N from '../i18n';
|
|
|
27
23
|
import { Header } from './header';
|
|
28
24
|
import css from './app.module.css';
|
|
29
25
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
useEffect(
|
|
26
|
+
const ScrollToTop = () => {
|
|
27
|
+
const {
|
|
28
|
+
pathname
|
|
29
|
+
} = useLocation();
|
|
30
|
+
useEffect(() => {
|
|
35
31
|
window.scrollTo(0, 0);
|
|
36
32
|
}, [pathname]);
|
|
37
33
|
return null;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
const Layout = _ref => {
|
|
37
|
+
let {
|
|
38
|
+
jobs,
|
|
39
|
+
version,
|
|
40
|
+
...props
|
|
41
|
+
} = _ref;
|
|
45
42
|
return /*#__PURE__*/React.createElement("div", {
|
|
46
43
|
className: css.root
|
|
47
44
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
@@ -63,21 +60,14 @@ Layout.defaultProps = {
|
|
|
63
60
|
version: null
|
|
64
61
|
};
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var _useComponentQuerySta2 = useComponentQueryState(COMPONENT.BUNDLE_PACKAGES),
|
|
75
|
-
bundlePackagesState = _useComponentQuerySta2[0],
|
|
76
|
-
bundlePackagesSetState = _useComponentQuerySta2[1];
|
|
77
|
-
|
|
78
|
-
var _useComponentQuerySta3 = useComponentQueryState(COMPONENT.BUNDLE_MODULES),
|
|
79
|
-
bundleModulesState = _useComponentQuerySta3[0],
|
|
80
|
-
bundleModulesSetState = _useComponentQuerySta3[1];
|
|
63
|
+
const AppComponent = _ref2 => {
|
|
64
|
+
let {
|
|
65
|
+
version,
|
|
66
|
+
jobs
|
|
67
|
+
} = _ref2;
|
|
68
|
+
const [bundleStatsState, bundleStatsSetState] = useComponentQueryState(COMPONENT.BUNDLE_ASSETS);
|
|
69
|
+
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(COMPONENT.BUNDLE_PACKAGES);
|
|
70
|
+
const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(COMPONENT.BUNDLE_MODULES);
|
|
81
71
|
|
|
82
72
|
if (jobs.length === 0) {
|
|
83
73
|
return /*#__PURE__*/React.createElement(Layout, {
|
|
@@ -87,8 +77,10 @@ var AppComponent = function AppComponent(_ref2) {
|
|
|
87
77
|
}, I18N.NO_DATA)));
|
|
88
78
|
}
|
|
89
79
|
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
const {
|
|
81
|
+
duplicatePackagesCount
|
|
82
|
+
} = jobs[0].summary.webpack;
|
|
83
|
+
const duplicatePackagesInsights = Boolean(duplicatePackagesCount.current || duplicatePackagesCount.baseline);
|
|
92
84
|
return /*#__PURE__*/React.createElement(Layout, {
|
|
93
85
|
jobs: jobs,
|
|
94
86
|
version: version
|
|
@@ -124,8 +116,10 @@ var AppComponent = function AppComponent(_ref2) {
|
|
|
124
116
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
125
117
|
exact: true,
|
|
126
118
|
path: URLS.ASSETS,
|
|
127
|
-
render:
|
|
128
|
-
|
|
119
|
+
render: _ref3 => {
|
|
120
|
+
let {
|
|
121
|
+
location
|
|
122
|
+
} = _ref3;
|
|
129
123
|
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
130
124
|
space: "medium"
|
|
131
125
|
}, /*#__PURE__*/React.createElement(Summary, {
|
|
@@ -138,31 +132,31 @@ var AppComponent = function AppComponent(_ref2) {
|
|
|
138
132
|
jobs: jobs,
|
|
139
133
|
setState: bundleStatsSetState
|
|
140
134
|
}, bundleStatsState, {
|
|
141
|
-
key: location.pathname
|
|
135
|
+
key: `${location.pathname}_${location.search}`
|
|
142
136
|
})))));
|
|
143
137
|
}
|
|
144
138
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
145
139
|
exact: true,
|
|
146
140
|
path: URLS.MODULES,
|
|
147
|
-
render:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}, bundleModulesState)))));
|
|
160
|
-
}
|
|
141
|
+
render: () => /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
142
|
+
space: "medium"
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Summary, {
|
|
144
|
+
keys: METRICS_WEBPACK_MODULES,
|
|
145
|
+
data: jobs[0].summary,
|
|
146
|
+
showSummaryItemDelta: jobs.length !== 1
|
|
147
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
148
|
+
outline: true
|
|
149
|
+
}, /*#__PURE__*/React.createElement(BundleModules, _extends({
|
|
150
|
+
jobs: jobs,
|
|
151
|
+
setState: bundleModulesSetState
|
|
152
|
+
}, bundleModulesState)))))
|
|
161
153
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
162
154
|
exact: true,
|
|
163
155
|
path: URLS.PACKAGES,
|
|
164
|
-
render:
|
|
165
|
-
|
|
156
|
+
render: _ref4 => {
|
|
157
|
+
let {
|
|
158
|
+
location
|
|
159
|
+
} = _ref4;
|
|
166
160
|
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
167
161
|
space: "medium"
|
|
168
162
|
}, /*#__PURE__*/React.createElement(Summary, {
|
|
@@ -175,28 +169,26 @@ var AppComponent = function AppComponent(_ref2) {
|
|
|
175
169
|
jobs: jobs
|
|
176
170
|
}, bundlePackagesState, {
|
|
177
171
|
setState: bundlePackagesSetState,
|
|
178
|
-
key: location.pathname
|
|
172
|
+
key: `${location.pathname}_${location.search}`
|
|
179
173
|
})))));
|
|
180
174
|
}
|
|
181
175
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
182
176
|
exact: true,
|
|
183
177
|
path: URLS.OVERVIEW,
|
|
184
|
-
render:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
})))));
|
|
199
|
-
}
|
|
178
|
+
render: () => /*#__PURE__*/React.createElement(Stack, {
|
|
179
|
+
space: "large"
|
|
180
|
+
}, duplicatePackagesInsights && /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(DuplicatePackagesWarning, {
|
|
181
|
+
duplicatePackagesCount: duplicatePackagesCount,
|
|
182
|
+
showDelta: jobs.length > 1
|
|
183
|
+
})), /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
184
|
+
space: "small"
|
|
185
|
+
}, /*#__PURE__*/React.createElement(TotalSizeTypeTitle, null), /*#__PURE__*/React.createElement(BundleAssetsTotalsChartBars, {
|
|
186
|
+
jobs: jobs
|
|
187
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
188
|
+
outline: true
|
|
189
|
+
}, /*#__PURE__*/React.createElement(BundleAssetsTotalsTable, {
|
|
190
|
+
jobs: jobs
|
|
191
|
+
})))))
|
|
200
192
|
}))));
|
|
201
193
|
};
|
|
202
194
|
|
|
@@ -214,6 +206,4 @@ AppComponent.propTypes = {
|
|
|
214
206
|
})),
|
|
215
207
|
version: PropTypes.string
|
|
216
208
|
};
|
|
217
|
-
export
|
|
218
|
-
return /*#__PURE__*/React.createElement(HashRouter, null, /*#__PURE__*/React.createElement(ScrollToTop, null), /*#__PURE__*/React.createElement(QueryStateProvider, null, /*#__PURE__*/React.createElement(AppComponent, props)));
|
|
219
|
-
};
|
|
209
|
+
export const App = props => /*#__PURE__*/React.createElement(HashRouter, null, /*#__PURE__*/React.createElement(ScrollToTop, null), /*#__PURE__*/React.createElement(QueryStateProvider, null, /*#__PURE__*/React.createElement(AppComponent, props)));
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
1
|
import React from 'react';
|
|
8
2
|
import { storiesOf } from '@storybook/react';
|
|
9
3
|
import { createJobs } from '@bundle-stats/utils';
|
|
@@ -16,79 +10,64 @@ import baselineData from '../../../../fixtures/job.baseline.json'; // eslint-dis
|
|
|
16
10
|
/* eslint-enable */
|
|
17
11
|
|
|
18
12
|
import { App } from '.';
|
|
19
|
-
|
|
20
|
-
webpack:
|
|
13
|
+
const CURRENT_SOURCE = {
|
|
14
|
+
webpack: {
|
|
21
15
|
builtAt: currentData.builtAt,
|
|
22
|
-
hash: currentData.hash
|
|
23
|
-
|
|
16
|
+
hash: currentData.hash,
|
|
17
|
+
...currentData.rawData.webpack
|
|
18
|
+
}
|
|
24
19
|
};
|
|
25
|
-
|
|
26
|
-
webpack:
|
|
20
|
+
const BASELINE_SOURCE = {
|
|
21
|
+
webpack: {
|
|
27
22
|
builtAt: baselineData.builtAt,
|
|
28
|
-
hash: baselineData.hash
|
|
29
|
-
|
|
23
|
+
hash: baselineData.hash,
|
|
24
|
+
...baselineData.rawData.webpack
|
|
25
|
+
}
|
|
30
26
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
webpack:
|
|
27
|
+
const JOBS = createJobs([CURRENT_SOURCE, BASELINE_SOURCE]);
|
|
28
|
+
const NO_BASELINE_JOBS = createJobs([CURRENT_SOURCE]);
|
|
29
|
+
const MULTIPLE_JOBS = createJobs([CURRENT_SOURCE, BASELINE_SOURCE, {
|
|
30
|
+
webpack: {
|
|
35
31
|
builtAt: baselineData.builtAt,
|
|
36
|
-
hash: 'aaaa1111'
|
|
37
|
-
|
|
38
|
-
assets: baselineData.rawData.webpack.assets.filter(
|
|
39
|
-
return asset.name.match(/.(css|js)$/);
|
|
40
|
-
}),
|
|
32
|
+
hash: 'aaaa1111',
|
|
33
|
+
...baselineData.rawData.webpack,
|
|
34
|
+
assets: baselineData.rawData.webpack.assets.filter(asset => asset.name.match(/.(css|js)$/)),
|
|
41
35
|
modules: baselineData.rawData.webpack.modules.slice(0, 100)
|
|
42
|
-
}
|
|
36
|
+
}
|
|
43
37
|
}]);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var EMPTY_BASELINE = createJobs([{
|
|
38
|
+
const [CURRENT_JOB, BASELINE_JOB] = JOBS;
|
|
39
|
+
const EMPTY_BASELINE = createJobs([{
|
|
47
40
|
webpack: currentData.rawData.webpack
|
|
48
41
|
}, {
|
|
49
42
|
webpack: null
|
|
50
43
|
}]);
|
|
51
|
-
|
|
52
|
-
stories.addDecorator(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
});
|
|
78
|
-
stories.add('empty
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
version: "1.0"
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
stories.add('multiple baselines', function () {
|
|
85
|
-
return /*#__PURE__*/React.createElement(App, {
|
|
86
|
-
jobs: MULTIPLE_JOBS,
|
|
87
|
-
version: "1.0"
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
stories.add('empty', function () {
|
|
91
|
-
return /*#__PURE__*/React.createElement(App, {
|
|
92
|
-
verison: "1.0"
|
|
93
|
-
});
|
|
94
|
-
});
|
|
44
|
+
const stories = storiesOf('App', module);
|
|
45
|
+
stories.addDecorator(storyFn => /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
style: {
|
|
47
|
+
margin: '-1rem'
|
|
48
|
+
}
|
|
49
|
+
}, storyFn()));
|
|
50
|
+
stories.add('default', () => /*#__PURE__*/React.createElement(App, {
|
|
51
|
+
jobs: [CURRENT_JOB, BASELINE_JOB],
|
|
52
|
+
version: "1.0"
|
|
53
|
+
}));
|
|
54
|
+
stories.add('no insights', () => /*#__PURE__*/React.createElement(App, {
|
|
55
|
+
jobs: [{ ...CURRENT_JOB,
|
|
56
|
+
insights: undefined
|
|
57
|
+
}, BASELINE_JOB]
|
|
58
|
+
}));
|
|
59
|
+
stories.add('no baseline', () => /*#__PURE__*/React.createElement(App, {
|
|
60
|
+
jobs: NO_BASELINE_JOBS,
|
|
61
|
+
version: "1.0"
|
|
62
|
+
}));
|
|
63
|
+
stories.add('empty baseline', () => /*#__PURE__*/React.createElement(App, {
|
|
64
|
+
jobs: EMPTY_BASELINE,
|
|
65
|
+
version: "1.0"
|
|
66
|
+
}));
|
|
67
|
+
stories.add('multiple baselines', () => /*#__PURE__*/React.createElement(App, {
|
|
68
|
+
jobs: MULTIPLE_JOBS,
|
|
69
|
+
version: "1.0"
|
|
70
|
+
}));
|
|
71
|
+
stories.add('empty', () => /*#__PURE__*/React.createElement(App, {
|
|
72
|
+
verison: "1.0"
|
|
73
|
+
}));
|
|
@@ -5,9 +5,11 @@ import { Container } from '../../ui/container';
|
|
|
5
5
|
import { JobsHeader } from '../../components/jobs-header';
|
|
6
6
|
import { Logo } from '../../ui/logo';
|
|
7
7
|
import css from './header.module.css';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export const Header = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
className,
|
|
11
|
+
jobs
|
|
12
|
+
} = _ref;
|
|
11
13
|
return /*#__PURE__*/React.createElement(Container, {
|
|
12
14
|
as: "header",
|
|
13
15
|
className: cx(css.root, className)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down"><line x1="12" y1="5" x2="12" y2="19"></line><polyline points="19 12 12 19 5 12"></polyline></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle"><circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit"><circle cx="12" cy="12" r="4"></circle><line x1="1.05" y1="12" x2="7" y2="12"></line><line x1="17.01" y1="12" x2="22.96" y2="12"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart" transform="rotate(-90deg)"><line x1="12" y1="20" x2="12" y2="10"></line><line x1="18" y1="20" x2="18" y2="4"></line><line x1="6" y1="20" x2="6" y2="16"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle"><circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-triangle"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="16" height="16"><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="afeather afeather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg"><path d="M12 5v14M19 12l-7 7-7-7"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="bfeather bfeather-x-circle" id="cancel" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M15 9l-6 6M9 9l6 6"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="cfeather cfeather-clock" id="clock" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="dfeather dfeather-x" id="close" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="efeather efeather-git-commit" id="commit" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="4"/><path d="M1.05 12H7M17.01 12h5.95"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="ffeather ffeather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg"><path d="M12 20V10M18 20V4M6 20v-4"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="gfeather gfeather-help-circle" id="help" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3M12 17h.01"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="hfeather hfeather-menu" id="menu" xmlns="http://www.w3.org/2000/svg"><path d="M3 12h18M3 6h18M3 18h18"/></symbol><symbol viewBox="0 0 24 24" fill="currentColor" id="sort" xmlns="http://www.w3.org/2000/svg"><path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/><path d="M0 0h24v24H0z" fill="none"/></symbol><symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="jfeather jfeather-alert-triangle" id="warning" xmlns="http://www.w3.org/2000/svg"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0zM12 9v4M12 17h.01"/></symbol></svg>
|
|
@@ -12,13 +12,15 @@ import { FileName } from '../../ui/file-name';
|
|
|
12
12
|
import { ComponentLink } from '../component-link';
|
|
13
13
|
import css from './asset-info.module.css';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const ChunkModulesLink = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
as: Component,
|
|
18
|
+
chunks,
|
|
19
|
+
chunkId,
|
|
20
|
+
name
|
|
21
|
+
} = _ref;
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
const chunk = _find(chunks, {
|
|
22
24
|
id: chunkId
|
|
23
25
|
});
|
|
24
26
|
|
|
@@ -26,9 +28,9 @@ var ChunkModulesLink = function ChunkModulesLink(_ref) {
|
|
|
26
28
|
return null;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
const chunkIds = _map(chunks, 'id');
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
const fileType = getModuleFileType(name);
|
|
32
34
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
33
35
|
className: css.viewModules
|
|
34
36
|
}, getBundleModulesByChunk(chunkIds, chunkId, fileType)), "View chunk modules");
|
|
@@ -46,18 +48,20 @@ ChunkModulesLink.defaultProps = {
|
|
|
46
48
|
chunkId: '',
|
|
47
49
|
name: ''
|
|
48
50
|
};
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
export const AssetInfo = props => {
|
|
52
|
+
const {
|
|
53
|
+
className,
|
|
54
|
+
chunks,
|
|
55
|
+
item,
|
|
56
|
+
labels,
|
|
57
|
+
CustomComponentLink
|
|
58
|
+
} = props;
|
|
55
59
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
56
60
|
space: "xsmall",
|
|
57
61
|
className: cx(css.root, className)
|
|
58
|
-
}, item.runs.map(
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
}, item.runs.map((run, index) => {
|
|
63
|
+
const Title = index !== 0 ? 'h4' : 'h3';
|
|
64
|
+
const key = `asset-info-${(run == null ? void 0 : run.name) || index}-${index}`;
|
|
61
65
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
62
66
|
space: "xxxsmall",
|
|
63
67
|
key: key
|