@hai-dev/ui-kit 1.1.11 → 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 +37 -34
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/types.d.ts +2 -1
- 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/types.d.ts +2 -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 +159 -147
- 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/components/photo-crop-uploader/photo-crop-uploader.js +131 -128
- package/dist/components/photo-crop-uploader/types.d.ts +2 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +5 -3
- 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/index.d.ts +3 -3
- package/dist/index.js +26 -24
- package/dist/{memoTheme-D5VCpQCz.js → memoTheme-BYBJ2Fe6.js} +1 -1
- package/dist/refType-CsohaiiT.js +60 -0
- package/dist/types.d.ts +2 -1
- package/dist/{upload-dialog-errors-Cyz6_7n4.js → upload-dialog-errors-CCRxzIZp.js} +69 -67
- 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,51 +1,53 @@
|
|
|
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
|
|
13
|
-
import { CircularProgressLoader as
|
|
14
|
-
import { g as
|
|
15
|
-
import { m as
|
|
16
|
-
import { c as
|
|
17
|
-
import { u as
|
|
18
|
-
import { u as
|
|
19
|
-
import { B as
|
|
20
|
-
import { C as
|
|
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";
|
|
18
|
+
import { c as U } from "../../../../createSimplePaletteValueFilter-B7--0ryQ.js";
|
|
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";
|
|
21
23
|
import { Button as P } from "../../../button/button.js";
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
+
function ho(o) {
|
|
25
|
+
return so("MuiIconButton", o);
|
|
24
26
|
}
|
|
25
|
-
const
|
|
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
|
|
50
52
|
}) => ({
|
|
51
53
|
textAlign: "center",
|
|
@@ -100,7 +102,7 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
100
102
|
marginRight: -3
|
|
101
103
|
}
|
|
102
104
|
}]
|
|
103
|
-
})),
|
|
105
|
+
})), M(({
|
|
104
106
|
theme: o
|
|
105
107
|
}) => ({
|
|
106
108
|
variants: [{
|
|
@@ -110,14 +112,14 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
110
112
|
style: {
|
|
111
113
|
color: "inherit"
|
|
112
114
|
}
|
|
113
|
-
}, ...Object.entries(o.palette).filter(
|
|
115
|
+
}, ...Object.entries(o.palette).filter(U()).map(([e]) => ({
|
|
114
116
|
props: {
|
|
115
117
|
color: e
|
|
116
118
|
},
|
|
117
119
|
style: {
|
|
118
120
|
color: (o.vars || o).palette[e].main
|
|
119
121
|
}
|
|
120
|
-
})), ...Object.entries(o.palette).filter(
|
|
122
|
+
})), ...Object.entries(o.palette).filter(U()).map(([e]) => ({
|
|
121
123
|
props: {
|
|
122
124
|
color: e
|
|
123
125
|
},
|
|
@@ -141,14 +143,14 @@ const U = Q("MuiIconButton", ["root", "disabled", "colorInherit", "colorPrimary"
|
|
|
141
143
|
fontSize: o.typography.pxToRem(28)
|
|
142
144
|
}
|
|
143
145
|
}],
|
|
144
|
-
[`&.${
|
|
146
|
+
[`&.${W.disabled}`]: {
|
|
145
147
|
backgroundColor: "transparent",
|
|
146
148
|
color: (o.vars || o).palette.action.disabled
|
|
147
149
|
},
|
|
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 U = Q("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,148 +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
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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,
|
|
332
340
|
{
|
|
333
|
-
className: i(n.dialog,
|
|
341
|
+
className: i(n.dialog, p, n[T]),
|
|
334
342
|
onClose: e,
|
|
335
|
-
...
|
|
336
|
-
children: /* @__PURE__ */
|
|
343
|
+
...x,
|
|
344
|
+
children: /* @__PURE__ */ r(A, { className: i(n.content), children: /* @__PURE__ */ r(io, { value: $ }) })
|
|
337
345
|
}
|
|
338
|
-
) :
|
|
339
|
-
|
|
346
|
+
) : R?.length ? /* @__PURE__ */ r(
|
|
347
|
+
k,
|
|
340
348
|
{
|
|
341
|
-
className: i(n.dialog,
|
|
349
|
+
className: i(n.dialog, p, n[T]),
|
|
342
350
|
onClose: e,
|
|
343
|
-
...
|
|
344
|
-
children: /* @__PURE__ */
|
|
345
|
-
|
|
351
|
+
...x,
|
|
352
|
+
children: /* @__PURE__ */ r(
|
|
353
|
+
X,
|
|
346
354
|
{
|
|
347
|
-
locale:
|
|
348
|
-
photoSources:
|
|
349
|
-
errors:
|
|
355
|
+
locale: s,
|
|
356
|
+
photoSources: a,
|
|
357
|
+
errors: R,
|
|
350
358
|
onCloseDialogHandler: e,
|
|
351
|
-
onClearErrors:
|
|
359
|
+
onClearErrors: I
|
|
352
360
|
}
|
|
353
361
|
)
|
|
354
362
|
}
|
|
355
|
-
) : /* @__PURE__ */
|
|
356
|
-
|
|
363
|
+
) : /* @__PURE__ */ S(
|
|
364
|
+
k,
|
|
357
365
|
{
|
|
358
|
-
className: i(n.dialog,
|
|
366
|
+
className: i(n.dialog, p, n[T]),
|
|
359
367
|
onClose: e,
|
|
360
|
-
...
|
|
368
|
+
...x,
|
|
361
369
|
children: [
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
-
|
|
370
|
+
/* @__PURE__ */ r(D, { className: i(n.topActions), children: /* @__PURE__ */ r(
|
|
371
|
+
F,
|
|
364
372
|
{
|
|
365
373
|
onClick: e,
|
|
366
374
|
className: i(n.close),
|
|
367
|
-
"aria-label":
|
|
368
|
-
children: /* @__PURE__ */
|
|
375
|
+
"aria-label": g[s].back,
|
|
376
|
+
children: /* @__PURE__ */ r(
|
|
369
377
|
"img",
|
|
370
378
|
{
|
|
371
379
|
draggable: !1,
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
src: po,
|
|
375
|
-
alt: p[l].back
|
|
380
|
+
src: Io,
|
|
381
|
+
alt: g[s].back
|
|
376
382
|
}
|
|
377
383
|
)
|
|
378
384
|
}
|
|
379
385
|
) }),
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
/* @__PURE__ */
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
$,
|
|
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,
|
|
385
390
|
{
|
|
386
391
|
className: i(n.crop),
|
|
387
|
-
crop:
|
|
392
|
+
crop: l[C],
|
|
388
393
|
circularCrop: N,
|
|
389
394
|
keepSelection: B,
|
|
390
|
-
aspect:
|
|
391
|
-
minWidth:
|
|
392
|
-
minHeight:
|
|
393
|
-
onChange:
|
|
394
|
-
children: /* @__PURE__ */
|
|
395
|
+
aspect: L,
|
|
396
|
+
minWidth: K,
|
|
397
|
+
minHeight: Y,
|
|
398
|
+
onChange: u,
|
|
399
|
+
children: /* @__PURE__ */ r(
|
|
395
400
|
"img",
|
|
396
401
|
{
|
|
397
|
-
onLoad:
|
|
398
|
-
src:
|
|
399
|
-
ref:
|
|
400
|
-
alt:
|
|
402
|
+
onLoad: b,
|
|
403
|
+
src: a[C],
|
|
404
|
+
ref: H,
|
|
405
|
+
alt: g[s]["photo-crop"],
|
|
401
406
|
draggable: !1
|
|
402
407
|
},
|
|
403
408
|
C
|
|
404
409
|
)
|
|
405
410
|
}
|
|
406
411
|
),
|
|
407
|
-
|
|
412
|
+
E && /* @__PURE__ */ r(
|
|
413
|
+
oo,
|
|
414
|
+
{
|
|
415
|
+
locale: s,
|
|
416
|
+
photoSources: a,
|
|
417
|
+
photoIndex: C
|
|
418
|
+
}
|
|
419
|
+
)
|
|
408
420
|
] }),
|
|
409
|
-
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
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(
|
|
412
424
|
P,
|
|
413
425
|
{
|
|
414
426
|
buttonSize: "small",
|
|
415
|
-
buttonColor: "
|
|
427
|
+
buttonColor: "red",
|
|
416
428
|
buttonVariant: "outlined",
|
|
417
429
|
buttonWeight: 500,
|
|
418
430
|
className: i(n.button),
|
|
419
431
|
onClick: z,
|
|
420
|
-
children:
|
|
432
|
+
children: g[s].skip
|
|
421
433
|
}
|
|
422
434
|
),
|
|
423
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ r(
|
|
424
436
|
P,
|
|
425
437
|
{
|
|
426
438
|
buttonSize: "small",
|
|
427
439
|
buttonColor: "blue",
|
|
428
|
-
buttonVariant: "
|
|
440
|
+
buttonVariant: "outlined",
|
|
429
441
|
buttonWeight: 500,
|
|
430
442
|
className: i(n.button),
|
|
431
|
-
onClick:
|
|
432
|
-
children:
|
|
443
|
+
onClick: v,
|
|
444
|
+
children: g[s].continue
|
|
433
445
|
}
|
|
434
446
|
)
|
|
435
|
-
] }) : /* @__PURE__ */
|
|
447
|
+
] }) : /* @__PURE__ */ r(
|
|
436
448
|
P,
|
|
437
449
|
{
|
|
438
450
|
minWidth: "100%",
|
|
439
451
|
buttonSize: "small",
|
|
440
452
|
buttonColor: "blue",
|
|
441
|
-
buttonVariant: "
|
|
453
|
+
buttonVariant: "outlined",
|
|
442
454
|
buttonWeight: 500,
|
|
443
455
|
className: i(n.button),
|
|
444
456
|
onClick: y,
|
|
445
|
-
children:
|
|
457
|
+
children: g[s].crop
|
|
446
458
|
}
|
|
447
459
|
) })
|
|
448
460
|
]
|
|
@@ -450,5 +462,5 @@ const po = "data:image/svg+xml,%3csvg%20width='46'%20height='46'%20viewBox='0%20
|
|
|
450
462
|
);
|
|
451
463
|
};
|
|
452
464
|
export {
|
|
453
|
-
|
|
465
|
+
_o as UploadDialog
|
|
454
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 {
|