@baic/yolk-cli 2.1.0-alpha.102 → 2.1.0-alpha.104
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/es/yolk.d.ts +5 -1
- package/es/yolk.js +1 -1
- package/lib/yolk.d.ts +5 -1
- package/lib/yolk.js +1 -1
- package/package.json +2 -2
- package/templates/umi-mobile/.umirc.ts.tpl +0 -1
- package/templates/umi-mobile/src/.umi/core/EmptyRoute.tsx +8 -0
- package/templates/umi-mobile/src/.umi/core/defineApp.ts +21 -0
- package/templates/umi-mobile/src/.umi/core/history.ts +70 -0
- package/templates/umi-mobile/src/.umi/core/historyIntelli.ts +132 -0
- package/templates/umi-mobile/src/.umi/core/plugin.ts +83 -0
- package/templates/umi-mobile/src/.umi/core/pluginConfig.d.ts +295 -0
- package/templates/umi-mobile/src/.umi/core/polyfill.ts +191 -0
- package/templates/umi-mobile/src/.umi/core/route.tsx +267 -0
- package/templates/umi-mobile/src/.umi/core/routeProps.js +3 -0
- package/templates/umi-mobile/src/.umi/core/routeProps.ts +4 -0
- package/templates/umi-mobile/src/.umi/core/terminal.ts +62 -0
- package/templates/umi-mobile/src/.umi/exports.ts +51 -0
- package/templates/umi-mobile/src/.umi/plugin-clickToComponent/runtime.tsx +19 -0
- package/templates/umi-mobile/src/.umi/plugin-errorBoundary/runtime.tsx +67 -0
- package/templates/umi-mobile/src/.umi/plugin-hd/runtime.tsx +57 -0
- package/templates/umi-mobile/src/.umi/testBrowser.tsx +91 -0
- package/templates/umi-mobile/src/.umi/tsconfig.json +29 -0
- package/templates/umi-mobile/src/.umi/typings.d.ts +138 -0
- package/templates/umi-mobile/src/.umi/umi.ts +76 -0
- package/templates/umi-mobile/src/app.tsx +2 -2
- package/templates/umi-mobile/src/pages/404.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/BarCode.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/Iconfont.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/Input.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/List/1.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/List/2.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/examples/List/3.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/examples/List/4.tsx +7 -8
- package/templates/umi-mobile/src/pages/demo/examples/Loading.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/1.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/2.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/3.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/NumberInput/4.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/PagingList/1.tsx +1 -2
- package/templates/umi-mobile/src/pages/demo/examples/QrCode.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/Required.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/TimerButton.tsx +0 -1
- package/templates/umi-mobile/src/pages/demo/examples/usePreload.tsx +1 -1
- package/templates/umi-mobile/src/pages/demo/index.tsx +8 -8
- package/templates/umi-mobile/src/pages/index.tsx +0 -2
- package/templates/umi-mobile-h5+app/.umirc.ts.tpl +0 -1
- package/templates/umi-mobile-native/.umirc.ts.tpl +0 -1
- package/templates/umi-web/.umirc.ts.tpl +0 -1
- package/templates/umi-web/src/pages/404.tsx +2 -3
- package/templates/umi-web/src/pages/demo/index.tsx +3 -2
- package/templates/umi-web/src/pages/index.tsx +0 -2
- package/templates/umi-web-screen/.umirc.ts.tpl +0 -1
- package/templates/umi-web-screen/src/components/resize-container/index.tsx +9 -8
- package/templates/umi-web-screen/src/pages/404.tsx +2 -3
- package/templates/umi-web-screen/src/pages/template/components/charts/demo-line/index.tsx +1 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// This file is generated by Umi automatically
|
|
2
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
3
|
+
type CSSModuleClasses = { readonly [key: string]: string };
|
|
4
|
+
declare module '*.css' {
|
|
5
|
+
const classes: CSSModuleClasses;
|
|
6
|
+
export default classes;
|
|
7
|
+
}
|
|
8
|
+
declare module '*.scss' {
|
|
9
|
+
const classes: CSSModuleClasses;
|
|
10
|
+
export default classes;
|
|
11
|
+
}
|
|
12
|
+
declare module '*.sass' {
|
|
13
|
+
const classes: CSSModuleClasses;
|
|
14
|
+
export default classes;
|
|
15
|
+
}
|
|
16
|
+
declare module '*.less' {
|
|
17
|
+
const classes: CSSModuleClasses;
|
|
18
|
+
export default classes;
|
|
19
|
+
}
|
|
20
|
+
declare module '*.styl' {
|
|
21
|
+
const classes: CSSModuleClasses;
|
|
22
|
+
export default classes;
|
|
23
|
+
}
|
|
24
|
+
declare module '*.stylus' {
|
|
25
|
+
const classes: CSSModuleClasses;
|
|
26
|
+
export default classes;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// images
|
|
30
|
+
declare module '*.jpg' {
|
|
31
|
+
const src: string;
|
|
32
|
+
export default src;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.jpeg' {
|
|
35
|
+
const src: string;
|
|
36
|
+
export default src;
|
|
37
|
+
}
|
|
38
|
+
declare module '*.png' {
|
|
39
|
+
const src: string;
|
|
40
|
+
export default src;
|
|
41
|
+
}
|
|
42
|
+
declare module '*.gif' {
|
|
43
|
+
const src: string;
|
|
44
|
+
export default src;
|
|
45
|
+
}
|
|
46
|
+
declare module '*.svg' {
|
|
47
|
+
import * as React from 'react';
|
|
48
|
+
export const ReactComponent: React.FunctionComponent<
|
|
49
|
+
React.SVGProps<SVGSVGElement> & { title?: string }
|
|
50
|
+
>;
|
|
51
|
+
|
|
52
|
+
const src: string;
|
|
53
|
+
export default src;
|
|
54
|
+
}
|
|
55
|
+
declare module '*.ico' {
|
|
56
|
+
const src: string;
|
|
57
|
+
export default src;
|
|
58
|
+
}
|
|
59
|
+
declare module '*.webp' {
|
|
60
|
+
const src: string;
|
|
61
|
+
export default src;
|
|
62
|
+
}
|
|
63
|
+
declare module '*.avif' {
|
|
64
|
+
const src: string;
|
|
65
|
+
export default src;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// media
|
|
69
|
+
declare module '*.mp4' {
|
|
70
|
+
const src: string;
|
|
71
|
+
export default src;
|
|
72
|
+
}
|
|
73
|
+
declare module '*.webm' {
|
|
74
|
+
const src: string;
|
|
75
|
+
export default src;
|
|
76
|
+
}
|
|
77
|
+
declare module '*.ogg' {
|
|
78
|
+
const src: string;
|
|
79
|
+
export default src;
|
|
80
|
+
}
|
|
81
|
+
declare module '*.mp3' {
|
|
82
|
+
const src: string;
|
|
83
|
+
export default src;
|
|
84
|
+
}
|
|
85
|
+
declare module '*.wav' {
|
|
86
|
+
const src: string;
|
|
87
|
+
export default src;
|
|
88
|
+
}
|
|
89
|
+
declare module '*.flac' {
|
|
90
|
+
const src: string;
|
|
91
|
+
export default src;
|
|
92
|
+
}
|
|
93
|
+
declare module '*.aac' {
|
|
94
|
+
const src: string;
|
|
95
|
+
export default src;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// fonts
|
|
99
|
+
declare module '*.woff' {
|
|
100
|
+
const src: string;
|
|
101
|
+
export default src;
|
|
102
|
+
}
|
|
103
|
+
declare module '*.woff2' {
|
|
104
|
+
const src: string;
|
|
105
|
+
export default src;
|
|
106
|
+
}
|
|
107
|
+
declare module '*.eot' {
|
|
108
|
+
const src: string;
|
|
109
|
+
export default src;
|
|
110
|
+
}
|
|
111
|
+
declare module '*.ttf' {
|
|
112
|
+
const src: string;
|
|
113
|
+
export default src;
|
|
114
|
+
}
|
|
115
|
+
declare module '*.otf' {
|
|
116
|
+
const src: string;
|
|
117
|
+
export default src;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// other
|
|
121
|
+
declare module '*.wasm' {
|
|
122
|
+
const initWasm: (
|
|
123
|
+
options: WebAssembly.Imports,
|
|
124
|
+
) => Promise<WebAssembly.Exports>;
|
|
125
|
+
export default initWasm;
|
|
126
|
+
}
|
|
127
|
+
declare module '*.webmanifest' {
|
|
128
|
+
const src: string;
|
|
129
|
+
export default src;
|
|
130
|
+
}
|
|
131
|
+
declare module '*.pdf' {
|
|
132
|
+
const src: string;
|
|
133
|
+
export default src;
|
|
134
|
+
}
|
|
135
|
+
declare module '*.txt' {
|
|
136
|
+
const src: string;
|
|
137
|
+
export default src;
|
|
138
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// This file is generated by Umi automatically
|
|
3
|
+
// DO NOT CHANGE IT MANUALLY!
|
|
4
|
+
import 'antd/dist/antd.less';
|
|
5
|
+
import { ApplyPluginsType } from 'umi';
|
|
6
|
+
import { createHistory } from './core/history';
|
|
7
|
+
import { createPluginManager } from './core/plugin';
|
|
8
|
+
import './core/polyfill';
|
|
9
|
+
import { getRoutes } from './core/route';
|
|
10
|
+
import { renderClient } from '/Users/baicheng/Desktop/git.zdhrsoft.com/agricultural-cow-trading-mobile/node_modules/.pnpm/@umijs+renderer-react@4.0.53_ef5jwxihqo6n7gxfmzogljlgcm/node_modules/@umijs/renderer-react';
|
|
11
|
+
import '/Users/baicheng/Desktop/git.zdhrsoft.com/agricultural-cow-trading-mobile/src/global.less';
|
|
12
|
+
|
|
13
|
+
const publicPath = '/';
|
|
14
|
+
const runtimePublicPath = false;
|
|
15
|
+
|
|
16
|
+
async function render() {
|
|
17
|
+
const pluginManager = createPluginManager();
|
|
18
|
+
const { routes, routeComponents } = await getRoutes(pluginManager);
|
|
19
|
+
|
|
20
|
+
// allow user to extend routes
|
|
21
|
+
await pluginManager.applyPlugins({
|
|
22
|
+
key: 'patchRoutes',
|
|
23
|
+
type: ApplyPluginsType.event,
|
|
24
|
+
args: {
|
|
25
|
+
routes,
|
|
26
|
+
routeComponents,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const contextOpts = pluginManager.applyPlugins({
|
|
31
|
+
key: 'modifyContextOpts',
|
|
32
|
+
type: ApplyPluginsType.modify,
|
|
33
|
+
initialValue: {},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const basename = contextOpts.basename || '/';
|
|
37
|
+
const historyType = contextOpts.historyType || 'hash';
|
|
38
|
+
|
|
39
|
+
const history = createHistory({
|
|
40
|
+
type: historyType,
|
|
41
|
+
basename,
|
|
42
|
+
...contextOpts.historyOpts,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return pluginManager.applyPlugins({
|
|
46
|
+
key: 'render',
|
|
47
|
+
type: ApplyPluginsType.compose,
|
|
48
|
+
initialValue() {
|
|
49
|
+
const context = {
|
|
50
|
+
routes,
|
|
51
|
+
routeComponents,
|
|
52
|
+
pluginManager,
|
|
53
|
+
rootElement:
|
|
54
|
+
contextOpts.rootElement || document.getElementById('yolk-app'),
|
|
55
|
+
publicPath,
|
|
56
|
+
runtimePublicPath,
|
|
57
|
+
history,
|
|
58
|
+
historyType,
|
|
59
|
+
basename,
|
|
60
|
+
callback: contextOpts.callback,
|
|
61
|
+
};
|
|
62
|
+
const modifiedContext = pluginManager.applyPlugins({
|
|
63
|
+
key: 'modifyClientRenderOpts',
|
|
64
|
+
type: ApplyPluginsType.modify,
|
|
65
|
+
initialValue: context,
|
|
66
|
+
});
|
|
67
|
+
return renderClient(modifiedContext);
|
|
68
|
+
},
|
|
69
|
+
})();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
render();
|
|
73
|
+
|
|
74
|
+
window.g_umi = {
|
|
75
|
+
version: '4.0.53',
|
|
76
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import '@baic/yolk-mobile/es/style/index.less';
|
|
2
|
+
|
|
1
3
|
import { Provider } from '@baic/yolk-mobile';
|
|
2
4
|
|
|
3
5
|
import request from '@/common/request';
|
|
4
6
|
|
|
5
|
-
import '@baic/yolk-mobile/es/style/index.less';
|
|
6
|
-
|
|
7
7
|
export function rootContainer(container: React.ReactNode) {
|
|
8
8
|
return (
|
|
9
9
|
<Provider
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback, useMemo } from 'react';
|
|
2
|
+
|
|
2
3
|
import { Image } from 'antd-mobile';
|
|
4
|
+
|
|
3
5
|
import { List, ListVirtualizedScrollEvent } from '@baic/yolk-mobile';
|
|
4
6
|
|
|
5
7
|
const rowCount = 100000;
|
|
@@ -14,13 +16,10 @@ const item = {
|
|
|
14
16
|
const mock = Array(rowCount).fill(item);
|
|
15
17
|
|
|
16
18
|
export default () => {
|
|
17
|
-
const onScrollHandler =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[],
|
|
22
|
-
);
|
|
23
|
-
const virtualizedMemo = React.useMemo(
|
|
19
|
+
const onScrollHandler = useCallback(async (e: ListVirtualizedScrollEvent) => {
|
|
20
|
+
console.log(e);
|
|
21
|
+
}, []);
|
|
22
|
+
const virtualizedMemo = useMemo(
|
|
24
23
|
() => ({
|
|
25
24
|
height: 500,
|
|
26
25
|
rowHeight: 60,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import _ from 'lodash';
|
|
4
2
|
|
|
5
|
-
import {
|
|
3
|
+
import type { FunctionComponent } from 'react';
|
|
4
|
+
import { createElement } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Collapse, Tabs } from 'antd-mobile';
|
|
6
7
|
|
|
7
8
|
import BarCode from './examples/BarCode';
|
|
8
9
|
import Iconfont from './examples/Iconfont';
|
|
@@ -27,7 +28,7 @@ const { Panel } = Collapse;
|
|
|
27
28
|
|
|
28
29
|
const tabs: Record<
|
|
29
30
|
string,
|
|
30
|
-
|
|
31
|
+
FunctionComponent | Record<string, FunctionComponent>
|
|
31
32
|
> = {
|
|
32
33
|
BarCode,
|
|
33
34
|
Iconfont,
|
|
@@ -58,7 +59,7 @@ export default () => {
|
|
|
58
59
|
if (_.isFunction(tab)) {
|
|
59
60
|
return (
|
|
60
61
|
<Tab key={key} title={key}>
|
|
61
|
-
{
|
|
62
|
+
{createElement(tab)}
|
|
62
63
|
</Tab>
|
|
63
64
|
);
|
|
64
65
|
}
|
|
@@ -71,7 +72,7 @@ export default () => {
|
|
|
71
72
|
const tab2 = tab[key2];
|
|
72
73
|
return (
|
|
73
74
|
<Panel key={key2} title={key2}>
|
|
74
|
-
{
|
|
75
|
+
{createElement(tab2)}
|
|
75
76
|
</Panel>
|
|
76
77
|
);
|
|
77
78
|
})}
|
|
@@ -79,9 +80,8 @@ export default () => {
|
|
|
79
80
|
</Tab>
|
|
80
81
|
);
|
|
81
82
|
}
|
|
83
|
+
return null;
|
|
82
84
|
})}
|
|
83
85
|
</Tabs>
|
|
84
86
|
);
|
|
85
87
|
};
|
|
86
|
-
|
|
87
|
-
// export default () => <PagingList_1 />;
|
|
@@ -103,7 +103,7 @@ export default () => {
|
|
|
103
103
|
const keys = Object.keys(tabs);
|
|
104
104
|
return (
|
|
105
105
|
<Tabs defaultActiveKey={keys[0]}>
|
|
106
|
-
{keys.map(key => {
|
|
106
|
+
{keys.map((key) => {
|
|
107
107
|
const tab = tabs[key];
|
|
108
108
|
if (_.isFunction(tab)) {
|
|
109
109
|
return (
|
|
@@ -117,7 +117,7 @@ export default () => {
|
|
|
117
117
|
return (
|
|
118
118
|
<TabPane key={key} tab={key}>
|
|
119
119
|
<Tabs defaultActiveKey={keys2[0]}>
|
|
120
|
-
{keys2.map(key2 => {
|
|
120
|
+
{keys2.map((key2) => {
|
|
121
121
|
const tab2 = tab[key2];
|
|
122
122
|
return (
|
|
123
123
|
<TabPane key={key2} tab={key2}>
|
|
@@ -129,6 +129,7 @@ export default () => {
|
|
|
129
129
|
</TabPane>
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
|
+
return null;
|
|
132
133
|
})}
|
|
133
134
|
</Tabs>
|
|
134
135
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import type { ReactNode, RefObject } from 'react';
|
|
5
|
+
import { forwardRef, useImperativeHandle, useMemo, useRef } from 'react';
|
|
5
6
|
|
|
6
7
|
import { useSize } from 'ahooks';
|
|
7
8
|
|
|
@@ -15,15 +16,15 @@ export type ContainerInstance = {
|
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
type ResizeContainerProps = {
|
|
18
|
-
children?:
|
|
19
|
+
children?: ReactNode | ((e: ContainerInstance) => ReactNode);
|
|
19
20
|
className?: string;
|
|
20
|
-
getContainer?: () => HTMLElement |
|
|
21
|
+
getContainer?: () => HTMLElement | RefObject<HTMLElement>;
|
|
21
22
|
onResize?: (e: ContainerInstance) => void;
|
|
22
23
|
containerParentElementZoom?: boolean | number;
|
|
23
24
|
containerZoom?: boolean | number;
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
const Component =
|
|
27
|
+
const Component = forwardRef<ContainerInstance, ResizeContainerProps>(
|
|
27
28
|
(
|
|
28
29
|
{
|
|
29
30
|
children,
|
|
@@ -35,13 +36,13 @@ const Component = React.forwardRef<ContainerInstance, ResizeContainerProps>(
|
|
|
35
36
|
},
|
|
36
37
|
ref,
|
|
37
38
|
) => {
|
|
38
|
-
const containerRef =
|
|
39
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
39
40
|
const { width = 0, height = 0 } = useSize(
|
|
40
41
|
_.isFunction(getContainer)
|
|
41
42
|
? getContainer()
|
|
42
43
|
: () => containerRef.current?.parentElement || null,
|
|
43
44
|
) || { width: 0, height: 0 };
|
|
44
|
-
const instance =
|
|
45
|
+
const instance = useMemo(() => {
|
|
45
46
|
let res = {
|
|
46
47
|
width,
|
|
47
48
|
height,
|
|
@@ -72,8 +73,8 @@ const Component = React.forwardRef<ContainerInstance, ResizeContainerProps>(
|
|
|
72
73
|
}
|
|
73
74
|
return res;
|
|
74
75
|
}, [width, height, onResize, containerParentElementZoom, containerZoom]);
|
|
75
|
-
|
|
76
|
-
const childrenMemo =
|
|
76
|
+
useImperativeHandle(ref, () => instance);
|
|
77
|
+
const childrenMemo = useMemo(() => {
|
|
77
78
|
const { width: containerWidth, height: containerHeight } = instance;
|
|
78
79
|
if (0 === containerWidth || 0 === containerHeight) {
|
|
79
80
|
return null;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import { Line } from '@ant-design/plots';
|
|
4
2
|
|
|
5
3
|
import { ResizeContainer } from '@/components';
|
|
@@ -8,6 +6,7 @@ const Component = () => (
|
|
|
8
6
|
<ResizeContainer>
|
|
9
7
|
{({ width, height }) => (
|
|
10
8
|
<Line
|
|
9
|
+
supportCSSTransform
|
|
11
10
|
width={width}
|
|
12
11
|
height={height}
|
|
13
12
|
xField="date"
|