@genai-fi/base 4.0.3 → 4.0.5
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,6 +1,9 @@
|
|
|
1
1
|
export declare const Button: import('@emotion/styled').StyledComponent<import('@mui/material').ButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
2
2
|
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
3
3
|
}, "disabled" | "className" | "style" | "classes" | "children" | "color" | "sx" | "tabIndex" | "href" | "action" | "loading" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loadingIndicator" | "loadingPosition" | "startIcon" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
|
+
export declare const VerticalButton: import('@emotion/styled').StyledComponent<import('@mui/material').ButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
5
|
+
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
6
|
+
}, "disabled" | "className" | "style" | "classes" | "children" | "color" | "sx" | "tabIndex" | "href" | "action" | "loading" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loadingIndicator" | "loadingPosition" | "startIcon" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
4
7
|
export declare const LargeButton: import('@emotion/styled').StyledComponent<import('@mui/material').ButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
5
8
|
ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
6
9
|
}, "disabled" | "className" | "style" | "classes" | "children" | "color" | "sx" | "tabIndex" | "href" | "action" | "loading" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loadingIndicator" | "loadingPosition" | "startIcon" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
@@ -3,6 +3,13 @@ import { B as o } from "../../Button-BeUmwrlS.js";
|
|
|
3
3
|
const e = t(o)({
|
|
4
4
|
textTransform: "none"
|
|
5
5
|
}), s = t(o)({
|
|
6
|
+
flexDirection: "column",
|
|
7
|
+
padding: "5px 8px",
|
|
8
|
+
"& .MuiButton-startIcon": {
|
|
9
|
+
margin: "0"
|
|
10
|
+
},
|
|
11
|
+
textTransform: "none"
|
|
12
|
+
}), a = t(o)({
|
|
6
13
|
textTransform: "none",
|
|
7
14
|
fontWeight: "bold",
|
|
8
15
|
fontSize: "1.2rem",
|
|
@@ -10,5 +17,6 @@ const e = t(o)({
|
|
|
10
17
|
});
|
|
11
18
|
export {
|
|
12
19
|
e as Button,
|
|
13
|
-
|
|
20
|
+
a as LargeButton,
|
|
21
|
+
s as VerticalButton
|
|
14
22
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
interface
|
|
2
|
-
interval?: number;
|
|
3
|
-
capture?: boolean;
|
|
4
|
-
disable?: boolean;
|
|
1
|
+
interface Callbacks {
|
|
5
2
|
onCapture?: (image: HTMLCanvasElement) => void | Promise<void>;
|
|
6
3
|
onPreprocess?: (image: HTMLCanvasElement) => void | Promise<void>;
|
|
7
4
|
onPostprocess?: (image: HTMLCanvasElement) => void | Promise<void>;
|
|
8
5
|
onActivated?: (available: boolean) => void;
|
|
9
6
|
onFatal?: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface Props extends Callbacks {
|
|
9
|
+
interval?: number;
|
|
10
|
+
capture?: boolean;
|
|
11
|
+
disable?: boolean;
|
|
10
12
|
direct?: boolean;
|
|
11
13
|
hidden?: boolean;
|
|
12
14
|
size: number;
|
|
13
15
|
}
|
|
14
|
-
export default function Webcam({ interval, capture,
|
|
16
|
+
export default function Webcam({ interval, capture, disable, direct, hidden, size, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { IconButton as
|
|
6
|
-
import { c as
|
|
7
|
-
import { WebcamClass as
|
|
8
|
-
import { g as
|
|
9
|
-
import { g as
|
|
10
|
-
import { css as
|
|
11
|
-
import '../../assets/Webcam.css';function
|
|
1
|
+
import { jsx as c, jsxs as j, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import * as X from "react";
|
|
3
|
+
import { useState as T, useRef as b, useEffect as C, useCallback as B } from "react";
|
|
4
|
+
import { useTranslation as H } from "react-i18next";
|
|
5
|
+
import { IconButton as P } from "@mui/material";
|
|
6
|
+
import { c as K } from "../../createSvgIcon-DQhMxTx4.js";
|
|
7
|
+
import { WebcamClass as L } from "./webcamClass.js";
|
|
8
|
+
import { g as G, u as J, s as Q, c as Y, a as Z, m as W } from "../../DefaultPropsProvider-BurgXZzw.js";
|
|
9
|
+
import { g as tt, P as n } from "../../createTheme-DV959X3d.js";
|
|
10
|
+
import { css as z, keyframes as q } from "@emotion/react";
|
|
11
|
+
import '../../assets/Webcam.css';function et(t) {
|
|
12
12
|
return String(t).match(/[\d.\-+]*\s*(.*)/)[1] || "";
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function nt(t) {
|
|
15
15
|
return parseFloat(t);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
container:
|
|
19
|
-
wrapContainer:
|
|
20
|
-
flipButton:
|
|
17
|
+
const rt = "_container_u6uf5_1", at = "_wrapContainer_u6uf5_5", ot = "_flipButton_u6uf5_10", F = {
|
|
18
|
+
container: rt,
|
|
19
|
+
wrapContainer: at,
|
|
20
|
+
flipButton: ot
|
|
21
21
|
};
|
|
22
|
-
function
|
|
23
|
-
return
|
|
22
|
+
function it(t) {
|
|
23
|
+
return tt("MuiSkeleton", t);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
const
|
|
25
|
+
G("MuiSkeleton", ["root", "text", "rectangular", "rounded", "circular", "pulse", "wave", "withChildren", "fitContent", "heightAuto"]);
|
|
26
|
+
const st = (t) => {
|
|
27
27
|
const {
|
|
28
|
-
classes:
|
|
29
|
-
variant:
|
|
30
|
-
animation:
|
|
31
|
-
hasChildren:
|
|
32
|
-
width:
|
|
33
|
-
height:
|
|
28
|
+
classes: o,
|
|
29
|
+
variant: a,
|
|
30
|
+
animation: i,
|
|
31
|
+
hasChildren: p,
|
|
32
|
+
width: y,
|
|
33
|
+
height: m
|
|
34
34
|
} = t;
|
|
35
|
-
return
|
|
36
|
-
root: ["root",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
35
|
+
return Z({
|
|
36
|
+
root: ["root", a, i, p && "withChildren", p && !y && "fitContent", p && !m && "heightAuto"]
|
|
37
|
+
}, it, o);
|
|
38
|
+
}, M = q`
|
|
39
39
|
0% {
|
|
40
40
|
opacity: 1;
|
|
41
41
|
}
|
|
@@ -47,7 +47,7 @@ const lt = (t) => {
|
|
|
47
47
|
100% {
|
|
48
48
|
opacity: 1;
|
|
49
49
|
}
|
|
50
|
-
`,
|
|
50
|
+
`, _ = q`
|
|
51
51
|
0% {
|
|
52
52
|
transform: translateX(-100%);
|
|
53
53
|
}
|
|
@@ -60,25 +60,25 @@ const lt = (t) => {
|
|
|
60
60
|
100% {
|
|
61
61
|
transform: translateX(100%);
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
64
|
-
animation: ${
|
|
65
|
-
` : null,
|
|
63
|
+
`, ct = typeof M != "string" ? z`
|
|
64
|
+
animation: ${M} 2s ease-in-out 0.5s infinite;
|
|
65
|
+
` : null, lt = typeof _ != "string" ? z`
|
|
66
66
|
&::after {
|
|
67
|
-
animation: ${
|
|
67
|
+
animation: ${_} 2s linear 0.5s infinite;
|
|
68
68
|
}
|
|
69
|
-
` : null,
|
|
69
|
+
` : null, ut = Q("span", {
|
|
70
70
|
name: "MuiSkeleton",
|
|
71
71
|
slot: "Root",
|
|
72
|
-
overridesResolver: (t,
|
|
72
|
+
overridesResolver: (t, o) => {
|
|
73
73
|
const {
|
|
74
|
-
ownerState:
|
|
74
|
+
ownerState: a
|
|
75
75
|
} = t;
|
|
76
|
-
return [
|
|
76
|
+
return [o.root, o[a.variant], a.animation !== !1 && o[a.animation], a.hasChildren && o.withChildren, a.hasChildren && !a.width && o.fitContent, a.hasChildren && !a.height && o.heightAuto];
|
|
77
77
|
}
|
|
78
|
-
})(
|
|
78
|
+
})(W(({
|
|
79
79
|
theme: t
|
|
80
80
|
}) => {
|
|
81
|
-
const
|
|
81
|
+
const o = et(t.shape.borderRadius) || "px", a = nt(t.shape.borderRadius);
|
|
82
82
|
return {
|
|
83
83
|
display: "block",
|
|
84
84
|
// Create a "on paper" color with sufficient contrast retaining the color
|
|
@@ -94,7 +94,7 @@ const lt = (t) => {
|
|
|
94
94
|
height: "auto",
|
|
95
95
|
transformOrigin: "0 55%",
|
|
96
96
|
transform: "scale(1, 0.60)",
|
|
97
|
-
borderRadius: `${
|
|
97
|
+
borderRadius: `${a}${o}/${Math.round(a / 0.6 * 10) / 10}${o}`,
|
|
98
98
|
"&:empty:before": {
|
|
99
99
|
content: '"\\00a0"'
|
|
100
100
|
}
|
|
@@ -115,8 +115,8 @@ const lt = (t) => {
|
|
|
115
115
|
}
|
|
116
116
|
}, {
|
|
117
117
|
props: ({
|
|
118
|
-
ownerState:
|
|
119
|
-
}) =>
|
|
118
|
+
ownerState: i
|
|
119
|
+
}) => i.hasChildren,
|
|
120
120
|
style: {
|
|
121
121
|
"& > *": {
|
|
122
122
|
visibility: "hidden"
|
|
@@ -124,15 +124,15 @@ const lt = (t) => {
|
|
|
124
124
|
}
|
|
125
125
|
}, {
|
|
126
126
|
props: ({
|
|
127
|
-
ownerState:
|
|
128
|
-
}) =>
|
|
127
|
+
ownerState: i
|
|
128
|
+
}) => i.hasChildren && !i.width,
|
|
129
129
|
style: {
|
|
130
130
|
maxWidth: "fit-content"
|
|
131
131
|
}
|
|
132
132
|
}, {
|
|
133
133
|
props: ({
|
|
134
|
-
ownerState:
|
|
135
|
-
}) =>
|
|
134
|
+
ownerState: i
|
|
135
|
+
}) => i.hasChildren && !i.height,
|
|
136
136
|
style: {
|
|
137
137
|
height: "auto"
|
|
138
138
|
}
|
|
@@ -140,8 +140,8 @@ const lt = (t) => {
|
|
|
140
140
|
props: {
|
|
141
141
|
animation: "pulse"
|
|
142
142
|
},
|
|
143
|
-
style:
|
|
144
|
-
animation: `${
|
|
143
|
+
style: ct || {
|
|
144
|
+
animation: `${M} 2s ease-in-out 0.5s infinite`
|
|
145
145
|
}
|
|
146
146
|
}, {
|
|
147
147
|
props: {
|
|
@@ -172,47 +172,47 @@ const lt = (t) => {
|
|
|
172
172
|
props: {
|
|
173
173
|
animation: "wave"
|
|
174
174
|
},
|
|
175
|
-
style:
|
|
175
|
+
style: lt || {
|
|
176
176
|
"&::after": {
|
|
177
|
-
animation: `${
|
|
177
|
+
animation: `${_} 2s linear 0.5s infinite`
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
}]
|
|
181
181
|
};
|
|
182
|
-
})),
|
|
183
|
-
const
|
|
184
|
-
props:
|
|
182
|
+
})), E = /* @__PURE__ */ X.forwardRef(function(o, a) {
|
|
183
|
+
const i = J({
|
|
184
|
+
props: o,
|
|
185
185
|
name: "MuiSkeleton"
|
|
186
186
|
}), {
|
|
187
|
-
animation:
|
|
188
|
-
className:
|
|
189
|
-
component:
|
|
190
|
-
height:
|
|
191
|
-
style:
|
|
192
|
-
variant:
|
|
193
|
-
width:
|
|
194
|
-
...
|
|
195
|
-
} =
|
|
196
|
-
...
|
|
197
|
-
animation:
|
|
198
|
-
component:
|
|
199
|
-
variant:
|
|
200
|
-
hasChildren: !!
|
|
201
|
-
},
|
|
202
|
-
return /* @__PURE__ */
|
|
203
|
-
as:
|
|
204
|
-
ref:
|
|
205
|
-
className:
|
|
206
|
-
ownerState:
|
|
207
|
-
...
|
|
187
|
+
animation: p = "pulse",
|
|
188
|
+
className: y,
|
|
189
|
+
component: m = "span",
|
|
190
|
+
height: h,
|
|
191
|
+
style: e,
|
|
192
|
+
variant: A = "text",
|
|
193
|
+
width: v,
|
|
194
|
+
...f
|
|
195
|
+
} = i, g = {
|
|
196
|
+
...i,
|
|
197
|
+
animation: p,
|
|
198
|
+
component: m,
|
|
199
|
+
variant: A,
|
|
200
|
+
hasChildren: !!f.children
|
|
201
|
+
}, u = st(g);
|
|
202
|
+
return /* @__PURE__ */ c(ut, {
|
|
203
|
+
as: m,
|
|
204
|
+
ref: a,
|
|
205
|
+
className: Y(u.root, y),
|
|
206
|
+
ownerState: g,
|
|
207
|
+
...f,
|
|
208
208
|
style: {
|
|
209
|
-
width:
|
|
210
|
-
height:
|
|
211
|
-
...
|
|
209
|
+
width: v,
|
|
210
|
+
height: h,
|
|
211
|
+
...e
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
});
|
|
215
|
-
process.env.NODE_ENV !== "production" && (
|
|
215
|
+
process.env.NODE_ENV !== "production" && (E.propTypes = {
|
|
216
216
|
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
217
217
|
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
218
218
|
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
|
|
@@ -222,169 +222,159 @@ process.env.NODE_ENV !== "production" && (K.propTypes = {
|
|
|
222
222
|
* If `false` the animation effect is disabled.
|
|
223
223
|
* @default 'pulse'
|
|
224
224
|
*/
|
|
225
|
-
animation:
|
|
225
|
+
animation: n.oneOf(["pulse", "wave", !1]),
|
|
226
226
|
/**
|
|
227
227
|
* Optional children to infer width and height from.
|
|
228
228
|
*/
|
|
229
|
-
children:
|
|
229
|
+
children: n.node,
|
|
230
230
|
/**
|
|
231
231
|
* Override or extend the styles applied to the component.
|
|
232
232
|
*/
|
|
233
|
-
classes:
|
|
233
|
+
classes: n.object,
|
|
234
234
|
/**
|
|
235
235
|
* @ignore
|
|
236
236
|
*/
|
|
237
|
-
className:
|
|
237
|
+
className: n.string,
|
|
238
238
|
/**
|
|
239
239
|
* The component used for the root node.
|
|
240
240
|
* Either a string to use a HTML element or a component.
|
|
241
241
|
*/
|
|
242
|
-
component:
|
|
242
|
+
component: n.elementType,
|
|
243
243
|
/**
|
|
244
244
|
* Height of the skeleton.
|
|
245
245
|
* Useful when you don't want to adapt the skeleton to a text element but for instance a card.
|
|
246
246
|
*/
|
|
247
|
-
height:
|
|
247
|
+
height: n.oneOfType([n.number, n.string]),
|
|
248
248
|
/**
|
|
249
249
|
* @ignore
|
|
250
250
|
*/
|
|
251
|
-
style:
|
|
251
|
+
style: n.object,
|
|
252
252
|
/**
|
|
253
253
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
254
254
|
*/
|
|
255
|
-
sx:
|
|
255
|
+
sx: n.oneOfType([n.arrayOf(n.oneOfType([n.func, n.object, n.bool])), n.func, n.object]),
|
|
256
256
|
/**
|
|
257
257
|
* The type of content that will be rendered.
|
|
258
258
|
* @default 'text'
|
|
259
259
|
*/
|
|
260
|
-
variant:
|
|
260
|
+
variant: n.oneOfType([n.oneOf(["circular", "rectangular", "rounded", "text"]), n.string]),
|
|
261
261
|
/**
|
|
262
262
|
* Width of the skeleton.
|
|
263
263
|
* Useful when the skeleton is inside an inline element with no width of its own.
|
|
264
264
|
*/
|
|
265
|
-
width:
|
|
265
|
+
width: n.oneOfType([n.number, n.string])
|
|
266
266
|
});
|
|
267
|
-
const
|
|
267
|
+
const U = K([/* @__PURE__ */ c("path", {
|
|
268
268
|
d: "M16 7h-1l-1-1h-4L9 7H8c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-4 7c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"
|
|
269
|
-
}, "0"), /* @__PURE__ */
|
|
269
|
+
}, "0"), /* @__PURE__ */ c("path", {
|
|
270
270
|
d: "m8.57.51 4.48 4.48V2.04c4.72.47 8.48 4.23 8.95 8.95h2C23.34 3.02 15.49-1.59 8.57.51m2.38 21.45c-4.72-.47-8.48-4.23-8.95-8.95H0c.66 7.97 8.51 12.58 15.43 10.48l-4.48-4.48z"
|
|
271
271
|
}, "1")], "Cameraswitch");
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
onActivated: p,
|
|
282
|
-
onFatal: w,
|
|
283
|
-
size: l
|
|
284
|
-
}) {
|
|
285
|
-
const { t: h } = J(), [e, T] = M(null), b = O(null), C = O(-1), _ = O(0), d = O(), [k, L] = M(!1), [R, D] = M(!1);
|
|
286
|
-
y(() => {
|
|
287
|
-
d.current = async (n) => {
|
|
288
|
-
var c;
|
|
289
|
-
if (o) {
|
|
290
|
-
d.current && (C.current = window.requestAnimationFrame(d.current));
|
|
272
|
+
function bt({ interval: t, capture: o, disable: a, direct: i, hidden: p, size: y, ...m }) {
|
|
273
|
+
const { t: h } = H(), [e, A] = T(null), v = b(null), f = b(-1), g = b(0), u = b(), s = b({}), [k, V] = T(!1), [R, I] = T(!1);
|
|
274
|
+
s.current = m;
|
|
275
|
+
const d = Math.floor(y);
|
|
276
|
+
C(() => {
|
|
277
|
+
u.current = async (r) => {
|
|
278
|
+
var l;
|
|
279
|
+
if (a) {
|
|
280
|
+
u.current && (f.current = window.requestAnimationFrame(u.current));
|
|
291
281
|
return;
|
|
292
282
|
}
|
|
293
283
|
if (e && e.canvas) {
|
|
294
284
|
e.update();
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
if (
|
|
298
|
-
await
|
|
285
|
+
const S = t !== void 0 ? t : 1e3;
|
|
286
|
+
if (s.current.onPreprocess && await s.current.onPreprocess(e.canvas), o && s.current.onCapture && r - g.current >= S) {
|
|
287
|
+
if (i && e.canvas)
|
|
288
|
+
await s.current.onCapture(e.canvas);
|
|
299
289
|
else {
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
290
|
+
const w = document.createElement("canvas");
|
|
291
|
+
w.width = e.canvas.width, w.height = e.canvas.height;
|
|
292
|
+
const x = w.getContext("2d");
|
|
293
|
+
x || console.error("Failed to get context"), x == null || x.drawImage(e.canvas, 0, 0), await s.current.onCapture(w);
|
|
304
294
|
}
|
|
305
|
-
|
|
295
|
+
g.current = r;
|
|
306
296
|
}
|
|
307
|
-
const
|
|
308
|
-
|
|
297
|
+
const O = (l = v.current) == null ? void 0 : l.getContext("2d");
|
|
298
|
+
O && (O.drawImage(e.canvas, 0, 0), s.current.onPostprocess && v.current && await s.current.onPostprocess(v.current));
|
|
309
299
|
}
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
}, [e, t,
|
|
313
|
-
const
|
|
314
|
-
async (
|
|
315
|
-
var
|
|
316
|
-
if (await
|
|
300
|
+
u.current && (f.current = window.requestAnimationFrame(u.current));
|
|
301
|
+
}, f.current === -1 && (f.current = window.requestAnimationFrame(u.current));
|
|
302
|
+
}, [e, t, o, i, a]);
|
|
303
|
+
const N = B(
|
|
304
|
+
async (r) => {
|
|
305
|
+
var l;
|
|
306
|
+
if (await r.setup({ facingMode: R ? "user" : "environment" }), r.webcam && (r.webcam.playsInline = !0, r.webcam.muted = !0, r.webcam.onsuspend = () => r.play(), A(r)), (l = navigator.mediaDevices) != null && l.enumerateDevices)
|
|
317
307
|
try {
|
|
318
|
-
(await navigator.mediaDevices.enumerateDevices()).filter((
|
|
319
|
-
} catch (
|
|
320
|
-
console.error(
|
|
308
|
+
(await navigator.mediaDevices.enumerateDevices()).filter((w) => w.kind === "videoinput").length > 1 && (k || V(!0), r.flip = R);
|
|
309
|
+
} catch (S) {
|
|
310
|
+
console.error(S);
|
|
321
311
|
}
|
|
322
|
-
return
|
|
312
|
+
return s.current.onActivated && s.current.onActivated(!0), r;
|
|
323
313
|
},
|
|
324
|
-
[
|
|
314
|
+
[R, k]
|
|
325
315
|
);
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}, [
|
|
329
|
-
const
|
|
330
|
-
return
|
|
331
|
-
|
|
316
|
+
C(() => {
|
|
317
|
+
o && (g.current = 0);
|
|
318
|
+
}, [o]), C(() => {
|
|
319
|
+
const r = new L(d, d, !0);
|
|
320
|
+
return N(r).catch((l) => {
|
|
321
|
+
s.current.onActivated && s.current.onActivated(!1), console.error("No webcam", l), s.current.onFatal && s.current.onFatal();
|
|
332
322
|
}), () => {
|
|
333
|
-
var
|
|
334
|
-
(
|
|
323
|
+
var l;
|
|
324
|
+
(l = r.webcam) != null && l.srcObject && r.stop();
|
|
335
325
|
};
|
|
336
|
-
}, [R,
|
|
337
|
-
var
|
|
338
|
-
|
|
339
|
-
}, [e]),
|
|
340
|
-
e && (
|
|
341
|
-
}, [e,
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
}, [
|
|
345
|
-
return
|
|
346
|
-
|
|
326
|
+
}, [R, N, d]), C(() => () => {
|
|
327
|
+
var r;
|
|
328
|
+
u.current = void 0, (r = e == null ? void 0 : e.webcam) != null && r.srcObject && e.stop();
|
|
329
|
+
}, [e]), C(() => {
|
|
330
|
+
e && (a ? e.pause() : e.play());
|
|
331
|
+
}, [e, a]);
|
|
332
|
+
const $ = B(() => {
|
|
333
|
+
I((r) => !r);
|
|
334
|
+
}, [I]);
|
|
335
|
+
return p ? /* @__PURE__ */ c(D, { children: k && /* @__PURE__ */ c(
|
|
336
|
+
P,
|
|
347
337
|
{
|
|
348
338
|
size: "large",
|
|
349
339
|
color: "inherit",
|
|
350
|
-
onClick:
|
|
340
|
+
onClick: $,
|
|
351
341
|
"aria-label": h("webcam.aria.flip"),
|
|
352
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ c(U, { fontSize: "large" })
|
|
353
343
|
}
|
|
354
|
-
) }) : /* @__PURE__ */
|
|
355
|
-
!e && /* @__PURE__ */
|
|
356
|
-
|
|
344
|
+
) }) : /* @__PURE__ */ j(D, { children: [
|
|
345
|
+
!e && /* @__PURE__ */ c(
|
|
346
|
+
E,
|
|
357
347
|
{
|
|
358
348
|
variant: "rounded",
|
|
359
|
-
width:
|
|
360
|
-
height:
|
|
349
|
+
width: d,
|
|
350
|
+
height: d
|
|
361
351
|
}
|
|
362
352
|
),
|
|
363
|
-
e && /* @__PURE__ */
|
|
364
|
-
k && /* @__PURE__ */
|
|
365
|
-
|
|
353
|
+
e && /* @__PURE__ */ j("div", { className: F.wrapContainer, children: [
|
|
354
|
+
k && /* @__PURE__ */ c(
|
|
355
|
+
P,
|
|
366
356
|
{
|
|
367
|
-
className:
|
|
357
|
+
className: F.flipButton,
|
|
368
358
|
size: "large",
|
|
369
359
|
color: "inherit",
|
|
370
|
-
onClick:
|
|
360
|
+
onClick: $,
|
|
371
361
|
"aria-label": h("webcam.aria.flip"),
|
|
372
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ c(U, { fontSize: "large" })
|
|
373
363
|
}
|
|
374
364
|
),
|
|
375
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ c(
|
|
376
366
|
"div",
|
|
377
367
|
{
|
|
378
368
|
"data-testid": "webcam",
|
|
379
|
-
className:
|
|
369
|
+
className: F.container,
|
|
380
370
|
role: "img",
|
|
381
371
|
"aria-label": h("webcam.aria.video"),
|
|
382
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ c(
|
|
383
373
|
"canvas",
|
|
384
374
|
{
|
|
385
|
-
width:
|
|
386
|
-
height:
|
|
387
|
-
ref:
|
|
375
|
+
width: d,
|
|
376
|
+
height: d,
|
|
377
|
+
ref: v
|
|
388
378
|
}
|
|
389
379
|
)
|
|
390
380
|
}
|
|
@@ -393,5 +383,5 @@ function kt({
|
|
|
393
383
|
] });
|
|
394
384
|
}
|
|
395
385
|
export {
|
|
396
|
-
|
|
386
|
+
bt as default
|
|
397
387
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as ConnectionStatus } from './components/ConnectionStatus/ConnectionStatus';
|
|
2
|
-
export { Button, LargeButton } from './components/Button/Button';
|
|
2
|
+
export { Button, LargeButton, VerticalButton } from './components/Button/Button';
|
|
3
3
|
export { default as usePeer } from './hooks/peer';
|
|
4
4
|
export type { SenderType, PeerEvent, PeerErrorType, PeerStatus, BuiltinEvent, Connection, PeerConnectionType, } from './services/peer2peer/types';
|
|
5
5
|
export { default as Peer2Peer } from './services/peer2peer/Peer2Peer';
|
package/dist/main.js
CHANGED
|
@@ -1,74 +1,75 @@
|
|
|
1
1
|
import { default as o } from "./components/ConnectionStatus/ConnectionStatus.js";
|
|
2
|
-
import { Button as t, LargeButton as f } from "./components/Button/Button.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { useID as
|
|
6
|
-
import { useOnlyOnce as
|
|
7
|
-
import { default as
|
|
8
|
-
import { theme as
|
|
9
|
-
import { default as
|
|
10
|
-
import { canvasFromDataTransfer as P, canvasFromFile as S, canvasFromImage as
|
|
11
|
-
import { createZipBlob as
|
|
12
|
-
import { useTabActive as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
2
|
+
import { Button as t, LargeButton as f, VerticalButton as m } from "./components/Button/Button.js";
|
|
3
|
+
import { default as p } from "./hooks/peer.js";
|
|
4
|
+
import { default as l } from "./services/peer2peer/Peer2Peer.js";
|
|
5
|
+
import { useID as x } from "./hooks/id.js";
|
|
6
|
+
import { useOnlyOnce as c } from "./hooks/onlyOnce.js";
|
|
7
|
+
import { default as F } from "./hooks/random.js";
|
|
8
|
+
import { theme as I } from "./style/theme.js";
|
|
9
|
+
import { default as B } from "./util/randomId.js";
|
|
10
|
+
import { canvasFromDataTransfer as P, canvasFromFile as S, canvasFromImage as y, canvasFromURL as T, canvasesFromFiles as b, cropTo as A, urlFromDataTransfer as C } from "./util/canvas.js";
|
|
11
|
+
import { createZipBlob as M, loadZipFile as R, saveZipFile as W } from "./util/zip.js";
|
|
12
|
+
import { useTabActive as O } from "./hooks/useTabActive.js";
|
|
13
|
+
import { default as k } from "./components/Spinner/Spinner.js";
|
|
14
|
+
import { default as E } from "./components/Privacy/Privacy.js";
|
|
15
|
+
import { default as Q } from "./components/BusyButton/BusyButton.js";
|
|
16
|
+
import { default as V } from "./components/AlertPara/AlertPara.js";
|
|
17
17
|
import { default as q } from "./components/QRCode/QRCode.js";
|
|
18
18
|
import { default as G } from "./components/Webcam/Webcam.js";
|
|
19
19
|
import { default as J } from "./components/ContentLoader/ContentLoader.js";
|
|
20
|
-
import { default as
|
|
21
|
-
import { extractNodesFromElements as
|
|
22
|
-
import { Widget as
|
|
23
|
-
import { S as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
20
|
+
import { default as X } from "./components/WorkflowLayout/Layout.js";
|
|
21
|
+
import { extractNodesFromElements as _, generateLines as $ } from "./components/WorkflowLayout/lines.js";
|
|
22
|
+
import { Widget as re } from "./components/WorkflowLayout/Widget.js";
|
|
23
|
+
import { S as ae } from "./SvgLayer-DQQ6Pb5G.js";
|
|
24
|
+
import { default as fe } from "./components/LangSelect/LangSelect.js";
|
|
25
|
+
import { default as se } from "./components/IconMenu/Spacer.js";
|
|
26
|
+
import { default as ue } from "./components/IconMenu/IconMenu.js";
|
|
27
|
+
import { default as ne } from "./components/IconMenu/IconMenuInline.js";
|
|
28
|
+
import { default as de } from "./components/IconMenu/Item.js";
|
|
29
|
+
import { default as ie } from "./components/PercentageBar/PercentageBar.js";
|
|
30
|
+
import { default as ve } from "./components/PieScore/PieScore.js";
|
|
31
|
+
import { default as ge } from "./components/Application/Application.js";
|
|
32
32
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
V as AlertPara,
|
|
34
|
+
ge as Application,
|
|
35
|
+
Q as BusyButton,
|
|
36
36
|
t as Button,
|
|
37
37
|
o as ConnectionStatus,
|
|
38
38
|
J as ContentLoader,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
ue as IconMenu,
|
|
40
|
+
ne as IconMenuInline,
|
|
41
|
+
de as IconMenuItem,
|
|
42
|
+
fe as LangSelect,
|
|
43
43
|
f as LargeButton,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
l as Peer2Peer,
|
|
45
|
+
ie as PercentageBar,
|
|
46
|
+
ve as PieScore,
|
|
47
|
+
E as Privacy,
|
|
48
48
|
q as QRCode,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
se as Spacer,
|
|
50
|
+
k as Spinner,
|
|
51
|
+
ae as SvgLayer,
|
|
52
|
+
m as VerticalButton,
|
|
52
53
|
G as Webcam,
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
re as Widget,
|
|
55
|
+
X as WorkflowLayout,
|
|
55
56
|
P as canvasFromDataTransfer,
|
|
56
57
|
S as canvasFromFile,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
y as canvasFromImage,
|
|
59
|
+
T as canvasFromURL,
|
|
60
|
+
b as canvasesFromFiles,
|
|
61
|
+
M as createZipBlob,
|
|
62
|
+
A as cropTo,
|
|
63
|
+
_ as extractNodesFromElements,
|
|
64
|
+
$ as generateLines,
|
|
65
|
+
R as loadZipFile,
|
|
66
|
+
B as randomId,
|
|
67
|
+
W as saveZipFile,
|
|
68
|
+
I as theme,
|
|
69
|
+
C as urlFromDataTransfer,
|
|
70
|
+
x as useID,
|
|
71
|
+
c as useOnlyOnce,
|
|
72
|
+
p as usePeer,
|
|
73
|
+
F as useRandom,
|
|
74
|
+
O as useTabActive
|
|
74
75
|
};
|