@coasys/ad4m-connect 0.12.0-rc1-dev → 0.12.0-rc1-dev.2
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/components/icons/CheckCircleIcon.d.ts +1 -0
- package/dist/components/icons/TickIcon.d.ts +1 -0
- package/dist/components/shared/Ad4mLogo.d.ts +1 -0
- package/dist/components/shared/AppLogo.d.ts +1 -0
- package/dist/components/shared/Header.d.ts +1 -0
- package/dist/components/shared/Logo.d.ts +1 -0
- package/dist/components/states/ErrorState.d.ts +6 -0
- package/dist/components/views/ConnectionOverview.d.ts +22 -0
- package/dist/components/views/Hosting.d.ts +22 -0
- package/dist/components/views/MultiUserAuth.d.ts +26 -0
- package/dist/components/views/RemoteConnection.d.ts +19 -0
- package/dist/components/views/RequestCapability.d.ts +16 -0
- package/dist/components/views/ScanQRCode.d.ts +14 -0
- package/dist/components/views/Settings.d.ts +19 -0
- package/dist/components/views/Start.d.ts +19 -0
- package/dist/components/views/old/Hosting.d.ts +22 -0
- package/dist/components/views/old/MultiUserAuth.d.ts +26 -0
- package/dist/components/views/old/RemoteConnection.d.ts +19 -0
- package/dist/components/views/old/RequestCapability.d.ts +16 -0
- package/dist/components/views/old/ScanQRCode.d.ts +14 -0
- package/dist/components/views/old/Settings.d.ts +19 -0
- package/dist/components/views/old/Start.d.ts +19 -0
- package/dist/core.js +30 -1573
- package/dist/index.js +102 -1645
- package/dist/old/components/InvalidToken.d.ts +0 -0
- package/dist/old/components/VerifyCode.d.ts +0 -0
- package/dist/old/core.d.ts +0 -0
- package/dist/old/electron.d.ts +0 -0
- package/dist/old/state/ConnectState.d.ts +0 -0
- package/dist/old/state/index.d.ts +0 -0
- package/dist/old/utils.d.ts +0 -0
- package/dist/old/views/Hosting.d.ts +0 -0
- package/dist/old/views/MultiUserAuth.d.ts +0 -0
- package/dist/old/views/RemoteConnection.d.ts +0 -0
- package/dist/old/views/RequestCapability.d.ts +0 -0
- package/dist/old/views/ScanQRCode.d.ts +0 -0
- package/dist/old/views/Settings.d.ts +0 -0
- package/dist/old/views/Start.d.ts +0 -0
- package/dist/old/web.d.ts +0 -0
- package/dist/state/ConnectState.d.ts +101 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/utils.js +1 -1
- package/dist/web.js +86 -1629
- package/package.json +19 -16
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* UI View States
|
|
4
|
+
*/
|
|
5
|
+
export type UIView = 'connection_overview' | 'remote_connection' | 'settings' | 'start' | 'qr' | 'requestcap' | 'verifycode' | 'disconnected' | 'hosting' | 'agentlocked' | 'multiuser_auth';
|
|
6
|
+
/**
|
|
7
|
+
* Multi-user authentication steps
|
|
8
|
+
*/
|
|
9
|
+
export type MultiUserStep = 'email' | 'password' | 'code';
|
|
10
|
+
export type MultiUserVerificationType = 'signup' | 'login';
|
|
11
|
+
/**
|
|
12
|
+
* Form state for different auth methods
|
|
13
|
+
*/
|
|
14
|
+
interface FormState {
|
|
15
|
+
email: string;
|
|
16
|
+
password: string;
|
|
17
|
+
hostingStep: number;
|
|
18
|
+
multiUserEmail: string;
|
|
19
|
+
multiUserPassword: string;
|
|
20
|
+
multiUserVerificationCode: string;
|
|
21
|
+
multiUserStep: MultiUserStep;
|
|
22
|
+
multiUserVerificationType: MultiUserVerificationType;
|
|
23
|
+
remoteUrl: string;
|
|
24
|
+
code: string | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Error state for different operations
|
|
28
|
+
*/
|
|
29
|
+
interface ErrorState {
|
|
30
|
+
password: string | null;
|
|
31
|
+
hostingNotRunning: string | null;
|
|
32
|
+
verifyCode: string | null;
|
|
33
|
+
multiUser: string | null;
|
|
34
|
+
remote: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Loading state for async operations
|
|
38
|
+
*/
|
|
39
|
+
interface LoadingState {
|
|
40
|
+
hosting: boolean;
|
|
41
|
+
multiUser: boolean;
|
|
42
|
+
remoteDetecting: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Detection state
|
|
46
|
+
*/
|
|
47
|
+
interface DetectionState {
|
|
48
|
+
localDetected: boolean;
|
|
49
|
+
remoteMultiUserDetected: boolean | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Reactive state controller for Ad4m Connect
|
|
53
|
+
* Manages all UI and form state in a centralized, reactive way
|
|
54
|
+
*/
|
|
55
|
+
export declare class ConnectState implements ReactiveController {
|
|
56
|
+
private host;
|
|
57
|
+
currentView: UIView;
|
|
58
|
+
isOpen: boolean;
|
|
59
|
+
isMobile: boolean;
|
|
60
|
+
isRemote: boolean;
|
|
61
|
+
hasClickedDownload: boolean;
|
|
62
|
+
forms: FormState;
|
|
63
|
+
errors: ErrorState;
|
|
64
|
+
loading: LoadingState;
|
|
65
|
+
detection: DetectionState;
|
|
66
|
+
constructor(host: ReactiveControllerHost);
|
|
67
|
+
hostConnected(): void;
|
|
68
|
+
hostDisconnected(): void;
|
|
69
|
+
get canSubmitMultiUser(): boolean;
|
|
70
|
+
get canSubmitVerificationCode(): boolean;
|
|
71
|
+
get hasAnyError(): boolean;
|
|
72
|
+
get isAnyLoading(): boolean;
|
|
73
|
+
get showLocalOption(): boolean;
|
|
74
|
+
get showRemoteOption(): boolean;
|
|
75
|
+
get showQROption(): boolean;
|
|
76
|
+
get showDownload(): boolean;
|
|
77
|
+
setView(view: UIView): void;
|
|
78
|
+
toggleOpen(): void;
|
|
79
|
+
open(): void;
|
|
80
|
+
close(): void;
|
|
81
|
+
setMobile(isMobile: boolean): void;
|
|
82
|
+
setRemote(isRemote: boolean): void;
|
|
83
|
+
setHasClickedDownload(clicked: boolean): void;
|
|
84
|
+
updateForm<K extends keyof FormState>(field: K, value: FormState[K]): void;
|
|
85
|
+
resetMultiUserForm(): void;
|
|
86
|
+
nextMultiUserStep(): void;
|
|
87
|
+
previousMultiUserStep(): void;
|
|
88
|
+
toggleMultiUserVerificationType(): void;
|
|
89
|
+
setError<K extends keyof ErrorState>(field: K, message: string | null): void;
|
|
90
|
+
clearError<K extends keyof ErrorState>(field: K): void;
|
|
91
|
+
clearAllErrors(): void;
|
|
92
|
+
setLoading<K extends keyof LoadingState>(field: K, isLoading: boolean): void;
|
|
93
|
+
setLocalDetected(detected: boolean): void;
|
|
94
|
+
setRemoteMultiUserDetected(detected: boolean | null): void;
|
|
95
|
+
private requestUpdate;
|
|
96
|
+
/**
|
|
97
|
+
* Reset all state to initial values
|
|
98
|
+
*/
|
|
99
|
+
reset(): void;
|
|
100
|
+
}
|
|
101
|
+
export {};
|
package/dist/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var l=(o,s,t)=>new Promise((c,e)=>{var r=n=>{try{u(t.next(n))}catch(d){e(d)}},p=n=>{try{u(t.throw(n))}catch(d){e(d)}},u=n=>n.done?c(n.value):Promise.resolve(n.value).then(r,p);u((t=t.apply(o,s)).next())});var a="0.12.0-rc1-dev.2";function f(){return typeof window!="undefined"&&window.self!==window.top}function i(){try{localStorage.setItem("test",""),localStorage.removeItem("test")}catch(o){return!1}return!0}function w(o,s){i()&&localStorage.setItem(`${a}/${o}`,s)}function k(o){return i()?localStorage.getItem(`${a}/${o}`):null}function y(o){i()&&localStorage.removeItem(`${a}/${o}`)}function v(o,s=1e4){return l(this,null,function*(){return Promise.race([new Promise((t,c)=>{let e;try{e=new WebSocket(o,"graphql-transport-ws"),e.onopen=()=>{e.close(),t(e)},e.onerror=r=>{c(r)},e.onclose=r=>{r.code!==1e3&&c(new Error(`WebSocket closed with code ${r.code}: ${r.reason}`))}}catch(r){e&&e.close(),c(r)}}),new Promise((t,c)=>{setTimeout(()=>{c(new Error("WebSocket connection timed out"))},s)})])})}export{v as connectWebSocket,k as getLocal,f as isEmbedded,y as removeLocal,w as setLocal};
|