@rsdoctor/components 1.5.18 → 1.6.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 (148) hide show
  1. package/dist/components/Alert/ecma-version-check_module.css +1 -1
  2. package/dist/components/Alert/ecma-version-check_module.css.map +1 -1
  3. package/dist/components/Alerts/bundle-alert.mjs +12 -8
  4. package/dist/components/Alerts/bundle-alert.mjs.map +1 -1
  5. package/dist/components/Alerts/bundle.mjs +3 -4
  6. package/dist/components/Alerts/bundle.mjs.map +1 -1
  7. package/dist/components/Alerts/collapse-cjs-require.mjs +6 -14
  8. package/dist/components/Alerts/collapse-cjs-require.mjs.map +1 -1
  9. package/dist/components/Alerts/collapse-cross-chunks.mjs +3 -8
  10. package/dist/components/Alerts/collapse-cross-chunks.mjs.map +1 -1
  11. package/dist/components/Alerts/collapse-esm-cjs.mjs +6 -10
  12. package/dist/components/Alerts/collapse-esm-cjs.mjs.map +1 -1
  13. package/dist/components/Alerts/collapse-module-mixed-chunks.mjs +5 -12
  14. package/dist/components/Alerts/collapse-module-mixed-chunks.mjs.map +1 -1
  15. package/dist/components/Alerts/collapse-side-effects-only-imports.mjs +5 -12
  16. package/dist/components/Alerts/collapse-side-effects-only-imports.mjs.map +1 -1
  17. package/dist/components/Alerts/collapse.mjs +3 -10
  18. package/dist/components/Alerts/collapse.mjs.map +1 -1
  19. package/dist/components/Alerts/collapse_module.css +1 -1
  20. package/dist/components/Alerts/collapse_module.css.map +1 -1
  21. package/dist/components/Alerts/index.module.mjs +7 -0
  22. package/dist/components/Alerts/index.module.mjs.map +1 -0
  23. package/dist/components/Alerts/index_module.css +9 -0
  24. package/dist/components/Alerts/index_module.css.map +1 -0
  25. package/dist/components/Alerts/list.mjs +0 -3
  26. package/dist/components/Alerts/list.mjs.map +1 -1
  27. package/dist/components/Card/size.d.ts +1 -0
  28. package/dist/components/Card/size.mjs +29 -7
  29. package/dist/components/Card/size.mjs.map +1 -1
  30. package/dist/components/Card/size.module.mjs +1 -0
  31. package/dist/components/Card/size.module.mjs.map +1 -1
  32. package/dist/components/Card/size_module.css +5 -2
  33. package/dist/components/Card/size_module.css.map +1 -1
  34. package/dist/components/Charts/TimelineCharts/index.mjs +118 -94
  35. package/dist/components/Charts/TimelineCharts/index.mjs.map +1 -1
  36. package/dist/components/Charts/TreeMap.d.ts +2 -1
  37. package/dist/components/Charts/TreeMap.mjs +111 -126
  38. package/dist/components/Charts/TreeMap.mjs.map +1 -1
  39. package/dist/components/Charts/constants.d.ts +1 -0
  40. package/dist/components/Charts/constants.mjs +11 -1
  41. package/dist/components/Charts/constants.mjs.map +1 -1
  42. package/dist/components/Charts/index.mjs +3 -1
  43. package/dist/components/Charts/index.mjs.map +1 -1
  44. package/dist/components/Charts/loader.css +1 -1
  45. package/dist/components/Charts/loader.css.map +1 -1
  46. package/dist/components/Charts/treeMapSize.d.ts +10 -0
  47. package/dist/components/Charts/treeMapSize.mjs +17 -0
  48. package/dist/components/Charts/treeMapSize.mjs.map +1 -0
  49. package/dist/components/Charts/treeMapSize.test.d.ts +1 -0
  50. package/dist/components/Charts/treeMapSize.test.mjs +44 -0
  51. package/dist/components/Charts/treeMapSize.test.mjs.map +1 -0
  52. package/dist/components/Charts/treemap_module.css +6 -5
  53. package/dist/components/Charts/treemap_module.css.map +1 -1
  54. package/dist/components/FileTree/index.css +0 -1
  55. package/dist/components/FileTree/index.css.map +1 -1
  56. package/dist/components/FileTree/index.mjs +3 -4
  57. package/dist/components/FileTree/index.mjs.map +1 -1
  58. package/dist/components/Keyword/style_module.css +0 -1
  59. package/dist/components/Keyword/style_module.css.map +1 -1
  60. package/dist/components/Layout/header.mjs +38 -16
  61. package/dist/components/Layout/header.mjs.map +1 -1
  62. package/dist/components/Layout/header.module.mjs +5 -2
  63. package/dist/components/Layout/header.module.mjs.map +1 -1
  64. package/dist/components/Layout/header_module.css +69 -21
  65. package/dist/components/Layout/header_module.css.map +1 -1
  66. package/dist/components/Layout/index.mjs +34 -8
  67. package/dist/components/Layout/index.mjs.map +1 -1
  68. package/dist/components/Layout/menus.mjs +9 -6
  69. package/dist/components/Layout/menus.mjs.map +1 -1
  70. package/dist/components/Layout/rsdoctor-title-logo-dark.mjs +2 -0
  71. package/dist/components/Loader/Analysis/files.mjs +16 -17
  72. package/dist/components/Loader/Analysis/files.mjs.map +1 -1
  73. package/dist/components/Loader/Analysis/style_module.css +13 -14
  74. package/dist/components/Loader/Analysis/style_module.css.map +1 -1
  75. package/dist/components/Loader/executions.mjs +5 -13
  76. package/dist/components/Loader/executions.mjs.map +1 -1
  77. package/dist/components/Overall/DataSummary.d.ts +1 -1
  78. package/dist/components/Overall/DataSummary.mjs +21 -20
  79. package/dist/components/Overall/DataSummary.mjs.map +1 -1
  80. package/dist/components/Overall/DataSummary.module.mjs +1 -12
  81. package/dist/components/Overall/DataSummary.module.mjs.map +1 -1
  82. package/dist/components/Overall/DataSummary_module.css +13 -73
  83. package/dist/components/Overall/DataSummary_module.css.map +1 -1
  84. package/dist/components/Overall/bundle.mjs +2 -3
  85. package/dist/components/Overall/bundle.mjs.map +1 -1
  86. package/dist/components/Overall/bundle.module.mjs +1 -0
  87. package/dist/components/Overall/bundle.module.mjs.map +1 -1
  88. package/dist/components/Overall/bundle_module.css +12 -4
  89. package/dist/components/Overall/bundle_module.css.map +1 -1
  90. package/dist/components/Overall/list_module.css +18 -2
  91. package/dist/components/Overall/list_module.css.map +1 -1
  92. package/dist/components/Overall/overview_module.css +13 -6
  93. package/dist/components/Overall/overview_module.css.map +1 -1
  94. package/dist/components/Overall/project.mjs +1 -1
  95. package/dist/components/Overall/project.mjs.map +1 -1
  96. package/dist/components/Overall/project_module.css +8 -0
  97. package/dist/components/Overall/project_module.css.map +1 -1
  98. package/dist/components/base/CodeViewer/index.d.ts +1 -1
  99. package/dist/components/base/CodeViewer/index.mjs +5 -3
  100. package/dist/components/base/CodeViewer/index.mjs.map +1 -1
  101. package/dist/components/base/CodeViewer/interface.d.ts +1 -2
  102. package/dist/components/base/DiffViewer/index.d.ts +1 -1
  103. package/dist/components/base/DiffViewer/index.mjs +4 -1
  104. package/dist/components/base/DiffViewer/index.mjs.map +1 -1
  105. package/dist/components/base/DiffViewer/interface.d.ts +1 -2
  106. package/dist/pages/BundleSize/components/asset_module.css +7 -5
  107. package/dist/pages/BundleSize/components/asset_module.css.map +1 -1
  108. package/dist/pages/BundleSize/components/card_module.css +9 -3
  109. package/dist/pages/BundleSize/components/card_module.css.map +1 -1
  110. package/dist/pages/BundleSize/components/cards.mjs +5 -6
  111. package/dist/pages/BundleSize/components/cards.mjs.map +1 -1
  112. package/dist/pages/BundleSize/components/index.mjs +11 -8
  113. package/dist/pages/BundleSize/components/index.mjs.map +1 -1
  114. package/dist/pages/BundleSize/components/index.module.mjs +1 -6
  115. package/dist/pages/BundleSize/components/index.module.mjs.map +1 -1
  116. package/dist/pages/BundleSize/components/index_module.css +0 -37
  117. package/dist/pages/BundleSize/components/index_module.css.map +1 -1
  118. package/dist/pages/BundleSize/components/search-modal.mjs +5 -5
  119. package/dist/pages/BundleSize/components/search-modal.mjs.map +1 -1
  120. package/dist/pages/BundleSize/components/search-modal.module.mjs +10 -0
  121. package/dist/pages/BundleSize/components/search-modal.module.mjs.map +1 -0
  122. package/dist/pages/BundleSize/components/search-modal_module.css +39 -0
  123. package/dist/pages/BundleSize/components/search-modal_module.css.map +1 -0
  124. package/dist/pages/BundleSize/components/tree-graph.mjs +4 -4
  125. package/dist/pages/BundleSize/components/tree-graph.mjs.map +1 -1
  126. package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +6 -2
  127. package/dist/pages/ModuleAnalyze/components/fileTreeCom.css.map +1 -1
  128. package/dist/pages/ModuleAnalyze/index.css +4 -6
  129. package/dist/pages/ModuleAnalyze/index.css.map +1 -1
  130. package/dist/pages/ModuleAnalyze/index.mjs +3 -4
  131. package/dist/pages/ModuleAnalyze/index.mjs.map +1 -1
  132. package/dist/pages/Overall/index.mjs +5 -13
  133. package/dist/pages/Overall/index.mjs.map +1 -1
  134. package/dist/pages/Overall/index.module.mjs +3 -0
  135. package/dist/pages/Overall/index.module.mjs.map +1 -1
  136. package/dist/pages/Overall/index_module.css +35 -2
  137. package/dist/pages/Overall/index_module.css.map +1 -1
  138. package/dist/pages/Overall/responsiveLayout.mjs +3 -3
  139. package/dist/pages/Overall/responsiveLayout.mjs.map +1 -1
  140. package/dist/pages/WebpackLoaders/Analysis/index.mjs +3 -3
  141. package/dist/pages/WebpackLoaders/Analysis/index.mjs.map +1 -1
  142. package/dist/pages/WebpackLoaders/Overall/index.mjs +1 -1
  143. package/dist/pages/WebpackLoaders/Overall/index.mjs.map +1 -1
  144. package/dist/static/image/rsdoctor-title-logo-dark.png +0 -0
  145. package/dist/utils/hooks.d.ts +1 -0
  146. package/dist/utils/hooks.mjs +6 -1
  147. package/dist/utils/hooks.mjs.map +1 -1
  148. package/package.json +4 -4
@@ -35,8 +35,7 @@ export interface DiffViewerProps {
35
35
  */
36
36
  isEmbed?: boolean;
37
37
  /**
38
- * Whether to use light theme
39
- * @default true
38
+ * Whether to use light theme. If not specified the global theme is used.
40
39
  */
41
40
  isLightTheme?: boolean;
42
41
  /**
@@ -37,13 +37,16 @@
37
37
  --x-pad-minus-scrollbar: calc(var(--x-pad) - var(--scrollbar-width));
38
38
  min-height: var(--tree-min-height);
39
39
  padding: var(--y-pad) var(--x-pad-minus-scrollbar) var(--y-pad) var(--x-pad);
40
- resize: vertical;
41
- border: 1px solid #ebedf1;
42
- border-radius: 8px;
40
+ border: 1px solid var(--color-border-secondary);
41
+ border-radius: var(--border-radius-lg);
43
42
  flex: 1;
44
43
  display: flex;
45
44
  }
46
45
 
46
+ .bundleTree-ym_nR5 .ant-tree-list-scrollbar-thumb {
47
+ background: var(--color-scrollbar) !important;
48
+ }
49
+
47
50
  @media (max-height: 900px) {
48
51
  .bundleTree-ym_nR5 {
49
52
  --tree-min-height: 450px;
@@ -84,7 +87,6 @@
84
87
  .bundleTreeEntryTitle-XbeexU {
85
88
  text-overflow: ellipsis;
86
89
  text-wrap: nowrap;
87
- color: #000000d9;
88
90
  font-size: 14px;
89
91
  font-weight: 400;
90
92
  overflow: hidden;
@@ -98,7 +100,7 @@
98
100
  }
99
101
 
100
102
  .divider-Iq1wtJ {
101
- border-bottom: 1px dashed #0000001f;
103
+ border-bottom: 1px dashed var(--color-divider);
102
104
  flex-grow: 1;
103
105
  min-width: 10px;
104
106
  height: 1px;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/pages/BundleSize/components/asset.module.scss"],"names":[],"mappings":"AAAA;EACE,eAAe;AACjB;;AAF6D;EAK3D,cAAc;AAChB;;AANsG;EASpG,WAAW;AACb;;AAVuJ;EAarJ,iBAAiB;AACnB;;AAd0M;EAiBxM,aAAa;AACf;;AAlBsQ;EAqBpQ,2CAA2C;EAC3C,2BAA2B;AAC7B;;AAvBwV;EA0BtV,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AA7BsZ;EAgCpZ,wBAAwB;EACxB,aAAa;EACb,aAAa;EACb,uBAAuB;EACvB,oEAAoE;EACpE,kCAAkC;EAClC,4EAA4E;EAC5E,gBAAgB;EAChB,yBAAyB;EACzB,kBAAkB;EAClB,OAAO;EACP,aAAa;AACf;;AA5CivB;EAA0B;IAgDvwB,wBAAwB;EAC1B;AACF;;AAlDizB;EAqD/yB,OAAO;EACP,kBAAkB;AACpB;;AAvD81B;EA0D51B,kBAAkB;EAClB,QAAQ;AACV;;AA5Di5B;EA+D/4B,gCAAgC;EAChC,aAAa;EACb,kBAAkB;AACpB;;AAlEi+B;EAqE/9B,YAAY;EACZ,oBAAoB;AACtB;;AAvEyiC;EA0EviC,WAAW;EACX,mBAAmB;EACnB,qDAAqD;EACrD,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,OAAO;AACT;;AAjFgsC;EAoF9rC,uBAAuB;EACvB,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;EACf,gBAAgB;EAChB,gBAAgB;AAClB;;AA1Fm0C;EA6Fj0C,OAAO;EACP,mBAAmB;EACnB,aAAa;EACb,gBAAgB;AAClB;;AAjGo5C;EAoGl5C,mCAAmC;EACnC,YAAY;EACZ,eAAe;EACf,WAAW;EACX,cAAc;EACd,kBAAkB;EAClB,QAAQ;AACV","sourcesContent":[".bundle :global .rc-tree-node-content-wrapper{font-size:14px}.bundle :global .file-icon{margin-left:0}.bundle :global .ant-tree-indent-unit{width:10px}.bundle :global .ant-tree-iconEle{margin-right:2px}.bundle :global .ant-tree-node-content-wrapper{display:flex}.bundleBody{justify-content:flex-start;min-height:var(--body-min-height, initial)}.bundle,.bundleBody{display:flex;flex-direction:column;flex:1}.bundleTree{--tree-min-height: 300px;--x-pad: 20px;--y-pad: 14px;--scrollbar-width: 10px;--x-pad-minus-scrollbar: calc(var(--x-pad) - var(--scrollbar-width));display:flex;flex:1;min-height:var(--tree-min-height);padding:var(--y-pad) var(--x-pad-minus-scrollbar) var(--y-pad) var(--x-pad);border:1px solid #ebedf1;border-radius:8px;resize:vertical}@media(max-height: 900px){.bundleTree{--tree-min-height: 450px}}.bundleTreeViewport{flex:1;position:relative}.bundleTreeInnerViewport{position:absolute;inset:0}.bundleTreeEntry{display:flex;position:relative;height:var(--item-height, 30px)}.bundleTreeEntry :global span.ant-tag{margin:none;margin-inline-end:0px}.bundleTreeEntryContent{position:absolute;left:0;top:0;width:100%;display:flex;align-items:center;padding-inline-end:var(--x-pad-minus-scrollbar, 0px)}.bundleTreeEntryTitle{text-overflow:ellipsis;overflow:hidden;text-wrap:nowrap;font-size:14px;font-weight:400;color:rgba(0,0,0,.85)}.bundleTreeEntryTitleWrap{display:flex;flex:1;align-items:center;overflow:hidden}.divider{position:relative;top:4px;height:1px;min-width:10px;flex-grow:1;margin:0 10px;border-bottom:1px dashed rgba(0,0,0,.12)}"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/pages/BundleSize/components/asset.module.scss"],"names":[],"mappings":"AAAA;EACE,eAAe;AACjB;;AAF6D;EAK3D,cAAc;AAChB;;AANsG;EASpG,WAAW;AACb;;AAVuJ;EAarJ,iBAAiB;AACnB;;AAd0M;EAiBxM,aAAa;AACf;;AAlBsQ;EAqBpQ,2CAA2C;EAC3C,2BAA2B;AAC7B;;AAvBwV;EA0BtV,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AA7BsZ;EAgCpZ,wBAAwB;EACxB,aAAa;EACb,aAAa;EACb,uBAAuB;EACvB,oEAAoE;EACpE,kCAAkC;EAClC,4EAA4E;EAC5E,+CAA+C;EAC/C,sCAAsC;EACtC,OAAO;EACP,aAAa;AACf;;AA3C2wB;EA8CzwB,6CAA6C;AAC/C;;AA/C42B;EAA0B;IAmDl4B,wBAAwB;EAC1B;AACF;;AArD46B;EAwD16B,OAAO;EACP,kBAAkB;AACpB;;AA1Dy9B;EA6Dv9B,kBAAkB;EAClB,QAAQ;AACV;;AA/D4gC;EAkE1gC,gCAAgC;EAChC,aAAa;EACb,kBAAkB;AACpB;;AArE4lC;EAwE1lC,YAAY;EACZ,oBAAoB;AACtB;;AA1EoqC;EA6ElqC,WAAW;EACX,mBAAmB;EACnB,qDAAqD;EACrD,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,OAAO;AACT;;AApF2zC;EAuFzzC,uBAAuB;EACvB,iBAAiB;EACjB,eAAe;EACf,gBAAgB;EAChB,gBAAgB;AAClB;;AA5Fw6C;EA+Ft6C,OAAO;EACP,mBAAmB;EACnB,aAAa;EACb,gBAAgB;AAClB;;AAnGy/C;EAsGv/C,8CAA8C;EAC9C,YAAY;EACZ,eAAe;EACf,WAAW;EACX,cAAc;EACd,kBAAkB;EAClB,QAAQ;AACV","sourcesContent":[".bundle :global .rc-tree-node-content-wrapper{font-size:14px}.bundle :global .file-icon{margin-left:0}.bundle :global .ant-tree-indent-unit{width:10px}.bundle :global .ant-tree-iconEle{margin-right:2px}.bundle :global .ant-tree-node-content-wrapper{display:flex}.bundleBody{justify-content:flex-start;min-height:var(--body-min-height, initial)}.bundle,.bundleBody{display:flex;flex-direction:column;flex:1}.bundleTree{--tree-min-height: 300px;--x-pad: 20px;--y-pad: 14px;--scrollbar-width: 10px;--x-pad-minus-scrollbar: calc(var(--x-pad) - var(--scrollbar-width));display:flex;flex:1;min-height:var(--tree-min-height);padding:var(--y-pad) var(--x-pad-minus-scrollbar) var(--y-pad) var(--x-pad);border:1px solid var(--color-border-secondary);border-radius:var(--border-radius-lg)}.bundleTree :global(.ant-tree-list-scrollbar-thumb){background:var(--color-scrollbar) !important}@media(max-height: 900px){.bundleTree{--tree-min-height: 450px}}.bundleTreeViewport{flex:1;position:relative}.bundleTreeInnerViewport{position:absolute;inset:0}.bundleTreeEntry{display:flex;position:relative;height:var(--item-height, 30px)}.bundleTreeEntry :global span.ant-tag{margin:none;margin-inline-end:0px}.bundleTreeEntryContent{position:absolute;left:0;top:0;width:100%;display:flex;align-items:center;padding-inline-end:var(--x-pad-minus-scrollbar, 0px)}.bundleTreeEntryTitle{text-overflow:ellipsis;overflow:hidden;text-wrap:nowrap;font-size:14px;font-weight:400}.bundleTreeEntryTitleWrap{display:flex;flex:1;align-items:center;overflow:hidden}.divider{position:relative;top:4px;height:1px;min-width:10px;flex-grow:1;margin:0 10px;border-bottom:1px dashed var(--color-divider)}"],"sourceRoot":""}
@@ -1,5 +1,7 @@
1
1
  .container-wODg_6 {
2
- background-color: #fff;
2
+ background-color: var(--color-bg-box);
3
+ border: 1px solid var(--color-border-secondary);
4
+ border-radius: var(--border-radius-lg);
3
5
  align-items: center;
4
6
  margin-bottom: 20px;
5
7
  padding: 20px 0;
@@ -27,19 +29,23 @@
27
29
  }
28
30
 
29
31
  .container-wODg_6 .summary-zj0ygd .description-o0ffpO {
32
+ font-variant-numeric: tabular-nums;
30
33
  margin-right: 5px;
31
34
  font-size: 20px;
32
- font-weight: 500;
35
+ font-weight: 600;
33
36
  line-height: 32px;
34
37
  }
35
38
 
36
39
  .container-wODg_6 .summary-zj0ygd .unit-n5Yty6 {
40
+ color: var(--text-color-secondary);
37
41
  font-size: 12px;
38
42
  font-weight: 400;
39
43
  line-height: 32px;
40
44
  }
41
45
 
42
46
  .container-wODg_6 .summary-zj0ygd .totalNumber-UweUl8 {
47
+ color: var(--text-color-secondary);
48
+ font-variant-numeric: tabular-nums;
43
49
  margin: 4px 0;
44
50
  font-size: 13px;
45
51
  font-weight: 400;
@@ -54,7 +60,7 @@
54
60
  }
55
61
 
56
62
  .cardTitle-xNmEfV .title-qIR7dd {
57
- color: #000;
63
+ color: var(--text-color);
58
64
  font-size: 14px;
59
65
  font-weight: 500;
60
66
  line-height: 20px;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/pages/BundleSize/components/card.module.scss"],"names":[],"mappings":"AAAA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AANmG;EASjG,6BAA6B;EAC7B,WAAW;EACX,aAAa;AACf;;AAZoL;EAelL,OAAO;EACP,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAnBqR;EAsBnR,sBAAsB;EACtB,uBAAuB;EACvB,cAAc;EACd,aAAa;AACf;;AA1BiX;EA6B/W,iBAAiB;EACjB,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AAjCmd;EAoCjd,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AAvC6hB;EA0C3hB,aAAa;EACb,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AA9C2nB;EAiDznB,8BAA8B;EAC9B,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;AACf;;AArDutB;EAwDrtB,WAAW;EACX,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB","sourcesContent":[".container{display:flex;align-items:center;background-color:#fff;padding:20px 0;margin-bottom:20px}.container .chartsContainer{width:100%;display:flex;justify-content:space-evenly}.container .chartsContainer .chart{display:flex;align-items:center;justify-content:center;flex:1}.container .summary{display:flex;flex-direction:column;justify-content:center;margin:0 20px}.container .summary .description{font-size:20px;font-weight:500;line-height:32px;margin-right:5px}.container .summary .unit{font-size:12px;font-weight:400;line-height:32px}.container .summary .totalNumber{font-size:13px;font-weight:400;line-height:20px;margin:4px 0}.cardTitle{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.cardTitle .title{font-size:14px;font-weight:500;line-height:20px;color:#000}"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/pages/BundleSize/components/card.module.scss"],"names":[],"mappings":"AAAA;EACE,qCAAqC;EACrC,+CAA+C;EAC/C,sCAAsC;EACtC,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AARuM;EAWrM,6BAA6B;EAC7B,WAAW;EACX,aAAa;AACf;;AAdwR;EAiBtR,OAAO;EACP,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AArByX;EAwBvX,sBAAsB;EACtB,uBAAuB;EACvB,cAAc;EACd,aAAa;AACf;;AA5Bqd;EA+Bnd,kCAAkC;EAClC,iBAAiB;EACjB,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AApCylB;EAuCvlB,kCAAkC;EAClC,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AA3CqsB;EA8CnsB,kCAAkC;EAClC,kCAAkC;EAClC,aAAa;EACb,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB;;AApDu2B;EAuDr2B,8BAA8B;EAC9B,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;AACf;;AA3Dm8B;EA8Dj8B,wBAAwB;EACxB,eAAe;EACf,gBAAgB;EAChB,iBAAiB;AACnB","sourcesContent":[".container{display:flex;align-items:center;background-color:var(--color-bg-box);padding:20px 0;margin-bottom:20px;border:1px solid var(--color-border-secondary);border-radius:var(--border-radius-lg)}.container .chartsContainer{width:100%;display:flex;justify-content:space-evenly}.container .chartsContainer .chart{display:flex;align-items:center;justify-content:center;flex:1}.container .summary{display:flex;flex-direction:column;justify-content:center;margin:0 20px}.container .summary .description{font-size:20px;font-weight:600;line-height:32px;margin-right:5px;font-variant-numeric:tabular-nums}.container .summary .unit{font-size:12px;font-weight:400;line-height:32px;color:var(--text-color-secondary)}.container .summary .totalNumber{font-size:13px;font-weight:400;line-height:20px;margin:4px 0;color:var(--text-color-secondary);font-variant-numeric:tabular-nums}.cardTitle{display:flex;justify-content:space-between;align-items:center;margin-bottom:25px}.cardTitle .title{font-size:14px;font-weight:500;line-height:20px;color:var(--text-color)}"],"sourceRoot":""}
@@ -1,9 +1,9 @@
1
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useMemo, useState } from "react";
3
- import { Avatar, Divider, Segmented, Tree, theme } from "antd";
3
+ import { Avatar, Divider, Segmented, Tree } from "antd";
4
4
  import { SDK } from "@rsdoctor/types";
5
5
  import { FileFilled, GoldenFilled, RightOutlined } from "@ant-design/icons";
6
- import { formatSize, useDuplicatePackagesByErrors } from "../../../utils/index.mjs";
6
+ import { formatSize, useDuplicatePackagesByErrors, useThemeToken } from "../../../utils/index.mjs";
7
7
  import { StatisticCard } from "../../../components/Card/statistic.mjs";
8
8
  import { SizeCard } from "../../../components/Card/size.mjs";
9
9
  import overview from "../../../components/Overall/overview.mjs";
@@ -12,10 +12,9 @@ import { getFiles } from "../../../components/Overall/index.mjs";
12
12
  import { TextDrawer } from "../../../components/TextDrawer/index.mjs";
13
13
  import card_module from "./card.module.mjs";
14
14
  const { DirectoryTree: DirectoryTree } = Tree;
15
- const { useToken: useToken } = theme;
16
15
  const { innerWidth: cards_innerWidth } = window;
17
16
  const AssetCard = ({ showProgress = false, data, total, tagBgColor, type })=>{
18
- const { token } = useToken();
17
+ const token = useThemeToken();
19
18
  const _tagBgColor = tagBgColor || token.colorPrimaryBorderHover;
20
19
  return /*#__PURE__*/ jsx(SizeCard, {
21
20
  type: type,
@@ -175,7 +174,7 @@ const BundleCards = ({ errors, summary })=>{
175
174
  },
176
175
  text: /*#__PURE__*/ jsxs("div", {
177
176
  style: {
178
- color: '#000000a6'
177
+ color: 'var(--text-color-secondary)'
179
178
  },
180
179
  children: [
181
180
  /*#__PURE__*/ jsx("span", {
@@ -193,7 +192,7 @@ const BundleCards = ({ errors, summary })=>{
193
192
  treeData: treeData,
194
193
  rootStyle: {
195
194
  minHeight: '800px',
196
- border: '1px solid rgba(235, 237, 241)'
195
+ border: '1px solid var(--color-border)'
197
196
  }
198
197
  })
199
198
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/cards.mjs","sources":["../../../../src/pages/BundleSize/components/cards.tsx"],"sourcesContent":["/* rslint-disable react/jsx-key */\nimport React, { useState, useMemo } from 'react';\nimport { Divider, Segmented, theme, Avatar, Tree } from 'antd';\nimport { Client, SDK } from '@rsdoctor/types';\nimport { RightOutlined, FileFilled, GoldenFilled } from '@ant-design/icons';\n\nimport { formatSize, useDuplicatePackagesByErrors } from '../../../utils';\nimport { StatisticCard } from '../../../components/Card/statistic';\nimport { SizeCard, bgColorType } from '../../../components/Card/size';\nimport Overview from '../../../components/Overall/overview';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { getFiles } from '../../..//components/Overall';\nimport { TextDrawer } from '../../..//components/TextDrawer';\n\nimport styles from './card.module.scss';\n\nconst { DirectoryTree } = Tree;\nconst { useToken } = theme;\nconst { innerWidth } = window;\n\ninterface CardProps {\n showProgress?: boolean;\n data: Client.RsdoctorClientAssetsSummary['all']['total'];\n total: number;\n tagBgColor?: string;\n type?: string;\n}\n\nconst AssetCard: React.FC<CardProps> = ({\n showProgress = false,\n data,\n total,\n tagBgColor,\n type,\n}) => {\n const { token } = useToken();\n const _tagBgColor = tagBgColor || token.colorPrimaryBorderHover;\n return (\n <SizeCard\n type={type!}\n files={data.files}\n total={total}\n showProgress={showProgress}\n tagBgColor={_tagBgColor}\n />\n );\n};\n\nconst AssetCardContainer: React.FC<{\n type?: string;\n titles: string[];\n datas: CardProps[];\n bgColor?: bgColorType;\n}> = ({ titles, datas, bgColor, type }) => {\n const [selectedTitle, setSelectedTitle] = useState(titles[0]);\n const idx = useMemo(\n () => titles.indexOf(selectedTitle),\n [titles, selectedTitle],\n );\n const currentIdx = idx >= 0 ? idx : 0;\n const fileType = type || selectedTitle || titles[0];\n\n // Add bounds checking to prevent accessing undefined data\n const currentData =\n currentIdx >= 0 && currentIdx < datas.length\n ? datas[currentIdx]\n : datas[0] || {};\n\n return (\n <StatisticCard\n title={\n <div className={styles.cardTitle}>\n <div className={styles.title}>{fileType}</div>\n {titles.length > 1 ? (\n <Segmented\n defaultValue={titles[0]}\n options={titles}\n onChange={(value) => {\n setSelectedTitle(value as string);\n }}\n size=\"small\"\n style={{ transition: 'transform 0.3s ease' }}\n value={selectedTitle}\n />\n ) : null}\n </div>\n }\n value={\n <AssetCard\n type={fileType}\n {...currentData}\n tagBgColor={bgColor?.tagBgColor}\n />\n }\n boxProps={{\n style: {\n background: bgColor?.bgColor,\n width: innerWidth > 1300 ? '80%' : '95%',\n },\n }}\n />\n );\n};\n\nexport const BundleCards: React.FC<{\n cwd: string;\n errors: SDK.ErrorsData;\n summary: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetsSummary>;\n}> = ({ errors, summary }) => {\n const duplicatePackages = useDuplicatePackagesByErrors(errors);\n const [totalSize, totalSizeUnit] = formatSize(summary.all.total.size).split(\n ' ',\n );\n\n const arr = [\n <AssetCardContainer\n type={'JS'}\n titles={['Total', 'Initial']}\n datas={[\n {\n data: summary.js.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.js.initial,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n <AssetCardContainer\n type={'CSS'}\n titles={['Total', 'Initial']}\n datas={[\n {\n data: summary.css.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.css.initial,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n <AssetCardContainer\n titles={['Images', 'Fonts', 'Media']}\n datas={[\n {\n data: summary.imgs.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.fonts.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.media.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n <AssetCardContainer\n type={'HTML'}\n titles={['HTML Files']}\n datas={[\n {\n data: summary.html.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n ];\n\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: false }}\n >\n {(res) => {\n const { treeData } = getFiles(res['all'].total);\n return (\n <div className={styles.container}>\n <div className={styles.summary}>\n <Overview\n title={\n <TextDrawer\n buttonProps={{\n size: 'small',\n }}\n buttonStyle={{\n fontSize: 'inherit',\n }}\n drawerProps={{\n title: 'Files',\n }}\n text={\n <div style={{ color: '#000000a6' }}>\n <span style={{ marginRight: '5px' }}>Total Files</span>\n <RightOutlined />\n </div>\n }\n >\n <DirectoryTree\n defaultExpandAll\n selectable={false}\n treeData={treeData}\n rootStyle={{\n minHeight: '800px',\n border: '1px solid rgba(235, 237, 241)',\n }}\n />\n </TextDrawer>\n }\n description={\n <>\n <span className={styles.description}>{totalSize}</span>\n <span className={styles.unit}>{totalSizeUnit}</span>\n <div className={styles.totalNumber}>\n <span style={{ marginRight: '7px' }}>\n Number of files\n </span>\n <span style={{ fontWeight: 500 }}>\n {summary.all.total.count}\n </span>\n </div>\n </>\n }\n icon={\n <Avatar\n style={{ background: '#3874F6' }}\n shape=\"circle\"\n icon={<FileFilled style={{ fontSize: '18px' }} />}\n />\n }\n style={{\n marginBottom: '12px',\n minWidth: '210px',\n }}\n />\n <Overview\n style={{ minWidth: '210px' }}\n title={\n <div style={{ margin: '4px 0' }}>\n <span style={{ marginRight: '5px' }}>\n Duplicate Packages\n </span>\n </div>\n }\n description={duplicatePackages.length}\n icon={\n <Avatar\n style={{ background: '#13C2C2' }}\n shape=\"circle\"\n icon={<GoldenFilled style={{ fontSize: '18px' }} />}\n />\n }\n />\n </div>\n <Divider style={{ height: '200px' }} type=\"vertical\" />\n <div className={styles.chartsContainer}>\n {arr.map((e, idx) => (\n <>\n <div key={idx} className={styles.chart}>\n {e}\n </div>\n {idx !== arr.length - 1 ? (\n <Divider\n key={`${idx}-divider`}\n style={{ height: '200px' }}\n type=\"vertical\"\n />\n ) : null}\n </>\n ))}\n </div>\n </div>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["DirectoryTree","Tree","useToken","theme","innerWidth","window","AssetCard","showProgress","data","total","tagBgColor","type","token","_tagBgColor","SizeCard","AssetCardContainer","titles","datas","bgColor","selectedTitle","setSelectedTitle","useState","idx","useMemo","currentIdx","fileType","currentData","StatisticCard","styles","Segmented","value","BundleCards","errors","summary","duplicatePackages","useDuplicatePackagesByErrors","totalSize","totalSizeUnit","formatSize","arr","ServerAPIProvider","SDK","res","treeData","getFiles","Overview","TextDrawer","RightOutlined","Avatar","FileFilled","GoldenFilled","Divider","e"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,EAAEA,eAAAA,aAAa,EAAE,GAAGC;AAC1B,MAAM,EAAEC,UAAAA,QAAQ,EAAE,GAAGC;AACrB,MAAM,EAAEC,YAAAA,gBAAU,EAAE,GAAGC;AAUvB,MAAMC,YAAiC,CAAC,EACtCC,eAAe,KAAK,EACpBC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,IAAI,EACL;IACC,MAAM,EAAEC,KAAK,EAAE,GAAGV;IAClB,MAAMW,cAAcH,cAAcE,MAAM,uBAAuB;IAC/D,OAAO,WAAP,GACE,IAACE,UAAQA;QACP,MAAMH;QACN,OAAOH,KAAK,KAAK;QACjB,OAAOC;QACP,cAAcF;QACd,YAAYM;;AAGlB;AAEA,MAAME,qBAKD,CAAC,EAAEC,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEP,IAAI,EAAE;IACpC,MAAM,CAACQ,eAAeC,iBAAiB,GAAGC,SAASL,MAAM,CAAC,EAAE;IAC5D,MAAMM,MAAMC,QACV,IAAMP,OAAO,O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oBACE,IAACc,QAAMA;oCACL,OAAO;wCAAE,YAAY;oCAAU;oCAC/B,OAAM;oCACN,oBAAM,IAACE,cAAYA;wCAAC,OAAO;4CAAE,UAAU;wCAAO;;;;;;kCAKtD,IAACC,SAAOA;wBAAC,OAAO;4BAAE,QAAQ;wBAAQ;wBAAG,MAAK;;kCAC1C,IAAC;wBAAI,WAAWvB,YAAAA,eAAsB;kCACnCW,IAAI,GAAG,CAAC,CAACa,GAAG9B,MAAAA,WAAAA,GACX;;kDACE,IAAC;wCAAc,WAAWM,YAAAA,KAAY;kDACnCwB;uCADO9B;oCAGTA,QAAQiB,IAAI,MAAM,GAAG,IAAI,WAAJ,GACpB,IAACY,SAAOA;wCAEN,OAAO;4CAAE,QAAQ;wCAAQ;wCACzB,MAAK;uCAFA,GAAG7B,IAAI,QAAQ,CAAC,IAIrB;;;;;;QAMhB;;AAGN"}
1
+ {"version":3,"file":"pages/BundleSize/components/cards.mjs","sources":["../../../../src/pages/BundleSize/components/cards.tsx"],"sourcesContent":["/* rslint-disable react/jsx-key */\nimport React, { useState, useMemo } from 'react';\nimport { Divider, Segmented, Avatar, Tree } from 'antd';\nimport { Client, SDK } from '@rsdoctor/types';\nimport { RightOutlined, FileFilled, GoldenFilled } from '@ant-design/icons';\n\nimport {\n formatSize,\n useDuplicatePackagesByErrors,\n useThemeToken,\n} from '../../../utils';\nimport { StatisticCard } from '../../../components/Card/statistic';\nimport { SizeCard, bgColorType } from '../../../components/Card/size';\nimport Overview from '../../../components/Overall/overview';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { getFiles } from '../../..//components/Overall';\nimport { TextDrawer } from '../../..//components/TextDrawer';\n\nimport styles from './card.module.scss';\n\nconst { DirectoryTree } = Tree;\nconst { innerWidth } = window;\n\ninterface CardProps {\n showProgress?: boolean;\n data: Client.RsdoctorClientAssetsSummary['all']['total'];\n total: number;\n tagBgColor?: string;\n type?: string;\n}\n\nconst AssetCard: React.FC<CardProps> = ({\n showProgress = false,\n data,\n total,\n tagBgColor,\n type,\n}) => {\n const token = useThemeToken();\n const _tagBgColor = tagBgColor || token.colorPrimaryBorderHover;\n return (\n <SizeCard\n type={type!}\n files={data.files}\n total={total}\n showProgress={showProgress}\n tagBgColor={_tagBgColor}\n />\n );\n};\n\nconst AssetCardContainer: React.FC<{\n type?: string;\n titles: string[];\n datas: CardProps[];\n bgColor?: bgColorType;\n}> = ({ titles, datas, bgColor, type }) => {\n const [selectedTitle, setSelectedTitle] = useState(titles[0]);\n const idx = useMemo(\n () => titles.indexOf(selectedTitle),\n [titles, selectedTitle],\n );\n const currentIdx = idx >= 0 ? idx : 0;\n const fileType = type || selectedTitle || titles[0];\n\n // Add bounds checking to prevent accessing undefined data\n const currentData =\n currentIdx >= 0 && currentIdx < datas.length\n ? datas[currentIdx]\n : datas[0] || {};\n\n return (\n <StatisticCard\n title={\n <div className={styles.cardTitle}>\n <div className={styles.title}>{fileType}</div>\n {titles.length > 1 ? (\n <Segmented\n defaultValue={titles[0]}\n options={titles}\n onChange={(value) => {\n setSelectedTitle(value as string);\n }}\n size=\"small\"\n style={{ transition: 'transform 0.3s ease' }}\n value={selectedTitle}\n />\n ) : null}\n </div>\n }\n value={\n <AssetCard\n type={fileType}\n {...currentData}\n tagBgColor={bgColor?.tagBgColor}\n />\n }\n boxProps={{\n style: {\n background: bgColor?.bgColor,\n width: innerWidth > 1300 ? '80%' : '95%',\n },\n }}\n />\n );\n};\n\nexport const BundleCards: React.FC<{\n cwd: string;\n errors: SDK.ErrorsData;\n summary: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetAssetsSummary>;\n}> = ({ errors, summary }) => {\n const duplicatePackages = useDuplicatePackagesByErrors(errors);\n const [totalSize, totalSizeUnit] = formatSize(summary.all.total.size).split(\n ' ',\n );\n\n const arr = [\n <AssetCardContainer\n type={'JS'}\n titles={['Total', 'Initial']}\n datas={[\n {\n data: summary.js.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.js.initial,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n <AssetCardContainer\n type={'CSS'}\n titles={['Total', 'Initial']}\n datas={[\n {\n data: summary.css.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.css.initial,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n <AssetCardContainer\n titles={['Images', 'Fonts', 'Media']}\n datas={[\n {\n data: summary.imgs.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.fonts.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n {\n data: summary.media.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n <AssetCardContainer\n type={'HTML'}\n titles={['HTML Files']}\n datas={[\n {\n data: summary.html.total,\n total: summary.all.total.size,\n showProgress: true,\n },\n ]}\n />,\n ];\n\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: false }}\n >\n {(res) => {\n const { treeData } = getFiles(res['all'].total);\n return (\n <div className={styles.container}>\n <div className={styles.summary}>\n <Overview\n title={\n <TextDrawer\n buttonProps={{\n size: 'small',\n }}\n buttonStyle={{\n fontSize: 'inherit',\n }}\n drawerProps={{\n title: 'Files',\n }}\n text={\n <div style={{ color: 'var(--text-color-secondary)' }}>\n <span style={{ marginRight: '5px' }}>Total Files</span>\n <RightOutlined />\n </div>\n }\n >\n <DirectoryTree\n defaultExpandAll\n selectable={false}\n treeData={treeData}\n rootStyle={{\n minHeight: '800px',\n border: '1px solid var(--color-border)',\n }}\n />\n </TextDrawer>\n }\n description={\n <>\n <span className={styles.description}>{totalSize}</span>\n <span className={styles.unit}>{totalSizeUnit}</span>\n <div className={styles.totalNumber}>\n <span style={{ marginRight: '7px' }}>\n Number of files\n </span>\n <span style={{ fontWeight: 500 }}>\n {summary.all.total.count}\n </span>\n </div>\n </>\n }\n icon={\n <Avatar\n style={{ background: '#3874F6' }}\n shape=\"circle\"\n icon={<FileFilled style={{ fontSize: '18px' }} />}\n />\n }\n style={{\n marginBottom: '12px',\n minWidth: '210px',\n }}\n />\n <Overview\n style={{ minWidth: '210px' }}\n title={\n <div style={{ margin: '4px 0' }}>\n <span style={{ marginRight: '5px' }}>\n Duplicate Packages\n </span>\n </div>\n }\n description={duplicatePackages.length}\n icon={\n <Avatar\n style={{ background: '#13C2C2' }}\n shape=\"circle\"\n icon={<GoldenFilled style={{ fontSize: '18px' }} />}\n />\n }\n />\n </div>\n <Divider style={{ height: '200px' }} type=\"vertical\" />\n <div className={styles.chartsContainer}>\n {arr.map((e, idx) => (\n <>\n <div key={idx} className={styles.chart}>\n {e}\n </div>\n {idx !== arr.length - 1 ? (\n <Divider\n key={`${idx}-divider`}\n style={{ height: '200px' }}\n type=\"vertical\"\n />\n ) : null}\n </>\n ))}\n </div>\n </div>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["DirectoryTree","Tree","innerWidth","window","AssetCard","showProgress","data","total","tagBgColor","type","token","useThemeToken","_tagBgColor","SizeCard","AssetCardContainer","titles","datas","bgColor","selectedTitle","setSelectedTitle","useState","idx","useMemo","currentIdx","fileType","currentData","StatisticCard","styles","Segmented","value","BundleCards","errors","summary","duplicatePackages","useDuplicatePackagesByErrors","totalSize","totalSizeUnit","formatSize","arr","ServerAPIProvider","SDK","res","treeData","getFiles","Overview","TextDrawer","RightOutlined","Avatar","FileFilled","GoldenFilled","Divider","e"],"mappings":";;;;;;;;;;;;;AAoBA,MAAM,EAAEA,eAAAA,aAAa,EAAE,GAAGC;AAC1B,MAAM,EAAEC,YAAAA,gBAAU,EAAE,GAAGC;AAUvB,MAAMC,YAAiC,CAAC,EACtCC,eAAe,KAAK,EACpBC,IAAI,EACJC,KAAK,EACLC,UAAU,EACVC,IAAI,EACL;IACC,MAAMC,QAAQC;IACd,MAAMC,cAAcJ,cAAcE,MAAM,uBAAuB;IAC/D,OAAO,WAAP,GACE,IAACG,UAAQA;QACP,MAAMJ;QACN,OAAOH,KAAK,KAAK;QACjB,OAA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,UAAU;gCACZ;;0CAEF,IAACJ,UAAQA;gCACP,OAAO;oCAAE,UAAU;gCAAQ;gCAC3B,qBACE,IAAC;oCAAI,OAAO;wCAAE,QAAQ;oCAAQ;8CAC5B,kBAAC;wCAAK,OAAO;4CAAE,aAAa;wCAAM;kDAAG;;;gCAKzC,aAAaX,kBAAkB,MAAM;gCACrC,oBACE,IAACc,QAAMA;oCACL,OAAO;wCAAE,YAAY;oCAAU;oCAC/B,OAAM;oCACN,oBAAM,IAACE,cAAYA;wCAAC,OAAO;4CAAE,UAAU;wCAAO;;;;;;kCAKtD,IAACC,SAAOA;wBAAC,OAAO;4BAAE,QAAQ;wBAAQ;wBAAG,MAAK;;kCAC1C,IAAC;wBAAI,WAAWvB,YAAAA,eAAsB;kCACnCW,IAAI,GAAG,CAAC,CAACa,GAAG9B,MAAAA,WAAAA,GACX;;kDACE,IAAC;wCAAc,WAAWM,YAAAA,KAAY;kDACnCwB;uCADO9B;oCAGTA,QAAQiB,IAAI,MAAM,GAAG,IAAI,WAAJ,GACpB,IAACY,SAAOA;wCAEN,OAAO;4CAAE,QAAQ;wCAAQ;wCACzB,MAAK;uCAFA,GAAG7B,IAAI,QAAQ,CAAC,IAIrB;;;;;;QAMhB;;AAGN"}
@@ -5,7 +5,7 @@ import { Button, Card, Col, Row, Space, Tabs, Tag, Tooltip, Typography } from "a
5
5
  import react, { useId } from "react";
6
6
  import { ServerAPIProvider } from "../../../components/Manifest/index.mjs";
7
7
  import { useProjectInfo } from "../../../components/Layout/project-info-context.mjs";
8
- import { flattenTreemapData, usePersistedState } from "../../../utils/index.mjs";
8
+ import { flattenTreemapData, usePersistedState, useTheme } from "../../../utils/index.mjs";
9
9
  import { BundleCards } from "./cards.mjs";
10
10
  import index_module from "./index.module.mjs";
11
11
  import "./index.css";
@@ -17,6 +17,8 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
17
17
  const [expanded, setExpanded] = usePersistedState('bundle-size-tabs-card-expanded', false);
18
18
  const cardDomId = useId();
19
19
  const expandActionText = expanded ? 'Shrink card' : 'Expand card';
20
+ const { isLight } = useTheme();
21
+ const treeGraphTooltipColor = isLight ? 'white' : void 0;
20
22
  return /*#__PURE__*/ jsxs(Fragment, {
21
23
  children: [
22
24
  /*#__PURE__*/ jsx(react.Activity, {
@@ -65,10 +67,10 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
65
67
  marginLeft: 16,
66
68
  padding: 10
67
69
  },
68
- color: "white",
70
+ color: treeGraphTooltipColor,
69
71
  title: /*#__PURE__*/ jsxs(Space, {
70
72
  direction: "vertical",
71
- color: "white",
73
+ color: treeGraphTooltipColor,
72
74
  size: "middle",
73
75
  children: [
74
76
  /*#__PURE__*/ jsx(Row, {
@@ -111,7 +113,7 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
111
113
  maxWidth: 408
112
114
  },
113
115
  placement: "bottom",
114
- color: "white",
116
+ color: treeGraphTooltipColor,
115
117
  title: /*#__PURE__*/ jsx(Space, {
116
118
  direction: "vertical",
117
119
  color: "white",
@@ -129,11 +131,12 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
129
131
  })
130
132
  })
131
133
  }),
132
- children: /*#__PURE__*/ jsx(InfoCircleOutlined, {
134
+ children: /*#__PURE__*/ jsx(Typography.Text, {
135
+ type: "secondary",
133
136
  style: {
134
- color: 'rgba(0,0,0,.45)',
135
137
  marginLeft: 4
136
- }
138
+ },
139
+ children: /*#__PURE__*/ jsx(InfoCircleOutlined, {})
137
140
  })
138
141
  }),
139
142
  /*#__PURE__*/ jsx(Typography.Text, {
@@ -204,7 +207,7 @@ const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
204
207
  }),
205
208
  children: /*#__PURE__*/ jsx(InfoCircleOutlined, {
206
209
  style: {
207
- color: 'rgba(0,0,0,.45)'
210
+ color: 'var(--text-color-secondary)'
208
211
  }
209
212
  })
210
213
  })
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/index.mjs","sources":["../../../../src/pages/BundleSize/components/index.tsx"],"sourcesContent":["import {\n CodepenCircleOutlined,\n DeploymentUnitOutlined,\n InfoCircleOutlined,\n ShrinkOutlined,\n ArrowsAltOutlined,\n} from '@ant-design/icons';\nimport { type Client, SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Row,\n Space,\n Tag,\n Tooltip,\n Typography,\n Tabs,\n} from 'antd';\nimport React, { useId } from 'react';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { useProjectInfo } from '../../../components/Layout/project-info-context';\nimport { flattenTreemapData, usePersistedState } from '../../../utils';\nimport { BundleCards } from './cards';\nimport styles from './index.module.scss';\nimport './index.sass';\nimport {\n AssetTreemapWithFilter,\n TreeNode,\n} from 'src/components/Charts/TreeMap';\nimport { Rspack } from '@rsdoctor/utils/common';\nimport { TreeGraph } from './tree-graph';\nimport { isJavaScriptAsset } from '../../../utils/assets';\n\ninterface WebpackModulesOverallProps {\n cwd: string;\n errors: SDK.ErrorsData;\n summary: Client.RsdoctorClientAssetsSummary;\n entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;\n}\n\nexport const WebpackModulesOverallBase: React.FC<\n WebpackModulesOverallProps\n> = ({ errors, cwd, summary, entryPoints }) => {\n const [expanded, setExpanded] = usePersistedState(\n 'bundle-size-tabs-card-expanded',\n false,\n );\n const cardDomId = useId();\n const expandActionText = expanded ? 'Shrink card' : 'Expand card';\n return (\n <>\n <React.Activity mode={expanded ? 'hidden' : 'visible'}>\n <BundleCards cwd={cwd} errors={errors} summary={summary} />\n </React.Activity>\n <Card\n className={styles.root}\n classNames={{ body: styles.rootBody }}\n id={cardDomId}\n >\n <Tabs\n size=\"middle\"\n className={styles.tabsRoot}\n tabBarExtraContent={{\n right: (\n <Tooltip\n // the content collapses/expands, but the cursor stays at the same position (outside the button now, cause layout has shifted)\n // antd doesn't know that and keeps the tooltip open, so we need to force rerender it on every state change\n key={String(expanded)}\n title={expandActionText}\n >\n <Button\n // TODO:: does it make sense here? the content basically stays the same and we're actually controlling other elements\n aria-controls={cardDomId}\n aria-expanded={expanded}\n aria-label={expandActionText}\n onClick={() => setExpanded(!expanded)}\n icon={expanded ? <ShrinkOutlined /> : <ArrowsAltOutlined />}\n size=\"small\"\n ></Button>\n </Tooltip>\n ),\n }}\n items={[\n {\n key: 'tree',\n label: (\n <Space>\n <Typography.Text>Tree Graph</Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 380 }}\n overlayInnerStyle={{ marginLeft: 16, padding: 10 }}\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\" size=\"middle\">\n <Row>\n <Col>\n <Tag color=\"cyan\" style={{ margin: 0 }}>\n initial\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the chunk is an initial chunk.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color=\"green\" style={{ margin: 0 }}>\n concatenated\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the module is a concatenated\n module\n </Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 408 }}\n placement=\"bottom\"\n color=\"white\"\n title={\n <Space direction=\"vertical\" color=\"white\">\n <Row>\n <Col>\n <Typography.Text strong>\n Concatenated Module\n </Typography.Text>\n <Typography.Text>\n : A performance optimization where\n multiple modules are merged (or\n \"hoisted\") into a single scope instead\n of wrapping each module in separate\n function closures. This reduces the\n bundle size and improves runtime\n performance by minimizing function call\n overhead.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined\n style={{\n color: 'rgba(0,0,0,.45)',\n marginLeft: 4,\n }}\n />\n </Tooltip>\n <Typography.Text>.</Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button\n size=\"small\"\n icon={<CodepenCircleOutlined />}\n />\n <Typography.Text style={{ marginLeft: 4 }}>\n Open the code.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button\n size=\"small\"\n icon={<DeploymentUnitOutlined />}\n />\n <Typography.Text style={{ marginLeft: 4 }}>\n View the module dependency, that is, module\n reasons in stats.json.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'purple'}>{'Bundled: 15.77 KB'}</Tag>\n <Typography.Text>\n The final size of the output files after\n processing, bundling, and optimization. This is\n what is delivered to the browser.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'orange'}>{'Source: 60.46 KB'}</Tag>\n <Typography.Text>\n The original size of your source code files before\n any processing or transformations. This is the raw\n size of your code as you wrote it.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined style={{ color: 'rgba(0,0,0,.45)' }} />\n </Tooltip>\n </Space>\n ),\n children: (\n <TreeGraph\n entryPoints={entryPoints}\n cwd={cwd}\n summary={summary}\n />\n ),\n },\n {\n key: 'treemap',\n label: 'Treemap',\n children: (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetProjectInfo}>\n {(data) => {\n const { isRspack, hasSourceMap } =\n Rspack.checkSourceMapSupport(data.configs);\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetSummaryBundles}\n >\n {(data) => {\n // Filter assets to only show JS (js, cjs, mjs), .bundle, CSS, and HTML files\n const isVisibleTreemapAsset = (filePath: string) => {\n const ext =\n filePath.toLowerCase().split('.').pop() || '';\n return (\n isJavaScriptAsset(filePath) ||\n ext === 'css' ||\n ext === 'html'\n );\n };\n\n const computedTreeData: TreeNode[] = data\n .filter((item) =>\n isVisibleTreemapAsset(item.asset.path),\n )\n .map((item) => {\n const moduleTree = flattenTreemapData(\n item.modules,\n );\n const hasModules = item.modules.length > 0;\n return {\n name: item.asset.path,\n sourceSize: hasModules\n ? (moduleTree.sourceSize ?? 0)\n : item.asset.size,\n bundledSize: item.asset.size,\n gzipSize: item.asset.gzipSize ?? 0,\n children: moduleTree.children,\n };\n });\n return (\n <AssetTreemapWithFilter\n treeData={computedTreeData}\n bundledSize={hasSourceMap || isRspack}\n />\n );\n }}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n ),\n },\n ]}\n defaultActiveKey=\"tree\"\n />\n </Card>\n </>\n );\n};\n\nexport const WebpackModulesOverall: React.FC = () => {\n const { project } = useProjectInfo();\n\n if (!project) {\n return null;\n }\n\n const { root, errors } = project;\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: true }}\n >\n {(summary) => {\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetEntryPoints}>\n {(entryPoints) => (\n <WebpackModulesOverallBase\n cwd={root}\n errors={errors}\n summary={summary}\n entryPoints={entryPoints}\n />\n )}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["WebpackModulesOverallBase","errors","cwd","summary","entryPoints","expanded","setExpanded","usePersistedState","cardDomId","useId","expandActionText","React","BundleCards","Card","styles","Tabs","Tooltip","Button","ShrinkOutlined","ArrowsAltOutlined","String","Space","Typography","Row","Col","Tag","InfoCircleOutlined","CodepenCircleOutlined","DeploymentUnitOutlined","TreeGraph","ServerAPIProvider","SDK","data","isRspack","hasSourceMap","Rspack","isVisibleTreemapAsset","filePath","ext","isJavaScriptAsset","computedTreeData","item","moduleTree","flattenTreemapData","hasModules","AssetTreemapWithFilter","WebpackModulesOverall","project","useProjectInfo","root"],"mappings":";;;;;;;;;;;;;;;AAyCO,MAAMA,4BAET,CAAC,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,WAAW,EAAE;IACxC,MAAM,CAACC,UAAUC,YAAY,GAAGC,kBAC9B,kCACA;IAEF,MAAMC,YAAYC;IAClB,MAAMC,mBAAmBL,WAAW,gBAAgB;IACpD,OAAO,WAAP,GACE;;0BACE,IAACM,MAAAA,QAAc;gBAAC,MAAMN,WAAW,WAAW;0BAC1C,kBAACO,aAAWA;oBAAC,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AP,GACE,IAAC2B,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;0BACrD,CAAC3B,cAAAA,WAAAA,GACA,IAACJ,2BAAyBA;wBACxB,KAAKiD;wBACL,QAAQhD;wBACR,SAASE;wBACT,aAAaC;;;;AAQ7B"}
1
+ {"version":3,"file":"pages/BundleSize/components/index.mjs","sources":["../../../../src/pages/BundleSize/components/index.tsx"],"sourcesContent":["import {\n CodepenCircleOutlined,\n DeploymentUnitOutlined,\n InfoCircleOutlined,\n ShrinkOutlined,\n ArrowsAltOutlined,\n} from '@ant-design/icons';\nimport { type Client, SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Row,\n Space,\n Tag,\n Tooltip,\n Typography,\n Tabs,\n} from 'antd';\nimport React, { useId } from 'react';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { useProjectInfo } from '../../../components/Layout/project-info-context';\nimport {\n flattenTreemapData,\n usePersistedState,\n useTheme,\n} from '../../../utils';\nimport { BundleCards } from './cards';\nimport styles from './index.module.scss';\nimport './index.sass';\nimport {\n AssetTreemapWithFilter,\n TreeNode,\n} from 'src/components/Charts/TreeMap';\nimport { Rspack } from '@rsdoctor/utils/common';\nimport { TreeGraph } from './tree-graph';\nimport { isJavaScriptAsset } from '../../../utils/assets';\n\ninterface WebpackModulesOverallProps {\n cwd: string;\n errors: SDK.ErrorsData;\n summary: Client.RsdoctorClientAssetsSummary;\n entryPoints: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetEntryPoints>;\n}\n\nexport const WebpackModulesOverallBase: React.FC<\n WebpackModulesOverallProps\n> = ({ errors, cwd, summary, entryPoints }) => {\n const [expanded, setExpanded] = usePersistedState(\n 'bundle-size-tabs-card-expanded',\n false,\n );\n const cardDomId = useId();\n const expandActionText = expanded ? 'Shrink card' : 'Expand card';\n const { isLight } = useTheme();\n // In light mode the tooltip's background is dark and the text is also dark cause Typography is used inside. dark mode is ok\n const treeGraphTooltipColor = isLight ? 'white' : undefined;\n return (\n <>\n <React.Activity mode={expanded ? 'hidden' : 'visible'}>\n <BundleCards cwd={cwd} errors={errors} summary={summary} />\n </React.Activity>\n <Card\n className={styles.root}\n classNames={{ body: styles.rootBody }}\n id={cardDomId}\n >\n <Tabs\n size=\"middle\"\n className={styles.tabsRoot}\n tabBarExtraContent={{\n right: (\n <Tooltip\n // the content collapses/expands, but the cursor stays at the same position (outside the button now, cause layout has shifted)\n // antd doesn't know that and keeps the tooltip open, so we need to force rerender it on every state change\n key={String(expanded)}\n title={expandActionText}\n >\n <Button\n // TODO:: does it make sense here? the content basically stays the same and we're actually controlling other elements\n aria-controls={cardDomId}\n aria-expanded={expanded}\n aria-label={expandActionText}\n onClick={() => setExpanded(!expanded)}\n icon={expanded ? <ShrinkOutlined /> : <ArrowsAltOutlined />}\n size=\"small\"\n ></Button>\n </Tooltip>\n ),\n }}\n items={[\n {\n key: 'tree',\n label: (\n <Space>\n <Typography.Text>Tree Graph</Typography.Text>\n <Tooltip\n overlayStyle={{ maxWidth: 380 }}\n overlayInnerStyle={{ marginLeft: 16, padding: 10 }}\n color={treeGraphTooltipColor}\n title={\n <Space\n direction=\"vertical\"\n color={treeGraphTooltipColor}\n size=\"middle\"\n >\n <Row>\n <Col>\n <Tag color=\"cyan\" style={{ margin: 0 }}>\n initial\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the chunk is an initial chunk.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color=\"green\" style={{ margin: 0 }}>\n concatenated\n </Tag>\n <Typography.Text style={{ marginLeft: 4 }}>\n Identify whether the module is a concatenated\n module\n </Typography.Text>\n {/* TODO:: it's literally a tooltip inside another tooltip */}\n <Tooltip\n overlayStyle={{ maxWidth: 408 }}\n placement=\"bottom\"\n color={treeGraphTooltipColor}\n title={\n <Space direction=\"vertical\" color=\"white\">\n <Row>\n <Col>\n <Typography.Text strong>\n Concatenated Module\n </Typography.Text>\n <Typography.Text>\n : A performance optimization where\n multiple modules are merged (or\n \"hoisted\") into a single scope instead\n of wrapping each module in separate\n function closures. This reduces the\n bundle size and improves runtime\n performance by minimizing function call\n overhead.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <Typography.Text\n type=\"secondary\"\n style={{ marginLeft: 4 }}\n >\n <InfoCircleOutlined />\n </Typography.Text>\n </Tooltip>\n <Typography.Text>.</Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button\n size=\"small\"\n icon={<CodepenCircleOutlined />}\n />\n <Typography.Text style={{ marginLeft: 4 }}>\n Open the code.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Button\n size=\"small\"\n icon={<DeploymentUnitOutlined />}\n />\n <Typography.Text style={{ marginLeft: 4 }}>\n View the module dependency, that is, module\n reasons in stats.json.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'purple'}>{'Bundled: 15.77 KB'}</Tag>\n <Typography.Text>\n The final size of the output files after\n processing, bundling, and optimization. This is\n what is delivered to the browser.\n </Typography.Text>\n </Col>\n </Row>\n <Row>\n <Col>\n <Tag color={'orange'}>{'Source: 60.46 KB'}</Tag>\n <Typography.Text>\n The original size of your source code files before\n any processing or transformations. This is the raw\n size of your code as you wrote it.\n </Typography.Text>\n </Col>\n </Row>\n </Space>\n }\n >\n <InfoCircleOutlined\n style={{ color: 'var(--text-color-secondary)' }}\n />\n </Tooltip>\n </Space>\n ),\n children: (\n <TreeGraph\n entryPoints={entryPoints}\n cwd={cwd}\n summary={summary}\n />\n ),\n },\n {\n key: 'treemap',\n label: 'Treemap',\n children: (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetProjectInfo}>\n {(data) => {\n const { isRspack, hasSourceMap } =\n Rspack.checkSourceMapSupport(data.configs);\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetSummaryBundles}\n >\n {(data) => {\n // Filter assets to only show JS (js, cjs, mjs), .bundle, CSS, and HTML files\n const isVisibleTreemapAsset = (filePath: string) => {\n const ext =\n filePath.toLowerCase().split('.').pop() || '';\n return (\n isJavaScriptAsset(filePath) ||\n ext === 'css' ||\n ext === 'html'\n );\n };\n\n const computedTreeData: TreeNode[] = data\n .filter((item) =>\n isVisibleTreemapAsset(item.asset.path),\n )\n .map((item) => {\n const moduleTree = flattenTreemapData(\n item.modules,\n );\n const hasModules = item.modules.length > 0;\n return {\n name: item.asset.path,\n sourceSize: hasModules\n ? (moduleTree.sourceSize ?? 0)\n : item.asset.size,\n bundledSize: item.asset.size,\n gzipSize: item.asset.gzipSize ?? 0,\n children: moduleTree.children,\n };\n });\n return (\n <AssetTreemapWithFilter\n treeData={computedTreeData}\n bundledSize={hasSourceMap || isRspack}\n />\n );\n }}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n ),\n },\n ]}\n defaultActiveKey=\"tree\"\n />\n </Card>\n </>\n );\n};\n\nexport const WebpackModulesOverall: React.FC = () => {\n const { project } = useProjectInfo();\n\n if (!project) {\n return null;\n }\n\n const { root, errors } = project;\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetAssetsSummary}\n body={{ withFileContent: true }}\n >\n {(summary) => {\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetEntryPoints}>\n {(entryPoints) => (\n <WebpackModulesOverallBase\n cwd={root}\n errors={errors}\n summary={summary}\n entryPoints={entryPoints}\n />\n )}\n </ServerAPIProvider>\n );\n }}\n </ServerAPIProvider>\n );\n};\n"],"names":["WebpackModulesOverallBase","errors","cwd","summary","entryPoints","expanded","setExpanded","usePersistedState","cardDomId","useId","expandActionText","isLight","useTheme","treeGraphTooltipColor","undefined","React","BundleCards","Card","styles","Tabs","Tooltip","Button","ShrinkOutlined","ArrowsAltOutlined","String","Space","Typography","Row","Col","Tag","InfoCircleOutlined","CodepenCircleOutlined","DeploymentUnitOutlined","TreeGraph","ServerAPIProvider","SDK","data","isRspack","hasSourceMap","Rspack","isVisibleTreemapAsset","filePath","ext","isJavaScriptAsset","computedTreeData","item","moduleTree","flattenTreemapData","hasModules","AssetTreemapWithFilter","WebpackModulesOverall","project","useProjectInfo","root"],"mappings":";;;;;;;;;;;;;;;AA6CO,MAAMA,4BAET,CAAC,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,WAAW,EAAE;IACxC,MAAM,CAACC,UAAUC,YAAY,GAAGC,kBAC9B,kCACA;IAEF,MAAMC,YAAYC;IAClB,MAAMC,mBAAmBL,WAAW,gBAAgB;IACpD,MAAM,EAAEM,OAAO,EAAE,GAAGC;IAEpB,MAAMC,wBAAwBF,UAAU,UAAUG;IAClD,OAAO,WAAP,GACE;;0BACE,IAACC,MAAAA,QAAc;gBAAC,MAAMV,WAAW,WAAW;0BAC1C,kBAACW,aAAWA;oBAAC,KAAKd;oBAAK,QAAQD;oBAAQ,SAASE;;;0BAElD,IAACc,MAAIA;gBACH,WAAWC,aAAAA,IAAW;gBACtB,YAAY;oBAAE,MAAMA,aAAAA,QAAe;gBAAC;gBACpC,IAAIV;0BAEJ,kBAACW,MAAIA;oBACH,MAAK;oBACL,WAAWD,aAAAA,QAAe;oBAC1B,oBAAoB;wBAClB,OAAO,WAAP,GACE,IAACE,SAAOA;4BAIN,OAAOV;sCAEP,kBAACW,QAAMA;gCAEL,iBAAeb;gCACf,iBAAeH;gCACf,cAAYK;gCACZ,SAAS,IAAMJ,YAAY,CAACD;gCAC5B,MAAMA,WAAW,WAAXA,GAAW,IAACiB,gBAAcA,CAAAA,KAAAA,WAAAA,GAAM,IAACC,mBAAiBA,CAAAA;gCACxD,MAAK;;2BAVFC,OAAOnB;oBAclB;oBACA,OAAO;wBACL;4BACE,KAAK;4BACL,OAAO,WAAP,GACE,KAACoB,OAAKA;;kDACJ,IAACC,WAAW,IAAI;kDAAC;;kDACjB,IAACN,SAAOA;wCACN,cAAc;4CAAE,UAAU;wCAAI;wCAC9B,mBAAmB;4CAAE,YAAY;4CAAI,SAAS;wCAAG;wCACjD,O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,KAAK,KAAK,CAAC,IAAI;oDAC5B,UAAUA,KAAK,KAAK,CAAC,QAAQ,IAAI;oDACjC,UAAUC,WAAW,QAAQ;gDAC/B;4CACF;4CACF,OAAO,WAAP,GACE,IAACG,wBAAsBA;gDACrB,UAAUL;gDACV,aAAaN,gBAAgBD;;wCAGnC;;gCAGN;;wBAGN;qBACD;oBACD,kBAAiB;;;;;AAK3B;AAEO,MAAMa,wBAAkC;IAC7C,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,SACH,OAAO;IAGT,MAAM,EAAEE,IAAI,EAAEpD,MAAM,EAAE,GAAGkD;IACzB,OAAO,WAAP,GACE,IAACjB,mBAAiBA;QAChB,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,gBAAgB;QACvC,MAAM;YAAE,iBAAiB;QAAK;kBAE7B,CAAChC,UACO,WAAP,GACE,IAAC+B,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;0BACrD,CAAC/B,cAAAA,WAAAA,GACA,IAACJ,2BAAyBA;wBACxB,KAAKqD;wBACL,QAAQpD;wBACR,SAASE;wBACT,aAAaC;;;;AAQ7B"}
@@ -13,12 +13,7 @@ const index_module = {
13
13
  assets: "assets-ll1P_L",
14
14
  assetBox: "assetBox-Y8vGse",
15
15
  fileText: "fileText-W0quVZ",
16
- assetsTag: "assetsTag-eAVvyj",
17
- modal: "modal-afyzYa",
18
- "search-btn": "search-btn-To902q",
19
- searchBtn: "search-btn-To902q",
20
- "search-modal-list": "search-modal-list-G_Uxc8",
21
- searchModalList: "search-modal-list-G_Uxc8"
16
+ assetsTag: "assetsTag-eAVvyj"
22
17
  };
23
18
  export default index_module;
24
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/index.module.mjs","sources":["../../../../src/pages/BundleSize/components/index.module.scss"],"sourcesContent":["// extracted by LIB_CSS_EXTRACT_LOADER\nimport \"./index_module.css\"\nexport default {\"root\":\"root-DgXuux\",\"rootBody\":\"rootBody-xGjkG7\",\"treeGraph\":\"treeGraph-LllSyP\",\"tabsRoot\":\"tabsRoot-gPEaze\",\"assetDetailCol\":\"assetDetailCol-jwyTZJ\",\"assetDetailFileTreeRoot\":\"assetDetailFileTreeRoot-RBNnA8\",\"assetDetailFileTreeBody\":\"assetDetailFileTreeBody-kRMd_h\",\"assetDetailFileTreeViewport\":\"assetDetailFileTreeViewport-USNF6e\",\"assetDetailRoot\":\"assetDetailRoot-dgQPS5\",\"assetDetailFileTreeScrollArea\":\"assetDetailFileTreeScrollArea-IqDzT3\",\"assets\":\"assets-ll1P_L\",\"assetBox\":\"assetBox-Y8vGse\",\"fileText\":\"fileText-W0quVZ\",\"assetsTag\":\"assetsTag-eAVvyj\",\"modal\":\"modal-afyzYa\",\"search-btn\":\"search-btn-To902q\",\"searchBtn\":\"search-btn-To902q\",\"search-modal-list\":\"search-modal-list-G_Uxc8\",\"searchModalList\":\"search-modal-list-G_Uxc8\"};"],"names":[],"mappings":";AAEA,qBAAe;IAAC,MAAO;IAAc,UAAW;IAAkB,WAAY;IAAmB,UAAW;IAAkB,gBAAiB;IAAwB,yBAA0B;IAAiC,yBAA0B;IAAiC,6BAA8B;IAAqC,iBAAkB;IAAyB,+BAAgC;IAAuC,QAAS;IAAgB,UAAW;IAAkB,UAAW;IAAkB,WAAY;IAAmB,OAAQ;IAAe,cAAa;IAAoB,WAAY;IAAoB,qBAAoB;IAA2B,iBAAkB;AAA0B"}
1
+ {"version":3,"file":"pages/BundleSize/components/index.module.mjs","sources":["../../../../src/pages/BundleSize/components/index.module.scss"],"sourcesContent":["// extracted by LIB_CSS_EXTRACT_LOADER\nimport \"./index_module.css\"\nexport default {\"root\":\"root-DgXuux\",\"rootBody\":\"rootBody-xGjkG7\",\"treeGraph\":\"treeGraph-LllSyP\",\"tabsRoot\":\"tabsRoot-gPEaze\",\"assetDetailCol\":\"assetDetailCol-jwyTZJ\",\"assetDetailFileTreeRoot\":\"assetDetailFileTreeRoot-RBNnA8\",\"assetDetailFileTreeBody\":\"assetDetailFileTreeBody-kRMd_h\",\"assetDetailFileTreeViewport\":\"assetDetailFileTreeViewport-USNF6e\",\"assetDetailRoot\":\"assetDetailRoot-dgQPS5\",\"assetDetailFileTreeScrollArea\":\"assetDetailFileTreeScrollArea-IqDzT3\",\"assets\":\"assets-ll1P_L\",\"assetBox\":\"assetBox-Y8vGse\",\"fileText\":\"fileText-W0quVZ\",\"assetsTag\":\"assetsTag-eAVvyj\"};"],"names":[],"mappings":";AAEA,qBAAe;IAAC,MAAO;IAAc,UAAW;IAAkB,WAAY;IAAmB,UAAW;IAAkB,gBAAiB;IAAwB,yBAA0B;IAAiC,yBAA0B;IAAiC,6BAA8B;IAAqC,iBAAkB;IAAyB,+BAAgC;IAAuC,QAAS;IAAgB,UAAW;IAAkB,UAAW;IAAkB,WAAY;AAAkB"}
@@ -86,42 +86,5 @@
86
86
  margin-inline: 0;
87
87
  }
88
88
 
89
- .modal-afyzYa .ant-input-affix-wrapper {
90
- width: 490px;
91
- padding: 4px 5px;
92
- }
93
-
94
- .search-btn-To902q {
95
- color: #fff;
96
- }
97
-
98
- .search-btn-To902q > span {
99
- position: relative;
100
- }
101
-
102
- .search-btn-To902q:before {
103
- content: "";
104
- opacity: 1;
105
- border-radius: inherit;
106
- background: linear-gradient(135deg, #6253e1, #04befe);
107
- transition: all .3s;
108
- position: absolute;
109
- inset: -1px;
110
- }
111
-
112
- .search-btn-To902q:hover:before {
113
- opacity: 0;
114
- }
115
-
116
- .search-modal-list-G_Uxc8 .ant-spin-container {
117
- max-height: 30rem;
118
- overflow: auto;
119
- }
120
-
121
- .search-modal-list-G_Uxc8 .search-list-item.clickable:hover {
122
- cursor: pointer;
123
- background-color: #eee;
124
- }
125
-
126
89
 
127
90
  /*# sourceMappingURL=index_module.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/pages/BundleSize/components/index.module.scss"],"names":[],"mappings":"AAAA;EACE,cAAc;AAChB;;AAF8B;EAK5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AAR8B;EAW5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AAd8B;EAiB5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AApB8B;EAuB5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AA1ByU;EA6BvU,YAAY;AACd;;AA9BgW;EAiC9V,+BAA+B;EAC/B,OAAO;EACP,8BAA8B;EAC9B,aAAa;AACf;;AArCkc;EAwChc,kBAAkB;AACpB;;AAzCif;EA4C/e,kBAAkB;EAClB,QAAQ;EACR,cAAc;AAChB;;AA/CwjB;EAkDtjB,WAAW;AACb;;AAnDwmB;EAsDtmB,4BAA4B;AAC9B;;AAvDsqB;EA0DpqB,kBAAkB;EAClB,WAAW;AACb;;AA5Dk0B;EA+Dh0B,eAAe;AACjB;;AAhE49B;EAmE19B,cAAc;EACd,iBAAiB;AACnB;;AArEqnC;EAwEnnC,mBAAmB;EACnB,aAAa;AACf;;AA1EuqC;EA6ErqC,iBAAiB;AACnB;;AA9EotC;EAiFltC,YAAY;AACd;;AAlF2uC;EAqFzuC,gBAAgB;AAClB;;AAtFoyC;EAyFlyC,YAAY;EACZ,gBAAgB;AAClB;;AA3Fw2C;EA8Ft2C,WAAW;AACb;;AA/F+3C;EAkG73C,kBAAkB;AACpB;;AAnGk6C;EAsGh6C,WAAW;EACX,UAAU;EACV,sBAAsB;EACtB,qDAAqD;EACrD,mBAAmB;EACnB,kBAAkB;EAClB,WAAW;AACb;;AA7GskD;EAgHpkD,UAAU;AACZ;;AAjH0mD;EAoHxmD,iBAAiB;EACjB,cAAc;AAChB;;AAtHwrD;EAyHtrD,eAAe;EACf,sBAAsB;AACxB","sourcesContent":[".root .rootBody{padding-top:0}.root,.rootBody,.treeGraph,.tabsRoot,.assetDetailCol,.assetDetailFileTreeRoot,.assetDetailFileTreeBody,.assetDetailFileTreeViewport,.tabsRoot :global(.ant-tabs-content-holder),.tabsRoot :global(.ant-tabs-content),.tabsRoot :global(.ant-tabs-tabpane-active){display:flex;flex-direction:column;flex:1}.treeGraph{row-gap:8px}.assetDetailRoot{display:grid;column-gap:var(--spacing-base);grid-template-columns:1fr 3fr;flex:1}.assetDetailFileTreeViewport{position:relative}.assetDetailFileTreeScrollArea{position:absolute;inset:0;overflow:auto}.assets :global .rc-tree-indent-unit{width:22px}.assets :global .rc-tree-treenode{line-height:30px !important}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-switcher{position:relative;bottom:4px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-node-content-wrapper{font-size:14px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .file-icon{padding:10px 0 0 0;margin-left:0}.assets .assetBox{display:flex;align-items:center}.assets .assetBox .fileText{margin-right:4px}.assetsTag{height:30px}.assetsTag :global .ant-divider-vertical{margin-inline:0}.modal :global .ant-input-affix-wrapper{padding:4px 5px;width:490px}.search-btn{color:#fff}.search-btn>span{position:relative}.search-btn::before{content:\"\";background:linear-gradient(135deg, #6253e1, #04befe);position:absolute;inset:-1px;opacity:1;transition:all .3s;border-radius:inherit}.search-btn:hover::before{opacity:0}.search-modal-list :global .ant-spin-container{overflow:auto;max-height:30rem}.search-modal-list :global .search-list-item.clickable:hover{background-color:#eee;cursor:pointer}"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/pages/BundleSize/components/index.module.scss"],"names":[],"mappings":"AAAA;EACE,cAAc;AAChB;;AAF8B;EAK5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AAR8B;EAW5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AAd8B;EAiB5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AApB8B;EAuB5B,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AA1ByU;EA6BvU,YAAY;AACd;;AA9BgW;EAiC9V,+BAA+B;EAC/B,OAAO;EACP,8BAA8B;EAC9B,aAAa;AACf;;AArCkc;EAwChc,kBAAkB;AACpB;;AAzCif;EA4C/e,kBAAkB;EAClB,QAAQ;EACR,cAAc;AAChB;;AA/CwjB;EAkDtjB,WAAW;AACb;;AAnDwmB;EAsDtmB,4BAA4B;AAC9B;;AAvDsqB;EA0DpqB,kBAAkB;EAClB,WAAW;AACb;;AA5Dk0B;EA+Dh0B,eAAe;AACjB;;AAhE49B;EAmE19B,cAAc;EACd,iBAAiB;AACnB;;AArEqnC;EAwEnnC,mBAAmB;EACnB,aAAa;AACf;;AA1EuqC;EA6ErqC,iBAAiB;AACnB;;AA9EotC;EAiFltC,YAAY;AACd;;AAlF2uC;EAqFzuC,gBAAgB;AAClB","sourcesContent":[".root .rootBody{padding-top:0}.root,.rootBody,.treeGraph,.tabsRoot,.assetDetailCol,.assetDetailFileTreeRoot,.assetDetailFileTreeBody,.assetDetailFileTreeViewport,.tabsRoot :global(.ant-tabs-content-holder),.tabsRoot :global(.ant-tabs-content),.tabsRoot :global(.ant-tabs-tabpane-active){display:flex;flex-direction:column;flex:1}.treeGraph{row-gap:8px}.assetDetailRoot{display:grid;column-gap:var(--spacing-base);grid-template-columns:1fr 3fr;flex:1}.assetDetailFileTreeViewport{position:relative}.assetDetailFileTreeScrollArea{position:absolute;inset:0;overflow:auto}.assets :global .rc-tree-indent-unit{width:22px}.assets :global .rc-tree-treenode{line-height:30px !important}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-switcher{position:relative;bottom:4px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .rc-tree-node-content-wrapper{font-size:14px}.assets :global .rc-tree-treenode:not(.rc-tree-treenode-switcher-open):not(.rc-tree-treenode-switcher-close) .file-icon{padding:10px 0 0 0;margin-left:0}.assets .assetBox{display:flex;align-items:center}.assets .assetBox .fileText{margin-right:4px}.assetsTag{height:30px}.assetsTag :global .ant-divider-vertical{margin-inline:0}"],"sourceRoot":""}
@@ -3,7 +3,7 @@ import { useCallback, useState } from "react";
3
3
  import { Button, Empty, Input, List, Modal, Skeleton, Tabs, Typography } from "antd";
4
4
  import { ServerAPIProvider } from "../../../components/index.mjs";
5
5
  import { SDK } from "@rsdoctor/types";
6
- import index_module from "./index.module.mjs";
6
+ import search_modal_module from "./search-modal.module.mjs";
7
7
  import { SearchOutlined } from "@ant-design/icons";
8
8
  const { Search: Search } = Input;
9
9
  const SearchModal = ({ onModuleClick, onClose, open, setOpen, isIcon = false })=>{
@@ -32,7 +32,7 @@ const SearchModal = ({ onModuleClick, onClose, open, setOpen, isIcon = false })=
32
32
  isIcon ? /*#__PURE__*/ jsx(SearchOutlined, {
33
33
  onClick: showModal
34
34
  }) : /*#__PURE__*/ jsx(Button, {
35
- className: index_module["search-btn"],
35
+ className: search_modal_module.searchBtn,
36
36
  color: "cyan",
37
37
  onClick: showModal,
38
38
  children: "Search Module"
@@ -46,7 +46,7 @@ const SearchModal = ({ onModuleClick, onClose, open, setOpen, isIcon = false })=
46
46
  const defaultChunkId = Object.keys(assetsChunksList)[0];
47
47
  return /*#__PURE__*/ jsx(Fragment, {
48
48
  children: /*#__PURE__*/ jsxs(Modal, {
49
- className: index_module.modal,
49
+ className: search_modal_module.modal,
50
50
  title: "Search Modules",
51
51
  onOk: handleOk,
52
52
  onCancel: handleCancel,
@@ -97,7 +97,7 @@ const ModulesModal = (searchModule, chunk, onModuleClick)=>/*#__PURE__*/ jsx(Ser
97
97
  },
98
98
  children: (modules)=>/*#__PURE__*/ jsx(Fragment, {
99
99
  children: modules?.length !== 0 ? /*#__PURE__*/ jsx(List, {
100
- className: index_module["search-modal-list"],
100
+ className: search_modal_module.list,
101
101
  loading: !modules.length,
102
102
  itemLayout: "horizontal",
103
103
  pagination: {
@@ -108,7 +108,7 @@ const ModulesModal = (searchModule, chunk, onModuleClick)=>/*#__PURE__*/ jsx(Ser
108
108
  renderItem: (item)=>{
109
109
  const itemPathArr = item.relativePath.split(searchModule);
110
110
  return /*#__PURE__*/ jsx(List.Item, {
111
- className: onModuleClick ? 'search-list-item clickable' : 'search-list-item',
111
+ className: onModuleClick && search_modal_module.listItemInteractive,
112
112
  onClick: onModuleClick ? ()=>onModuleClick(item) : void 0,
113
113
  children: /*#__PURE__*/ jsx(Skeleton, {
114
114
  avatar: true,
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/search-modal.mjs","sources":["../../../../src/pages/BundleSize/components/search-modal.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport {\n Button,\n Modal,\n Input,\n Tabs,\n List,\n Skeleton,\n Typography,\n Empty,\n} from 'antd';\nimport { SearchProps } from 'antd/es/input';\nimport { ServerAPIProvider } from 'src/components';\nimport { SDK } from '@rsdoctor/types';\nimport styles from './index.module.scss';\nimport { SearchOutlined } from '@ant-design/icons';\n\nconst { Search } = Input;\n\ntype OnSearchParams = Parameters<NonNullable<SearchProps['onSearch']>>;\n\nexport const SearchModal: React.FC<{\n onModuleClick?: (module: any) => void;\n onClose?: () => void;\n open?: boolean;\n setOpen?: (open: boolean) => void;\n isIcon?: boolean;\n}> = ({\n onModuleClick = undefined,\n onClose,\n open,\n setOpen,\n isIcon = false,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [searchModule, setSearchModule] = useState('');\n const [searchChunk, setSearchChunk] = useState('');\n\n const modalOpen = open !== undefined ? open : isModalOpen;\n const setModalOpen = setOpen || setIsModalOpen;\n\n const onSearch: SearchProps['onSearch'] = useCallback(\n (...args: OnSearchParams) => {\n const [value, _event] = args;\n setSearchModule(value);\n },\n [],\n );\n\n const showModal = () => {\n setModalOpen(true);\n };\n\n const handleOk = () => {\n setModalOpen(false);\n onClose?.();\n };\n\n const handleCancel = () => {\n setModalOpen(false);\n onClose?.();\n };\n\n return (\n <>\n {isIcon ? (\n <SearchOutlined onClick={showModal} />\n ) : (\n <Button\n className={styles['search-btn']}\n color=\"cyan\"\n onClick={showModal}\n >\n Search Module\n </Button>\n )}\n\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetSearchModules}\n body={{ moduleName: String(searchModule) }}\n >\n {(assetsChunksList) => {\n const defaultChunkId = Object.keys(assetsChunksList)[0];\n return (\n <>\n <Modal\n className={styles.modal}\n title=\"Search Modules\"\n onOk={handleOk}\n onCancel={handleCancel}\n open={modalOpen}\n width={'65rem'}\n footer=\"\"\n >\n <Search\n placeholder=\"input search module name\"\n allowClear\n onSearch={onSearch}\n style={{ width: 500 }}\n />\n {defaultChunkId ? (\n <Tabs\n defaultActiveKey={defaultChunkId}\n tabPosition={'top'}\n onChange={(value) => setSearchChunk(value)}\n items={Object.keys(assetsChunksList).map((chunk, _i) => {\n const id = chunk;\n return {\n label: assetsChunksList[chunk],\n key: id,\n children: ModulesModal(\n searchModule,\n searchChunk || defaultChunkId,\n (item) => {\n onModuleClick?.(item);\n setModalOpen(false);\n onClose?.();\n },\n ),\n };\n })}\n />\n ) : (\n <Empty description={'No modules found.'} />\n )}\n </Modal>\n </>\n );\n }}\n </ServerAPIProvider>\n </>\n );\n};\n\nconst ModulesModal = (\n searchModule: string,\n chunk: string,\n onModuleClick?: (module: any) => void | undefined,\n) => {\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetSearchModuleInChunk}\n body={{ moduleName: String(searchModule), chunk }}\n >\n {(modules) => (\n <>\n {modules?.length !== 0 ? (\n <List\n className={styles['search-modal-list']}\n loading={!modules.length}\n itemLayout=\"horizontal\"\n pagination={{ position: 'bottom', align: 'center' }}\n dataSource={modules}\n renderItem={(item) => {\n const itemPathArr = item.relativePath.split(searchModule);\n return (\n <List.Item\n className={\n onModuleClick\n ? 'search-list-item clickable'\n : 'search-list-item'\n }\n key={`${item.path}-${item.relativePath}`}\n onClick={\n onModuleClick ? () => onModuleClick(item) : undefined\n }\n >\n <Skeleton avatar title={false} loading={!item.path} active>\n <List.Item.Meta\n key={`${item.path}-${item.relativePath}-meta`}\n description={\n <>\n <Typography.Text code>{'Module:'}</Typography.Text>\n {itemPathArr.map((cur, index) => {\n if (index < itemPathArr.length - 1) {\n return (\n <Typography.Text\n key={`${cur}-${index}`}\n style={{ fontWeight: 200 }}\n >\n {cur}\n <Typography.Text\n strong\n key={`${cur}-${index}-strong`}\n style={{ fontWeight: 600 }}\n >\n {searchModule}\n </Typography.Text>\n </Typography.Text>\n );\n }\n return (\n <Typography.Text style={{ fontWeight: 200 }}>\n {cur}\n </Typography.Text>\n );\n })}\n </>\n }\n />\n </Skeleton>\n </List.Item>\n );\n }}\n />\n ) : (\n <Empty />\n )}\n </>\n )}\n </ServerAPIProvider>\n );\n};\n"],"names":["Search","Input","SearchModal","onModuleClick","onClose","open","setOpen","isIcon","isModalOpen","setIsModalOpen","useState","searchModule","setSearchModule","searchChunk","setSearchChunk","modalOpen","undefined","setModalOpen","onSearch","useCallback","args","value","_event","showModal","handleOk","handleCancel","SearchOutlined","Button","styles","ServerAPIProvider","SDK","String","assetsChunksList","defaultChunkId","Object","Modal","Tabs","chunk","_i","id","ModulesModal","item","Empty","modules","List","itemPathArr","Skeleton","Typography","cur","index"],"mappings":";;;;;;;AAiBA,MAAM,EAAEA,QAAAA,MAAM,EAAE,GAAGC;AAIZ,MAAMC,cAMR,CAAC,EACJC,aAAyB,EACzBC,OAAO,EACPC,IAAI,EACJC,OAAO,EACPC,SAAS,KAAK,EACf;IACC,MAAM,CAACC,aAAaC,eAAe,GAAGC,SAAS;IAC/C,MAAM,CAACC,cAAcC,gBAAgB,GAAGF,SAAS;IACjD,MAAM,CAACG,aAAaC,eAAe,GAAGJ,SAAS;IAE/C,MAAMK,YAAYV,AAASW,WAATX,OAAqBA,OAAOG;IAC9C,MAAMS,eAAeX,WAAWG;IAEhC,MAAMS,WAAoCC,YACxC,CAAC,GAAGC;QACF,MAAM,CAACC,OAAOC,OAAO,GAAGF;QACxBR,gBAAg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AAC,KAAK,CAAC;;2BAP5C,GAAGA,KAAK,IAAI,CAAC,CAAC,EAAEA,KAAK,YAAY,EAAE;oBAyC9C;mCAGF,IAACC,OAAKA,CAAAA"}
1
+ {"version":3,"file":"pages/BundleSize/components/search-modal.mjs","sources":["../../../../src/pages/BundleSize/components/search-modal.tsx"],"sourcesContent":["import React, { useCallback, useState } from 'react';\nimport {\n Button,\n Modal,\n Input,\n Tabs,\n List,\n Skeleton,\n Typography,\n Empty,\n} from 'antd';\nimport { SearchProps } from 'antd/es/input';\nimport { ServerAPIProvider } from 'src/components';\nimport { SDK } from '@rsdoctor/types';\nimport styles from './search-modal.module.scss';\nimport { SearchOutlined } from '@ant-design/icons';\n\nconst { Search } = Input;\n\ntype OnSearchParams = Parameters<NonNullable<SearchProps['onSearch']>>;\n\nexport const SearchModal: React.FC<{\n onModuleClick?: (module: any) => void;\n onClose?: () => void;\n open?: boolean;\n setOpen?: (open: boolean) => void;\n isIcon?: boolean;\n}> = ({\n onModuleClick = undefined,\n onClose,\n open,\n setOpen,\n isIcon = false,\n}) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [searchModule, setSearchModule] = useState('');\n const [searchChunk, setSearchChunk] = useState('');\n\n const modalOpen = open !== undefined ? open : isModalOpen;\n const setModalOpen = setOpen || setIsModalOpen;\n\n const onSearch: SearchProps['onSearch'] = useCallback(\n (...args: OnSearchParams) => {\n const [value, _event] = args;\n setSearchModule(value);\n },\n [],\n );\n\n const showModal = () => {\n setModalOpen(true);\n };\n\n const handleOk = () => {\n setModalOpen(false);\n onClose?.();\n };\n\n const handleCancel = () => {\n setModalOpen(false);\n onClose?.();\n };\n\n return (\n <>\n {isIcon ? (\n <SearchOutlined onClick={showModal} />\n ) : (\n <Button className={styles.searchBtn} color=\"cyan\" onClick={showModal}>\n Search Module\n </Button>\n )}\n\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetSearchModules}\n body={{ moduleName: String(searchModule) }}\n >\n {(assetsChunksList) => {\n const defaultChunkId = Object.keys(assetsChunksList)[0];\n return (\n <>\n <Modal\n className={styles.modal}\n title=\"Search Modules\"\n onOk={handleOk}\n onCancel={handleCancel}\n open={modalOpen}\n width={'65rem'}\n footer=\"\"\n >\n <Search\n placeholder=\"input search module name\"\n allowClear\n onSearch={onSearch}\n style={{ width: 500 }}\n />\n {defaultChunkId ? (\n <Tabs\n defaultActiveKey={defaultChunkId}\n tabPosition={'top'}\n onChange={(value) => setSearchChunk(value)}\n items={Object.keys(assetsChunksList).map((chunk, _i) => {\n const id = chunk;\n return {\n label: assetsChunksList[chunk],\n key: id,\n children: ModulesModal(\n searchModule,\n searchChunk || defaultChunkId,\n (item) => {\n onModuleClick?.(item);\n setModalOpen(false);\n onClose?.();\n },\n ),\n };\n })}\n />\n ) : (\n <Empty description={'No modules found.'} />\n )}\n </Modal>\n </>\n );\n }}\n </ServerAPIProvider>\n </>\n );\n};\n\nconst ModulesModal = (\n searchModule: string,\n chunk: string,\n onModuleClick?: (module: any) => void | undefined,\n) => {\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetSearchModuleInChunk}\n body={{ moduleName: String(searchModule), chunk }}\n >\n {(modules) => (\n <>\n {modules?.length !== 0 ? (\n <List\n className={styles.list}\n loading={!modules.length}\n itemLayout=\"horizontal\"\n pagination={{ position: 'bottom', align: 'center' }}\n dataSource={modules}\n renderItem={(item) => {\n const itemPathArr = item.relativePath.split(searchModule);\n return (\n <List.Item\n className={onModuleClick && styles.listItemInteractive}\n key={`${item.path}-${item.relativePath}`}\n onClick={\n onModuleClick ? () => onModuleClick(item) : undefined\n }\n >\n <Skeleton avatar title={false} loading={!item.path} active>\n <List.Item.Meta\n key={`${item.path}-${item.relativePath}-meta`}\n description={\n <>\n <Typography.Text code>{'Module:'}</Typography.Text>\n {itemPathArr.map((cur, index) => {\n if (index < itemPathArr.length - 1) {\n return (\n <Typography.Text\n key={`${cur}-${index}`}\n style={{ fontWeight: 200 }}\n >\n {cur}\n <Typography.Text\n strong\n key={`${cur}-${index}-strong`}\n style={{ fontWeight: 600 }}\n >\n {searchModule}\n </Typography.Text>\n </Typography.Text>\n );\n }\n return (\n <Typography.Text style={{ fontWeight: 200 }}>\n {cur}\n </Typography.Text>\n );\n })}\n </>\n }\n />\n </Skeleton>\n </List.Item>\n );\n }}\n />\n ) : (\n <Empty />\n )}\n </>\n )}\n </ServerAPIProvider>\n );\n};\n"],"names":["Search","Input","SearchModal","onModuleClick","onClose","open","setOpen","isIcon","isModalOpen","setIsModalOpen","useState","searchModule","setSearchModule","searchChunk","setSearchChunk","modalOpen","undefined","setModalOpen","onSearch","useCallback","args","value","_event","showModal","handleOk","handleCancel","SearchOutlined","Button","styles","ServerAPIProvider","SDK","String","assetsChunksList","defaultChunkId","Object","Modal","Tabs","chunk","_i","id","ModulesModal","item","Empty","modules","List","itemPathArr","Skeleton","Typography","cur","index"],"mappings":";;;;;;;AAiBA,MAAM,EAAEA,QAAAA,MAAM,EAAE,GAAGC;AAIZ,MAAMC,cAMR,CAAC,EACJC,aAAyB,EACzBC,OAAO,EACPC,IAAI,EACJC,OAAO,EACPC,SAAS,KAAK,EACf;IACC,MAAM,CAACC,aAAaC,eAAe,GAAGC,SAAS;IAC/C,MAAM,CAACC,cAAcC,gBAAgB,GAAGF,SAAS;IACjD,MAAM,CAACG,aAAaC,eAAe,GAAGJ,SAAS;IAE/C,MAAMK,YAAYV,AAASW,WAATX,OAAqBA,OAAOG;IAC9C,MAAMS,eAAeX,WAAWG;IAEhC,MAAMS,WAAoCC,YACxC,CAAC,GAAGC;QACF,MAAM,CAACC,OAAOC,OAAO,GAAGF;QACxBR,gBAAgBS;IAClB,GACA,EAAE;IAGJ,MAAME,YAAY;QAChBN,aAAa;IACf;IAEA,MAAMO,WAAW;QACfP,aAAa;QACbb;IACF;IAEA,MAAMqB,eAAe;QACnBR,aAAa;QACbb;IACF;IAEA,OAAO,WAAP,GACE;;YACGG,SAAS,WAATA,GACC,IAACmB,gBAAcA;gBAAC,SAASH;+B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NsTS",
5
+ listItemInteractive: "listItemInteractive-AC3tqb",
6
+ searchBtn: "searchBtn-ZhRlk8"
7
+ };
8
+ export default search_modal_module;
9
+
10
+ //# sourceMappingURL=search-modal.module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages/BundleSize/components/search-modal.module.mjs","sources":["../../../../src/pages/BundleSize/components/search-modal.module.scss"],"sourcesContent":["// extracted by LIB_CSS_EXTRACT_LOADER\nimport \"./search-modal_module.css\"\nexport default {\"modal\":\"modal-jTgoC2\",\"list\":\"list-osNsTS\",\"listItemInteractive\":\"listItemInteractive-AC3tqb\",\"searchBtn\":\"searchBtn-ZhRlk8\"};"],"names":[],"mappings":";AAEA,4BAAe;IAAC,OAAQ;IAAe,MAAO;IAAc,qBAAsB;IAA6B,WAAY;AAAkB"}