@bundle-stats/ui 4.13.0-rc.0 → 4.13.0-rc.1

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.
Files changed (86) hide show
  1. package/lib/components/bundle-assets/bundle-assets.js +23 -22
  2. package/lib/components/bundle-assets/bundle-assets.js.map +1 -1
  3. package/lib/components/bundle-assets/index.js +3 -1
  4. package/lib/components/bundle-assets/index.js.map +1 -1
  5. package/lib/components/bundle-modules/bundle-modules.js +10 -6
  6. package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
  7. package/lib/components/bundle-modules/bundle-modules.utils.js +2 -13
  8. package/lib/components/bundle-modules/bundle-modules.utils.js.map +1 -1
  9. package/lib/components/bundle-modules/index.js +2 -1
  10. package/lib/components/bundle-modules/index.js.map +1 -1
  11. package/lib/components/bundle-packages/bundle-packages.js +11 -6
  12. package/lib/components/bundle-packages/bundle-packages.js.map +1 -1
  13. package/lib/components/metrics-treemap/metrics-treemap.constants.js +7 -0
  14. package/lib/components/metrics-treemap/metrics-treemap.constants.js.map +1 -1
  15. package/lib/components/metrics-treemap/metrics-treemap.js +69 -71
  16. package/lib/components/metrics-treemap/metrics-treemap.js.map +1 -1
  17. package/lib/components/metrics-treemap/metrics-treemap.module.css +47 -10
  18. package/lib/components/metrics-treemap/metrics-treemap.utils.js +60 -1
  19. package/lib/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
  20. package/lib/utils/colors.js +22 -0
  21. package/lib/utils/colors.js.map +1 -0
  22. package/lib/{utils.js → utils/components.js} +2 -17
  23. package/lib/utils/components.js.map +1 -0
  24. package/lib/utils/index.js +20 -0
  25. package/lib/utils/index.js.map +1 -0
  26. package/lib/utils/jobs.js +18 -0
  27. package/lib/utils/jobs.js.map +1 -0
  28. package/lib-esm/components/bundle-assets/bundle-assets.js +23 -23
  29. package/lib-esm/components/bundle-assets/bundle-assets.js.map +1 -1
  30. package/lib-esm/components/bundle-assets/index.js +3 -1
  31. package/lib-esm/components/bundle-assets/index.js.map +1 -1
  32. package/lib-esm/components/bundle-modules/bundle-modules.js +10 -6
  33. package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
  34. package/lib-esm/components/bundle-modules/bundle-modules.utils.js +1 -11
  35. package/lib-esm/components/bundle-modules/bundle-modules.utils.js.map +1 -1
  36. package/lib-esm/components/bundle-modules/index.js +3 -2
  37. package/lib-esm/components/bundle-modules/index.js.map +1 -1
  38. package/lib-esm/components/bundle-packages/bundle-packages.js +11 -6
  39. package/lib-esm/components/bundle-packages/bundle-packages.js.map +1 -1
  40. package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js +6 -1
  41. package/lib-esm/components/metrics-treemap/metrics-treemap.constants.js.map +1 -1
  42. package/lib-esm/components/metrics-treemap/metrics-treemap.js +65 -68
  43. package/lib-esm/components/metrics-treemap/metrics-treemap.js.map +1 -1
  44. package/lib-esm/components/metrics-treemap/metrics-treemap.module.css +47 -10
  45. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js +57 -0
  46. package/lib-esm/components/metrics-treemap/metrics-treemap.utils.js.map +1 -1
  47. package/lib-esm/utils/colors.js +15 -0
  48. package/lib-esm/utils/colors.js.map +1 -0
  49. package/lib-esm/utils/components.js +16 -0
  50. package/lib-esm/utils/components.js.map +1 -0
  51. package/lib-esm/utils/index.js +4 -0
  52. package/lib-esm/utils/index.js.map +1 -0
  53. package/lib-esm/utils/jobs.js +11 -0
  54. package/lib-esm/utils/jobs.js.map +1 -0
  55. package/package.json +3 -3
  56. package/src/components/bundle-assets/bundle-assets.jsx +72 -48
  57. package/src/components/bundle-assets/index.jsx +4 -0
  58. package/src/components/bundle-modules/bundle-modules.tsx +32 -11
  59. package/src/components/bundle-modules/bundle-modules.types.d.ts +2 -17
  60. package/src/components/bundle-modules/bundle-modules.utils.ts +7 -18
  61. package/src/components/bundle-modules/index.tsx +4 -3
  62. package/src/components/bundle-packages/bundle-packages.jsx +19 -7
  63. package/src/components/metrics-treemap/metrics-treemap.constants.ts +11 -0
  64. package/src/components/metrics-treemap/metrics-treemap.module.css +47 -10
  65. package/src/components/metrics-treemap/metrics-treemap.tsx +171 -110
  66. package/src/components/metrics-treemap/metrics-treemap.utils.ts +107 -1
  67. package/src/utils/colors.ts +19 -0
  68. package/src/utils/components.tsx +19 -0
  69. package/src/utils/index.ts +3 -0
  70. package/src/utils/jobs.ts +22 -0
  71. package/types/components/bundle-assets/bundle-assets.d.ts +1 -5
  72. package/types/components/bundle-modules/bundle-modules.d.ts +4 -2
  73. package/types/components/bundle-modules/bundle-modules.utils.d.ts +3 -7
  74. package/types/components/bundle-modules/index.d.ts +2 -2
  75. package/types/components/metrics-treemap/metrics-treemap.constants.d.ts +8 -0
  76. package/types/components/metrics-treemap/metrics-treemap.d.ts +1 -1
  77. package/types/components/metrics-treemap/metrics-treemap.utils.d.ts +11 -1
  78. package/types/utils/colors.d.ts +1 -0
  79. package/types/utils/components.d.ts +2 -0
  80. package/types/utils/index.d.ts +3 -0
  81. package/types/utils/jobs.d.ts +7 -0
  82. package/lib/utils.js.map +0 -1
  83. package/lib-esm/utils.js +0 -30
  84. package/lib-esm/utils.js.map +0 -1
  85. package/src/utils.jsx +0 -38
  86. package/types/utils.d.ts +0 -3
@@ -0,0 +1,7 @@
1
+ import type { Job, WebpackChunk } from '@bundle-stats/utils';
2
+ interface GetJobsChunksData {
3
+ chunks: Array<WebpackChunk>;
4
+ chunkIds: Array<string>;
5
+ }
6
+ export declare function getJobsChunksData(jobs: Array<Job>): GetJobsChunksData;
7
+ export {};
package/lib/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.jsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,yDAAiC;AACjC,4DAA4B;AAE5B,4EAAyC;AAElC,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE;IACrC,MAAM,MAAM,GAAG,IAAA,eAAK,EAAC,2BAAM,EAAE,IAAI,CAAC,KAAK,CAAC,2BAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IAEhE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,KAAK,CAAC,EAAE;YACf,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;SACvB;QAED,IAAI,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,OAAO,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC5C;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,SAAS,aAcpB;AAEK,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;IAClE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAExB,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,uCAAK,SAAS,EAAE,SAAS,IAAG,KAAK,CAAO,CAAC;KACjD;IAED,OAAO,eAAK,CAAC,YAAY,CAAC,KAAK,EAAE;QAC/B,GAAG,KAAK;QACR,SAAS,EAAE,IAAA,oBAAE,EAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAfW,QAAA,2BAA2B,+BAetC"}
package/lib-esm/utils.js DELETED
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import chunk from 'lodash/chunk';
3
- import cx from 'classnames';
4
- import COLORS from './chart-colors.json';
5
- export const getColors = (count = 2) => {
6
- const chunks = chunk(COLORS, Math.round(COLORS.length / count));
7
- return chunks.map((chunkColors, index) => {
8
- if (index === 0) {
9
- return chunkColors[0];
10
- }
11
- if (index === chunks.length - 1) {
12
- return chunkColors[chunkColors.length - 1];
13
- }
14
- return chunkColors[Math.floor(chunkColors.length / 2)];
15
- });
16
- };
17
- export const getRenderChildWithClassName = (className) => (child) => {
18
- if (child === null || child === '') {
19
- return null;
20
- }
21
- const { props } = child;
22
- if (!props) {
23
- return React.createElement("div", { className: className }, child);
24
- }
25
- return React.cloneElement(child, {
26
- ...props,
27
- className: cx(className, props.className),
28
- });
29
- };
30
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE;IACrC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC;IAEhE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE;QACvC,IAAI,KAAK,KAAK,CAAC,EAAE;YACf,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;SACvB;QAED,IAAI,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,OAAO,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;SAC5C;QAED,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE;IAClE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;QAClC,OAAO,IAAI,CAAC;KACb;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAExB,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,6BAAK,SAAS,EAAE,SAAS,IAAG,KAAK,CAAO,CAAC;KACjD;IAED,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE;QAC/B,GAAG,KAAK;QACR,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC"}
package/src/utils.jsx DELETED
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import chunk from 'lodash/chunk';
3
- import cx from 'classnames';
4
-
5
- import COLORS from './chart-colors.json';
6
-
7
- export const getColors = (count = 2) => {
8
- const chunks = chunk(COLORS, Math.round(COLORS.length / count));
9
-
10
- return chunks.map((chunkColors, index) => {
11
- if (index === 0) {
12
- return chunkColors[0];
13
- }
14
-
15
- if (index === chunks.length - 1) {
16
- return chunkColors[chunkColors.length - 1];
17
- }
18
-
19
- return chunkColors[Math.floor(chunkColors.length / 2)];
20
- });
21
- };
22
-
23
- export const getRenderChildWithClassName = (className) => (child) => {
24
- if (child === null || child === '') {
25
- return null;
26
- }
27
-
28
- const { props } = child;
29
-
30
- if (!props) {
31
- return <div className={className}>{child}</div>;
32
- }
33
-
34
- return React.cloneElement(child, {
35
- ...props,
36
- className: cx(className, props.className), // eslint-disable-line react/prop-types
37
- });
38
- };
package/types/utils.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export function getColors(count?: number): string[];
2
- export function getRenderChildWithClassName(className: any): (child: any) => React.JSX.Element | null;
3
- import React from 'react';