@rsdoctor/components 1.5.18 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +12 -8
- package/dist/components/Alerts/bundle-alert.mjs.map +1 -1
- package/dist/components/Alerts/bundle.mjs +3 -4
- 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.d.ts +1 -0
- package/dist/components/Card/size.mjs +29 -7
- package/dist/components/Card/size.mjs.map +1 -1
- package/dist/components/Card/size.module.mjs +1 -0
- package/dist/components/Card/size.module.mjs.map +1 -1
- package/dist/components/Card/size_module.css +5 -2
- package/dist/components/Card/size_module.css.map +1 -1
- package/dist/components/Charts/TimelineCharts/index.mjs +118 -94
- package/dist/components/Charts/TimelineCharts/index.mjs.map +1 -1
- package/dist/components/Charts/TreeMap.d.ts +2 -1
- package/dist/components/Charts/TreeMap.mjs +111 -126
- package/dist/components/Charts/TreeMap.mjs.map +1 -1
- package/dist/components/Charts/constants.d.ts +1 -0
- package/dist/components/Charts/constants.mjs +11 -1
- package/dist/components/Charts/constants.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/loader.css +1 -1
- package/dist/components/Charts/loader.css.map +1 -1
- package/dist/components/Charts/treeMapSize.d.ts +10 -0
- package/dist/components/Charts/treeMapSize.mjs +17 -0
- package/dist/components/Charts/treeMapSize.mjs.map +1 -0
- package/dist/components/Charts/treeMapSize.test.d.ts +1 -0
- package/dist/components/Charts/treeMapSize.test.mjs +44 -0
- package/dist/components/Charts/treeMapSize.test.mjs.map +1 -0
- 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 +38 -16
- package/dist/components/Layout/header.mjs.map +1 -1
- package/dist/components/Layout/header.module.mjs +5 -2
- package/dist/components/Layout/header.module.mjs.map +1 -1
- package/dist/components/Layout/header_module.css +69 -21
- package/dist/components/Layout/header_module.css.map +1 -1
- package/dist/components/Layout/index.mjs +34 -8
- package/dist/components/Layout/index.mjs.map +1 -1
- package/dist/components/Layout/menus.mjs +9 -6
- 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.d.ts +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 +13 -73
- package/dist/components/Overall/DataSummary_module.css.map +1 -1
- package/dist/components/Overall/bundle.mjs +2 -3
- package/dist/components/Overall/bundle.mjs.map +1 -1
- package/dist/components/Overall/bundle.module.mjs +1 -0
- package/dist/components/Overall/bundle.module.mjs.map +1 -1
- package/dist/components/Overall/bundle_module.css +12 -4
- package/dist/components/Overall/bundle_module.css.map +1 -1
- package/dist/components/Overall/list_module.css +18 -2
- package/dist/components/Overall/list_module.css.map +1 -1
- package/dist/components/Overall/overview_module.css +13 -6
- package/dist/components/Overall/overview_module.css.map +1 -1
- package/dist/components/Overall/project.mjs +1 -1
- package/dist/components/Overall/project.mjs.map +1 -1
- package/dist/components/Overall/project_module.css +8 -0
- package/dist/components/Overall/project_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 +9 -3
- 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 +4 -4
- 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/Overall/index.mjs +5 -13
- package/dist/pages/Overall/index.mjs.map +1 -1
- package/dist/pages/Overall/index.module.mjs +3 -0
- package/dist/pages/Overall/index.module.mjs.map +1 -1
- package/dist/pages/Overall/index_module.css +35 -2
- package/dist/pages/Overall/index_module.css.map +1 -1
- package/dist/pages/Overall/responsiveLayout.mjs +3 -3
- package/dist/pages/Overall/responsiveLayout.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/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;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO,WAAP,GAAO,IAACE,IAAMA,CAAAA;QAChB,KAAK;YACH,OAAO,WAAP,GAAO,IAACC,aAAQA,CAAAA;QAClB,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO,WAAP,GAAO,IAACC,KAAOA,CAAAA;QACjB,KAAK;YACH,OAAO,WAAP,GAAO,IAACC,MAAQA,CAAAA;QAClB,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO,WAAP,GAAO,IAACC,aAAOA,CAAAA;QACjB;YACE,OAAO,WAAP,GAAO,IAACH,aAAQA,CAAAA;IACpB;AACF;AAEO,SAASI,WAAWR,QAAgB;IACzC,MAAMS,WAAWV,YAAYC;IAC7B,OAAO,WAAP,GAAO,IAAC;QAAI,WAAU;kBAAaS;;AACrC;AAEO,MAAMC,WAAyC,CAACC;IACrD,MAAM,EAAEC,MAAM,EAAE,GAAGC;IAEnB,MAAMC,QAAQC;IACd,MAAMC,QAAQJ,SAASE,MAAM,UAAU,GAAGA,MAAM,SAAS;IACzD,MAAMG,QAAQ;QAAE,UAAUH,MAAM,QAAQ;IAAC;IAEzC,OAAO,WAAP,GACE,IAACI,SAAIA;QACH,WAAW;QACX,YAAY;QACZ,cAAc,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAE;YAC/B,IAAID,MAAM,UACR,OAAO,WAAP,GACE,KAACE,OAAKA;gBAAC,OAAO;oBAAEL;gBAAM;;kCACpB,IAACM,eAAaA;wBACZ,cAAcN;wBACd,WAAW,CAAC,yBAAyB,EAAEI,WAAW,oCAAoC,IAAI;wBAC1F,OAAOH;;oBAERG,WAAW,WAAXA,GAAW,IAACG,mBAAiBA,CAAAA,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,20 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TranslationOutlined } from "@ant-design/icons";
|
|
3
|
-
import {
|
|
3
|
+
import { Client } from "@rsdoctor/types";
|
|
4
|
+
import { Button, Col, Dropdown, Layout, Row, Switch } from "antd";
|
|
4
5
|
import "react";
|
|
5
|
-
import {
|
|
6
|
+
import { useNavigate } from "react-router-dom";
|
|
7
|
+
import { Language, Theme } from "../../constants.mjs";
|
|
6
8
|
import { useI18n, useTheme } from "../../utils/index.mjs";
|
|
7
9
|
import { OverlayAlertsWithButton } from "../Alerts/index.mjs";
|
|
8
10
|
import { BuilderSelect } from "./builder-select.mjs";
|
|
9
11
|
import { Menus } from "./menus.mjs";
|
|
10
|
-
import { Client } from "@rsdoctor/types";
|
|
11
|
-
import { useNavigate } from "react-router-dom";
|
|
12
12
|
import header_module from "./header.module.mjs";
|
|
13
|
-
|
|
13
|
+
const logoLight = 'https://assets.rspack.rs/rsdoctor/rsdoctor-title-logo.png';
|
|
14
|
+
const logoDark = 'https://assets.rspack.rs/rsdoctor/rsdoctor-logo-dark.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: [
|
|
@@ -35,16 +36,22 @@ const Header = ({ enableRoutes })=>{
|
|
|
35
36
|
children: /*#__PURE__*/ jsxs("div", {
|
|
36
37
|
className: header_module.leftColInner,
|
|
37
38
|
children: [
|
|
38
|
-
/*#__PURE__*/ jsx("
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
className: header_module.rsdoctorLogo,
|
|
43
|
-
alt: "logo",
|
|
39
|
+
/*#__PURE__*/ jsx("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
className: header_module.logoButton,
|
|
42
|
+
"aria-label": "Go to Rsdoctor home",
|
|
44
43
|
onClick: ()=>{
|
|
45
44
|
if (location.hash.includes(Client.RsdoctorClientRoutes.Uploader) && location.pathname.includes('/preview')) location.href = 'http://rsdoctor.rs';
|
|
46
45
|
else navigate(Client.RsdoctorClientRoutes.Home);
|
|
47
|
-
}
|
|
46
|
+
},
|
|
47
|
+
children: /*#__PURE__*/ jsx("img", {
|
|
48
|
+
width: "1604",
|
|
49
|
+
height: "380",
|
|
50
|
+
src: isLight ? logoLight : logoDark,
|
|
51
|
+
className: header_module.rsdoctorLogo,
|
|
52
|
+
alt: "Rsdoctor",
|
|
53
|
+
draggable: false
|
|
54
|
+
})
|
|
48
55
|
}),
|
|
49
56
|
/*#__PURE__*/ jsx(BuilderSelect, {})
|
|
50
57
|
]
|
|
@@ -63,6 +70,18 @@ const Header = ({ enableRoutes })=>{
|
|
|
63
70
|
/*#__PURE__*/ jsx(Col, {
|
|
64
71
|
children: /*#__PURE__*/ jsx(OverlayAlertsWithButton, {})
|
|
65
72
|
}),
|
|
73
|
+
/*#__PURE__*/ jsx(Col, {
|
|
74
|
+
children: /*#__PURE__*/ jsx(Switch, {
|
|
75
|
+
className: header_module.themeSwitch,
|
|
76
|
+
"aria-label": isDark ? 'Use light theme' : 'Use dark theme',
|
|
77
|
+
checkedChildren: "\uD83C\uDF1B",
|
|
78
|
+
unCheckedChildren: "\uD83C\uDF1E",
|
|
79
|
+
checked: isDark,
|
|
80
|
+
onChange: (checked)=>{
|
|
81
|
+
setTheme(checked ? Theme.Dark : Theme.Light);
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
66
85
|
/*#__PURE__*/ jsx(Col, {
|
|
67
86
|
children: /*#__PURE__*/ jsx(Dropdown, {
|
|
68
87
|
overlayStyle: {
|
|
@@ -80,8 +99,11 @@ const Header = ({ enableRoutes })=>{
|
|
|
80
99
|
i18n.language
|
|
81
100
|
]
|
|
82
101
|
},
|
|
83
|
-
children: /*#__PURE__*/ jsx(
|
|
84
|
-
|
|
102
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
103
|
+
type: "text",
|
|
104
|
+
className: header_module.utilityButton,
|
|
105
|
+
"aria-label": "Change language",
|
|
106
|
+
icon: /*#__PURE__*/ jsx(TranslationOutlined, {})
|
|
85
107
|
})
|
|
86
108
|
})
|
|
87
109
|
})
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"components/Layout/header.mjs","sources":["../../../src/components/Layout/header.tsx"],"sourcesContent":["import { TranslationOutlined } from '@ant-design/icons';\nimport { Client } from '@rsdoctor/types';\nimport { Button, Col, Dropdown, Layout, Row, Switch } from 'antd';\nimport React from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { Language, Theme } from '../../constants';\nimport { useI18n, useTheme } from '../../utils';\nimport { OverlayAlertsWithButton } from '../Alerts';\nimport { BuilderSelect } from './builder-select';\nimport { Menus } from './menus';\nimport styles from './header.module.scss';\n\nconst logoLight = 'https://assets.rspack.rs/rsdoctor/rsdoctor-title-logo.png';\nconst logoDark = 'https://assets.rspack.rs/rsdoctor/rsdoctor-logo-dark.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 <button\n type=\"button\"\n className={styles.logoButton}\n aria-label=\"Go to Rsdoctor home\"\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 <img\n width=\"1604\"\n height=\"380\"\n src={isLight ? logoLight : logoDark}\n className={styles.rsdoctorLogo}\n alt=\"Rsdoctor\"\n draggable={false}\n />\n </button>\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={styles.themeSwitch}\n aria-label={isDark ? 'Use light theme' : 'Use dark theme'}\n checkedChildren=\"🌛\"\n unCheckedChildren=\"🌞\"\n checked={isDark}\n onChange={(checked) => {\n setTheme(checked ? Theme.Dark : Theme.Light);\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 <Button\n type=\"text\"\n className={styles.utilityButton}\n aria-label=\"Change language\"\n icon={<TranslationOutlined />}\n />\n </Dropdown>\n </Col>\n </Row>\n </Col>\n </Row>\n </Layout.Header>\n );\n};\n"],"names":["logoLight","logoDark","Header","enableRoutes","i18n","useI18n","navigate","useNavigate","setTheme","isLight","isDark","useTheme","languages","Language","Layout","styles","Row","Col","location","Client","BuilderSelect","Menus","JSON","OverlayAlertsWithButton","Switch","checked","Theme","Dropdown","e","Button","TranslationOutlined"],"mappings":";;;;;;;;;;;;AAYA,MAAMA,YAAY;AAClB,MAAMC,WAAW;AAMV,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,OAAOC,SAAS,EAAE;YAAE,OAAO;QAAK;QAClC;YAAE,OAAOA,SAAS,EAAE;YAAE,OAAO;QAAU;KACxC;IAED,OAAO,WAAP,GACE,IAACC,OAAO,MAAM;QAAC,WAAWC,cAAAA,IAAW;kBACnC,mBAACC,KAAGA;YAAC,WAAWD,cAAAA,SAAgB;;8BAC9B,IAACE,KAAGA;oBAAC,WAAWF,cAAAA,OAAc;8BAC5B,mBAAC;wBAAI,WAAWA,cAAAA,YAAmB;;0CACjC,IAAC;gCACC,MAAK;gCACL,WAAWA,cAAAA,UAAiB;gCAC5B,cAAW;gCACX,SAAS;oCACP,IACEG,SAAS,IAAI,CAAC,QAAQ,CACpBC,OAAO,oBAAoB,CAAC,QAAQ,KAEtCD,SAAS,QAAQ,CAAC,QAAQ,CAAC,aAE3BA,SAAS,IAAI,GAAG;yCAEhBZ,SAASa,OAAO,oBAAoB,CAAC,IAAI;gCAE7C;0CAEA,kBAAC;oCACC,OAAM;oCACN,QAAO;oCACP,KAAKV,UAAUT,YAAYC;oCAC3B,WAAWc,cAAAA,YAAmB;oCAC9B,KAAI;oCACJ,WAAW;;;0CAGf,IAACK,eAAaA,CAAAA;;;;8BAGlB,IAACC,OAAKA;oBAEJ,OAAO;wBAAE,YAAY;oBAAO;mBADvBlB,eAAemB,KAAK,SAAS,CAACnB,gBAAgB;8BAIrD,IAACc,KAAGA;oBAAC,WAAWF,cAAAA,QAAe;8BAC7B,mBAACC,KAAGA;wBAAC,WAAWD,cAAAA,aAAoB;;0CAClC,IAACE,KAAGA;0CACF,kBAACM,yBAAuBA,CAAAA;;0CAG1B,IAACN,KAAGA;0CACF,kBAACO,QAAMA;oCACL,WAAWT,cAAAA,WAAkB;oCAC7B,cAAYL,SAAS,oBAAoB;oCACzC,iBAAgB;oCAChB,mBAAkB;oCAClB,SAASA;oCACT,UAAU,CAACe;wCACTjB,SAASiB,UAAUC,MAAM,IAAI,GAAGA,MAAM,KAAK;oCAC7C;;;0CAGJ,IAACT,KAAGA;0CACF,kBAACU,UAAQA;oCACP,cAAc;wCAAE,QAAQ;oCAAK;oCAC7B,MAAM;wCACJ,OAAOf,UAAU,GAAG,CAAC,CAACgB,IAAO;gDAC3B,OAAOA,EAAE,KAAK;gDACd,KAAKA,EAAE,KAAK;gDACZ;oDACExB,KAAK,cAAc,CAACwB,EAAE,KAAK;gDAC7B;4CACF;wCACA,cAAc;4CAACxB,KAAK,QAAQ;yCAAC;oCAC/B;8CAEA,kBAACyB,QAAMA;wCACL,MAAK;wCACL,WAAWd,cAAAA,aAAoB;wCAC/B,cAAW;wCACX,oBAAM,IAACe,qBAAmBA,CAAAA;;;;;;;;;;AAS5C"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import "./header_module.css";
|
|
2
2
|
const header_module = {
|
|
3
3
|
root: "root-nAtwJx",
|
|
4
|
-
rootDark: "rootDark-X_YzXd",
|
|
5
4
|
innerRoot: "innerRoot-b2vAK8",
|
|
6
5
|
leftCol: "leftCol-n3WyJ5",
|
|
7
6
|
leftColInner: "leftColInner-AB1JiD",
|
|
7
|
+
logoButton: "logoButton-TKslN_",
|
|
8
8
|
rightCol: "rightCol-jgHpb9",
|
|
9
9
|
rightColInner: "rightColInner-nINgMT",
|
|
10
10
|
rsdoctorLogo: "rsdoctorLogo-O30iKB",
|
|
11
|
-
|
|
11
|
+
menuContainer: "menuContainer-teTlDu",
|
|
12
|
+
primaryMenu: "primaryMenu-gMpDIg",
|
|
13
|
+
themeSwitch: "themeSwitch-qaSSKB",
|
|
14
|
+
utilityButton: "utilityButton-_PCcZS"
|
|
12
15
|
};
|
|
13
16
|
export default header_module;
|
|
14
17
|
|
|
@@ -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\",\"logoButton\":\"logoButton-TKslN_\",\"rightCol\":\"rightCol-jgHpb9\",\"rightColInner\":\"rightColInner-nINgMT\",\"rsdoctorLogo\":\"rsdoctorLogo-O30iKB\",\"menuContainer\":\"menuContainer-teTlDu\",\"primaryMenu\":\"primaryMenu-gMpDIg\",\"themeSwitch\":\"themeSwitch-qaSSKB\",\"utilityButton\":\"utilityButton-_PCcZS\"};"],"names":[],"mappings":";AAEA,sBAAe;IAAC,MAAO;IAAc,WAAY;IAAmB,SAAU;IAAiB,cAAe;IAAsB,YAAa;IAAoB,UAAW;IAAkB,eAAgB;IAAuB,cAAe;IAAsB,eAAgB;IAAuB,aAAc;IAAqB,aAAc;IAAqB,eAAgB;AAAsB"}
|
|
@@ -1,24 +1,20 @@
|
|
|
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
|
-
|
|
8
|
+
border-bottom: 1px solid var(--color-border-secondary);
|
|
10
9
|
transition: none;
|
|
11
10
|
position: fixed;
|
|
11
|
+
box-shadow: 0 8px 24px #00000014;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.root-nAtwJx .ant-switch-handle {
|
|
15
15
|
top: 1px !important;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.rootDark-X_YzXd {
|
|
19
|
-
--bg-color: #141414;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
.innerRoot-b2vAK8 {
|
|
23
19
|
height: var(--height);
|
|
24
20
|
flex-wrap: nowrap;
|
|
@@ -39,6 +35,21 @@
|
|
|
39
35
|
display: flex;
|
|
40
36
|
}
|
|
41
37
|
|
|
38
|
+
.logoButton-TKslN_ {
|
|
39
|
+
border-radius: var(--border-radius);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
background: none;
|
|
42
|
+
border: 0;
|
|
43
|
+
align-items: center;
|
|
44
|
+
padding: 0;
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.logoButton-TKslN_:focus-visible {
|
|
49
|
+
outline-offset: 4px;
|
|
50
|
+
outline: 2px solid #2f81f7;
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
.rightCol-jgHpb9 {
|
|
43
54
|
flex: 1;
|
|
44
55
|
}
|
|
@@ -53,35 +64,72 @@
|
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
.rsdoctorLogo-O30iKB {
|
|
56
|
-
|
|
67
|
+
object-fit: contain;
|
|
68
|
+
-webkit-user-select: none;
|
|
69
|
+
user-select: none;
|
|
57
70
|
width: auto;
|
|
58
|
-
height:
|
|
71
|
+
height: 28px;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
.rsdoctorLogo-O30iKB:active {
|
|
62
75
|
opacity: .8;
|
|
63
76
|
}
|
|
64
77
|
|
|
65
|
-
.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
.menuContainer-teTlDu {
|
|
79
|
+
align-self: stretch;
|
|
80
|
+
margin-left: 24px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.primaryMenu-gMpDIg {
|
|
84
|
+
background: none;
|
|
85
|
+
border-bottom: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:is(.primaryMenu-gMpDIg .ant-menu-item, .primaryMenu-gMpDIg .ant-menu-submenu) {
|
|
89
|
+
margin-block: 5px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.primaryMenu-gMpDIg .ant-menu-title-content {
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.themeSwitch-qaSSKB {
|
|
97
|
+
border: 1px solid var(--color-border);
|
|
98
|
+
background: var(--color-bg-box-elevated);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.themeSwitch-qaSSKB:focus-visible {
|
|
102
|
+
outline-offset: 2px;
|
|
103
|
+
outline: 2px solid #2f81f7;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.utilityButton-_PCcZS {
|
|
107
|
+
width: 32px;
|
|
108
|
+
height: 32px;
|
|
109
|
+
color: var(--text-color-secondary);
|
|
110
|
+
border-radius: var(--border-radius);
|
|
71
111
|
-webkit-user-select: none;
|
|
72
112
|
user-select: none;
|
|
73
|
-
|
|
113
|
+
justify-content: center;
|
|
114
|
+
align-items: center;
|
|
115
|
+
padding: 0;
|
|
74
116
|
font-size: 20px;
|
|
75
|
-
transition:
|
|
76
|
-
display: inline-
|
|
117
|
+
transition: color .2s, background-color .2s;
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.utilityButton-_PCcZS:hover {
|
|
122
|
+
color: var(--text-color);
|
|
123
|
+
background: var(--color-accent-subtle);
|
|
77
124
|
}
|
|
78
125
|
|
|
79
|
-
.
|
|
80
|
-
color:
|
|
126
|
+
.utilityButton-_PCcZS:active {
|
|
127
|
+
color: #5b8ff9;
|
|
81
128
|
}
|
|
82
129
|
|
|
83
|
-
.
|
|
84
|
-
|
|
130
|
+
.utilityButton-_PCcZS:focus-visible {
|
|
131
|
+
outline-offset: 2px;
|
|
132
|
+
outline: 2px solid #2f81f7;
|
|
85
133
|
}
|
|
86
134
|
|
|
87
135
|
|
|
@@ -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,sDAAsD;EACtD,gBAAgB;EAChB,eAAe;EACf,gCAAgC;AAClC;;AAXmQ;EAcjQ,mBAAmB;AACrB;;AAfuT;EAkBrT,qBAAqB;EACrB,iBAAiB;EACjB,8BAA8B;EAC9B,mBAAmB;EACnB,aAAa;AACf;;AAvBsa;EA0Bpa,qBAAqB;EACrB,sCAAsC;AACxC;;AA5B0e;EA+Bxe,8BAA8B;EAC9B,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAnCkkB;EAsChkB,mCAAmC;EACnC,eAAe;EACf,gBAAgB;EAChB,SAAS;EACT,mBAAmB;EACnB,UAAU;EACV,oBAAoB;AACtB;;AA7CmtB;EAgDjtB,mBAAmB;EACnB,0BAA0B;AAC5B;;AAlD0xB;EAqDxxB,OAAO;AACT;;AAtD2yB;EAyDzyB,yBAAyB;EACzB,mBAAmB;EACnB,uCAAuC;EACvC,qBAAqB;EACrB,iBAAiB;EACjB,aAAa;AACf;;AA/Dg8B;EAkE97B,mBAAmB;EACnB,yBAAyB;EACzB,iBAAiB;EACjB,WAAW;EACX,YAAY;AACd;;AAvEygC;EA0EvgC,WAAW;AACb;;AA3EyiC;EA8EviC,mBAAmB;EACnB,iBAAiB;AACnB;;AAhF4lC;EAmF1lC,gBAAgB;EAChB,gBAAgB;AAClB;;AArFkpC;EAwFhpC,iBAAiB;AACnB;;AAzFgvC;EA4F9uC,gBAAgB;AAClB;;AA7F8yC;EAgG5yC,qCAAqC;EACrC,wCAAwC;AAC1C;;AAlGw4C;EAqGt4C,mBAAmB;EACnB,0BAA0B;AAC5B;;AAvGg9C;EA0G98C,WAAW;EACX,YAAY;EACZ,kCAAkC;EAClC,mCAAmC;EACnC,yBAAyB;EACzB,iBAAiB;EACjB,uBAAuB;EACvB,mBAAmB;EACnB,UAAU;EACV,eAAe;EACf,2CAA2C;EAC3C,oBAAoB;AACtB;;AAtHutD;EAyHrtD,wBAAwB;EACxB,sCAAsC;AACxC;;AA3H0yD;EA8HxyD,cAAc;AAChB;;AA/H80D;EAkI50D,mBAAmB;EACnB,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;border-bottom:1px solid var(--color-border-secondary);box-shadow:0 8px 24px rgba(0,0,0,.08)}.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%}.logoButton{display:inline-flex;align-items:center;padding:0;border:0;background:rgba(0,0,0,0);border-radius:var(--border-radius);cursor:pointer}.logoButton:focus-visible{outline:2px solid #2f81f7;outline-offset:4px}.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:28px;object-fit:contain;user-select:none}.rsdoctorLogo:active{opacity:.8}.menuContainer{align-self:stretch;margin-left:24px}.primaryMenu{background:rgba(0,0,0,0);border-bottom:0}.primaryMenu :global(.ant-menu-item),.primaryMenu :global(.ant-menu-submenu){margin-block:5px}.primaryMenu :global(.ant-menu-title-content){font-weight:500}.themeSwitch{border:1px solid var(--color-border);background:var(--color-bg-box-elevated)}.themeSwitch:focus-visible{outline:2px solid #2f81f7;outline-offset:2px}.utilityButton{display:inline-flex;align-items:center;justify-content:center;font-size:20px;width:32px;height:32px;padding:0;color:var(--text-color-secondary);border-radius:var(--border-radius);transition:color .2s ease,background-color .2s ease;user-select:none}.utilityButton:hover{color:var(--text-color);background:var(--color-accent-subtle)}.utilityButton:active{color:#5b8ff9}.utilityButton:focus-visible{outline:2px solid #2f81f7;outline-offset:2px}"],"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,36 @@ 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': isLight ? MAIN_BG : themeToken.colorBgLayout,
|
|
57
|
+
'--color-bg-box': themeToken.colorBgContainer,
|
|
58
|
+
'--color-bg-box-elevated': isLight ? themeToken.colorBgLayout : themeToken.colorBgElevated,
|
|
59
|
+
'--color-bg-box-subtle': isLight ? themeToken.colorBgContainer : '#0d1218',
|
|
60
|
+
'--color-border': themeToken.colorBorder,
|
|
61
|
+
'--color-border-secondary': themeToken.colorBorderSecondary,
|
|
62
|
+
'--color-divider': themeToken.colorBorder,
|
|
63
|
+
'--color-scrollbar': isLight ? 'rgba(0, 0, 0, 0.5)' : 'rgba(255,255,255, 0.5)',
|
|
64
|
+
'--text-color': themeToken.colorText,
|
|
65
|
+
'--text-color-secondary': themeToken.colorTextSecondary,
|
|
66
|
+
'--text-color-muted': themeToken.colorTextTertiary,
|
|
67
|
+
'--color-accent-subtle': isLight ? '#e6f4ff' : 'rgba(47, 129, 247, 0.12)',
|
|
68
|
+
'--color-data-bundled': '#5b8ff9',
|
|
69
|
+
'--color-data-source': '#43c6d9',
|
|
70
|
+
'--color-data-gzip': '#f2b84b',
|
|
71
|
+
'--color-data-initial': '#43c6d9',
|
|
72
|
+
'--border-radius': themeToken.borderRadius + 'px',
|
|
73
|
+
'--border-radius-lg': themeToken.borderRadiusLG + 'px'
|
|
74
|
+
};
|
|
75
|
+
for (const [name, value] of Object.entries(globalCssVars))$root.style.setProperty(name, value);
|
|
76
|
+
}, [
|
|
77
|
+
showHeader,
|
|
78
|
+
themeToken,
|
|
79
|
+
isLight
|
|
80
|
+
]);
|
|
54
81
|
return /*#__PURE__*/ jsx(ServerAPIProvider, {
|
|
55
82
|
api: SDK.ServerAPI.API.GetProjectInfo,
|
|
56
83
|
showSkeleton: false,
|
|
@@ -59,7 +86,6 @@ const Layout_Layout = (props)=>{
|
|
|
59
86
|
project
|
|
60
87
|
},
|
|
61
88
|
children: /*#__PURE__*/ jsxs(Layout, {
|
|
62
|
-
style: globalCssVars,
|
|
63
89
|
children: [
|
|
64
90
|
/*#__PURE__*/ jsx(TitleUpdater, {
|
|
65
91
|
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': isLight ? MAIN_BG : themeToken.colorBgLayout,\n '--color-bg-box': themeToken.colorBgContainer,\n '--color-bg-box-elevated': isLight\n ? themeToken.colorBgLayout\n : themeToken.colorBgElevated,\n '--color-bg-box-subtle': isLight\n ? themeToken.colorBgContainer\n : '#0d1218',\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 '--text-color-muted': themeToken.colorTextTertiary,\n '--color-accent-subtle': isLight ? '#e6f4ff' : 'rgba(47, 129, 247, 0.12)',\n '--color-data-bundled': '#5b8ff9',\n '--color-data-source': '#43c6d9',\n '--color-data-gzip': '#f2b84b',\n '--color-data-initial': '#43c6d9',\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,QAAQ,KAAKU,eACpBV,KAAK,cAAc,CAACU;IAExB,GAAG;QAACZ;KAAO;IAGXR,UAAU;QACR,MAAM8B,kBAAkBZ;QACxBF,gBAAgBc,mBAAmBX;IACrC,GAAG;QAACN;KAAM;IAEV,MAAMkB,MAAMC,WAAWC;IACvB,MAAMC,aAAa,CAACH,IAAI,QAAQ;IAEhCI,gBAAgB;QACd,MAAMC,QAAQnC,SAAS,eAAe;QACtC,MAAMoC,gBAAgB;YACpB,kBAAkBC,KAAK,WAAW,GAAG;YACrC,uBAAuBJ,aAAaI,KAAK,YAAY,GAAG,OAAO;YAC/D,mBAAmBlC,UAAUmC,UAAUjC,WAAW,aAAa;YAC/D,kBAAkBA,WAAW,gBAAgB;YAC7C,2BAA2BF,UACvBE,WAAW,aAAa,GACxBA,WAAW,eAAe;YAC9B,yBAAyBF,UACrBE,WAAW,gBAAgB,GAC3B;YACJ,kBAAkBA,WAAW,WAAW;YACxC,4BAA4BA,WAAW,oBAAoB;YAC3D,mBAAmBA,WAAW,WAAW;YACzC,qBAAqBF,UACjB,uBACA;YACJ,gBAAgBE,WAAW,SAAS;YACpC,0BAA0BA,WAAW,kBAAkB;YACvD,sBAAsBA,WAAW,iBAAiB;YAClD,yBAAyBF,UAAU,YAAY;YAC/C,wBAAwB;YACxB,uBAAuB;YACvB,qBAAqB;YACrB,wBAAwB;YACxB,mBAAmBE,WAAW,YAAY,GAAG;YAC7C,sBAAsBA,WAAW,cAAc,GAAG;QACpD;QACA,KAAK,MAAM,CAACP,MAAMyC,MAAM,IAAIZ,OAAO,OAAO,CAACS,eACzCD,MAAM,KAAK,CAAC,WAAW,CAACrC,MAAMyC;IAElC,GAAG;QAACN;QAAY5B;QAAYF;KAAQ;IAEpC,OAAO,WAAP,GACE,IAACqC,mBAAiBA;QAChB,KAAKC,IAAI,SAAS,CAAC,GAAG,CAAC,cAAc;QACrC,cAAc;kBAEb,CAACC,UAAAA,WAAAA,GACA,IAACC,mBAAmB,QAAQ;gBAAC,OAAO;oBAAED;gBAAQ;0BAC5C,mBAACE,QAACA;;sCACA,IAAC/C,cAAYA;4BAAC,MAAM6C,SAAS;;wBAC5BT,cAAc,WAAdA,GAAc,IAACY,QAAMA;4BAAC,cAAc/B;;sCACrC,IAACgC,UAAQA,CAAAA;sCACT,KAACF,OAAAA,OAAS;4BAAC,WAAWG,aAAAA,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";
|
|
@@ -15,6 +15,7 @@ import bundle_size_active from "../../common/svg/navbar/bundle-size-active.mjs";
|
|
|
15
15
|
import bundle_size_inactive from "../../common/svg/navbar/bundle-size-inactive.mjs";
|
|
16
16
|
import { BundleSize, LoaderFiles, LoaderTimeline, ModuleResolve, PluginsAnalyze } from "../../pages/index.mjs";
|
|
17
17
|
import { CompileName } from "./constants.mjs";
|
|
18
|
+
import header_module from "./header.module.mjs";
|
|
18
19
|
import * as __rspack_external__pages_Overall_constants_mjs_39667e8e from "../../pages/Overall/constants.mjs";
|
|
19
20
|
const BuilderSwitchName = 'builder-switcher';
|
|
20
21
|
const defaultInActive = {
|
|
@@ -103,29 +104,31 @@ const MenusBase = (props)=>{
|
|
|
103
104
|
navigate(BundleSize.route);
|
|
104
105
|
}
|
|
105
106
|
});
|
|
107
|
+
const { theme } = useTheme();
|
|
106
108
|
const MenuComponent = /*#__PURE__*/ jsx(Menu, {
|
|
107
109
|
items: items,
|
|
110
|
+
theme: theme,
|
|
108
111
|
mode: "horizontal",
|
|
109
112
|
onClick: (e)=>{
|
|
110
113
|
if (!e.keyPath.includes(BuilderSwitchName)) navigate(e.key);
|
|
111
114
|
},
|
|
112
115
|
disabledOverflow: true,
|
|
113
116
|
overflowedIndicator: /*#__PURE__*/ jsx(MenuOutlined, {}),
|
|
117
|
+
className: header_module.primaryMenu,
|
|
114
118
|
style: {
|
|
115
119
|
height: Size.NavBarHeight,
|
|
116
120
|
lineHeight: `${Size.NavBarHeight}px`,
|
|
117
121
|
minWidth: 0,
|
|
118
|
-
justifyContent: 'flex-
|
|
122
|
+
justifyContent: 'flex-start',
|
|
119
123
|
...props.style
|
|
120
124
|
},
|
|
121
125
|
selectedKeys: [
|
|
122
126
|
'/' === pathname ? __rspack_external__pages_Overall_constants_mjs_39667e8e.route : pathname
|
|
123
127
|
]
|
|
124
128
|
}, enableRoutes.join(''));
|
|
125
|
-
return /*#__PURE__*/ jsx("
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
+
return /*#__PURE__*/ jsx("nav", {
|
|
130
|
+
className: header_module.menuContainer,
|
|
131
|
+
"aria-label": "Primary navigation",
|
|
129
132
|
children: MenuComponent
|
|
130
133
|
});
|
|
131
134
|
};
|
|
@@ -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-
|
|
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';\nimport styles from './header.module.scss';\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 className={styles.primaryMenu}\n style={{\n height: Size.NavBarHeight,\n lineHeight: `${Size.NavBarHeight}px`,\n minWidth: 0,\n justifyContent: 'flex-start',\n ...props.style,\n }}\n selectedKeys={[pathname === '/' ? OverallConstants.route : pathname]}\n />\n );\n\n return (\n <nav className={styles.menuContainer} aria-label=\"Primary navigation\">\n {MenuComponent}\n </nav>\n );\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","styles","Size","Menus","withServerAPI","SDK"],"mappings":"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"}
|