antd-img-crop 4.16.0 → 4.17.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.
@@ -179,15 +179,16 @@ const ImgCrop = react.forwardRef((props, cropperRef) => {
179
179
  const onCancel = react.useRef();
180
180
  const onOk = react.useRef();
181
181
  const runRawBeforeUpload = react.useCallback((beforeUpload, file, pass, fail) => tslib.__awaiter(void 0, void 0, void 0, function* () {
182
+ const rawFile = file;
182
183
  if (typeof beforeUpload !== 'function') {
183
- pass(file);
184
+ pass(rawFile);
184
185
  return;
185
186
  }
186
187
  try {
187
188
  // https://ant.design/components/upload-cn#api
188
189
  // https://github.com/ant-design/ant-design/blob/master/components/upload/Upload.tsx#L152-L178
189
190
  const result = yield beforeUpload(file, [file]);
190
- pass(result !== true ? result : file);
191
+ pass(result !== true ? result : rawFile);
191
192
  }
192
193
  catch (err) {
193
194
  fail(err);
@@ -177,15 +177,16 @@ const ImgCrop = forwardRef((props, cropperRef) => {
177
177
  const onCancel = useRef();
178
178
  const onOk = useRef();
179
179
  const runRawBeforeUpload = useCallback((beforeUpload, file, pass, fail) => __awaiter(void 0, void 0, void 0, function* () {
180
+ const rawFile = file;
180
181
  if (typeof beforeUpload !== 'function') {
181
- pass(file);
182
+ pass(rawFile);
182
183
  return;
183
184
  }
184
185
  try {
185
186
  // https://ant.design/components/upload-cn#api
186
187
  // https://github.com/ant-design/ant-design/blob/master/components/upload/Upload.tsx#L152-L178
187
188
  const result = yield beforeUpload(file, [file]);
188
- pass(result !== true ? result : file);
189
+ pass(result !== true ? result : rawFile);
189
190
  }
190
191
  catch (err) {
191
192
  fail(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-img-crop",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
4
4
  "description": "An image cropper for Ant Design Upload",
5
5
  "keywords": [
6
6
  "react",