@bundle-stats/ui 4.12.1 → 4.13.0-beta.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/lib/app/app.js +3 -7
- package/lib/app/app.js.map +1 -1
- package/lib/assets/icons.svg +26 -20
- package/lib/assets/icons.svg.js +27 -23
- package/lib/assets/icons.svg.js.map +1 -1
- package/lib/components/bundle-assets/bundle-assets.js +11 -3
- package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib/components/bundle-assets/index.js +3 -4
- package/lib/components/bundle-assets/index.js.map +1 -1
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js +77 -0
- package/lib/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -0
- package/lib/components/bundle-assets-totals/bundle-assets-totals.module.css +7 -0
- package/lib/{ui/horizontal-bar-chart → components/bundle-assets-totals}/index.js +1 -1
- package/lib/components/bundle-assets-totals/index.js.map +1 -0
- package/lib/components/bundle-modules/bundle-modules.js +9 -2
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/index.js +3 -4
- package/lib/components/bundle-modules/index.js.map +1 -1
- package/lib/components/bundle-packages/bundle-packages.js +10 -2
- package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib/components/bundle-packages/index.js +3 -4
- package/lib/components/bundle-packages/index.js.map +1 -1
- package/lib/components/index.js +3 -5
- package/lib/components/index.js.map +1 -1
- package/lib/components/{bundle-assets-totals-table → metrics-display-selector}/index.js +1 -1
- package/lib/components/metrics-display-selector/index.js.map +1 -0
- package/lib/components/metrics-display-selector/metrics-display-selector.js +21 -0
- package/lib/components/metrics-display-selector/metrics-display-selector.js.map +1 -0
- package/lib/components/metrics-display-selector/metrics-display-selector.module.css +10 -0
- package/lib/components/{bundle-assets-totals-chart-bars → metrics-treemap}/index.js +1 -1
- package/lib/components/metrics-treemap/index.js.map +1 -0
- package/lib/components/metrics-treemap/metrics-treemap.js +168 -0
- package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -0
- package/lib/components/metrics-treemap/metrics-treemap.module.css +184 -0
- package/lib/constants.js +6 -1
- package/lib/constants.js.map +1 -1
- package/lib/hooks/entry-info.js +12 -0
- package/lib/hooks/entry-info.js.map +1 -0
- package/lib/hooks/metrics-display-type.js +40 -0
- package/lib/hooks/metrics-display-type.js.map +1 -0
- package/lib/query-state.js +1 -1
- package/lib/query-state.js.map +1 -1
- package/lib/ui/button/button.module.css +1 -0
- package/lib/ui/icon/icon.js +2 -0
- package/lib/ui/icon/icon.js.map +1 -1
- package/lib/ui/index.js +1 -3
- package/lib/ui/index.js.map +1 -1
- package/lib-esm/app/app.js +3 -7
- package/lib-esm/app/app.js.map +1 -1
- package/lib-esm/assets/icons.svg +26 -20
- package/lib-esm/assets/icons.svg.js +27 -23
- package/lib-esm/assets/icons.svg.js.map +1 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +11 -3
- package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
- package/lib-esm/components/bundle-assets/index.js +5 -6
- package/lib-esm/components/bundle-assets/index.js.map +1 -1
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js +47 -0
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.js.map +1 -0
- package/lib-esm/components/bundle-assets-totals/bundle-assets-totals.module.css +7 -0
- package/lib-esm/components/bundle-assets-totals/index.js +2 -0
- package/lib-esm/components/bundle-assets-totals/index.js.map +1 -0
- package/lib-esm/components/bundle-modules/bundle-modules.js +9 -2
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-modules/index.js +3 -4
- package/lib-esm/components/bundle-modules/index.js.map +1 -1
- package/lib-esm/components/bundle-packages/bundle-packages.js +10 -2
- package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
- package/lib-esm/components/bundle-packages/index.js +5 -6
- package/lib-esm/components/bundle-packages/index.js.map +1 -1
- package/lib-esm/components/index.js +1 -2
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/metrics-display-selector/index.js +2 -0
- package/lib-esm/components/metrics-display-selector/index.js.map +1 -0
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.js +14 -0
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.js.map +1 -0
- package/lib-esm/components/metrics-display-selector/metrics-display-selector.module.css +10 -0
- package/lib-esm/components/metrics-treemap/index.js +2 -0
- package/lib-esm/components/metrics-treemap/index.js.map +1 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.js +140 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -0
- package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +184 -0
- package/lib-esm/constants.js +5 -0
- package/lib-esm/constants.js.map +1 -1
- package/lib-esm/hooks/entry-info.js +8 -0
- package/lib-esm/hooks/entry-info.js.map +1 -0
- package/lib-esm/hooks/metrics-display-type.js +36 -0
- package/lib-esm/hooks/metrics-display-type.js.map +1 -0
- package/lib-esm/query-state.js +1 -1
- package/lib-esm/query-state.js.map +1 -1
- package/lib-esm/ui/button/button.module.css +1 -0
- package/lib-esm/ui/icon/icon.js +2 -0
- package/lib-esm/ui/icon/icon.js.map +1 -1
- package/lib-esm/ui/index.js +0 -1
- package/lib-esm/ui/index.js.map +1 -1
- package/package.json +7 -4
- package/src/app/app.jsx +4 -8
- package/src/assets/icons/table.svg +3 -0
- package/src/assets/icons/treemap.svg +4 -0
- package/src/assets/icons.svg +26 -20
- package/src/assets/icons.svg.jsx +91 -55
- package/src/components/bundle-assets/bundle-assets.jsx +25 -11
- package/src/components/bundle-assets/index.jsx +10 -5
- package/src/components/bundle-assets-totals/bundle-assets-totals.jsx +94 -0
- package/src/components/bundle-assets-totals/bundle-assets-totals.module.css +7 -0
- package/src/components/bundle-assets-totals/index.js +1 -0
- package/src/components/bundle-modules/bundle-modules.tsx +26 -12
- package/src/components/bundle-modules/index.tsx +4 -3
- package/src/components/bundle-packages/bundle-packages.jsx +24 -10
- package/src/components/bundle-packages/index.jsx +10 -5
- package/src/components/index.js +1 -2
- package/src/components/metrics-display-selector/index.tsx +1 -0
- package/src/components/metrics-display-selector/metrics-display-selector.module.css +10 -0
- package/src/components/metrics-display-selector/metrics-display-selector.tsx +47 -0
- package/src/components/metrics-treemap/index.ts +1 -0
- package/src/components/metrics-treemap/metrics-treemap.module.css +184 -0
- package/src/components/metrics-treemap/metrics-treemap.stories.tsx +23 -0
- package/src/components/metrics-treemap/metrics-treemap.tsx +308 -0
- package/src/{constants.js → constants.ts} +5 -0
- package/src/hooks/entry-info.ts +19 -0
- package/src/hooks/metrics-display-type.ts +56 -0
- package/src/query-state.tsx +1 -1
- package/src/types.d.ts +2 -0
- package/src/ui/button/button.module.css +1 -0
- package/src/ui/icon/icon.tsx +2 -0
- package/src/ui/index.js +0 -1
- package/types/components/bundle-assets/bundle-assets.d.ts +2 -1
- package/types/components/{bundle-assets-totals-table/bundle-assets-totals-table.d.ts → bundle-assets-totals/bundle-assets-totals.d.ts} +2 -2
- package/types/components/bundle-assets-totals/index.d.ts +1 -0
- package/types/components/bundle-modules/bundle-modules.d.ts +2 -1
- package/types/components/bundle-modules/index.d.ts +1 -1
- package/types/components/bundle-packages/bundle-packages.d.ts +1 -0
- package/types/components/index.d.ts +1 -2
- package/types/components/metrics-display-selector/index.d.ts +1 -0
- package/types/components/metrics-display-selector/metrics-display-selector.d.ts +9 -0
- package/types/components/metrics-treemap/index.d.ts +1 -0
- package/types/components/metrics-treemap/metrics-treemap.d.ts +9 -0
- package/types/constants.d.ts +19 -15
- package/types/hooks/entry-info.d.ts +8 -0
- package/types/hooks/metrics-display-type.d.ts +4 -0
- package/types/ui/icon/icon.d.ts +4 -0
- package/types/ui/index.d.ts +0 -1
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +0 -95
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js.map +0 -1
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.module.css +0 -42
- package/lib/components/bundle-assets-totals-chart-bars/index.js.map +0 -1
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +0 -57
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js.map +0 -1
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +0 -3
- package/lib/components/bundle-assets-totals-table/index.js.map +0 -1
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +0 -102
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js.map +0 -1
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.module.css +0 -42
- package/lib/ui/horizontal-bar-chart/index.js.map +0 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +0 -66
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js.map +0 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.module.css +0 -42
- package/lib-esm/components/bundle-assets-totals-chart-bars/index.js +0 -2
- package/lib-esm/components/bundle-assets-totals-chart-bars/index.js.map +0 -1
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +0 -27
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js.map +0 -1
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +0 -3
- package/lib-esm/components/bundle-assets-totals-table/index.js +0 -2
- package/lib-esm/components/bundle-assets-totals-table/index.js.map +0 -1
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +0 -96
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js.map +0 -1
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.module.css +0 -42
- package/lib-esm/ui/horizontal-bar-chart/index.js +0 -2
- package/lib-esm/ui/horizontal-bar-chart/index.js.map +0 -1
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.jsx +0 -106
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.module.css +0 -42
- package/src/components/bundle-assets-totals-chart-bars/index.js +0 -1
- package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.jsx +0 -55
- package/src/components/bundle-assets-totals-table/bundle-assets-totals-table.module.css +0 -3
- package/src/components/bundle-assets-totals-table/index.js +0 -1
- package/src/ui/horizontal-bar-chart/horizontal-bar-chart.jsx +0 -156
- package/src/ui/horizontal-bar-chart/horizontal-bar-chart.module.css +0 -42
- package/src/ui/horizontal-bar-chart/index.js +0 -1
- package/types/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.d.ts +0 -22
- package/types/components/bundle-assets-totals-chart-bars/index.d.ts +0 -1
- package/types/components/bundle-assets-totals-table/index.d.ts +0 -1
- package/types/ui/horizontal-bar-chart/horizontal-bar-chart.d.ts +0 -23
- package/types/ui/horizontal-bar-chart/index.d.ts +0 -1
package/src/assets/icons.svg
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<svg width="0" height="0" style="position:absolute">
|
|
2
|
-
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="arrow" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-down" id="arrow" xmlns="http://www.w3.org/2000/svg">
|
|
3
3
|
<path d="M12 5v14M19 12l-7 7-7-7"/>
|
|
4
4
|
</symbol>
|
|
5
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="arrow-right-circle" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right-circle" viewBox="0 0 24 24" id="arrow-right-circle" xmlns="http://www.w3.org/2000/svg">
|
|
6
6
|
<circle cx="12" cy="12" r="10"/>
|
|
7
|
-
<path d="
|
|
7
|
+
<path d="m12 16 4-4-4-4M8 12h8"/>
|
|
8
8
|
</symbol>
|
|
9
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="chevron-down" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
-
<path d="
|
|
9
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-down" viewBox="0 0 24 24" id="chevron-down" xmlns="http://www.w3.org/2000/svg">
|
|
10
|
+
<path d="m6 9 6 6 6-6"/>
|
|
11
11
|
</symbol>
|
|
12
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="chevron-up" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<path d="
|
|
12
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-up" viewBox="0 0 24 24" id="chevron-up" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
+
<path d="m18 15-6-6-6 6"/>
|
|
14
14
|
</symbol>
|
|
15
|
-
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="clock" xmlns="http://www.w3.org/2000/svg">
|
|
15
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock" id="clock" xmlns="http://www.w3.org/2000/svg">
|
|
16
16
|
<circle cx="12" cy="12" r="10"/>
|
|
17
17
|
<path d="M12 6v6l4 2"/>
|
|
18
18
|
</symbol>
|
|
19
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="close" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x-circle" viewBox="0 0 24 24" id="close" xmlns="http://www.w3.org/2000/svg">
|
|
20
20
|
<circle cx="12" cy="12" r="10"/>
|
|
21
|
-
<path d="
|
|
21
|
+
<path d="m15 9-6 6M9 9l6 6"/>
|
|
22
22
|
</symbol>
|
|
23
|
-
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="commit" xmlns="http://www.w3.org/2000/svg">
|
|
23
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-git-commit" id="commit" xmlns="http://www.w3.org/2000/svg">
|
|
24
24
|
<circle cx="12" cy="12" r="4"/>
|
|
25
25
|
<path d="M1.05 12H7M17.01 12h5.95"/>
|
|
26
26
|
</symbol>
|
|
@@ -28,24 +28,24 @@
|
|
|
28
28
|
<circle cx="12" cy="12" r="10"/>
|
|
29
29
|
<path d="M12 8v4M12 16h.01"/>
|
|
30
30
|
</symbol>
|
|
31
|
-
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="external-link" xmlns="http://www.w3.org/2000/svg">
|
|
32
|
-
<path d="M18 13v6a2 2 0
|
|
31
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link" viewBox="0 0 24 24" id="external-link" xmlns="http://www.w3.org/2000/svg">
|
|
32
|
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14 21 3"/>
|
|
33
33
|
</symbol>
|
|
34
|
-
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="filter" xmlns="http://www.w3.org/2000/svg">
|
|
34
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bar-chart" id="filter" xmlns="http://www.w3.org/2000/svg">
|
|
35
35
|
<path d="M12 20V10M18 20V4M6 20v-4"/>
|
|
36
36
|
</symbol>
|
|
37
37
|
<symbol viewBox="0 0 98 96" id="github" xmlns="http://www.w3.org/2000/svg">
|
|
38
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0
|
|
38
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="currentColor"/>
|
|
39
39
|
</symbol>
|
|
40
|
-
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="help" xmlns="http://www.w3.org/2000/svg">
|
|
40
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-help-circle" id="help" xmlns="http://www.w3.org/2000/svg">
|
|
41
41
|
<circle cx="12" cy="12" r="10"/>
|
|
42
|
-
<path d="M9.09 9a3 3 0
|
|
42
|
+
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01"/>
|
|
43
43
|
</symbol>
|
|
44
44
|
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="info" xmlns="http://www.w3.org/2000/svg">
|
|
45
45
|
<circle cx="12" cy="12" r="10"/>
|
|
46
46
|
<path d="M12 16v-4M12 8h.01"/>
|
|
47
47
|
</symbol>
|
|
48
|
-
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" id="menu" xmlns="http://www.w3.org/2000/svg">
|
|
48
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu" id="menu" xmlns="http://www.w3.org/2000/svg">
|
|
49
49
|
<path d="M3 12h18M3 6h18M3 18h18"/>
|
|
50
50
|
</symbol>
|
|
51
51
|
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="more-vertical" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -57,7 +57,13 @@
|
|
|
57
57
|
<path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"/>
|
|
58
58
|
<path d="M0 0h24v24H0z" fill="none"/>
|
|
59
59
|
</symbol>
|
|
60
|
-
<symbol
|
|
61
|
-
<path d="
|
|
60
|
+
<symbol fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24" id="table" xmlns="http://www.w3.org/2000/svg">
|
|
61
|
+
<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"/>
|
|
62
|
+
</symbol>
|
|
63
|
+
<symbol fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" id="treemap" xmlns="http://www.w3.org/2000/svg">
|
|
64
|
+
<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 21h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9M12.025 3.422 12 20.652ZM12.85 9l7.347.025zm-.153 6 7.576.025zm4.334.764L17 20.326Z"/>
|
|
65
|
+
</symbol>
|
|
66
|
+
<symbol viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-alert-triangle" id="warning" xmlns="http://www.w3.org/2000/svg">
|
|
67
|
+
<path d="M10.29 3.86 1.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 0zM12 9v4M12 17h.01"/>
|
|
62
68
|
</symbol>
|
|
63
69
|
</svg>
|
package/src/assets/icons.svg.jsx
CHANGED
|
@@ -6,9 +6,10 @@ export const SvgIcons = (props) => (
|
|
|
6
6
|
viewBox="0 0 24 24"
|
|
7
7
|
fill="none"
|
|
8
8
|
stroke="currentColor"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
strokeWidth="2"
|
|
10
|
+
strokeLinecap="round"
|
|
11
|
+
strokeLinejoin="round"
|
|
12
|
+
className="feather feather-arrow-down"
|
|
12
13
|
id="arrow"
|
|
13
14
|
xmlns="http://www.w3.org/2000/svg"
|
|
14
15
|
>
|
|
@@ -17,47 +18,51 @@ export const SvgIcons = (props) => (
|
|
|
17
18
|
<symbol
|
|
18
19
|
fill="none"
|
|
19
20
|
stroke="currentColor"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
strokeWidth="2"
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"
|
|
24
|
+
className="feather feather-arrow-right-circle"
|
|
23
25
|
viewBox="0 0 24 24"
|
|
24
26
|
id="arrow-right-circle"
|
|
25
27
|
xmlns="http://www.w3.org/2000/svg"
|
|
26
28
|
>
|
|
27
29
|
<circle cx="12" cy="12" r="10" />
|
|
28
|
-
<path d="
|
|
30
|
+
<path d="m12 16 4-4-4-4M8 12h8" />
|
|
29
31
|
</symbol>
|
|
30
32
|
<symbol
|
|
31
33
|
fill="none"
|
|
32
34
|
stroke="currentColor"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
strokeWidth="2"
|
|
36
|
+
strokeLinecap="round"
|
|
37
|
+
strokeLinejoin="round"
|
|
38
|
+
className="lucide lucide-chevron-down"
|
|
36
39
|
viewBox="0 0 24 24"
|
|
37
40
|
id="chevron-down"
|
|
38
41
|
xmlns="http://www.w3.org/2000/svg"
|
|
39
42
|
>
|
|
40
|
-
<path d="
|
|
43
|
+
<path d="m6 9 6 6 6-6" />
|
|
41
44
|
</symbol>
|
|
42
45
|
<symbol
|
|
43
46
|
fill="none"
|
|
44
47
|
stroke="currentColor"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
strokeWidth="2"
|
|
49
|
+
strokeLinecap="round"
|
|
50
|
+
strokeLinejoin="round"
|
|
51
|
+
className="lucide lucide-chevron-up"
|
|
48
52
|
viewBox="0 0 24 24"
|
|
49
53
|
id="chevron-up"
|
|
50
54
|
xmlns="http://www.w3.org/2000/svg"
|
|
51
55
|
>
|
|
52
|
-
<path d="
|
|
56
|
+
<path d="m18 15-6-6-6 6" />
|
|
53
57
|
</symbol>
|
|
54
58
|
<symbol
|
|
55
59
|
viewBox="0 0 24 24"
|
|
56
60
|
fill="none"
|
|
57
61
|
stroke="currentColor"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
strokeWidth="2"
|
|
63
|
+
strokeLinecap="round"
|
|
64
|
+
strokeLinejoin="round"
|
|
65
|
+
className="feather feather-clock"
|
|
61
66
|
id="clock"
|
|
62
67
|
xmlns="http://www.w3.org/2000/svg"
|
|
63
68
|
>
|
|
@@ -67,23 +72,25 @@ export const SvgIcons = (props) => (
|
|
|
67
72
|
<symbol
|
|
68
73
|
fill="none"
|
|
69
74
|
stroke="currentColor"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
strokeWidth="2"
|
|
76
|
+
strokeLinecap="round"
|
|
77
|
+
strokeLinejoin="round"
|
|
78
|
+
className="feather feather-x-circle"
|
|
73
79
|
viewBox="0 0 24 24"
|
|
74
80
|
id="close"
|
|
75
81
|
xmlns="http://www.w3.org/2000/svg"
|
|
76
82
|
>
|
|
77
83
|
<circle cx="12" cy="12" r="10" />
|
|
78
|
-
<path d="
|
|
84
|
+
<path d="m15 9-6 6M9 9l6 6" />
|
|
79
85
|
</symbol>
|
|
80
86
|
<symbol
|
|
81
87
|
viewBox="0 0 24 24"
|
|
82
88
|
fill="none"
|
|
83
89
|
stroke="currentColor"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
strokeWidth="2"
|
|
91
|
+
strokeLinecap="round"
|
|
92
|
+
strokeLinejoin="round"
|
|
93
|
+
className="feather feather-git-commit"
|
|
87
94
|
id="commit"
|
|
88
95
|
xmlns="http://www.w3.org/2000/svg"
|
|
89
96
|
>
|
|
@@ -93,9 +100,9 @@ export const SvgIcons = (props) => (
|
|
|
93
100
|
<symbol
|
|
94
101
|
fill="none"
|
|
95
102
|
stroke="currentColor"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
103
|
+
strokeWidth="2"
|
|
104
|
+
strokeLinecap="round"
|
|
105
|
+
strokeLinejoin="round"
|
|
99
106
|
viewBox="0 0 24 24"
|
|
100
107
|
id="error"
|
|
101
108
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -106,22 +113,24 @@ export const SvgIcons = (props) => (
|
|
|
106
113
|
<symbol
|
|
107
114
|
fill="none"
|
|
108
115
|
stroke="currentColor"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
strokeWidth="2"
|
|
117
|
+
strokeLinecap="round"
|
|
118
|
+
strokeLinejoin="round"
|
|
119
|
+
className="feather feather-external-link"
|
|
112
120
|
viewBox="0 0 24 24"
|
|
113
121
|
id="external-link"
|
|
114
122
|
xmlns="http://www.w3.org/2000/svg"
|
|
115
123
|
>
|
|
116
|
-
<path d="M18 13v6a2 2 0
|
|
124
|
+
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6M15 3h6v6M10 14 21 3" />
|
|
117
125
|
</symbol>
|
|
118
126
|
<symbol
|
|
119
127
|
viewBox="0 0 24 24"
|
|
120
128
|
fill="none"
|
|
121
129
|
stroke="currentColor"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
strokeWidth="2"
|
|
131
|
+
strokeLinecap="round"
|
|
132
|
+
strokeLinejoin="round"
|
|
133
|
+
className="feather feather-bar-chart"
|
|
125
134
|
id="filter"
|
|
126
135
|
xmlns="http://www.w3.org/2000/svg"
|
|
127
136
|
>
|
|
@@ -129,9 +138,9 @@ export const SvgIcons = (props) => (
|
|
|
129
138
|
</symbol>
|
|
130
139
|
<symbol viewBox="0 0 98 96" id="github" xmlns="http://www.w3.org/2000/svg">
|
|
131
140
|
<path
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0
|
|
141
|
+
fillRule="evenodd"
|
|
142
|
+
clipRule="evenodd"
|
|
143
|
+
d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"
|
|
135
144
|
fill="currentColor"
|
|
136
145
|
/>
|
|
137
146
|
</symbol>
|
|
@@ -139,21 +148,22 @@ export const SvgIcons = (props) => (
|
|
|
139
148
|
viewBox="0 0 24 24"
|
|
140
149
|
fill="none"
|
|
141
150
|
stroke="currentColor"
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
151
|
+
strokeWidth="2"
|
|
152
|
+
strokeLinecap="round"
|
|
153
|
+
strokeLinejoin="round"
|
|
154
|
+
className="feather feather-help-circle"
|
|
145
155
|
id="help"
|
|
146
156
|
xmlns="http://www.w3.org/2000/svg"
|
|
147
157
|
>
|
|
148
158
|
<circle cx="12" cy="12" r="10" />
|
|
149
|
-
<path d="M9.09 9a3 3 0
|
|
159
|
+
<path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01" />
|
|
150
160
|
</symbol>
|
|
151
161
|
<symbol
|
|
152
162
|
fill="none"
|
|
153
163
|
stroke="currentColor"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
strokeWidth="2"
|
|
165
|
+
strokeLinecap="round"
|
|
166
|
+
strokeLinejoin="round"
|
|
157
167
|
viewBox="0 0 24 24"
|
|
158
168
|
id="info"
|
|
159
169
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -165,9 +175,10 @@ export const SvgIcons = (props) => (
|
|
|
165
175
|
viewBox="0 0 24 24"
|
|
166
176
|
fill="none"
|
|
167
177
|
stroke="currentColor"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
178
|
+
strokeWidth="2"
|
|
179
|
+
strokeLinecap="round"
|
|
180
|
+
strokeLinejoin="round"
|
|
181
|
+
className="feather feather-menu"
|
|
171
182
|
id="menu"
|
|
172
183
|
xmlns="http://www.w3.org/2000/svg"
|
|
173
184
|
>
|
|
@@ -176,9 +187,9 @@ export const SvgIcons = (props) => (
|
|
|
176
187
|
<symbol
|
|
177
188
|
fill="none"
|
|
178
189
|
stroke="currentColor"
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
190
|
+
strokeWidth="2"
|
|
191
|
+
strokeLinecap="round"
|
|
192
|
+
strokeLinejoin="round"
|
|
182
193
|
viewBox="0 0 24 24"
|
|
183
194
|
id="more-vertical"
|
|
184
195
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -191,17 +202,42 @@ export const SvgIcons = (props) => (
|
|
|
191
202
|
<path d="M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z" />
|
|
192
203
|
<path d="M0 0h24v24H0z" fill="none" />
|
|
193
204
|
</symbol>
|
|
205
|
+
<symbol
|
|
206
|
+
fill="none"
|
|
207
|
+
stroke="currentColor"
|
|
208
|
+
strokeWidth="2"
|
|
209
|
+
strokeLinecap="round"
|
|
210
|
+
strokeLinejoin="round"
|
|
211
|
+
viewBox="0 0 24 24"
|
|
212
|
+
id="table"
|
|
213
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
214
|
+
>
|
|
215
|
+
<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18" />
|
|
216
|
+
</symbol>
|
|
217
|
+
<symbol
|
|
218
|
+
fill="none"
|
|
219
|
+
stroke="currentColor"
|
|
220
|
+
strokeLinecap="round"
|
|
221
|
+
strokeLinejoin="round"
|
|
222
|
+
strokeWidth="2"
|
|
223
|
+
viewBox="0 0 24 24"
|
|
224
|
+
id="treemap"
|
|
225
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
226
|
+
>
|
|
227
|
+
<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 21h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9M12.025 3.422 12 20.652ZM12.85 9l7.347.025zm-.153 6 7.576.025zm4.334.764L17 20.326Z" />
|
|
228
|
+
</symbol>
|
|
194
229
|
<symbol
|
|
195
230
|
viewBox="0 0 24 24"
|
|
196
231
|
fill="none"
|
|
197
232
|
stroke="currentColor"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
233
|
+
strokeWidth="2"
|
|
234
|
+
strokeLinecap="round"
|
|
235
|
+
strokeLinejoin="round"
|
|
236
|
+
className="feather feather-alert-triangle"
|
|
201
237
|
id="warning"
|
|
202
238
|
xmlns="http://www.w3.org/2000/svg"
|
|
203
239
|
>
|
|
204
|
-
<path d="M10.29 3.
|
|
240
|
+
<path d="M10.29 3.86 1.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 0zM12 9v4M12 17h.01" />
|
|
205
241
|
</symbol>
|
|
206
242
|
</svg>
|
|
207
243
|
);
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import config from '../../config.json';
|
|
15
15
|
import I18N from '../../i18n';
|
|
16
|
+
import { MetricsDisplayType } from '../../constants';
|
|
17
|
+
import { useMetricsDisplayType } from '../../hooks/metrics-display-type';
|
|
16
18
|
import { FlexStack } from '../../layout/flex-stack';
|
|
17
19
|
import { Icon } from '../../ui/icon';
|
|
18
20
|
import { InputSearch } from '../../ui/input-search';
|
|
@@ -29,6 +31,8 @@ import { MetricsTable } from '../metrics-table';
|
|
|
29
31
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
30
32
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
31
33
|
import { SEARCH_PLACEHOLDER } from './bundle-assets.i18n';
|
|
34
|
+
import { MetricsDisplaySelector } from '../metrics-display-selector';
|
|
35
|
+
import { MetricsTreemap } from '../metrics-treemap';
|
|
32
36
|
import css from './bundle-assets.module.css';
|
|
33
37
|
|
|
34
38
|
const RUN_TITLE_CURRENT = 'Current';
|
|
@@ -174,10 +178,13 @@ export const BundleAssets = (props) => {
|
|
|
174
178
|
updateSearch,
|
|
175
179
|
customComponentLink: CustomComponentLink,
|
|
176
180
|
hideEntryInfo,
|
|
181
|
+
showEntryInfo,
|
|
177
182
|
} = props;
|
|
178
183
|
|
|
179
184
|
const jobLabels = jobs?.map((job) => job?.label);
|
|
180
185
|
|
|
186
|
+
const [displayType, setDisplayType] = useMetricsDisplayType();
|
|
187
|
+
|
|
181
188
|
const dropdownFilters = useMemo(
|
|
182
189
|
() => getFilters({ compareMode: jobs?.length > 1, filters }),
|
|
183
190
|
[jobs, filters],
|
|
@@ -228,6 +235,7 @@ export const BundleAssets = (props) => {
|
|
|
228
235
|
className={css.toolbar}
|
|
229
236
|
renderActions={({ actionClassName }) => (
|
|
230
237
|
<FlexStack space="xxsmall" className={cx(css.dropdown, actionClassName)}>
|
|
238
|
+
<MetricsDisplaySelector onSelect={setDisplayType} value={displayType} />
|
|
231
239
|
<MetricsTableOptions
|
|
232
240
|
handleViewAll={resetAllFilters}
|
|
233
241
|
handleResetFilters={resetFilters}
|
|
@@ -251,16 +259,21 @@ export const BundleAssets = (props) => {
|
|
|
251
259
|
</FlexStack>
|
|
252
260
|
</Toolbar>
|
|
253
261
|
<main>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
{displayType === MetricsDisplayType.TABLE && (
|
|
263
|
+
<MetricsTable
|
|
264
|
+
runs={jobs}
|
|
265
|
+
items={items}
|
|
266
|
+
renderRowHeader={renderRowHeader}
|
|
267
|
+
emptyMessage={emptyMessage}
|
|
268
|
+
showHeaderSum
|
|
269
|
+
title={metricsTableTitle}
|
|
270
|
+
sort={sort}
|
|
271
|
+
updateSort={updateSort}
|
|
272
|
+
/>
|
|
273
|
+
)}
|
|
274
|
+
{displayType === MetricsDisplayType.TREEMAP && (
|
|
275
|
+
<MetricsTreemap emptyMessage={emptyMessage} items={items} onItemClick={showEntryInfo} />
|
|
276
|
+
)}
|
|
264
277
|
</main>
|
|
265
278
|
</section>
|
|
266
279
|
|
|
@@ -330,7 +343,8 @@ BundleAssets.propTypes = {
|
|
|
330
343
|
updateSort: PropTypes.func.isRequired,
|
|
331
344
|
allItems: PropTypes.arrayOf(PropTypes.shape({
|
|
332
345
|
key: PropTypes.string,
|
|
333
|
-
})),
|
|
346
|
+
})).isRequired,
|
|
334
347
|
customComponentLink: PropTypes.elementType,
|
|
335
348
|
hideEntryInfo: PropTypes.func.isRequired,
|
|
349
|
+
showEntryInfo: PropTypes.func.isRequired,
|
|
336
350
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import * as webpack from '@bundle-stats/utils/lib-esm/webpack';
|
|
4
4
|
import { ASSET_FILTERS } from '@bundle-stats/utils';
|
|
@@ -10,8 +10,14 @@ import {
|
|
|
10
10
|
import { useRowsFilter } from '../../hooks/rows-filter';
|
|
11
11
|
import { useRowsSort } from '../../hooks/rows-sort';
|
|
12
12
|
import { useSearchParams } from '../../hooks/search-params';
|
|
13
|
+
import { useEntryInfo } from '../../hooks/entry-info';
|
|
13
14
|
import { BundleAssets as BundleAssetsComponent } from './bundle-assets';
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
addRowAssetFlags,
|
|
17
|
+
addRowIsNotPredictive,
|
|
18
|
+
getRowFilter,
|
|
19
|
+
getCustomSort,
|
|
20
|
+
} from './bundle-assets.utils';
|
|
15
21
|
|
|
16
22
|
export const BundleAssets = (props) => {
|
|
17
23
|
const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
|
|
@@ -59,9 +65,7 @@ export const BundleAssets = (props) => {
|
|
|
59
65
|
getCustomSort,
|
|
60
66
|
});
|
|
61
67
|
|
|
62
|
-
const hideEntryInfo =
|
|
63
|
-
setState({ entryId: '' });
|
|
64
|
-
}, [setState]);
|
|
68
|
+
const [hideEntryInfo, showEntryInfo] = useEntryInfo({ setState });
|
|
65
69
|
|
|
66
70
|
return (
|
|
67
71
|
<BundleAssetsComponent
|
|
@@ -72,6 +76,7 @@ export const BundleAssets = (props) => {
|
|
|
72
76
|
allItems={rows}
|
|
73
77
|
totalRowCount={totalRowCount}
|
|
74
78
|
hideEntryInfo={hideEntryInfo}
|
|
79
|
+
showEntryInfo={showEntryInfo}
|
|
75
80
|
/>
|
|
76
81
|
);
|
|
77
82
|
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useHistory } from 'react-router-dom';
|
|
4
|
+
import {
|
|
5
|
+
getBundleAssetsFileTypeComponentLink,
|
|
6
|
+
getComponentStateQueryString,
|
|
7
|
+
} from '@bundle-stats/utils';
|
|
8
|
+
import * as webpack from '@bundle-stats/utils/lib-esm/webpack';
|
|
9
|
+
|
|
10
|
+
import { ASSETS_SIZES_FILE_TYPE_MAP, SECTION_URLS, MetricsDisplayType } from '../../constants';
|
|
11
|
+
import { useMetricsDisplayType } from '../../hooks/metrics-display-type';
|
|
12
|
+
import { Toolbar } from '../../ui/toolbar';
|
|
13
|
+
import { MetricsTreemap } from '../metrics-treemap';
|
|
14
|
+
import { MetricsDisplaySelector } from '../metrics-display-selector';
|
|
15
|
+
import { TotalSizeTypeTitle } from '../total-size-type-title';
|
|
16
|
+
import { MetricsTable } from '../metrics-table';
|
|
17
|
+
import { ComponentLink } from '../component-link';
|
|
18
|
+
import css from './bundle-assets-totals.module.css';
|
|
19
|
+
|
|
20
|
+
export const BundleAssetsTotals = ({
|
|
21
|
+
className,
|
|
22
|
+
jobs,
|
|
23
|
+
customComponentLink: CustomComponentLink,
|
|
24
|
+
...restProps
|
|
25
|
+
}) => {
|
|
26
|
+
const [displayType, setDisplayType] = useMetricsDisplayType();
|
|
27
|
+
const history = useHistory();
|
|
28
|
+
|
|
29
|
+
const items = webpack.compareBySection.sizes(jobs);
|
|
30
|
+
|
|
31
|
+
const renderRowHeader = (item) => {
|
|
32
|
+
const fileType = ASSETS_SIZES_FILE_TYPE_MAP[item.key];
|
|
33
|
+
const { section, title, params } = getBundleAssetsFileTypeComponentLink(fileType, item.label);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<CustomComponentLink section={section} title={title} params={params}>
|
|
37
|
+
{item.label}
|
|
38
|
+
</CustomComponentLink>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleMetricsTreemapItemClick = useCallback(
|
|
43
|
+
(entryId) => {
|
|
44
|
+
const fileType = ASSETS_SIZES_FILE_TYPE_MAP[entryId];
|
|
45
|
+
const { section, params } = getBundleAssetsFileTypeComponentLink(fileType, '');
|
|
46
|
+
const search = getComponentStateQueryString(params);
|
|
47
|
+
const nextUrl = `${SECTION_URLS[section]}?${search}`;
|
|
48
|
+
|
|
49
|
+
history.push(nextUrl);
|
|
50
|
+
},
|
|
51
|
+
[history],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className={className}>
|
|
56
|
+
<Toolbar
|
|
57
|
+
className={css.toolbar}
|
|
58
|
+
renderActions={() => (
|
|
59
|
+
<MetricsDisplaySelector onSelect={setDisplayType} value={displayType} />
|
|
60
|
+
)}
|
|
61
|
+
>
|
|
62
|
+
<TotalSizeTypeTitle />
|
|
63
|
+
</Toolbar>
|
|
64
|
+
{displayType === MetricsDisplayType.TABLE && (
|
|
65
|
+
<MetricsTable
|
|
66
|
+
runs={jobs}
|
|
67
|
+
items={items}
|
|
68
|
+
renderRowHeader={renderRowHeader}
|
|
69
|
+
showHeaderSum
|
|
70
|
+
{...restProps}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
{displayType === MetricsDisplayType.TREEMAP && (
|
|
74
|
+
<MetricsTreemap items={items} onItemClick={handleMetricsTreemapItemClick} />
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
BundleAssetsTotals.defaultProps = {
|
|
81
|
+
className: '',
|
|
82
|
+
jobs: [],
|
|
83
|
+
customComponentLink: ComponentLink,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
BundleAssetsTotals.propTypes = {
|
|
87
|
+
/** Addopted child class name */
|
|
88
|
+
className: PropTypes.string,
|
|
89
|
+
|
|
90
|
+
/** Jobs data */
|
|
91
|
+
jobs: PropTypes.array, // eslint-disable-line react/forbid-prop-types
|
|
92
|
+
|
|
93
|
+
customComponentLink: PropTypes.elementType,
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bundle-assets-totals';
|