@hai-dev/ui-kit 1.0.1 → 1.0.3

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.
Files changed (38) hide show
  1. package/dist/{Button-0AB7oP6Y.js → Button-DDlVTM6i.js} +3 -2
  2. package/dist/ButtonBase-CXGZ-DBC.js +1346 -0
  3. package/dist/{CircularProgress-BD6BPlN2.js → CircularProgress-CscJm1An.js} +9 -8
  4. package/dist/{DialogTitle-iOQ7wKEt.js → DialogTitle-KN1sayHD.js} +453 -555
  5. package/dist/assets/photo-list.css +1 -0
  6. package/dist/assets/upload-dialog.css +1 -1
  7. package/dist/components/button/button.js +1 -1
  8. package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +87 -23
  9. package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +1 -0
  10. package/dist/components/photo-crop-uploader/components/photo-list/constants.js +4 -0
  11. package/dist/components/photo-crop-uploader/components/photo-list/index.d.ts +1 -0
  12. package/dist/components/photo-crop-uploader/components/photo-list/index.js +4 -0
  13. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.d.ts +3 -0
  14. package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +88 -0
  15. package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +8 -0
  16. package/dist/components/photo-crop-uploader/components/photo-list/types.js +1 -0
  17. package/dist/components/photo-crop-uploader/components/upload-button/types.d.ts +3 -1
  18. package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +72 -62
  19. package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -0
  20. package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +4 -0
  21. package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +5 -2
  22. package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +172 -135
  23. package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
  24. package/dist/components/photo-crop-uploader/constants.js +36 -33
  25. package/dist/components/photo-crop-uploader/locale.js +8 -2
  26. package/dist/components/photo-crop-uploader/photo-crop-uploader.js +163 -112
  27. package/dist/components/photo-crop-uploader/types.d.ts +3 -1
  28. package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.d.ts +3 -0
  29. package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.js +32 -0
  30. package/dist/components/photo-crop-uploader/utils/get-photo-crop.d.ts +1 -1
  31. package/dist/components/photo-crop-uploader/utils/get-photo-crop.js +12 -12
  32. package/dist/components/photo-crop-uploader/utils/index.d.ts +1 -0
  33. package/dist/components/photo-crop-uploader/utils/index.js +4 -2
  34. package/dist/components/photo-crop-uploader/utils/read-photo.js +33 -30
  35. package/dist/createTheme-DSHGFfg6.js +4124 -0
  36. package/dist/extendSxProp-CzeED7BH.js +49 -0
  37. package/package.json +1 -1
  38. package/dist/ButtonBase-Bw_3RZmN.js +0 -5453
@@ -1,41 +1,44 @@
1
- import { jsxs as T, jsx as n } from "react/jsx-runtime";
2
- import { S as j } from "../../../../index-BiffjjQq.js";
1
+ import { jsxs as N, jsx as a, Fragment as E } from "react/jsx-runtime";
2
+ import { S as D } from "../../../../index-BiffjjQq.js";
3
3
  import { c as r } from "../../../../index-B2JRaoNz.js";
4
- import { localizedText as b } from "../../locale.js";
5
- import { EN_LOCALE as w } from "../../../../constants.js";
6
- import { DEFAULT_MIN_DIMENSION as O, DEFAULT_ASPECT_RATIO as D } from "../../constants.js";
7
- import { D as P, d as z, a as E, b as M, c as U } from "../../../../DialogTitle-iOQ7wKEt.js";
8
- import * as x from "react";
9
- import { g as $, a as F, u as W, s as A, c as V, b as g, d as H, B as Y, P as t, f as Z } from "../../../../ButtonBase-Bw_3RZmN.js";
10
- import { u as q, m as N, c as R, C as G } from "../../../../CircularProgress-BD6BPlN2.js";
11
- import { Button as J } from "../../../button/button.js";
12
- import '../../../../assets/upload-dialog.css';function K(o) {
13
- return F("MuiIconButton", o);
4
+ import { PhotoList as M } from "../photo-list/photo-list.js";
5
+ import { localizedText as p } from "../../locale.js";
6
+ import { EN_LOCALE as W } from "../../../../constants.js";
7
+ import { CLOSE_ICON_SIZE as R } from "./constants.js";
8
+ import { DEFAULT_MIN_DIMENSION as j, DEFAULT_ASPECT_RATIO as F } from "../../constants.js";
9
+ import { D as U, c as x, a as $, b as V } from "../../../../DialogTitle-KN1sayHD.js";
10
+ import * as L from "react";
11
+ import { a as H, g as Z, b as Y, e as m, P as t } from "../../../../createTheme-DSHGFfg6.js";
12
+ import { u as q, m as A, c as O, C as G } from "../../../../CircularProgress-CscJm1An.js";
13
+ import { u as J, s as w, c as K, B as Q, b as X } from "../../../../ButtonBase-CXGZ-DBC.js";
14
+ import { Button as T } from "../../../button/button.js";
15
+ import '../../../../assets/upload-dialog.css';function oo(o) {
16
+ return Z("MuiIconButton", o);
14
17
  }
15
- const L = $("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), Q = (o) => {
18
+ const k = H("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), to = (o) => {
16
19
  const {
17
20
  classes: e,
18
- disabled: a,
19
- color: l,
20
- edge: d,
21
- size: u,
22
- loading: m
23
- } = o, p = {
24
- root: ["root", m && "loading", a && "disabled", l !== "default" && `color${g(l)}`, d && `edge${g(d)}`, `size${g(u)}`],
21
+ disabled: n,
22
+ color: c,
23
+ edge: g,
24
+ size: b,
25
+ loading: f
26
+ } = o, u = {
27
+ root: ["root", f && "loading", n && "disabled", c !== "default" && `color${m(c)}`, g && `edge${m(g)}`, `size${m(b)}`],
25
28
  loadingIndicator: ["loadingIndicator"],
26
29
  loadingWrapper: ["loadingWrapper"]
27
30
  };
28
- return H(p, K, e);
29
- }, X = A(Y, {
31
+ return K(u, oo, e);
32
+ }, eo = w(Q, {
30
33
  name: "MuiIconButton",
31
34
  slot: "Root",
32
35
  overridesResolver: (o, e) => {
33
36
  const {
34
- ownerState: a
37
+ ownerState: n
35
38
  } = o;
36
- return [e.root, a.loading && e.loading, a.color !== "default" && e[`color${g(a.color)}`], a.edge && e[`edge${g(a.edge)}`], e[`size${g(a.size)}`]];
39
+ return [e.root, n.loading && e.loading, n.color !== "default" && e[`color${m(n.color)}`], n.edge && e[`edge${m(n.edge)}`], e[`size${m(n.size)}`]];
37
40
  }
38
- })(N(({
41
+ })(A(({
39
42
  theme: o
40
43
  }) => ({
41
44
  textAlign: "center",
@@ -90,7 +93,7 @@ const L = $("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
90
93
  marginRight: -3
91
94
  }
92
95
  }]
93
- })), N(({
96
+ })), A(({
94
97
  theme: o
95
98
  }) => ({
96
99
  variants: [{
@@ -100,14 +103,14 @@ const L = $("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
100
103
  style: {
101
104
  color: "inherit"
102
105
  }
103
- }, ...Object.entries(o.palette).filter(R()).map(([e]) => ({
106
+ }, ...Object.entries(o.palette).filter(O()).map(([e]) => ({
104
107
  props: {
105
108
  color: e
106
109
  },
107
110
  style: {
108
111
  color: (o.vars || o).palette[e].main
109
112
  }
110
- })), ...Object.entries(o.palette).filter(R()).map(([e]) => ({
113
+ })), ...Object.entries(o.palette).filter(O()).map(([e]) => ({
111
114
  props: {
112
115
  color: e
113
116
  },
@@ -131,14 +134,14 @@ const L = $("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
131
134
  fontSize: o.typography.pxToRem(28)
132
135
  }
133
136
  }],
134
- [`&.${L.disabled}`]: {
137
+ [`&.${k.disabled}`]: {
135
138
  backgroundColor: "transparent",
136
139
  color: (o.vars || o).palette.action.disabled
137
140
  },
138
- [`&.${L.loading}`]: {
141
+ [`&.${k.loading}`]: {
139
142
  color: "transparent"
140
143
  }
141
- }))), oo = A("span", {
144
+ }))), no = w("span", {
142
145
  name: "MuiIconButton",
143
146
  slot: "LoadingIndicator"
144
147
  })(({
@@ -159,60 +162,60 @@ const L = $("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
159
162
  display: "flex"
160
163
  }
161
164
  }]
162
- })), S = /* @__PURE__ */ x.forwardRef(function(e, a) {
163
- const l = W({
165
+ })), P = /* @__PURE__ */ L.forwardRef(function(e, n) {
166
+ const c = J({
164
167
  props: e,
165
168
  name: "MuiIconButton"
166
169
  }), {
167
- edge: d = !1,
168
- children: u,
169
- className: m,
170
- color: p = "default",
171
- disabled: y = !1,
172
- disableFocusRipple: f = !1,
173
- size: C = "medium",
174
- id: i,
175
- loading: c = null,
176
- loadingIndicator: v,
177
- ...I
178
- } = l, h = q(i), k = v ?? /* @__PURE__ */ n(G, {
179
- "aria-labelledby": h,
170
+ edge: g = !1,
171
+ children: b,
172
+ className: f,
173
+ color: u = "default",
174
+ disabled: C = !1,
175
+ disableFocusRipple: I = !1,
176
+ size: B = "medium",
177
+ id: h,
178
+ loading: d = null,
179
+ loadingIndicator: s,
180
+ ...S
181
+ } = c, _ = q(h), v = s ?? /* @__PURE__ */ a(G, {
182
+ "aria-labelledby": _,
180
183
  color: "inherit",
181
184
  size: 16
182
- }), _ = {
183
- ...l,
184
- edge: d,
185
- color: p,
186
- disabled: y,
187
- disableFocusRipple: f,
188
- loading: c,
189
- loadingIndicator: k,
190
- size: C
191
- }, B = Q(_);
192
- return /* @__PURE__ */ T(X, {
193
- id: c ? h : i,
194
- className: V(B.root, m),
185
+ }), l = {
186
+ ...c,
187
+ edge: g,
188
+ color: u,
189
+ disabled: C,
190
+ disableFocusRipple: I,
191
+ loading: d,
192
+ loadingIndicator: v,
193
+ size: B
194
+ }, y = to(l);
195
+ return /* @__PURE__ */ N(eo, {
196
+ id: d ? _ : h,
197
+ className: Y(y.root, f),
195
198
  centerRipple: !0,
196
- focusRipple: !f,
197
- disabled: y || c,
198
- ref: a,
199
- ...I,
200
- ownerState: _,
201
- children: [typeof c == "boolean" && // use plain HTML span to minimize the runtime overhead
202
- /* @__PURE__ */ n("span", {
203
- className: B.loadingWrapper,
199
+ focusRipple: !I,
200
+ disabled: C || d,
201
+ ref: n,
202
+ ...S,
203
+ ownerState: l,
204
+ children: [typeof d == "boolean" && // use plain HTML span to minimize the runtime overhead
205
+ /* @__PURE__ */ a("span", {
206
+ className: y.loadingWrapper,
204
207
  style: {
205
208
  display: "contents"
206
209
  },
207
- children: /* @__PURE__ */ n(oo, {
208
- className: B.loadingIndicator,
209
- ownerState: _,
210
- children: c && k
210
+ children: /* @__PURE__ */ a(no, {
211
+ className: y.loadingIndicator,
212
+ ownerState: l,
213
+ children: d && v
211
214
  })
212
- }), u]
215
+ }), b]
213
216
  });
214
217
  });
215
- process.env.NODE_ENV !== "production" && (S.propTypes = {
218
+ process.env.NODE_ENV !== "production" && (P.propTypes = {
216
219
  // ┌────────────────────────────── Warning ──────────────────────────────┐
217
220
  // │ These PropTypes are generated from the TypeScript type definitions. │
218
221
  // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
@@ -220,7 +223,7 @@ process.env.NODE_ENV !== "production" && (S.propTypes = {
220
223
  /**
221
224
  * The icon to display.
222
225
  */
223
- children: Z(t.node, (o) => x.Children.toArray(o.children).some((a) => /* @__PURE__ */ x.isValidElement(a) && a.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
226
+ children: X(t.node, (o) => L.Children.toArray(o.children).some((n) => /* @__PURE__ */ L.isValidElement(n) && n.props.onClick) ? new Error(["MUI: You are providing an onClick event listener to a child of a button element.", "Prefer applying it to the IconButton directly.", "This guarantees that the whole <button> will be responsive to click events."].join(`
224
227
  `)) : null),
225
228
  /**
226
229
  * Override or extend the styles applied to the component.
@@ -291,94 +294,128 @@ process.env.NODE_ENV !== "production" && (S.propTypes = {
291
294
  */
292
295
  sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
293
296
  });
294
- const to = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.3434%2015.4595C16.8227%2014.9388%2015.9785%2014.9388%2015.4578%2015.4595C14.9371%2015.9802%2014.9371%2016.8244%2015.4578%2017.3451L21.1146%2023.002L15.4578%2028.6588C14.9371%2029.1795%2014.9371%2030.0237%2015.4578%2030.5444C15.9785%2031.0651%2016.8227%2031.0651%2017.3434%2030.5444L23.0002%2024.8876L28.6571%2030.5444C29.1778%2031.0651%2030.022%2031.0651%2030.5427%2030.5444C31.0634%2030.0237%2031.0634%2029.1795%2030.5427%2028.6588L24.8858%2023.002L30.5427%2017.3451C31.0634%2016.8244%2031.0634%2015.9802%2030.5427%2015.4595C30.022%2014.9388%2029.1778%2014.9388%2028.6571%2015.4595L23.0002%2021.1163L17.3434%2015.4595Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", eo = "_dialog_ujd1k_1", ao = "_topActions_ujd1k_6", no = "_close_ujd1k_12", io = "_botActions_ujd1k_16", ro = "_title_ujd1k_19", so = "_content_ujd1k_25", lo = "_crop_ujd1k_33", co = "_dialogText_ujd1k_42", s = {
295
- dialog: eo,
296
- topActions: ao,
297
- close: no,
298
- botActions: io,
299
- title: ro,
300
- content: so,
301
- crop: lo,
302
- dialogText: co
303
- }, Io = (o) => {
297
+ const ao = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%200%2046%2046'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.3434%2015.4595C16.8227%2014.9388%2015.9785%2014.9388%2015.4578%2015.4595C14.9371%2015.9802%2014.9371%2016.8244%2015.4578%2017.3451L21.1146%2023.002L15.4578%2028.6588C14.9371%2029.1795%2014.9371%2030.0237%2015.4578%2030.5444C15.9785%2031.0651%2016.8227%2031.0651%2017.3434%2030.5444L23.0002%2024.8876L28.6571%2030.5444C29.1778%2031.0651%2030.022%2031.0651%2030.5427%2030.5444C31.0634%2030.0237%2031.0634%2029.1795%2030.5427%2028.6588L24.8858%2023.002L30.5427%2017.3451C31.0634%2016.8244%2031.0634%2015.9802%2030.5427%2015.4595C30.022%2014.9388%2029.1778%2014.9388%2028.6571%2015.4595L23.0002%2021.1163L17.3434%2015.4595Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", io = "_dialog_1d9zm_1", ro = "_topActions_1d9zm_7", so = "_close_1d9zm_13", lo = "_botActions_1d9zm_17", co = "_button_1d9zm_22", po = "_title_1d9zm_26", go = "_content_1d9zm_32", uo = "_many_1d9zm_40", mo = "_crop_1d9zm_47", bo = "_dialogText_1d9zm_56", i = {
298
+ dialog: io,
299
+ topActions: ro,
300
+ close: so,
301
+ botActions: lo,
302
+ button: co,
303
+ title: po,
304
+ content: go,
305
+ many: uo,
306
+ crop: mo,
307
+ dialogText: bo
308
+ }, Lo = (o) => {
304
309
  const {
305
310
  onCloseDialogHandler: e,
306
- photoSource: a,
307
- photoCrop: l,
308
- onCropChange: d = () => {
311
+ photoSources: n = [],
312
+ photoCrops: c = [],
313
+ onCropChange: g = () => {
309
314
  },
310
- onPhotoLoad: u,
311
- imageRef: m,
312
- photoError: p,
313
- onPhotoCrop: y,
314
- minDimension: f = O,
315
- aspectRatio: C = D,
316
- locale: i = w,
317
- circular: c,
318
- keepSelection: v = !0,
319
- className: I,
320
- ...h
321
- } = o;
322
- return /* @__PURE__ */ T(
323
- P,
315
+ onPhotoLoad: b,
316
+ imageRef: f,
317
+ photoError: u,
318
+ onPhotoCrop: C,
319
+ onNextPhoto: I,
320
+ onSkipCrop: B,
321
+ minDimension: h = j,
322
+ aspectRatio: d = F,
323
+ locale: s = W,
324
+ circular: S,
325
+ keepSelection: _ = !0,
326
+ className: v,
327
+ photoIndex: l,
328
+ ...y
329
+ } = o, z = n.slice(l).length > 1;
330
+ return /* @__PURE__ */ N(
331
+ U,
324
332
  {
325
- className: r(s.dialog, I),
333
+ className: r(i.dialog, v),
326
334
  onClose: e,
327
- ...h,
335
+ ...y,
328
336
  children: [
329
- /* @__PURE__ */ n(z, { className: r(s.topActions), children: /* @__PURE__ */ n(
330
- S,
337
+ /* @__PURE__ */ a(x, { className: r(i.topActions), children: /* @__PURE__ */ a(
338
+ P,
331
339
  {
332
340
  onClick: e,
333
- className: r(s.close),
334
- "aria-label": b[i].back,
335
- children: /* @__PURE__ */ n(
341
+ className: r(i.close),
342
+ "aria-label": p[s].back,
343
+ children: /* @__PURE__ */ a(
336
344
  "img",
337
345
  {
338
- width: 40,
339
- height: 40,
340
- src: to,
341
- alt: b[i].back
346
+ width: R,
347
+ height: R,
348
+ src: ao,
349
+ alt: p[s].back
342
350
  }
343
351
  )
344
352
  }
345
353
  ) }),
346
- /* @__PURE__ */ n(E, { className: r(s.title), children: b[i]["photo-crop"] }),
347
- /* @__PURE__ */ T(M, { className: r(s.content), children: [
348
- a && /* @__PURE__ */ n(
349
- j,
354
+ /* @__PURE__ */ a($, { className: r(i.title), children: p[s]["photo-crop"] }),
355
+ /* @__PURE__ */ N(V, { className: r(i.content, z && i.many), children: [
356
+ z && /* @__PURE__ */ a("span", {}),
357
+ !!n.length && /* @__PURE__ */ a(
358
+ D,
350
359
  {
351
- className: r(s.crop),
352
- crop: l,
353
- circularCrop: c,
354
- keepSelection: v,
355
- aspect: C,
356
- minWidth: f,
357
- minHeight: f,
358
- onChange: d,
359
- children: /* @__PURE__ */ n(
360
+ className: r(i.crop),
361
+ crop: c[l],
362
+ circularCrop: S,
363
+ keepSelection: _,
364
+ aspect: d,
365
+ minWidth: h,
366
+ minHeight: h,
367
+ onChange: g,
368
+ children: /* @__PURE__ */ a(
360
369
  "img",
361
370
  {
362
- onLoad: u,
363
- src: a,
364
- ref: m,
365
- alt: b[i]["photo-crop"],
371
+ onLoad: b,
372
+ src: n[l],
373
+ ref: f,
374
+ alt: p[s]["photo-crop"],
366
375
  draggable: !1
367
376
  }
368
377
  )
369
378
  }
370
379
  ),
371
- p && /* @__PURE__ */ n(U, { className: r(s.dialogText), children: p })
380
+ z && /* @__PURE__ */ a(M, { photoSources: n, photoIndex: l })
372
381
  ] }),
373
- /* @__PURE__ */ n(z, { className: r(s.botActions), children: /* @__PURE__ */ n(
374
- J,
382
+ u && /* @__PURE__ */ a(x, { className: r(i.dialogText), children: u }),
383
+ /* @__PURE__ */ a(x, { className: r(i.botActions), children: z ? /* @__PURE__ */ N(E, { children: [
384
+ /* @__PURE__ */ a(
385
+ T,
386
+ {
387
+ buttonSize: "small",
388
+ buttonColor: "blue",
389
+ buttonVariant: "outlined",
390
+ buttonWeight: 500,
391
+ className: r(i.button),
392
+ onClick: B,
393
+ children: p[s].skip
394
+ }
395
+ ),
396
+ /* @__PURE__ */ a(
397
+ T,
398
+ {
399
+ buttonSize: "small",
400
+ buttonColor: "blue",
401
+ buttonVariant: "filled",
402
+ buttonWeight: 500,
403
+ className: r(i.button),
404
+ onClick: I,
405
+ children: p[s].continue
406
+ }
407
+ )
408
+ ] }) : /* @__PURE__ */ a(
409
+ T,
375
410
  {
376
411
  minWidth: "100%",
377
412
  buttonSize: "small",
378
413
  buttonColor: "blue",
379
414
  buttonVariant: "filled",
380
- onClick: y,
381
- children: b[i].crop
415
+ buttonWeight: 500,
416
+ className: r(i.button),
417
+ onClick: C,
418
+ children: p[s].crop
382
419
  }
383
420
  ) })
384
421
  ]
@@ -386,5 +423,5 @@ const to = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
386
423
  );
387
424
  };
388
425
  export {
389
- Io as UploadDialog
426
+ Lo as UploadDialog
390
427
  };
@@ -39,3 +39,6 @@ export declare const PIXEL_UNIT = "px";
39
39
  export declare const MS_UNIT = "ms";
40
40
  export declare const MB_UNIT = "mb";
41
41
  export declare const MB_FRACTION_DIGITS = 1;
42
+ export declare const FULL_CROP_SIZE = 100;
43
+ export declare const MAX_ASPECT_RATIO = 2;
44
+ export declare const MIN_ASPECT_RATIO = 0.5;
@@ -1,14 +1,14 @@
1
1
  import { BYTE_TO_KILOBYTE as T } from "../../constants.js";
2
- const S = 1, e = 670, E = ".jpg", _ = ".jpeg", G = ".png", M = ".svg", P = ".bmp", o = ".gif", I = ".ico", A = ".webp", p = [
3
- E,
2
+ const m = 1, C = 670, _ = ".jpg", E = ".jpeg", M = ".png", P = ".svg", G = ".bmp", A = ".gif", I = ".ico", o = ".webp", e = [
4
3
  _,
5
- G,
4
+ E,
6
5
  M,
7
6
  P,
8
- o,
7
+ G,
9
8
  A,
9
+ o,
10
10
  I
11
- ], n = "image/jpg", c = "image/jpeg", s = "image/png", t = "image/svg+xml", O = "image/bmp", Y = "image/gif", g = "image/webp", i = "image/x-icon", m = "image/vnd.microsoft.icon", X = [
11
+ ], n = "image/jpg", c = "image/jpeg", s = "image/png", t = "image/svg+xml", O = "image/bmp", Y = "image/gif", g = "image/webp", S = "image/x-icon", N = "image/vnd.microsoft.icon", X = [
12
12
  n,
13
13
  c,
14
14
  s,
@@ -16,49 +16,52 @@ const S = 1, e = 670, E = ".jpg", _ = ".jpeg", G = ".png", M = ".svg", P = ".bmp
16
16
  O,
17
17
  Y,
18
18
  g,
19
- i,
20
- m
21
- ], C = {
22
- JPEG_IMAGE_TYPE: [E, _],
23
- JPG_IMAGE_TYPE: [E, _],
24
- PNG_IMAGE_TYPE: [G],
25
- GIF_IMAGE_TYPE: [o],
26
- SVG_IMAGE_TYPE: [M],
27
- BMP_IMAGE_TYPE: [P],
28
- WEBP_IMAGE_TYPE: [A],
19
+ S,
20
+ N
21
+ ], p = {
22
+ JPEG_IMAGE_TYPE: [_, E],
23
+ JPG_IMAGE_TYPE: [_, E],
24
+ PNG_IMAGE_TYPE: [M],
25
+ GIF_IMAGE_TYPE: [A],
26
+ SVG_IMAGE_TYPE: [P],
27
+ BMP_IMAGE_TYPE: [G],
28
+ WEBP_IMAGE_TYPE: [o],
29
29
  ICO_IMAGE_TYPE: [I],
30
30
  MICROSOFT_ICO_IMAGE_TYPE: [I]
31
- }, U = 500, F = 5 * T * T, B = "2d", a = "high", D = "%", L = "px", R = "ms", J = "mb", b = 1;
31
+ }, U = 500, F = 5 * T * T, B = "2d", L = "high", R = "%", a = "px", D = "ms", J = "mb", b = 1, f = 100, j = 2, r = 0.5;
32
32
  export {
33
- P as BMP_IMAGE_EXT,
33
+ G as BMP_IMAGE_EXT,
34
34
  O as BMP_IMAGE_TYPE,
35
- S as DEFAULT_ASPECT_RATIO,
35
+ m as DEFAULT_ASPECT_RATIO,
36
36
  F as DEFAULT_FILE_MAX_SIZE,
37
- e as DEFAULT_MIN_DIMENSION,
37
+ C as DEFAULT_MIN_DIMENSION,
38
38
  U as DEFAULT_TIMEOUT,
39
- o as GIF_IMAGE_EXT,
39
+ f as FULL_CROP_SIZE,
40
+ A as GIF_IMAGE_EXT,
40
41
  Y as GIF_IMAGE_TYPE,
41
42
  I as ICO_IMAGE_EXT,
42
- i as ICO_IMAGE_TYPE,
43
- _ as JPEG_IMAGE_EXT,
43
+ S as ICO_IMAGE_TYPE,
44
+ E as JPEG_IMAGE_EXT,
44
45
  c as JPEG_IMAGE_TYPE,
45
- E as JPG_IMAGE_EXT,
46
+ _ as JPG_IMAGE_EXT,
46
47
  n as JPG_IMAGE_TYPE,
48
+ j as MAX_ASPECT_RATIO,
47
49
  b as MB_FRACTION_DIGITS,
48
50
  J as MB_UNIT,
49
- m as MICROSOFT_ICO_IMAGE_TYPE,
50
- C as MIME_TO_EXT,
51
- R as MS_UNIT,
51
+ N as MICROSOFT_ICO_IMAGE_TYPE,
52
+ p as MIME_TO_EXT,
53
+ r as MIN_ASPECT_RATIO,
54
+ D as MS_UNIT,
52
55
  B as PHOTO_CANVAS_CONTEXT,
53
- a as PHOTO_SMOOTHING_QUALITY,
54
- L as PIXEL_UNIT,
55
- G as PNG_IMAGE_EXT,
56
+ L as PHOTO_SMOOTHING_QUALITY,
57
+ a as PIXEL_UNIT,
58
+ M as PNG_IMAGE_EXT,
56
59
  s as PNG_IMAGE_TYPE,
57
- D as PRECENT_UNIT,
58
- p as SUPPORTED_IMAGE_EXTENSIONS,
60
+ R as PRECENT_UNIT,
61
+ e as SUPPORTED_IMAGE_EXTENSIONS,
59
62
  X as SUPPORTED_IMAGE_MIME_TYPES,
60
- M as SVG_IMAGE_EXT,
63
+ P as SVG_IMAGE_EXT,
61
64
  t as SVG_IMAGE_TYPE,
62
- A as WEBP_IMAGE_EXT,
65
+ o as WEBP_IMAGE_EXT,
63
66
  g as WEBP_IMAGE_TYPE
64
67
  };
@@ -18,7 +18,10 @@ const e = {
18
18
  "timeout-error": "Photo loading timed out",
19
19
  "paint-error": "Failed to render photo",
20
20
  "read-abort": "Reading of photo was interrupted",
21
- "paint-abort": "Rendering of photo was interrupted"
21
+ "paint-abort": "Rendering of photo was interrupted",
22
+ continue: "Continue",
23
+ skip: "Skip area selection",
24
+ aspect: "The aspect ratio of the cropped image must not be greater than 2"
22
25
  },
23
26
  ru: {
24
27
  upload: "Загрузить фото",
@@ -39,7 +42,10 @@ const e = {
39
42
  "timeout-error": "Превышено время загрузки фотографии",
40
43
  "paint-error": "Не удалось отрисовать фотографию",
41
44
  "read-abort": "Чтение фотографии было прервано",
42
- "paint-abort": "Отрисовка фотографии была прервана"
45
+ "paint-abort": "Отрисовка фотографии была прервана",
46
+ continue: "Продолжить",
47
+ skip: "Пропустить выбор области",
48
+ aspect: "Соотношение сторон обрезаемого изображения не должно быть больше 2"
43
49
  }
44
50
  };
45
51
  export {