@rsdoctor/components 1.5.18 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/ecma-version-check_module.css +1 -1
- package/dist/components/Alert/ecma-version-check_module.css.map +1 -1
- package/dist/components/Alerts/bundle-alert.mjs +8 -6
- package/dist/components/Alerts/bundle-alert.mjs.map +1 -1
- package/dist/components/Alerts/bundle.mjs +1 -2
- package/dist/components/Alerts/bundle.mjs.map +1 -1
- package/dist/components/Alerts/collapse-cjs-require.mjs +6 -14
- package/dist/components/Alerts/collapse-cjs-require.mjs.map +1 -1
- package/dist/components/Alerts/collapse-cross-chunks.mjs +3 -8
- package/dist/components/Alerts/collapse-cross-chunks.mjs.map +1 -1
- package/dist/components/Alerts/collapse-esm-cjs.mjs +6 -10
- package/dist/components/Alerts/collapse-esm-cjs.mjs.map +1 -1
- package/dist/components/Alerts/collapse-module-mixed-chunks.mjs +5 -12
- package/dist/components/Alerts/collapse-module-mixed-chunks.mjs.map +1 -1
- package/dist/components/Alerts/collapse-side-effects-only-imports.mjs +5 -12
- package/dist/components/Alerts/collapse-side-effects-only-imports.mjs.map +1 -1
- package/dist/components/Alerts/collapse.mjs +3 -10
- package/dist/components/Alerts/collapse.mjs.map +1 -1
- package/dist/components/Alerts/collapse_module.css +1 -1
- package/dist/components/Alerts/collapse_module.css.map +1 -1
- package/dist/components/Alerts/index.module.mjs +7 -0
- package/dist/components/Alerts/index.module.mjs.map +1 -0
- package/dist/components/Alerts/index_module.css +9 -0
- package/dist/components/Alerts/index_module.css.map +1 -0
- package/dist/components/Alerts/list.mjs +0 -3
- package/dist/components/Alerts/list.mjs.map +1 -1
- package/dist/components/Card/size_module.css +0 -2
- package/dist/components/Card/size_module.css.map +1 -1
- package/dist/components/Charts/TimelineCharts/index.mjs +63 -39
- package/dist/components/Charts/TimelineCharts/index.mjs.map +1 -1
- package/dist/components/Charts/TreeMap.mjs +88 -101
- package/dist/components/Charts/TreeMap.mjs.map +1 -1
- package/dist/components/Charts/index.mjs +3 -1
- package/dist/components/Charts/index.mjs.map +1 -1
- package/dist/components/Charts/treemap_module.css +6 -5
- package/dist/components/Charts/treemap_module.css.map +1 -1
- package/dist/components/FileTree/index.css +0 -1
- package/dist/components/FileTree/index.css.map +1 -1
- package/dist/components/FileTree/index.mjs +3 -4
- package/dist/components/FileTree/index.mjs.map +1 -1
- package/dist/components/Keyword/style_module.css +0 -1
- package/dist/components/Keyword/style_module.css.map +1 -1
- package/dist/components/Layout/header.mjs +22 -6
- package/dist/components/Layout/header.mjs.map +1 -1
- package/dist/components/Layout/header.module.mjs +0 -1
- package/dist/components/Layout/header.module.mjs.map +1 -1
- package/dist/components/Layout/header_module.css +0 -6
- package/dist/components/Layout/header_module.css.map +1 -1
- package/dist/components/Layout/index.mjs +27 -8
- package/dist/components/Layout/index.mjs.map +1 -1
- package/dist/components/Layout/menus.mjs +3 -1
- package/dist/components/Layout/menus.mjs.map +1 -1
- package/dist/components/Layout/rsdoctor-title-logo-dark.mjs +2 -0
- package/dist/components/Loader/Analysis/files.mjs +16 -17
- package/dist/components/Loader/Analysis/files.mjs.map +1 -1
- package/dist/components/Loader/Analysis/style_module.css +13 -14
- package/dist/components/Loader/Analysis/style_module.css.map +1 -1
- package/dist/components/Loader/executions.mjs +5 -13
- package/dist/components/Loader/executions.mjs.map +1 -1
- package/dist/components/Overall/DataSummary.mjs +21 -20
- package/dist/components/Overall/DataSummary.mjs.map +1 -1
- package/dist/components/Overall/DataSummary.module.mjs +1 -12
- package/dist/components/Overall/DataSummary.module.mjs.map +1 -1
- package/dist/components/Overall/DataSummary_module.css +7 -72
- package/dist/components/Overall/DataSummary_module.css.map +1 -1
- package/dist/components/Overall/bundle_module.css +1 -4
- package/dist/components/Overall/bundle_module.css.map +1 -1
- package/dist/components/Overall/list_module.css +0 -2
- package/dist/components/Overall/list_module.css.map +1 -1
- package/dist/components/Overall/overview_module.css +1 -2
- package/dist/components/Overall/overview_module.css.map +1 -1
- package/dist/components/base/CodeViewer/index.d.ts +1 -1
- package/dist/components/base/CodeViewer/index.mjs +5 -3
- package/dist/components/base/CodeViewer/index.mjs.map +1 -1
- package/dist/components/base/CodeViewer/interface.d.ts +1 -2
- package/dist/components/base/DiffViewer/index.d.ts +1 -1
- package/dist/components/base/DiffViewer/index.mjs +4 -1
- package/dist/components/base/DiffViewer/index.mjs.map +1 -1
- package/dist/components/base/DiffViewer/interface.d.ts +1 -2
- package/dist/pages/BundleSize/components/asset_module.css +7 -5
- package/dist/pages/BundleSize/components/asset_module.css.map +1 -1
- package/dist/pages/BundleSize/components/card_module.css +2 -2
- package/dist/pages/BundleSize/components/card_module.css.map +1 -1
- package/dist/pages/BundleSize/components/cards.mjs +5 -6
- package/dist/pages/BundleSize/components/cards.mjs.map +1 -1
- package/dist/pages/BundleSize/components/index.mjs +11 -8
- package/dist/pages/BundleSize/components/index.mjs.map +1 -1
- package/dist/pages/BundleSize/components/index.module.mjs +1 -6
- package/dist/pages/BundleSize/components/index.module.mjs.map +1 -1
- package/dist/pages/BundleSize/components/index_module.css +0 -37
- package/dist/pages/BundleSize/components/index_module.css.map +1 -1
- package/dist/pages/BundleSize/components/search-modal.mjs +5 -5
- package/dist/pages/BundleSize/components/search-modal.mjs.map +1 -1
- package/dist/pages/BundleSize/components/search-modal.module.mjs +10 -0
- package/dist/pages/BundleSize/components/search-modal.module.mjs.map +1 -0
- package/dist/pages/BundleSize/components/search-modal_module.css +39 -0
- package/dist/pages/BundleSize/components/search-modal_module.css.map +1 -0
- package/dist/pages/BundleSize/components/tree-graph.mjs +2 -2
- package/dist/pages/BundleSize/components/tree-graph.mjs.map +1 -1
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css +6 -2
- package/dist/pages/ModuleAnalyze/components/fileTreeCom.css.map +1 -1
- package/dist/pages/ModuleAnalyze/index.css +4 -6
- package/dist/pages/ModuleAnalyze/index.css.map +1 -1
- package/dist/pages/ModuleAnalyze/index.mjs +3 -4
- package/dist/pages/ModuleAnalyze/index.mjs.map +1 -1
- package/dist/pages/WebpackLoaders/Analysis/index.mjs +3 -3
- package/dist/pages/WebpackLoaders/Analysis/index.mjs.map +1 -1
- package/dist/pages/WebpackLoaders/Overall/index.mjs +1 -1
- package/dist/pages/WebpackLoaders/Overall/index.mjs.map +1 -1
- package/dist/static/image/rsdoctor-title-logo-dark.png +0 -0
- package/dist/utils/hooks.d.ts +1 -0
- package/dist/utils/hooks.mjs +6 -1
- package/dist/utils/hooks.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Charts/index.mjs","sources":["../../../src/components/Charts/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { SDK } from '@rsdoctor/types';\nimport { ISelectLoaderProps, LoaderCommonSelect } from '../Select';\nimport { ServerAPIProvider, withServerAPI } from '../Manifest';\nimport { LoaderExecutionsChart } from './loader';\nimport { filterLoader } from 'src/utils/loader';\nimport { Space } from 'antd';\n\nenum ChartDimension {\n Loader,\n Process,\n}\n\nexport const LoaderChartBase: React.FC<{\n project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;\n}> = ({ project }) => {\n const { root: cwd } = project;\n const [store, setStore] = useState({\n filename: '',\n loaders: [] as string[],\n layer: '',\n } as ISelectLoaderProps);\n // @ts-ignore\n const [dimension] = useState<ChartDimension>(ChartDimension.Loader);\n\n return (\n <Space direction=\"vertical\" style={{ width: '100%' }}>\n <ServerAPIProvider api={SDK.ServerAPI.API.GetLoaderNames}>\n {(loaderNames) => (\n <LoaderCommonSelect onChange={setStore} loaderNames={loaderNames} />\n )}\n </ServerAPIProvider>\n <ServerAPIProvider api={SDK.ServerAPI.API.GetLoaderChartData}>\n {(res) => {\n const loaders = res.filter((el) =>\n filterLoader(\n el.resource,\n el.loader,\n store.filename,\n store.loaders,\n el.layer,\n store?.layer,\n ),\n );\n return dimension === ChartDimension.Loader ? (\n <LoaderExecutionsChart loaders={loaders}
|
|
1
|
+
{"version":3,"file":"components/Charts/index.mjs","sources":["../../../src/components/Charts/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { SDK } from '@rsdoctor/types';\nimport { ISelectLoaderProps, LoaderCommonSelect } from '../Select';\nimport { ServerAPIProvider, withServerAPI } from '../Manifest';\nimport { LoaderExecutionsChart } from './loader';\nimport { filterLoader } from 'src/utils/loader';\nimport { Space } from 'antd';\nimport { useTheme } from 'src/utils';\n\nenum ChartDimension {\n Loader,\n Process,\n}\n\nexport const LoaderChartBase: React.FC<{\n project: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetProjectInfo>;\n}> = ({ project }) => {\n const { root: cwd } = project;\n const [store, setStore] = useState({\n filename: '',\n loaders: [] as string[],\n layer: '',\n } as ISelectLoaderProps);\n // @ts-ignore\n const [dimension] = useState<ChartDimension>(ChartDimension.Loader);\n\n const { theme } = useTheme();\n return (\n <Space direction=\"vertical\" style={{ width: '100%' }}>\n <ServerAPIProvider api={SDK.ServerAPI.API.GetLoaderNames}>\n {(loaderNames) => (\n <LoaderCommonSelect onChange={setStore} loaderNames={loaderNames} />\n )}\n </ServerAPIProvider>\n <ServerAPIProvider api={SDK.ServerAPI.API.GetLoaderChartData}>\n {(res) => {\n const loaders = res.filter((el) =>\n filterLoader(\n el.resource,\n el.loader,\n store.filename,\n store.loaders,\n el.layer,\n store?.layer,\n ),\n );\n return dimension === ChartDimension.Loader ? (\n <LoaderExecutionsChart\n // changing the theme breaks the chart. force rerender on every theme change.\n key={theme}\n loaders={loaders}\n cwd={cwd}\n />\n ) : (\n // <ProcessExecutionsChart loaders={loaders} cwd={cwd} pid={pid} />\n <></>\n );\n }}\n </ServerAPIProvider>\n </Space>\n );\n};\n\nexport const LoaderChart = withServerAPI({\n api: SDK.ServerAPI.API.GetProjectInfo,\n responsePropName: 'project',\n Component: LoaderChartBase,\n});\n"],"names":["LoaderChartBase","project","cwd","store","setStore","useState","dimension","theme","useTheme","Space","ServerAPIProvider","SDK","loaderNames","LoaderCommonSelect","res","loaders","el","filterLoader","LoaderExecutionsChart","LoaderChart","withServerAPI"],"mappings":";;;;;;;;;AAcO,MAAMA,kBAER,CAAC,EAAEC,OAAO,EAAE;IACf,MAAM,EAAE,MAAMC,GAAG,EAAE,GAAGD;IACtB,MAAM,CAACE,OAAOC,SAAS,GAAGC,SAAS;QACjC,UAAU;QACV,SAAS,EAAE;QACX,OAAO;IACT;IAEA,MAAM,CAACC,UAAU,GAAGD,SAAQA;IAE5B,MAAM,EAAEE,KAAK,EAAE,GAAGC;IAClB,OAAO,WAAP,GACE,KAACC,OAAKA;QAAC,WAAU;QAAW,OAAO;YAAE,OAAO;QAAO;;0BACjD,IAACC,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;0BACrD,CAACC,cAAAA,WAAAA,GACA,IAACC,oBAAkBA;wBAAC,UAAUT;wBAAU,aAAaQ;;;0BAGzD,IAACF,mBAAiBA;gBAAC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,kBAAkB;0BACzD,CAACG;oBACA,MAAMC,UAAUD,IAAI,MAAM,CAAC,CAACE,KAC1BC,aACED,GAAG,QAAQ,EACXA,GAAG,MAAM,EACTb,MAAM,QAAQ,EACdA,MAAM,OAAO,EACba,GAAG,KAAK,EACRb,OAAO;oBAGX,OAAOG,AAAc,MAAdA,YAAAA,WAAAA,GACL,IAACY,uBAAqBA;wBAGpB,SAASH;wBACT,KAAKb;uBAFAK,S,cAMP;gBAEJ;;;;AAIR;AAEO,MAAMY,cAAcC,cAAc;IACvC,KAAKT,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;IACrC,kBAAkB;IAClB,WAAWX;AACb"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.treemap-DOrYiA {
|
|
2
|
-
|
|
3
|
-
border: 2px solid #e8e8e8;
|
|
2
|
+
border: 2px solid var(--color-border-secondary);
|
|
4
3
|
flex-direction: row;
|
|
5
4
|
height: calc(100vh - 100px);
|
|
6
5
|
display: flex;
|
|
@@ -40,9 +39,9 @@
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.sidebar-Pww0Wm {
|
|
42
|
+
background-color: var(--color-bg-box-elevated);
|
|
43
|
+
border-right: 1px solid var(--color-border-secondary);
|
|
43
44
|
z-index: 10;
|
|
44
|
-
background-color: #f6f6f6;
|
|
45
|
-
border-right: 1px solid #e8e8e8;
|
|
46
45
|
flex-direction: column;
|
|
47
46
|
width: 300px;
|
|
48
47
|
min-width: 300px;
|
|
@@ -69,7 +68,6 @@
|
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
.sidebar-content-WuURH8 h4 {
|
|
72
|
-
color: #333;
|
|
73
71
|
margin: 0 0 10px;
|
|
74
72
|
font-size: 14px;
|
|
75
73
|
font-weight: bold;
|
|
@@ -77,6 +75,7 @@
|
|
|
77
75
|
|
|
78
76
|
.sidebar-toggle-NaGZQP {
|
|
79
77
|
z-index: 20;
|
|
78
|
+
color: #000;
|
|
80
79
|
cursor: pointer;
|
|
81
80
|
background: #fff;
|
|
82
81
|
border: 1px solid #ccc;
|
|
@@ -101,8 +100,10 @@
|
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
.chart-container-gPlZC7 {
|
|
103
|
+
flex-direction: column;
|
|
104
104
|
width: 100%;
|
|
105
105
|
height: 100%;
|
|
106
|
+
display: flex;
|
|
106
107
|
position: relative;
|
|
107
108
|
}
|
|
108
109
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/components/Charts/treemap.module.scss"],"names":[],"mappings":"AAAA;EACE
|
|
1
|
+
{"version":3,"sources":["webpack://./src/components/Charts/treemap.module.scss"],"names":[],"mappings":"AAAA;EACE,+CAA+C;EAC/C,mBAAmB;EACnB,2BAA2B;EAC3B,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAPqJ;EAUnJ,yBAAyB;EACzB,iBAAiB;EACjB,eAA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ChB,qBAAqB;EACrB,4BAA4B;AAC9B;;AArI8pD;EAwI5pD,qBAAqB;AACvB;;AAzI8sD;EA4I5sD,sBAAsB;EACtB,QAAQ;EACR,aAAa;AACf;;AA/IqwD;EAkJnwD,8BAA8B;EAC9B,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAtJ81D;EAyJ51D,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,gBAAgB;AAClB;;AA7J68D;EAgK38D,WAAW;EACX,mBAAmB;EACnB,gBAAgB;EAChB,eAAe;AACjB;;AApKohE;EAuKlhE,mBAAmB;AACrB;;AAxKmjE;EA2KjjE,8BAA8B;EAC9B,eAAe;EACf,eAAe;EACf,aAAa;AACf;;AA/KyoE;EAkLvoE,WAAW;EACX,kBAAkB;EAClB,iBAAiB;AACnB;;AArLssE;EAwLpsE,sBAAsB;EACtB,yBAAyB;EACzB,kBAAkB;EAClB,iBAAiB;EACjB,gBAAgB;EAChB,gBAAgB;AAClB;;AA9Lw0E;EAiMt0E,WAAW;EACX,yBAAyB;EACzB,gCAAgC;EAChC,iBAAiB;EACjB,eAAe;EACf,iBAAiB;AACnB;;AAvMo9E;EA0Ml9E,iBAAiB;EACjB,gBAAgB;AAClB;;AA5M0gF;EA+MxgF,WAAW;EACX,eAAe;EACf,qBAAqB;EACrB,gCAAgC;EAChC,iBAAiB;EACjB,eAAe;EACf,gCAAgC;AAClC;;AAtN6qF;EAyN3qF,yBAAyB;AAC3B;;AA1NguF;EA6N9tF,mBAAmB;AACrB;;AA9NkxF;EAiOhxF,WAAW;EACX,kBAAkB;EAClB,gBAAgB;EAChB,iBAAiB;EACjB,eAAe;AACjB;;AAtOq3F;EAyOn3F,kBAAkB;AACpB","sourcesContent":[".treemap{display:flex;flex-direction:row;height:calc(100vh - 100px);position:relative;overflow:hidden;border:2px solid var(--color-border-secondary)}.treemap :global .ant-checkbox-wrapper{font-weight:400;font-size:12px;user-select:none}.treemap:fullscreen,.treemap:-webkit-full-screen,.treemap:-moz-full-screen,.treemap:-ms-fullscreen{height:100vh;width:100vw;border:none}.sidebar{width:300px;min-width:300px;background-color:var(--color-bg-box-elevated);border-right:1px solid var(--color-border-secondary);display:flex;flex-direction:column;transition:transform .3s ease;z-index:10;height:100%;position:relative;overflow:visible}.sidebar.collapsed{transform:translateX(-100%);position:absolute;left:0}.sidebar-content{padding:15px;overflow-y:auto;flex:1;display:flex;flex-direction:column;gap:20px}.sidebar-content h4{margin:0 0 10px 0;font-size:14px;font-weight:bold}.sidebar-toggle{position:absolute;top:10px;right:10px;z-index:20;background:#fff;color:#000;border:1px solid #ccc;border-radius:4px;padding:5px;cursor:pointer;transition:right .3s ease}.sidebar-toggle.collapsed{right:-40px}.chart-wrapper{flex:1;position:relative;height:100%;width:100%;overflow:hidden}.chart-container{display:flex;flex-direction:column;position:relative;width:100%;height:100%}.fullscreen-button{position:absolute;top:10px;right:10px;z-index:100;background:hsla(0,0%,100%,.9);border:1px solid #d9d9d9;border-radius:4px;padding:8px 12px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;color:#333;box-shadow:0 2px 8px rgba(0,0,0,.15);transition:all .3s ease}.fullscreen-button:hover{background:#fff;border-color:#40a9ff;color:#40a9ff;box-shadow:0 4px 12px rgba(0,0,0,.2)}.fullscreen-button:active{transform:scale(0.95)}.chunk-list{display:flex;flex-direction:column;gap:6px}.chunk-item{display:flex;justify-content:space-between;align-items:center;font-size:12px}.chunk-item :global .ant-checkbox-wrapper{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.size-tag{color:#999;font-size:11px;margin-left:8px;white-space:nowrap}.search-box{margin-bottom:10px}.tooltip-row{font-size:12px;display:flex;justify-content:space-between;margin-top:4px}.tooltip-label{font-weight:bold;margin-right:10px;color:#333}.search-results{margin-top:10px;max-height:300px;overflow-y:auto;border:1px solid #e8e8e8;border-radius:4px;background-color:#fff}.search-results-header{padding:8px 12px;font-size:12px;font-weight:bold;color:#666;background-color:#f5f5f5;border-bottom:1px solid #e8e8e8}.search-results-list{max-height:250px;overflow-y:auto}.search-result-item{padding:8px 12px;font-size:12px;color:#333;cursor:pointer;border-bottom:1px solid #f0f0f0;word-break:break-all;transition:background-color .2s}.search-result-item:hover{background-color:#e6f7ff}.search-result-item:last-child{border-bottom:none}.search-results-empty{margin-top:10px;padding:8px 12px;font-size:12px;color:#999;text-align:center}.all-none-checkbox{margin-bottom:6px}"],"sourceRoot":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/components/FileTree/index.scss"],"names":[],"mappings":"AAAA;EACE,uBAAuB;EACvB,SAAS;AACX;;AAHiD;EAM/C,mBAAmB;EACnB,UAAU;EACV,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB,gBAAgB;EAChB,aAAa;AACf;;AAd6L;EAiB3L,qBAAqB;AACvB;;AAlByP;EAqBvP,
|
|
1
|
+
{"version":3,"sources":["webpack://./src/components/FileTree/index.scss"],"names":[],"mappings":"AAAA;EACE,uBAAuB;EACvB,SAAS;AACX;;AAHiD;EAM/C,mBAAmB;EACnB,UAAU;EACV,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB,gBAAgB;EAChB,aAAa;AACf;;AAd6L;EAiB3L,qBAAqB;AACvB;;AAlByP;EAqBvP,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;EACf,SAAS;EACT,cAAc;EACd,eAAe;EACf,gBAAgB;EAChB,qBAAqB;EACrB,qBAAqB;EACrB,kBAAkB;AACpB;;AA/B4d;EAkC1d,aAAa;AACf;;AAnC+gB;EAsC7gB,cAAc;AAChB;;AAvCwkB;EA0CtkB,cAAc;EACd,mBAAmB;AACrB;;AA5CivB;EA+C/uB,qBAAqB;EACrB,kBAAkB;AACpB;;AAjD80B;EAoD50B,qBAAqB;AACvB;;AArDo4B;EAwDl4B,sBAAsB;EACtB,SAAS;EACT,qBAAqB;AACvB;;AA3D09B;EA8Dx9B,WAAW;EACX,qBAAqB;AACvB;;AAhEiiC;EAmE/hC,yBAAyB;EACzB,oBAAoB;AACtB;;AArEgnC;EAwE9mC,wBAAwB;AAC1B;;AAzEyqC;EA4EvqC,gBAAgB;EAChB,cAAc;EACd,qBAAqB;AACvB","sourcesContent":[".rc-tree{margin:0;border:1px solid rgba(0,0,0,0)}.rc-tree .rc-tree-treenode{display:flex;align-items:center;margin:0;padding:0;line-height:24px;white-space:nowrap;list-style:none;outline:0}.rc-tree .rc-tree-treenode:hover{background:rgba(0,0,0,.04)}.rc-tree .rc-tree-treenode .rc-tree-node-content-wrapper{position:relative;display:inline-block;margin:0;padding:0 4px;font-size:14px;font-weight:400;box-sizing:border-box;text-decoration:none;vertical-align:top;cursor:pointer}.rc-tree .rc-tree-treenode-child-tree{display:none}.rc-tree .rc-tree-treenode-child-tree-open{display:block}.rc-tree .rc-tree-treenode-treenode-disabled>span:not(.rc-tree-switcher),.rc-tree .rc-tree-treenode>a,.rc-tree .rc-tree-treenode>a span{color:#767676;cursor:not-allowed}.rc-tree .rc-tree-treenode-treenode-selected{background:rgba(5,145,255,.3);border-radius:4px}.rc-tree .rc-tree-treenode-title{display:inline-block}.rc-tree .rc-tree-treenode-indent{display:inline-block;height:0;vertical-align:bottom}.rc-tree .rc-tree-treenode-indent-unit{display:inline-block;width:14px}.file-tree-switcher-arrow{transform:rotate(0deg);transition:transform .3s ease}.file-tree-switcher-arrow-expand{transform:rotate(90deg)}.file-icon{display:inline-block;padding:2px 0;margin-left:8px}"],"sourceRoot":""}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Space
|
|
3
|
+
import { Space } from "antd";
|
|
4
4
|
import { FileOutlined, FolderOpenTwoTone, FolderTwoTone, RightOutlined } from "@ant-design/icons";
|
|
5
5
|
import rc_tree from "rc-tree";
|
|
6
6
|
import css from "../../common/svg/files/css.mjs";
|
|
@@ -9,9 +9,8 @@ import files_image from "../../common/svg/files/image.mjs";
|
|
|
9
9
|
import js from "../../common/svg/files/js.mjs";
|
|
10
10
|
import unkown_file from "../../common/svg/files/unkown-file.mjs";
|
|
11
11
|
import "./index.css";
|
|
12
|
-
import { useTheme } from "../../utils/index.mjs";
|
|
12
|
+
import { useTheme, useThemeToken } from "../../utils/index.mjs";
|
|
13
13
|
import path from "path";
|
|
14
|
-
const { useToken: useToken } = theme;
|
|
15
14
|
function getFileType(filename) {
|
|
16
15
|
const extension = path.extname(filename).slice(1).toLowerCase();
|
|
17
16
|
switch(extension){
|
|
@@ -63,7 +62,7 @@ function getFileCom(filename) {
|
|
|
63
62
|
}
|
|
64
63
|
const FileTree = (props)=>{
|
|
65
64
|
const { isDark } = useTheme();
|
|
66
|
-
const
|
|
65
|
+
const token = useThemeToken();
|
|
67
66
|
const color = isDark ? token.colorWhite : token.colorText;
|
|
68
67
|
const style = {
|
|
69
68
|
fontSize: token.fontSize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/FileTree/index.mjs","sources":["../../../src/components/FileTree/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Space
|
|
1
|
+
{"version":3,"file":"components/FileTree/index.mjs","sources":["../../../src/components/FileTree/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Space } from 'antd';\nimport {\n FileOutlined,\n FolderOpenTwoTone,\n FolderTwoTone,\n RightOutlined,\n} from '@ant-design/icons';\nimport Tree, { TreeProps } from 'rc-tree';\nimport CSSIcon from 'src/common/svg/files/css.svg';\nimport HtmlIcon from 'src/common/svg/files/html.svg';\nimport IMGIcon from 'src/common/svg/files/image.svg';\nimport JSIcon from 'src/common/svg/files/js.svg';\nimport FileIcon from 'src/common/svg/files/unkown-file.svg';\n\nimport './index.sass';\nimport { useTheme, useThemeToken } from '../../utils';\nimport path from 'path';\n\nfunction getFileType(filename: string) {\n const extension = path.extname(filename).slice(1).toLowerCase();\n\n switch (extension) {\n case 'js':\n case 'jsx':\n case 'ts':\n case 'mjs':\n case 'cjs':\n case 'mts':\n case 'cts':\n return <JSIcon />;\n case 'tsx':\n return <FileIcon />;\n case 'css':\n case 'scss':\n case 'sass':\n case 'less':\n case 'styl':\n case 'stylus':\n return <CSSIcon />;\n case 'html':\n return <HtmlIcon />;\n case 'png':\n case 'jpg':\n case 'jpeg':\n case 'gif':\n case 'svg':\n case 'bmp':\n case 'webp':\n case 'ico':\n case 'apng':\n case 'avif':\n case 'tif':\n case 'tiff':\n case 'jfif':\n case 'pjpeg':\n case 'pjp':\n return <IMGIcon />;\n default:\n return <FileIcon />;\n }\n}\n\nexport function getFileCom(filename: string) {\n const fileIcon = getFileType(filename);\n return <div className=\"file-icon\">{fileIcon}</div>;\n}\n\nexport const FileTree: React.FC<Partial<TreeProps>> = (props) => {\n const { isDark } = useTheme();\n\n const token = useThemeToken();\n const color = isDark ? token.colorWhite : token.colorText;\n const style = { fontSize: token.fontSize };\n\n return (\n <Tree\n checkable={false}\n selectable={true}\n switcherIcon={({ data, expanded }) => {\n if (data?.children) {\n return (\n <Space style={{ color }}>\n <RightOutlined\n twoToneColor={color}\n className={`file-tree-switcher-arrow ${expanded ? 'file-tree-switcher-arrow-expand' : ''}`}\n style={style}\n />\n {expanded ? <FolderOpenTwoTone /> : <FolderTwoTone />}\n </Space>\n );\n }\n if (data?.key && typeof data.key === 'string') {\n return getFileCom(data.key);\n }\n return <FileOutlined />;\n }}\n expandAction=\"click\"\n {...props}\n />\n );\n};\n"],"names":["getFileType","filename","extension","path","JSIcon","FileIcon","CSSIcon","HtmlIcon","IMGIcon","getFileCom","fileIcon","FileTree","props","isDark","useTheme","token","useThemeToken","color","style","Tree","data","expanded","Space","RightOutlined","FolderOpenTwoTone","FolderTwoTone","FileOutlined"],"mappings":";;;;;;;;;;;;;AAmBA,SAASA,YAAYC,QAAgB;IACnC,MAAMC,YAAYC,KAAK,OAAO,CAACF,UAAU,KAAK,CAAC,GAAG,WAAW;IAE7D,OAAQC;QACN,KAAK;QACL,KAAK;QACL,KAAK;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A,KAAAA,WAAAA,GAAM,IAACC,eAAaA,CAAAA;;;YAIxD,IAAIL,MAAM,OAAO,AAAoB,YAApB,OAAOA,KAAK,GAAG,EAC9B,OAAOX,WAAWW,KAAK,GAAG;YAE5B,OAAO,WAAP,GAAO,IAACM,cAAYA,CAAAA;QACtB;QACA,cAAa;QACZ,GAAGd,KAAK;;AAGf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/components/Keyword/style.module.scss"],"names":[],"mappings":"AAAA;EACE,
|
|
1
|
+
{"version":3,"sources":["webpack://./src/components/Keyword/style.module.scss"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,gBAAgB;AAClB","sourcesContent":[".text{font-size:14px;font-weight:400}"],"sourceRoot":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TranslationOutlined } from "@ant-design/icons";
|
|
3
|
-
import { Col, Dropdown, Layout, Row } from "antd";
|
|
3
|
+
import { Col, Dropdown, Layout, Row, Switch } from "antd";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Language } from "../../constants.mjs";
|
|
5
|
+
import { Language, Theme } from "../../constants.mjs";
|
|
6
6
|
import { useI18n, useTheme } from "../../utils/index.mjs";
|
|
7
7
|
import { OverlayAlertsWithButton } from "../Alerts/index.mjs";
|
|
8
8
|
import { BuilderSelect } from "./builder-select.mjs";
|
|
@@ -10,11 +10,12 @@ import { Menus } from "./menus.mjs";
|
|
|
10
10
|
import { Client } from "@rsdoctor/types";
|
|
11
11
|
import { useNavigate } from "react-router-dom";
|
|
12
12
|
import header_module from "./header.module.mjs";
|
|
13
|
-
import
|
|
13
|
+
import rsdoctor_title_logo_dark from "./rsdoctor-title-logo-dark.mjs";
|
|
14
|
+
const logoLight = 'https://assets.rspack.rs/rsdoctor/rsdoctor-title-logo.png';
|
|
14
15
|
const Header = ({ enableRoutes })=>{
|
|
15
16
|
const { i18n } = useI18n();
|
|
16
17
|
const navigate = useNavigate();
|
|
17
|
-
const { isDark } = useTheme();
|
|
18
|
+
const { setTheme, isLight, isDark } = useTheme();
|
|
18
19
|
const languages = [
|
|
19
20
|
{
|
|
20
21
|
value: Language.Cn,
|
|
@@ -26,7 +27,7 @@ const Header = ({ enableRoutes })=>{
|
|
|
26
27
|
}
|
|
27
28
|
];
|
|
28
29
|
return /*#__PURE__*/ jsx(Layout.Header, {
|
|
29
|
-
className:
|
|
30
|
+
className: header_module.root,
|
|
30
31
|
children: /*#__PURE__*/ jsxs(Row, {
|
|
31
32
|
className: header_module.innerRoot,
|
|
32
33
|
children: [
|
|
@@ -38,7 +39,7 @@ const Header = ({ enableRoutes })=>{
|
|
|
38
39
|
/*#__PURE__*/ jsx("img", {
|
|
39
40
|
width: "1604",
|
|
40
41
|
height: "380",
|
|
41
|
-
src:
|
|
42
|
+
src: isLight ? logoLight : rsdoctor_title_logo_dark,
|
|
42
43
|
className: header_module.rsdoctorLogo,
|
|
43
44
|
alt: "logo",
|
|
44
45
|
onClick: ()=>{
|
|
@@ -63,6 +64,21 @@ const Header = ({ enableRoutes })=>{
|
|
|
63
64
|
/*#__PURE__*/ jsx(Col, {
|
|
64
65
|
children: /*#__PURE__*/ jsx(OverlayAlertsWithButton, {})
|
|
65
66
|
}),
|
|
67
|
+
/*#__PURE__*/ jsx(Col, {
|
|
68
|
+
children: /*#__PURE__*/ jsx(Switch, {
|
|
69
|
+
className: "header-switch",
|
|
70
|
+
checkedChildren: "\uD83C\uDF1B",
|
|
71
|
+
unCheckedChildren: "\uD83C\uDF1E",
|
|
72
|
+
checked: isDark,
|
|
73
|
+
onChange: (checked)=>{
|
|
74
|
+
setTheme(checked ? Theme.Dark : Theme.Light);
|
|
75
|
+
},
|
|
76
|
+
style: {
|
|
77
|
+
border: `1px solid ${isLight ? '#ddd' : '#fff'}`,
|
|
78
|
+
background: isLight ? '#eee' : '#141414'
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}),
|
|
66
82
|
/*#__PURE__*/ jsx(Col, {
|
|
67
83
|
children: /*#__PURE__*/ jsx(Dropdown, {
|
|
68
84
|
overlayStyle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Layout/header.mjs","sources":["../../../src/components/Layout/header.tsx"],"sourcesContent":["import { TranslationOutlined } from '@ant-design/icons';\nimport { Col, Dropdown, Layout, Row } from 'antd';\nimport React from 'react';\nimport { Language } from '../../constants';\nimport { useI18n, useTheme } from '../../utils';\nimport { OverlayAlertsWithButton } from '../Alerts';\nimport { BuilderSelect } from './builder-select';\nimport { Menus } from './menus';\nimport { Client } from '@rsdoctor/types';\nimport { useNavigate } from 'react-router-dom';\nimport styles from './header.module.scss';\nimport
|
|
1
|
+
{"version":3,"file":"components/Layout/header.mjs","sources":["../../../src/components/Layout/header.tsx"],"sourcesContent":["import { TranslationOutlined } from '@ant-design/icons';\nimport { Col, Dropdown, Layout, Row, Switch } from 'antd';\nimport React from 'react';\nimport { Language, Theme } from '../../constants';\nimport { useI18n, useTheme } from '../../utils';\nimport { OverlayAlertsWithButton } from '../Alerts';\nimport { BuilderSelect } from './builder-select';\nimport { Menus } from './menus';\nimport { Client } from '@rsdoctor/types';\nimport { useNavigate } from 'react-router-dom';\nimport styles from './header.module.scss';\nimport logoDark from './rsdoctor-title-logo-dark.png';\nconst logoLight = 'https://assets.rspack.rs/rsdoctor/rsdoctor-title-logo.png';\n\nexport interface HeaderProps {\n enableRoutes?: string[];\n}\n\nexport const Header: React.FC<HeaderProps> = ({ enableRoutes }) => {\n const { i18n } = useI18n();\n\n const navigate = useNavigate();\n const { setTheme, isLight, isDark } = useTheme();\n const languages = [\n { value: Language.Cn, label: '中文' },\n { value: Language.En, label: 'English' },\n ];\n\n return (\n <Layout.Header className={styles.root}>\n <Row className={styles.innerRoot}>\n <Col className={styles.leftCol}>\n <div className={styles.leftColInner}>\n <img\n width=\"1604\"\n height=\"380\"\n src={isLight ? logoLight : logoDark}\n className={styles.rsdoctorLogo}\n alt=\"logo\"\n onClick={() => {\n if (\n location.hash.includes(\n Client.RsdoctorClientRoutes.Uploader,\n ) &&\n location.pathname.includes('/preview')\n ) {\n location.href = 'http://rsdoctor.rs';\n } else {\n navigate(Client.RsdoctorClientRoutes.Home);\n }\n }}\n />\n <BuilderSelect />\n </div>\n </Col>\n <Menus\n key={enableRoutes ? JSON.stringify(enableRoutes) : 'default'}\n style={{ transition: 'none' }}\n />\n\n <Col className={styles.rightCol}>\n <Row className={styles.rightColInner}>\n <Col>\n <OverlayAlertsWithButton />\n </Col>\n\n <Col>\n <Switch\n className=\"header-switch\"\n checkedChildren=\"🌛\"\n unCheckedChildren=\"🌞\"\n checked={isDark}\n onChange={(checked) => {\n setTheme(checked ? Theme.Dark : Theme.Light);\n }}\n style={{\n border: `1px solid ${isLight ? '#ddd' : '#fff'}`,\n background: isLight ? '#eee' : '#141414',\n }}\n />\n </Col>\n <Col>\n <Dropdown\n overlayStyle={{ zIndex: 1000 }}\n menu={{\n items: languages.map((e) => ({\n label: e.label,\n key: e.value,\n onClick() {\n i18n.changeLanguage(e.value);\n },\n })),\n selectedKeys: [i18n.language],\n }}\n >\n <TranslationOutlined className={styles.translationsIcon} />\n </Dropdown>\n </Col>\n </Row>\n </Col>\n </Row>\n </Layout.Header>\n );\n};\n"],"names":["logoLight","Header","enableRoutes","i18n","useI18n","navigate","useNavigate","setTheme","isLight","isDark","useTheme","languages","Language","Layout","styles","Row","Col","logoDark","location","Client","BuilderSelect","Menus","JSON","OverlayAlertsWithButton","Switch","checked","Theme","Dropdown","e","TranslationOutlined"],"mappings":";;;;;;;;;;;;;AAYA,MAAMA,YAAY;AAMX,MAAMC,SAAgC,CAAC,EAAEC,YAAY,EAAE;IAC5D,MAAM,EAAEC,IAAI,EAAE,GAAGC;IAEjB,MAAMC,WAAWC;IACjB,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGC;IACtC,MAAMC,YAAY;QAChB;YAAE,OAA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,cAAc;wCAAE,QAAQ;oCAAK;oCAC7B,MAAM;wCACJ,OAAOhB,UAAU,GAAG,CAAC,CAACiB,IAAO;gDAC3B,OAAOA,EAAE,KAAK;gDACd,KAAKA,EAAE,KAAK;gDACZ;oDACEzB,KAAK,cAAc,CAACyB,EAAE,KAAK;gDAC7B;4CACF;wCACA,cAAc;4CAACzB,KAAK,QAAQ;yCAAC;oCAC/B;8CAEA,kBAAC0B,qBAAmBA;wCAAC,WAAWf,cAAAA,gBAAuB;;;;;;;;;;AAQvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Layout/header.module.mjs","sources":["../../../src/components/Layout/header.module.scss"],"sourcesContent":["// extracted by LIB_CSS_EXTRACT_LOADER\nimport \"./header_module.css\"\nexport default {\"root\":\"root-nAtwJx\",\"
|
|
1
|
+
{"version":3,"file":"components/Layout/header.module.mjs","sources":["../../../src/components/Layout/header.module.scss"],"sourcesContent":["// extracted by LIB_CSS_EXTRACT_LOADER\nimport \"./header_module.css\"\nexport default {\"root\":\"root-nAtwJx\",\"innerRoot\":\"innerRoot-b2vAK8\",\"leftCol\":\"leftCol-n3WyJ5\",\"leftColInner\":\"leftColInner-AB1JiD\",\"rightCol\":\"rightCol-jgHpb9\",\"rightColInner\":\"rightColInner-nINgMT\",\"rsdoctorLogo\":\"rsdoctorLogo-O30iKB\",\"translationsIcon\":\"translationsIcon-eK7oMQ\"};"],"names":[],"mappings":";AAEA,sBAAe;IAAC,MAAO;IAAc,WAAY;IAAmB,SAAU;IAAiB,cAAe;IAAsB,UAAW;IAAkB,eAAgB;IAAuB,cAAe;IAAsB,kBAAmB;AAAyB"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
.root-nAtwJx {
|
|
2
|
-
--bg-color: white;
|
|
3
2
|
--height: var(--layout-nav-height, 54px);
|
|
4
3
|
width: 100%;
|
|
5
4
|
height: var(--height);
|
|
6
5
|
padding: 0;
|
|
7
6
|
padding-inline: var(--spacing-base);
|
|
8
7
|
z-index: 999;
|
|
9
|
-
background-color: var(--bg-color);
|
|
10
8
|
transition: none;
|
|
11
9
|
position: fixed;
|
|
12
10
|
}
|
|
@@ -15,10 +13,6 @@
|
|
|
15
13
|
top: 1px !important;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
.rootDark-X_YzXd {
|
|
19
|
-
--bg-color: #141414;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
16
|
.innerRoot-b2vAK8 {
|
|
23
17
|
height: var(--height);
|
|
24
18
|
flex-wrap: nowrap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/components/Layout/header.module.scss"],"names":[],"mappings":"AAAA;EACE,
|
|
1
|
+
{"version":3,"sources":["webpack://./src/components/Layout/header.module.scss"],"names":[],"mappings":"AAAA;EACE,wCAAwC;EACxC,WAAW;EACX,qBAAqB;EACrB,UAAU;EACV,mCAAmC;EACnC,YAAY;EACZ,gBAAgB;EAChB,eAAe;AACjB;;AATuK;EAYrK,mBAAmB;AACrB;;AAb2N;EAgBzN,qBAAqB;EACrB,iBAAiB;EACjB,8BAA8B;EAC9B,mBAAmB;EACnB,aAAa;AACf;;AArB0U;EAwBxU,qBAAqB;EACrB,sCAAsC;AACxC;;AA1B8Y;EA6B5Y,8BAA8B;EAC9B,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAjCse;EAoCpe,OAAO;AACT;;AArCuf;EAwCrf,yBAAyB;EACzB,mBAAmB;EACnB,uCAAuC;EACvC,qBAAqB;EACrB,iBAAiB;EACjB,aAAa;AACf;;AA9C4oB;EAiD1oB,eAAe;EACf,WAAW;EACX,YAAY;AACd;;AApDgsB;EAuD9rB,WAAW;AACb;;AAxDguB;EA2D9tB,uBAAuB;EACvB,sBAAsB;EACtB,kBAAkB;EAClB,sBAAsB;EACtB,eAAe;EACf,yBAAyB;EACzB,iBAAiB;EACjB,WAAW;EACX,eAAe;EACf,mBAAmB;EACnB,qBAAqB;AACvB;;AAtEg7B;EAyE96B,yBAAyB;AAC3B;;AA1Ei+B;EA6E/9B,0BAA0B;AAC5B","sourcesContent":[".root{--height: var(--layout-nav-height, 54px);width:100%;height:var(--height);position:fixed;padding:0;padding-inline:var(--spacing-base);z-index:999;transition:none}.root :global .ant-switch-handle{top:1px !important}.innerRoot{display:flex;justify-content:space-between;align-items:center;flex-wrap:nowrap;height:var(--height)}.leftCol{height:var(--height);line-height:calc(var(--height) + 2px)}.leftColInner{display:flex;justify-content:space-between;align-items:center;height:100%}.rightCol{flex:1}.rightColInner{display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;column-gap:calc(var(--spacing-base)/3);height:var(--height)}.rsdoctorLogo{width:auto;height:30px;cursor:pointer}.rsdoctorLogo:active{opacity:.8}.translationsIcon{--color-active: #40a9ff;--color-hover: #1668dc;display:inline-block;font-size:20px;text-align:center;vertical-align:middle;cursor:pointer;width:30px;transition:all .3s ease;user-select:none}.translationsIcon:hover{color:var(--color-hover)}.translationsIcon:active{color:var(--color-active)}"],"sourceRoot":""}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext, useEffect, useState } from "react";
|
|
2
|
+
import { useContext, useEffect, useLayoutEffect, useState } from "react";
|
|
3
3
|
import { FloatButton, Layout } from "antd";
|
|
4
4
|
import { Language, MAIN_BG, Size } from "../../constants.mjs";
|
|
5
5
|
import { Header } from "./header.mjs";
|
|
6
|
-
import { getEnableRoutesFromUrlQuery, getFirstVisitFromStorage, getLanguage, setFirstVisitToStorage, useI18n, useLocale, useUrlQuery } from "../../utils/index.mjs";
|
|
6
|
+
import { getEnableRoutesFromUrlQuery, getFirstVisitFromStorage, getLanguage, setFirstVisitToStorage, useI18n, useLocale, useTheme, useThemeToken, useUrlQuery } from "../../utils/index.mjs";
|
|
7
7
|
import { Progress } from "./progress.mjs";
|
|
8
8
|
import { ConfigContext } from "../../config.mjs";
|
|
9
9
|
import { SDK } from "@rsdoctor/types";
|
|
@@ -20,6 +20,8 @@ const TitleUpdater = ({ name })=>{
|
|
|
20
20
|
return null;
|
|
21
21
|
};
|
|
22
22
|
const Layout_Layout = (props)=>{
|
|
23
|
+
const { isLight } = useTheme();
|
|
24
|
+
const themeToken = useThemeToken();
|
|
23
25
|
const locale = useLocale();
|
|
24
26
|
const { i18n } = useI18n();
|
|
25
27
|
const { children } = props;
|
|
@@ -46,11 +48,29 @@ const Layout_Layout = (props)=>{
|
|
|
46
48
|
]);
|
|
47
49
|
const ctx = useContext(ConfigContext);
|
|
48
50
|
const showHeader = !ctx.embedded;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
useLayoutEffect(()=>{
|
|
52
|
+
const $root = document.documentElement;
|
|
53
|
+
const globalCssVars = {
|
|
54
|
+
'--spacing-base': Size.BasePadding + 'px',
|
|
55
|
+
'--layout-nav-height': showHeader ? Size.NavBarHeight + 'px' : '0px',
|
|
56
|
+
'--color-bg-main': MAIN_BG,
|
|
57
|
+
'--color-bg-box': themeToken.colorBgContainer,
|
|
58
|
+
'--color-bg-box-elevated': themeToken.colorBgLayout,
|
|
59
|
+
'--color-border': themeToken.colorBorder,
|
|
60
|
+
'--color-border-secondary': themeToken.colorBorderSecondary,
|
|
61
|
+
'--color-divider': themeToken.colorBorder,
|
|
62
|
+
'--color-scrollbar': isLight ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255,255,255, 0.5)',
|
|
63
|
+
'--text-color': themeToken.colorText,
|
|
64
|
+
'--text-color-secondary': themeToken.colorTextSecondary,
|
|
65
|
+
'--border-radius': themeToken.borderRadius + 'px',
|
|
66
|
+
'--border-radius-lg': themeToken.borderRadiusLG + 'px'
|
|
67
|
+
};
|
|
68
|
+
for (const [name, value] of Object.entries(globalCssVars))$root.style.setProperty(name, value);
|
|
69
|
+
}, [
|
|
70
|
+
showHeader,
|
|
71
|
+
themeToken,
|
|
72
|
+
isLight
|
|
73
|
+
]);
|
|
54
74
|
return /*#__PURE__*/ jsx(ServerAPIProvider, {
|
|
55
75
|
api: SDK.ServerAPI.API.GetProjectInfo,
|
|
56
76
|
showSkeleton: false,
|
|
@@ -59,7 +79,6 @@ const Layout_Layout = (props)=>{
|
|
|
59
79
|
project
|
|
60
80
|
},
|
|
61
81
|
children: /*#__PURE__*/ jsxs(Layout, {
|
|
62
|
-
style: globalCssVars,
|
|
63
82
|
children: [
|
|
64
83
|
/*#__PURE__*/ jsx(TitleUpdater, {
|
|
65
84
|
name: project?.name
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Layout/index.mjs","sources":["../../../src/components/Layout/index.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"components/Layout/index.mjs","sources":["../../../src/components/Layout/index.tsx"],"sourcesContent":["import {\n PropsWithChildren,\n useContext,\n useEffect,\n useLayoutEffect,\n useState,\n} from 'react';\nimport { FloatButton, Layout as L } from 'antd';\nimport { Language, MAIN_BG, Size } from '../../constants';\nimport { Header } from './header';\nimport {\n useLocale,\n useI18n,\n getFirstVisitFromStorage,\n setFirstVisitToStorage,\n getLanguage,\n useUrlQuery,\n getEnableRoutesFromUrlQuery,\n useThemeToken,\n useTheme,\n} from '../../utils';\nimport { Progress } from './progress';\nimport { ConfigContext } from '../../config';\nimport { SDK } from '@rsdoctor/types';\nimport { ServerAPIProvider } from '../Manifest';\nimport { ProjectInfoContext } from './project-info-context';\nimport styles from './index.module.scss';\n\nexport interface LayoutProps {\n children: React.JSX.Element;\n}\n\nconst TitleUpdater: React.FC<{\n name?: string;\n}> = ({ name }) => {\n useEffect(() => {\n if (name) {\n document.title = `Rsdoctor - ${name}`;\n } else {\n document.title = 'Rsdoctor';\n }\n }, [name]);\n\n return null;\n};\n\nexport const Layout = (\n props: PropsWithChildren<LayoutProps>,\n): React.JSX.Element => {\n const { isLight } = useTheme();\n const themeToken = useThemeToken();\n const locale = useLocale();\n const { i18n } = useI18n();\n const { children } = props;\n const query = useUrlQuery();\n const [enableRoutes, setEnableRoutes] = useState<string[] | undefined>(\n () => getEnableRoutesFromUrlQuery() || undefined,\n );\n\n useEffect(() => {\n let currentLocale = locale;\n // Check if the user is visiting the site for the first time\n const visited = getFirstVisitFromStorage();\n if (!visited) {\n setFirstVisitToStorage('1');\n const targetLang = window.navigator.language.split('-')[0];\n const userLang = getLanguage(targetLang);\n\n if (Object.values(Language).includes(userLang)) {\n currentLocale = userLang;\n }\n }\n\n if (i18n.language !== currentLocale) {\n i18n.changeLanguage(currentLocale);\n }\n }, [locale]);\n\n // Listen for enableRoutes changes in URL query parameters\n useEffect(() => {\n const newEnableRoutes = getEnableRoutesFromUrlQuery();\n setEnableRoutes(newEnableRoutes || undefined);\n }, [query]);\n\n const ctx = useContext(ConfigContext);\n const showHeader = !ctx.embedded;\n\n useLayoutEffect(() => {\n const $root = document.documentElement;\n const globalCssVars = {\n '--spacing-base': Size.BasePadding + 'px',\n '--layout-nav-height': showHeader ? Size.NavBarHeight + 'px' : '0px',\n '--color-bg-main': MAIN_BG,\n '--color-bg-box': themeToken.colorBgContainer,\n '--color-bg-box-elevated': themeToken.colorBgLayout,\n '--color-border': themeToken.colorBorder,\n '--color-border-secondary': themeToken.colorBorderSecondary,\n '--color-divider': themeToken.colorBorder,\n '--color-scrollbar': isLight\n ? 'rgba(0, 0, 0, 0.5)'\n : 'rgba(255,255,255, 0.5)',\n '--text-color': themeToken.colorText,\n '--text-color-secondary': themeToken.colorTextSecondary,\n '--border-radius': themeToken.borderRadius + 'px',\n '--border-radius-lg': themeToken.borderRadiusLG + 'px',\n };\n for (const [name, value] of Object.entries(globalCssVars)) {\n $root.style.setProperty(name, value);\n }\n }, [showHeader, themeToken, isLight]);\n\n return (\n <ServerAPIProvider\n api={SDK.ServerAPI.API.GetProjectInfo}\n showSkeleton={false}\n >\n {(project) => (\n <ProjectInfoContext.Provider value={{ project }}>\n <L>\n <TitleUpdater name={project?.name} />\n {showHeader && <Header enableRoutes={enableRoutes} />}\n <Progress />\n <L.Content className={styles.content}>\n {children}\n <FloatButton.BackTop />\n </L.Content>\n </L>\n </ProjectInfoContext.Provider>\n )}\n </ServerAPIProvider>\n );\n};\n"],"names":["TitleUpdater","name","useEffect","document","Layout","props","isLight","useTheme","themeToken","useThemeToken","locale","useLocale","i18n","useI18n","children","query","useUrlQuery","enableRoutes","setEnableRoutes","useState","getEnableRoutesFromUrlQuery","undefined","currentLocale","visited","getFirstVisitFromStorage","setFirstVisitToStorage","targetLang","window","userLang","getLanguage","Object","Language","newEnableRoutes","ctx","useContext","ConfigContext","showHeader","useLayoutEffect","$root","globalCssVars","Size","MAIN_BG","value","ServerAPIProvider","SDK","project","ProjectInfoContext","L","Header","Progress","styles","FloatButton"],"mappings":";;;;;;;;;;;;AAgCA,MAAMA,eAED,CAAC,EAAEC,IAAI,EAAE;IACZC,UAAU;QACR,IAAID,MACFE,SAAS,KAAK,GAAG,CAAC,WAAW,EAAEF,MAAM;aAErCE,SAAS,KAAK,GAAG;IAErB,GAAG;QAACF;KAAK;IAET,OAAO;AACT;AAEO,MAAMG,gBAAS,CACpBC;IAEA,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAMC,aAAaC;IACnB,MAAMC,SAASC;IACf,MAAM,EAAEC,IAAI,EAAE,GAAGC;IACjB,MAAM,EAAEC,QAAQ,EAAE,GAAGT;IACrB,MAAMU,QAAQC;IACd,MAAM,CAACC,cAAcC,gBAAgB,GAAGC,SACtC,IAAMC,iCAAiCC;IAGzCnB,UAAU;QACR,IAAIoB,gBAAgBZ;QAEpB,MAAMa,UAAUC;QAChB,IAAI,CAACD,SAAS;YACZE,uBAAuB;YACvB,MAAMC,aAAaC,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC1D,MAAMC,WAAWC,YAAYH;YAE7B,IAAII,OAAO,MAAM,CAACC,UAAU,QAAQ,CAACH,WACnCN,gBAAgBM;QAEpB;QAEA,IAAIhB,KAAK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AAAA,OAAc;;gCACjCpC;8CACD,IAACqC,YAAY,OAAO;;;;;;;AAOlC"}
|
|
@@ -5,7 +5,7 @@ import { Menu } from "antd";
|
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
6
|
import { useLocation, useNavigate } from "react-router-dom";
|
|
7
7
|
import { Size } from "../../constants.mjs";
|
|
8
|
-
import { getEnableRoutesFromUrlQuery, hasBundle, hasCompile, useI18n } from "../../utils/index.mjs";
|
|
8
|
+
import { getEnableRoutesFromUrlQuery, hasBundle, hasCompile, useI18n, useTheme } from "../../utils/index.mjs";
|
|
9
9
|
import { withServerAPI } from "../Manifest/index.mjs";
|
|
10
10
|
import overall_active from "../../common/svg/navbar/overall-active.mjs";
|
|
11
11
|
import overall_inactive from "../../common/svg/navbar/overall-inactive.mjs";
|
|
@@ -103,8 +103,10 @@ const MenusBase = (props)=>{
|
|
|
103
103
|
navigate(BundleSize.route);
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
+
const { theme } = useTheme();
|
|
106
107
|
const MenuComponent = /*#__PURE__*/ jsx(Menu, {
|
|
107
108
|
items: items,
|
|
109
|
+
theme: theme,
|
|
108
110
|
mode: "horizontal",
|
|
109
111
|
onClick: (e)=>{
|
|
110
112
|
if (!e.keyPath.includes(BuilderSwitchName)) navigate(e.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/Layout/menus.mjs","sources":["../../../src/components/Layout/menus.tsx"],"sourcesContent":["import {\n BoxPlotFilled,\n MenuOutlined,\n FundFilled,\n ApiFilled,\n NodeIndexOutlined,\n} from '@ant-design/icons';\nimport { Manifest, SDK } from '@rsdoctor/types';\nimport { Menu, MenuProps } from 'antd';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { Size } from '../../constants';\nimport * as OverallConstants from '../../pages/Overall/constants';\nimport {\n useI18n,\n hasBundle,\n hasCompile,\n getEnableRoutesFromUrlQuery,\n} from '../../utils';\nimport { withServerAPI } from '../Manifest';\nimport OverallActive from 'src/common/svg/navbar/overall-active.svg';\nimport OverallInActive from 'src/common/svg/navbar/overall-inactive.svg';\nimport CompileAnalysisActive from 'src/common/svg/navbar/compile-analysis-active.svg';\nimport CompileAnalysisInActive from 'src/common/svg/navbar/compile-analysis-inactive.svg';\nimport BundleSizeActive from 'src/common/svg/navbar/bundle-size-active.svg';\nimport BundleSizeInActive from 'src/common/svg/navbar/bundle-size-inactive.svg';\nimport {\n BundleSize,\n LoaderFiles,\n PluginsAnalyze,\n ModuleResolve,\n LoaderTimeline,\n} from 'src/pages';\nimport { CompileName } from './constants';\n\nconst BuilderSwitchName = 'builder-switcher';\n\nconst defaultInActive = {\n overall: <OverallInActive />,\n webpack: <CompileAnalysisInActive />,\n bundle: <BundleSizeInActive />,\n};\nconst MenusBase: React.FC<{\n style?: React.CSSProperties;\n routes: Manifest.RsdoctorManifestClientRoutes[];\n}> = (props) => {\n const { t } = useI18n();\n const { pathname } = useLocation();\n const navigate = useNavigate();\n const [navIcon, setNavIcon] = useState(defaultInActive);\n const { routes: apiRoutes } = props;\n\n // Get enableRoutes from URL query as fallback\n const urlEnableRoutes = getEnableRoutesFromUrlQuery();\n const enableRoutes =\n apiRoutes && apiRoutes.length > 0\n ? apiRoutes\n : (urlEnableRoutes as Manifest.RsdoctorManifestClientRoutes[]) || [];\n\n useEffect(() => {\n if (pathname.includes('webpack')) {\n setNavIcon({\n ...defaultInActive,\n webpack: <CompileAnalysisActive />,\n });\n } else if (pathname.includes('overall') || pathname === '/') {\n setNavIcon({\n ...defaultInActive,\n overall: <OverallActive />,\n });\n } else if (pathname.includes('bundle')) {\n setNavIcon({\n ...defaultInActive,\n bundle: <BundleSizeActive />,\n });\n }\n }, [pathname]);\n\n const iconStyle: React.CSSProperties = {\n color: 'rgba(96, 102, 114)',\n };\n const items: MenuProps['items'] = [];\n\n if (enableRoutes.includes(Manifest.RsdoctorManifestClientRoutes.Overall)) {\n items.push({\n label: t(OverallConstants.name),\n key: OverallConstants.route,\n icon: navIcon.overall,\n children: [],\n onTitleClick(e) {\n navigate(e.key);\n },\n });\n }\n\n if (hasCompile(enableRoutes)) {\n items.push({\n label: t(CompileName),\n key: CompileName,\n icon: navIcon.webpack,\n children: [\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.WebpackLoaders,\n ) && {\n label: t(LoaderTimeline.name),\n key: LoaderTimeline.route,\n icon: <BoxPlotFilled style={iconStyle} />,\n },\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.WebpackLoaders,\n ) && {\n label: t(LoaderFiles.name),\n key: LoaderFiles.route,\n icon: <FundFilled style={iconStyle} />,\n },\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.ModuleResolve,\n ) && {\n label: t(ModuleResolve.name),\n key: ModuleResolve.route,\n icon: <NodeIndexOutlined style={iconStyle} />,\n },\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.WebpackPlugins,\n ) && {\n label: t(PluginsAnalyze.name),\n key: PluginsAnalyze.route,\n icon: <ApiFilled style={iconStyle} />,\n },\n ].filter((e) => Boolean(e)) as MenuProps['items'],\n });\n }\n\n if (hasBundle(enableRoutes)) {\n items.push({\n label: t(BundleSize.name),\n key: BundleSize.name,\n icon: navIcon.bundle,\n children: [],\n onTitleClick() {\n navigate(BundleSize.route);\n },\n });\n }\n\n const MenuComponent = (\n <Menu\n items={items}\n mode=\"horizontal\"\n key={enableRoutes.join('')}\n onClick={(e) => {\n if (!e.keyPath.includes(BuilderSwitchName)) {\n navigate(e.key);\n }\n }}\n disabledOverflow\n overflowedIndicator={<MenuOutlined />}\n style={{\n height: Size.NavBarHeight,\n lineHeight: `${Size.NavBarHeight}px`,\n minWidth: 0,\n justifyContent: 'flex-end',\n ...props.style,\n }}\n selectedKeys={[pathname === '/' ? OverallConstants.route : pathname]}\n />\n );\n\n return <div style={{ marginLeft: '30px' }}>{MenuComponent}</div>;\n};\n\nexport const Menus = withServerAPI({\n api: SDK.ServerAPI.API.GetClientRoutes,\n responsePropName: 'routes',\n Component: MenusBase,\n fallbackComponent: () => null,\n showSkeleton: false,\n});\n"],"names":["BuilderSwitchName","defaultInActive","OverallInActive","CompileAnalysisInActive","BundleSizeInActive","MenusBase","props","t","useI18n","pathname","useLocation","navigate","useNavigate","navIcon","setNavIcon","useState","apiRoutes","urlEnableRoutes","getEnableRoutesFromUrlQuery","enableRoutes","useEffect","CompileAnalysisActive","OverallActive","BundleSizeActive","iconStyle","items","Manifest","OverallConstants","e","hasCompile","CompileName","LoaderTimeline","BoxPlotFilled","LoaderFiles","FundFilled","ModuleResolve","NodeIndexOutlined","PluginsAnalyze","ApiFilled","Boolean","hasBundle","BundleSize","MenuComponent","Menu","MenuOutlined","Size","Menus","withServerAPI","SDK"],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"components/Layout/menus.mjs","sources":["../../../src/components/Layout/menus.tsx"],"sourcesContent":["import {\n BoxPlotFilled,\n MenuOutlined,\n FundFilled,\n ApiFilled,\n NodeIndexOutlined,\n} from '@ant-design/icons';\nimport { Manifest, SDK } from '@rsdoctor/types';\nimport { Menu, MenuProps } from 'antd';\nimport React, { useEffect, useState } from 'react';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { Size } from '../../constants';\nimport * as OverallConstants from '../../pages/Overall/constants';\nimport {\n useI18n,\n hasBundle,\n hasCompile,\n getEnableRoutesFromUrlQuery,\n useTheme,\n} from '../../utils';\nimport { withServerAPI } from '../Manifest';\nimport OverallActive from 'src/common/svg/navbar/overall-active.svg';\nimport OverallInActive from 'src/common/svg/navbar/overall-inactive.svg';\nimport CompileAnalysisActive from 'src/common/svg/navbar/compile-analysis-active.svg';\nimport CompileAnalysisInActive from 'src/common/svg/navbar/compile-analysis-inactive.svg';\nimport BundleSizeActive from 'src/common/svg/navbar/bundle-size-active.svg';\nimport BundleSizeInActive from 'src/common/svg/navbar/bundle-size-inactive.svg';\nimport {\n BundleSize,\n LoaderFiles,\n PluginsAnalyze,\n ModuleResolve,\n LoaderTimeline,\n} from 'src/pages';\nimport { CompileName } from './constants';\n\nconst BuilderSwitchName = 'builder-switcher';\n\nconst defaultInActive = {\n overall: <OverallInActive />,\n webpack: <CompileAnalysisInActive />,\n bundle: <BundleSizeInActive />,\n};\nconst MenusBase: React.FC<{\n style?: React.CSSProperties;\n routes: Manifest.RsdoctorManifestClientRoutes[];\n}> = (props) => {\n const { t } = useI18n();\n const { pathname } = useLocation();\n const navigate = useNavigate();\n const [navIcon, setNavIcon] = useState(defaultInActive);\n const { routes: apiRoutes } = props;\n\n // Get enableRoutes from URL query as fallback\n const urlEnableRoutes = getEnableRoutesFromUrlQuery();\n const enableRoutes =\n apiRoutes && apiRoutes.length > 0\n ? apiRoutes\n : (urlEnableRoutes as Manifest.RsdoctorManifestClientRoutes[]) || [];\n\n useEffect(() => {\n if (pathname.includes('webpack')) {\n setNavIcon({\n ...defaultInActive,\n webpack: <CompileAnalysisActive />,\n });\n } else if (pathname.includes('overall') || pathname === '/') {\n setNavIcon({\n ...defaultInActive,\n overall: <OverallActive />,\n });\n } else if (pathname.includes('bundle')) {\n setNavIcon({\n ...defaultInActive,\n bundle: <BundleSizeActive />,\n });\n }\n }, [pathname]);\n\n const iconStyle: React.CSSProperties = {\n color: 'rgba(96, 102, 114)',\n };\n const items: MenuProps['items'] = [];\n\n if (enableRoutes.includes(Manifest.RsdoctorManifestClientRoutes.Overall)) {\n items.push({\n label: t(OverallConstants.name),\n key: OverallConstants.route,\n icon: navIcon.overall,\n children: [],\n onTitleClick(e) {\n navigate(e.key);\n },\n });\n }\n\n if (hasCompile(enableRoutes)) {\n items.push({\n label: t(CompileName),\n key: CompileName,\n icon: navIcon.webpack,\n children: [\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.WebpackLoaders,\n ) && {\n label: t(LoaderTimeline.name),\n key: LoaderTimeline.route,\n icon: <BoxPlotFilled style={iconStyle} />,\n },\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.WebpackLoaders,\n ) && {\n label: t(LoaderFiles.name),\n key: LoaderFiles.route,\n icon: <FundFilled style={iconStyle} />,\n },\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.ModuleResolve,\n ) && {\n label: t(ModuleResolve.name),\n key: ModuleResolve.route,\n icon: <NodeIndexOutlined style={iconStyle} />,\n },\n enableRoutes.includes(\n Manifest.RsdoctorManifestClientRoutes.WebpackPlugins,\n ) && {\n label: t(PluginsAnalyze.name),\n key: PluginsAnalyze.route,\n icon: <ApiFilled style={iconStyle} />,\n },\n ].filter((e) => Boolean(e)) as MenuProps['items'],\n });\n }\n\n if (hasBundle(enableRoutes)) {\n items.push({\n label: t(BundleSize.name),\n key: BundleSize.name,\n icon: navIcon.bundle,\n children: [],\n onTitleClick() {\n navigate(BundleSize.route);\n },\n });\n }\n\n const { theme } = useTheme();\n const MenuComponent = (\n <Menu\n items={items}\n theme={theme}\n mode=\"horizontal\"\n key={enableRoutes.join('')}\n onClick={(e) => {\n if (!e.keyPath.includes(BuilderSwitchName)) {\n navigate(e.key);\n }\n }}\n disabledOverflow\n overflowedIndicator={<MenuOutlined />}\n style={{\n height: Size.NavBarHeight,\n lineHeight: `${Size.NavBarHeight}px`,\n minWidth: 0,\n justifyContent: 'flex-end',\n ...props.style,\n }}\n selectedKeys={[pathname === '/' ? OverallConstants.route : pathname]}\n />\n );\n\n return <div style={{ marginLeft: '30px' }}>{MenuComponent}</div>;\n};\n\nexport const Menus = withServerAPI({\n api: SDK.ServerAPI.API.GetClientRoutes,\n responsePropName: 'routes',\n Component: MenusBase,\n fallbackComponent: () => null,\n showSkeleton: false,\n});\n"],"names":["BuilderSwitchName","defaultInActive","OverallInActive","CompileAnalysisInActive","BundleSizeInActive","MenusBase","props","t","useI18n","pathname","useLocation","navigate","useNavigate","navIcon","setNavIcon","useState","apiRoutes","urlEnableRoutes","getEnableRoutesFromUrlQuery","enableRoutes","useEffect","CompileAnalysisActive","OverallActive","BundleSizeActive","iconStyle","items","Manifest","OverallConstants","e","hasCompile","CompileName","LoaderTimeline","BoxPlotFilled","LoaderFiles","FundFilled","ModuleResolve","NodeIndexOutlined","PluginsAnalyze","ApiFilled","Boolean","hasBundle","BundleSize","theme","useTheme","MenuComponent","Menu","MenuOutlined","Size","Menus","withServerAPI","SDK"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA,MAAMA,oBAAoB;AAE1B,MAAMC,kBAAkB;IACtB,SAAS,WAAT,GAAS,IAACC,kBAAeA,CAAAA;IACzB,SAAS,WAAT,GAAS,IAACC,2BAAuBA,CAAAA;IACjC,QAAQ,WAAR,GAAQ,IAACC,sBAAkBA,CAAAA;AAC7B;AACA,MAAMC,YAGD,CAACC;IACJ,MAAM,EAAEC,CAAC,EAAE,GAAGC;IACd,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IACrB,MAAMC,WAAWC;IACjB,MAAM,CAACC,SAASC,WAAW,GAAGC,SAASd;IACvC,MAAM,EAAE,QAAQe,SAAS,EAAE,GAAGV;IAG9B,MAAMW,kBAAkBC;IACxB,MAAMC,eACJH,aAAaA,UAAU,MAAM,GAAG,IAC5BA,YACCC,mBAA+D,EAAE;IAExEG,UAAU;QACR,IAAIX,SAAS,QAAQ,CAAC,YACpBK,WAAW;YACT,GAAGb,eAAe;YAClB,SAAS,WAAT,GAAS,IAACoB,yBAAqBA,CAAAA;QACjC;aACK,IAAIZ,SAAS,QAAQ,CAAC,cAAcA,AAAa,QAAbA,UACzCK,WAAW;YACT,GAAGb,eAAe;YAClB,SAAS,WAAT,GAAS,IAACqB,gBAAaA,CAAAA;QACzB;aACK,IAAIb,SAAS,QAAQ,CAAC,WAC3BK,WAAW;YACT,GAAGb,eAAe;YAClB,QAAQ,WAAR,GAAQ,IAACsB,oBAAgBA,CAAAA;QAC3B;IAEJ,GAAG;QAACd;KAAS;IAEb,MAAMe,YAAiC;QACrC,OAAO;IACT;IACA,MAAMC,QAA4B,EAAE;IAEpC,IAAIN,aAAa,QAAQ,C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,MAAM5B,QAAQ,MAAM;QACpB,UAAU,EAAE;QACZ;YACEF,SAAS8B,WAAW,KAAK;QAC3B;IACF;IAGF,MAAM,EAAEC,KAAK,EAAE,GAAGC;IAClB,MAAMC,gBAAgB,WAAhBA,GACJ,IAACC,MAAIA;QACH,OAAOpB;QACP,OAAOiB;QACP,MAAK;QAEL,SAAS,CAACd;YACR,IAAI,CAACA,EAAE,OAAO,CAAC,QAAQ,CAAC5B,oBACtBW,SAASiB,EAAE,GAAG;QAElB;QACA,kBAAgB;QAChB,mCAAqB,IAACkB,cAAYA,CAAAA;QAClC,OAAO;YACL,QAAQC,KAAK,YAAY;YACzB,YAAY,GAAGA,KAAK,YAAY,CAAC,EAAE,CAAC;YACpC,UAAU;YACV,gBAAgB;YAChB,GAAGzC,MAAM,KAAK;QAChB;QACA,cAAc;YAAc,QAAbG,WAAmBkB,wDAAAA,KAAsB,GAAGlB;SAAS;OAf/DU,aAAa,IAAI,CAAC;IAmB3B,OAAO,WAAP,GAAO,IAAC;QAAI,OAAO;YAAE,YAAY;QAAO;kBAAIyB;;AAC9C;AAEO,MAAMI,QAAQC,cAAc;IACjC,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,eAAe;IACtC,kBAAkB;IAClB,WAAW7C;IACX,mBAAmB,IAAM;IACzB,cAAc;AAChB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CloseCircleOutlined } from "@ant-design/icons";
|
|
3
3
|
import { SDK } from "@rsdoctor/types";
|
|
4
4
|
import { Card, Col, Divider, Drawer, List, Popover, Row, Space, Table, Tag, Tooltip, Typography } from "antd";
|
|
@@ -76,17 +76,17 @@ const LoaderFiles = (props)=>{
|
|
|
76
76
|
const key = `${file}_${e.loader}_${i}`;
|
|
77
77
|
if (i <= ADDITION_LOADER_NUMBER) return /*#__PURE__*/ jsx(Tooltip, {
|
|
78
78
|
title: e.path,
|
|
79
|
-
children: /*#__PURE__*/ jsxs(
|
|
80
|
-
className: style_module.textBox,
|
|
81
|
-
style: {
|
|
82
|
-
color: isError ? '#f50' : 'inherit'
|
|
83
|
-
},
|
|
79
|
+
children: /*#__PURE__*/ jsxs(Tag, {
|
|
84
80
|
onClick: (ev)=>{
|
|
85
81
|
ev.stopPropagation();
|
|
86
82
|
setResourcePath(file);
|
|
87
83
|
setLoaderIndex(i);
|
|
88
84
|
setDrawerVisible(true);
|
|
89
85
|
},
|
|
86
|
+
className: style_module.textBox,
|
|
87
|
+
style: {
|
|
88
|
+
color: isError ? '#f50' : 'inherit'
|
|
89
|
+
},
|
|
90
90
|
children: [
|
|
91
91
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
92
92
|
className: style_module.text,
|
|
@@ -104,7 +104,7 @@ const LoaderFiles = (props)=>{
|
|
|
104
104
|
})
|
|
105
105
|
}, key);
|
|
106
106
|
}),
|
|
107
|
-
additionalLoaders?.length
|
|
107
|
+
additionalLoaders?.length > 0 && /*#__PURE__*/ jsx(Popover, {
|
|
108
108
|
content: /*#__PURE__*/ jsx(List, {
|
|
109
109
|
dataSource: additionalLoaders,
|
|
110
110
|
renderItem: (e, i)=>{
|
|
@@ -117,17 +117,17 @@ const LoaderFiles = (props)=>{
|
|
|
117
117
|
style: {
|
|
118
118
|
paddingBottom: 5
|
|
119
119
|
},
|
|
120
|
-
children: /*#__PURE__*/ jsxs(
|
|
121
|
-
className: style_module.textBox,
|
|
122
|
-
style: {
|
|
123
|
-
color: isError ? '#f50' : 'inherit'
|
|
124
|
-
},
|
|
120
|
+
children: /*#__PURE__*/ jsxs(Tag, {
|
|
125
121
|
onClick: (ev)=>{
|
|
126
122
|
ev.stopPropagation();
|
|
127
123
|
setResourcePath(file);
|
|
128
124
|
setLoaderIndex(i);
|
|
129
125
|
setDrawerVisible(true);
|
|
130
126
|
},
|
|
127
|
+
className: style_module.textBox,
|
|
128
|
+
style: {
|
|
129
|
+
color: isError ? '#f50' : 'inherit'
|
|
130
|
+
},
|
|
131
131
|
children: [
|
|
132
132
|
/*#__PURE__*/ jsx(Typography.Text, {
|
|
133
133
|
className: style_module.text,
|
|
@@ -148,13 +148,13 @@ const LoaderFiles = (props)=>{
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
}),
|
|
151
|
-
children: /*#__PURE__*/ jsx(
|
|
151
|
+
children: /*#__PURE__*/ jsx(Tag, {
|
|
152
152
|
className: style_module.textBox,
|
|
153
153
|
children: /*#__PURE__*/ jsx(Typography.Text, {
|
|
154
154
|
children: "\xb7\xb7\xb7"
|
|
155
155
|
})
|
|
156
156
|
})
|
|
157
|
-
})
|
|
157
|
+
})
|
|
158
158
|
]
|
|
159
159
|
})
|
|
160
160
|
]
|
|
@@ -192,11 +192,10 @@ const LoaderFiles = (props)=>{
|
|
|
192
192
|
children: "Files"
|
|
193
193
|
}),
|
|
194
194
|
/*#__PURE__*/ jsxs(Typography.Text, {
|
|
195
|
+
type: "secondary",
|
|
195
196
|
style: {
|
|
196
197
|
fontSize: 12,
|
|
197
|
-
fontWeight: 400
|
|
198
|
-
color: '#1C1F2399',
|
|
199
|
-
opacity: 0.6
|
|
198
|
+
fontWeight: 400
|
|
200
199
|
},
|
|
201
200
|
children: [
|
|
202
201
|
"Total Files: ",
|