@genai-fi/base 3.0.2 → 4.0.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/Button-CGKw9sMz.js +656 -0
- package/dist/CircularProgress-C6sMwjDC.js +1275 -0
- package/dist/{DefaultPropsProvider-C0Ib4Mye.js → DefaultPropsProvider-D2IJ8Qbs.js} +5 -1
- package/dist/{DialogQR-DVWhImXI.js → DialogQR-CyZcX7ul.js} +9 -5
- package/dist/{FlashWifi-CaAOKd3g.js → FlashWifi-CYp0UP0B.js} +1 -1
- package/dist/Portal-BqkDy0Wc.js +613 -0
- package/dist/SvgLayer-CA0elY7q.js +36 -0
- package/dist/assets/IconButtonDot.css +1 -0
- package/dist/assets/LangSelect.css +1 -0
- package/dist/assets/Loading.css +1 -0
- package/dist/assets/PercentageBar.css +1 -0
- package/dist/assets/PieScore.css +1 -0
- package/dist/assets/SvgLayer.css +1 -0
- package/dist/assets/Widget.css +1 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/style2.css +1 -0
- package/dist/colours.module.css +4 -0
- package/dist/components/AlertPara/AlertPara.js +1 -1
- package/dist/components/Application/Application.d.ts +10 -0
- package/dist/components/Application/Application.js +1610 -0
- package/dist/components/BusyButton/BusyButton.js +7 -6
- package/dist/components/Button/Button.js +12 -4
- package/dist/components/ConnectionStatus/ConnectionStatus.d.ts +1 -5
- package/dist/components/ConnectionStatus/ConnectionStatus.js +48 -47
- package/dist/components/ConnectionStatus/FlashWifi.js +1 -1
- package/dist/components/ContentLoader/ContentError.js +1 -1
- package/dist/components/ContentLoader/ContentLoader.js +5 -1
- package/dist/components/ContentLoader/ContentProgress.js +1 -1
- package/dist/components/IconButtonDot/IconButtonDot.d.ts +7 -0
- package/dist/components/IconButtonDot/IconButtonDot.js +22 -0
- package/dist/components/IconMenu/IconMenu.d.ts +12 -0
- package/dist/components/IconMenu/IconMenu.js +26 -0
- package/dist/components/IconMenu/IconMenuInline.d.ts +6 -0
- package/dist/components/IconMenu/IconMenuInline.js +12 -0
- package/dist/components/IconMenu/Item.d.ts +9 -0
- package/dist/components/IconMenu/Item.js +34 -0
- package/dist/components/IconMenu/Spacer.d.ts +1 -0
- package/dist/components/IconMenu/Spacer.js +11 -0
- package/dist/components/IconMenu/context.d.ts +1 -0
- package/dist/components/IconMenu/context.js +5 -0
- package/dist/components/IconMenu/index.d.ts +4 -0
- package/dist/components/IconMenu/index.js +10 -0
- package/dist/components/LangSelect/LangSelect.d.ts +12 -0
- package/dist/components/LangSelect/LangSelect.js +46 -0
- package/dist/components/Loading/Loading.d.ts +7 -0
- package/dist/components/Loading/Loading.js +15 -0
- package/dist/components/Motd/Motd.js +1 -1
- package/dist/components/PercentageBar/PercentageBar.d.ts +7 -0
- package/dist/components/PercentageBar/PercentageBar.js +37 -0
- package/dist/components/PieScore/PieScore.d.ts +6 -0
- package/dist/components/PieScore/PieScore.js +10676 -0
- package/dist/components/QRCode/DialogQR.js +8 -4
- package/dist/components/QRCode/QRCode.js +1 -1
- package/dist/components/Webcam/Webcam.js +3 -3
- package/dist/components/WorkflowLayout/Layout.d.ts +7 -0
- package/dist/components/WorkflowLayout/Layout.js +43 -0
- package/dist/components/WorkflowLayout/SvgLayer.d.ts +14 -0
- package/dist/components/WorkflowLayout/SvgLayer.js +5 -0
- package/dist/components/WorkflowLayout/Widget.d.ts +18 -0
- package/dist/components/WorkflowLayout/Widget.js +7413 -0
- package/dist/components/WorkflowLayout/index.d.ts +3 -0
- package/dist/components/WorkflowLayout/index.js +6 -0
- package/dist/components/WorkflowLayout/lines.d.ts +17 -0
- package/dist/components/WorkflowLayout/lines.js +37 -0
- package/dist/{createSvgIcon-BfF8yuCp.js → createSvgIcon-DmrVEdN7.js} +2 -2
- package/dist/{createTheme-BIcG8YPQ.js → createTheme-a85zdZWm.js} +4 -0
- package/dist/hooks/peer.d.ts +25 -2
- package/dist/hooks/peer.js +196 -54
- package/dist/main.d.ts +6 -0
- package/dist/main.js +53 -33
- package/dist/react-D_xU5dL6.js +112 -0
- package/dist/state/webrtcState.js +5 -4
- package/dist/style/theme.js +1 -1
- package/dist/style.module-BAnhZ_KJ.js +9 -0
- package/dist/style.module-BDpZJv9y.js +26 -0
- package/dist/util/Observer.d.ts +7 -0
- package/dist/util/Observer.js +9 -0
- package/dist/{webrtcState-D0nJpE9Z.js → vanilla-BJxibF1U.js} +83 -85
- package/package.json +8 -2
- package/dist/Button-DQwRVw4a.js +0 -1918
- package/dist/react-D-b-Xrzv.js +0 -98
- package/dist/style.module-DSFm2eLD.js +0 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ILine } from '../../components/WorkflowLayout/SvgLayer';
|
|
2
|
+
export interface INode {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function extractNodesFromElements(div: HTMLElement, initial?: Map<string, INode[]>): Map<string, INode[]>;
|
|
10
|
+
export type ConnectionPoint = 'left' | 'right' | 'top' | 'bottom';
|
|
11
|
+
export interface IConnection {
|
|
12
|
+
start: string;
|
|
13
|
+
startPoint: ConnectionPoint;
|
|
14
|
+
end: string;
|
|
15
|
+
endPoint: ConnectionPoint;
|
|
16
|
+
}
|
|
17
|
+
export declare function generateLines(data: Map<string, INode[]>, connections: IConnection[]): ILine[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function f(s, h) {
|
|
2
|
+
var o;
|
|
3
|
+
const n = h || /* @__PURE__ */ new Map();
|
|
4
|
+
for (let r = 0; r < s.children.length; ++r) {
|
|
5
|
+
const e = s.children[r], t = e.getAttribute("data-widget");
|
|
6
|
+
if (t === "container")
|
|
7
|
+
f(e, n);
|
|
8
|
+
else if (t) {
|
|
9
|
+
n.has(t) || n.set(t, []);
|
|
10
|
+
const i = e.offsetWidth, d = e.offsetHeight;
|
|
11
|
+
i > 0 && d > 0 && ((o = n.get(t)) == null || o.push({ x: e.offsetLeft, y: e.offsetTop, width: i, height: d, id: e.id || "noid" }));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
function c(s, h) {
|
|
17
|
+
const n = [];
|
|
18
|
+
for (const o of h) {
|
|
19
|
+
const r = s.get(o.start) || [], e = s.get(o.end) || [];
|
|
20
|
+
for (const t of r)
|
|
21
|
+
for (const i of e)
|
|
22
|
+
n.push({
|
|
23
|
+
id1: t.id,
|
|
24
|
+
id2: i.id,
|
|
25
|
+
x1: o.startPoint === "left" ? t.x : o.startPoint === "right" ? t.x + t.width : t.x + t.width / 2,
|
|
26
|
+
x2: o.endPoint === "left" ? i.x : o.endPoint === "right" ? i.x + i.width : i.x + i.width / 2,
|
|
27
|
+
y1: o.startPoint === "top" ? t.y : o.startPoint === "bottom" ? t.y + t.height : t.y + t.height / 2,
|
|
28
|
+
y2: o.endPoint === "top" ? i.y : o.endPoint === "bottom" ? i.y + i.height : i.y + i.height / 2,
|
|
29
|
+
direction: o.startPoint === "top" || o.startPoint === "bottom" ? "vertical" : "horizontal"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
f as extractNodesFromElements,
|
|
36
|
+
c as generateLines
|
|
37
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as h from "react";
|
|
2
2
|
import { jsxs as b, jsx as I } from "react/jsx-runtime";
|
|
3
|
-
import { g as w, a as z, P as e } from "./createTheme-
|
|
4
|
-
import { g as N, u as C, s as O, c as T, a as R, m as E } from "./DefaultPropsProvider-
|
|
3
|
+
import { g as w, a as z, P as e } from "./createTheme-a85zdZWm.js";
|
|
4
|
+
import { g as N, u as C, s as O, c as T, a as R, m as E } from "./DefaultPropsProvider-D2IJ8Qbs.js";
|
|
5
5
|
function j(o) {
|
|
6
6
|
return w("MuiSvgIcon", o);
|
|
7
7
|
}
|
package/dist/hooks/peer.d.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
1
2
|
import { default as Peer2Peer, P2POptions } from '../services/peer2peer/Peer2Peer';
|
|
2
|
-
import { Connection, PeerEvent } from '../services/peer2peer/types';
|
|
3
|
+
import { Connection, PeerEvent, PeerStatus } from '../services/peer2peer/types';
|
|
4
|
+
export declare const PeerProvider: import('react').Provider<Peer2Peer<PeerEvent> | null>;
|
|
5
|
+
interface PeerProps extends PropsWithChildren {
|
|
6
|
+
code: string;
|
|
7
|
+
server?: string;
|
|
8
|
+
forceTURN?: boolean;
|
|
9
|
+
forceWebsocket?: boolean;
|
|
10
|
+
host?: string;
|
|
11
|
+
secure?: boolean;
|
|
12
|
+
peerkey: string;
|
|
13
|
+
port?: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function Peer<T extends PeerEvent>({ children, code, server, host, secure, peerkey, port, forceTURN, forceWebsocket, disabled, }: PeerProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function usePeerObject<T extends PeerEvent>(): Peer2Peer<T> | null;
|
|
18
|
+
export declare function usePeerSender<T extends PeerEvent>(): (data: T, exclude?: string[]) => void;
|
|
19
|
+
export declare function usePeerStatus(): PeerStatus;
|
|
20
|
+
export declare function usePeerOpen(fn: () => void): void;
|
|
21
|
+
export declare function usePeerClose<T extends PeerEvent>(fn: (conn?: Connection<T>) => void): void;
|
|
22
|
+
export declare function usePeerData<T extends PeerEvent>(fn: (data: T, conn: Connection<T>) => void): void;
|
|
23
|
+
export declare function usePeerEvent<T extends PeerEvent>(event: T['event'], fn: (data: T, conn: Connection<T>) => void): void;
|
|
24
|
+
export declare function usePeerConnect<T extends PeerEvent>(fn: (conn: Connection<T>) => void): void;
|
|
25
|
+
export declare function usePeerError(fn: (err: string) => void): void;
|
|
3
26
|
interface Callbacks<T extends PeerEvent> {
|
|
4
27
|
onOpen?: () => void;
|
|
5
28
|
onConnect?: (conn: Connection<T>) => void;
|
|
@@ -16,7 +39,7 @@ interface Props<T extends PeerEvent> extends Callbacks<T>, P2POptions {
|
|
|
16
39
|
port?: number;
|
|
17
40
|
disabled?: boolean;
|
|
18
41
|
}
|
|
19
|
-
|
|
42
|
+
/** @deprecated */
|
|
20
43
|
export default function usePeer<T extends PeerEvent>({ code, server, host, secure, port, key, disabled, onOpen, onClose, onError, onData, onConnect, forceTURN, forceWebsocket, }: Props<T>): {
|
|
21
44
|
send: ((data: T, exclude?: string[]) => void) | undefined;
|
|
22
45
|
ready: boolean;
|
package/dist/hooks/peer.js
CHANGED
|
@@ -1,70 +1,212 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as F, useState as y, useRef as p, useEffect as c, useContext as i } from "react";
|
|
3
|
+
import { iceConfig as E, webrtcActive as O } from "../state/webrtcState.js";
|
|
4
|
+
import R from "../services/peer2peer/Peer2Peer.js";
|
|
5
|
+
import { a as T, u as V } from "../react-D_xU5dL6.js";
|
|
6
|
+
const f = F(null), G = f.Provider;
|
|
7
|
+
function Q({
|
|
8
|
+
children: e,
|
|
9
|
+
code: t,
|
|
10
|
+
server: n,
|
|
11
|
+
host: r,
|
|
12
|
+
secure: o,
|
|
13
|
+
peerkey: s,
|
|
14
|
+
port: a,
|
|
15
|
+
forceTURN: C,
|
|
16
|
+
forceWebsocket: b,
|
|
17
|
+
disabled: S
|
|
18
|
+
}) {
|
|
19
|
+
const [v, w] = y(null), [l, P] = T(O), d = V(E);
|
|
20
|
+
return c(() => {
|
|
21
|
+
if (S) {
|
|
22
|
+
P("disabled");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (l === "unset") return;
|
|
26
|
+
if (l === "disabled") {
|
|
27
|
+
P("unset");
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!t || !d)
|
|
31
|
+
return;
|
|
32
|
+
const x = new R(
|
|
33
|
+
t,
|
|
34
|
+
r || "api2.gen-ai.fi",
|
|
35
|
+
o || !0,
|
|
36
|
+
s,
|
|
37
|
+
a || 443,
|
|
38
|
+
d,
|
|
39
|
+
l === "relay",
|
|
40
|
+
n,
|
|
41
|
+
{ forceTURN: C, forceWebsocket: b }
|
|
42
|
+
);
|
|
43
|
+
return w(x), () => {
|
|
44
|
+
x.destroy();
|
|
45
|
+
};
|
|
46
|
+
}, [t, r, o, s, a, n, l, d, C, b, S, P]), /* @__PURE__ */ B(G, { value: v, children: e });
|
|
47
|
+
}
|
|
48
|
+
function W() {
|
|
49
|
+
return i(f);
|
|
50
|
+
}
|
|
51
|
+
const H = () => {
|
|
52
|
+
};
|
|
53
|
+
function X() {
|
|
54
|
+
const e = i(f);
|
|
55
|
+
return e ? e.boundSendAll : H;
|
|
56
|
+
}
|
|
57
|
+
function Y() {
|
|
58
|
+
const e = i(f), [t, n] = y((e == null ? void 0 : e.status) || "connecting");
|
|
59
|
+
return c(() => {
|
|
60
|
+
if (e) {
|
|
61
|
+
const r = (o) => n(o);
|
|
62
|
+
return n(e.status), e.on("status", r), () => {
|
|
63
|
+
e.off("status", r);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}, [e]), t;
|
|
67
|
+
}
|
|
68
|
+
function Z(e) {
|
|
69
|
+
const t = i(f), n = p(e);
|
|
70
|
+
n.current = e, c(() => {
|
|
71
|
+
if (t) {
|
|
72
|
+
const r = () => n.current();
|
|
73
|
+
return t.on("open", r), () => {
|
|
74
|
+
t.off("open", r);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}, [t]);
|
|
78
|
+
}
|
|
79
|
+
function _(e) {
|
|
80
|
+
const t = i(f), n = p(e);
|
|
81
|
+
n.current = e, c(() => {
|
|
82
|
+
if (t) {
|
|
83
|
+
const r = (o) => n.current(o);
|
|
84
|
+
return t.on("close", r), () => {
|
|
85
|
+
t.off("close", r);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}, [t]);
|
|
89
|
+
}
|
|
90
|
+
function $(e) {
|
|
91
|
+
const t = i(f), n = p(e);
|
|
92
|
+
n.current = e, c(() => {
|
|
93
|
+
if (t) {
|
|
94
|
+
const r = (o, s) => n.current(o, s);
|
|
95
|
+
return t.on("data", r), () => {
|
|
96
|
+
t.off("data", r);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}, [t]);
|
|
100
|
+
}
|
|
101
|
+
function N(e, t) {
|
|
102
|
+
const n = i(f), r = p(t);
|
|
103
|
+
r.current = t, c(() => {
|
|
104
|
+
if (n) {
|
|
105
|
+
const o = (s, a) => {
|
|
106
|
+
s.event === e && r.current(s, a);
|
|
107
|
+
};
|
|
108
|
+
return n.on("data", o), () => {
|
|
109
|
+
n.off("data", o);
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}, [n, e]);
|
|
113
|
+
}
|
|
114
|
+
function U(e) {
|
|
115
|
+
const t = i(f), n = p(e);
|
|
116
|
+
n.current = e, c(() => {
|
|
117
|
+
if (t) {
|
|
118
|
+
const r = (o) => n.current(o);
|
|
119
|
+
return t.on("connect", r), () => {
|
|
120
|
+
t.off("connect", r);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}, [t]);
|
|
124
|
+
}
|
|
125
|
+
function k(e) {
|
|
126
|
+
const t = i(f), n = p(e);
|
|
127
|
+
n.current = e, c(() => {
|
|
128
|
+
if (t) {
|
|
129
|
+
const r = (o) => n.current(o);
|
|
130
|
+
return t.on("error", r), () => {
|
|
131
|
+
t.off("error", r);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}, [t]);
|
|
135
|
+
}
|
|
136
|
+
function ee({
|
|
137
|
+
code: e,
|
|
138
|
+
server: t,
|
|
139
|
+
host: n,
|
|
140
|
+
secure: r,
|
|
141
|
+
port: o,
|
|
142
|
+
key: s,
|
|
143
|
+
disabled: a,
|
|
13
144
|
onOpen: C,
|
|
14
145
|
onClose: b,
|
|
15
|
-
onError:
|
|
16
|
-
onData:
|
|
17
|
-
onConnect:
|
|
18
|
-
forceTURN:
|
|
19
|
-
forceWebsocket:
|
|
146
|
+
onError: S,
|
|
147
|
+
onData: v,
|
|
148
|
+
onConnect: w,
|
|
149
|
+
forceTURN: l,
|
|
150
|
+
forceWebsocket: P
|
|
20
151
|
}) {
|
|
21
|
-
const [
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
if (
|
|
26
|
-
|
|
152
|
+
const [d, x] = y(), u = p({}), [A, j] = T(O), D = V(E), [q, g] = y("connecting");
|
|
153
|
+
return c(() => {
|
|
154
|
+
u.current.onClose = b, u.current.onOpen = C, u.current.onConnect = w, u.current.onError = S, u.current.onData = v;
|
|
155
|
+
}, [v, C, b, S, w]), c(() => {
|
|
156
|
+
if (a) {
|
|
157
|
+
g("failed"), j("disabled");
|
|
27
158
|
return;
|
|
28
159
|
} else
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
if (
|
|
32
|
-
|
|
160
|
+
g("connecting");
|
|
161
|
+
if (A === "unset") return;
|
|
162
|
+
if (A === "disabled") {
|
|
163
|
+
j("unset");
|
|
33
164
|
return;
|
|
34
165
|
}
|
|
35
|
-
if (!
|
|
36
|
-
if (!
|
|
166
|
+
if (!e) return;
|
|
167
|
+
if (!D) {
|
|
37
168
|
setTimeout(() => {
|
|
38
|
-
|
|
39
|
-
}, 5e3),
|
|
169
|
+
g("failed");
|
|
170
|
+
}, 5e3), g("failed");
|
|
40
171
|
return;
|
|
41
172
|
}
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{ forceTURN:
|
|
173
|
+
const m = new R(
|
|
174
|
+
e,
|
|
175
|
+
n,
|
|
176
|
+
r || !1,
|
|
177
|
+
s || "peerjs",
|
|
178
|
+
o || 443,
|
|
179
|
+
D,
|
|
180
|
+
A === "relay",
|
|
181
|
+
t,
|
|
182
|
+
{ forceTURN: l, forceWebsocket: P }
|
|
52
183
|
);
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
|
|
184
|
+
return m.on("status", g), m.on("data", (h, z) => {
|
|
185
|
+
u.current.onData && u.current.onData(h, z);
|
|
186
|
+
}), m.on("close", (h) => {
|
|
187
|
+
u.current.onClose && u.current.onClose(h);
|
|
188
|
+
}), m.on("connect", (h) => {
|
|
189
|
+
u.current.onConnect && u.current.onConnect(h);
|
|
190
|
+
}), x(m), () => {
|
|
191
|
+
m.destroy();
|
|
61
192
|
};
|
|
62
|
-
}, [
|
|
63
|
-
send:
|
|
64
|
-
ready:
|
|
65
|
-
peer:
|
|
193
|
+
}, [e, t, A, D, n, s, o, r, a, j, l, P]), {
|
|
194
|
+
send: d ? d.boundSendAll : void 0,
|
|
195
|
+
ready: q === "ready",
|
|
196
|
+
peer: d
|
|
66
197
|
};
|
|
67
198
|
}
|
|
68
199
|
export {
|
|
69
|
-
|
|
200
|
+
Q as Peer,
|
|
201
|
+
G as PeerProvider,
|
|
202
|
+
ee as default,
|
|
203
|
+
_ as usePeerClose,
|
|
204
|
+
U as usePeerConnect,
|
|
205
|
+
$ as usePeerData,
|
|
206
|
+
k as usePeerError,
|
|
207
|
+
N as usePeerEvent,
|
|
208
|
+
W as usePeerObject,
|
|
209
|
+
Z as usePeerOpen,
|
|
210
|
+
X as usePeerSender,
|
|
211
|
+
Y as usePeerStatus
|
|
70
212
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -19,3 +19,9 @@ export { default as AlertPara } from './components/AlertPara/AlertPara';
|
|
|
19
19
|
export { default as QRCode } from './components/QRCode/QRCode';
|
|
20
20
|
export { default as Webcam } from './components/Webcam/Webcam';
|
|
21
21
|
export { default as ContentLoader } from './components/ContentLoader/ContentLoader';
|
|
22
|
+
export { WorkflowLayout, type IConnection, Widget } from './components/WorkflowLayout';
|
|
23
|
+
export { default as LangSelect } from './components/LangSelect/LangSelect';
|
|
24
|
+
export { IconMenu, IconMenuInline, IconMenuItem, Spacer } from './components/IconMenu';
|
|
25
|
+
export { default as PercentageBar } from './components/PercentageBar/PercentageBar';
|
|
26
|
+
export { default as PieScore } from './components/PieScore/PieScore';
|
|
27
|
+
export { default as Application } from './components/Application/Application';
|
package/dist/main.js
CHANGED
|
@@ -1,49 +1,69 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import {
|
|
3
|
-
import { default as
|
|
1
|
+
import { default as r } 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
4
|
import { default as u } from "./services/peer2peer/Peer2Peer.js";
|
|
5
5
|
import { useID as n } from "./hooks/id.js";
|
|
6
6
|
import { useOnlyOnce as d } from "./hooks/onlyOnce.js";
|
|
7
7
|
import { default as i } from "./hooks/random.js";
|
|
8
8
|
import { theme as v } from "./style/theme.js";
|
|
9
9
|
import { default as P } from "./util/randomId.js";
|
|
10
|
-
import { canvasFromDataTransfer 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
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
10
|
+
import { canvasFromDataTransfer as g, canvasFromFile as L, canvasFromImage as S, 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 U } from "./components/BusyButton/BusyButton.js";
|
|
16
|
+
import { default as q } from "./components/AlertPara/AlertPara.js";
|
|
17
|
+
import { default as E } from "./components/QRCode/QRCode.js";
|
|
18
|
+
import { default as H } from "./components/Webcam/Webcam.js";
|
|
19
|
+
import { default as K } from "./components/ContentLoader/ContentLoader.js";
|
|
20
|
+
import { default as V } from "./components/WorkflowLayout/Layout.js";
|
|
21
|
+
import { Widget as Y } from "./components/WorkflowLayout/Widget.js";
|
|
22
|
+
import { default as $ } from "./components/LangSelect/LangSelect.js";
|
|
23
|
+
import { default as oe } from "./components/IconMenu/Spacer.js";
|
|
24
|
+
import { default as ae } from "./components/IconMenu/IconMenu.js";
|
|
25
|
+
import { default as fe } from "./components/IconMenu/IconMenuInline.js";
|
|
26
|
+
import { default as se } from "./components/IconMenu/Item.js";
|
|
27
|
+
import { default as ue } from "./components/PercentageBar/PercentageBar.js";
|
|
28
|
+
import { default as ne } from "./components/PieScore/PieScore.js";
|
|
29
|
+
import { default as de } from "./components/Application/Application.js";
|
|
20
30
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
q as AlertPara,
|
|
32
|
+
de as Application,
|
|
33
|
+
U as BusyButton,
|
|
23
34
|
t as Button,
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
r as ConnectionStatus,
|
|
36
|
+
K as ContentLoader,
|
|
37
|
+
ae as IconMenu,
|
|
38
|
+
fe as IconMenuInline,
|
|
39
|
+
se as IconMenuItem,
|
|
40
|
+
$ as LangSelect,
|
|
26
41
|
f as LargeButton,
|
|
27
42
|
u as Peer2Peer,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
g as
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
ue as PercentageBar,
|
|
44
|
+
ne as PieScore,
|
|
45
|
+
w as Privacy,
|
|
46
|
+
E as QRCode,
|
|
47
|
+
oe as Spacer,
|
|
48
|
+
h as Spinner,
|
|
49
|
+
H as Webcam,
|
|
50
|
+
Y as Widget,
|
|
51
|
+
V as WorkflowLayout,
|
|
52
|
+
g as canvasFromDataTransfer,
|
|
53
|
+
L as canvasFromFile,
|
|
54
|
+
S as canvasFromImage,
|
|
55
|
+
y as canvasFromURL,
|
|
56
|
+
T as canvasesFromFiles,
|
|
57
|
+
D as createZipBlob,
|
|
58
|
+
b as cropTo,
|
|
59
|
+
M as loadZipFile,
|
|
40
60
|
P as randomId,
|
|
41
|
-
|
|
61
|
+
R as saveZipFile,
|
|
42
62
|
v as theme,
|
|
43
|
-
|
|
63
|
+
A as urlFromDataTransfer,
|
|
44
64
|
n as useID,
|
|
45
65
|
d as useOnlyOnce,
|
|
46
|
-
|
|
66
|
+
s as usePeer,
|
|
47
67
|
i as useRandom,
|
|
48
|
-
|
|
68
|
+
Z as useTabActive
|
|
49
69
|
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import _, { useReducer as R, useEffect as A, useDebugValue as S, useRef as x, createElement as y, createContext as C, useCallback as E, useContext as F } from "react";
|
|
2
|
+
import { c as V, g as j, I as h } from "./vanilla-BJxibF1U.js";
|
|
3
|
+
const k = {}, w = C(
|
|
4
|
+
void 0
|
|
5
|
+
);
|
|
6
|
+
function P(t) {
|
|
7
|
+
return F(w) || j();
|
|
8
|
+
}
|
|
9
|
+
function T({
|
|
10
|
+
children: t,
|
|
11
|
+
store: s
|
|
12
|
+
}) {
|
|
13
|
+
const u = x(void 0);
|
|
14
|
+
return !s && !u.current && (u.current = V()), y(
|
|
15
|
+
w.Provider,
|
|
16
|
+
{
|
|
17
|
+
value: s || u.current
|
|
18
|
+
},
|
|
19
|
+
t
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const b = (t) => typeof (t == null ? void 0 : t.then) == "function", g = (t) => {
|
|
23
|
+
t.status || (t.status = "pending", t.then(
|
|
24
|
+
(s) => {
|
|
25
|
+
t.status = "fulfilled", t.value = s;
|
|
26
|
+
},
|
|
27
|
+
(s) => {
|
|
28
|
+
t.status = "rejected", t.reason = s;
|
|
29
|
+
}
|
|
30
|
+
));
|
|
31
|
+
}, D = _.use || // A shim for older React versions
|
|
32
|
+
((t) => {
|
|
33
|
+
if (t.status === "pending")
|
|
34
|
+
throw t;
|
|
35
|
+
if (t.status === "fulfilled")
|
|
36
|
+
return t.value;
|
|
37
|
+
throw t.status === "rejected" ? t.reason : (g(t), t);
|
|
38
|
+
}), d = /* @__PURE__ */ new WeakMap(), v = (t, s) => {
|
|
39
|
+
let u = d.get(t);
|
|
40
|
+
return u || (u = new Promise((o, n) => {
|
|
41
|
+
let a = t;
|
|
42
|
+
const l = (e) => (r) => {
|
|
43
|
+
a === e && o(r);
|
|
44
|
+
}, f = (e) => (r) => {
|
|
45
|
+
a === e && n(r);
|
|
46
|
+
}, c = () => {
|
|
47
|
+
try {
|
|
48
|
+
const e = s();
|
|
49
|
+
b(e) ? (d.set(e, u), a = e, e.then(l(e), f(e)), h(e, c)) : o(e);
|
|
50
|
+
} catch (e) {
|
|
51
|
+
n(e);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
t.then(l(t), f(t)), h(t, c);
|
|
55
|
+
}), d.set(t, u)), u;
|
|
56
|
+
};
|
|
57
|
+
function I(t, s) {
|
|
58
|
+
const { delay: u, unstable_promiseStatus: o = !_.use } = {}, n = P(), [[a, l, f], c] = R(
|
|
59
|
+
(r) => {
|
|
60
|
+
const i = n.get(t);
|
|
61
|
+
return Object.is(r[0], i) && r[1] === n && r[2] === t ? r : [i, n, t];
|
|
62
|
+
},
|
|
63
|
+
void 0,
|
|
64
|
+
() => [n.get(t), n, t]
|
|
65
|
+
);
|
|
66
|
+
let e = a;
|
|
67
|
+
if ((l !== n || f !== t) && (c(), e = n.get(t)), A(() => {
|
|
68
|
+
const r = n.sub(t, () => {
|
|
69
|
+
if (o)
|
|
70
|
+
try {
|
|
71
|
+
const i = n.get(t);
|
|
72
|
+
b(i) && g(
|
|
73
|
+
v(i, () => n.get(t))
|
|
74
|
+
);
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
if (typeof u == "number") {
|
|
78
|
+
setTimeout(c, u);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
c();
|
|
82
|
+
});
|
|
83
|
+
return c(), r;
|
|
84
|
+
}, [n, t, u, o]), S(e), b(e)) {
|
|
85
|
+
const r = v(e, () => n.get(t));
|
|
86
|
+
return o && g(r), D(r);
|
|
87
|
+
}
|
|
88
|
+
return e;
|
|
89
|
+
}
|
|
90
|
+
function L(t, s) {
|
|
91
|
+
const u = P();
|
|
92
|
+
return E(
|
|
93
|
+
(...n) => {
|
|
94
|
+
if ((k ? "production" : void 0) !== "production" && !("write" in t))
|
|
95
|
+
throw new Error("not writable atom");
|
|
96
|
+
return u.set(t, ...n);
|
|
97
|
+
},
|
|
98
|
+
[u, t]
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
function H(t, s) {
|
|
102
|
+
return [
|
|
103
|
+
I(t),
|
|
104
|
+
// We do wrong type assertion here, which results in throwing an error.
|
|
105
|
+
L(t)
|
|
106
|
+
];
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
T as P,
|
|
110
|
+
H as a,
|
|
111
|
+
I as u
|
|
112
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as t } from "../vanilla-BJxibF1U.js";
|
|
2
|
+
const e = t("disabled"), c = t(void 0), i = t("unset");
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
c as iceConfig,
|
|
5
|
+
e as webrtcActive,
|
|
6
|
+
i as webrtcCandidate
|
|
6
7
|
};
|
package/dist/style/theme.js
CHANGED