@rsdoctor/components 1.3.4 → 1.3.5

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 (85) hide show
  1. package/dist/components/Alert/ecma-version-check.mjs +2 -2
  2. package/dist/components/Alert/ecma-version-check.mjs.map +1 -1
  3. package/dist/components/Alert/package-relation.mjs +2 -4
  4. package/dist/components/Alert/package-relation.mjs.map +1 -1
  5. package/dist/components/Alert/view.mjs +2 -3
  6. package/dist/components/Alert/view.mjs.map +1 -1
  7. package/dist/components/Alerts/bundle-alert.mjs +2 -4
  8. package/dist/components/Alerts/bundle-alert.mjs.map +1 -1
  9. package/dist/components/Charts/TimelineCharts/index.mjs +3 -4
  10. package/dist/components/Charts/TimelineCharts/index.mjs.map +1 -1
  11. package/dist/components/Charts/TreeMap.mjs +2 -3
  12. package/dist/components/Charts/TreeMap.mjs.map +1 -1
  13. package/dist/components/Charts/index.mjs +1 -1
  14. package/dist/components/Charts/index.mjs.map +1 -1
  15. package/dist/components/Charts/loader.mjs +2 -2
  16. package/dist/components/Charts/loader.mjs.map +1 -1
  17. package/dist/components/FileTree/index.mjs +2 -2
  18. package/dist/components/FileTree/index.mjs.map +1 -1
  19. package/dist/components/Loader/Analysis/files.mjs +32 -36
  20. package/dist/components/Loader/Analysis/files.mjs.map +1 -1
  21. package/dist/components/Loader/executions.mjs +1 -2
  22. package/dist/components/Loader/executions.mjs.map +1 -1
  23. package/dist/components/Overall/bundle_module.css +1 -0
  24. package/dist/components/Overall/bundle_module.css.map +1 -1
  25. package/dist/components/Overall/compile.mjs +1 -2
  26. package/dist/components/Overall/compile.mjs.map +1 -1
  27. package/dist/components/Overall/help-center_module.css +2 -0
  28. package/dist/components/Overall/help-center_module.css.map +1 -1
  29. package/dist/components/Overall/list_module.css +2 -12
  30. package/dist/components/Overall/list_module.css.map +1 -1
  31. package/dist/components/Overall/project_module.css +1 -0
  32. package/dist/components/Overall/project_module.css.map +1 -1
  33. package/dist/components/Select/index.mjs +1 -1
  34. package/dist/components/Select/index.mjs.map +1 -1
  35. package/dist/components/base/CodeViewer/index.mjs +1 -2
  36. package/dist/components/base/CodeViewer/index.mjs.map +1 -1
  37. package/dist/components/base/CodeViewer/utils.mjs +1 -1
  38. package/dist/components/base/CodeViewer/utils.mjs.map +1 -1
  39. package/dist/components/base/DiffViewer/index.mjs +1 -2
  40. package/dist/components/base/DiffViewer/index.mjs.map +1 -1
  41. package/dist/pages/BundleSize/components/asset.mjs +5 -12
  42. package/dist/pages/BundleSize/components/asset.mjs.map +1 -1
  43. package/dist/pages/BundleSize/components/cards.mjs +2 -2
  44. package/dist/pages/BundleSize/components/cards.mjs.map +1 -1
  45. package/dist/pages/BundleSize/components/index_module.css +2 -6
  46. package/dist/pages/BundleSize/components/index_module.css.map +1 -1
  47. package/dist/pages/BundleSize/components/search-modal.mjs +5 -5
  48. package/dist/pages/BundleSize/components/search-modal.mjs.map +1 -1
  49. package/dist/pages/ModuleAnalyze/chunks.mjs +1 -1
  50. package/dist/pages/ModuleAnalyze/chunks.mjs.map +1 -1
  51. package/dist/pages/ModuleAnalyze/components/fileTreeCom.mjs +1 -2
  52. package/dist/pages/ModuleAnalyze/components/fileTreeCom.mjs.map +1 -1
  53. package/dist/pages/ModuleAnalyze/fileTree.mjs +1 -2
  54. package/dist/pages/ModuleAnalyze/fileTree.mjs.map +1 -1
  55. package/dist/pages/ModuleAnalyze/utils/hooks.mjs +5 -8
  56. package/dist/pages/ModuleAnalyze/utils/hooks.mjs.map +1 -1
  57. package/dist/pages/ModuleAnalyze/utils/index.mjs +2 -4
  58. package/dist/pages/ModuleAnalyze/utils/index.mjs.map +1 -1
  59. package/dist/pages/Resources/BundleDiff/DiffContainer/assets.mjs +4 -7
  60. package/dist/pages/Resources/BundleDiff/DiffContainer/assets.mjs.map +1 -1
  61. package/dist/pages/Resources/BundleDiff/DiffContainer/modules.mjs +13 -16
  62. package/dist/pages/Resources/BundleDiff/DiffContainer/modules.mjs.map +1 -1
  63. package/dist/pages/Resources/BundleDiff/DiffContainer/row.mjs +15 -35
  64. package/dist/pages/Resources/BundleDiff/DiffContainer/row.mjs.map +1 -1
  65. package/dist/pages/Resources/BundleDiff/DiffServerAPIProvider/index.mjs +3 -4
  66. package/dist/pages/Resources/BundleDiff/DiffServerAPIProvider/index.mjs.map +1 -1
  67. package/dist/pages/TreeShaking/editor.mjs +2 -4
  68. package/dist/pages/TreeShaking/editor.mjs.map +1 -1
  69. package/dist/pages/TreeShaking/index.css +4 -28
  70. package/dist/pages/TreeShaking/index.css.map +1 -1
  71. package/dist/pages/TreeShaking/index.mjs +1 -1
  72. package/dist/pages/TreeShaking/index.mjs.map +1 -1
  73. package/dist/pages/TreeShaking/table.mjs +3 -3
  74. package/dist/pages/TreeShaking/table.mjs.map +1 -1
  75. package/dist/utils/file.mjs +8 -9
  76. package/dist/utils/file.mjs.map +1 -1
  77. package/dist/utils/hooks.mjs +1 -5
  78. package/dist/utils/hooks.mjs.map +1 -1
  79. package/dist/utils/loader.mjs +1 -1
  80. package/dist/utils/loader.mjs.map +1 -1
  81. package/dist/utils/request.mjs +1 -2
  82. package/dist/utils/request.mjs.map +1 -1
  83. package/dist/utils/url.mjs +2 -2
  84. package/dist/utils/url.mjs.map +1 -1
  85. package/package.json +6 -6
@@ -17,7 +17,6 @@ const FileTree = (props)=>{
17
17
  refreshAsyncNodes: true
18
18
  });
19
19
  const renderNode = useCallback(({ node, onToggle })=>{
20
- var _node_data_children;
21
20
  defaultOpenFather && node.data.level < defaultOpenFather && node.setOpened(true);
22
21
  const Icon = getFileCom(node.data.name);
23
22
  return /*#__PURE__*/ jsx("div", {
@@ -34,7 +33,7 @@ const FileTree = (props)=>{
34
33
  onClick: onToggle,
35
34
  children: /*#__PURE__*/ jsxs(Space, {
36
35
  children: [
37
- !node.options.opened && (null == (_node_data_children = node.data.children) ? void 0 : _node_data_children.length) ? /*#__PURE__*/ jsx(PlusCircleOutlined, {
36
+ !node.options.opened && node.data.children?.length ? /*#__PURE__*/ jsx(PlusCircleOutlined, {
38
37
  style: {
39
38
  color: 'lightblue'
40
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pages/ModuleAnalyze/components/fileTreeCom.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/components/fileTreeCom.tsx"],"sourcesContent":["import {\n MinusCircleOutlined,\n PlusCircleOutlined,\n RightSquareOutlined,\n} from '@ant-design/icons';\nimport { Popover, Space, Typography } from 'antd';\nimport React, { useCallback } from 'react';\nimport Tree, { DefaultNodeProps, useTreeState } from 'react-hyper-tree';\n\nimport { ModuleGraphListContext } from '../../BundleSize/config';\nimport { NewTreeNodeType } from '../utils/hooks';\nimport './fileTreeCom.scss';\nimport { getFileCom } from 'src/components/FileTree';\n\nconst prefix = 'file-tree-com';\n\ntype FileTreeProps = {\n treeData: NewTreeNodeType[];\n needCode?: boolean;\n needShowAllTree?: boolean;\n needJumpto?: boolean;\n defaultOpened?: boolean;\n defaultOpenFather?: number;\n cwd: string;\n selectedChunk?: string;\n};\n\nexport const FileTree: React.FC<FileTreeProps> = (props) => {\n const {\n treeData,\n needJumpto = false,\n defaultOpened = false,\n defaultOpenFather = 0,\n } = props;\n\n const { required, handlers } = useTreeState({\n id: `${prefix}-tree`,\n data: treeData || [],\n defaultOpened,\n multipleSelect: false,\n refreshAsyncNodes: true,\n });\n\n const renderNode = useCallback(({ node, onToggle }: DefaultNodeProps) => {\n defaultOpenFather &&\n node.data.level < defaultOpenFather &&\n node.setOpened(true);\n const Icon = getFileCom(node.data.name);\n\n return (\n <div className={`${prefix}-titles-box`} key={node.data.name}>\n <div className={`${prefix}-titles`}>\n <Space direction=\"vertical\">\n <div className={`${prefix}-node-title`}>\n <Space>\n <div onClick={onToggle}>\n <Space>\n {!node.options.opened && node.data.children?.length ? (\n <PlusCircleOutlined style={{ color: 'lightblue' }} />\n ) : (\n <MinusCircleOutlined style={{ color: 'lightblue' }} />\n )}\n {Icon}\n <Popover\n key={`${node.data.name}popover`}\n content={\n <>\n {node.data.__RESOURCEPATH__ ? (\n <Typography.Text\n key={`${node.data.name}-popover-path`}\n code\n >\n {node.data.__RESOURCEPATH__}\n </Typography.Text>\n ) : (\n <></>\n )}\n </>\n }\n title=\"INFO\"\n trigger=\"hover\"\n >\n <Typography.Text>{node.data.name}</Typography.Text>\n </Popover>\n </Space>\n </div>\n <Space>\n {needJumpto && (\n <ModuleGraphListContext.Consumer>\n {({ moduleJumpList, setModuleJumpList }) => {\n return (\n <RightSquareOutlined\n onClick={() => {\n const _list = [...moduleJumpList];\n _list.push(+node.id);\n setModuleJumpList(_list);\n }}\n />\n );\n }}\n </ModuleGraphListContext.Consumer>\n )}\n </Space>\n </Space>\n </div>\n </Space>\n </div>\n </div>\n );\n }, []);\n\n return (\n <>\n <Tree\n {...required}\n {...handlers}\n horizontalLineStyles={{\n stroke: '#c4c4c4',\n strokeWidth: 2,\n strokeDasharray: '1 1',\n }}\n verticalLineStyles={{\n stroke: '#c4c4c4',\n strokeWidth: 2,\n strokeDasharray: '1 1',\n }}\n draggable={false}\n depthGap={14}\n gapMode={'padding'}\n disableLines={false}\n disableTransitions={true}\n disableHorizontalLines={false}\n disableVerticalLines={false}\n verticalLineTopOffset={0}\n verticalLineOffset={5}\n renderNode={renderNode}\n />\n </>\n );\n};\n"],"names":["prefix","FileTree","props","treeData","needJumpto","defaultOpened","defaultOpenFather","required","handlers","useTreeState","renderNode","useCallback","node","onToggle","_node_data_children","Icon","getFileCom","Space","PlusCircleOutlined","MinusCircleOutlined","Popover","Typography","ModuleGraphListContext","moduleJumpList","setModuleJumpList","RightSquareOutlined","_list","Tree"],"mappings":";;;;;;;;AAcA,MAAMA,SAAS;AAaR,MAAMC,WAAoC,CAACC;IAChD,MAAM,EACJC,QAAQ,EACRC,aAAa,KAAK,EAClBC,gBAAgB,KAAK,EACrBC,oBAAoB,CAAC,EACtB,GAAGJ;IAEJ,MAAM,EAAEK,QAAQ,EAAEC,QAAQ,EAAE,GAAGC,aAAa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ACK,OAAKA;8CACHb,cAAc,WAAdA,GACC,IAACkB,uBAAuB,QAAQ;kDAC7B,CAAC,EAAEC,cAAc,EAAEC,iBAAiB,EAAE,GAC9B,WAAP,GACE,IAACC,qBAAmBA;gDAClB,SAAS;oDACP,MAAMC,QAAQ;2DAAIH;qDAAe;oDACjCG,MAAM,IAAI,CAAC,CAACd,KAAK,EAAE;oDACnBY,kBAAkBE;gDACpB;;;;;;;;;WA9CuBd,KAAK,IAAI,CAAC,IAAI;IA2D/D,GAAG,EAAE;IAEL,OAAO,WAAP,GACE;kBACE,kBAACe,kBAAIA;YACF,GAAGpB,QAAQ;YACX,GAAGC,QAAQ;YACZ,sBAAsB;gBACpB,QAAQ;gBACR,aAAa;gBACb,iBAAiB;YACnB;YACA,oBAAoB;gBAClB,QAAQ;gBACR,aAAa;gBACb,iBAAiB;YACnB;YACA,WAAW;YACX,UAAU;YACV,SAAS;YACT,cAAc;YACd,oBAAoB;YACpB,wBAAwB;YACxB,sBAAsB;YACtB,uBAAuB;YACvB,oBAAoB;YACpB,YAAYE;;;AAIpB"}
1
+ {"version":3,"file":"pages/ModuleAnalyze/components/fileTreeCom.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/components/fileTreeCom.tsx"],"sourcesContent":["import {\n MinusCircleOutlined,\n PlusCircleOutlined,\n RightSquareOutlined,\n} from '@ant-design/icons';\nimport { Popover, Space, Typography } from 'antd';\nimport React, { useCallback } from 'react';\nimport Tree, { DefaultNodeProps, useTreeState } from 'react-hyper-tree';\n\nimport { ModuleGraphListContext } from '../../BundleSize/config';\nimport { NewTreeNodeType } from '../utils/hooks';\nimport './fileTreeCom.scss';\nimport { getFileCom } from 'src/components/FileTree';\n\nconst prefix = 'file-tree-com';\n\ntype FileTreeProps = {\n treeData: NewTreeNodeType[];\n needCode?: boolean;\n needShowAllTree?: boolean;\n needJumpto?: boolean;\n defaultOpened?: boolean;\n defaultOpenFather?: number;\n cwd: string;\n selectedChunk?: string;\n};\n\nexport const FileTree: React.FC<FileTreeProps> = (props) => {\n const {\n treeData,\n needJumpto = false,\n defaultOpened = false,\n defaultOpenFather = 0,\n } = props;\n\n const { required, handlers } = useTreeState({\n id: `${prefix}-tree`,\n data: treeData || [],\n defaultOpened,\n multipleSelect: false,\n refreshAsyncNodes: true,\n });\n\n const renderNode = useCallback(({ node, onToggle }: DefaultNodeProps) => {\n defaultOpenFather &&\n node.data.level < defaultOpenFather &&\n node.setOpened(true);\n const Icon = getFileCom(node.data.name);\n\n return (\n <div className={`${prefix}-titles-box`} key={node.data.name}>\n <div className={`${prefix}-titles`}>\n <Space direction=\"vertical\">\n <div className={`${prefix}-node-title`}>\n <Space>\n <div onClick={onToggle}>\n <Space>\n {!node.options.opened && node.data.children?.length ? (\n <PlusCircleOutlined style={{ color: 'lightblue' }} />\n ) : (\n <MinusCircleOutlined style={{ color: 'lightblue' }} />\n )}\n {Icon}\n <Popover\n key={`${node.data.name}popover`}\n content={\n <>\n {node.data.__RESOURCEPATH__ ? (\n <Typography.Text\n key={`${node.data.name}-popover-path`}\n code\n >\n {node.data.__RESOURCEPATH__}\n </Typography.Text>\n ) : (\n <></>\n )}\n </>\n }\n title=\"INFO\"\n trigger=\"hover\"\n >\n <Typography.Text>{node.data.name}</Typography.Text>\n </Popover>\n </Space>\n </div>\n <Space>\n {needJumpto && (\n <ModuleGraphListContext.Consumer>\n {({ moduleJumpList, setModuleJumpList }) => {\n return (\n <RightSquareOutlined\n onClick={() => {\n const _list = [...moduleJumpList];\n _list.push(+node.id);\n setModuleJumpList(_list);\n }}\n />\n );\n }}\n </ModuleGraphListContext.Consumer>\n )}\n </Space>\n </Space>\n </div>\n </Space>\n </div>\n </div>\n );\n }, []);\n\n return (\n <>\n <Tree\n {...required}\n {...handlers}\n horizontalLineStyles={{\n stroke: '#c4c4c4',\n strokeWidth: 2,\n strokeDasharray: '1 1',\n }}\n verticalLineStyles={{\n stroke: '#c4c4c4',\n strokeWidth: 2,\n strokeDasharray: '1 1',\n }}\n draggable={false}\n depthGap={14}\n gapMode={'padding'}\n disableLines={false}\n disableTransitions={true}\n disableHorizontalLines={false}\n disableVerticalLines={false}\n verticalLineTopOffset={0}\n verticalLineOffset={5}\n renderNode={renderNode}\n />\n </>\n );\n};\n"],"names":["prefix","FileTree","props","treeData","needJumpto","defaultOpened","defaultOpenFather","required","handlers","useTreeState","renderNode","useCallback","node","onToggle","Icon","getFileCom","Space","PlusCircleOutlined","MinusCircleOutlined","Popover","Typography","ModuleGraphListContext","moduleJumpList","setModuleJumpList","RightSquareOutlined","_list","Tree"],"mappings":";;;;;;;;AAcA,MAAMA,SAAS;AAaR,MAAMC,WAAoC,CAACC;IAChD,MAAM,EACJC,QAAQ,EACRC,aAAa,KAAK,EAClBC,gBAAgB,KAAK,EACrBC,oBAAoB,CAAC,EACtB,GAAGJ;IAEJ,MAAM,EAAEK,QAAQ,EAAEC,QAAQ,EAAE,GAAGC,aAAa;QAC1C,IAAI,GAAGT,OAAO,KAAK,CAAC;QACpB,MAAMG,YAAY,EAAE;QACpBE;QACA,gBAAgB;QAChB,mBAAmB;IACrB;IAEA,MAAMK,aAAaC,YAAY,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAoB;QAClEP,qBACEM,KAAK,IAAI,CAAC,KAAK,GAAGN,qBAClBM,KAAK,SAAS,CAAC;QACjB,MAAME,OAAOC,WAAWH,KAAK,IAAI,CAAC,IAAI;QAEtC,OAAO,WAAP,GACE,IAAC;YAAI,WAAW,GAAGZ,OAAO,WAAW,CAAC;sBACpC,kBAAC;gBAAI,WAAW,GAAGA,OAAO,OAAO,CAAC;0BAChC,kBAACgB,OAAKA;oBAAC,WAAU;8BACf,kBAAC;wBAAI,WAAW,GAAGhB,OAAO,WAAW,CAAC;kCACpC,mBAACgB,OAAKA;;8CACJ,IAAC;oCAAI,SAASH;8CACZ,mBAACG,OAAKA;;4CACH,CAACJ,KAAK,OAAO,CAAC,MAAM,IAAIA,KAAK,IAAI,CAAC,QAAQ,EAAE,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9
9
  import { useCreateFileTreeData } from "./utils/hooks.mjs";
10
10
  import { TabList } from "./index.mjs";
11
11
  const ModuleFilesTree = (props)=>{
12
- var _curModule_bailoutReason;
13
12
  const { curModule, modules, dependencies, cwd, activeTabKey, selectedChunk = '' } = props;
14
13
  const [importedModules, setImportedModules] = useState([]);
15
14
  const { data: fileStructures } = useCreateFileTreeData(modules, importedModules, curModule);
@@ -51,7 +50,7 @@ const ModuleFilesTree = (props)=>{
51
50
  })
52
51
  })
53
52
  }) : /*#__PURE__*/ jsx("div", {
54
- children: null == (_curModule_bailoutReason = curModule.bailoutReason) ? void 0 : _curModule_bailoutReason.map((reason)=>/*#__PURE__*/ jsx("div", {
53
+ children: curModule.bailoutReason?.map((reason)=>/*#__PURE__*/ jsx("div", {
55
54
  style: {
56
55
  marginBottom: 10
57
56
  },
@@ -1 +1 @@
1
- {"version":3,"file":"pages/ModuleAnalyze/fileTree.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/fileTree.tsx"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport { Col, Empty, Tag, Popover } from 'antd';\nimport React, { useEffect, useState } from 'react';\nimport { Size } from 'src/constants';\nimport { FileTree } from './components/fileTreeCom';\nimport { clsNamePrefix } from './constants';\nimport DependencyTree from './dependency';\nimport { getImporteds } from './utils';\nimport { useCreateFileTreeData } from './utils/hooks';\nimport { TabList } from './index';\n\nexport const ModuleFilesTree: React.FC<{\n modules: SDK.ModuleData[];\n dependencies: SDK.DependencyData[];\n curModule: SDK.ModuleData;\n cwd: string;\n selectedChunk: string;\n activeTabKey: string;\n}> = (props) => {\n const {\n curModule,\n modules,\n dependencies,\n cwd,\n activeTabKey,\n selectedChunk = '',\n } = props;\n const [importedModules, setImportedModules] = useState(\n [] as SDK.ModuleData[],\n );\n\n const { data: fileStructures } = useCreateFileTreeData(\n modules,\n importedModules,\n curModule,\n );\n\n useEffect(() => {\n const importeds = getImporteds(curModule, modules);\n setImportedModules(importeds);\n }, [curModule, modules]);\n\n return (\n <>\n {activeTabKey === TabList[TabList.Reasons] ? (\n <>\n {importedModules ? (\n <FileTree\n cwd={cwd}\n treeData={fileStructures}\n needCode={true}\n needShowAllTree={true}\n needJumpto={true}\n selectedChunk={selectedChunk}\n />\n ) : (\n <Empty className={`${clsNamePrefix}-empty`} />\n )}\n </>\n ) : activeTabKey === TabList[TabList.Dependencies] ? (\n <div\n className={`${clsNamePrefix}-file-tree`}\n style={{ padding: Size.BasePadding / 2 }}\n >\n <Col span={24} style={{ marginTop: Size.BasePadding / 2 }}>\n {curModule ? (\n <DependencyTree\n module={curModule}\n dependencies={dependencies}\n cwd={cwd}\n />\n ) : (\n <Empty className={`${clsNamePrefix}-empty`} />\n )}\n </Col>\n </div>\n ) : (\n <div>\n {curModule.bailoutReason?.map((reason) => (\n <div style={{ marginBottom: 10 }}>\n <Tag key={reason}>\n <Popover content={reason}>\n <span style={{ display: 'inline-block' }}>\n {reason.length > 120\n ? `${reason.slice(0, 120)}...`\n : reason}\n </span>\n </Popover>\n </Tag>\n </div>\n ))}\n </div>\n )}\n </>\n );\n};\n"],"names":["ModuleFilesTree","props","_curModule_bailoutReason","curModule","modules","dependencies","cwd","activeTabKey","selectedChunk","importedModules","setImportedModules","useState","fileStructures","useCreateFileTreeData","useEffect","importeds","getImporteds","TabList","FileTree","Empty","clsNamePrefix","Size","Col","DependencyTree","reason","Tag","Popover"],"mappings":";;;;;;;;;;AAWO,MAAMA,kBAOR,CAACC;QA4DKC;IA3DT,MAAM,EACJC,SAAS,EACTC,OAAO,EACPC,YAAY,EACZC,GAAG,EACHC,YAAY,EACZC,gBAAgB,EAAE,EACnB,GAAGP;IACJ,MAAM,CAACQ,iBAAiBC,mBAAmB,GAAGC,SAC5C,EAAE;IAGJ,MAAM,EAAE,MAAMC,cAAc,EAAE,GAAGC,sBAC/BT,SACAK,iBACAN;IAGFW,UAAU;QACR,MAAMC,YAAYC,aAAab,WAAWC;QAC1CM,mBAAmBK;IACrB,GAAG;QAACZ;QAAWC;KAAQ;IAEvB,OAAO,WAAP,GACE;kBACGG,iBAAiBU,OAAO,CAACA,QAAQ,OAAO,CAAC,GAAG,WAAH,GACxC;sBACGR,kBAAkB,WAAlBA,GACC,IAACS,UAAQA;gBACP,KAAKZ;gBACL,UAAUM;gBACV,UAAU;gBACV,iBAAiB;gBACjB,YAAY;gBACZ,eAAeJ;+BAGjB,IAACW,OAAKA;gBAAC,WAAW,GAAGC,cAAc,MAAM,CAAC;;aAG5Cb,iBAAiBU,OAAO,CAACA,QAAQ,YAAY,CAAC,GAAG,WAAH,GAChD,IAAC;YACC,WAAW,GAAGG,cAAc,UAAU,CAAC;YACvC,OAAO;gBAAE,SAASC,KAAK,WAAW,GAAG;YAAE;sBAEvC,kBAACC,KAAGA;gBAAC,MAAM;gBAAI,OAAO;oBAAE,WAAWD,KAAK,WAAW,GAAG;gBAAE;0BACrDlB,YAAY,WAAZA,GACC,IAACoB,YAAcA;oBACb,QAAQpB;oBACR,cAAcE;oBACd,KAAKC;mCAGP,IAACa,OAAKA;oBAAC,WAAW,GAAGC,cAAc,MAAM,CAAC;;;2BAKhD,IAAC;8BACElB,CAAAA,2BAAAA,UAAU,aAAa,AAAD,IAAtBA,KAAAA,IAAAA,yBAAyB,GAAG,CAAC,CAACsB,SAAAA,WAAAA,GAC7B,IAAC;oBAAI,OAAO;wBAAE,cAAc;oBAAG;8BAC7B,kBAACC,KAAGA;kCACF,kBAACC,SAAOA;4BAAC,SAASF;sCAChB,kBAAC;gCAAK,OAAO;oCAAE,SAAS;gCAAe;0CACpCA,OAAO,MAAM,GAAG,MACb,GAAGA,OAAO,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,GAC5BA;;;uBALAA;;;;AAexB"}
1
+ {"version":3,"file":"pages/ModuleAnalyze/fileTree.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/fileTree.tsx"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport { Col, Empty, Tag, Popover } from 'antd';\nimport React, { useEffect, useState } from 'react';\nimport { Size } from 'src/constants';\nimport { FileTree } from './components/fileTreeCom';\nimport { clsNamePrefix } from './constants';\nimport DependencyTree from './dependency';\nimport { getImporteds } from './utils';\nimport { useCreateFileTreeData } from './utils/hooks';\nimport { TabList } from './index';\n\nexport const ModuleFilesTree: React.FC<{\n modules: SDK.ModuleData[];\n dependencies: SDK.DependencyData[];\n curModule: SDK.ModuleData;\n cwd: string;\n selectedChunk: string;\n activeTabKey: string;\n}> = (props) => {\n const {\n curModule,\n modules,\n dependencies,\n cwd,\n activeTabKey,\n selectedChunk = '',\n } = props;\n const [importedModules, setImportedModules] = useState(\n [] as SDK.ModuleData[],\n );\n\n const { data: fileStructures } = useCreateFileTreeData(\n modules,\n importedModules,\n curModule,\n );\n\n useEffect(() => {\n const importeds = getImporteds(curModule, modules);\n setImportedModules(importeds);\n }, [curModule, modules]);\n\n return (\n <>\n {activeTabKey === TabList[TabList.Reasons] ? (\n <>\n {importedModules ? (\n <FileTree\n cwd={cwd}\n treeData={fileStructures}\n needCode={true}\n needShowAllTree={true}\n needJumpto={true}\n selectedChunk={selectedChunk}\n />\n ) : (\n <Empty className={`${clsNamePrefix}-empty`} />\n )}\n </>\n ) : activeTabKey === TabList[TabList.Dependencies] ? (\n <div\n className={`${clsNamePrefix}-file-tree`}\n style={{ padding: Size.BasePadding / 2 }}\n >\n <Col span={24} style={{ marginTop: Size.BasePadding / 2 }}>\n {curModule ? (\n <DependencyTree\n module={curModule}\n dependencies={dependencies}\n cwd={cwd}\n />\n ) : (\n <Empty className={`${clsNamePrefix}-empty`} />\n )}\n </Col>\n </div>\n ) : (\n <div>\n {curModule.bailoutReason?.map((reason) => (\n <div style={{ marginBottom: 10 }}>\n <Tag key={reason}>\n <Popover content={reason}>\n <span style={{ display: 'inline-block' }}>\n {reason.length > 120\n ? `${reason.slice(0, 120)}...`\n : reason}\n </span>\n </Popover>\n </Tag>\n </div>\n ))}\n </div>\n )}\n </>\n );\n};\n"],"names":["ModuleFilesTree","props","curModule","modules","dependencies","cwd","activeTabKey","selectedChunk","importedModules","setImportedModules","useState","fileStructures","useCreateFileTreeData","useEffect","importeds","getImporteds","TabList","FileTree","Empty","clsNamePrefix","Size","Col","DependencyTree","reason","Tag","Popover"],"mappings":";;;;;;;;;;AAWO,MAAMA,kBAOR,CAACC;IACJ,MAAM,EACJC,SAAS,EACTC,OAAO,EACPC,YAAY,EACZC,GAAG,EACHC,YAAY,EACZC,gBAAgB,EAAE,EACnB,GAAGN;IACJ,MAAM,CAACO,iBAAiBC,mBAAmB,GAAGC,SAC5C,EAAE;IAGJ,MAAM,EAAE,MAAMC,cAAc,EAAE,GAAGC,sBAC/BT,SACAK,iBACAN;IAGFW,UAAU;QACR,MAAMC,YAAYC,aAAab,WAAWC;QAC1CM,mBAAmBK;IACrB,GAAG;QAACZ;QAAWC;KAAQ;IAEvB,OAAO,WAAP,GACE;kBACGG,iBAAiBU,OAAO,CAACA,QAAQ,OAAO,CAAC,GAAG,WAAH,GACxC;sBACGR,kBAAkB,WAAlBA,GACC,IAACS,UAAQA;gBACP,KAAKZ;gBACL,UAAUM;gBACV,UAAU;gBACV,iBAAiB;gBACjB,YAAY;gBACZ,eAAeJ;+BAGjB,IAACW,OAAKA;gBAAC,WAAW,GAAGC,cAAc,MAAM,CAAC;;aAG5Cb,iBAAiBU,OAAO,CAACA,QAAQ,YAAY,CAAC,GAAG,WAAH,GAChD,IAAC;YACC,WAAW,GAAGG,cAAc,UAAU,CAAC;YACvC,OAAO;gBAAE,SAASC,KAAK,WAAW,GAAG;YAAE;sBAEvC,kBAACC,KAAGA;gBAAC,MAAM;gBAAI,OAAO;oBAAE,WAAWD,KAAK,WAAW,GAAG;gBAAE;0BACrDlB,YAAY,WAAZA,GACC,IAACoB,YAAcA;oBACb,QAAQpB;oBACR,cAAcE;oBACd,KAAKC;mCAGP,IAACa,OAAKA;oBAAC,WAAW,GAAGC,cAAc,MAAM,CAAC;;;2BAKhD,IAAC;sBACEjB,UAAU,aAAa,EAAE,IAAI,CAACqB,SAAAA,WAAAA,GAC7B,IAAC;oBAAI,OAAO;wBAAE,cAAc;oBAAG;8BAC7B,kBAACC,KAAGA;kCACF,kBAACC,SAAOA;4BAAC,SAASF;sCAChB,kBAAC;gCAAK,OAAO;oCAAE,SAAS;gCAAe;0CACpCA,OAAO,MAAM,GAAG,MACb,GAAGA,OAAO,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,GAC5BA;;;uBALAA;;;;AAexB"}
@@ -4,11 +4,11 @@ import { getImporteds } from "./index.mjs";
4
4
  import { Lodash } from "@rsdoctor/utils/common";
5
5
  function useCreateFileTreeData(modules, importedModules, curModule) {
6
6
  return useMemo(()=>{
7
- if (!importedModules || !(null == importedModules ? void 0 : importedModules.length)) return {
7
+ if (!importedModules || !importedModules?.length) return {
8
8
  filterData: [],
9
9
  data: []
10
10
  };
11
- const root = Lodash.compact(null == importedModules ? void 0 : importedModules.map((imported, index)=>({
11
+ const root = Lodash.compact(importedModules?.map((imported, index)=>({
12
12
  key: `0-${index}`,
13
13
  name: getShortPath(imported.path),
14
14
  __RESOURCEPATH__: imported.path,
@@ -33,7 +33,7 @@ function useCreateFileTreeData(modules, importedModules, curModule) {
33
33
  }
34
34
  function getLeafs(imported, modules, fatherModule) {
35
35
  const leafModules = getImporteds(imported, modules);
36
- const leafs = null == leafModules ? void 0 : leafModules.map((_imported, index)=>({
36
+ const leafs = leafModules?.map((_imported, index)=>({
37
37
  key: `0-${index}`,
38
38
  name: getShortPath(_imported.path),
39
39
  __RESOURCEPATH__: _imported.path,
@@ -51,11 +51,8 @@ function getLeafs(imported, modules, fatherModule) {
51
51
  return leafs;
52
52
  }
53
53
  function getContactMainModulePath(concatModules, modules) {
54
- const concatModulesPath = null == concatModules ? void 0 : concatModules.map((cm)=>{
55
- var _modules_filter;
56
- return null == (_modules_filter = modules.filter((m)=>m.id === cm)) ? void 0 : _modules_filter[0];
57
- });
58
- return null == concatModulesPath ? void 0 : concatModulesPath.map((m)=>m.path);
54
+ const concatModulesPath = concatModules?.map((cm)=>modules.filter((m)=>m.id === cm)?.[0]);
55
+ return concatModulesPath?.map((m)=>m.path);
59
56
  }
60
57
  export { getContactMainModulePath, useCreateFileTreeData };
61
58
 
@@ -1 +1 @@
1
- {"version":3,"file":"pages/ModuleAnalyze/utils/hooks.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/utils/hooks.tsx"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport { useMemo } from 'react';\nimport { formatSize, getShortPath } from 'src/utils';\nimport { getImporteds } from '.';\nimport { Lodash } from '@rsdoctor/utils/common';\n\nexport type NewTreeNodeType = {\n __RESOURCEPATH__: string;\n id: number;\n key: string;\n name: string;\n level: number;\n kind: number;\n size?: string;\n concatModules: number[] | undefined;\n chunks?: string[];\n getChildren?: () => NewTreeNodeType[];\n dependencies?: number[];\n fatherPath?: string;\n children?: number[];\n needExpand?: boolean | string;\n};\n\nexport function useCreateFileTreeData(\n modules: SDK.ModuleData[],\n importedModules: SDK.ModuleData[],\n curModule: SDK.ModuleData,\n): { data: NewTreeNodeType[] } {\n return useMemo(() => {\n if (!importedModules || !importedModules?.length) {\n return { filterData: [], data: [] };\n }\n const root = Lodash.compact(\n importedModules?.map((imported, index) => {\n return {\n key: `0-${index}`,\n name: getShortPath(imported.path),\n __RESOURCEPATH__: imported.path,\n id: imported.id,\n level: 1,\n chunks: imported.chunks,\n size: formatSize(imported.size.parsedSize),\n kind: imported.kind,\n concatModules: imported.concatenationModules,\n fatherPath: getShortPath(curModule.path),\n dependencies: imported.dependencies,\n getChildren: () => getLeafs(imported, modules, curModule),\n children: imported.imported,\n };\n }),\n );\n // getAllTreeData(root, modules, 2, importedModules);\n return {\n data: root,\n };\n }, [importedModules, curModule]);\n}\n\nfunction getLeafs(\n imported: SDK.ModuleData,\n modules: SDK.ModuleData[],\n fatherModule: SDK.ModuleData,\n) {\n const leafModules = getImporteds(imported, modules);\n\n const leafs = leafModules?.map((_imported, index) => {\n return {\n key: `0-${index}`,\n name: getShortPath(_imported.path),\n __RESOURCEPATH__: _imported.path,\n id: _imported.id,\n level: 1,\n size: formatSize(_imported.size.parsedSize),\n kind: _imported.kind,\n chunks: _imported.chunks,\n concatModules: _imported.concatenationModules,\n fatherPath: getShortPath(fatherModule.path),\n dependencies: _imported.dependencies,\n getChildren: () => getLeafs(_imported, modules, imported),\n children: _imported.imported,\n };\n });\n return leafs;\n}\n\nexport function getContactMainModulePath(\n concatModules: number[],\n modules: SDK.ModuleData[],\n): string[] {\n const concatModulesPath = concatModules?.map(\n (cm) => modules.filter((m) => m.id === cm)?.[0],\n );\n return concatModulesPath?.map((m) => m.path);\n}\n"],"names":["useCreateFileTreeData","modules","importedModules","curModule","useMemo","root","Lodash","imported","index","getShortPath","formatSize","getLeafs","fatherModule","leafModules","getImporteds","leafs","_imported","getContactMainModulePath","concatModules","concatModulesPath","cm","_modules_filter","m"],"mappings":";;;;AAuBO,SAASA,sBACdC,OAAyB,EACzBC,eAAiC,EACjCC,SAAyB;IAEzB,OAAOC,QAAQ;QACb,IAAI,CAACF,mBAAmB,CAACA,CAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,gBAAiB,MAAM,AAAD,GAC7C,OAAO;YAAE,YAAY,EAAE;YAAE,MAAM,EAAE;QAAC;QAEpC,MAAMG,OAAOC,OAAO,OAAO,CACzBJ,QAAAA,kBAAAA,KAAAA,IAAAA,gBAAiB,GAAG,CAAC,CAACK,UAAUC,QACvB;gBACL,KAAK,CAAC,EAAE,EAAEA,OAAO;gBACjB,MAAMC,aAAaF,SAAS,IAAI;gBAChC,kBAAkBA,SAAS,IAAI;gBAC/B,IAAIA,SAAS,EAAE;gBACf,OAAO;gBACP,QAAQA,SAAS,MAAM;gBACvB,MAAMG,WAAWH,SAAS,IAAI,CAAC,UAAU;gBACzC,MAAMA,SAAS,IAAI;gBACnB,eAAeA,SAAS,oBAAoB;gBAC5C,YAAYE,aAAaN,UAAU,IAAI;gBACvC,cAAcI,SAAS,YAAY;gBACnC,aAAa,IAAMI,SAASJ,UAAUN,SAASE;gBAC/C,UAAUI,SAAS,QAAQ;YAC7B;QAIJ,OAAO;YACL,MAAMF;QACR;IACF,GAAG;QAACH;QAAiBC;KAAU;AACjC;AAEA,SAASQ,SACPJ,QAAwB,EACxBN,OAAyB,EACzBW,YAA4B;IAE5B,MAAMC,cAAcC,aAAaP,UAAUN;IAE3C,MAAMc,QAAQF,QAAAA,cAAAA,KAAAA,IAAAA,YAAa,GAAG,CAAC,CAACG,WAAWR,QAClC;YACL,KAAK,CAAC,EAAE,EAAEA,OAAO;YACjB,MAAMC,aAAaO,UAAU,IAAI;YACjC,kBAAkBA,UAAU,IAAI;YAChC,IAAIA,UAAU,EAAE;YAChB,OAAO;YACP,MAAMN,WAAWM,UAAU,IAAI,CAAC,UAAU;YAC1C,MAAMA,UAAU,IAAI;YACpB,QAAQA,UAAU,MAAM;YACxB,eAAeA,UAAU,oBAAoB;YAC7C,YAAYP,aAAaG,aAAa,IAAI;YAC1C,cAAcI,UAAU,YAAY;YACpC,aAAa,IAAML,SAASK,WAAWf,SAASM;YAChD,UAAUS,UAAU,QAAQ;QAC9B;IAEF,OAAOD;AACT;AAEO,SAASE,yBACdC,aAAuB,EACvBjB,OAAyB;IAEzB,MAAMkB,oBAAoBD,QAAAA,gBAAAA,KAAAA,IAAAA,cAAe,GAAG,CAC1C,CAACE;YAAOC;uBAAAA,CAAAA,kBAAAA,QAAQ,MAAM,CAAC,CAACC,IAAMA,EAAE,EAAE,KAAKF,GAAE,IAAjCC,KAAAA,IAAAA,eAAoC,CAAC,EAAE;;IAEjD,OAAOF,QAAAA,oBAAAA,KAAAA,IAAAA,kBAAmB,GAAG,CAAC,CAACG,IAAMA,EAAE,IAAI;AAC7C"}
1
+ {"version":3,"file":"pages/ModuleAnalyze/utils/hooks.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/utils/hooks.tsx"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport { useMemo } from 'react';\nimport { formatSize, getShortPath } from 'src/utils';\nimport { getImporteds } from '.';\nimport { Lodash } from '@rsdoctor/utils/common';\n\nexport type NewTreeNodeType = {\n __RESOURCEPATH__: string;\n id: number;\n key: string;\n name: string;\n level: number;\n kind: number;\n size?: string;\n concatModules: number[] | undefined;\n chunks?: string[];\n getChildren?: () => NewTreeNodeType[];\n dependencies?: number[];\n fatherPath?: string;\n children?: number[];\n needExpand?: boolean | string;\n};\n\nexport function useCreateFileTreeData(\n modules: SDK.ModuleData[],\n importedModules: SDK.ModuleData[],\n curModule: SDK.ModuleData,\n): { data: NewTreeNodeType[] } {\n return useMemo(() => {\n if (!importedModules || !importedModules?.length) {\n return { filterData: [], data: [] };\n }\n const root = Lodash.compact(\n importedModules?.map((imported, index) => {\n return {\n key: `0-${index}`,\n name: getShortPath(imported.path),\n __RESOURCEPATH__: imported.path,\n id: imported.id,\n level: 1,\n chunks: imported.chunks,\n size: formatSize(imported.size.parsedSize),\n kind: imported.kind,\n concatModules: imported.concatenationModules,\n fatherPath: getShortPath(curModule.path),\n dependencies: imported.dependencies,\n getChildren: () => getLeafs(imported, modules, curModule),\n children: imported.imported,\n };\n }),\n );\n // getAllTreeData(root, modules, 2, importedModules);\n return {\n data: root,\n };\n }, [importedModules, curModule]);\n}\n\nfunction getLeafs(\n imported: SDK.ModuleData,\n modules: SDK.ModuleData[],\n fatherModule: SDK.ModuleData,\n) {\n const leafModules = getImporteds(imported, modules);\n\n const leafs = leafModules?.map((_imported, index) => {\n return {\n key: `0-${index}`,\n name: getShortPath(_imported.path),\n __RESOURCEPATH__: _imported.path,\n id: _imported.id,\n level: 1,\n size: formatSize(_imported.size.parsedSize),\n kind: _imported.kind,\n chunks: _imported.chunks,\n concatModules: _imported.concatenationModules,\n fatherPath: getShortPath(fatherModule.path),\n dependencies: _imported.dependencies,\n getChildren: () => getLeafs(_imported, modules, imported),\n children: _imported.imported,\n };\n });\n return leafs;\n}\n\nexport function getContactMainModulePath(\n concatModules: number[],\n modules: SDK.ModuleData[],\n): string[] {\n const concatModulesPath = concatModules?.map(\n (cm) => modules.filter((m) => m.id === cm)?.[0],\n );\n return concatModulesPath?.map((m) => m.path);\n}\n"],"names":["useCreateFileTreeData","modules","importedModules","curModule","useMemo","root","Lodash","imported","index","getShortPath","formatSize","getLeafs","fatherModule","leafModules","getImporteds","leafs","_imported","getContactMainModulePath","concatModules","concatModulesPath","cm","m"],"mappings":";;;;AAuBO,SAASA,sBACdC,OAAyB,EACzBC,eAAiC,EACjCC,SAAyB;IAEzB,OAAOC,QAAQ;QACb,IAAI,CAACF,mBAAmB,CAACA,iBAAiB,QACxC,OAAO;YAAE,YAAY,EAAE;YAAE,MAAM,EAAE;QAAC;QAEpC,MAAMG,OAAOC,OAAO,OAAO,CACzBJ,iBAAiB,IAAI,CAACK,UAAUC,QACvB;gBACL,KAAK,CAAC,EAAE,EAAEA,OAAO;gBACjB,MAAMC,aAAaF,SAAS,IAAI;gBAChC,kBAAkBA,SAAS,IAAI;gBAC/B,IAAIA,SAAS,EAAE;gBACf,OAAO;gBACP,QAAQA,SAAS,MAAM;gBACvB,MAAMG,WAAWH,SAAS,IAAI,CAAC,UAAU;gBACzC,MAAMA,SAAS,IAAI;gBACnB,eAAeA,SAAS,oBAAoB;gBAC5C,YAAYE,aAAaN,UAAU,IAAI;gBACvC,cAAcI,SAAS,YAAY;gBACnC,aAAa,IAAMI,SAASJ,UAAUN,SAASE;gBAC/C,UAAUI,SAAS,QAAQ;YAC7B;QAIJ,OAAO;YACL,MAAMF;QACR;IACF,GAAG;QAACH;QAAiBC;KAAU;AACjC;AAEA,SAASQ,SACPJ,QAAwB,EACxBN,OAAyB,EACzBW,YAA4B;IAE5B,MAAMC,cAAcC,aAAaP,UAAUN;IAE3C,MAAMc,QAAQF,aAAa,IAAI,CAACG,WAAWR,QAClC;YACL,KAAK,CAAC,EAAE,EAAEA,OAAO;YACjB,MAAMC,aAAaO,UAAU,IAAI;YACjC,kBAAkBA,UAAU,IAAI;YAChC,IAAIA,UAAU,EAAE;YAChB,OAAO;YACP,MAAMN,WAAWM,UAAU,IAAI,CAAC,UAAU;YAC1C,MAAMA,UAAU,IAAI;YACpB,QAAQA,UAAU,MAAM;YACxB,eAAeA,UAAU,oBAAoB;YAC7C,YAAYP,aAAaG,aAAa,IAAI;YAC1C,cAAcI,UAAU,YAAY;YACpC,aAAa,IAAML,SAASK,WAAWf,SAASM;YAChD,UAAUS,UAAU,QAAQ;QAC9B;IAEF,OAAOD;AACT;AAEO,SAASE,yBACdC,aAAuB,EACvBjB,OAAyB;IAEzB,MAAMkB,oBAAoBD,eAAe,IACvC,CAACE,KAAOnB,QAAQ,MAAM,CAAC,CAACoB,IAAMA,EAAE,EAAE,KAAKD,KAAK,CAAC,EAAE;IAEjD,OAAOD,mBAAmB,IAAI,CAACE,IAAMA,EAAE,IAAI;AAC7C"}
@@ -1,7 +1,6 @@
1
1
  import { Lodash } from "@rsdoctor/utils/common";
2
2
  const getImporteds = (curModule, modules)=>{
3
- var _curModule_imported;
4
- if (null == curModule ? void 0 : null == (_curModule_imported = curModule.imported) ? void 0 : _curModule_imported.length) {
3
+ if (curModule?.imported?.length) {
5
4
  const _importeds = curModule.imported.map((_importedModule)=>modules.find((m)=>m.id === Number(_importedModule)));
6
5
  const importeds = Lodash.compact(_importeds);
7
6
  return importeds;
@@ -15,8 +14,7 @@ const getModuleReasonsTree = (curModule, modules, reasonsTree, visited)=>{
15
14
  const importeds = getImporteds(curModule, modules);
16
15
  if (!importeds.length) return;
17
16
  importeds.forEach((_curModule)=>{
18
- var _curModule_chunks;
19
- null == _curModule || null == (_curModule_chunks = _curModule.chunks) || _curModule_chunks.forEach((_chunk)=>{
17
+ _curModule?.chunks?.forEach((_chunk)=>{
20
18
  if (reasonsTree.indexOf(_chunk) < 0) reasonsTree.push(_chunk);
21
19
  });
22
20
  getModuleReasonsTree(_curModule, modules, reasonsTree, visited);
@@ -1 +1 @@
1
- {"version":3,"file":"pages/ModuleAnalyze/utils/index.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/utils/index.ts"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport { Lodash } from '@rsdoctor/utils/common';\n\nexport const getImporteds = (\n curModule: SDK.ModuleData,\n modules: SDK.ModuleData[],\n) => {\n if (curModule?.imported?.length) {\n const _importeds = curModule.imported.map((_importedModule) =>\n modules.find((m) => m.id === Number(_importedModule)),\n );\n const importeds: SDK.ModuleData[] = Lodash.compact(_importeds);\n return importeds;\n }\n return [];\n};\n\nexport const getModuleReasonsTree = (\n curModule: SDK.ModuleData,\n modules: SDK.ModuleData[],\n reasonsTree: string[],\n visited: Map<number, boolean>,\n) => {\n if (!visited.has(curModule.id)) {\n visited.set(curModule.id, true);\n } else if (visited.get(curModule.id)) {\n return;\n }\n\n const importeds = getImporteds(curModule, modules);\n\n if (!importeds.length) {\n return;\n }\n\n importeds.forEach((_curModule) => {\n _curModule?.chunks?.forEach((_chunk) => {\n if (reasonsTree.indexOf(_chunk) < 0) {\n reasonsTree.push(_chunk);\n }\n });\n\n getModuleReasonsTree(_curModule, modules, reasonsTree, visited);\n });\n};\n"],"names":["getImporteds","curModule","modules","_curModule_imported","_importeds","_importedModule","m","Number","importeds","Lodash","getModuleReasonsTree","reasonsTree","visited","_curModule","_curModule_chunks","_chunk"],"mappings":";AAGO,MAAMA,eAAe,CAC1BC,WACAC;QAEIC;IAAJ,IAAIA,QAAAA,YAAAA,KAAAA,IAAAA,QAAAA,CAAAA,sBAAAA,UAAW,QAAQ,AAAD,IAAlBA,KAAAA,IAAAA,oBAAqB,MAAM,EAAE;QAC/B,MAAMC,aAAaH,UAAU,QAAQ,CAAC,GAAG,CAAC,CAACI,kBACzCH,QAAQ,IAAI,CAAC,CAACI,IAAMA,EAAE,EAAE,KAAKC,OAAOF;QAEtC,MAAMG,YAA8BC,OAAO,OAAO,CAACL;QACnD,OAAOI;IACT;IACA,OAAO,EAAE;AACX;AAEO,MAAME,uBAAuB,CAClCT,WACAC,SACAS,aACAC;IAEA,IAAKA,QAAQ,GAAG,CAACX,UAAU,EAAE,GAEtB;QAAA,IAAIW,QAAQ,GAAG,CAACX,UAAU,EAAE,GACjC;IACF,OAHEW,QAAQ,GAAG,CAACX,UAAU,EAAE,EAAE;IAK5B,MAAMO,YAAYR,aAAaC,WAAWC;IAE1C,IAAI,CAACM,UAAU,MAAM,EACnB;IAGFA,UAAU,OAAO,CAAC,CAACK;YACjBC;QAAAA,QAAAA,cAAAA,QAAAA,CAAAA,oBAAAA,WAAY,MAAM,AAAD,KAAjBA,kBAAoB,OAAO,CAAC,CAACC;YAC3B,IAAIJ,YAAY,OAAO,CAACI,UAAU,GAChCJ,YAAY,IAAI,CAACI;QAErB;QAEAL,qBAAqBG,YAAYX,SAASS,aAAaC;IACzD;AACF"}
1
+ {"version":3,"file":"pages/ModuleAnalyze/utils/index.mjs","sources":["webpack://@rsdoctor/components/./src/pages/ModuleAnalyze/utils/index.ts"],"sourcesContent":["import { SDK } from '@rsdoctor/types';\nimport { Lodash } from '@rsdoctor/utils/common';\n\nexport const getImporteds = (\n curModule: SDK.ModuleData,\n modules: SDK.ModuleData[],\n) => {\n if (curModule?.imported?.length) {\n const _importeds = curModule.imported.map((_importedModule) =>\n modules.find((m) => m.id === Number(_importedModule)),\n );\n const importeds: SDK.ModuleData[] = Lodash.compact(_importeds);\n return importeds;\n }\n return [];\n};\n\nexport const getModuleReasonsTree = (\n curModule: SDK.ModuleData,\n modules: SDK.ModuleData[],\n reasonsTree: string[],\n visited: Map<number, boolean>,\n) => {\n if (!visited.has(curModule.id)) {\n visited.set(curModule.id, true);\n } else if (visited.get(curModule.id)) {\n return;\n }\n\n const importeds = getImporteds(curModule, modules);\n\n if (!importeds.length) {\n return;\n }\n\n importeds.forEach((_curModule) => {\n _curModule?.chunks?.forEach((_chunk) => {\n if (reasonsTree.indexOf(_chunk) < 0) {\n reasonsTree.push(_chunk);\n }\n });\n\n getModuleReasonsTree(_curModule, modules, reasonsTree, visited);\n });\n};\n"],"names":["getImporteds","curModule","modules","_importeds","_importedModule","m","Number","importeds","Lodash","getModuleReasonsTree","reasonsTree","visited","_curModule","_chunk"],"mappings":";AAGO,MAAMA,eAAe,CAC1BC,WACAC;IAEA,IAAID,WAAW,UAAU,QAAQ;QAC/B,MAAME,aAAaF,UAAU,QAAQ,CAAC,GAAG,CAAC,CAACG,kBACzCF,QAAQ,IAAI,CAAC,CAACG,IAAMA,EAAE,EAAE,KAAKC,OAAOF;QAEtC,MAAMG,YAA8BC,OAAO,OAAO,CAACL;QACnD,OAAOI;IACT;IACA,OAAO,EAAE;AACX;AAEO,MAAME,uBAAuB,CAClCR,WACAC,SACAQ,aACAC;IAEA,IAAKA,QAAQ,GAAG,CAACV,UAAU,EAAE,GAEtB;QAAA,IAAIU,QAAQ,GAAG,CAACV,UAAU,EAAE,GACjC;IACF,OAHEU,QAAQ,GAAG,CAACV,UAAU,EAAE,EAAE;IAK5B,MAAMM,YAAYP,aAAaC,WAAWC;IAE1C,IAAI,CAACK,UAAU,MAAM,EACnB;IAGFA,UAAU,OAAO,CAAC,CAACK;QACjBA,YAAY,QAAQ,QAAQ,CAACC;YAC3B,IAAIH,YAAY,OAAO,CAACG,UAAU,GAChCH,YAAY,IAAI,CAACG;QAErB;QAEAJ,qBAAqBG,YAAYV,SAASQ,aAAaC;IACzD;AACF"}
@@ -518,19 +518,16 @@ const Assets = ({ baseline, current, outputFilename })=>{
518
518
  {
519
519
  title: 'Actions',
520
520
  key: 'actions',
521
- render: (_v, r)=>{
522
- var _r_baseline, _r_current;
523
- return /*#__PURE__*/ jsx(ViewChanges, {
521
+ render: (_v, r)=>/*#__PURE__*/ jsx(ViewChanges, {
524
522
  file: r.alias,
525
523
  data: [
526
524
  {
527
- baseline: null == (_r_baseline = r.baseline) ? void 0 : _r_baseline.content,
528
- current: null == (_r_current = r.current) ? void 0 : _r_current.content,
525
+ baseline: r.baseline?.content,
526
+ current: r.current?.content,
529
527
  group: 'assets'
530
528
  }
531
529
  ]
532
- });
533
- }
530
+ })
534
531
  }
535
532
  ]
536
533
  })
@@ -1 +1 @@
1
- {"version":3,"file":"pages/Resources/BundleDiff/DiffContainer/assets.mjs","sources":["webpack://@rsdoctor/components/./src/pages/Resources/BundleDiff/DiffContainer/assets.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Button,\n Col,\n Divider,\n Row,\n Select,\n Space,\n Table,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { sumBy } from 'es-toolkit/compat';\nimport {\n CheckSquareOutlined,\n InfoCircleOutlined,\n MinusSquareOutlined,\n PlusSquareOutlined,\n SortAscendingOutlined,\n FileSearchOutlined,\n AppstoreAddOutlined,\n} from '@ant-design/icons';\nimport { Constants, SDK, Client } from '@rsdoctor/types';\nimport { BundleDiffTableAssetsData } from './types';\nimport { formatPercent, formatSize } from '../../../../utils';\nimport { Color, Size } from '../../../../constants';\nimport { Percent, SizePercent } from '../../../../components/Card/diff';\nimport { KeywordInput } from '../../../../components/Form/keyword';\nimport { ModuleRowForAsset } from './row';\nimport { ViewChanges } from './changes';\nimport { UpdateType, SortType } from './constants';\nimport { formatDiffSize } from './utils';\nimport { Graph } from '@rsdoctor/utils/common';\n\nconst fileTypes = {\n JS: [Constants.JSExtension],\n CSS: [Constants.CSSExtension],\n HTML: [Constants.HtmlExtension],\n Imgs: Constants.ImgExtensions,\n Fonts: Constants.FontExtensions,\n Media: Constants.MediaExtensions,\n Others: [],\n};\n\nconst definedExtensions = Object.values(fileTypes).flat();\n\nconst Name: React.FC<{ data: BundleDiffTableAssetsData }> = ({ data: r }) => {\n const name = (\n <Space>\n <Typography.Text strong>{r.alias}</Typography.Text>\n <Tooltip\n title={\n <Space style={{ color: 'inherit' }} direction=\"vertical\">\n {r.current ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Current realpath: {r.current.path}\n </Typography.Text>\n ) : null}\n {r.baseline ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Baseline realpath: {r.baseline.path}\n </Typography.Text>\n ) : null}\n </Space>\n }\n >\n <InfoCircleOutlined />\n </Tooltip>\n </Space>\n );\n\n if (r.baseline && !r.current) {\n // deleted\n return (\n <Space>\n <MinusSquareOutlined style={{ color: Color.Red }} />\n {name}\n </Space>\n );\n }\n\n if (!r.baseline && r.current) {\n // new\n return (\n <Space>\n <PlusSquareOutlined style={{ color: Color.Green }} />\n {name}\n </Space>\n );\n }\n\n if (r.baseline && r.current) {\n // update\n return (\n <Space>\n <CheckSquareOutlined style={{ color: Color.Yellow }} />\n {name}\n </Space>\n );\n }\n\n return name;\n};\n\nexport const Assets: React.FC<{\n outputFilename: string;\n baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n}> = ({ baseline, current, outputFilename }) => {\n const bOutPutFileName = outputFilename;\n\n const [keyword, setKeyword] = useState<string>();\n const [selectedFileTypes, setSelectedFileTypes] = useState<string[]>([]);\n const [selectedUpdateTypes, setSelectedUpdateTypes] = useState<UpdateType[]>(\n [],\n );\n const [selectedSortType, setSelectedSortType] = useState<SortType>(\n SortType.Size,\n );\n const [selectedBAsset, setSelectedBAsset] = useState(null);\n const [selectedCAsset, setSelectedCAsset] = useState(null);\n\n const { assets: bAssets } = baseline.chunkGraph;\n const { assets: cAssets } = current.chunkGraph;\n\n const dataSource = useMemo(() => {\n const res: Record<string, BundleDiffTableAssetsData> = {};\n if (selectedBAsset && selectedCAsset) {\n res.choose = {\n alias: `${selectedBAsset} \\n ${selectedCAsset}`,\n current: cAssets.find((c: SDK.AssetData) => c.path === selectedCAsset),\n baseline: bAssets.find((b: SDK.AssetData) => b.path === selectedBAsset),\n };\n return Object.values(res);\n }\n\n bAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = {\n alias,\n baseline: asset,\n };\n } else {\n console.warn('[Baseline Asset Exists]: ', asset, res);\n }\n });\n\n cAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = { alias };\n }\n res[alias].current = asset;\n });\n\n return Object.values(res);\n }, [bAssets, cAssets, selectedBAsset, selectedCAsset]);\n\n const filteredDataSource = useMemo(() => {\n let list = dataSource.slice();\n\n if (keyword) {\n list = list.filter((e) => e.alias.indexOf(keyword) > -1);\n }\n\n if (selectedFileTypes.length) {\n const exts = selectedFileTypes\n .map((e) => fileTypes[e as keyof typeof fileTypes])\n .flat();\n\n const hasOthers = selectedFileTypes.indexOf('Others') > -1;\n\n list = list.filter((e) => {\n const asset = e.baseline! || e.current!;\n if (Graph.isAssetMatchExtensions(asset, exts)) {\n return true;\n }\n\n if (hasOthers) {\n return !Graph.isAssetMatchExtensions(asset, definedExtensions);\n }\n\n return false;\n });\n }\n\n if (selectedUpdateTypes.length) {\n list = list.filter((e) => {\n if (e.baseline && !e.current) {\n // deleted\n return selectedUpdateTypes.includes(UpdateType.Deleted);\n }\n\n if (!e.baseline && e.current) {\n // new\n return selectedUpdateTypes.includes(UpdateType.New);\n }\n\n if (e.baseline && e.current) {\n if (e.baseline.size === e.current.size) {\n // not changed\n return selectedUpdateTypes.includes(UpdateType.NotChanged);\n }\n // changed\n return selectedUpdateTypes.includes(UpdateType.Changed);\n }\n\n return false;\n });\n }\n\n if (selectedSortType) {\n if (selectedSortType === SortType.Name) {\n list.sort((a, b) => {\n return a.alias.localeCompare(b.alias);\n });\n } else {\n const { prev, others } = list.reduce(\n (t, c) => {\n if (c.current) {\n if (c.baseline) {\n t.prev.unshift(c);\n } else {\n t.prev.push(c);\n }\n } else {\n t.others.push(c);\n }\n return t;\n },\n {\n prev: [] as BundleDiffTableAssetsData[],\n others: [] as BundleDiffTableAssetsData[],\n },\n );\n\n list = [\n ...prev.sort((a, b) => {\n if (b.current && a.current) {\n if (selectedSortType === SortType.Delta) {\n const { percent: percentA } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n a.alias,\n );\n const { percent: percentB } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n b.alias,\n );\n return percentB - percentA;\n }\n return b.current!.size - a.current!.size;\n }\n return -1;\n }),\n ...others,\n ];\n }\n }\n\n return list;\n }, [\n dataSource,\n keyword,\n selectedFileTypes,\n selectedUpdateTypes,\n selectedSortType,\n ]);\n\n const cSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.current ? e.current.size : 0)) || 0,\n [filteredDataSource],\n );\n const bSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.baseline ? e.baseline.size : 0)) || 0,\n [filteredDataSource],\n );\n\n return (\n <Row gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n <Space wrap>\n <KeywordInput\n icon={<FileSearchOutlined />}\n label=\"\"\n labelStyle={{ width: 45 }}\n placeholder=\"Search by file name\"\n onChange={(e) => {\n setKeyword(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file type\"\n style={{ width: 250 }}\n options={Object.keys(fileTypes).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedFileTypes(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file changed type\"\n style={{ width: 200 }}\n options={Object.values(UpdateType).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedUpdateTypes(e);\n }}\n />\n <Select\n suffixIcon={<SortAscendingOutlined />}\n // style={{ width: 150 }}\n options={Object.values(SortType).map((e) => ({\n label: e,\n value: e,\n }))}\n value={selectedSortType}\n onChange={(e) => {\n setSelectedSortType(e);\n }}\n />\n </Space>\n <Row style={{ marginTop: 10 }} gutter={[6, 6]}>\n <Col>\n <Button>Select Baseline Asset and Current Asset to Diff </Button>\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select baseline assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(baseline.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedBAsset(e)}\n />\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select current assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(current.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedCAsset(e)}\n />\n </Col>\n </Row>\n </Col>\n <Col span={24}>\n <Table\n bordered\n sticky={{ offsetHeader: 54 }}\n pagination={{\n pageSize: 20,\n size: 'small',\n }}\n dataSource={filteredDataSource}\n rowKey={(e) => e.alias}\n expandable={{\n expandedRowRender: (r) => {\n return (\n <div style={{ margin: Size.BasePadding / 3 }}>\n <ModuleRowForAsset\n data={r}\n baseline={baseline}\n current={current}\n />\n </div>\n );\n },\n columnTitle: (\n <Tooltip\n title=\"Click to expand row to see the modules which the chunk contains\"\n placement=\"left\"\n >\n <AppstoreAddOutlined style={{ cursor: 'pointer' }} />\n </Tooltip>\n ),\n }}\n columns={[\n {\n title: (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n filtered assets is {filteredDataSource.length}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n total assets is {dataSource.length}\n </Typography.Text>\n </Space>\n }\n >\n <Typography.Text strong>Assets</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {filteredDataSource.length}/{dataSource.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n ),\n render: (_v, r) => <Name data={r} />,\n },\n {\n title: () => {\n const cs = formatSize(cSize);\n const diff = Graph.diffSize(bSize, cSize);\n return (\n <Tooltip\n title={`Current size is ${cs}, Delta is ${formatPercent(diff.percent)}`}\n >\n <Typography.Text strong>Current</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n <Typography.Text\n style={{ fontSize: 'inherit', marginRight: 8 }}\n >\n {cs}\n </Typography.Text>\n <SizePercent\n fontSize={'inherit'}\n baseline={bSize}\n current={cSize}\n />\n {formatDiffSize(\n bSize,\n cSize,\n bSize > cSize\n ? Client.RsdoctorClientDiffState.Down\n : Client.RsdoctorClientDiffState.Up,\n { fontSize: 10, fontWeight: 400, marginLeft: 4 },\n )}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.current) {\n const { percent, state } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n r.alias,\n );\n const isInitial = Graph.isInitialAsset(\n r.current,\n current.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.current.size)}\n </Typography.Text>\n <Percent percent={percent} state={state} />\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: () => {\n const bs = formatSize(bSize);\n return (\n <Tooltip title={`Baseline size is ${bs}`}>\n <Typography.Text strong>Baseline</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {bs}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.baseline) {\n const isInitial = Graph.isInitialAsset(\n r.baseline,\n baseline.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.baseline.size)}\n </Typography.Text>\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: 'Actions',\n key: 'actions',\n render: (_v, r) => {\n return (\n <ViewChanges\n file={r.alias}\n data={[\n {\n baseline: r.baseline?.content,\n current: r.current?.content,\n group: 'assets',\n },\n ]}\n />\n );\n },\n },\n ]}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["fileTypes","Constants","definedExtensions","Object","Name","r","name","Space","Typography","Tooltip","InfoCircleOutlined","MinusSquareOutlined","Color","PlusSquareOutlined","CheckSquareOutlined","Assets","baseline","current","outputFilename","bOutPutFileName","keyword","setKeyword","useState","selectedFileTypes","setSelectedFileTypes","selectedUpdateTypes","setSelectedUpdateTypes","selectedSortType","setSelectedSortType","SortType","selectedBAsset","setSelectedBAsset","selectedCAsset","setSelectedCAsset","bAssets","cAssets","dataSource","useMemo","res","c","b","asset","alias","Graph","console","filteredDataSource","list","e","exts","hasOthers","UpdateType","a","prev","others","t","percentA","percentB","cSize","sumBy","bSize","Row","Size","Col","KeywordInput","FileSearchOutlined","Select","SortAscendingOutlined","Button","Table","ModuleRowForAsset","AppstoreAddOutlined","Divider","_v","cs","formatSize","diff","formatPercent","SizePercent","formatDiffSize","Client","percent","state","isInitial","Percent","Tag","bs","_r_baseline","_r_current","ViewChanges"],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAMA,YAAY;IAChB,IAAI;QAACC,UAAU,WAAW;KAAC;IAC3B,KAAK;QAACA,UAAU,YAAY;KAAC;IAC7B,MAAM;QAACA,UAAU,aAAa;KAAC;IAC/B,MAAMA,UAAU,aAAa;IAC7B,OAAOA,UAAU,cAAc;IAC/B,OAAOA,UAAU,eAAe;IAChC,QAAQ,EAAE;AACZ;AAEA,MAAMC,oBAAoBC,OAAO,MAAM,CAACH,WAAW,IAAI;AAEvD,MAAMI,OAAsD,CAAC,EAAE,MAAMC,CAAC,EAAE;IACtE,MAAMC,OAAO,WAAPA,GACJ,KAACC,OAAKA;;0BACJ,IAACC,WAAW,IAAI;gBAAC,QAAM;0BAAEH,EAAE,KAAK;;0BAChC,IAACI,SAAOA;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AAE;iDAAgB;;;gCAG3D;gCACA,OAAO;4BACT;wBACF;wBACA;4BACE,OAAO;4BACP,KAAK;4BACL,QAAQ,CAAC4D,IAAInE;oCAMOiF,aACDC;gCANjB,OAAO,WAAP,GACE,IAACC,aAAWA;oCACV,MAAMnF,EAAE,KAAK;oCACb,MAAM;wCACJ;4CACE,UAAU,QAAAiF,CAAAA,cAAAA,EAAE,QAAQ,AAAD,IAATA,KAAAA,IAAAA,YAAY,OAAO;4CAC7B,SAAS,QAAAC,CAAAA,aAAAA,EAAE,OAAO,AAAD,IAARA,KAAAA,IAAAA,WAAW,OAAO;4CAC3B,OAAO;wCACT;qCACD;;4BAGP;wBACF;qBACD;;;;;AAKX"}
1
+ {"version":3,"file":"pages/Resources/BundleDiff/DiffContainer/assets.mjs","sources":["webpack://@rsdoctor/components/./src/pages/Resources/BundleDiff/DiffContainer/assets.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Button,\n Col,\n Divider,\n Row,\n Select,\n Space,\n Table,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { sumBy } from 'es-toolkit/compat';\nimport {\n CheckSquareOutlined,\n InfoCircleOutlined,\n MinusSquareOutlined,\n PlusSquareOutlined,\n SortAscendingOutlined,\n FileSearchOutlined,\n AppstoreAddOutlined,\n} from '@ant-design/icons';\nimport { Constants, SDK, Client } from '@rsdoctor/types';\nimport { BundleDiffTableAssetsData } from './types';\nimport { formatPercent, formatSize } from '../../../../utils';\nimport { Color, Size } from '../../../../constants';\nimport { Percent, SizePercent } from '../../../../components/Card/diff';\nimport { KeywordInput } from '../../../../components/Form/keyword';\nimport { ModuleRowForAsset } from './row';\nimport { ViewChanges } from './changes';\nimport { UpdateType, SortType } from './constants';\nimport { formatDiffSize } from './utils';\nimport { Graph } from '@rsdoctor/utils/common';\n\nconst fileTypes = {\n JS: [Constants.JSExtension],\n CSS: [Constants.CSSExtension],\n HTML: [Constants.HtmlExtension],\n Imgs: Constants.ImgExtensions,\n Fonts: Constants.FontExtensions,\n Media: Constants.MediaExtensions,\n Others: [],\n};\n\nconst definedExtensions = Object.values(fileTypes).flat();\n\nconst Name: React.FC<{ data: BundleDiffTableAssetsData }> = ({ data: r }) => {\n const name = (\n <Space>\n <Typography.Text strong>{r.alias}</Typography.Text>\n <Tooltip\n title={\n <Space style={{ color: 'inherit' }} direction=\"vertical\">\n {r.current ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Current realpath: {r.current.path}\n </Typography.Text>\n ) : null}\n {r.baseline ? (\n <Typography.Text style={{ color: 'inherit' }}>\n Baseline realpath: {r.baseline.path}\n </Typography.Text>\n ) : null}\n </Space>\n }\n >\n <InfoCircleOutlined />\n </Tooltip>\n </Space>\n );\n\n if (r.baseline && !r.current) {\n // deleted\n return (\n <Space>\n <MinusSquareOutlined style={{ color: Color.Red }} />\n {name}\n </Space>\n );\n }\n\n if (!r.baseline && r.current) {\n // new\n return (\n <Space>\n <PlusSquareOutlined style={{ color: Color.Green }} />\n {name}\n </Space>\n );\n }\n\n if (r.baseline && r.current) {\n // update\n return (\n <Space>\n <CheckSquareOutlined style={{ color: Color.Yellow }} />\n {name}\n </Space>\n );\n }\n\n return name;\n};\n\nexport const Assets: React.FC<{\n outputFilename: string;\n baseline: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n current: SDK.ServerAPI.ResponseTypes[SDK.ServerAPI.API.GetBundleDiffSummary];\n}> = ({ baseline, current, outputFilename }) => {\n const bOutPutFileName = outputFilename;\n\n const [keyword, setKeyword] = useState<string>();\n const [selectedFileTypes, setSelectedFileTypes] = useState<string[]>([]);\n const [selectedUpdateTypes, setSelectedUpdateTypes] = useState<UpdateType[]>(\n [],\n );\n const [selectedSortType, setSelectedSortType] = useState<SortType>(\n SortType.Size,\n );\n const [selectedBAsset, setSelectedBAsset] = useState(null);\n const [selectedCAsset, setSelectedCAsset] = useState(null);\n\n const { assets: bAssets } = baseline.chunkGraph;\n const { assets: cAssets } = current.chunkGraph;\n\n const dataSource = useMemo(() => {\n const res: Record<string, BundleDiffTableAssetsData> = {};\n if (selectedBAsset && selectedCAsset) {\n res.choose = {\n alias: `${selectedBAsset} \\n ${selectedCAsset}`,\n current: cAssets.find((c: SDK.AssetData) => c.path === selectedCAsset),\n baseline: bAssets.find((b: SDK.AssetData) => b.path === selectedBAsset),\n };\n return Object.values(res);\n }\n\n bAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = {\n alias,\n baseline: asset,\n };\n } else {\n console.warn('[Baseline Asset Exists]: ', asset, res);\n }\n });\n\n cAssets.forEach((asset: SDK.AssetData) => {\n const alias = Graph.formatAssetName(asset.path, bOutPutFileName);\n if (!res[alias]) {\n res[alias] = { alias };\n }\n res[alias].current = asset;\n });\n\n return Object.values(res);\n }, [bAssets, cAssets, selectedBAsset, selectedCAsset]);\n\n const filteredDataSource = useMemo(() => {\n let list = dataSource.slice();\n\n if (keyword) {\n list = list.filter((e) => e.alias.indexOf(keyword) > -1);\n }\n\n if (selectedFileTypes.length) {\n const exts = selectedFileTypes\n .map((e) => fileTypes[e as keyof typeof fileTypes])\n .flat();\n\n const hasOthers = selectedFileTypes.indexOf('Others') > -1;\n\n list = list.filter((e) => {\n const asset = e.baseline! || e.current!;\n if (Graph.isAssetMatchExtensions(asset, exts)) {\n return true;\n }\n\n if (hasOthers) {\n return !Graph.isAssetMatchExtensions(asset, definedExtensions);\n }\n\n return false;\n });\n }\n\n if (selectedUpdateTypes.length) {\n list = list.filter((e) => {\n if (e.baseline && !e.current) {\n // deleted\n return selectedUpdateTypes.includes(UpdateType.Deleted);\n }\n\n if (!e.baseline && e.current) {\n // new\n return selectedUpdateTypes.includes(UpdateType.New);\n }\n\n if (e.baseline && e.current) {\n if (e.baseline.size === e.current.size) {\n // not changed\n return selectedUpdateTypes.includes(UpdateType.NotChanged);\n }\n // changed\n return selectedUpdateTypes.includes(UpdateType.Changed);\n }\n\n return false;\n });\n }\n\n if (selectedSortType) {\n if (selectedSortType === SortType.Name) {\n list.sort((a, b) => {\n return a.alias.localeCompare(b.alias);\n });\n } else {\n const { prev, others } = list.reduce(\n (t, c) => {\n if (c.current) {\n if (c.baseline) {\n t.prev.unshift(c);\n } else {\n t.prev.push(c);\n }\n } else {\n t.others.push(c);\n }\n return t;\n },\n {\n prev: [] as BundleDiffTableAssetsData[],\n others: [] as BundleDiffTableAssetsData[],\n },\n );\n\n list = [\n ...prev.sort((a, b) => {\n if (b.current && a.current) {\n if (selectedSortType === SortType.Delta) {\n const { percent: percentA } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n a.alias,\n );\n const { percent: percentB } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n b.alias,\n );\n return percentB - percentA;\n }\n return b.current!.size - a.current!.size;\n }\n return -1;\n }),\n ...others,\n ];\n }\n }\n\n return list;\n }, [\n dataSource,\n keyword,\n selectedFileTypes,\n selectedUpdateTypes,\n selectedSortType,\n ]);\n\n const cSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.current ? e.current.size : 0)) || 0,\n [filteredDataSource],\n );\n const bSize = useMemo(\n () =>\n sumBy(filteredDataSource, (e) => (e.baseline ? e.baseline.size : 0)) || 0,\n [filteredDataSource],\n );\n\n return (\n <Row gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n <Space wrap>\n <KeywordInput\n icon={<FileSearchOutlined />}\n label=\"\"\n labelStyle={{ width: 45 }}\n placeholder=\"Search by file name\"\n onChange={(e) => {\n setKeyword(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file type\"\n style={{ width: 250 }}\n options={Object.keys(fileTypes).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedFileTypes(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by file changed type\"\n style={{ width: 200 }}\n options={Object.values(UpdateType).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedUpdateTypes(e);\n }}\n />\n <Select\n suffixIcon={<SortAscendingOutlined />}\n // style={{ width: 150 }}\n options={Object.values(SortType).map((e) => ({\n label: e,\n value: e,\n }))}\n value={selectedSortType}\n onChange={(e) => {\n setSelectedSortType(e);\n }}\n />\n </Space>\n <Row style={{ marginTop: 10 }} gutter={[6, 6]}>\n <Col>\n <Button>Select Baseline Asset and Current Asset to Diff </Button>\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select baseline assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(baseline.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedBAsset(e)}\n />\n </Col>\n <Col>\n <Select\n allowClear\n placeholder=\"select current assets\"\n showSearch\n style={{ width: 300 }}\n options={Object.values(current.chunkGraph.assets).map((e) => ({\n label: e.path,\n value: e.path,\n }))}\n onChange={(e) => setSelectedCAsset(e)}\n />\n </Col>\n </Row>\n </Col>\n <Col span={24}>\n <Table\n bordered\n sticky={{ offsetHeader: 54 }}\n pagination={{\n pageSize: 20,\n size: 'small',\n }}\n dataSource={filteredDataSource}\n rowKey={(e) => e.alias}\n expandable={{\n expandedRowRender: (r) => {\n return (\n <div style={{ margin: Size.BasePadding / 3 }}>\n <ModuleRowForAsset\n data={r}\n baseline={baseline}\n current={current}\n />\n </div>\n );\n },\n columnTitle: (\n <Tooltip\n title=\"Click to expand row to see the modules which the chunk contains\"\n placement=\"left\"\n >\n <AppstoreAddOutlined style={{ cursor: 'pointer' }} />\n </Tooltip>\n ),\n }}\n columns={[\n {\n title: (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n filtered assets is {filteredDataSource.length}\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n total assets is {dataSource.length}\n </Typography.Text>\n </Space>\n }\n >\n <Typography.Text strong>Assets</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {filteredDataSource.length}/{dataSource.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n ),\n render: (_v, r) => <Name data={r} />,\n },\n {\n title: () => {\n const cs = formatSize(cSize);\n const diff = Graph.diffSize(bSize, cSize);\n return (\n <Tooltip\n title={`Current size is ${cs}, Delta is ${formatPercent(diff.percent)}`}\n >\n <Typography.Text strong>Current</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n <Typography.Text\n style={{ fontSize: 'inherit', marginRight: 8 }}\n >\n {cs}\n </Typography.Text>\n <SizePercent\n fontSize={'inherit'}\n baseline={bSize}\n current={cSize}\n />\n {formatDiffSize(\n bSize,\n cSize,\n bSize > cSize\n ? Client.RsdoctorClientDiffState.Down\n : Client.RsdoctorClientDiffState.Up,\n { fontSize: 10, fontWeight: 400, marginLeft: 4 },\n )}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.current) {\n const { percent, state } = Graph.diffAssetsByExtensions(\n baseline.chunkGraph,\n current.chunkGraph,\n (asset) =>\n Graph.formatAssetName(asset.path, bOutPutFileName) ===\n r.alias,\n );\n const isInitial = Graph.isInitialAsset(\n r.current,\n current.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.current.size)}\n </Typography.Text>\n <Percent percent={percent} state={state} />\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: () => {\n const bs = formatSize(bSize);\n return (\n <Tooltip title={`Baseline size is ${bs}`}>\n <Typography.Text strong>Baseline</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {bs}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n );\n },\n render: (_v, r) => {\n if (r.baseline) {\n const isInitial = Graph.isInitialAsset(\n r.baseline,\n baseline.chunkGraph.chunks,\n );\n return (\n <Space>\n <Typography.Text>\n {formatSize(r.baseline.size)}\n </Typography.Text>\n {isInitial ? <Tag color={Color.Blue}>initial</Tag> : null}\n </Space>\n );\n }\n return '-';\n },\n },\n {\n title: 'Actions',\n key: 'actions',\n render: (_v, r) => {\n return (\n <ViewChanges\n file={r.alias}\n data={[\n {\n baseline: r.baseline?.content,\n current: r.current?.content,\n group: 'assets',\n },\n ]}\n />\n );\n },\n },\n ]}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["fileTypes","Constants","definedExtensions","Object","Name","r","name","Space","Typography","Tooltip","InfoCircleOutlined","MinusSquareOutlined","Color","PlusSquareOutlined","CheckSquareOutlined","Assets","baseline","current","outputFilename","bOutPutFileName","keyword","setKeyword","useState","selectedFileTypes","setSelectedFileTypes","selectedUpdateTypes","setSelectedUpdateTypes","selectedSortType","setSelectedSortType","SortType","selectedBAsset","setSelectedBAsset","selectedCAsset","setSelectedCAsset","bAssets","cAssets","dataSource","useMemo","res","c","b","asset","alias","Graph","console","filteredDataSource","list","e","exts","hasOthers","UpdateType","a","prev","others","t","percentA","percentB","cSize","sumBy","bSize","Row","Size","Col","KeywordInput","FileSearchOutlined","Select","SortAscendingOutlined","Button","Table","ModuleRowForAsset","AppstoreAddOutlined","Divider","_v","cs","formatSize","diff","formatPercent","SizePercent","formatDiffSize","Client","percent","state","isInitial","Percent","Tag","bs","ViewChanges"],"mappings":";;;;;;;;;;;;;;;AAmCA,MAAMA,YAAY;IAChB,IAAI;QAACC,UAAU,WAAW;KAAC;IAC3B,KAAK;QAACA,UAAU,YAAY;KAAC;IAC7B,MAAM;QAACA,UAAU,aAAa;KAAC;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4BAGzB;4BACA,QAAQ,CAAC8D,IAAInE;gCACX,IAAIA,EAAE,QAAQ,EAAE;oCACd,MAAM6E,YAAYvC,MAAM,cAAc,CACpCtC,EAAE,QAAQ,EACVW,SAAS,UAAU,CAAC,MAAM;oCAE5B,OAAO,WAAP,GACE,KAACT,OAAKA;;0DACJ,IAACC,WAAW,IAAI;0DACbkE,WAAWrE,EAAE,QAAQ,CAAC,IAAI;;4CAE5B6E,YAAY,WAAZA,GAAY,IAACE,KAAGA;gDAAC,OAAOxE,MAAM,IAAI;0DAAE;iDAAgB;;;gCAG3D;gCACA,OAAO;4BACT;wBACF;wBACA;4BACE,OAAO;4BACP,KAAK;4BACL,QAAQ,CAAC4D,IAAInE,IACJ,WAAP,GACE,IAACiF,aAAWA;oCACV,MAAMjF,EAAE,KAAK;oCACb,MAAM;wCACJ;4CACE,UAAUA,EAAE,QAAQ,EAAE;4CACtB,SAASA,EAAE,OAAO,EAAE;4CACpB,OAAO;wCACT;qCACD;;wBAIT;qBACD;;;;;AAKX"}
@@ -67,8 +67,7 @@ const Modules = ({ baseline, current })=>{
67
67
  const dataSource = useMemo(()=>{
68
68
  const res = {};
69
69
  bModules.forEach((mod)=>{
70
- var _mod_webpackId, _mod_path;
71
- const modPath = (null == (_mod_webpackId = mod.webpackId) ? void 0 : _mod_webpackId.replace(ModuleHashPattern, '')) || (null == (_mod_path = mod.path) ? void 0 : _mod_path.replace(ModuleHashPattern, ''));
70
+ const modPath = mod.webpackId?.replace(ModuleHashPattern, '') || mod.path?.replace(ModuleHashPattern, '');
72
71
  if (res[modPath]) console.warn('[Baseline Module Exists]: ', mod, res);
73
72
  else res[modPath] = {
74
73
  path: modPath,
@@ -76,8 +75,7 @@ const Modules = ({ baseline, current })=>{
76
75
  };
77
76
  });
78
77
  cModules.forEach((mod)=>{
79
- var _mod_webpackId, _mod_path;
80
- const modPath = (null == (_mod_webpackId = mod.webpackId) ? void 0 : _mod_webpackId.replace(ModuleHashPattern, '')) || (null == (_mod_path = mod.path) ? void 0 : _mod_path.replace(ModuleHashPattern, ''));
78
+ const modPath = mod.webpackId?.replace(ModuleHashPattern, '') || mod.path?.replace(ModuleHashPattern, '');
81
79
  if (!res[modPath]) res[modPath] = {
82
80
  path: modPath
83
81
  };
@@ -266,7 +264,6 @@ const Modules = ({ baseline, current })=>{
266
264
  title: 'Actions',
267
265
  width: 200,
268
266
  render: (_v, r)=>{
269
- var _baseline_moduleCodeMap_r_baseline_id, _r_baseline, _current_moduleCodeMap_r_current_id, _r_current, _baseline_moduleCodeMap_r_baseline_id1, _r_baseline1, _current_moduleCodeMap_r_current_id1, _r_current1, _baseline_moduleCodeMap_r_baseline_id2, _r_baseline2, _current_moduleCodeMap_r_current_id2, _r_current2, _current_moduleCodeMap_r_current_id3, _current_moduleCodeMap_r_current_id4, _current_moduleCodeMap_r_current_id5, _current_moduleCodeMap_r_current_id6;
270
267
  const isChanged = getUpdateType(r) === UpdateType.Changed;
271
268
  return /*#__PURE__*/ jsxs(Space, {
272
269
  direction: "vertical",
@@ -279,36 +276,36 @@ const Modules = ({ baseline, current })=>{
279
276
  file: r.path,
280
277
  data: [
281
278
  {
282
- baseline: null == (_baseline_moduleCodeMap_r_baseline_id = baseline.moduleCodeMap[null == (_r_baseline = r.baseline) ? void 0 : _r_baseline.id]) ? void 0 : _baseline_moduleCodeMap_r_baseline_id.source,
283
- current: null == (_current_moduleCodeMap_r_current_id = current.moduleCodeMap[null == (_r_current = r.current) ? void 0 : _r_current.id]) ? void 0 : _current_moduleCodeMap_r_current_id.source,
279
+ baseline: baseline.moduleCodeMap[r.baseline?.id]?.source,
280
+ current: current.moduleCodeMap[r.current?.id]?.source,
284
281
  group: 'Source'
285
282
  },
286
283
  {
287
- baseline: null == (_baseline_moduleCodeMap_r_baseline_id1 = baseline.moduleCodeMap[null == (_r_baseline1 = r.baseline) ? void 0 : _r_baseline1.id]) ? void 0 : _baseline_moduleCodeMap_r_baseline_id1.transformed,
288
- current: null == (_current_moduleCodeMap_r_current_id1 = current.moduleCodeMap[null == (_r_current1 = r.current) ? void 0 : _r_current1.id]) ? void 0 : _current_moduleCodeMap_r_current_id1.transformed,
284
+ baseline: baseline.moduleCodeMap[r.baseline?.id]?.transformed,
285
+ current: current.moduleCodeMap[r.current?.id]?.transformed,
289
286
  group: 'Transformed Source'
290
287
  },
291
288
  {
292
- baseline: null == (_baseline_moduleCodeMap_r_baseline_id2 = baseline.moduleCodeMap[null == (_r_baseline2 = r.baseline) ? void 0 : _r_baseline2.id]) ? void 0 : _baseline_moduleCodeMap_r_baseline_id2.parsedSource,
293
- current: null == (_current_moduleCodeMap_r_current_id2 = current.moduleCodeMap[null == (_r_current2 = r.current) ? void 0 : _r_current2.id]) ? void 0 : _current_moduleCodeMap_r_current_id2.parsedSource,
289
+ baseline: baseline.moduleCodeMap[r.baseline?.id]?.parsedSource,
290
+ current: current.moduleCodeMap[r.current?.id]?.parsedSource,
294
291
  group: 'Parsed Source'
295
292
  }
296
293
  ]
297
294
  }) : null,
298
- (null == r ? void 0 : r.current) ? /*#__PURE__*/ jsx(ViewChanges, {
295
+ r?.current ? /*#__PURE__*/ jsx(ViewChanges, {
299
296
  text: "Current Result Viewer",
300
297
  file: r.path,
301
298
  data: [
302
299
  {
303
- baseline: null == (_current_moduleCodeMap_r_current_id3 = current.moduleCodeMap[r.current.id]) ? void 0 : _current_moduleCodeMap_r_current_id3.source,
304
- current: null == (_current_moduleCodeMap_r_current_id4 = current.moduleCodeMap[r.current.id]) ? void 0 : _current_moduleCodeMap_r_current_id4.transformed,
300
+ baseline: current.moduleCodeMap[r.current.id]?.source,
301
+ current: current.moduleCodeMap[r.current.id]?.transformed,
305
302
  baselineTitle: 'Current Source',
306
303
  currentTitle: 'Current Transformed Source',
307
304
  group: 'Transformed Source'
308
305
  },
309
306
  {
310
- baseline: null == (_current_moduleCodeMap_r_current_id5 = current.moduleCodeMap[r.current.id]) ? void 0 : _current_moduleCodeMap_r_current_id5.source,
311
- current: null == (_current_moduleCodeMap_r_current_id6 = current.moduleCodeMap[r.current.id]) ? void 0 : _current_moduleCodeMap_r_current_id6.parsedSource,
307
+ baseline: current.moduleCodeMap[r.current.id]?.source,
308
+ current: current.moduleCodeMap[r.current.id]?.parsedSource,
312
309
  baselineTitle: 'Current Source',
313
310
  currentTitle: 'Current Parsed Source',
314
311
  group: 'Parsed Source'
@@ -1 +1 @@
1
- {"version":3,"file":"pages/Resources/BundleDiff/DiffContainer/modules.mjs","sources":["webpack://@rsdoctor/components/./src/pages/Resources/BundleDiff/DiffContainer/modules.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Col,\n Divider,\n Row,\n Select,\n Space,\n Table,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { uniq } from 'es-toolkit/compat';\nimport { InfoCircleOutlined, FileSearchOutlined } from '@ant-design/icons';\nimport {\n BundleDiffComponentCardProps,\n BundleDiffTableModulesData,\n} from './types';\nimport { beautifyModulePath, useUniqModules } from '../../../../utils';\nimport { Size } from '../../../../constants';\nimport { KeywordInput } from '../../../../components/Form/keyword';\nimport { ViewChanges } from './changes';\nimport { UpdateType } from './constants';\nimport { Badge as Bdg } from '../../../../components/Badge';\nimport { ModuleHashPattern, getTargetColumnPropsForModuleRow } from './row';\nimport { Graph } from '@rsdoctor/utils/common';\n\nexport function getUpdateType(e: BundleDiffTableModulesData): UpdateType {\n if (e.baseline && !e.current) {\n // deleted\n return UpdateType.Deleted;\n }\n\n if (!e.baseline && e.current) {\n // new\n return UpdateType.New;\n }\n\n if (e.baseline && e.current) {\n if (\n e.baseline.size.sourceSize === e.current.size.sourceSize &&\n e.baseline.size.parsedSize === e.current.size.parsedSize\n ) {\n // not changed\n return UpdateType.NotChanged;\n }\n // update\n return UpdateType.Changed;\n }\n\n throw new Error('Update Type not match');\n}\n\nexport const FileUpdateTypeTag: React.FC<{ type: UpdateType }> = ({ type }) => {\n if (type === UpdateType.NotChanged) {\n return (\n <Tooltip title=\"It hasn't changed between Baseline and Current\">\n <Tag color=\"success\">Not Changed</Tag>\n </Tooltip>\n );\n }\n if (type === UpdateType.Changed) {\n return (\n <Tooltip title=\"It has been changed between Baseline and Current\">\n <Tag color=\"warning\">Changed</Tag>\n </Tooltip>\n );\n }\n if (type === UpdateType.New) {\n return (\n <Tooltip title=\"It is created in Current\">\n <Tag color=\"error\">New</Tag>\n </Tooltip>\n );\n }\n if (type === UpdateType.Deleted) {\n return (\n <Tooltip title=\"It has been deleted in Current\">\n <Tag color=\"error\">Deleted</Tag>\n </Tooltip>\n );\n }\n return null;\n};\n\nexport const Modules: React.FC<BundleDiffComponentCardProps> = ({\n baseline,\n current,\n}) => {\n const bModules = useMemo(\n () => useUniqModules(baseline.moduleGraph.modules),\n [baseline],\n );\n const cModules = useMemo(\n () => useUniqModules(current.moduleGraph.modules),\n [current],\n );\n\n const bChunks = baseline.chunkGraph.chunks;\n const cChunks = current.chunkGraph.chunks;\n\n const bRoot = baseline.root;\n const cRoot = current.root;\n\n const [keyword, setKeyword] = useState<string>();\n const [selectedUpdateTypes, setSelectedUpdateTypes] = useState<UpdateType[]>(\n [],\n );\n\n const dataSource = useMemo(() => {\n const res: Record<string, BundleDiffTableModulesData> = {};\n\n bModules.forEach((mod) => {\n const modPath =\n mod.webpackId?.replace(ModuleHashPattern, '') ||\n mod.path?.replace(ModuleHashPattern, '');\n\n if (!res[modPath]) {\n res[modPath] = {\n path: modPath,\n baseline: mod,\n };\n } else {\n console.warn('[Baseline Module Exists]: ', mod, res);\n }\n });\n\n cModules.forEach((mod) => {\n const modPath =\n mod.webpackId?.replace(ModuleHashPattern, '') ||\n mod.path?.replace(ModuleHashPattern, '');\n\n if (!res[modPath]) {\n res[modPath] = {\n path: modPath,\n };\n }\n res[modPath].current = mod;\n });\n\n return Object.values(res);\n }, [bModules, cModules]);\n\n const filteredDataSource = useMemo(() => {\n let list = dataSource.slice();\n\n if (keyword) {\n list = list.filter((e) => e.path.indexOf(keyword) > -1);\n }\n\n if (selectedUpdateTypes.length) {\n list = list.filter((e) => {\n return selectedUpdateTypes.includes(getUpdateType(e));\n });\n }\n\n return list;\n }, [dataSource, keyword, selectedUpdateTypes]);\n\n const { bFilteredModulesLength, cFilteredModulesLength } = useMemo(() => {\n return {\n bFilteredModulesLength: filteredDataSource.filter((e) => e.baseline)\n .length,\n cFilteredModulesLength: filteredDataSource.filter((e) => e.current)\n .length,\n };\n }, [filteredDataSource]);\n\n return (\n <Row gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n <Space wrap>\n <KeywordInput\n icon={<FileSearchOutlined />}\n label=\"\"\n labelStyle={{ width: 45 }}\n placeholder=\"Search by name\"\n onChange={(e) => {\n setKeyword(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by changed type\"\n style={{ width: 200 }}\n options={Object.values(UpdateType).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedUpdateTypes(e);\n }}\n />\n </Space>\n </Col>\n <Col span={24}>\n <Table\n bordered\n sticky={{ offsetHeader: 54 }}\n pagination={{\n pageSize: 20,\n size: 'small',\n }}\n scroll={{ x: 1700 }}\n dataSource={filteredDataSource}\n rowKey={(e) => e.path}\n columns={[\n {\n fixed: 'left',\n title: (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n filtered modules is {filteredDataSource.length} (Current\n & Baseline)\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n total modules is {dataSource.length} (Current &\n Baseline)\n </Typography.Text>\n </Space>\n }\n >\n <Typography.Text strong>Modules</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {filteredDataSource.length}/{dataSource.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n ),\n render: (_v, r) => {\n const { alias, inNodeModules } = beautifyModulePath(\n r.path,\n r.baseline ? bRoot : cRoot,\n );\n return (\n <Space>\n <Tooltip title={r.path}>\n <Typography.Text copyable={{ text: r.path }}>\n {alias}\n </Typography.Text>\n </Tooltip>\n <FileUpdateTypeTag type={getUpdateType(r)} />\n {inNodeModules ? (\n <Tag color=\"warning\">node_modules</Tag>\n ) : null}\n </Space>\n );\n },\n },\n getTargetColumnPropsForModuleRow(\n 'current',\n bFilteredModulesLength,\n cFilteredModulesLength,\n ),\n getTargetColumnPropsForModuleRow(\n 'baseline',\n bFilteredModulesLength,\n cFilteredModulesLength,\n ),\n {\n title: 'in Assets',\n render: (_v, r) => {\n const b: string[] = [];\n const c: string[] = [];\n if (r.current) {\n Graph.getChunksByModule(r.current, cChunks).forEach((e) =>\n e.assets.forEach((asset) => c.push(asset)),\n );\n }\n\n if (r.baseline) {\n Graph.getChunksByModule(r.baseline, bChunks).forEach((e) =>\n e.assets.forEach((asset) => b.push(asset)),\n );\n }\n\n if (!b.length && !c.length) return null;\n\n return (\n <Space direction=\"vertical\">\n {uniq(c)\n .filter(Boolean)\n .map((e) => (\n <Bdg label=\"Current\" value={e} key={`c_${e}`} />\n ))}\n {uniq(b)\n .filter(Boolean)\n .map((e) => (\n <Bdg label=\"Baseline\" value={e} key={`b_${e}`} />\n ))}\n </Space>\n );\n },\n },\n {\n title: 'Actions',\n width: 200,\n render: (_v, r) => {\n const isChanged = getUpdateType(r) === UpdateType.Changed;\n return (\n <Space direction=\"vertical\" style={{ maxWidth: 170 }}>\n {isChanged ? (\n <ViewChanges\n text=\"View Changes\"\n file={r.path}\n data={[\n {\n baseline:\n baseline.moduleCodeMap[r.baseline?.id as number]\n ?.source,\n current:\n current.moduleCodeMap[r.current?.id as number]\n ?.source,\n group: 'Source',\n },\n {\n baseline:\n baseline.moduleCodeMap[r.baseline?.id as number]\n ?.transformed,\n current:\n current.moduleCodeMap[r.current?.id as number]\n ?.transformed,\n group: 'Transformed Source',\n },\n {\n baseline:\n baseline.moduleCodeMap[r.baseline?.id as number]\n ?.parsedSource,\n current:\n current.moduleCodeMap[r.current?.id as number]\n ?.parsedSource,\n group: 'Parsed Source',\n },\n ]}\n />\n ) : null}\n {r?.current ? (\n <ViewChanges\n text=\"Current Result Viewer\"\n file={r.path}\n data={[\n {\n baseline:\n current.moduleCodeMap[r.current!.id]?.source,\n current:\n current.moduleCodeMap[r.current!.id]?.transformed,\n baselineTitle: 'Current Source',\n currentTitle: 'Current Transformed Source',\n group: 'Transformed Source',\n },\n {\n baseline:\n current.moduleCodeMap[r.current!.id]?.source,\n current:\n current.moduleCodeMap[r.current!.id]\n ?.parsedSource,\n baselineTitle: 'Current Source',\n currentTitle: 'Current Parsed Source',\n group: 'Parsed Source',\n },\n ]}\n />\n ) : null}\n </Space>\n );\n },\n },\n ]}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["getUpdateType","e","UpdateType","Error","FileUpdateTypeTag","type","Tooltip","Tag","Modules","baseline","current","bModules","useMemo","useUniqModules","cModules","bChunks","cChunks","bRoot","cRoot","keyword","setKeyword","useState","selectedUpdateTypes","setSelectedUpdateTypes","dataSource","res","mod","_mod_webpackId","_mod_path","modPath","ModuleHashPattern","console","Object","filteredDataSource","list","bFilteredModulesLength","cFilteredModulesLength","Row","Size","Col","Space","KeywordInput","FileSearchOutlined","Select","Table","Typography","Divider","InfoCircleOutlined","_v","r","alias","inNodeModules","beautifyModulePath","getTargetColumnPropsForModuleRow","b","c","Graph","asset","uniq","Boolean","Bdg","_baseline_moduleCodeMap_r_baseline_id","_r_baseline","_current_moduleCodeMap_r_current_id","_r_current","_baseline_moduleCodeMap_r_baseline_id1","_r_baseline1","_current_moduleCodeMap_r_current_id1","_r_current1","_baseline_moduleCodeMap_r_baseline_id2","_r_baseline2","_current_moduleCodeMap_r_current_id2","_r_current2","_current_moduleCodeMap_r_current_id3","_current_moduleCodeMap_r_current_id4","_current_moduleCodeMap_r_current_id5","_current_moduleCodeMap_r_current_id6","isChanged","ViewChanges"],"mappings":";;;;;;;;;;;;;AA2BO,SAASA,cAAcC,CAA6B;IACzD,IAAIA,E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IAAAA,KAAAA,IAAAA,EAAG,OAAO,AAAD,IAAC,cACT,IAAC6B,aAAWA;4CACV,MAAK;4CACL,MAAM7B,EAAE,IAAI;4CACZ,MAAM;gDACJ;oDACE,UAAQ,QACNwB,CAAAA,uCAAAA,QAAQ,aAAa,CAACxB,EAAE,OAAO,CAAE,EAAE,CAAC,AAAD,IAAnCwB,KAAAA,IAAAA,qCAAsC,MAAM;oDAC9C,SAAO,QACLC,CAAAA,uCAAAA,QAAQ,aAAa,CAACzB,EAAE,OAAO,CAAE,EAAE,CAAC,AAAD,IAAnCyB,KAAAA,IAAAA,qCAAsC,WAAW;oDACnD,eAAe;oDACf,cAAc;oDACd,OAAO;gDACT;gDACA;oDACE,UAAQ,QACNC,CAAAA,uCAAAA,QAAQ,aAAa,CAAC1B,EAAE,OAAO,CAAE,EAAE,CAAC,AAAD,IAAnC0B,KAAAA,IAAAA,qCAAsC,MAAM;oDAC9C,SAAO,QACLC,CAAAA,uCAAAA,QAAQ,aAAa,CAAC3B,EAAE,OAAO,CAAE,EAAE,CAAC,AAAD,IAAnC2B,KAAAA,IAAAA,qCACI,YAAY;oDAClB,eAAe;oDACf,cAAc;oDACd,OAAO;gDACT;6CACD;6CAED;;;4BAGV;wBACF;qBACD;;;;;AAKX"}
1
+ {"version":3,"file":"pages/Resources/BundleDiff/DiffContainer/modules.mjs","sources":["webpack://@rsdoctor/components/./src/pages/Resources/BundleDiff/DiffContainer/modules.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Col,\n Divider,\n Row,\n Select,\n Space,\n Table,\n Tag,\n Tooltip,\n Typography,\n} from 'antd';\nimport { uniq } from 'es-toolkit/compat';\nimport { InfoCircleOutlined, FileSearchOutlined } from '@ant-design/icons';\nimport {\n BundleDiffComponentCardProps,\n BundleDiffTableModulesData,\n} from './types';\nimport { beautifyModulePath, useUniqModules } from '../../../../utils';\nimport { Size } from '../../../../constants';\nimport { KeywordInput } from '../../../../components/Form/keyword';\nimport { ViewChanges } from './changes';\nimport { UpdateType } from './constants';\nimport { Badge as Bdg } from '../../../../components/Badge';\nimport { ModuleHashPattern, getTargetColumnPropsForModuleRow } from './row';\nimport { Graph } from '@rsdoctor/utils/common';\n\nexport function getUpdateType(e: BundleDiffTableModulesData): UpdateType {\n if (e.baseline && !e.current) {\n // deleted\n return UpdateType.Deleted;\n }\n\n if (!e.baseline && e.current) {\n // new\n return UpdateType.New;\n }\n\n if (e.baseline && e.current) {\n if (\n e.baseline.size.sourceSize === e.current.size.sourceSize &&\n e.baseline.size.parsedSize === e.current.size.parsedSize\n ) {\n // not changed\n return UpdateType.NotChanged;\n }\n // update\n return UpdateType.Changed;\n }\n\n throw new Error('Update Type not match');\n}\n\nexport const FileUpdateTypeTag: React.FC<{ type: UpdateType }> = ({ type }) => {\n if (type === UpdateType.NotChanged) {\n return (\n <Tooltip title=\"It hasn't changed between Baseline and Current\">\n <Tag color=\"success\">Not Changed</Tag>\n </Tooltip>\n );\n }\n if (type === UpdateType.Changed) {\n return (\n <Tooltip title=\"It has been changed between Baseline and Current\">\n <Tag color=\"warning\">Changed</Tag>\n </Tooltip>\n );\n }\n if (type === UpdateType.New) {\n return (\n <Tooltip title=\"It is created in Current\">\n <Tag color=\"error\">New</Tag>\n </Tooltip>\n );\n }\n if (type === UpdateType.Deleted) {\n return (\n <Tooltip title=\"It has been deleted in Current\">\n <Tag color=\"error\">Deleted</Tag>\n </Tooltip>\n );\n }\n return null;\n};\n\nexport const Modules: React.FC<BundleDiffComponentCardProps> = ({\n baseline,\n current,\n}) => {\n const bModules = useMemo(\n () => useUniqModules(baseline.moduleGraph.modules),\n [baseline],\n );\n const cModules = useMemo(\n () => useUniqModules(current.moduleGraph.modules),\n [current],\n );\n\n const bChunks = baseline.chunkGraph.chunks;\n const cChunks = current.chunkGraph.chunks;\n\n const bRoot = baseline.root;\n const cRoot = current.root;\n\n const [keyword, setKeyword] = useState<string>();\n const [selectedUpdateTypes, setSelectedUpdateTypes] = useState<UpdateType[]>(\n [],\n );\n\n const dataSource = useMemo(() => {\n const res: Record<string, BundleDiffTableModulesData> = {};\n\n bModules.forEach((mod) => {\n const modPath =\n mod.webpackId?.replace(ModuleHashPattern, '') ||\n mod.path?.replace(ModuleHashPattern, '');\n\n if (!res[modPath]) {\n res[modPath] = {\n path: modPath,\n baseline: mod,\n };\n } else {\n console.warn('[Baseline Module Exists]: ', mod, res);\n }\n });\n\n cModules.forEach((mod) => {\n const modPath =\n mod.webpackId?.replace(ModuleHashPattern, '') ||\n mod.path?.replace(ModuleHashPattern, '');\n\n if (!res[modPath]) {\n res[modPath] = {\n path: modPath,\n };\n }\n res[modPath].current = mod;\n });\n\n return Object.values(res);\n }, [bModules, cModules]);\n\n const filteredDataSource = useMemo(() => {\n let list = dataSource.slice();\n\n if (keyword) {\n list = list.filter((e) => e.path.indexOf(keyword) > -1);\n }\n\n if (selectedUpdateTypes.length) {\n list = list.filter((e) => {\n return selectedUpdateTypes.includes(getUpdateType(e));\n });\n }\n\n return list;\n }, [dataSource, keyword, selectedUpdateTypes]);\n\n const { bFilteredModulesLength, cFilteredModulesLength } = useMemo(() => {\n return {\n bFilteredModulesLength: filteredDataSource.filter((e) => e.baseline)\n .length,\n cFilteredModulesLength: filteredDataSource.filter((e) => e.current)\n .length,\n };\n }, [filteredDataSource]);\n\n return (\n <Row gutter={[Size.BasePadding, Size.BasePadding]}>\n <Col span={24}>\n <Space wrap>\n <KeywordInput\n icon={<FileSearchOutlined />}\n label=\"\"\n labelStyle={{ width: 45 }}\n placeholder=\"Search by name\"\n onChange={(e) => {\n setKeyword(e);\n }}\n />\n <Select\n mode=\"multiple\"\n placeholder=\"Filter by changed type\"\n style={{ width: 200 }}\n options={Object.values(UpdateType).map((e) => ({\n label: e,\n value: e,\n }))}\n allowClear\n onChange={(e) => {\n setSelectedUpdateTypes(e);\n }}\n />\n </Space>\n </Col>\n <Col span={24}>\n <Table\n bordered\n sticky={{ offsetHeader: 54 }}\n pagination={{\n pageSize: 20,\n size: 'small',\n }}\n scroll={{ x: 1700 }}\n dataSource={filteredDataSource}\n rowKey={(e) => e.path}\n columns={[\n {\n fixed: 'left',\n title: (\n <Tooltip\n title={\n <Space direction=\"vertical\">\n <Typography.Text style={{ color: 'inherit' }}>\n filtered modules is {filteredDataSource.length} (Current\n & Baseline)\n </Typography.Text>\n <Typography.Text style={{ color: 'inherit' }}>\n total modules is {dataSource.length} (Current &\n Baseline)\n </Typography.Text>\n </Space>\n }\n >\n <Typography.Text strong>Modules</Typography.Text>\n <Divider type=\"vertical\" />\n <Typography.Text\n type=\"secondary\"\n style={{ fontSize: 10, fontWeight: 400, marginRight: 4 }}\n >\n {filteredDataSource.length}/{dataSource.length}\n </Typography.Text>\n <InfoCircleOutlined />\n </Tooltip>\n ),\n render: (_v, r) => {\n const { alias, inNodeModules } = beautifyModulePath(\n r.path,\n r.baseline ? bRoot : cRoot,\n );\n return (\n <Space>\n <Tooltip title={r.path}>\n <Typography.Text copyable={{ text: r.path }}>\n {alias}\n </Typography.Text>\n </Tooltip>\n <FileUpdateTypeTag type={getUpdateType(r)} />\n {inNodeModules ? (\n <Tag color=\"warning\">node_modules</Tag>\n ) : null}\n </Space>\n );\n },\n },\n getTargetColumnPropsForModuleRow(\n 'current',\n bFilteredModulesLength,\n cFilteredModulesLength,\n ),\n getTargetColumnPropsForModuleRow(\n 'baseline',\n bFilteredModulesLength,\n cFilteredModulesLength,\n ),\n {\n title: 'in Assets',\n render: (_v, r) => {\n const b: string[] = [];\n const c: string[] = [];\n if (r.current) {\n Graph.getChunksByModule(r.current, cChunks).forEach((e) =>\n e.assets.forEach((asset) => c.push(asset)),\n );\n }\n\n if (r.baseline) {\n Graph.getChunksByModule(r.baseline, bChunks).forEach((e) =>\n e.assets.forEach((asset) => b.push(asset)),\n );\n }\n\n if (!b.length && !c.length) return null;\n\n return (\n <Space direction=\"vertical\">\n {uniq(c)\n .filter(Boolean)\n .map((e) => (\n <Bdg label=\"Current\" value={e} key={`c_${e}`} />\n ))}\n {uniq(b)\n .filter(Boolean)\n .map((e) => (\n <Bdg label=\"Baseline\" value={e} key={`b_${e}`} />\n ))}\n </Space>\n );\n },\n },\n {\n title: 'Actions',\n width: 200,\n render: (_v, r) => {\n const isChanged = getUpdateType(r) === UpdateType.Changed;\n return (\n <Space direction=\"vertical\" style={{ maxWidth: 170 }}>\n {isChanged ? (\n <ViewChanges\n text=\"View Changes\"\n file={r.path}\n data={[\n {\n baseline:\n baseline.moduleCodeMap[r.baseline?.id as number]\n ?.source,\n current:\n current.moduleCodeMap[r.current?.id as number]\n ?.source,\n group: 'Source',\n },\n {\n baseline:\n baseline.moduleCodeMap[r.baseline?.id as number]\n ?.transformed,\n current:\n current.moduleCodeMap[r.current?.id as number]\n ?.transformed,\n group: 'Transformed Source',\n },\n {\n baseline:\n baseline.moduleCodeMap[r.baseline?.id as number]\n ?.parsedSource,\n current:\n current.moduleCodeMap[r.current?.id as number]\n ?.parsedSource,\n group: 'Parsed Source',\n },\n ]}\n />\n ) : null}\n {r?.current ? (\n <ViewChanges\n text=\"Current Result Viewer\"\n file={r.path}\n data={[\n {\n baseline:\n current.moduleCodeMap[r.current!.id]?.source,\n current:\n current.moduleCodeMap[r.current!.id]?.transformed,\n baselineTitle: 'Current Source',\n currentTitle: 'Current Transformed Source',\n group: 'Transformed Source',\n },\n {\n baseline:\n current.moduleCodeMap[r.current!.id]?.source,\n current:\n current.moduleCodeMap[r.current!.id]\n ?.parsedSource,\n baselineTitle: 'Current Source',\n currentTitle: 'Current Parsed Source',\n group: 'Parsed Source',\n },\n ]}\n />\n ) : null}\n </Space>\n );\n },\n },\n ]}\n />\n </Col>\n </Row>\n );\n};\n"],"names":["getUpdateType","e","UpdateType","Error","FileUpdateTypeTag","type","Tooltip","Tag","Modules","baseline","current","bModules","useMemo","useUniqModules","cModules","bChunks","cChunks","bRoot","cRoot","keyword","setKeyword","useState","selectedUpdateTypes","setSelectedUpdateTypes","dataSource","res","mod","modPath","ModuleHashPattern","console","Object","filteredDataSource","list","bFilteredModulesLength","cFilteredModulesLength","Row","Size","Col","Space","KeywordInput","FileSearchOutlined","Select","Table","Typography","Divider","InfoCircleOutlined","_v","r","alias","inNodeModules","beautifyModulePath","getTargetColumnPropsForModuleRow","b","c","Graph","asset","uniq","Boolean","Bdg","isChanged","ViewChanges"],"mappings":";;;;;;;;;;;;;AA2BO,SAASA,cAAcC,CAA6B;IACzD,IAAIA,EAAE,QAAQ,IAAI,CAACA,EAAE,OAAO,EAE1B,OAAOC,WAAW,OAAO;IAG3B,IAAI,CAACD,EAAE,QAAQ,IAAIA,EAAE,OAAO,EAE1B,OAAOC,WAAW,GAAG;IAGvB,IAAID,EAAE,QAAQ,IAAIA,EAAE,OAAO,EAAE;QAC3B,IACEA,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,KAAKA,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,IACxDA,EAAE,QAAQ,CAAC,IAAI,CAAC,UAAU,KAAKA,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAGxD,OAAOC,WAAW,UAAU;QAG9B,OAAOA,WAAW,OAAO;IAC3B;IAEA,MAAM,IAAIC,MAAM;AAClB;AAEO,MAAMC,oBAAoD,CAAC,EAAEC,IAAI,EAAE;IACxE,IAAIA,SAASH,WAAW,UAAU,EAChC,OAAO,WAAP,GACE,IAACI,SAAOA;QAAC,OAAM;kBACb,kBAACC,KAAGA;YAAC,OAAM;sBAAU;;;IAI3B,IAAIF,SAASH,WAAW,OAAO,EAC7B,OAAO,WAAP,GACE,IAACI,SAAOA;QAAC,OAAM;kBACb,kBAACC,KAAGA;YAAC,OAAM;sBAAU;;;IAI3B,IAAIF,SAASH,WAAW,GAAG,EACzB,OAAO,WAAP,GACE,IAACI,SAAOA;QAAC,OAAM;kBACb,kBAACC,KAAGA;YAAC,OAAM;sBAAQ;;;IAIzB,IAAIF,SAASH,WAAW,OAAO,EAC7B,OAAO,WAAP,GACE,IAACI,SAAOA;QAAC,OAAM;kBACb,kBAACC,KAA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