antd-img-crop 4.0.1 → 4.0.2

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 CHANGED
@@ -9,12 +9,6 @@ An image cropper for Ant Design [Upload](https://ant.design/components/upload/).
9
9
 
10
10
  English | [简体中文](./README.zh-CN.md)
11
11
 
12
- ---
13
-
14
- > 👉 Since 4.0, no need to manually import Modal & Slider style files.
15
- >
16
- > If having problem, Please read [No style, or ConfigProvider not work?](#no-style-or-configprovider-not-work)
17
-
18
12
  ## Demo
19
13
 
20
14
  [![Edit antd-img-crop](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/antd-img-crop-4qoom5p9x4?fontsize=14&hidenavigation=1&theme=dark)
@@ -63,9 +57,20 @@ const Demo = () => (
63
57
  | onUploadFail | `function` | - | Call when upload failed |
64
58
  | cropperProps | `object` | - | Props of [react-easy-crop] (\* [existing props] cannot be overridden) |
65
59
 
60
+ ## Styles
61
+
62
+ To prevent overwriting the custom styles to `antd`, `antd-img-crop` does not import the style files of components.
63
+
64
+ Therefore, if you configured `babel-plugin-import` and no `Modal` or `Slider` were used, please import the styles manually:
65
+
66
+ ```js
67
+ import 'antd/es/modal/style';
68
+ import 'antd/es/slider/style';
69
+ ```
70
+
66
71
  ## FAQ
67
72
 
68
- ### No style, or ConfigProvider not work?
73
+ ### ConfigProvider not work?
69
74
 
70
75
  If using `craco-antd`, please try to add `libraryDirectory: 'es'` to `craco.config.js`:
71
76
 
package/README.zh-CN.md CHANGED
@@ -9,12 +9,6 @@
9
9
 
10
10
  [English](./README.md) | 简体中文
11
11
 
12
- ---
13
-
14
- > 👉 4.0 版本起,无需再手动引入 Modal 和 Slider 样式文件。
15
- >
16
- > 如有问题,请查看 [没有样式,或 ConfigProvider 没有生效?](#没有样式或-configprovider-没有生效)
17
-
18
12
  ## 示例
19
13
 
20
14
  [![Edit antd-img-crop](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/antd-img-crop-4qoom5p9x4?fontsize=14&hidenavigation=1&theme=dark)
@@ -63,9 +57,20 @@ const Demo = () => (
63
57
  | onUploadFail | `function` | - | 上传失败时的回调 |
64
58
  | cropperProps | `object` | - | [react-easy-crop] 的 props(\* [已有 props] 无法重写) |
65
59
 
60
+ ## 样式
61
+
62
+ 为防止覆盖 `antd` 自定义样式,`antd-img-crop` 没有引入组件样式。
63
+
64
+ 因此,若项目配置了 `babel-plugin-import` 且未使用 `Modal` 或 `Slider`,请手动引入样式:
65
+
66
+ ```js
67
+ import 'antd/es/modal/style';
68
+ import 'antd/es/slider/style';
69
+ ```
70
+
66
71
  ## FAQ
67
72
 
68
- ### 没有样式,或 ConfigProvider 没有生效?
73
+ ### ConfigProvider 未生效?
69
74
 
70
75
  若使用 `craco-antd`,请在 `craco.config.js` 中添加 `libraryDirectory: 'es'`:
71
76
 
@@ -23,8 +23,6 @@ var Cropper = require('react-easy-crop');
23
23
  var LocaleReceiver = require('antd/lib/locale-provider/LocaleReceiver');
24
24
  var AntModal = require('antd/lib/modal');
25
25
  var AntSlider = require('antd/lib/slider');
26
- require('antd/lib/modal/style');
27
- require('antd/lib/slider/style');
28
26
 
29
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
30
28
 
@@ -19,8 +19,6 @@ import Cropper from 'react-easy-crop';
19
19
  import LocaleReceiver from 'antd/es/locale-provider/LocaleReceiver';
20
20
  import AntModal from 'antd/es/modal';
21
21
  import AntSlider from 'antd/es/slider';
22
- import 'antd/es/modal/style';
23
- import 'antd/es/slider/style';
24
22
 
25
23
  __$styleInject(".img-crop-modal .img-crop-container {\n position: relative;\n width: 100%;\n height: 40vh;\n}\n.img-crop-modal .img-crop-control {\n display: flex;\n align-items: center;\n width: 60%;\n margin-left: auto;\n margin-right: auto;\n}\n.img-crop-modal .img-crop-control:first-of-type {\n margin-top: 16px;\n}\n.img-crop-modal .img-crop-control:last-of-type {\n margin-bottom: -8px;\n}\n.img-crop-modal .img-crop-control button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 34px;\n height: 34px;\n padding: 0;\n font-style: normal;\n background: transparent;\n border: 0;\n outline: 0;\n cursor: pointer;\n}\n.img-crop-modal .img-crop-control button[disabled] {\n cursor: default;\n}\n.img-crop-modal .img-crop-control button + div:only-of-type {\n flex: 1;\n margin: 0 8px;\n}\n.img-crop-modal .img-crop-control-zoom button {\n font-size: 18px;\n}\n.img-crop-modal .img-crop-control-rotate button {\n font-size: 16px;\n}\n.img-crop-modal .img-crop-control-rotate button:first-of-type {\n transform: rotate(-20deg);\n}\n.img-crop-modal .img-crop-control-rotate button:last-of-type {\n transform: rotate(20deg);\n}\n");
26
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-img-crop",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "An image cropper for Ant Design Upload",
5
5
  "keywords": [
6
6
  "react",