@hai-dev/ui-kit 1.0.7 → 1.0.9

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.
@@ -1 +1,3 @@
1
+ export type { Crop, PercentCrop, PixelCrop } from 'react-image-crop';
1
2
  export { PhotoCropUploader } from './photo-crop-uploader';
3
+ export { drawCroppedImage } from './utils';
@@ -1,4 +1,6 @@
1
1
  import { PhotoCropUploader as p } from "./photo-crop-uploader.js";
2
+ import { drawCroppedImage as a } from "./utils/draw-cropped-image.js";
2
3
  export {
3
- p as PhotoCropUploader
4
+ p as PhotoCropUploader,
5
+ a as drawCroppedImage
4
6
  };
@@ -1,229 +1,244 @@
1
- import { jsxs as So, Fragment as To, jsx as E } from "react/jsx-runtime";
2
- import { useState as s, useRef as j } from "react";
3
- import "../../index-BiffjjQq.js";
4
- import { c as _o } from "../../index-B2JRaoNz.js";
5
- import { localizedText as wo } from "./locale.js";
6
- import { EN_LOCALE as Ao } from "../../constants.js";
7
- import { DEFAULT_MIN_DIMENSION as Uo, DEFAULT_ASPECT_RATIO as xo, DEFAULT_TIMEOUT as yo, DEFAULT_FILE_MAX_SIZE as Oo, FULL_PROGRESS_VALUE as B, PHOTO_LOADING_DELAY as Io, RESET_DATA_DELAY as C } from "./constants.js";
8
- import { UploadDialog as vo } from "./components/upload-dialog/upload-dialog.js";
9
- import { UploadButton as Fo } from "./components/upload-button/upload-button.js";
10
- import { ErrorUploadDialog as Mo } from "./components/error-upload-dialog/error-upload-dialog.js";
11
- import { validatePhotoFile as G } from "./utils/validate-photo-file.js";
12
- import { readPhoto as Y } from "./utils/read-photo.js";
13
- import { getPhotoCrop as No } from "./utils/get-photo-crop.js";
14
- import { getCropedPhoto as Ro } from "./utils/get-croped-photo.js";
15
- import { getDefaultCroppedPhoto as bo } from "./utils/get-default-cropped-photo.js";
16
- import '../../assets/photo-crop-uploader.css';const Ho = "_photoCropCanvas_1i4lr_1", ko = {
17
- photoCropCanvas: Ho
18
- }, tt = (X) => {
1
+ import { jsxs as To, Fragment as wo, jsx as C } from "react/jsx-runtime";
2
+ import { useState as n, useRef as G } from "react";
3
+ import { D as _o } from "../../index-BiffjjQq.js";
4
+ import { c as Ao } from "../../index-B2JRaoNz.js";
5
+ import { localizedText as Uo } from "./locale.js";
6
+ import { EN_LOCALE as xo } from "../../constants.js";
7
+ import { DEFAULT_MIN_DIMENSION as yo, DEFAULT_ASPECT_RATIO as Oo, DEFAULT_TIMEOUT as vo, DEFAULT_FILE_MAX_SIZE as Io, FULL_PROGRESS_VALUE as Y, PHOTO_LOADING_DELAY as Fo, RESET_DATA_DELAY as E } from "./constants.js";
8
+ import { UploadDialog as Mo } from "./components/upload-dialog/upload-dialog.js";
9
+ import { UploadButton as No } from "./components/upload-button/upload-button.js";
10
+ import { ErrorUploadDialog as Ro } from "./components/error-upload-dialog/error-upload-dialog.js";
11
+ import { validatePhotoFile as X } from "./utils/validate-photo-file.js";
12
+ import { readPhoto as Z } from "./utils/read-photo.js";
13
+ import { getPhotoCrop as bo } from "./utils/get-photo-crop.js";
14
+ import { getCroppedSource as Ho } from "./utils/get-cropped-source.js";
15
+ import { getDefaultCroppedPhoto as zo } from "./utils/get-default-cropped-photo.js";
16
+ import '../../assets/photo-crop-uploader.css';const ko = "_photoCropCanvas_1i4lr_1", Vo = {
17
+ photoCropCanvas: ko
18
+ }, et = (q) => {
19
19
  const {
20
- buttonClassname: Z = "",
21
- onStartUpload: q = () => {
20
+ buttonClassname: J = "",
21
+ onStartUpload: K = () => {
22
22
  },
23
- onEndUpload: J = () => {
23
+ onEndUpload: Q = () => {
24
24
  },
25
- onError: K = () => {
25
+ onError: W = () => {
26
26
  },
27
- onStartCrop: Q = () => {
27
+ onStartCrop: $ = () => {
28
28
  },
29
- onEndCrop: W = () => {
29
+ onEndCrop: y = () => {
30
30
  },
31
- onDragOver: $ = () => {
31
+ onDragOver: oo = () => {
32
32
  },
33
- onDragLeave: oo = () => {
33
+ onDragLeave: to = () => {
34
34
  },
35
- onDragDrop: to = () => {
35
+ onDragDrop: ro = () => {
36
36
  },
37
- onClose: U = () => {
37
+ onClose: P = () => {
38
38
  },
39
- showErrorPopup: ro = !1,
40
- minDimension: l = Uo,
41
- aspectRatio: P = xo,
42
- locale: e = Ao,
43
- timeout: x = yo,
44
- fileMaxSize: y = Oo,
45
- allowedExtensions: D,
46
- allowedMimeTypes: O,
47
- circular: eo,
48
- width: so,
49
- keepSelection: no,
50
- uploadButton: ao,
39
+ showErrorPopup: eo = !1,
40
+ minDimension: i = yo,
41
+ aspectRatio: D = Oo,
42
+ locale: s = xo,
43
+ timeout: O = vo,
44
+ fileMaxSize: v = Io,
45
+ allowedExtensions: L,
46
+ allowedMimeTypes: I,
47
+ circular: so,
48
+ width: no,
49
+ keepSelection: ao,
50
+ uploadButton: io,
51
51
  multiple: m = !1,
52
- fromSources: I,
52
+ fromSources: F,
53
+ returnCropParams: S = !1,
53
54
  ...lo
54
- } = X, [io, f] = s(!1), [h, u] = s([]), [L, S] = s([]), [p, v] = s(0), F = j(null), M = j(null), [i, T] = s(!1), [po, N] = s(0), [R, b] = s(""), [co, d] = s([]), [ho, H] = s(!1), mo = io || i && m, fo = () => {
55
+ } = q, [po, f] = n(!1), [p, u] = n([]), [T, w] = n([]), [c, M] = n(0), N = G(null), R = G(null), [l, _] = n(!1), [co, b] = n(0), [H, z] = n(""), [ho, d] = n([]), [mo, k] = n(!1), fo = po || l && m, uo = () => {
55
56
  d([]);
56
- }, k = (o = []) => {
57
- i || (U(o, h), f(!1), setTimeout(() => d([]), C), setTimeout(() => u([]), C));
58
- }, uo = () => {
59
- i || (U([], h), f(!1), setTimeout(() => d([]), C), setTimeout(() => u([]), C));
57
+ }, V = (o = []) => {
58
+ l || (P?.(
59
+ o,
60
+ p
61
+ ), f(!1), setTimeout(() => d([]), E), setTimeout(() => u([]), E));
60
62
  }, go = () => {
61
- H(!1);
62
- }, _ = (o) => {
63
- J(o), u(o), S(Array(o.length)), v(0), f(!0), b("");
64
- }, w = (o) => {
65
- o instanceof Error && (console.warn(o.message), K(o), b(o.message), H(!0), u([]), f(!1));
63
+ l || (P([], p), f(!1), setTimeout(() => d([]), E), setTimeout(() => u([]), E));
64
+ }, Co = () => {
65
+ k(!1);
66
+ }, A = (o) => {
67
+ Q(o), u(o), w(Array(o.length)), M(0), f(!0), z("");
68
+ }, U = (o) => {
69
+ o instanceof Error && (console.warn(o.message), W(o), z(o.message), k(!0), u([]), f(!1));
66
70
  }, Eo = async (o) => {
67
71
  const { files: r } = o.target;
68
- if (r?.length && !i)
72
+ if (r?.length && !l)
69
73
  try {
70
- if (T(!0), q(), m) {
71
- const t = Array.from(r), n = B / t.length, g = [], c = [];
72
- for (const A of t) {
74
+ if (_(!0), K(), m) {
75
+ const t = Array.from(r), e = Y / t.length, g = [], h = [];
76
+ for (const x of t) {
73
77
  try {
74
- G(
75
- A,
78
+ X(
79
+ x,
76
80
  {
77
- maxSize: y,
78
- allowedExtensions: D,
79
- allowedMimeTypes: O
81
+ maxSize: v,
82
+ allowedExtensions: L,
83
+ allowedMimeTypes: I
80
84
  },
81
- e
85
+ s
82
86
  );
83
- const a = await Y(A, l, e, x);
87
+ const a = await Z(x, i, s, O);
84
88
  g.push(a);
85
89
  } catch (a) {
86
- let V = "";
87
- a instanceof Error && (V = a.message), c.push({
88
- photoName: A.name,
89
- errorMessage: V
90
+ let B = "";
91
+ a instanceof Error && (B = a.message), h.push({
92
+ photoName: x.name,
93
+ errorMessage: B
90
94
  });
91
95
  }
92
- N(
93
- (a) => Math.min(B, a + n)
96
+ b(
97
+ (a) => Math.min(Y, a + e)
94
98
  ), await new Promise((a) => setTimeout(a, 0));
95
99
  }
96
- if (I?.length)
97
- throw new Error(c[0]?.errorMessage);
98
- d(c), _(g);
100
+ if (F?.length)
101
+ throw new Error(h[0]?.errorMessage);
102
+ d(h), A(g);
99
103
  } else {
100
104
  const t = r[0];
101
- G(
105
+ X(
102
106
  t,
103
- { maxSize: y, allowedExtensions: D, allowedMimeTypes: O },
104
- e
107
+ { maxSize: v, allowedExtensions: L, allowedMimeTypes: I },
108
+ s
105
109
  );
106
- const n = await Y(t, l, e, x);
107
- _([n]);
110
+ const e = await Z(t, i, s, O);
111
+ A([e]);
108
112
  }
109
113
  } catch (t) {
110
- w(t);
114
+ U(t);
111
115
  } finally {
112
116
  m ? setTimeout(() => {
113
- o.target.value = "", N(0), T(!1);
114
- }, Io) : (o.target.value = "", T(!1));
117
+ o.target.value = "", b(0), _(!1);
118
+ }, Fo) : (o.target.value = "", _(!1));
115
119
  }
116
- }, Co = (o) => {
117
- const { width: r, height: t } = o.currentTarget;
118
- console.log(o);
119
- const n = No(r, t, l, P);
120
- S((g) => {
121
- const c = [...g];
122
- return c[p] = n, c;
120
+ }, Po = (o) => {
121
+ const { width: r, height: t } = o.currentTarget, e = bo(r, t, i, D);
122
+ w((g) => {
123
+ const h = [...g];
124
+ return h[c] = e, h;
123
125
  });
124
- }, Po = (o, r) => {
125
- S((t) => {
126
- const n = [...t];
127
- return n[p] = r, n;
126
+ }, Do = (o, r) => {
127
+ w((t) => {
128
+ const e = [...t];
129
+ return e[c] = r, e;
128
130
  });
129
- }, z = () => {
130
- const o = M.current, r = F.current;
131
- if (o && r && L)
131
+ }, j = () => {
132
+ const o = R.current, r = N.current;
133
+ if (o && r && T)
132
134
  try {
133
- Q();
134
- const t = Ro(
135
- r,
136
- o,
137
- L[p],
138
- e
139
- );
140
- W(t), p >= h.length - 1 && k();
135
+ $();
136
+ const t = T[c];
137
+ if (S) {
138
+ const e = _o(t, r.width, r.height);
139
+ y?.(e);
140
+ } else {
141
+ const e = Ho(
142
+ r,
143
+ o,
144
+ t,
145
+ s
146
+ );
147
+ y?.(e);
148
+ }
149
+ c >= p.length - 1 && V();
141
150
  } catch (t) {
142
- t instanceof Error && (console.warn(t), w(t));
151
+ t instanceof Error && (console.warn(t), U(t));
143
152
  }
144
- }, Do = () => {
145
- z(), v((o) => o + 1);
146
- }, Lo = async () => {
147
- const o = h.slice(p);
153
+ }, Lo = () => {
154
+ j(), M((o) => o + 1);
155
+ }, So = async () => {
156
+ const o = p.slice(c);
148
157
  try {
149
158
  const r = await Promise.all(
150
159
  o.map(
151
- (t) => bo(t, l, P, e)
160
+ (t) => zo(
161
+ t,
162
+ i,
163
+ D,
164
+ s,
165
+ S
166
+ )
152
167
  )
153
168
  );
154
- k(r);
169
+ V(r);
155
170
  } catch (r) {
156
- w(r);
171
+ U(r);
157
172
  }
158
173
  };
159
- return /* @__PURE__ */ So(To, { children: [
160
- /* @__PURE__ */ E(
161
- Fo,
174
+ return /* @__PURE__ */ To(wo, { children: [
175
+ /* @__PURE__ */ C(
176
+ No,
162
177
  {
163
178
  onChange: Eo,
164
- onPhotoDataLoaded: _,
165
- buttonClassname: Z,
166
- disabled: i,
167
- buttonDisabled: i,
168
- locale: e,
169
- width: so,
170
- allowedExtensions: D,
171
- onDragDrop: to,
172
- onDragLeave: oo,
173
- onDragOver: $,
174
- button: ao,
179
+ onPhotoDataLoaded: A,
180
+ buttonClassname: J,
181
+ disabled: l,
182
+ buttonDisabled: l,
183
+ locale: s,
184
+ width: no,
185
+ allowedExtensions: L,
186
+ onDragDrop: ro,
187
+ onDragLeave: to,
188
+ onDragOver: oo,
189
+ button: io,
175
190
  multiple: m,
176
- fromSources: I,
191
+ fromSources: F,
177
192
  ...lo,
178
- children: wo[e].upload
193
+ children: Uo[s].upload
179
194
  }
180
195
  ),
181
- /* @__PURE__ */ E(
182
- vo,
196
+ /* @__PURE__ */ C(
197
+ Mo,
183
198
  {
184
- open: mo,
185
- photoSourceLoading: i,
186
- loadingValue: po,
187
- errors: co,
188
- photoCrops: L,
189
- photoSources: h,
190
- onNextPhoto: Do,
191
- onSkipCrop: Lo,
192
- onClearErrors: fo,
193
- photoError: R,
194
- onCloseDialogHandler: uo,
195
- onCropChange: Po,
196
- onPhotoCrop: z,
197
- onPhotoLoad: Co,
198
- imageRef: F,
199
- minDimension: l,
200
- aspectRatio: P,
201
- locale: e,
202
- circular: eo,
203
- keepSelection: no,
204
- photoIndex: p
199
+ open: fo,
200
+ photoSourceLoading: l,
201
+ loadingValue: co,
202
+ errors: ho,
203
+ photoCrops: T,
204
+ photoSources: p,
205
+ onNextPhoto: Lo,
206
+ onSkipCrop: So,
207
+ onClearErrors: uo,
208
+ photoError: H,
209
+ onCloseDialogHandler: go,
210
+ onCropChange: Do,
211
+ onPhotoCrop: j,
212
+ onPhotoLoad: Po,
213
+ imageRef: N,
214
+ minDimension: i,
215
+ aspectRatio: D,
216
+ locale: s,
217
+ circular: so,
218
+ keepSelection: ao,
219
+ photoIndex: c
205
220
  }
206
221
  ),
207
- /* @__PURE__ */ E(
208
- Mo,
222
+ /* @__PURE__ */ C(
223
+ Ro,
209
224
  {
210
- open: ro && ho,
211
- photoError: R,
212
- onCloseErrorDialog: go,
213
- locale: e
225
+ open: eo && mo,
226
+ photoError: H,
227
+ onCloseErrorDialog: Co,
228
+ locale: s
214
229
  }
215
230
  ),
216
- /* @__PURE__ */ E(
231
+ /* @__PURE__ */ C(
217
232
  "canvas",
218
233
  {
219
- className: _o(ko.photoCropCanvas),
220
- width: l,
221
- height: l,
222
- ref: M
234
+ className: Ao(Vo.photoCropCanvas),
235
+ width: i,
236
+ height: i,
237
+ ref: R
223
238
  }
224
239
  )
225
240
  ] });
226
241
  };
227
242
  export {
228
- tt as PhotoCropUploader
243
+ et as PhotoCropUploader
229
244
  };
@@ -1,4 +1,5 @@
1
1
  import { DragEvent, InputHTMLAttributes, ReactNode } from 'react';
2
+ import { PixelCrop } from 'react-image-crop';
2
3
  import { Locale } from '../../types';
3
4
  import { BMP_IMAGE_TYPE, GIF_IMAGE_TYPE, ICO_IMAGE_TYPE, JPEG_IMAGE_TYPE, JPG_IMAGE_TYPE, MICROSOFT_ICO_IMAGE_TYPE, PNG_IMAGE_TYPE, SVG_IMAGE_TYPE, WEBP_IMAGE_TYPE, ICO_IMAGE_EXT, BMP_IMAGE_EXT, GIF_IMAGE_EXT, JPEG_IMAGE_EXT, JPG_IMAGE_EXT, PNG_IMAGE_EXT, SVG_IMAGE_EXT, WEBP_IMAGE_EXT } from './constants';
4
5
  export type PhotoDataUrl = string;
@@ -14,14 +15,22 @@ export type PhotoFileOptions = {
14
15
  allowedExtensions?: PhotoExtension[];
15
16
  allowedMimeTypes?: PhotoMimeType[];
16
17
  };
18
+ type WithNoReturnCropParamsProps = {
19
+ returnCropParams?: false;
20
+ onEndCrop?: (photoData: PhotoDataUrl) => unknown;
21
+ onClose?: (skipPhotosData: PhotoDataUrl[], sourcesData: PhotoDataUrl[]) => unknown;
22
+ };
23
+ type WithReturnCropParamsProps = {
24
+ returnCropParams: true;
25
+ onEndCrop?: (photoData: PixelCrop) => unknown;
26
+ onClose?: (skipPhotosData: PixelCrop[], sourcesData: PhotoDataUrl[]) => unknown;
27
+ };
17
28
  export type PhotoCropUploaderCustomProps = {
18
29
  buttonClassname?: string;
19
30
  onStartUpload?: () => unknown;
20
31
  onEndUpload?: (photoData: PhotoDataUrl[]) => unknown;
21
32
  onError?: (error: Error) => unknown;
22
33
  onStartCrop?: () => unknown;
23
- onEndCrop?: (photoData: PhotoDataUrl) => unknown;
24
- onClose?: (skipPhotosData: PhotoDataUrl[], sourcesData: PhotoDataUrl[]) => unknown;
25
34
  onDragOver?: (event: DragEvent<HTMLDivElement>) => unknown;
26
35
  onDragLeave?: (event: DragEvent<HTMLDivElement>) => unknown;
27
36
  onDragDrop?: (event: DragEvent<HTMLDivElement>) => unknown;
@@ -39,5 +48,6 @@ export type PhotoCropUploaderCustomProps = {
39
48
  uploadButton?: ReactNode;
40
49
  fromSources?: PhotoDataUrl[];
41
50
  };
42
- export type PhotoCropUploaderProps = PhotoCropUploaderCustomProps & InputHTMLAttributes<HTMLInputElement>;
51
+ export type PhotoCropUploaderProps = PhotoCropUploaderCustomProps & (WithNoReturnCropParamsProps | WithReturnCropParamsProps) & InputHTMLAttributes<HTMLInputElement>;
43
52
  export type PhotoCropUploaderLocaleText = Record<Locale, Record<string, string>>;
53
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Crop } from 'react-image-crop';
2
+ import { Locale } from '../../../types';
3
+ export declare const drawCroppedImage: (canvas: HTMLCanvasElement, source: string, crop: Crop, locale?: Locale) => Promise<void>;
@@ -0,0 +1,33 @@
1
+ import { D as h } from "../../../index-BiffjjQq.js";
2
+ import { localizedText as w } from "../locale.js";
3
+ import { EN_LOCALE as l } from "../../../constants.js";
4
+ import { PHOTO_CANVAS_CONTEXT as x } from "../constants.js";
5
+ const O = async (o, n, a, m = l) => {
6
+ new Promise((d, s) => {
7
+ const r = new Image();
8
+ r.src = n, r.addEventListener("load", () => {
9
+ const { width: e, height: c } = o, { naturalWidth: p, naturalHeight: g } = r, i = o.getContext(x);
10
+ if (i) {
11
+ const t = h(a, p, g);
12
+ i.drawImage(
13
+ r,
14
+ t.x,
15
+ t.y,
16
+ t.width,
17
+ t.height,
18
+ 0,
19
+ 0,
20
+ e,
21
+ c
22
+ );
23
+ }
24
+ d("");
25
+ }), r.addEventListener("error", () => {
26
+ const e = new Error(w[m]["paint-error"]);
27
+ s(e);
28
+ });
29
+ });
30
+ };
31
+ export {
32
+ O as drawCroppedImage
33
+ };
@@ -0,0 +1,4 @@
1
+ import { Crop } from 'react-image-crop';
2
+ import { Locale } from '../../../types';
3
+ import { PhotoDataUrl } from '../types';
4
+ export declare const getCroppedSource: (photo: HTMLImageElement, canvas: HTMLCanvasElement, crop: Crop, locale?: Locale) => PhotoDataUrl;
@@ -22,5 +22,5 @@ const H = (c, o, d, m = O) => {
22
22
  ), t.restore(), o.toDataURL();
23
23
  };
24
24
  export {
25
- H as getCropedPhoto
25
+ H as getCroppedSource
26
26
  };
@@ -1,3 +1,4 @@
1
+ import { Crop } from 'react-image-crop';
1
2
  import { Locale } from '../../../types';
2
3
  import { PhotoDataUrl } from '../types';
3
- export declare const getDefaultCroppedPhoto: (photoSourse: PhotoDataUrl, minDimension: number, aspectRatio: number, locale: Locale) => Promise<PhotoDataUrl>;
4
+ export declare const getDefaultCroppedPhoto: (photoSourse: PhotoDataUrl, minDimension: number, aspectRatio: number, locale: Locale, returnCropParams: boolean) => Promise<PhotoDataUrl | Crop>;
@@ -1,32 +1,39 @@
1
- import { getPhotoCrop as m } from "./get-photo-crop.js";
2
- import { getCropedPhoto as g } from "./get-croped-photo.js";
3
- import { localizedText as P } from "../locale.js";
4
- const w = async (a, c, s, e) => new Promise((p, n) => {
1
+ import { D as g } from "../../../index-BiffjjQq.js";
2
+ import { getPhotoCrop as u } from "./get-photo-crop.js";
3
+ import { getCroppedSource as C } from "./get-cropped-source.js";
4
+ import { localizedText as l } from "../locale.js";
5
+ const x = async (a, s, i, e, m) => new Promise((n, c) => {
5
6
  const o = new Image(), d = document.createElement("canvas");
6
7
  o.src = a, o.addEventListener("load", () => {
7
- const { width: t, height: h } = o, i = m(
8
- t,
9
- h,
10
- c,
11
- s,
12
- !0
13
- );
8
+ const { width: r, height: p } = o;
14
9
  try {
15
- const r = g(
10
+ const t = u(
11
+ r,
12
+ p,
13
+ s,
14
+ i,
15
+ !0
16
+ );
17
+ if (m) {
18
+ const f = g(t, r, p);
19
+ n(f);
20
+ return;
21
+ }
22
+ const h = C(
16
23
  o,
17
24
  d,
18
- i,
25
+ t,
19
26
  e
20
27
  );
21
- p(r);
22
- } catch (r) {
23
- n(r);
28
+ n(h);
29
+ } catch (t) {
30
+ c(t);
24
31
  }
25
32
  }), o.addEventListener("error", () => {
26
- const t = new Error(P[e]["paint-error"]);
27
- n(t);
33
+ const r = new Error(l[e]["paint-error"]);
34
+ c(r);
28
35
  });
29
36
  });
30
37
  export {
31
- w as getDefaultCroppedPhoto
38
+ x as getDefaultCroppedPhoto
32
39
  };
@@ -1,5 +1,6 @@
1
1
  export { readPhoto } from './read-photo';
2
2
  export { getPhotoCrop } from './get-photo-crop';
3
- export { getCropedPhoto } from './get-croped-photo';
3
+ export { getCroppedSource } from './get-cropped-source';
4
4
  export { validatePhotoFile } from './validate-photo-file';
5
5
  export { getDefaultCroppedPhoto } from './get-default-cropped-photo';
6
+ export { drawCroppedImage } from './draw-cropped-image';
@@ -1,12 +1,14 @@
1
1
  import { readPhoto as e } from "./read-photo.js";
2
2
  import { getPhotoCrop as p } from "./get-photo-crop.js";
3
- import { getCropedPhoto as h } from "./get-croped-photo.js";
4
- import { validatePhotoFile as x } from "./validate-photo-file.js";
5
- import { getDefaultCroppedPhoto as a } from "./get-default-cropped-photo.js";
3
+ import { getCroppedSource as m } from "./get-cropped-source.js";
4
+ import { validatePhotoFile as d } from "./validate-photo-file.js";
5
+ import { getDefaultCroppedPhoto as g } from "./get-default-cropped-photo.js";
6
+ import { drawCroppedImage as C } from "./draw-cropped-image.js";
6
7
  export {
7
- h as getCropedPhoto,
8
- a as getDefaultCroppedPhoto,
8
+ C as drawCroppedImage,
9
+ m as getCroppedSource,
10
+ g as getDefaultCroppedPhoto,
9
11
  p as getPhotoCrop,
10
12
  e as readPhoto,
11
- x as validatePhotoFile
13
+ d as validatePhotoFile
12
14
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hai-dev/ui-kit",
3
3
  "private": false,
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "license": "UNLICENSED",
6
6
  "author": {
7
7
  "name": "Vladislav Knitrunov",
@@ -1,4 +0,0 @@
1
- import { Crop } from 'react-image-crop';
2
- import { Locale } from '../../../types';
3
- import { PhotoDataUrl } from '../types';
4
- export declare const getCropedPhoto: (photo: HTMLImageElement, canvas: HTMLCanvasElement, crop: Crop, locale?: Locale) => PhotoDataUrl;