@hai-dev/ui-kit 1.1.12 → 1.2.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.
- package/dist/{Box-TrgOqpYk.js → Box-BgNAyP2L.js} +2 -2
- package/dist/{Button-BN3fv8kr.js → Button-DTV8ztWw.js} +5 -5
- package/dist/{ButtonBase-CSWuFxUv.js → ButtonBase-C4krg_zd.js} +3 -3
- package/dist/{CircularProgress-sPARyPfh.js → CircularProgress-BoaEg4rF.js} +3 -3
- package/dist/{Dialog-Cf0d7zi7.js → Dialog-BK9lMUKV.js} +12 -11
- package/dist/{DialogTitle-BtvmXSZP.js → DialogTitle-ByUfLB5M.js} +4 -4
- package/dist/{Typography-Bjd6ZHeX.js → Typography-BMyz0ZCh.js} +4 -4
- package/dist/assets/button.css +1 -1
- package/dist/assets/circular-progress-loader.css +1 -1
- package/dist/assets/code-input.css +1 -1
- package/dist/assets/error-upload-dialog.css +1 -1
- package/dist/assets/inter.css +1 -0
- package/dist/assets/photo-list.css +1 -1
- package/dist/assets/upload-dialog-errors.css +1 -1
- package/dist/button.module-C0UNQnBk.js +40 -0
- package/dist/chainPropTypes-DgqFdXGi.js +532 -0
- package/dist/components/button/button-content.js +11 -11
- package/dist/components/button/button.d.ts +18 -0
- package/dist/components/button/button.js +42 -35
- package/dist/components/button/constants.d.ts +17 -0
- package/dist/components/button/constants.js +28 -11
- package/dist/components/button/types.d.ts +11 -8
- package/dist/components/button/utils/get-button-classnames.d.ts +6 -0
- package/dist/components/button/utils/get-button-classnames.js +22 -10
- package/dist/components/circular-progress-loader/circular-progress-loader.js +14 -13
- package/dist/components/code-input/code-input.js +114 -112
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +22 -21
- package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +5 -1
- package/dist/components/photo-crop-uploader/components/photo-list/constants.js +6 -2
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +136 -33
- package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +2 -0
- package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.d.ts +4 -0
- package/dist/components/photo-crop-uploader/components/photo-list/use-container-size.js +22 -0
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +1 -1
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog-errors.js +4 -3
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +156 -145
- package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.d.ts +4 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.js +31 -0
- package/dist/components/photo-crop-uploader/locale.js +6 -2
- package/dist/{createTheme-D8R2Cz2N.js → createTheme-BoOmbNvy.js} +426 -390
- package/dist/{extendSxProp-Cw_ym9sl.js → extendSxProp-BaUCVMKV.js} +2 -1
- package/dist/{index-CL3JU48X.js → index-h5oTv8GF.js} +3 -3
- package/dist/{memoTheme-D5VCpQCz.js → memoTheme-BYBJ2Fe6.js} +1 -1
- package/dist/refType-CsohaiiT.js +60 -0
- package/dist/{upload-dialog-errors-DHl0bh1n.js → upload-dialog-errors-CCRxzIZp.js} +53 -53
- package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
- package/dist/utils/debounce.d.ts +5 -0
- package/dist/utils/debounce.js +12 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +4 -0
- package/package.json +10 -2
- package/dist/button.module-BZPPmSAS.js +0 -21
- package/dist/chainPropTypes-DiJb1lGa.js +0 -568
- package/dist/refType-CUEs_vK5.js +0 -61
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as S, jsx as r, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import * as O from "react";
|
|
3
|
+
import { useState as q, useCallback as G } from "react";
|
|
4
|
+
import { useScaledMinDimension as J } from "./use-scaled-min-dimension.js";
|
|
5
|
+
import { S as Q } from "../../../../index-CcueJ2sD.js";
|
|
4
6
|
import { c as i } from "../../../../index-YnD2EP-S.js";
|
|
5
|
-
import { s as n, U as
|
|
6
|
-
import { PhotoList as
|
|
7
|
-
import { localizedText as
|
|
8
|
-
import { EN_LOCALE as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { D as
|
|
12
|
-
import { a as A, b as
|
|
13
|
-
import { CircularProgressLoader as
|
|
14
|
-
import { g as
|
|
15
|
-
import { m as M } from "../../../../memoTheme-
|
|
7
|
+
import { s as n, U as X } from "../../../../upload-dialog-errors-CCRxzIZp.js";
|
|
8
|
+
import { PhotoList as oo } from "../photo-list/photo-list.js";
|
|
9
|
+
import { localizedText as g } from "../../locale.js";
|
|
10
|
+
import { EN_LOCALE as eo, DARK_THEME as to } from "../../../../constants.js";
|
|
11
|
+
import { DEFAULT_MIN_DIMENSION as ao, DEFAULT_ASPECT_RATIO as ro } from "../../constants.js";
|
|
12
|
+
import '../../../../assets/inter.css';import '../../../../assets/upload-dialog.css';/* empty css */
|
|
13
|
+
import { D as k } from "../../../../Dialog-BK9lMUKV.js";
|
|
14
|
+
import { a as A, b as D, D as no } from "../../../../DialogTitle-ByUfLB5M.js";
|
|
15
|
+
import { CircularProgressLoader as io } from "../../../circular-progress-loader/circular-progress-loader.js";
|
|
16
|
+
import { g as so, a as lo, c as co, b as f, P as t } from "../../../../createTheme-BoOmbNvy.js";
|
|
17
|
+
import { m as M } from "../../../../memoTheme-BYBJ2Fe6.js";
|
|
16
18
|
import { c as U } from "../../../../createSimplePaletteValueFilter-B7--0ryQ.js";
|
|
17
|
-
import { u as
|
|
18
|
-
import { u as
|
|
19
|
-
import { B as
|
|
20
|
-
import { C as
|
|
21
|
-
import { Button as
|
|
22
|
-
|
|
23
|
-
return
|
|
19
|
+
import { u as po, c as go, s as j, b as uo } from "../../../../chainPropTypes-DgqFdXGi.js";
|
|
20
|
+
import { u as mo } from "../../../../useId-CK6Kn3Tn.js";
|
|
21
|
+
import { B as fo } from "../../../../ButtonBase-C4krg_zd.js";
|
|
22
|
+
import { C as bo } from "../../../../CircularProgress-BoaEg4rF.js";
|
|
23
|
+
import { Button as P } from "../../../button/button.js";
|
|
24
|
+
function ho(o) {
|
|
25
|
+
return so("MuiIconButton", o);
|
|
24
26
|
}
|
|
25
|
-
const W =
|
|
27
|
+
const W = lo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary", "colorSecondary", "colorError", "colorInfo", "colorSuccess", "colorWarning", "edgeStart", "edgeEnd", "sizeSmall", "sizeMedium", "sizeLarge", "loading", "loadingIndicator", "loadingWrapper"]), Co = (o) => {
|
|
26
28
|
const {
|
|
27
29
|
classes: e,
|
|
28
|
-
disabled:
|
|
29
|
-
color:
|
|
30
|
-
edge:
|
|
31
|
-
size:
|
|
32
|
-
loading:
|
|
33
|
-
} = o,
|
|
34
|
-
root: ["root",
|
|
30
|
+
disabled: a,
|
|
31
|
+
color: l,
|
|
32
|
+
edge: u,
|
|
33
|
+
size: b,
|
|
34
|
+
loading: c
|
|
35
|
+
} = o, m = {
|
|
36
|
+
root: ["root", c && "loading", a && "disabled", l !== "default" && `color${f(l)}`, u && `edge${f(u)}`, `size${f(b)}`],
|
|
35
37
|
loadingIndicator: ["loadingIndicator"],
|
|
36
38
|
loadingWrapper: ["loadingWrapper"]
|
|
37
39
|
};
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
+
return go(m, ho, e);
|
|
41
|
+
}, yo = j(fo, {
|
|
40
42
|
name: "MuiIconButton",
|
|
41
43
|
slot: "Root",
|
|
42
44
|
overridesResolver: (o, e) => {
|
|
43
45
|
const {
|
|
44
|
-
ownerState:
|
|
46
|
+
ownerState: a
|
|
45
47
|
} = o;
|
|
46
|
-
return [e.root,
|
|
48
|
+
return [e.root, a.loading && e.loading, a.color !== "default" && e[`color${f(a.color)}`], a.edge && e[`edge${f(a.edge)}`], e[`size${f(a.size)}`]];
|
|
47
49
|
}
|
|
48
50
|
})(M(({
|
|
49
51
|
theme: o
|
|
@@ -148,7 +150,7 @@ const W = oo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary
|
|
|
148
150
|
[`&.${W.loading}`]: {
|
|
149
151
|
color: "transparent"
|
|
150
152
|
}
|
|
151
|
-
}))),
|
|
153
|
+
}))), vo = j("span", {
|
|
152
154
|
name: "MuiIconButton",
|
|
153
155
|
slot: "LoadingIndicator"
|
|
154
156
|
})(({
|
|
@@ -169,60 +171,60 @@ const W = oo("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary
|
|
|
169
171
|
display: "flex"
|
|
170
172
|
}
|
|
171
173
|
}]
|
|
172
|
-
})),
|
|
173
|
-
const
|
|
174
|
+
})), F = /* @__PURE__ */ O.forwardRef(function(e, a) {
|
|
175
|
+
const l = po({
|
|
174
176
|
props: e,
|
|
175
177
|
name: "MuiIconButton"
|
|
176
178
|
}), {
|
|
177
|
-
edge:
|
|
178
|
-
children:
|
|
179
|
-
className:
|
|
180
|
-
color:
|
|
179
|
+
edge: u = !1,
|
|
180
|
+
children: b,
|
|
181
|
+
className: c,
|
|
182
|
+
color: m = "default",
|
|
181
183
|
disabled: y = !1,
|
|
182
|
-
disableFocusRipple:
|
|
184
|
+
disableFocusRipple: v = !1,
|
|
183
185
|
size: z = "medium",
|
|
184
|
-
id:
|
|
185
|
-
loading:
|
|
186
|
-
loadingIndicator:
|
|
187
|
-
...
|
|
188
|
-
} =
|
|
186
|
+
id: I,
|
|
187
|
+
loading: d = null,
|
|
188
|
+
loadingIndicator: L,
|
|
189
|
+
...s
|
|
190
|
+
} = l, N = mo(I), B = L ?? /* @__PURE__ */ r(bo, {
|
|
189
191
|
"aria-labelledby": N,
|
|
190
192
|
color: "inherit",
|
|
191
193
|
size: 16
|
|
192
194
|
}), h = {
|
|
193
|
-
...
|
|
194
|
-
edge:
|
|
195
|
-
color:
|
|
195
|
+
...l,
|
|
196
|
+
edge: u,
|
|
197
|
+
color: m,
|
|
196
198
|
disabled: y,
|
|
197
|
-
disableFocusRipple:
|
|
198
|
-
loading:
|
|
199
|
+
disableFocusRipple: v,
|
|
200
|
+
loading: d,
|
|
199
201
|
loadingIndicator: B,
|
|
200
202
|
size: z
|
|
201
|
-
},
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
id:
|
|
204
|
-
className:
|
|
203
|
+
}, p = Co(h);
|
|
204
|
+
return /* @__PURE__ */ S(yo, {
|
|
205
|
+
id: d ? N : I,
|
|
206
|
+
className: co(p.root, c),
|
|
205
207
|
centerRipple: !0,
|
|
206
|
-
focusRipple: !
|
|
207
|
-
disabled: y ||
|
|
208
|
-
ref:
|
|
209
|
-
...
|
|
208
|
+
focusRipple: !v,
|
|
209
|
+
disabled: y || d,
|
|
210
|
+
ref: a,
|
|
211
|
+
...s,
|
|
210
212
|
ownerState: h,
|
|
211
|
-
children: [typeof
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
className:
|
|
213
|
+
children: [typeof d == "boolean" && // use plain HTML span to minimize the runtime overhead
|
|
214
|
+
/* @__PURE__ */ r("span", {
|
|
215
|
+
className: p.loadingWrapper,
|
|
214
216
|
style: {
|
|
215
217
|
display: "contents"
|
|
216
218
|
},
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
className:
|
|
219
|
+
children: /* @__PURE__ */ r(vo, {
|
|
220
|
+
className: p.loadingIndicator,
|
|
219
221
|
ownerState: h,
|
|
220
|
-
children:
|
|
222
|
+
children: d && B
|
|
221
223
|
})
|
|
222
|
-
}),
|
|
224
|
+
}), b]
|
|
223
225
|
});
|
|
224
226
|
});
|
|
225
|
-
process.env.NODE_ENV !== "production" && (
|
|
227
|
+
process.env.NODE_ENV !== "production" && (F.propTypes = {
|
|
226
228
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
227
229
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
228
230
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -230,7 +232,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
230
232
|
/**
|
|
231
233
|
* The icon to display.
|
|
232
234
|
*/
|
|
233
|
-
children:
|
|
235
|
+
children: uo(t.node, (o) => O.Children.toArray(o.children).some((a) => /* @__PURE__ */ O.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(`
|
|
234
236
|
`)) : null),
|
|
235
237
|
/**
|
|
236
238
|
* Override or extend the styles applied to the component.
|
|
@@ -301,149 +303,158 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
301
303
|
*/
|
|
302
304
|
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object])
|
|
303
305
|
});
|
|
304
|
-
const
|
|
306
|
+
const Io = "data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2.27623%200.391122C1.75553%20-0.129577%200.911316%20-0.129578%200.390616%200.391122C-0.130083%200.911821%20-0.130083%201.75604%200.390616%202.27674L6.04747%207.93359L0.390616%2013.5904C-0.130083%2014.1111%20-0.130083%2014.9554%200.390616%2015.4761C0.911316%2015.9968%201.75553%2015.9968%202.27623%2015.4761L7.93309%209.81921L13.5899%2015.4761C14.1106%2015.9968%2014.9549%2015.9968%2015.4756%2015.4761C15.9963%2014.9554%2015.9963%2014.1111%2015.4756%2013.5904L9.81871%207.93359L15.4756%202.27674C15.9963%201.75604%2015.9963%200.911822%2015.4756%200.391122C14.9549%20-0.129577%2014.1106%20-0.129578%2013.5899%200.391123L7.93309%206.04798L2.27623%200.391122Z'%20fill='%233AA8FF'/%3e%3c/svg%3e", _o = (o) => {
|
|
305
307
|
const {
|
|
306
308
|
onCloseDialogHandler: e,
|
|
307
|
-
photoSources:
|
|
308
|
-
photoCrops:
|
|
309
|
-
onCropChange:
|
|
309
|
+
photoSources: a = [],
|
|
310
|
+
photoCrops: l = [],
|
|
311
|
+
onCropChange: u = () => {
|
|
310
312
|
},
|
|
311
|
-
onPhotoLoad:
|
|
312
|
-
imageRef:
|
|
313
|
-
photoError:
|
|
313
|
+
onPhotoLoad: b,
|
|
314
|
+
imageRef: c,
|
|
315
|
+
photoError: m,
|
|
314
316
|
onPhotoCrop: y,
|
|
315
|
-
onNextPhoto:
|
|
317
|
+
onNextPhoto: v,
|
|
316
318
|
onSkipCrop: z,
|
|
317
|
-
onClearErrors:
|
|
318
|
-
minDimension:
|
|
319
|
-
aspectRatio:
|
|
320
|
-
locale:
|
|
319
|
+
onClearErrors: I,
|
|
320
|
+
minDimension: d = ao,
|
|
321
|
+
aspectRatio: L = ro,
|
|
322
|
+
locale: s = eo,
|
|
321
323
|
circular: N,
|
|
322
324
|
keepSelection: B = !0,
|
|
323
325
|
photoSourceLoading: h,
|
|
324
|
-
className:
|
|
326
|
+
className: p,
|
|
325
327
|
photoIndex: C,
|
|
326
|
-
loadingValue:
|
|
327
|
-
errors:
|
|
328
|
-
theme:
|
|
329
|
-
...
|
|
330
|
-
} = o,
|
|
331
|
-
|
|
332
|
-
|
|
328
|
+
loadingValue: $,
|
|
329
|
+
errors: R,
|
|
330
|
+
theme: T = to,
|
|
331
|
+
...x
|
|
332
|
+
} = o, E = a.slice(C).length > 1, [V, _] = q(null), H = G(
|
|
333
|
+
(w) => {
|
|
334
|
+
c && (c.current = w), _(w);
|
|
335
|
+
},
|
|
336
|
+
[c]
|
|
337
|
+
), { minWidth: K, minHeight: Y } = J(V, d);
|
|
338
|
+
return h || !a.length && !R?.length ? /* @__PURE__ */ r(
|
|
339
|
+
k,
|
|
333
340
|
{
|
|
334
|
-
className: i(n.dialog,
|
|
341
|
+
className: i(n.dialog, p, n[T]),
|
|
335
342
|
onClose: e,
|
|
336
|
-
...
|
|
337
|
-
children: /* @__PURE__ */
|
|
343
|
+
...x,
|
|
344
|
+
children: /* @__PURE__ */ r(A, { className: i(n.content), children: /* @__PURE__ */ r(io, { value: $ }) })
|
|
338
345
|
}
|
|
339
|
-
) :
|
|
340
|
-
|
|
346
|
+
) : R?.length ? /* @__PURE__ */ r(
|
|
347
|
+
k,
|
|
341
348
|
{
|
|
342
|
-
className: i(n.dialog,
|
|
349
|
+
className: i(n.dialog, p, n[T]),
|
|
343
350
|
onClose: e,
|
|
344
|
-
...
|
|
345
|
-
children: /* @__PURE__ */
|
|
346
|
-
|
|
351
|
+
...x,
|
|
352
|
+
children: /* @__PURE__ */ r(
|
|
353
|
+
X,
|
|
347
354
|
{
|
|
348
|
-
locale:
|
|
349
|
-
photoSources:
|
|
350
|
-
errors:
|
|
355
|
+
locale: s,
|
|
356
|
+
photoSources: a,
|
|
357
|
+
errors: R,
|
|
351
358
|
onCloseDialogHandler: e,
|
|
352
|
-
onClearErrors:
|
|
359
|
+
onClearErrors: I
|
|
353
360
|
}
|
|
354
361
|
)
|
|
355
362
|
}
|
|
356
|
-
) : /* @__PURE__ */
|
|
357
|
-
|
|
363
|
+
) : /* @__PURE__ */ S(
|
|
364
|
+
k,
|
|
358
365
|
{
|
|
359
|
-
className: i(n.dialog,
|
|
366
|
+
className: i(n.dialog, p, n[T]),
|
|
360
367
|
onClose: e,
|
|
361
|
-
...
|
|
368
|
+
...x,
|
|
362
369
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
370
|
+
/* @__PURE__ */ r(D, { className: i(n.topActions), children: /* @__PURE__ */ r(
|
|
371
|
+
F,
|
|
365
372
|
{
|
|
366
373
|
onClick: e,
|
|
367
374
|
className: i(n.close),
|
|
368
|
-
"aria-label":
|
|
369
|
-
children: /* @__PURE__ */
|
|
375
|
+
"aria-label": g[s].back,
|
|
376
|
+
children: /* @__PURE__ */ r(
|
|
370
377
|
"img",
|
|
371
378
|
{
|
|
372
379
|
draggable: !1,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
src: uo,
|
|
376
|
-
alt: p[l].back
|
|
380
|
+
src: Io,
|
|
381
|
+
alt: g[s].back
|
|
377
382
|
}
|
|
378
383
|
)
|
|
379
384
|
}
|
|
380
385
|
) }),
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
V,
|
|
386
|
+
/* @__PURE__ */ r(no, { className: i(n.title), children: g[s]["photo-crop"] }),
|
|
387
|
+
/* @__PURE__ */ S(A, { className: i(n.content, E && n.many), children: [
|
|
388
|
+
!!a.length && /* @__PURE__ */ r(
|
|
389
|
+
Q,
|
|
386
390
|
{
|
|
387
391
|
className: i(n.crop),
|
|
388
|
-
crop:
|
|
392
|
+
crop: l[C],
|
|
389
393
|
circularCrop: N,
|
|
390
394
|
keepSelection: B,
|
|
391
|
-
aspect:
|
|
392
|
-
minWidth:
|
|
393
|
-
minHeight:
|
|
394
|
-
onChange:
|
|
395
|
-
children: /* @__PURE__ */
|
|
395
|
+
aspect: L,
|
|
396
|
+
minWidth: K,
|
|
397
|
+
minHeight: Y,
|
|
398
|
+
onChange: u,
|
|
399
|
+
children: /* @__PURE__ */ r(
|
|
396
400
|
"img",
|
|
397
401
|
{
|
|
398
|
-
onLoad:
|
|
399
|
-
src:
|
|
400
|
-
ref:
|
|
401
|
-
alt:
|
|
402
|
+
onLoad: b,
|
|
403
|
+
src: a[C],
|
|
404
|
+
ref: H,
|
|
405
|
+
alt: g[s]["photo-crop"],
|
|
402
406
|
draggable: !1
|
|
403
407
|
},
|
|
404
408
|
C
|
|
405
409
|
)
|
|
406
410
|
}
|
|
407
411
|
),
|
|
408
|
-
|
|
412
|
+
E && /* @__PURE__ */ r(
|
|
413
|
+
oo,
|
|
414
|
+
{
|
|
415
|
+
locale: s,
|
|
416
|
+
photoSources: a,
|
|
417
|
+
photoIndex: C
|
|
418
|
+
}
|
|
419
|
+
)
|
|
409
420
|
] }),
|
|
410
|
-
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
421
|
+
m && /* @__PURE__ */ r(D, { className: i(n.dialogText), children: m }),
|
|
422
|
+
/* @__PURE__ */ r(D, { className: i(n.botActions), children: E ? /* @__PURE__ */ S(Z, { children: [
|
|
423
|
+
/* @__PURE__ */ r(
|
|
424
|
+
P,
|
|
414
425
|
{
|
|
415
426
|
buttonSize: "small",
|
|
416
|
-
buttonColor: "
|
|
427
|
+
buttonColor: "red",
|
|
417
428
|
buttonVariant: "outlined",
|
|
418
429
|
buttonWeight: 500,
|
|
419
430
|
className: i(n.button),
|
|
420
431
|
onClick: z,
|
|
421
|
-
children:
|
|
432
|
+
children: g[s].skip
|
|
422
433
|
}
|
|
423
434
|
),
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
|
|
435
|
+
/* @__PURE__ */ r(
|
|
436
|
+
P,
|
|
426
437
|
{
|
|
427
438
|
buttonSize: "small",
|
|
428
439
|
buttonColor: "blue",
|
|
429
|
-
buttonVariant: "
|
|
440
|
+
buttonVariant: "outlined",
|
|
430
441
|
buttonWeight: 500,
|
|
431
442
|
className: i(n.button),
|
|
432
|
-
onClick:
|
|
433
|
-
children:
|
|
443
|
+
onClick: v,
|
|
444
|
+
children: g[s].continue
|
|
434
445
|
}
|
|
435
446
|
)
|
|
436
|
-
] }) : /* @__PURE__ */
|
|
437
|
-
|
|
447
|
+
] }) : /* @__PURE__ */ r(
|
|
448
|
+
P,
|
|
438
449
|
{
|
|
439
450
|
minWidth: "100%",
|
|
440
451
|
buttonSize: "small",
|
|
441
452
|
buttonColor: "blue",
|
|
442
|
-
buttonVariant: "
|
|
453
|
+
buttonVariant: "outlined",
|
|
443
454
|
buttonWeight: 500,
|
|
444
455
|
className: i(n.button),
|
|
445
456
|
onClick: y,
|
|
446
|
-
children:
|
|
457
|
+
children: g[s].crop
|
|
447
458
|
}
|
|
448
459
|
) })
|
|
449
460
|
]
|
|
@@ -451,5 +462,5 @@ const uo = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
|
|
|
451
462
|
);
|
|
452
463
|
};
|
|
453
464
|
export {
|
|
454
|
-
|
|
465
|
+
_o as UploadDialog
|
|
455
466
|
};
|
package/dist/components/photo-crop-uploader/components/upload-dialog/use-scaled-min-dimension.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useState as o, useEffect as s } from "react";
|
|
2
|
+
import { debounce as i } from "../../../../utils/debounce.js";
|
|
3
|
+
const f = 100;
|
|
4
|
+
function u(e, t) {
|
|
5
|
+
const { naturalWidth: d, naturalHeight: c, width: r, height: a } = e;
|
|
6
|
+
return !d || !c || !r || !a ? { minWidth: t, minHeight: t } : {
|
|
7
|
+
minWidth: Math.min(t * (r / d), r),
|
|
8
|
+
minHeight: Math.min(t * (a / c), a)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function v(e, t) {
|
|
12
|
+
const [d, c] = o({
|
|
13
|
+
minWidth: t,
|
|
14
|
+
minHeight: t
|
|
15
|
+
});
|
|
16
|
+
return s(() => {
|
|
17
|
+
if (!e) {
|
|
18
|
+
c({ minWidth: t, minHeight: t });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const r = () => c(u(e, t)), a = i(([n]) => {
|
|
22
|
+
c(u(n.target, t));
|
|
23
|
+
}, f), h = new ResizeObserver(a);
|
|
24
|
+
return h.observe(e), e.addEventListener("load", r), r(), () => {
|
|
25
|
+
a.cancel(), h.disconnect(), e.removeEventListener("load", r);
|
|
26
|
+
};
|
|
27
|
+
}, [e, t]), d;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
v as useScaledMinDimension
|
|
31
|
+
};
|
|
@@ -25,7 +25,9 @@ const e = {
|
|
|
25
25
|
aspect: "The aspect ratio of the cropped image must not be greater than 2",
|
|
26
26
|
close: "Close",
|
|
27
27
|
"not-uploaded": "Files were not uploaded",
|
|
28
|
-
"some-not-uploaded": "Some files were not uploaded"
|
|
28
|
+
"some-not-uploaded": "Some files were not uploaded",
|
|
29
|
+
"photo-in-queue": "Photo in queue",
|
|
30
|
+
more: "more"
|
|
29
31
|
},
|
|
30
32
|
ru: {
|
|
31
33
|
upload: "Загрузить файл",
|
|
@@ -53,7 +55,9 @@ const e = {
|
|
|
53
55
|
aspect: "Соотношение сторон обрезаемого изображения не должно быть больше 2",
|
|
54
56
|
close: "Закрыть",
|
|
55
57
|
"not-uploaded": "Файлы не были загружены",
|
|
56
|
-
"some-not-uploaded": "Некоторые файлы не были загружены"
|
|
58
|
+
"some-not-uploaded": "Некоторые файлы не были загружены",
|
|
59
|
+
"photo-in-queue": "Фотография в очереди",
|
|
60
|
+
more: "Еще"
|
|
57
61
|
}
|
|
58
62
|
};
|
|
59
63
|
export {
|