@umijs/plugins 4.0.17 → 4.0.20

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 CHANGED
@@ -53,7 +53,11 @@ var layout_default = (api) => {
53
53
  },
54
54
  enableBy: api.EnableBy.config
55
55
  });
56
- const depList = ["@alipay/tech-ui", "@ant-design/pro-layout"];
56
+ const depList = [
57
+ "@alipay/tech-ui",
58
+ "@ant-design/pro-components",
59
+ "@ant-design/pro-layout"
60
+ ];
57
61
  const pkgHasDep = depList.find((dep) => {
58
62
  var _a, _b;
59
63
  const { pkg } = api;
@@ -70,7 +74,7 @@ var layout_default = (api) => {
70
74
  if (pkgHasDep && api.cwd !== cwd && (0, import_fs.existsSync)((0, import_path.join)(cwd, "node_modules", pkgHasDep, "package.json"))) {
71
75
  return (0, import_path.join)(cwd, "node_modules", pkgHasDep);
72
76
  }
73
- return (0, import_path.dirname)(require.resolve("@ant-design/pro-layout/package.json"));
77
+ return (0, import_path.dirname)(require.resolve("@ant-design/pro-components/package.json"));
74
78
  };
75
79
  const pkgPath = (0, import_plugin_utils.winPath)(getPkgPath());
76
80
  api.modifyAppData((memo) => {
@@ -83,7 +87,8 @@ var layout_default = (api) => {
83
87
  });
84
88
  api.modifyConfig((memo) => {
85
89
  if (!pkgHasDep) {
86
- memo.alias["@ant-design/pro-layout"] = pkgPath;
90
+ const name = require(`${pkgPath}/package.json`).name;
91
+ memo.alias[name] = pkgPath;
87
92
  }
88
93
  return memo;
89
94
  });
@@ -97,7 +102,7 @@ import type { IRoute } from 'umi';
97
102
  import React, { useMemo } from 'react';
98
103
  import {
99
104
  ProLayout,
100
- } from "${pkgPath || "@ant-design/pro-layout"}";
105
+ } from "${pkgPath || "@ant-design/pro-components"}";
101
106
  import './Layout.less';
102
107
  import Logo from './Logo';
103
108
  import Exception from './Exception';
@@ -210,6 +215,7 @@ const { formatMessage } = useIntl();
210
215
  }
211
216
  return defaultDom;
212
217
  }}
218
+ itemRender={(route) => <Link to={route.path}>{route.breadcrumbName}</Link>}
213
219
  disableContentMargin
214
220
  fixSiderbar
215
221
  fixedHeader
@@ -259,7 +265,7 @@ const { formatMessage } = useIntl();
259
265
  api.writeTmpFile({
260
266
  path: "types.d.ts",
261
267
  content: `
262
- import type { ProLayoutProps, HeaderProps } from "${pkgPath || "@ant-design/pro-layout"}";
268
+ import type { ProLayoutProps, HeaderProps } from "${pkgPath || "@ant-design/pro-components"}";
263
269
  ${hasInitialStatePlugin ? `import type InitialStateType from '@@/plugin-initialState/@@initialState';
264
270
  type InitDataType = ReturnType<typeof InitialStateType>;
265
271
  ` : "type InitDataType = any;"}
@@ -439,8 +445,7 @@ export function getRightRenderContent (opts: {
439
445
  path: "Layout.less",
440
446
  content: `
441
447
  ${antdVersion.startsWith("5") ? "" : "@import '~antd/es/style/themes/default.less';"}
442
- @pro-header-hover-bg: rgba(0, 0, 0, 0.025);
443
- @media screen and (max-width: @screen-xs) {
448
+ @media screen and (max-width: 480px) {
444
449
  // \u5728\u5C0F\u5C4F\u5E55\u7684\u65F6\u5019\u53EF\u4EE5\u6709\u66F4\u597D\u7684\u4F53\u9A8C
445
450
  .umi-plugin-layout-container {
446
451
  width: 100% !important;
@@ -471,14 +476,14 @@ ${antdVersion.startsWith("5") ? "" : "@import '~antd/es/style/themes/default.les
471
476
  cursor: pointer;
472
477
  transition: all 0.3s;
473
478
  > i {
474
- color: @text-color;
479
+ color: rgba(255, 255, 255, 0.85);
475
480
  vertical-align: middle;
476
481
  }
477
482
  &:hover {
478
- background: @pro-header-hover-bg;
483
+ background: rgba(0, 0, 0, 0.025);
479
484
  }
480
485
  &:global(.opened) {
481
- background: @pro-header-hover-bg;
486
+ background: rgba(0, 0, 0, 0.025);
482
487
  }
483
488
  }
484
489
  .umi-plugin-layout-search {
@@ -25,7 +25,7 @@ __export(slave_exports, {
25
25
  default: () => slave_default
26
26
  });
27
27
  module.exports = __toCommonJS(slave_exports);
28
- var import_http_proxy_middleware = require("@umijs/bundler-webpack/compiled/http-proxy-middleware");
28
+ var import_http_proxy_middleware = require("@umijs/bundler-utils/compiled/http-proxy-middleware");
29
29
  var import_utils = require("@umijs/utils");
30
30
  var import_assert = __toESM(require("assert"));
31
31
  var import_fs = require("fs");
@@ -39,7 +39,7 @@ var tailwindcss_default = (api) => {
39
39
  api.onBeforeCompiler(() => {
40
40
  const inputPath = (0, import_path.join)(api.cwd, "tailwind.css");
41
41
  const generatedPath = (0, import_path.join)(api.paths.absTmpPath, outputPath);
42
- const binPath = (0, import_path.join)(api.cwd, "node_modules/.bin/tailwind");
42
+ const binPath = getTailwindBinPath({ cwd: api.cwd });
43
43
  const configPath = (0, import_path.join)(process.env.APP_ROOT || api.cwd, "tailwind.config.js");
44
44
  return new Promise((resolve) => {
45
45
  tailwind = (0, import_plugin_utils.crossSpawn)(`${binPath}`, [
@@ -73,5 +73,12 @@ var tailwindcss_default = (api) => {
73
73
  return [{ source: generatedPath }];
74
74
  });
75
75
  };
76
+ function getTailwindBinPath(opts) {
77
+ const pkgPath = require.resolve("tailwindcss/package.json", {
78
+ paths: [opts.cwd]
79
+ });
80
+ const tailwindPath = require(pkgPath).bin["tailwind"];
81
+ return (0, import_path.join)((0, import_path.dirname)(pkgPath), tailwindPath);
82
+ }
76
83
  // Annotate the CommonJS export names for ESM import in node:
77
84
  0 && (module.exports = {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.17",
3
+ "version": "4.0.20",
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",
@@ -26,8 +26,8 @@
26
26
  "@ahooksjs/use-request": "^2.0.0",
27
27
  "@ant-design/antd-theme-variable": "^1.0.0",
28
28
  "@ant-design/icons": "^4.7.0",
29
- "@ant-design/pro-layout": "^7.0.1-beta.28",
30
- "@umijs/bundler-utils": "4.0.17",
29
+ "@ant-design/pro-components": "^2.0.1",
30
+ "@umijs/bundler-utils": "4.0.20",
31
31
  "antd-dayjs-webpack-plugin": "^1.0.6",
32
32
  "axios": "^0.27.2",
33
33
  "babel-plugin-import": "^1.13.5",
@@ -46,7 +46,7 @@
46
46
  "warning": "^4.0.3"
47
47
  },
48
48
  "devDependencies": {
49
- "umi": "4.0.17"
49
+ "umi": "4.0.20"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"