antd-img-crop 4.13.0 → 4.15.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.
@@ -186,12 +186,12 @@ const ImgCrop = react.forwardRef((props, cropperRef) => {
186
186
  if (typeof cb.current.beforeCrop === 'function') {
187
187
  try {
188
188
  const result = yield cb.current.beforeCrop(file, fileList);
189
- if (result !== true) {
190
- return resolve(result);
189
+ if (result === false) {
190
+ return resolve(file);
191
191
  }
192
192
  }
193
193
  catch (err) {
194
- return resolve(err);
194
+ return resolve(file);
195
195
  }
196
196
  }
197
197
  // get file result
@@ -208,7 +208,7 @@ const ImgCrop = react.forwardRef((props, cropperRef) => {
208
208
  setModalImage('');
209
209
  easyCropRef.current.onReset();
210
210
  resolve(AntUpload.LIST_IGNORE);
211
- (_b = (_a = cb.current).onModalCancel) === null || _b === void 0 ? void 0 : _b.call(_a);
211
+ (_b = (_a = cb.current).onModalCancel) === null || _b === void 0 ? void 0 : _b.call(_a, resolve);
212
212
  };
213
213
  // on modal confirm
214
214
  onOk.current = (event) => tslib.__awaiter(void 0, void 0, void 0, function* () {
@@ -24,7 +24,7 @@ type ImgCropProps = {
24
24
  modalOk?: string;
25
25
  modalCancel?: string;
26
26
  onModalOk?: (value: BeforeUploadReturnType) => void;
27
- onModalCancel?: () => void;
27
+ onModalCancel?: (resolve: (value: BeforeUploadReturnType) => void) => void;
28
28
  modalProps?: Omit<ModalProps, 'className' | 'title' | 'width' | 'okText' | 'cancelText' | 'onOk' | 'onCancel' | 'open' | 'visible' | 'wrapClassName' | 'maskClosable' | 'destroyOnClose'>;
29
29
  beforeCrop?: BeforeUpload;
30
30
  children: JSX.Element;
@@ -184,12 +184,12 @@ const ImgCrop = forwardRef((props, cropperRef) => {
184
184
  if (typeof cb.current.beforeCrop === 'function') {
185
185
  try {
186
186
  const result = yield cb.current.beforeCrop(file, fileList);
187
- if (result !== true) {
188
- return resolve(result);
187
+ if (result === false) {
188
+ return resolve(file);
189
189
  }
190
190
  }
191
191
  catch (err) {
192
- return resolve(err);
192
+ return resolve(file);
193
193
  }
194
194
  }
195
195
  // get file result
@@ -206,7 +206,7 @@ const ImgCrop = forwardRef((props, cropperRef) => {
206
206
  setModalImage('');
207
207
  easyCropRef.current.onReset();
208
208
  resolve(AntUpload.LIST_IGNORE);
209
- (_b = (_a = cb.current).onModalCancel) === null || _b === void 0 ? void 0 : _b.call(_a);
209
+ (_b = (_a = cb.current).onModalCancel) === null || _b === void 0 ? void 0 : _b.call(_a, resolve);
210
210
  };
211
211
  // on modal confirm
212
212
  onOk.current = (event) => __awaiter(void 0, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-img-crop",
3
- "version": "4.13.0",
3
+ "version": "4.15.0",
4
4
  "description": "An image cropper for Ant Design Upload",
5
5
  "keywords": [
6
6
  "react",
@@ -36,28 +36,28 @@
36
36
  "tslib": "^2.6.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@rollup/plugin-replace": "^5.0.2",
40
- "@rollup/plugin-typescript": "^11.1.3",
41
- "@types/node": "^20.6.2",
42
- "@types/react": "^18.2.21",
43
- "@types/react-dom": "^18.2.7",
44
- "@vitejs/plugin-react": "^4.0.4",
45
- "antd": "^5.9.1",
46
- "autoprefixer": "^10.4.15",
47
- "eslint": "^8.49.0",
39
+ "@rollup/plugin-replace": "^5.0.5",
40
+ "@rollup/plugin-typescript": "^11.1.5",
41
+ "@types/node": "^20.8.10",
42
+ "@types/react": "^18.2.35",
43
+ "@types/react-dom": "^18.2.14",
44
+ "@vitejs/plugin-react": "^4.1.1",
45
+ "antd": "^5.11.0",
46
+ "autoprefixer": "^10.4.16",
47
+ "eslint": "^8.53.0",
48
48
  "eslint-config-prettier": "^9.0.0",
49
49
  "eslint-config-react-app": "^7.0.1",
50
- "postcss": "^8.4.29",
50
+ "postcss": "^8.4.31",
51
51
  "prettier": "^3.0.3",
52
52
  "prettier-plugin-organize-imports": "^3.2.3",
53
- "prettier-plugin-tailwindcss": "^0.5.4",
53
+ "prettier-plugin-tailwindcss": "^0.5.6",
54
54
  "react": "^18.2.0",
55
55
  "react-dom": "^18.2.0",
56
- "rollup": "3.29.2",
57
- "rollup-plugin-dts": "^6.0.2",
56
+ "rollup": "4.3.0",
57
+ "rollup-plugin-dts": "^6.1.0",
58
58
  "rollup-plugin-postcss": "^4.0.2",
59
- "tailwindcss": "^3.3.3",
59
+ "tailwindcss": "^3.3.5",
60
60
  "typescript": "^5.2.2",
61
- "vite": "^4.4.9"
61
+ "vite": "^4.5.0"
62
62
  }
63
63
  }