@umijs/plugins 4.0.0-canary.20230630.1 → 4.0.0-canary.20230724.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/layout.js +35 -35
- package/package.json +3 -3
package/dist/layout.js
CHANGED
|
@@ -64,6 +64,8 @@ var layout_default = (api) => {
|
|
|
64
64
|
antdVersion = require(`${pkgPath2}/package.json`).version;
|
|
65
65
|
} catch (e) {
|
|
66
66
|
}
|
|
67
|
+
const isAntd5 = antdVersion.startsWith("5");
|
|
68
|
+
const layoutFile = isAntd5 ? "Layout.css" : "Layout.less";
|
|
67
69
|
api.describe({
|
|
68
70
|
key: "layout",
|
|
69
71
|
config: {
|
|
@@ -130,7 +132,7 @@ import React, { useMemo } from 'react';
|
|
|
130
132
|
import {
|
|
131
133
|
ProLayout,
|
|
132
134
|
} from "${resolvedPkgPath}";
|
|
133
|
-
import '
|
|
135
|
+
import './${layoutFile}';
|
|
134
136
|
import Logo from './Logo';
|
|
135
137
|
import Exception from './Exception';
|
|
136
138
|
import { getRightRenderContent } from './rightRender';
|
|
@@ -517,12 +519,12 @@ export function getRightRenderContent (opts: {
|
|
|
517
519
|
})
|
|
518
520
|
});
|
|
519
521
|
api.writeTmpFile({
|
|
520
|
-
path:
|
|
522
|
+
path: layoutFile,
|
|
521
523
|
content: `
|
|
522
524
|
${// antd@5里面没有这个样式了
|
|
523
|
-
|
|
525
|
+
isAntd5 ? "" : "@import '~antd/es/style/themes/default.less';"}
|
|
524
526
|
@media screen and (max-width: 480px) {
|
|
525
|
-
|
|
527
|
+
/* 在小屏幕的时候可以有更好的体验 */
|
|
526
528
|
.umi-plugin-layout-container {
|
|
527
529
|
width: 100% !important;
|
|
528
530
|
}
|
|
@@ -530,13 +532,11 @@ ${// antd@5里面没有这个样式了
|
|
|
530
532
|
border-radius: 0 !important;
|
|
531
533
|
}
|
|
532
534
|
}
|
|
533
|
-
.umi-plugin-layout-menu {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
min-width: 160px;
|
|
539
|
-
}
|
|
535
|
+
.umi-plugin-layout-menu .anticon {
|
|
536
|
+
margin-right: 8px;
|
|
537
|
+
}
|
|
538
|
+
.umi-plugin-layout-menu .ant-dropdown-menu-item {
|
|
539
|
+
min-width: 160px;
|
|
540
540
|
}
|
|
541
541
|
.umi-plugin-layout-right {
|
|
542
542
|
display: flex !important;
|
|
@@ -544,30 +544,30 @@ ${// antd@5里面没有这个样式了
|
|
|
544
544
|
height: 100%;
|
|
545
545
|
margin-left: auto;
|
|
546
546
|
overflow: hidden;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
547
|
+
}
|
|
548
|
+
.umi-plugin-layout-right .umi-plugin-layout-action {
|
|
549
|
+
display: flex;
|
|
550
|
+
align-items: center;
|
|
551
|
+
height: 100%;
|
|
552
|
+
padding: 0 12px;
|
|
553
|
+
cursor: pointer;
|
|
554
|
+
transition: all 0.3s;
|
|
555
|
+
}
|
|
556
|
+
.umi-plugin-layout-right .umi-plugin-layout-action > i {
|
|
557
|
+
color: rgba(255, 255, 255, 0.85);
|
|
558
|
+
vertical-align: middle;
|
|
559
|
+
}
|
|
560
|
+
.umi-plugin-layout-right .umi-plugin-layout-action:hover {
|
|
561
|
+
background: rgba(0, 0, 0, 0.025);
|
|
562
|
+
}
|
|
563
|
+
.umi-plugin-layout-right .umi-plugin-layout-action.opened {
|
|
564
|
+
background: rgba(0, 0, 0, 0.025);
|
|
565
|
+
}
|
|
566
|
+
.umi-plugin-layout-right .umi-plugin-layout-search {
|
|
567
|
+
padding: 0 12px;
|
|
568
|
+
}
|
|
569
|
+
.umi-plugin-layout-right .umi-plugin-layout-search:hover {
|
|
570
|
+
background: transparent;
|
|
571
571
|
}
|
|
572
572
|
.umi-plugin-layout-name {
|
|
573
573
|
margin-left: 8px;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20230724.1",
|
|
4
4
|
"description": "@umijs/plugins",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"styled-components": "6.0.0-rc.0",
|
|
45
45
|
"tslib": "^2",
|
|
46
46
|
"warning": "^4.0.3",
|
|
47
|
-
"@umijs/bundler-utils": "4.0.0-canary.
|
|
47
|
+
"@umijs/bundler-utils": "4.0.0-canary.20230724.1",
|
|
48
48
|
"@umijs/valtio": "1.0.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"antd": "^4.24.1",
|
|
52
|
-
"umi": "4.0.0-canary.
|
|
52
|
+
"umi": "4.0.0-canary.20230724.1"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|