@rsdoctor/components 1.5.3 → 1.5.4

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 (163) hide show
  1. package/dist/common/imgs/connection-point.mjs +1 -1
  2. package/dist/common/imgs/rsdoctor-navbar.mjs +1 -1
  3. package/dist/common/imgs/webpack.mjs +1 -1
  4. package/dist/common/svg/bundle-size.mjs +1 -1
  5. package/dist/common/svg/cursor.mjs +1 -1
  6. package/dist/common/svg/error.mjs +1 -1
  7. package/dist/common/svg/file-css.mjs +1 -1
  8. package/dist/common/svg/file-html.mjs +1 -1
  9. package/dist/common/svg/file-image.mjs +1 -1
  10. package/dist/common/svg/file-js.mjs +1 -1
  11. package/dist/common/svg/file-unknown.mjs +1 -1
  12. package/dist/common/svg/file.mjs +1 -1
  13. package/dist/common/svg/files/css.mjs +1 -1
  14. package/dist/common/svg/files/html.mjs +1 -1
  15. package/dist/common/svg/files/image.mjs +1 -1
  16. package/dist/common/svg/files/js.mjs +1 -1
  17. package/dist/common/svg/files/unkown-file.mjs +1 -1
  18. package/dist/common/svg/loader/input.mjs +1 -1
  19. package/dist/common/svg/loader/output.mjs +1 -1
  20. package/dist/common/svg/loader/step.mjs +1 -1
  21. package/dist/common/svg/navbar/bundle-size-active.mjs +1 -1
  22. package/dist/common/svg/navbar/bundle-size-inactive.mjs +1 -1
  23. package/dist/common/svg/navbar/compile-analysis-active.mjs +1 -1
  24. package/dist/common/svg/navbar/compile-analysis-inactive.mjs +1 -1
  25. package/dist/common/svg/navbar/overall-active.mjs +1 -1
  26. package/dist/common/svg/navbar/overall-inactive.mjs +1 -1
  27. package/dist/common/svg/output.mjs +1 -1
  28. package/dist/common/svg/source-size.mjs +1 -1
  29. package/dist/common/svg/source.mjs +1 -1
  30. package/dist/common/svg/total-size.mjs +1 -1
  31. package/dist/common/svg/trae.mjs +1 -1
  32. package/dist/common/svg/version.mjs +1 -1
  33. package/dist/common/svg/vscode.mjs +1 -1
  34. package/dist/components/Alert/change.mjs.map +1 -1
  35. package/dist/components/Alert/ecma-version-check.mjs +1 -1
  36. package/dist/components/Alert/ecma-version-check.mjs.map +1 -1
  37. package/dist/components/Alert/ecma-version-check.module.mjs +1 -1
  38. package/dist/components/Alert/package-relation.module.mjs +1 -1
  39. package/dist/components/Alert/view.mjs.map +1 -1
  40. package/dist/components/Alerts/bundle-alert.mjs +37 -2
  41. package/dist/components/Alerts/bundle-alert.mjs.map +1 -1
  42. package/dist/components/Alerts/bundle-alert.module.mjs +1 -1
  43. package/dist/components/Alerts/collapse-cjs-require.d.ts +6 -0
  44. package/dist/components/Alerts/collapse-cjs-require.mjs +142 -0
  45. package/dist/components/Alerts/collapse-cjs-require.mjs.map +1 -0
  46. package/dist/components/Alerts/collapse-cross-chunks.mjs +2 -23
  47. package/dist/components/Alerts/collapse-cross-chunks.mjs.map +1 -1
  48. package/dist/components/Alerts/collapse-module-mixed-chunks.mjs +2 -23
  49. package/dist/components/Alerts/collapse-module-mixed-chunks.mjs.map +1 -1
  50. package/dist/components/Alerts/collapse-shared.d.ts +9 -0
  51. package/dist/components/Alerts/collapse-shared.mjs +90 -0
  52. package/dist/components/Alerts/collapse-shared.mjs.map +1 -0
  53. package/dist/components/Alerts/collapse-side-effects-only-imports.d.ts +6 -0
  54. package/dist/components/Alerts/collapse-side-effects-only-imports.mjs +131 -0
  55. package/dist/components/Alerts/collapse-side-effects-only-imports.mjs.map +1 -0
  56. package/dist/components/Alerts/collapse.mjs +2 -23
  57. package/dist/components/Alerts/collapse.mjs.map +1 -1
  58. package/dist/components/Alerts/collapse.module.mjs +1 -1
  59. package/dist/components/Alerts/list.module.mjs +1 -1
  60. package/dist/components/Alerts/overlay.mjs.map +1 -1
  61. package/dist/components/Alerts/overlay.module.mjs +1 -1
  62. package/dist/components/Card/diff.mjs.map +1 -1
  63. package/dist/components/Card/index.mjs +1 -1
  64. package/dist/components/Card/size.mjs +2 -2
  65. package/dist/components/Card/size.mjs.map +1 -1
  66. package/dist/components/Card/size.module.mjs +1 -1
  67. package/dist/components/Charts/TimelineCharts/index.mjs +1 -1
  68. package/dist/components/Charts/TimelineCharts/index.mjs.map +1 -1
  69. package/dist/components/Charts/TreeMap.mjs +1 -1
  70. package/dist/components/Charts/TreeMap.mjs.map +1 -1
  71. package/dist/components/Charts/constants.mjs +1 -1
  72. package/dist/components/Charts/loader.mjs +2 -2
  73. package/dist/components/Charts/loader.mjs.map +1 -1
  74. package/dist/components/Charts/treemap.module.mjs +1 -1
  75. package/dist/components/Configuration/builder.module.mjs +1 -1
  76. package/dist/components/FileTree/css.mjs +1 -1
  77. package/dist/components/FileTree/html.mjs +1 -1
  78. package/dist/components/FileTree/image.mjs +1 -1
  79. package/dist/components/FileTree/index.mjs +1 -1
  80. package/dist/components/FileTree/index.mjs.map +1 -1
  81. package/dist/components/FileTree/js.mjs +1 -1
  82. package/dist/components/FileTree/unkown-file.mjs +1 -1
  83. package/dist/components/Keyword/style.module.mjs +1 -1
  84. package/dist/components/Layout/bundle-size-icon.mjs +1 -1
  85. package/dist/components/Layout/compile-icon.mjs +1 -1
  86. package/dist/components/Layout/index.mjs.map +1 -1
  87. package/dist/components/Layout/overall-icon.mjs +1 -1
  88. package/dist/components/Layout/project-info-context.mjs.map +1 -1
  89. package/dist/components/Loader/Analysis/input.mjs +1 -1
  90. package/dist/components/Loader/Analysis/output.mjs +1 -1
  91. package/dist/components/Loader/Analysis/style.module.mjs +1 -1
  92. package/dist/components/Loader/executions.mjs.map +1 -1
  93. package/dist/components/Loader/step.mjs +1 -1
  94. package/dist/components/Manifest/api.mjs.map +1 -1
  95. package/dist/components/Overall/DataSummary.module.mjs +1 -1
  96. package/dist/components/Overall/bundle.mjs +1 -1
  97. package/dist/components/Overall/bundle.mjs.map +1 -1
  98. package/dist/components/Overall/bundle.module.mjs +1 -1
  99. package/dist/components/Overall/card.module.mjs +1 -1
  100. package/dist/components/Overall/compile.mjs.map +1 -1
  101. package/dist/components/Overall/compile.module.mjs +1 -1
  102. package/dist/components/Overall/help-center.module.mjs +1 -1
  103. package/dist/components/Overall/list.module.mjs +1 -1
  104. package/dist/components/Overall/overview.mjs +2 -1
  105. package/dist/components/Overall/overview.module.mjs +1 -1
  106. package/dist/components/Overall/project.module.mjs +1 -1
  107. package/dist/components/Resolver/analysis.mjs +2 -2
  108. package/dist/components/Resolver/analysis.mjs.map +1 -1
  109. package/dist/components/Select/index.mjs.map +1 -1
  110. package/dist/components/Status/failed.mjs.map +1 -1
  111. package/dist/components/TextDrawer/duplicate.mjs.map +1 -1
  112. package/dist/components/TextDrawer/index.mjs +1 -1
  113. package/dist/components/base/CodeViewer/index.mjs +2 -2
  114. package/dist/components/base/CodeViewer/index.mjs.map +1 -1
  115. package/dist/components/base/CodeViewer/index.module.mjs +1 -1
  116. package/dist/components/base/DiffViewer/index.mjs +2 -2
  117. package/dist/components/base/DiffViewer/index.mjs.map +1 -1
  118. package/dist/components/base/DiffViewer/index.module.mjs +1 -1
  119. package/dist/components/index.mjs +1 -2
  120. package/dist/config.mjs.map +1 -1
  121. package/dist/constants.mjs +1 -1
  122. package/dist/pages/BundleSize/components/asset.mjs +2 -2
  123. package/dist/pages/BundleSize/components/asset.mjs.map +1 -1
  124. package/dist/pages/BundleSize/components/card.module.mjs +1 -1
  125. package/dist/pages/BundleSize/components/cards.mjs +2 -2
  126. package/dist/pages/BundleSize/components/cards.mjs.map +1 -1
  127. package/dist/pages/BundleSize/components/index.mjs +1 -1
  128. package/dist/pages/BundleSize/components/index.mjs.map +1 -1
  129. package/dist/pages/BundleSize/components/index.module.mjs +1 -1
  130. package/dist/pages/BundleSize/components/search-modal.mjs +1 -1
  131. package/dist/pages/BundleSize/components/search-modal.mjs.map +1 -1
  132. package/dist/pages/BundleSize/config.mjs.map +1 -1
  133. package/dist/pages/BundleSize/constants.mjs +1 -1
  134. package/dist/pages/BundleSize/index.mjs +1 -1
  135. package/dist/pages/ModuleAnalyze/constants.mjs +1 -1
  136. package/dist/pages/ModuleAnalyze/dependency.mjs +1 -1
  137. package/dist/pages/ModuleResolve/index.mjs +1 -1
  138. package/dist/pages/Overall/index.mjs +1 -1
  139. package/dist/pages/Overall/index.module.mjs +1 -1
  140. package/dist/pages/Resources/BundleDiff/DiffContainer/assets.mjs.map +1 -1
  141. package/dist/pages/Resources/BundleDiff/DiffContainer/changes.mjs.map +1 -1
  142. package/dist/pages/Resources/BundleDiff/DiffContainer/modules.mjs.map +1 -1
  143. package/dist/pages/Resources/BundleDiff/DiffContainer/packages.mjs.map +1 -1
  144. package/dist/pages/Resources/BundleDiff/constants.mjs.map +1 -1
  145. package/dist/pages/Resources/BundleDiff/index.mjs +2 -2
  146. package/dist/pages/Resources/RuleIndex/index.mjs +1 -1
  147. package/dist/pages/TreeShaking/index.mjs +1 -1
  148. package/dist/pages/TreeShaking/open-tag.mjs +1 -1
  149. package/dist/pages/TreeShaking/table.mjs.map +1 -1
  150. package/dist/pages/Uploader/index.mjs +1 -1
  151. package/dist/pages/WebpackLoaders/Analysis/index.mjs +2 -2
  152. package/dist/pages/WebpackLoaders/Analysis/index.mjs.map +1 -1
  153. package/dist/pages/WebpackLoaders/Overall/index.mjs +1 -1
  154. package/dist/pages/WebpackPlugins/index.mjs +1 -1
  155. package/dist/pages/index.mjs +1 -1
  156. package/dist/utils/i18n/cn.mjs +1 -1
  157. package/dist/utils/i18n/en.mjs +1 -1
  158. package/dist/utils/i18n/index.mjs +1 -1
  159. package/dist/utils/loader.mjs +1 -1
  160. package/dist/utils/loader.mjs.map +1 -1
  161. package/dist/utils/time.mjs +1 -1
  162. package/dist/utils/time.mjs.map +1 -1
  163. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"components/base/CodeViewer/index.mjs","sources":["../../../../src/components/base/CodeViewer/index.tsx"],"sourcesContent":["import { Editor, Monaco, OnMount } from '@monaco-editor/react';\nimport clsx from 'clsx';\nimport { editor } from 'monaco-editor';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { CodeViewerProps } from './interface';\nimport {\n defineMonacoOptions,\n editorShowRange,\n getFileName,\n getFilePathFormat,\n} from './utils';\n\nimport { Checkbox } from 'antd';\nimport styles from './index.module.scss';\nimport { Lodash } from '@rsdoctor/utils/common';\n\nexport function CodeViewer({\n className,\n style,\n code = '',\n lang,\n filePath = '',\n defaultLine,\n ranges,\n isEmbed = false,\n headerVisible = true,\n isLightTheme = true,\n formatOnMount = false,\n}: CodeViewerProps) {\n const editor = useRef<editor.IStandaloneCodeEditor>();\n const monaco = useRef<Monaco>();\n const language = useMemo(\n () => lang || getFilePathFormat(filePath) || 'plaintext',\n [lang, filePath],\n );\n const [isWordWrap, setIsWordWrap] = useState(true);\n const options = useMemo(\n () => defineMonacoOptions({ wordWrap: isWordWrap ? 'on' : 'off' }),\n [isWordWrap],\n );\n const onEditorMount = useCallback<OnMount>(\n (editorInstance, monacoVal) => {\n editor.current = editorInstance;\n monaco.current = monacoVal;\n\n editorShowRange(editorInstance, monacoVal, ranges);\n if (Lodash.isNumber(defaultLine)) {\n setTimeout(() => {\n editorInstance.revealLine(defaultLine);\n });\n }\n\n if (formatOnMount) {\n // Use Monaco's built-in formatter to format the whole document\n setTimeout(() => {\n editorInstance.getAction('editor.action.formatDocument')?.run();\n }, 0);\n }\n },\n [ranges, defaultLine, formatOnMount],\n );\n\n const theme = isLightTheme ? 'vs-light' : 'vs-dark';\n\n useEffect(\n () => () => {\n editor.current?.setModel(null);\n },\n [],\n );\n\n return (\n <div\n className={clsx(\n 'monaco-component',\n 'code-viewer',\n styles['code-viewer'],\n isEmbed && styles['embed'],\n className,\n )}\n style={style}\n >\n {headerVisible && Boolean(filePath) && (\n <div className={styles['header']}>\n <div>{getFileName(filePath)}</div>\n <div style={{ flex: 1 }} />\n <div>\n <Checkbox\n className={styles['text']}\n title=\"side-by-side\"\n checked={isWordWrap}\n onChange={(evt) => {\n setIsWordWrap(evt.target.checked);\n }}\n >\n word-wrap\n </Checkbox>\n </div>\n </div>\n )}\n <div className={clsx(styles['content'], 'editor-wrap')}>\n <Editor\n theme={theme}\n language={language}\n value={code}\n options={options}\n onMount={onEditorMount}\n />\n </div>\n </div>\n );\n}\n\nexport type { CodeViewerProps } from './interface';\nexport { useCodeDrawer } from './useCodeDrawer';\nexport { defineMonacoOptions } from './utils';\n"],"names":["CodeViewer","className","style","code","lang","filePath","defaultLine","ranges","isEmbed","headerVisible","isLightTheme","formatOnMount","editor","useRef","monaco","language","useMemo","getFilePathFormat","isWordWrap","setIsWordWrap","useState","options","defineMonacoOptions","onEditorMount","useCallback","editorInstance","monacoVal","editorShowRange","Lodash","setTimeout","theme","useEffect","clsx","styles","Boolean","getFileName","Checkbox","evt","Editor"],"mappings":";;;;;;;;;AAgBO,SAASA,WAAW,EACzBC,SAAS,EACTC,KAAK,EACLC,OAAO,EAAE,EACTC,IAAI,EACJC,WAAW,EAAE,EACbC,WAAW,EACXC,MAAM,EACNC,UAAU,KAAK,EACfC,gBAAgB,IAAI,EACpBC,eAAe,IAAI,EACnBC,gBAAgB,KAAK,EACL;IAChB,MAAMC,SAASC;IACf,MAAMC,SAASD;IACf,MAAME,WAAWC,QACf,IAAMZ,QAAQa,kBAAkBZ,aAAa,aAC7C;QAACD;QAAMC;KAAS;IAElB,MAAM,CAACa,YAAYC,cAAc,GAAGC,SAAS;IAC7C,MAAMC,UAAUL,QACd,IAAMM,oBAAoB;YAAE,UAAUJ,aAAa,OAAO;QAAM,IAChE;QAACA;KAAW;IAEd,MAAMK,gBAAgBC,YACpB,CAACC,gBAAgBC;QACfd,OAAO,OAAO,GAAGa;QACjBX,OAAO,OAAO,GAAGY;QAEjBC,gBAAgBF,gBAAgBC,WAAWnB;QAC3C,IAAIqB,OAAO,QAAQ,CAACtB,cAClBuB,WAAW;YACTJ,eAAe,UAAU,CAACnB;QAC5B;QAGF,IAAIK,eAEFkB,WAAW;YACTJ,eAAe,SAAS,CAAC,iCAAiC;QAC5D,GAAG;IAEP,GACA;QAAClB;QAAQD;QAAaK;KAAc;IAGtC,MAAMmB,QAAQpB,eAAe,aAAa;IAE1CqB,UACE,IAAM;YACJnB,OAAO,OAAO,EAAE,SAAS;QAC3B,GACA,EAAE;IAGJ,OAAO,WAAP,GACE,KAAC;QACC,WAAWoB,KACT,oBACA,eACAC,YAAAA,CAAAA,cAAqB,EACrBzB,WAAWyB,aAAAA,KAAe,EAC1BhC;QAEF,OAAOC;;YAENO,iBAAiByB,QAAQ7B,aAAa,WAAbA,GACxB,KAAC;gBAAI,WAAW4B,aAAAA,MAAgB;;kCAC9B,IAAC;kCAAKE,YAAY9B;;kCAClB,IAAC;wBAAI,OAAO;4BAAE,MAAM;wBAAE;;kCACtB,IAAC;kCACC,kBAAC+B,UAAQA;4BACP,WAAWH,aAAAA,IAAc;4BACzB,OAAM;4BACN,SAASf;4BACT,UAAU,CAACmB;gCACTlB,cAAckB,IAAI,MAAM,CAAC,OAAO;4BAClC;sCACD;;;;;0BAMP,IAAC;gBAAI,WAAWL,KAAKC,aAAAA,OAAiB,EAAE;0BACtC,kBAACK,QAAMA;oBACL,OAAOR;oBACP,UAAUf;oBACV,OAAOZ;oBACP,SAASkB;oBACT,SAASE;;;;;AAKnB"}
1
+ {"version":3,"file":"components/base/CodeViewer/index.mjs","sources":["../../../../src/components/base/CodeViewer/index.tsx"],"sourcesContent":["import { Editor, Monaco, OnMount } from '@monaco-editor/react';\nimport clsx from 'clsx';\nimport { editor } from 'monaco-editor';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { CodeViewerProps } from './interface';\nimport {\n defineMonacoOptions,\n editorShowRange,\n getFileName,\n getFilePathFormat,\n} from './utils';\n\nimport { Checkbox } from 'antd';\nimport styles from './index.module.scss';\nimport { Lodash } from '@rsdoctor/utils/common';\n\nexport function CodeViewer({\n className,\n style,\n code = '',\n lang,\n filePath = '',\n defaultLine,\n ranges,\n isEmbed = false,\n headerVisible = true,\n isLightTheme = true,\n formatOnMount = false,\n}: CodeViewerProps) {\n const editor = useRef<editor.IStandaloneCodeEditor>();\n const monaco = useRef<Monaco>();\n const language = useMemo(\n () => lang || getFilePathFormat(filePath) || 'plaintext',\n [lang, filePath],\n );\n const [isWordWrap, setIsWordWrap] = useState(true);\n const options = useMemo(\n () => defineMonacoOptions({ wordWrap: isWordWrap ? 'on' : 'off' }),\n [isWordWrap],\n );\n const onEditorMount = useCallback<OnMount>(\n (editorInstance, monacoVal) => {\n editor.current = editorInstance;\n monaco.current = monacoVal;\n\n editorShowRange(editorInstance, monacoVal, ranges);\n if (Lodash.isNumber(defaultLine)) {\n setTimeout(() => {\n editorInstance.revealLine(defaultLine);\n });\n }\n\n if (formatOnMount) {\n // Use Monaco's built-in formatter to format the whole document\n setTimeout(() => {\n editorInstance.getAction('editor.action.formatDocument')?.run();\n }, 0);\n }\n },\n [ranges, defaultLine, formatOnMount],\n );\n\n const theme = isLightTheme ? 'vs-light' : 'vs-dark';\n\n useEffect(\n () => () => {\n editor.current?.setModel(null);\n },\n [],\n );\n\n return (\n <div\n className={clsx(\n 'monaco-component',\n 'code-viewer',\n styles['code-viewer'],\n isEmbed && styles['embed'],\n className,\n )}\n style={style}\n >\n {headerVisible && Boolean(filePath) && (\n <div className={styles['header']}>\n <div>{getFileName(filePath)}</div>\n <div style={{ flex: 1 }} />\n <div>\n <Checkbox\n className={styles['text']}\n title=\"side-by-side\"\n checked={isWordWrap}\n onChange={(evt) => {\n setIsWordWrap(evt.target.checked);\n }}\n >\n word-wrap\n </Checkbox>\n </div>\n </div>\n )}\n <div className={clsx(styles['content'], 'editor-wrap')}>\n <Editor\n theme={theme}\n language={language}\n value={code}\n options={options}\n onMount={onEditorMount}\n />\n </div>\n </div>\n );\n}\n\nexport type { CodeViewerProps } from './interface';\nexport { useCodeDrawer } from './useCodeDrawer';\nexport { defineMonacoOptions } from './utils';\n"],"names":["CodeViewer","className","style","code","lang","filePath","defaultLine","ranges","isEmbed","headerVisible","isLightTheme","formatOnMount","editor","useRef","monaco","language","useMemo","getFilePathFormat","isWordWrap","setIsWordWrap","useState","options","defineMonacoOptions","onEditorMount","useCallback","editorInstance","monacoVal","editorShowRange","Lodash","setTimeout","theme","useEffect","clsx","styles","Boolean","getFileName","Checkbox","evt","Editor"],"mappings":";;;;;;;;AAgBO,SAASA,WAAW,EACzBC,SAAS,EACTC,KAAK,EACLC,OAAO,EAAE,EACTC,IAAI,EACJC,WAAW,EAAE,EACbC,WAAW,EACXC,MAAM,EACNC,UAAU,KAAK,EACfC,gBAAgB,IAAI,EACpBC,eAAe,IAAI,EACnBC,gBAAgB,KAAK,EACL;IAChB,MAAMC,SAASC;IACf,MAAMC,SAASD;IACf,MAAME,WAAWC,QACf,IAAMZ,QAAQa,kBAAkBZ,aAAa,aAC7C;QAACD;QAAMC;KAAS;IAElB,MAAM,CAACa,YAAYC,cAAc,GAAGC,SAAS;IAC7C,MAAMC,UAAUL,QACd,IAAMM,oBAAoB;YAAE,UAAUJ,aAAa,OAAO;QAAM,IAChE;QAACA;KAAW;IAEd,MAAMK,gBAAgBC,YACpB,CAACC,gBAAgBC;QACfd,OAAO,OAAO,GAAGa;QACjBX,OAAO,OAAO,GAAGY;QAEjBC,gBAAgBF,gBAAgBC,WAAWnB;QAC3C,IAAIqB,OAAO,QAAQ,CAACtB,cAClBuB,WAAW;YACTJ,eAAe,UAAU,CAACnB;QAC5B;QAGF,IAAIK,eAEFkB,WAAW;YACTJ,eAAe,SAAS,CAAC,iCAAiC;QAC5D,GAAG;IAEP,GACA;QAAClB;QAAQD;QAAaK;KAAc;IAGtC,MAAMmB,QAAQpB,eAAe,aAAa;IAE1CqB,UACE,IAAM;YACJnB,OAAO,OAAO,EAAE,SAAS;QAC3B,GACA,EAAE;IAGJ,OAAO,WAAP,GACE,KAAC;QACC,WAAWoB,KACT,oBACA,eACAC,YAAAA,CAAAA,cAAqB,EACrBzB,WAAWyB,aAAAA,KAAe,EAC1BhC;QAEF,OAAOC;;YAENO,iBAAiByB,QAAQ7B,aAAa,WAAbA,GACxB,KAAC;gBAAI,WAAW4B,aAAAA,MAAgB;;kCAC9B,IAAC;kCAAKE,YAAY9B;;kCAClB,IAAC;wBAAI,OAAO;4BAAE,MAAM;wBAAE;;kCACtB,IAAC;kCACC,kBAAC+B,UAAQA;4BACP,WAAWH,aAAAA,IAAc;4BACzB,OAAM;4BACN,SAASf;4BACT,UAAU,CAACmB;gCACTlB,cAAckB,IAAI,MAAM,CAAC,OAAO;4BAClC;sCACD;;;;;0BAMP,IAAC;gBAAI,WAAWL,KAAKC,aAAAA,OAAiB,EAAE;0BACtC,kBAACK,QAAMA;oBACL,OAAOR;oBACP,UAAUf;oBACV,OAAOZ;oBACP,SAASkB;oBACT,SAASE;;;;;AAKnB"}
@@ -7,6 +7,6 @@ const index_module = {
7
7
  text: "text-T29bd1",
8
8
  content: "content-EVSW1C"
9
9
  };
10
- export { index_module as default };
10
+ export default index_module;
11
11
 
12
12
  //# sourceMappingURL=index.module.mjs.map
@@ -6,7 +6,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { getFileName, getFilePathFormat } from "../CodeViewer/utils.mjs";
7
7
  import index_module from "./index.module.mjs";
8
8
  import { defineMonacoDiffOptions } from "./utils.mjs";
9
- import { useDiffDrawer } from "./useDiffDrawer.mjs";
10
9
  function DiffViewer({ className, style, original = '', modified = '', originalFilePath = '', modifiedFilePath = '', originalLang, modifiedLang, isEmbed = false, isLightTheme = true, headerVisible = true }) {
11
10
  const [isSideBySide, setIsSideBySide] = useState(true);
12
11
  const editor = useRef();
@@ -74,6 +73,7 @@ function DiffViewer({ className, style, original = '', modified = '', originalFi
74
73
  ]
75
74
  });
76
75
  }
77
- export { DiffViewer, defineMonacoDiffOptions, useDiffDrawer };
76
+ export { useDiffDrawer } from "./useDiffDrawer.mjs";
77
+ export { DiffViewer, defineMonacoDiffOptions };
78
78
 
79
79
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"components/base/DiffViewer/index.mjs","sources":["../../../../src/components/base/DiffViewer/index.tsx"],"sourcesContent":["import { DiffEditor, MonacoDiffEditor } from '@monaco-editor/react';\nimport { Checkbox } from 'antd';\nimport clsx from 'clsx';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { getFileName, getFilePathFormat } from '../CodeViewer/utils';\nimport styles from './index.module.scss';\nimport { DiffViewerProps } from './interface';\nimport { defineMonacoDiffOptions } from './utils';\n\nexport function DiffViewer({\n className,\n style,\n original = '',\n modified = '',\n originalFilePath = '',\n modifiedFilePath = '',\n originalLang,\n modifiedLang,\n isEmbed = false,\n isLightTheme = true,\n headerVisible = true,\n}: DiffViewerProps) {\n const [isSideBySide, setIsSideBySide] = useState(true);\n const editor = useRef<MonacoDiffEditor>();\n const originalLanguage = useMemo(\n () => originalLang || getFilePathFormat(originalFilePath) || 'plaintext',\n [originalLang, originalFilePath],\n );\n const modifiedLanguage = useMemo(\n () => modifiedLang || getFilePathFormat(modifiedFilePath) || 'plaintext',\n [modifiedLang, modifiedFilePath],\n );\n const options = useMemo(\n () => defineMonacoDiffOptions({ renderSideBySide: isSideBySide }),\n [isSideBySide],\n );\n const onEditorMount = useCallback((editorInstance: MonacoDiffEditor) => {\n editor.current = editorInstance;\n }, []);\n const theme = isLightTheme ? 'vs-light' : 'vs-dark';\n\n useEffect(\n () => () => {\n editor.current?.setModel(null);\n },\n [],\n );\n\n return (\n <div\n className={clsx(\n 'monaco-component',\n 'diff-viewer',\n styles['diff-viewer'],\n isEmbed && styles['embed'],\n className,\n )}\n style={style}\n >\n {headerVisible && (\n <div className={styles['header']}>\n <div>{getFileName(originalFilePath)}</div>\n <div style={{ flex: 1 }} />\n <div>\n <Checkbox\n className={styles['text']}\n title=\"side-by-side\"\n checked={isSideBySide}\n onChange={(evt) => {\n setIsSideBySide(evt.target.checked);\n }}\n >\n side-by-side\n </Checkbox>\n </div>\n </div>\n )}\n <div className={clsx(styles['content'], 'editor-wrap')}>\n <DiffEditor\n theme={theme}\n originalLanguage={originalLanguage}\n modifiedLanguage={modifiedLanguage}\n original={original}\n modified={modified}\n width=\"100%\"\n options={options}\n onMount={onEditorMount}\n />\n </div>\n </div>\n );\n}\n\nexport type { DiffViewerProps } from './interface';\nexport { useDiffDrawer } from './useDiffDrawer';\nexport { defineMonacoDiffOptions } from './utils';\n"],"names":["DiffViewer","className","style","original","modified","originalFilePath","modifiedFilePath","originalLang","modifiedLang","isEmbed","isLightTheme","headerVisible","isSideBySide","setIsSideBySide","useState","editor","useRef","originalLanguage","useMemo","getFilePathFormat","modifiedLanguage","options","defineMonacoDiffOptions","onEditorMount","useCallback","editorInstance","theme","useEffect","clsx","styles","getFileName","Checkbox","evt","DiffEditor"],"mappings":";;;;;;;;;AASO,SAASA,WAAW,EACzBC,SAAS,EACTC,KAAK,EACLC,WAAW,EAAE,EACbC,WAAW,EAAE,EACbC,mBAAmB,EAAE,EACrBC,mBAAmB,EAAE,EACrBC,YAAY,EACZC,YAAY,EACZC,UAAU,KAAK,EACfC,eAAe,IAAI,EACnBC,gBAAgB,IAAI,EACJ;IAChB,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SAAS;IACjD,MAAMC,SAASC;IACf,MAAMC,mBAAmBC,QACvB,IAAMX,gBAAgBY,kBAAkBd,qBAAqB,aAC7D;QAACE;QAAcF;KAAiB;IAElC,MAAMe,mBAAmBF,QACvB,IAAMV,gBAAgBW,kBAAkBb,qBAAqB,aAC7D;QAACE;QAAcF;KAAiB;IAElC,MAAMe,UAAUH,QACd,IAAMI,wBAAwB;YAAE,kBAAkBV;QAAa,IAC/D;QAACA;KAAa;IAEhB,MAAMW,gBAAgBC,YAAY,CAACC;QACjCV,OAAO,OAAO,GAAGU;IACnB,GAAG,EAAE;IACL,MAAMC,QAAQhB,eAAe,aAAa;IAE1CiB,UACE,IAAM;YACJZ,OAAO,OAAO,EAAE,SAAS;QAC3B,GACA,EAAE;IAGJ,OAAO,WAAP,GACE,KAAC;QACC,WAAWa,KACT,oBACA,eACAC,YAAAA,CAAAA,cAAqB,EACrBpB,WAAWoB,aAAAA,KAAe,EAC1B5B;QAEF,OAAOC;;YAENS,iBAAiB,WAAjBA,GACC,KAAC;gBAAI,WAAWkB,aAAAA,MAAgB;;kCAC9B,IAAC;kCAAKC,YAAYzB;;kCAClB,IAAC;wBAAI,OAAO;4BAAE,MAAM;wBAAE;;kCACtB,IAAC;kCACC,kBAAC0B,UAAQA;4BACP,WAAWF,aAAAA,IAAc;4BACzB,OAAM;4BACN,SAASjB;4BACT,UAAU,CAACoB;gCACTnB,gBAAgBmB,IAAI,MAAM,CAAC,OAAO;4BACpC;sCACD;;;;;0BAMP,IAAC;gBAAI,WAAWJ,KAAKC,aAAAA,OAAiB,EAAE;0BACtC,kBAACI,YAAUA;oBACT,OAAOP;oBACP,kBAAkBT;oBAClB,kBAAkBG;oBAClB,UAAUjB;oBACV,UAAUC;oBACV,OAAM;oBACN,SAASiB;oBACT,SAASE;;;;;AAKnB"}
1
+ {"version":3,"file":"components/base/DiffViewer/index.mjs","sources":["../../../../src/components/base/DiffViewer/index.tsx"],"sourcesContent":["import { DiffEditor, MonacoDiffEditor } from '@monaco-editor/react';\nimport { Checkbox } from 'antd';\nimport clsx from 'clsx';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { getFileName, getFilePathFormat } from '../CodeViewer/utils';\nimport styles from './index.module.scss';\nimport { DiffViewerProps } from './interface';\nimport { defineMonacoDiffOptions } from './utils';\n\nexport function DiffViewer({\n className,\n style,\n original = '',\n modified = '',\n originalFilePath = '',\n modifiedFilePath = '',\n originalLang,\n modifiedLang,\n isEmbed = false,\n isLightTheme = true,\n headerVisible = true,\n}: DiffViewerProps) {\n const [isSideBySide, setIsSideBySide] = useState(true);\n const editor = useRef<MonacoDiffEditor>();\n const originalLanguage = useMemo(\n () => originalLang || getFilePathFormat(originalFilePath) || 'plaintext',\n [originalLang, originalFilePath],\n );\n const modifiedLanguage = useMemo(\n () => modifiedLang || getFilePathFormat(modifiedFilePath) || 'plaintext',\n [modifiedLang, modifiedFilePath],\n );\n const options = useMemo(\n () => defineMonacoDiffOptions({ renderSideBySide: isSideBySide }),\n [isSideBySide],\n );\n const onEditorMount = useCallback((editorInstance: MonacoDiffEditor) => {\n editor.current = editorInstance;\n }, []);\n const theme = isLightTheme ? 'vs-light' : 'vs-dark';\n\n useEffect(\n () => () => {\n editor.current?.setModel(null);\n },\n [],\n );\n\n return (\n <div\n className={clsx(\n 'monaco-component',\n 'diff-viewer',\n styles['diff-viewer'],\n isEmbed && styles['embed'],\n className,\n )}\n style={style}\n >\n {headerVisible && (\n <div className={styles['header']}>\n <div>{getFileName(originalFilePath)}</div>\n <div style={{ flex: 1 }} />\n <div>\n <Checkbox\n className={styles['text']}\n title=\"side-by-side\"\n checked={isSideBySide}\n onChange={(evt) => {\n setIsSideBySide(evt.target.checked);\n }}\n >\n side-by-side\n </Checkbox>\n </div>\n </div>\n )}\n <div className={clsx(styles['content'], 'editor-wrap')}>\n <DiffEditor\n theme={theme}\n originalLanguage={originalLanguage}\n modifiedLanguage={modifiedLanguage}\n original={original}\n modified={modified}\n width=\"100%\"\n options={options}\n onMount={onEditorMount}\n />\n </div>\n </div>\n );\n}\n\nexport type { DiffViewerProps } from './interface';\nexport { useDiffDrawer } from './useDiffDrawer';\nexport { defineMonacoDiffOptions } from './utils';\n"],"names":["DiffViewer","className","style","original","modified","originalFilePath","modifiedFilePath","originalLang","modifiedLang","isEmbed","isLightTheme","headerVisible","isSideBySide","setIsSideBySide","useState","editor","useRef","originalLanguage","useMemo","getFilePathFormat","modifiedLanguage","options","defineMonacoDiffOptions","onEditorMount","useCallback","editorInstance","theme","useEffect","clsx","styles","getFileName","Checkbox","evt","DiffEditor"],"mappings":";;;;;;;;AASO,SAASA,WAAW,EACzBC,SAAS,EACTC,KAAK,EACLC,WAAW,EAAE,EACbC,WAAW,EAAE,EACbC,mBAAmB,EAAE,EACrBC,mBAAmB,EAAE,EACrBC,YAAY,EACZC,YAAY,EACZC,UAAU,KAAK,EACfC,eAAe,IAAI,EACnBC,gBAAgB,IA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  content: "content-BsfSuD"
9
9
  };
10
- export { index_module as default };
10
+ export default index_module;
11
11
 
12
12
  //# sourceMappingURL=index.module.mjs.map
@@ -1,4 +1,3 @@
1
- import { TimelineCom } from "./Charts/TimelineCharts/index.mjs";
2
1
  export * from "./Alerts/index.mjs";
3
2
  export * from "./Badge/index.mjs";
4
3
  export * from "./base/index.mjs";
@@ -8,4 +7,4 @@ export * from "./Layout/index.mjs";
8
7
  export * from "./Manifest/index.mjs";
9
8
  export * from "./Overall/index.mjs";
10
9
  export * from "./TextDrawer/index.mjs";
11
- export { TimelineCom };
10
+ export { TimelineCom } from "./Charts/TimelineCharts/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","sources":["../src/config.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport { Manifest } from '@rsdoctor/types';\nimport {\n getLocaleFromStorage,\n getThemeFromStorage,\n getViewModeFromStorage,\n} from './utils/storage';\nimport { PageState, ViewMode, Language, Theme } from './constants';\n\nexport interface Config {\n locale: Language;\n theme: Theme;\n pageState: PageState;\n viewMode: {\n bundleAlerts: ViewMode;\n compileAlerts: ViewMode;\n };\n json: Manifest.RsdoctorManifest;\n setTheme(theme: Config['theme']): void;\n setManifest(json: Manifest.RsdoctorManifest): void;\n setPageState(state: PageState): void;\n setViewMode(mode: Partial<Config['viewMode']>, saveStorage?: boolean): void;\n // whether the page is embedded in another page\n embedded?: boolean;\n}\n\nexport const defaultConfig: Config = {\n locale: getLocaleFromStorage(),\n theme: getThemeFromStorage(),\n pageState: PageState.Pending,\n viewMode: getViewModeFromStorage(),\n json: {} as Manifest.RsdoctorManifest,\n setTheme() {},\n setManifest() {},\n setPageState(_state: PageState) {},\n setViewMode() {},\n};\n\nexport const ConfigContext = createContext<Config>({\n ...defaultConfig,\n});\n"],"names":["defaultConfig","getLocaleFromStorage","getThemeFromStorage","PageState","getViewModeFromStorage","_state","ConfigContext","createContext"],"mappings":";;;AA0BO,MAAMA,gBAAwB;IACnC,QAAQC;IACR,OAAOC;IACP,WAAWC,UAAU,OAAO;IAC5B,UAAUC;IACV,MAAM,CAAC;IACP,aAAY;IACZ,gBAAe;IACf,cAAaC,MAAiB,GAAG;IACjC,gBAAe;AACjB;AAEO,MAAMC,gBAAgB,WAAhBA,GAAgBC,cAAsB;IACjD,GAAGP,aAAa;AAClB"}
1
+ {"version":3,"file":"config.mjs","sources":["../src/config.tsx"],"sourcesContent":["import { createContext } from 'react';\nimport { Manifest } from '@rsdoctor/types';\nimport {\n getLocaleFromStorage,\n getThemeFromStorage,\n getViewModeFromStorage,\n} from './utils/storage';\nimport { PageState, ViewMode, Language, Theme } from './constants';\n\nexport interface Config {\n locale: Language;\n theme: Theme;\n pageState: PageState;\n viewMode: {\n bundleAlerts: ViewMode;\n compileAlerts: ViewMode;\n };\n json: Manifest.RsdoctorManifest;\n setTheme(theme: Config['theme']): void;\n setManifest(json: Manifest.RsdoctorManifest): void;\n setPageState(state: PageState): void;\n setViewMode(mode: Partial<Config['viewMode']>, saveStorage?: boolean): void;\n // whether the page is embedded in another page\n embedded?: boolean;\n}\n\nexport const defaultConfig: Config = {\n locale: getLocaleFromStorage(),\n theme: getThemeFromStorage(),\n pageState: PageState.Pending,\n viewMode: getViewModeFromStorage(),\n json: {} as Manifest.RsdoctorManifest,\n setTheme() {},\n setManifest() {},\n setPageState(_state: PageState) {},\n setViewMode() {},\n};\n\nexport const ConfigContext = createContext<Config>({\n ...defaultConfig,\n});\n"],"names":["defaultConfig","getLocaleFromStorage","getThemeFromStorage","PageState","getViewModeFromStorage","_state","ConfigContext","createContext"],"mappings":";;;AA0BO,MAAMA,gBAAwB;IACnC,QAAQC;IACR,OAAOC;IACP,WAAWC,UAAU,OAAO;IAC5B,UAAUC;IACV,MAAM,CAAC;IACP,aAAY;IACZ,gBAAe;IACf,cAAaC,MAAiB,GAAG;IACjC,gBAAe;AACjB;AAEO,MAAMC,gBAAgB,WAAHA,GAAGC,cAAsB;IACjD,GAAGP,aAAa;AAClB"}
@@ -56,6 +56,6 @@ const TAG_PALLETE = {
56
56
  };
57
57
  const MAIN_BG = '';
58
58
  const ROOT_BG_COLOR = 'rgb(105, 177, 255)';
59
- export { constants_APILoaderMode4Dev as APILoaderMode4Dev, constants_Color as Color, constants_ComponentState as ComponentState, constants_Language as Language, MAIN_BG, constants_PageState as PageState, ROOT_BG_COLOR, constants_Size as Size, TAG_PALLETE, constants_Theme as Theme, constants_ViewMode as ViewMode, drawerWidth };
59
+ export { MAIN_BG, ROOT_BG_COLOR, TAG_PALLETE, constants_APILoaderMode4Dev as APILoaderMode4Dev, constants_Color as Color, constants_ComponentState as ComponentState, constants_Language as Language, constants_PageState as PageState, constants_Size as Size, constants_Theme as Theme, constants_ViewMode as ViewMode, drawerWidth };
60
60
 
61
61
  //# sourceMappingURL=constants.mjs.map
@@ -16,7 +16,7 @@ import { createFileStructures, formatSize, isJsDataUrl, useI18n } from "../../..
16
16
  import { ModuleAnalyzeComponent } from "../../ModuleAnalyze/index.mjs";
17
17
  import { ModuleGraphListContext } from "../config.mjs";
18
18
  import index_module from "./index.module.mjs";
19
- const { DirectoryTree } = Tree;
19
+ const { DirectoryTree: DirectoryTree } = Tree;
20
20
  let expandedModulesKeys = [];
21
21
  const TAB_MAP = {
22
22
  source: 'source code',
@@ -433,7 +433,7 @@ const AssetDetail = ({ asset, chunks: includeChunks, modules: includeModules, mo
433
433
  const normalizePath = (path)=>path.replace(/\\/g, '/');
434
434
  const res = createFileStructures({
435
435
  files: filteredModules.map((e)=>e.path).filter(Boolean),
436
- inlinedResourcePathKey,
436
+ inlinedResourcePathKey: inlinedResourcePathKey,
437
437
  fileTitle (file, basename) {
438
438
  const mod = filteredModules.find((e)=>normalizePath(e.path) === normalizePath(file));
439
439
  if (!mod) return basename;
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/asset.mjs","sources":["../../../../src/pages/BundleSize/components/asset.tsx"],"sourcesContent":["import {\n CodepenCircleOutlined,\n ColumnHeightOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n Popover,\n Row,\n Space,\n Tag,\n Tooltip,\n Tree,\n Typography,\n} from 'antd';\nimport { DataNode as AntdDataNode } from 'antd/es/tree';\nimport { omitBy, sumBy } from 'es-toolkit/compat';\nimport { dirname, relative } from 'path';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { CodeViewer } from 'src/components/base';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { TextDrawer } from '../../../components/TextDrawer';\nimport { Size } from '../../../constants';\nimport {\n DataNode,\n createFileStructures,\n formatSize,\n isJsDataUrl,\n useI18n,\n} from '../../../utils';\nimport { ModuleAnalyzeComponent } from '../../ModuleAnalyze';\nimport { ModuleGraphListContext } from '../config';\nimport styles from './index.module.scss';\n\nconst { DirectoryTree } = Tree;\n\nlet expandedModulesKeys: React.Key[] = [];\nconst TAB_MAP = {\n source: 'source code',\n transformed: 'Transformed Code (After compile)',\n parsedSource: 'Bundled Code (After bundle and tree-shaking)',\n};\n\nconst tagStyle = {\n margin: 'none',\n marginInlineEnd: 0,\n};\n\nconst EmptyCodeItem = () => (\n <Empty\n description={`Do not have the module code.\n (1) If you use the brief mode, there will not have any codes to show.\n (2) If you use lite mode, there will not have source codes.`}\n />\n);\n\nexport const ModuleCodeViewer: React.FC<{ data: SDK.ModuleData }> = ({\n data,\n}) => {\n const [tab, setTab] = useState('');\n const { t } = useI18n();\n\n const TAB_LAB_MAP: Record<string, string> = {\n source: 'Source Code',\n transformed: `Transformed Code(${t('After Compile')})`,\n parsedSource: `Bundled Code(${t('After Bundled')})`,\n };\n if (!data) return null;\n\n const { path } = data;\n\n return (\n <TextDrawer\n text=\"\"\n buttonProps={{\n size: 'small',\n icon: (\n <Popover content=\"Open the Codes Box\">\n <CodepenCircleOutlined />\n </Popover>\n ),\n type: 'default',\n }}\n buttonStyle={{ padding: `0 4px` }}\n drawerProps={{\n destroyOnClose: true,\n title: `Code of \"${path}\"`,\n }}\n >\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetModuleCodeByModuleId}\n body={{ moduleId: data.id }}\n >\n {(source) => {\n return (\n <>\n {!source['source'] &&\n !source['parsedSource'] &&\n !source['transformed'] ? (\n <EmptyCodeItem />\n ) : (\n <Card\n className=\"code-size-card\"\n style={{ width: '100%' }}\n tabList={Object.keys(omitBy(source, (s) => !s))\n .map((k) => ({ tab: k }))\n .map((e) => ({\n ...e,\n tab: TAB_LAB_MAP[e.tab],\n key: e.tab,\n }))}\n defaultActiveTabKey={\n source['parsedSource'] ? 'parsedSource' : 'source'\n }\n onTabChange={(v) => setTab(v)}\n tabBarExtraContent={\n <Popover\n placement=\"bottom\"\n title={\n <Typography.Title level={5}>Explain</Typography.Title>\n }\n content={\n <>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n marginBottom: 30,\n }}\n >\n <div>\n <Typography.Text strong>Source: </Typography.Text>\n <Typography.Text>\n {TAB_MAP.source}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Transformed:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.transformed}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Bundled Source:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.parsedSource}\n </Typography.Text>\n </div>\n <br />\n <Typography.Text strong>{'More'}</Typography.Text>\n <Typography.Text>\n {t('CodeModeExplain')}\n </Typography.Text>\n </div>\n </>\n }\n trigger={'hover'}\n >\n <a href=\"#\">Explain</a>\n </Popover>\n }\n styles={{ body: { padding: 0, overflow: 'hidden' } }}\n >\n {source['parsedSource'] ||\n source['source'] ||\n source['transformed'] ? (\n <CodeViewer\n isEmbed\n code={\n tab\n ? source[tab as keyof SDK.ModuleSource]\n : source['parsedSource']\n ? source['parsedSource']\n : source['source']\n }\n filePath={path}\n />\n ) : (\n <EmptyCodeItem />\n )}\n </Card>\n )}\n </>\n );\n }}\n </ServerAPIProvider>\n </TextDrawer>\n );\n};\n\nexport const ModuleGraphViewer: React.FC<{\n id: number | string;\n show: boolean;\n setShow: (_show: boolean) => void;\n cwd: string;\n}> = ({ id, show, setShow, cwd }) => {\n if (!id) return null;\n\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetAllModuleGraph} body={{}}>\n {(modules) => (\n <ModuleAnalyzeComponent\n cwd={cwd}\n moduleId={id}\n modules={modules}\n show={show}\n setShow={setShow}\n />\n )}\n </ServerAPIProvider>\n );\n};\n\nconst inlinedResourcePathKey = '__RESOURCEPATH__';\n\nexport function getChildrenModule(node: DataNode, mods: string[]) {\n node.children &&\n node.children.forEach((n: DataNode) => {\n if (n.isLeaf) {\n mods.push(n[inlinedResourcePathKey]);\n } else {\n getChildrenModule(n, mods);\n }\n });\n\n return mods;\n}\n\nexport const ModulesStatistics: React.FC<{\n modules: SDK.ModuleData[];\n chunks: SDK.ChunkData[];\n filteredModules: SDK.ModuleData[];\n}> = ({ modules, chunks, filteredModules }) => {\n const { sourceSize, parsedSize, filteredParsedSize, filteredSourceSize } =\n useMemo(() => {\n return {\n sourceSize: sumBy(modules, (e) => e.size.sourceSize),\n parsedSize: sumBy(modules, (e) => e.size.parsedSize),\n filteredSourceSize: sumBy(filteredModules, (e) => e.size.sourceSize),\n filteredParsedSize: sumBy(filteredModules, (e) => e.size.parsedSize),\n };\n }, [modules, filteredModules]);\n\n return (\n <Space>\n <Tooltip\n title={`total modules count is ${modules.length}, the filtered modules count is ${filteredModules.length}`}\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules: {filteredModules.length} / {modules.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules bundled size: {formatSize(parsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules source size: {formatSize(sourceSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules bundled size: {formatSize(filteredParsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules source size: {formatSize(filteredSourceSize)}\n </Typography.Text>\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules Size:\n {filteredParsedSize === parsedSize\n ? formatSize(parsedSize)\n : `${formatSize(filteredParsedSize)} / ${formatSize(parsedSize)}`}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n this asset includes {chunks.length} chunks:\n </Typography.Text>\n {chunks.map((e) => (\n <Bdg label=\"chunk\" value={e.name} key={e.name} />\n ))}\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Chunks: {chunks.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n </Space>\n );\n};\n\nconst ConcatenatedTag = ({ moduleCount }: { moduleCount: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n This is a concatenated container module that includes {moduleCount}{' '}\n modules\n </Typography.Text>\n </Space>\n }\n >\n <Tag color=\"blue\" style={tagStyle}>\n concatenated container\n </Tag>\n </Tooltip>\n );\n};\n\nconst TotalBundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total output size of all the files in this folder. If you\n enabled minification, this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag style={tagStyle} color={'geekblue'}>\n {`bundled size: ${formatSize(size)}`}\n </Tag>\n </Tooltip>\n );\n};\n\nconst BundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The final output size of this file. If you enabled minification,\n this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'geekblue'}>{`bundled size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst GzippedSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The compressed file size that users actually download, as most web\n servers use gzip compression.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'orange'}>{`gzipped: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst TotalSourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total original size of all the files in this folder, before any\n transformations and minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag\n style={tagStyle}\n color={'cyan'}\n >{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst SourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The original size of this file, before any transformations and\n minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'cyan'}>{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nexport const AssetDetail: React.FC<{\n asset: SDK.AssetData;\n chunks: SDK.ChunkData[];\n modules: SDK.ModuleData[];\n moduleSizeLimit?: number;\n height?: number;\n root: string;\n}> = ({\n asset,\n chunks: includeChunks,\n modules: includeModules,\n moduleSizeLimit,\n height,\n root,\n}) => {\n const [moduleKeyword, setModuleKeyword] = useState('');\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [moduleJumpList, setModuleJumpList] = useState([] as number[]);\n const [show, setShow] = useState(false);\n\n const filteredModules = useMemo(() => {\n let res = includeModules.slice();\n if (moduleKeyword) {\n const regexp = new RegExp(moduleKeyword, 'i');\n res = res.filter((e) => regexp.test(e.path));\n }\n\n if (moduleSizeLimit) {\n res = res.filter((e) => e.size.parsedSize >= moduleSizeLimit);\n }\n\n return res;\n }, [includeModules, moduleKeyword, moduleSizeLimit]);\n\n const fileStructures = useMemo(() => {\n // Normalize paths for comparison - convert backslashes to forward slashes\n const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n const res = createFileStructures({\n files: filteredModules.map((e) => e.path).filter(Boolean),\n inlinedResourcePathKey,\n fileTitle(file, basename) {\n const mod = filteredModules.find(\n (e) => normalizePath(e.path) === normalizePath(file),\n )!;\n\n if (!mod) return basename;\n\n const { parsedSize = 0, sourceSize = 0, gzipSize = 0 } = mod.size;\n const isConcatenation = mod.kind === SDK.ModuleKind.Concatenation;\n\n const containedOtherModules =\n !isConcatenation &&\n parsedSize === 0 &&\n includeModules.filter(\n (e) => e !== mod && e.modules && e.modules.indexOf(mod.id) > -1,\n );\n\n return (\n <div className={styles['bundle-tree']}>\n <Popover\n content={`Open the ${basename}’s module reasons tree.`}\n placement=\"bottom\"\n >\n <div\n className={styles.box}\n onClick={() => {\n setModuleJumpList([mod.id]);\n setShow(true);\n }}\n >\n <div className={styles.keywords}>\n <Keyword ellipsis text={basename} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n </Popover>\n <Space>\n {parsedSize !== 0 ? (\n <>\n {typeof gzipSize === 'number' ? (\n <Popover\n placement=\"bottom\"\n content={<SourceSizeTag size={sourceSize} />}\n >\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <GzippedSizeTag size={gzipSize} />\n </Space>\n </Popover>\n ) : (\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <SourceSizeTag size={sourceSize} />\n </Space>\n )}\n </>\n ) : sourceSize !== 0 ? (\n // fallback to display tag for source size\n <SourceSizeTag size={sourceSize} />\n ) : null}\n {isConcatenation ? (\n <ConcatenatedTag moduleCount={mod.modules?.length || 0} />\n ) : null}\n {containedOtherModules && containedOtherModules.length ? (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n This module is concatenated into another container\n module:\n </Typography.Text>\n {containedOtherModules.map(({ id, path }) => {\n if (isJsDataUrl(path)) {\n return (\n <Typography.Paragraph\n ellipsis={{ rows: 4 }}\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {path}\n </Typography.Paragraph>\n );\n }\n\n const p = relative(dirname(mod.path), path);\n if (p.startsWith('javascript;charset=utf-8;base64,')) {\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n }\n\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n })}\n </Space>\n }\n >\n <Tag color=\"green\">concatenated</Tag>\n </Tooltip>\n ) : null}\n\n <ModuleCodeViewer data={mod} />\n </Space>\n </div>\n );\n },\n dirTitle(dir, defaultTitle) {\n const mods: string[] = [];\n const paths = getChildrenModule(dir, mods);\n if (paths.length) {\n // Normalize paths for comparison - convert backslashes to forward slashes\n const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n const mods = paths.map(\n (e) =>\n includeModules.find(\n (m) => normalizePath(m.path) === normalizePath(e),\n )!,\n );\n\n const parsedSize = sumBy(mods, (e) => e?.size?.parsedSize || 0);\n const sourceSize = sumBy(mods, (e) => e?.size?.sourceSize || 0);\n return (\n <div className={styles['bundle-tree']}>\n <div className={styles.box}>\n <div className={styles.keywords}>\n <Keyword ellipsis text={defaultTitle} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n <Space>\n {parsedSize > 0 ? (\n <>\n <TotalBundledSizeTag size={parsedSize} />\n <TotalSourceSizeTag size={sourceSize} />\n </>\n ) : (\n <TotalSourceSizeTag size={sourceSize} />\n )}\n </Space>\n </div>\n );\n }\n\n return defaultTitle;\n },\n page: 'bundle',\n });\n return res;\n }, [filteredModules]);\n\n const onSearch = (value: string) => setModuleKeyword(value);\n\n useEffect(() => {\n setModuleKeyword('');\n setDefaultExpandAll(false);\n }, [asset]);\n\n useEffect(() => {\n setDefaultExpandAll(false);\n }, [moduleKeyword]);\n\n return (\n <ModuleGraphListContext.Provider\n value={{ moduleJumpList, setModuleJumpList }}\n >\n <Card\n className={styles.bundle}\n title={`Modules of \"${asset.path}\"`}\n bodyStyle={{ minHeight: height }}\n size=\"small\"\n >\n {includeModules.length ? (\n <Row>\n <Col span={24}>\n <ModulesStatistics\n modules={includeModules}\n chunks={includeChunks}\n filteredModules={filteredModules}\n />\n </Col>\n <Col span={24}>\n <Space>\n <KeywordInput\n placeholder=\"search module by keyword\"\n onChange={onSearch}\n key={asset.path}\n />\n <Button\n onClick={() => setDefaultExpandAll(true)}\n size=\"small\"\n icon={<ColumnHeightOutlined />}\n />\n </Space>\n </Col>\n <Col span={24} style={{ marginTop: Size.BasePadding }}>\n {filteredModules.length ? (\n <DirectoryTree\n key={`tree_${moduleKeyword}_${defaultExpandAll}_${asset.path}`}\n selectable={false}\n defaultExpandAll={\n defaultExpandAll || filteredModules.length <= 20\n }\n onExpand={(expandedKeys) => {\n expandedModulesKeys = expandedKeys;\n }}\n defaultExpandParent\n // @ts-ignore\n defaultExpandedKeys={\n expandedModulesKeys?.length\n ? expandedModulesKeys\n : fileStructures.length === 1\n ? [fileStructures[0].key]\n : []\n }\n treeData={fileStructures as AntdDataNode[]}\n rootStyle={{\n maxHeight: '500px',\n overflow: 'auto',\n border: '1px solid rgba(235, 237, 241)',\n padding: '14px 20px',\n }}\n />\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${moduleKeyword}\" can't match any modules`}</Typography.Text>\n }\n />\n )}\n </Col>\n </Row>\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${asset.path}\" doesn't have any modules`}</Typography.Text>\n }\n />\n )}\n\n <ModuleGraphViewer\n id={\n moduleJumpList?.length\n ? moduleJumpList[moduleJumpList.length - 1]\n : ''\n }\n show={show}\n setShow={setShow}\n cwd={root}\n />\n </Card>\n </ModuleGraphListContext.Provider>\n );\n};\n"],"names":["DirectoryTree","Tree","expandedModulesKeys","TAB_MAP","tagStyle","EmptyCodeItem","Empty","ModuleCodeViewer","data","tab","setTab","useState","t","useI18n","TAB_LAB_MAP","path","TextDrawer","Popover","CodepenCircleOutlined","ServerAPIProvider","SDK","source","Card","Object","omitBy","s","k","e","v","Typography","CodeViewer","ModuleGraphViewer","id","show","setShow","cwd","modules","ModuleAnalyzeComponent","inlinedResourcePathKey","getChildrenModule","node","mods","n","ModulesStatistics","chunks","filteredModules","sourceSize","parsedSize","filteredParsedSize","filteredSourceSize","useMemo","sumBy","Space","Tooltip","InfoCircleOutlined","Divider","formatSize","Bdg","ConcatenatedTag","moduleCount","Tag","TotalBundledSizeTag","size","BundledSizeTag","GzippedSizeTag","TotalSourceSizeTag","SourceSizeTag","AssetDetail","asset","includeChunks","includeModules","moduleSizeLimit","height","root","moduleKeyword","setModuleKeyword","defaultExpandAll","setDefaultExpandAll","moduleJumpList","setModuleJumpList","res","regexp","RegExp","fileStructures","normalizePath","createFileStructures","Boolean","file","basename","mod","gzipSize","isConcatenation","containedOtherModules","styles","Keyword","isJsDataUrl","p","relative","dirname","dir","defaultTitle","paths","m","onSearch","value","useEffect","ModuleGraphListContext","Row","Col","KeywordInput","Button","ColumnHeightOutlined","Size","expandedKeys"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,EAAEA,aAAa,EAAE,GAAGC;AAE1B,IAAIC,sBAAmC,EAAE;AACzC,MAAMC,UAAU;IACd,QAAQ;IACR,aAAa;IACb,cAAc;AAChB;AAEA,MAAMC,WAAW;IACf,QAAQ;IACR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;oCAACA,cAAc,CAAC,EAAE,CAAC,GAAG;iCAAC,GACvB,EAAE;gCAEV,UAAUA;gCACV,WAAW;oCACT,WAAW;oCACX,UAAU;oCACV,QAAQ;oCACR,SAAS;gCACX;+BAvBK,CAAC,KAAK,EAAET,cAAc,CAAC,EAAEE,iBAAiB,CAAC,EAAER,MAAM,IAAI,EAAE,kBA0BhE,IAAC9D,OAAKA;gCACJ,2BACE,IAACuB,WAAW,IAAI;oCACd,QAAM;8CACN,CAAC,CAAC,EAAE6C,cAAc,yBAAyB,CAAC;;;;;mCAOxD,IAACpE,OAAKA;oBACJ,2BACE,IAACuB,WAAW,IAAI;wBACd,QAAM;kCACN,CAAC,CAAC,EAAEuC,MAAM,IAAI,CAAC,0BAA0B,CAAC;;;8BAKlD,IAACrC,mBAAAA;oBACC,IACE+C,gBAAgB,SACZA,cAAc,CAACA,eAAe,MAAM,GAAG,EAAE,GACzC;oBAEN,MAAM7C;oBACN,SAASC;oBACT,KAAKuC;;;;;AAKf"}
1
+ {"version":3,"file":"pages/BundleSize/components/asset.mjs","sources":["../../../../src/pages/BundleSize/components/asset.tsx"],"sourcesContent":["import {\n CodepenCircleOutlined,\n ColumnHeightOutlined,\n InfoCircleOutlined,\n} from '@ant-design/icons';\nimport { SDK } from '@rsdoctor/types';\nimport {\n Button,\n Card,\n Col,\n Divider,\n Empty,\n Popover,\n Row,\n Space,\n Tag,\n Tooltip,\n Tree,\n Typography,\n} from 'antd';\nimport { DataNode as AntdDataNode } from 'antd/es/tree';\nimport { omitBy, sumBy } from 'es-toolkit/compat';\nimport { dirname, relative } from 'path';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { CodeViewer } from 'src/components/base';\nimport { Badge as Bdg } from '../../../components/Badge';\nimport { KeywordInput } from '../../../components/Form/keyword';\nimport { Keyword } from '../../../components/Keyword';\nimport { ServerAPIProvider } from '../../../components/Manifest';\nimport { TextDrawer } from '../../../components/TextDrawer';\nimport { Size } from '../../../constants';\nimport {\n DataNode,\n createFileStructures,\n formatSize,\n isJsDataUrl,\n useI18n,\n} from '../../../utils';\nimport { ModuleAnalyzeComponent } from '../../ModuleAnalyze';\nimport { ModuleGraphListContext } from '../config';\nimport styles from './index.module.scss';\n\nconst { DirectoryTree } = Tree;\n\nlet expandedModulesKeys: React.Key[] = [];\nconst TAB_MAP = {\n source: 'source code',\n transformed: 'Transformed Code (After compile)',\n parsedSource: 'Bundled Code (After bundle and tree-shaking)',\n};\n\nconst tagStyle = {\n margin: 'none',\n marginInlineEnd: 0,\n};\n\nconst EmptyCodeItem = () => (\n <Empty\n description={`Do not have the module code.\n (1) If you use the brief mode, there will not have any codes to show.\n (2) If you use lite mode, there will not have source codes.`}\n />\n);\n\nexport const ModuleCodeViewer: React.FC<{ data: SDK.ModuleData }> = ({\n data,\n}) => {\n const [tab, setTab] = useState('');\n const { t } = useI18n();\n\n const TAB_LAB_MAP: Record<string, string> = {\n source: 'Source Code',\n transformed: `Transformed Code(${t('After Compile')})`,\n parsedSource: `Bundled Code(${t('After Bundled')})`,\n };\n if (!data) return null;\n\n const { path } = data;\n\n return (\n <TextDrawer\n text=\"\"\n buttonProps={{\n size: 'small',\n icon: (\n <Popover content=\"Open the Codes Box\">\n <CodepenCircleOutlined />\n </Popover>\n ),\n type: 'default',\n }}\n buttonStyle={{ padding: `0 4px` }}\n drawerProps={{\n destroyOnClose: true,\n title: `Code of \"${path}\"`,\n }}\n >\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetModuleCodeByModuleId}\n body={{ moduleId: data.id }}\n >\n {(source) => {\n return (\n <>\n {!source['source'] &&\n !source['parsedSource'] &&\n !source['transformed'] ? (\n <EmptyCodeItem />\n ) : (\n <Card\n className=\"code-size-card\"\n style={{ width: '100%' }}\n tabList={Object.keys(omitBy(source, (s) => !s))\n .map((k) => ({ tab: k }))\n .map((e) => ({\n ...e,\n tab: TAB_LAB_MAP[e.tab],\n key: e.tab,\n }))}\n defaultActiveTabKey={\n source['parsedSource'] ? 'parsedSource' : 'source'\n }\n onTabChange={(v) => setTab(v)}\n tabBarExtraContent={\n <Popover\n placement=\"bottom\"\n title={\n <Typography.Title level={5}>Explain</Typography.Title>\n }\n content={\n <>\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n marginBottom: 30,\n }}\n >\n <div>\n <Typography.Text strong>Source: </Typography.Text>\n <Typography.Text>\n {TAB_MAP.source}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Transformed:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.transformed}\n </Typography.Text>\n </div>\n <div>\n <Typography.Text strong>\n Bundled Source:\n </Typography.Text>\n <Typography.Text>\n {TAB_MAP.parsedSource}\n </Typography.Text>\n </div>\n <br />\n <Typography.Text strong>{'More'}</Typography.Text>\n <Typography.Text>\n {t('CodeModeExplain')}\n </Typography.Text>\n </div>\n </>\n }\n trigger={'hover'}\n >\n <a href=\"#\">Explain</a>\n </Popover>\n }\n styles={{ body: { padding: 0, overflow: 'hidden' } }}\n >\n {source['parsedSource'] ||\n source['source'] ||\n source['transformed'] ? (\n <CodeViewer\n isEmbed\n code={\n tab\n ? source[tab as keyof SDK.ModuleSource]\n : source['parsedSource']\n ? source['parsedSource']\n : source['source']\n }\n filePath={path}\n />\n ) : (\n <EmptyCodeItem />\n )}\n </Card>\n )}\n </>\n );\n }}\n </ServerAPIProvider>\n </TextDrawer>\n );\n};\n\nexport const ModuleGraphViewer: React.FC<{\n id: number | string;\n show: boolean;\n setShow: (_show: boolean) => void;\n cwd: string;\n}> = ({ id, show, setShow, cwd }) => {\n if (!id) return null;\n\n return (\n <ServerAPIProvider api={SDK.ServerAPI.API.GetAllModuleGraph} body={{}}>\n {(modules) => (\n <ModuleAnalyzeComponent\n cwd={cwd}\n moduleId={id}\n modules={modules}\n show={show}\n setShow={setShow}\n />\n )}\n </ServerAPIProvider>\n );\n};\n\nconst inlinedResourcePathKey = '__RESOURCEPATH__';\n\nexport function getChildrenModule(node: DataNode, mods: string[]) {\n node.children &&\n node.children.forEach((n: DataNode) => {\n if (n.isLeaf) {\n mods.push(n[inlinedResourcePathKey]);\n } else {\n getChildrenModule(n, mods);\n }\n });\n\n return mods;\n}\n\nexport const ModulesStatistics: React.FC<{\n modules: SDK.ModuleData[];\n chunks: SDK.ChunkData[];\n filteredModules: SDK.ModuleData[];\n}> = ({ modules, chunks, filteredModules }) => {\n const { sourceSize, parsedSize, filteredParsedSize, filteredSourceSize } =\n useMemo(() => {\n return {\n sourceSize: sumBy(modules, (e) => e.size.sourceSize),\n parsedSize: sumBy(modules, (e) => e.size.parsedSize),\n filteredSourceSize: sumBy(filteredModules, (e) => e.size.sourceSize),\n filteredParsedSize: sumBy(filteredModules, (e) => e.size.parsedSize),\n };\n }, [modules, filteredModules]);\n\n return (\n <Space>\n <Tooltip\n title={`total modules count is ${modules.length}, the filtered modules count is ${filteredModules.length}`}\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules: {filteredModules.length} / {modules.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules bundled size: {formatSize(parsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Total modules source size: {formatSize(sourceSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules bundled size: {formatSize(filteredParsedSize)}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n Filtered modules source size: {formatSize(filteredSourceSize)}\n </Typography.Text>\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Modules Size:\n {filteredParsedSize === parsedSize\n ? formatSize(parsedSize)\n : `${formatSize(filteredParsedSize)} / ${formatSize(parsedSize)}`}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n <Divider type=\"vertical\" />\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n this asset includes {chunks.length} chunks:\n </Typography.Text>\n {chunks.map((e) => (\n <Bdg label=\"chunk\" value={e.name} key={e.name} />\n ))}\n </Space>\n }\n >\n <Space>\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 12, fontWeight: 400 }}\n >\n Chunks: {chunks.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Space>\n </Tooltip>\n </Space>\n );\n};\n\nconst ConcatenatedTag = ({ moduleCount }: { moduleCount: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n This is a concatenated container module that includes {moduleCount}{' '}\n modules\n </Typography.Text>\n </Space>\n }\n >\n <Tag color=\"blue\" style={tagStyle}>\n concatenated container\n </Tag>\n </Tooltip>\n );\n};\n\nconst TotalBundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total output size of all the files in this folder. If you\n enabled minification, this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag style={tagStyle} color={'geekblue'}>\n {`bundled size: ${formatSize(size)}`}\n </Tag>\n </Tooltip>\n );\n};\n\nconst BundledSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The final output size of this file. If you enabled minification,\n this value shows the minified size.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'geekblue'}>{`bundled size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst GzippedSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The compressed file size that users actually download, as most web\n servers use gzip compression.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'orange'}>{`gzipped: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst TotalSourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The total original size of all the files in this folder, before any\n transformations and minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag\n style={tagStyle}\n color={'cyan'}\n >{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nconst SourceSizeTag = ({ size }: { size: number }) => {\n return (\n <Tooltip\n title={\n <Space>\n <Typography.Text style={{ color: 'inherit' }}>\n The original size of this file, before any transformations and\n minification.\n </Typography.Text>\n </Space>\n }\n >\n <Tag color={'cyan'}>{`source size: ${formatSize(size)}`}</Tag>\n </Tooltip>\n );\n};\n\nexport const AssetDetail: React.FC<{\n asset: SDK.AssetData;\n chunks: SDK.ChunkData[];\n modules: SDK.ModuleData[];\n moduleSizeLimit?: number;\n height?: number;\n root: string;\n}> = ({\n asset,\n chunks: includeChunks,\n modules: includeModules,\n moduleSizeLimit,\n height,\n root,\n}) => {\n const [moduleKeyword, setModuleKeyword] = useState('');\n const [defaultExpandAll, setDefaultExpandAll] = useState(false);\n const [moduleJumpList, setModuleJumpList] = useState([] as number[]);\n const [show, setShow] = useState(false);\n\n const filteredModules = useMemo(() => {\n let res = includeModules.slice();\n if (moduleKeyword) {\n const regexp = new RegExp(moduleKeyword, 'i');\n res = res.filter((e) => regexp.test(e.path));\n }\n\n if (moduleSizeLimit) {\n res = res.filter((e) => e.size.parsedSize >= moduleSizeLimit);\n }\n\n return res;\n }, [includeModules, moduleKeyword, moduleSizeLimit]);\n\n const fileStructures = useMemo(() => {\n // Normalize paths for comparison - convert backslashes to forward slashes\n const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n const res = createFileStructures({\n files: filteredModules.map((e) => e.path).filter(Boolean),\n inlinedResourcePathKey,\n fileTitle(file, basename) {\n const mod = filteredModules.find(\n (e) => normalizePath(e.path) === normalizePath(file),\n )!;\n\n if (!mod) return basename;\n\n const { parsedSize = 0, sourceSize = 0, gzipSize = 0 } = mod.size;\n const isConcatenation = mod.kind === SDK.ModuleKind.Concatenation;\n\n const containedOtherModules =\n !isConcatenation &&\n parsedSize === 0 &&\n includeModules.filter(\n (e) => e !== mod && e.modules && e.modules.indexOf(mod.id) > -1,\n );\n\n return (\n <div className={styles['bundle-tree']}>\n <Popover\n content={`Open the ${basename}’s module reasons tree.`}\n placement=\"bottom\"\n >\n <div\n className={styles.box}\n onClick={() => {\n setModuleJumpList([mod.id]);\n setShow(true);\n }}\n >\n <div className={styles.keywords}>\n <Keyword ellipsis text={basename} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n </Popover>\n <Space>\n {parsedSize !== 0 ? (\n <>\n {typeof gzipSize === 'number' ? (\n <Popover\n placement=\"bottom\"\n content={<SourceSizeTag size={sourceSize} />}\n >\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <GzippedSizeTag size={gzipSize} />\n </Space>\n </Popover>\n ) : (\n <Space direction=\"horizontal\">\n <BundledSizeTag size={parsedSize} />\n <SourceSizeTag size={sourceSize} />\n </Space>\n )}\n </>\n ) : sourceSize !== 0 ? (\n // fallback to display tag for source size\n <SourceSizeTag size={sourceSize} />\n ) : null}\n {isConcatenation ? (\n <ConcatenatedTag moduleCount={mod.modules?.length || 0} />\n ) : null}\n {containedOtherModules && containedOtherModules.length ? (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n This module is concatenated into another container\n module:\n </Typography.Text>\n {containedOtherModules.map(({ id, path }) => {\n if (isJsDataUrl(path)) {\n return (\n <Typography.Paragraph\n ellipsis={{ rows: 4 }}\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {path}\n </Typography.Paragraph>\n );\n }\n\n const p = relative(dirname(mod.path), path);\n if (p.startsWith('javascript;charset=utf-8;base64,')) {\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit', maxWidth: '100%' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n }\n\n return (\n <Typography.Text\n key={id}\n style={{ color: 'inherit' }}\n code\n >\n {p[0] === '.' ? p : `./${p}`}\n </Typography.Text>\n );\n })}\n </Space>\n }\n >\n <Tag color=\"green\">concatenated</Tag>\n </Tooltip>\n ) : null}\n\n <ModuleCodeViewer data={mod} />\n </Space>\n </div>\n );\n },\n dirTitle(dir, defaultTitle) {\n const mods: string[] = [];\n const paths = getChildrenModule(dir, mods);\n if (paths.length) {\n // Normalize paths for comparison - convert backslashes to forward slashes\n const normalizePath = (path: string) => path.replace(/\\\\/g, '/');\n const mods = paths.map(\n (e) =>\n includeModules.find(\n (m) => normalizePath(m.path) === normalizePath(e),\n )!,\n );\n\n const parsedSize = sumBy(mods, (e) => e?.size?.parsedSize || 0);\n const sourceSize = sumBy(mods, (e) => e?.size?.sourceSize || 0);\n return (\n <div className={styles['bundle-tree']}>\n <div className={styles.box}>\n <div className={styles.keywords}>\n <Keyword ellipsis text={defaultTitle} keyword={''} />\n </div>\n <div className={styles.dividerDiv}>\n <Divider className={styles.divider} dashed />\n </div>\n </div>\n <Space>\n {parsedSize > 0 ? (\n <>\n <TotalBundledSizeTag size={parsedSize} />\n <TotalSourceSizeTag size={sourceSize} />\n </>\n ) : (\n <TotalSourceSizeTag size={sourceSize} />\n )}\n </Space>\n </div>\n );\n }\n\n return defaultTitle;\n },\n page: 'bundle',\n });\n return res;\n }, [filteredModules]);\n\n const onSearch = (value: string) => setModuleKeyword(value);\n\n useEffect(() => {\n setModuleKeyword('');\n setDefaultExpandAll(false);\n }, [asset]);\n\n useEffect(() => {\n setDefaultExpandAll(false);\n }, [moduleKeyword]);\n\n return (\n <ModuleGraphListContext.Provider\n value={{ moduleJumpList, setModuleJumpList }}\n >\n <Card\n className={styles.bundle}\n title={`Modules of \"${asset.path}\"`}\n bodyStyle={{ minHeight: height }}\n size=\"small\"\n >\n {includeModules.length ? (\n <Row>\n <Col span={24}>\n <ModulesStatistics\n modules={includeModules}\n chunks={includeChunks}\n filteredModules={filteredModules}\n />\n </Col>\n <Col span={24}>\n <Space>\n <KeywordInput\n placeholder=\"search module by keyword\"\n onChange={onSearch}\n key={asset.path}\n />\n <Button\n onClick={() => setDefaultExpandAll(true)}\n size=\"small\"\n icon={<ColumnHeightOutlined />}\n />\n </Space>\n </Col>\n <Col span={24} style={{ marginTop: Size.BasePadding }}>\n {filteredModules.length ? (\n <DirectoryTree\n key={`tree_${moduleKeyword}_${defaultExpandAll}_${asset.path}`}\n selectable={false}\n defaultExpandAll={\n defaultExpandAll || filteredModules.length <= 20\n }\n onExpand={(expandedKeys) => {\n expandedModulesKeys = expandedKeys;\n }}\n defaultExpandParent\n // @ts-ignore\n defaultExpandedKeys={\n expandedModulesKeys?.length\n ? expandedModulesKeys\n : fileStructures.length === 1\n ? [fileStructures[0].key]\n : []\n }\n treeData={fileStructures as AntdDataNode[]}\n rootStyle={{\n maxHeight: '500px',\n overflow: 'auto',\n border: '1px solid rgba(235, 237, 241)',\n padding: '14px 20px',\n }}\n />\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${moduleKeyword}\" can't match any modules`}</Typography.Text>\n }\n />\n )}\n </Col>\n </Row>\n ) : (\n <Empty\n description={\n <Typography.Text\n strong\n >{`\"${asset.path}\" doesn't have any modules`}</Typography.Text>\n }\n />\n )}\n\n <ModuleGraphViewer\n id={\n moduleJumpList?.length\n ? moduleJumpList[moduleJumpList.length - 1]\n : ''\n }\n show={show}\n setShow={setShow}\n cwd={root}\n />\n </Card>\n </ModuleGraphListContext.Provider>\n );\n};\n"],"names":["DirectoryTree","Tree","expandedModulesKeys","TAB_MAP","tagStyle","EmptyCodeItem","Empty","ModuleCodeViewer","data","tab","setTab","useState","t","useI18n","TAB_LAB_MAP","path","TextDrawer","Popover","CodepenCircleOutlined","ServerAPIProvider","SDK","source","Card","Object","omitBy","s","k","e","v","Typography","CodeViewer","ModuleGraphViewer","id","show","setShow","cwd","modules","ModuleAnalyzeComponent","inlinedResourcePathKey","getChildrenModule","node","mods","n","ModulesStatistics","chunks","filteredModules","sourceSize","parsedSize","filteredParsedSize","filteredSourceSize","useMemo","sumBy","Space","Tooltip","InfoCircleOutlined","Divider","formatSize","Bdg","ConcatenatedTag","moduleCount","Tag","TotalBundledSizeTag","size","BundledSizeTag","GzippedSizeTag","TotalSourceSizeTag","SourceSizeTag","AssetDetail","asset","includeChunks","includeModules","moduleSizeLimit","height","root","moduleKeyword","setModuleKeyword","defaultExpandAll","setDefaultExpandAll","moduleJumpList","setModuleJumpList","res","regexp","RegExp","fileStructures","normalizePath","createFileStructures","Boolean","file","basename","mod","gzipSize","isConcatenation","containedOtherModules","styles","Keyword","isJsDataUrl","p","relative","dirname","dir","defaultTitle","paths","m","onSearch","value","useEffect","ModuleGraphListContext","Row","Col","KeywordInput","Button","ColumnHeightOutlined","Size","expandedKeys"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,MAAM,EAAEA,eAAAA,aAAa,EAAE,GAAGC;AAE1B,IAAIC,sBAAmC,EAAE;AACzC,MAAMC,UAAU;IACd,QAAQ;IACR,aAAa;IACb,cAAc;AAChB;AAEA,MAAMC,WAAW;IACf,QAAQ;IACR,iBAAiB;AACnB;AAEA,MAAMC,gBAAgB,kBACpB,IAACC,OAAKA;QACJ,aAAa,CAAC;;6DAE2C,CAAC;;AAIvD,MAAMC,mBAAuD,CAAC,EACnEC,IAAI,EACL;IACC,MAAM,CAACC,KAAKC,OAAO,GAAGC,SAAS;IAC/B,MAAM,EAAEC,CAAC,EAAE,GAAGC;IAEd,MAAMC,cAAsC;QAC1C,QAAQ;QACR,aAAa,CAAC,iBAAiB,EAAEF,EAAE,iBAAiB,CAAC,CAAC;QACtD,cAAc,CAAC,aAAa,EAAEA,EAAE,iBAAiB,CAAC,CAAC;IACrD;IACA,IAAI,CAACJ,MAAM,OAAO;IAElB,MAAM,EAAEO,IAAI,EAAE,GAAGP;IAEjB,OAAO,WAAP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0BAA0B,CAAC;;;8BAKlD,IAACrC,mBAAiBA;oBAChB,IACE+C,gBAAgB,SACZA,cAAc,CAACA,eAAe,MAAM,GAAG,EAAE,GACzC;oBAEN,MAAM7C;oBACN,SAASC;oBACT,KAAKuC;;;;;AAKf"}
@@ -10,6 +10,6 @@ const card_module = {
10
10
  cardTitle: "cardTitle-xNmEfV",
11
11
  title: "title-qIR7dd"
12
12
  };
13
- export { card_module as default };
13
+ export default card_module;
14
14
 
15
15
  //# sourceMappingURL=card.module.mjs.map
@@ -11,8 +11,8 @@ import { ServerAPIProvider } from "../../../components/Manifest/index.mjs";
11
11
  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
- const { DirectoryTree } = Tree;
15
- const { useToken } = theme;
14
+ const { DirectoryTree: DirectoryTree } = Tree;
15
+ const { useToken: useToken } = theme;
16
16
  const { innerWidth: cards_innerWidth } = window;
17
17
  const AssetCard = ({ showProgress = false, data, total, tagBgColor, type })=>{
18
18
  const { token } = useToken();
@@ -1 +1 @@
1
- {"version":3,"file":"pages/BundleSize/components/cards.mjs","sources":["../../../../src/pages/BundleSize/components/cards.tsx"],"sourcesContent":["/* eslint-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,aAAa,EAAE,GAAGC;AAC1B,MAAM,EAAEC,QAAQ,EAAE,GAAGC;AACrB,MAAM,EAAEC,YAAU,kBAAE,GAAGC;AAUvB,MAAMC,YAAiC,CAAC,EACtCC,eAAe,KAAK,EACpBC,IAAI,EACJC,KAAK,EACLC,UAAU,E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;;;gCAKhC,oBACE,IAACe,QAAMA;oCACL,OAAO;wCAAE,YAAY;oCAAU;oCAC/B,OAAM;oCACN,oBAAM,IAACC,YAAUA;wCAAC,OAAO;4CAAE,UAAU;wCAAO;;;gCAGhD,OAAO;oCACL,cAAc;oCACd,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"}
1
+ {"version":3,"file":"pages/BundleSize/components/cards.mjs","sources":["../../../../src/pages/BundleSize/components/cards.tsx"],"sourcesContent":["/* eslint-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","Av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
@@ -20,7 +20,7 @@ import "./index.css";
20
20
  import { SearchModal } from "./search-modal.mjs";
21
21
  import { AssetTreemapWithFilter } from "../../../components/Charts/TreeMap.mjs";
22
22
  import { Rspack } from "@rsdoctor/utils/common";
23
- const { Option } = Select;
23
+ const { Option: Option } = Select;
24
24
  const cardBodyHeight = 600;
25
25
  const WebpackModulesOverallBase = ({ errors, cwd, summary, entryPoints })=>{
26
26
  const [selectedEntryPoints, setEntryPoints] = useState([]);