@umijs/plugins 4.6.58 → 4.6.59
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/antd.js +1 -0
- package/package.json +3 -3
- package/templates/antd/runtime.ts.tpl +8 -8
package/dist/antd.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/plugins",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.59",
|
|
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",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"styled-components": "6.1.1",
|
|
46
46
|
"tslib": "^2",
|
|
47
47
|
"warning": "^4.0.3",
|
|
48
|
-
"@umijs/bundler-utils": "4.6.
|
|
48
|
+
"@umijs/bundler-utils": "4.6.59",
|
|
49
49
|
"@umijs/valtio": "1.0.4"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"antd": "^4.24.1",
|
|
53
|
-
"umi": "4.6.
|
|
53
|
+
"umi": "4.6.59"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
@@ -30,9 +30,9 @@ import merge from '{{{lodashPath.merge}}}'
|
|
|
30
30
|
|
|
31
31
|
let cacheAntdConfig = null;
|
|
32
32
|
|
|
33
|
-
const getAntdConfig = () => {
|
|
33
|
+
const getAntdConfig = ({{#isUtooWin}}runtimePluginManager?: any{{/isUtooWin}}) => {
|
|
34
34
|
if(!cacheAntdConfig){
|
|
35
|
-
cacheAntdConfig = getPluginManager().applyPlugins({
|
|
35
|
+
cacheAntdConfig = {{#isUtooWin}}(runtimePluginManager || getPluginManager()){{/isUtooWin}}{{^isUtooWin}}getPluginManager(){{/isUtooWin}}.applyPlugins({
|
|
36
36
|
key: 'antd',
|
|
37
37
|
type: ApplyPluginsType.modify,
|
|
38
38
|
initialValue: {
|
|
@@ -53,14 +53,14 @@ const getAntdConfig = () => {
|
|
|
53
53
|
return cacheAntdConfig;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function AntdProvider({ children }) {
|
|
56
|
+
function AntdProvider({ children{{#isUtooWin}}, pluginManager{{/isUtooWin}} }) {
|
|
57
57
|
let container = children;
|
|
58
58
|
|
|
59
59
|
const [antdConfig, _setAntdConfig] = React.useState(() => {
|
|
60
60
|
const {
|
|
61
61
|
appConfig: _,
|
|
62
62
|
...finalConfigProvider
|
|
63
|
-
} = getAntdConfig();
|
|
63
|
+
} = getAntdConfig({{#isUtooWin}}pluginManager{{/isUtooWin}});
|
|
64
64
|
{{#enableModernThemeAlgorithm}}
|
|
65
65
|
finalConfigProvider.theme ??= {};
|
|
66
66
|
finalConfigProvider.theme.algorithm ??= [];
|
|
@@ -155,9 +155,9 @@ function AntdProvider({ children }) {
|
|
|
155
155
|
return container;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
export function rootContainer(children) {
|
|
158
|
+
export function rootContainer(children{{#isUtooWin}}, opts{{/isUtooWin}}) {
|
|
159
159
|
return (
|
|
160
|
-
<AntdProvider>
|
|
160
|
+
<AntdProvider{{#isUtooWin}} pluginManager={opts?.plugin}{{/isUtooWin}}>
|
|
161
161
|
{children}
|
|
162
162
|
</AntdProvider>
|
|
163
163
|
);
|
|
@@ -166,10 +166,10 @@ export function rootContainer(children) {
|
|
|
166
166
|
{{#appConfig}}
|
|
167
167
|
// The App component should be under ConfigProvider
|
|
168
168
|
// plugin-locale has other ConfigProvider
|
|
169
|
-
export function innerProvider(container: any) {
|
|
169
|
+
export function innerProvider(container: any{{#isUtooWin}}, opts: any{{/isUtooWin}}) {
|
|
170
170
|
const {
|
|
171
171
|
appConfig: finalAppConfig = {},
|
|
172
|
-
} = getAntdConfig();
|
|
172
|
+
} = getAntdConfig({{#isUtooWin}}opts?.plugin{{/isUtooWin}});
|
|
173
173
|
return <App {...finalAppConfig}>{container}</App>;
|
|
174
174
|
}
|
|
175
175
|
{{/appConfig}}
|