antd-img-crop 4.7.0 → 4.8.0
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/README.md +14 -2
- package/README.zh-CN.md +21 -2
- package/dist/antd-img-crop.d.ts +1 -1
- package/dist/antd-img-crop.esm.js +3 -3
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -61,9 +61,21 @@ const Demo = () => (
|
|
|
61
61
|
| onUploadFail | `function` | - | Call when upload failed |
|
|
62
62
|
| cropperProps | `object` | - | Props of [react-easy-crop] (\* [existing props] cannot be overridden) |
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
### `ConfigProvider` not work?
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Try to set `libraryDirectory`(`'es'` or `'lib'`) to `babel-plugin-import` config, see which one will work.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
module.exports = {
|
|
70
|
+
plugins: [
|
|
71
|
+
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }],
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## No style? (only `antd<=v4`)
|
|
77
|
+
|
|
78
|
+
If you use `antd<=v4` + `babel-plugin-import`, and no `Modal` or `Slider` were imported, please import these styles manually:
|
|
67
79
|
|
|
68
80
|
```js
|
|
69
81
|
import 'antd/es/modal/style';
|
package/README.zh-CN.md
CHANGED
|
@@ -61,9 +61,28 @@ const Demo = () => (
|
|
|
61
61
|
| onUploadFail | `function` | - | 上传失败时的回调 |
|
|
62
62
|
| cropperProps | `object` | - | [react-easy-crop] 的 props(\* [已有 props] 无法重写) |
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
### `ConfigProvider` 无效?
|
|
65
|
+
|
|
66
|
+
尝试设置 `libraryDirectory`(`'es'` 或 `'lib'`)到 `babel-plugin-import` 的配置项,看看哪个会生效。
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
module.exports = {
|
|
70
|
+
plugins: [
|
|
71
|
+
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }],
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 没有样式?(仅 `antd<=v4`)
|
|
77
|
+
|
|
78
|
+
若使用 `antd<=v4` + `babel-plugin-import`,且未引入 `Modal` 或 `Slider`,请手动引入这些样式:
|
|
65
79
|
|
|
66
|
-
|
|
80
|
+
```js
|
|
81
|
+
import 'antd/es/modal/style';
|
|
82
|
+
import 'antd/es/slider/style';
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 在 antd v5 之前
|
|
67
86
|
|
|
68
87
|
```js
|
|
69
88
|
import 'antd/es/modal/style';
|
package/dist/antd-img-crop.d.ts
CHANGED
|
@@ -14,11 +14,11 @@ import { __rest, __awaiter } from 'tslib';
|
|
|
14
14
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
15
15
|
import { forwardRef, useState, useRef, useCallback, useImperativeHandle, memo, useMemo } from 'react';
|
|
16
16
|
import { version } from 'antd';
|
|
17
|
-
import AntModal from 'antd/
|
|
18
|
-
import AntUpload from 'antd/
|
|
17
|
+
import AntModal from 'antd/es/modal';
|
|
18
|
+
import AntUpload from 'antd/es/upload';
|
|
19
19
|
import { compareVersions } from 'compare-versions';
|
|
20
20
|
import Cropper from 'react-easy-crop';
|
|
21
|
-
import AntSlider from 'antd/
|
|
21
|
+
import AntSlider from 'antd/es/slider';
|
|
22
22
|
|
|
23
23
|
const PREFIX = 'img-crop';
|
|
24
24
|
const INIT_ZOOM = 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-img-crop",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "An image cropper for Ant Design Upload",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -29,25 +29,26 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"compare-versions": "6.0.0-rc.1",
|
|
32
|
-
"react-easy-crop": "^4.7.
|
|
32
|
+
"react-easy-crop": "^4.7.4",
|
|
33
33
|
"tslib": "^2.5.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
36
37
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
37
|
-
"@trivago/prettier-plugin-sort-imports": "^4.1.
|
|
38
|
-
"@types/node": "^18.14.
|
|
38
|
+
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
|
39
|
+
"@types/node": "^18.14.6",
|
|
39
40
|
"@types/react": "^18.0.28",
|
|
40
41
|
"@types/react-dom": "^18.0.11",
|
|
41
42
|
"@types/rollup-plugin-less": "^1.1.2",
|
|
42
43
|
"@vitejs/plugin-react": "^3.1.0",
|
|
43
|
-
"antd": "^5.2.
|
|
44
|
-
"eslint": "^8.
|
|
44
|
+
"antd": "^5.2.3",
|
|
45
|
+
"eslint": "^8.35.0",
|
|
45
46
|
"eslint-config-prettier": "^8.6.0",
|
|
46
47
|
"eslint-config-react-app": "^7.0.1",
|
|
47
48
|
"prettier": "^2.8.4",
|
|
48
49
|
"react": "^18.2.0",
|
|
49
50
|
"react-dom": "^18.2.0",
|
|
50
|
-
"rollup": "3.
|
|
51
|
+
"rollup": "3.18.0",
|
|
51
52
|
"rollup-plugin-dts": "^5.2.0",
|
|
52
53
|
"rollup-plugin-less": "^1.1.3",
|
|
53
54
|
"typescript": "^4.9.5",
|