@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
- s as LargeButton
20
+ a as LargeButton,
21
+ s as VerticalButton
14
22
  };
@@ -1,15 +1,17 @@
1
- interface Props {
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, onCapture, disable, direct, hidden, onPreprocess, onPostprocess, onActivated, onFatal, size, }: Props): import("react/jsx-runtime").JSX.Element;
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 s, jsxs as F, Fragment as q } from "react/jsx-runtime";
2
- import * as G from "react";
3
- import { useState as M, useRef as O, useEffect as y, useCallback as E } from "react";
4
- import { useTranslation as J } from "react-i18next";
5
- import { IconButton as V } from "@mui/material";
6
- import { c as Q } from "../../createSvgIcon-DQhMxTx4.js";
7
- import { WebcamClass as Y } from "./webcamClass.js";
8
- import { g as Z, u as z, s as P, c as W, a as tt, m as et } from "../../DefaultPropsProvider-BurgXZzw.js";
9
- import { g as at, P as a } from "../../createTheme-DV959X3d.js";
10
- import { css as A, keyframes as H } from "@emotion/react";
11
- import '../../assets/Webcam.css';function nt(t) {
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 rt(t) {
14
+ function nt(t) {
15
15
  return parseFloat(t);
16
16
  }
17
- const it = "_container_u6uf5_1", ot = "_wrapContainer_u6uf5_5", st = "_flipButton_u6uf5_10", N = {
18
- container: it,
19
- wrapContainer: ot,
20
- flipButton: st
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 ct(t) {
23
- return at("MuiSkeleton", t);
22
+ function it(t) {
23
+ return tt("MuiSkeleton", t);
24
24
  }
25
- Z("MuiSkeleton", ["root", "text", "rectangular", "rounded", "circular", "pulse", "wave", "withChildren", "fitContent", "heightAuto"]);
26
- const lt = (t) => {
25
+ G("MuiSkeleton", ["root", "text", "rectangular", "rounded", "circular", "pulse", "wave", "withChildren", "fitContent", "heightAuto"]);
26
+ const st = (t) => {
27
27
  const {
28
- classes: i,
29
- variant: r,
30
- animation: o,
31
- hasChildren: u,
32
- width: v,
33
- height: f
28
+ classes: o,
29
+ variant: a,
30
+ animation: i,
31
+ hasChildren: p,
32
+ width: y,
33
+ height: m
34
34
  } = t;
35
- return tt({
36
- root: ["root", r, o, u && "withChildren", u && !v && "fitContent", u && !f && "heightAuto"]
37
- }, ct, i);
38
- }, $ = H`
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
- `, j = H`
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
- `, ut = typeof $ != "string" ? A`
64
- animation: ${$} 2s ease-in-out 0.5s infinite;
65
- ` : null, ft = typeof j != "string" ? A`
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: ${j} 2s linear 0.5s infinite;
67
+ animation: ${_} 2s linear 0.5s infinite;
68
68
  }
69
- ` : null, pt = P("span", {
69
+ ` : null, ut = Q("span", {
70
70
  name: "MuiSkeleton",
71
71
  slot: "Root",
72
- overridesResolver: (t, i) => {
72
+ overridesResolver: (t, o) => {
73
73
  const {
74
- ownerState: r
74
+ ownerState: a
75
75
  } = t;
76
- return [i.root, i[r.variant], r.animation !== !1 && i[r.animation], r.hasChildren && i.withChildren, r.hasChildren && !r.width && i.fitContent, r.hasChildren && !r.height && i.heightAuto];
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
- })(et(({
78
+ })(W(({
79
79
  theme: t
80
80
  }) => {
81
- const i = nt(t.shape.borderRadius) || "px", r = rt(t.shape.borderRadius);
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: `${r}${i}/${Math.round(r / 0.6 * 10) / 10}${i}`,
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: o
119
- }) => o.hasChildren,
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: o
128
- }) => o.hasChildren && !o.width,
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: o
135
- }) => o.hasChildren && !o.height,
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: ut || {
144
- animation: `${$} 2s ease-in-out 0.5s infinite`
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: ft || {
175
+ style: lt || {
176
176
  "&::after": {
177
- animation: `${j} 2s linear 0.5s infinite`
177
+ animation: `${_} 2s linear 0.5s infinite`
178
178
  }
179
179
  }
180
180
  }]
181
181
  };
182
- })), K = /* @__PURE__ */ G.forwardRef(function(i, r) {
183
- const o = z({
184
- props: i,
182
+ })), E = /* @__PURE__ */ X.forwardRef(function(o, a) {
183
+ const i = J({
184
+ props: o,
185
185
  name: "MuiSkeleton"
186
186
  }), {
187
- animation: u = "pulse",
188
- className: v,
189
- component: f = "span",
190
- height: m,
191
- style: p,
192
- variant: w = "text",
193
- width: l,
194
- ...h
195
- } = o, e = {
196
- ...o,
197
- animation: u,
198
- component: f,
199
- variant: w,
200
- hasChildren: !!h.children
201
- }, T = lt(e);
202
- return /* @__PURE__ */ s(pt, {
203
- as: f,
204
- ref: r,
205
- className: W(T.root, v),
206
- ownerState: e,
207
- ...h,
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: l,
210
- height: m,
211
- ...p
209
+ width: v,
210
+ height: h,
211
+ ...e
212
212
  }
213
213
  });
214
214
  });
215
- process.env.NODE_ENV !== "production" && (K.propTypes = {
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: a.oneOf(["pulse", "wave", !1]),
225
+ animation: n.oneOf(["pulse", "wave", !1]),
226
226
  /**
227
227
  * Optional children to infer width and height from.
228
228
  */
229
- children: a.node,
229
+ children: n.node,
230
230
  /**
231
231
  * Override or extend the styles applied to the component.
232
232
  */
233
- classes: a.object,
233
+ classes: n.object,
234
234
  /**
235
235
  * @ignore
236
236
  */
237
- className: a.string,
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: a.elementType,
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: a.oneOfType([a.number, a.string]),
247
+ height: n.oneOfType([n.number, n.string]),
248
248
  /**
249
249
  * @ignore
250
250
  */
251
- style: a.object,
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: a.oneOfType([a.arrayOf(a.oneOfType([a.func, a.object, a.bool])), a.func, a.object]),
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: a.oneOfType([a.oneOf(["circular", "rectangular", "rounded", "text"]), a.string]),
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: a.oneOfType([a.number, a.string])
265
+ width: n.oneOfType([n.number, n.string])
266
266
  });
267
- const X = Q([/* @__PURE__ */ s("path", {
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__ */ s("path", {
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 kt({
273
- interval: t,
274
- capture: i,
275
- onCapture: r,
276
- disable: o,
277
- direct: u,
278
- hidden: v,
279
- onPreprocess: f,
280
- onPostprocess: m,
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 x = t !== void 0 ? t : 1e3;
296
- if (f && await f(e.canvas), i && r && n - _.current >= x) {
297
- if (u && e.canvas)
298
- await r(e.canvas);
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 g = document.createElement("canvas");
301
- g.width = e.canvas.width, g.height = e.canvas.height;
302
- const S = g.getContext("2d");
303
- S || console.error("Failed to get context"), S == null || S.drawImage(e.canvas, 0, 0), await r(g);
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
- _.current = n;
295
+ g.current = r;
306
296
  }
307
- const I = (c = b.current) == null ? void 0 : c.getContext("2d");
308
- I && (I.drawImage(e.canvas, 0, 0), m && b.current && await m(b.current));
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
- d.current && (C.current = window.requestAnimationFrame(d.current));
311
- }, C.current === -1 && (C.current = window.requestAnimationFrame(d.current));
312
- }, [e, t, i, r, u, o, m, f]);
313
- const B = E(
314
- async (n) => {
315
- var c;
316
- if (await n.setup({ facingMode: R ? "user" : "environment" }), n.webcam && (n.webcam.playsInline = !0, n.webcam.muted = !0, n.webcam.onsuspend = () => n.play(), T(n)), (c = navigator.mediaDevices) != null && c.enumerateDevices)
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((g) => g.kind === "videoinput").length > 1 && (k || L(!0), n.flip = R);
319
- } catch (x) {
320
- console.error(x);
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 p && p(!0), n;
312
+ return s.current.onActivated && s.current.onActivated(!0), r;
323
313
  },
324
- [p, R, k]
314
+ [R, k]
325
315
  );
326
- y(() => {
327
- i && (_.current = 0);
328
- }, [i]), y(() => {
329
- const n = new Y(l, l, !0);
330
- return B(n).catch((c) => {
331
- p && p(!1), console.error("No webcam", c), w && w();
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 c;
334
- (c = n.webcam) != null && c.srcObject && n.stop();
323
+ var l;
324
+ (l = r.webcam) != null && l.srcObject && r.stop();
335
325
  };
336
- }, [R, p, B, w, l]), y(() => () => {
337
- var n;
338
- d.current = void 0, (n = e == null ? void 0 : e.webcam) != null && n.srcObject && e.stop();
339
- }, [e]), y(() => {
340
- e && (o ? e.pause() : e.play());
341
- }, [e, o]);
342
- const U = E(() => {
343
- D((n) => !n);
344
- }, [D]);
345
- return v ? /* @__PURE__ */ s(q, { children: k && /* @__PURE__ */ s(
346
- V,
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: U,
340
+ onClick: $,
351
341
  "aria-label": h("webcam.aria.flip"),
352
- children: /* @__PURE__ */ s(X, { fontSize: "large" })
342
+ children: /* @__PURE__ */ c(U, { fontSize: "large" })
353
343
  }
354
- ) }) : /* @__PURE__ */ F(q, { children: [
355
- !e && /* @__PURE__ */ s(
356
- K,
344
+ ) }) : /* @__PURE__ */ j(D, { children: [
345
+ !e && /* @__PURE__ */ c(
346
+ E,
357
347
  {
358
348
  variant: "rounded",
359
- width: l,
360
- height: l
349
+ width: d,
350
+ height: d
361
351
  }
362
352
  ),
363
- e && /* @__PURE__ */ F("div", { className: N.wrapContainer, children: [
364
- k && /* @__PURE__ */ s(
365
- V,
353
+ e && /* @__PURE__ */ j("div", { className: F.wrapContainer, children: [
354
+ k && /* @__PURE__ */ c(
355
+ P,
366
356
  {
367
- className: N.flipButton,
357
+ className: F.flipButton,
368
358
  size: "large",
369
359
  color: "inherit",
370
- onClick: U,
360
+ onClick: $,
371
361
  "aria-label": h("webcam.aria.flip"),
372
- children: /* @__PURE__ */ s(X, { fontSize: "large" })
362
+ children: /* @__PURE__ */ c(U, { fontSize: "large" })
373
363
  }
374
364
  ),
375
- /* @__PURE__ */ s(
365
+ /* @__PURE__ */ c(
376
366
  "div",
377
367
  {
378
368
  "data-testid": "webcam",
379
- className: N.container,
369
+ className: F.container,
380
370
  role: "img",
381
371
  "aria-label": h("webcam.aria.video"),
382
- children: /* @__PURE__ */ s(
372
+ children: /* @__PURE__ */ c(
383
373
  "canvas",
384
374
  {
385
- width: l,
386
- height: l,
387
- ref: b
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
- kt as default
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 s } from "./hooks/peer.js";
4
- import { default as u } from "./services/peer2peer/Peer2Peer.js";
5
- import { useID as n } from "./hooks/id.js";
6
- import { useOnlyOnce as d } from "./hooks/onlyOnce.js";
7
- import { default as i } from "./hooks/random.js";
8
- import { theme as v } from "./style/theme.js";
9
- import { default as g } from "./util/randomId.js";
10
- import { canvasFromDataTransfer as P, canvasFromFile as S, canvasFromImage as B, canvasFromURL as y, canvasesFromFiles as T, cropTo as b, urlFromDataTransfer as A } from "./util/canvas.js";
11
- import { createZipBlob as D, loadZipFile as M, saveZipFile as R } from "./util/zip.js";
12
- import { useTabActive as Z } from "./hooks/useTabActive.js";
13
- import { default as h } from "./components/Spinner/Spinner.js";
14
- import { default as w } from "./components/Privacy/Privacy.js";
15
- import { default as N } from "./components/BusyButton/BusyButton.js";
16
- import { default as U } from "./components/AlertPara/AlertPara.js";
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 V } from "./components/WorkflowLayout/Layout.js";
21
- import { extractNodesFromElements as Y, generateLines as _ } from "./components/WorkflowLayout/lines.js";
22
- import { Widget as ee } from "./components/WorkflowLayout/Widget.js";
23
- import { S as oe } from "./SvgLayer-DQQ6Pb5G.js";
24
- import { default as te } from "./components/LangSelect/LangSelect.js";
25
- import { default as me } from "./components/IconMenu/Spacer.js";
26
- import { default as pe } from "./components/IconMenu/IconMenu.js";
27
- import { default as le } from "./components/IconMenu/IconMenuInline.js";
28
- import { default as xe } from "./components/IconMenu/Item.js";
29
- import { default as ce } from "./components/PercentageBar/PercentageBar.js";
30
- import { default as Fe } from "./components/PieScore/PieScore.js";
31
- import { default as Ie } from "./components/Application/Application.js";
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
- U as AlertPara,
34
- Ie as Application,
35
- N as BusyButton,
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
- pe as IconMenu,
40
- le as IconMenuInline,
41
- xe as IconMenuItem,
42
- te as LangSelect,
39
+ ue as IconMenu,
40
+ ne as IconMenuInline,
41
+ de as IconMenuItem,
42
+ fe as LangSelect,
43
43
  f as LargeButton,
44
- u as Peer2Peer,
45
- ce as PercentageBar,
46
- Fe as PieScore,
47
- w as Privacy,
44
+ l as Peer2Peer,
45
+ ie as PercentageBar,
46
+ ve as PieScore,
47
+ E as Privacy,
48
48
  q as QRCode,
49
- me as Spacer,
50
- h as Spinner,
51
- oe as SvgLayer,
49
+ se as Spacer,
50
+ k as Spinner,
51
+ ae as SvgLayer,
52
+ m as VerticalButton,
52
53
  G as Webcam,
53
- ee as Widget,
54
- V as WorkflowLayout,
54
+ re as Widget,
55
+ X as WorkflowLayout,
55
56
  P as canvasFromDataTransfer,
56
57
  S as canvasFromFile,
57
- B as canvasFromImage,
58
- y as canvasFromURL,
59
- T as canvasesFromFiles,
60
- D as createZipBlob,
61
- b as cropTo,
62
- Y as extractNodesFromElements,
63
- _ as generateLines,
64
- M as loadZipFile,
65
- g as randomId,
66
- R as saveZipFile,
67
- v as theme,
68
- A as urlFromDataTransfer,
69
- n as useID,
70
- d as useOnlyOnce,
71
- s as usePeer,
72
- i as useRandom,
73
- Z as useTabActive
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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/base",
3
- "version": "4.0.3",
3
+ "version": "4.0.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",