@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.
- package/dist/{Button-0AB7oP6Y.js → Button-DDlVTM6i.js} +3 -2
- package/dist/ButtonBase-CXGZ-DBC.js +1346 -0
- package/dist/{CircularProgress-BD6BPlN2.js → CircularProgress-CscJm1An.js} +9 -8
- package/dist/{DialogTitle-iOQ7wKEt.js → DialogTitle-KN1sayHD.js} +453 -555
- package/dist/assets/photo-list.css +1 -0
- package/dist/assets/upload-dialog.css +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/photo-crop-uploader/components/error-upload-dialog/error-upload-dialog.js +87 -23
- package/dist/components/photo-crop-uploader/components/photo-list/constants.d.ts +1 -0
- package/dist/components/photo-crop-uploader/components/photo-list/constants.js +4 -0
- package/dist/components/photo-crop-uploader/components/photo-list/index.d.ts +1 -0
- package/dist/components/photo-crop-uploader/components/photo-list/index.js +4 -0
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.d.ts +3 -0
- package/dist/components/photo-crop-uploader/components/photo-list/photo-list.js +88 -0
- package/dist/components/photo-crop-uploader/components/photo-list/types.d.ts +8 -0
- package/dist/components/photo-crop-uploader/components/photo-list/types.js +1 -0
- package/dist/components/photo-crop-uploader/components/upload-button/types.d.ts +3 -1
- package/dist/components/photo-crop-uploader/components/upload-button/upload-button.js +72 -62
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.d.ts +1 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/constants.js +4 -0
- package/dist/components/photo-crop-uploader/components/upload-dialog/types.d.ts +5 -2
- package/dist/components/photo-crop-uploader/components/upload-dialog/upload-dialog.js +172 -135
- package/dist/components/photo-crop-uploader/constants.d.ts +3 -0
- package/dist/components/photo-crop-uploader/constants.js +36 -33
- package/dist/components/photo-crop-uploader/locale.js +8 -2
- package/dist/components/photo-crop-uploader/photo-crop-uploader.js +163 -112
- package/dist/components/photo-crop-uploader/types.d.ts +3 -1
- package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.d.ts +3 -0
- package/dist/components/photo-crop-uploader/utils/get-default-cropped-photo.js +32 -0
- package/dist/components/photo-crop-uploader/utils/get-photo-crop.d.ts +1 -1
- package/dist/components/photo-crop-uploader/utils/get-photo-crop.js +12 -12
- package/dist/components/photo-crop-uploader/utils/index.d.ts +1 -0
- package/dist/components/photo-crop-uploader/utils/index.js +4 -2
- package/dist/components/photo-crop-uploader/utils/read-photo.js +33 -30
- package/dist/createTheme-DSHGFfg6.js +4124 -0
- package/dist/extendSxProp-CzeED7BH.js +49 -0
- package/package.json +1 -1
- package/dist/ButtonBase-Bw_3RZmN.js +0 -5453
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { S as
|
|
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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
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
|
|
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:
|
|
19
|
-
color:
|
|
20
|
-
edge:
|
|
21
|
-
size:
|
|
22
|
-
loading:
|
|
23
|
-
} = o,
|
|
24
|
-
root: ["root",
|
|
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
|
|
29
|
-
},
|
|
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:
|
|
37
|
+
ownerState: n
|
|
35
38
|
} = o;
|
|
36
|
-
return [e.root,
|
|
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
|
-
})(
|
|
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
|
-
})),
|
|
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(
|
|
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(
|
|
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
|
-
[`&.${
|
|
137
|
+
[`&.${k.disabled}`]: {
|
|
135
138
|
backgroundColor: "transparent",
|
|
136
139
|
color: (o.vars || o).palette.action.disabled
|
|
137
140
|
},
|
|
138
|
-
[`&.${
|
|
141
|
+
[`&.${k.loading}`]: {
|
|
139
142
|
color: "transparent"
|
|
140
143
|
}
|
|
141
|
-
}))),
|
|
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
|
-
})),
|
|
163
|
-
const
|
|
165
|
+
})), P = /* @__PURE__ */ L.forwardRef(function(e, n) {
|
|
166
|
+
const c = J({
|
|
164
167
|
props: e,
|
|
165
168
|
name: "MuiIconButton"
|
|
166
169
|
}), {
|
|
167
|
-
edge:
|
|
168
|
-
children:
|
|
169
|
-
className:
|
|
170
|
-
color:
|
|
171
|
-
disabled:
|
|
172
|
-
disableFocusRipple:
|
|
173
|
-
size:
|
|
174
|
-
id:
|
|
175
|
-
loading:
|
|
176
|
-
loadingIndicator:
|
|
177
|
-
...
|
|
178
|
-
} =
|
|
179
|
-
"aria-labelledby":
|
|
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
|
-
...
|
|
184
|
-
edge:
|
|
185
|
-
color:
|
|
186
|
-
disabled:
|
|
187
|
-
disableFocusRipple:
|
|
188
|
-
loading:
|
|
189
|
-
loadingIndicator:
|
|
190
|
-
size:
|
|
191
|
-
},
|
|
192
|
-
return /* @__PURE__ */
|
|
193
|
-
id:
|
|
194
|
-
className:
|
|
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: !
|
|
197
|
-
disabled:
|
|
198
|
-
ref:
|
|
199
|
-
...
|
|
200
|
-
ownerState:
|
|
201
|
-
children: [typeof
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
className:
|
|
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__ */
|
|
208
|
-
className:
|
|
209
|
-
ownerState:
|
|
210
|
-
children:
|
|
210
|
+
children: /* @__PURE__ */ a(no, {
|
|
211
|
+
className: y.loadingIndicator,
|
|
212
|
+
ownerState: l,
|
|
213
|
+
children: d && v
|
|
211
214
|
})
|
|
212
|
-
}),
|
|
215
|
+
}), b]
|
|
213
216
|
});
|
|
214
217
|
});
|
|
215
|
-
process.env.NODE_ENV !== "production" && (
|
|
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:
|
|
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
|
|
295
|
-
dialog:
|
|
296
|
-
topActions:
|
|
297
|
-
close:
|
|
298
|
-
botActions:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
onCropChange:
|
|
311
|
+
photoSources: n = [],
|
|
312
|
+
photoCrops: c = [],
|
|
313
|
+
onCropChange: g = () => {
|
|
309
314
|
},
|
|
310
|
-
onPhotoLoad:
|
|
311
|
-
imageRef:
|
|
312
|
-
photoError:
|
|
313
|
-
onPhotoCrop:
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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(
|
|
333
|
+
className: r(i.dialog, v),
|
|
326
334
|
onClose: e,
|
|
327
|
-
...
|
|
335
|
+
...y,
|
|
328
336
|
children: [
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
|
|
337
|
+
/* @__PURE__ */ a(x, { className: r(i.topActions), children: /* @__PURE__ */ a(
|
|
338
|
+
P,
|
|
331
339
|
{
|
|
332
340
|
onClick: e,
|
|
333
|
-
className: r(
|
|
334
|
-
"aria-label":
|
|
335
|
-
children: /* @__PURE__ */
|
|
341
|
+
className: r(i.close),
|
|
342
|
+
"aria-label": p[s].back,
|
|
343
|
+
children: /* @__PURE__ */ a(
|
|
336
344
|
"img",
|
|
337
345
|
{
|
|
338
|
-
width:
|
|
339
|
-
height:
|
|
340
|
-
src:
|
|
341
|
-
alt:
|
|
346
|
+
width: R,
|
|
347
|
+
height: R,
|
|
348
|
+
src: ao,
|
|
349
|
+
alt: p[s].back
|
|
342
350
|
}
|
|
343
351
|
)
|
|
344
352
|
}
|
|
345
353
|
) }),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
|
|
349
|
-
|
|
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(
|
|
352
|
-
crop: l,
|
|
353
|
-
circularCrop:
|
|
354
|
-
keepSelection:
|
|
355
|
-
aspect:
|
|
356
|
-
minWidth:
|
|
357
|
-
minHeight:
|
|
358
|
-
onChange:
|
|
359
|
-
children: /* @__PURE__ */
|
|
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:
|
|
363
|
-
src:
|
|
364
|
-
ref:
|
|
365
|
-
alt:
|
|
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
|
-
|
|
380
|
+
z && /* @__PURE__ */ a(M, { photoSources: n, photoIndex: l })
|
|
372
381
|
] }),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
|
|
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
|
-
|
|
381
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
4
|
+
E,
|
|
6
5
|
M,
|
|
7
6
|
P,
|
|
8
|
-
|
|
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",
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
],
|
|
22
|
-
JPEG_IMAGE_TYPE: [
|
|
23
|
-
JPG_IMAGE_TYPE: [
|
|
24
|
-
PNG_IMAGE_TYPE: [
|
|
25
|
-
GIF_IMAGE_TYPE: [
|
|
26
|
-
SVG_IMAGE_TYPE: [
|
|
27
|
-
BMP_IMAGE_TYPE: [
|
|
28
|
-
WEBP_IMAGE_TYPE: [
|
|
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",
|
|
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
|
-
|
|
33
|
+
G as BMP_IMAGE_EXT,
|
|
34
34
|
O as BMP_IMAGE_TYPE,
|
|
35
|
-
|
|
35
|
+
m as DEFAULT_ASPECT_RATIO,
|
|
36
36
|
F as DEFAULT_FILE_MAX_SIZE,
|
|
37
|
-
|
|
37
|
+
C as DEFAULT_MIN_DIMENSION,
|
|
38
38
|
U as DEFAULT_TIMEOUT,
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
43
|
+
S as ICO_IMAGE_TYPE,
|
|
44
|
+
E as JPEG_IMAGE_EXT,
|
|
44
45
|
c as JPEG_IMAGE_TYPE,
|
|
45
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
58
|
-
|
|
60
|
+
R as PRECENT_UNIT,
|
|
61
|
+
e as SUPPORTED_IMAGE_EXTENSIONS,
|
|
59
62
|
X as SUPPORTED_IMAGE_MIME_TYPES,
|
|
60
|
-
|
|
63
|
+
P as SVG_IMAGE_EXT,
|
|
61
64
|
t as SVG_IMAGE_TYPE,
|
|
62
|
-
|
|
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 {
|