@ikonai/sdk-react-ui 1.5.0 → 1.7.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/app/connection-recovery.d.ts +27 -0
- package/app/index.d.ts +1 -0
- package/app/use-ikon-app.d.ts +24 -1
- package/index.d.ts +1 -1
- package/index.js +865 -823
- package/package.json +1 -1
- package/theme/ikon-app.css +38 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a recovery attempt has to do to stand a chance.
|
|
3
|
+
*
|
|
4
|
+
* - `reload` — load the page again. The offline overlay only ever appears when reconnecting cannot
|
|
5
|
+
* help (the server instance stopped, the first connect never succeeded, or the SDK gave up), so a
|
|
6
|
+
* fresh document is the honest cure for every case but one.
|
|
7
|
+
* - `freshSession` — load the page without the `ikon-session` deep link. The named session has
|
|
8
|
+
* ended; a plain reload would rejoin it and fail identically.
|
|
9
|
+
*/
|
|
10
|
+
export type ConnectionRecoveryKind = 'reload' | 'freshSession';
|
|
11
|
+
export interface ConnectionRecovery {
|
|
12
|
+
kind: ConnectionRecoveryKind;
|
|
13
|
+
/** Perform the recovery. Navigates the page, so nothing after it runs. */
|
|
14
|
+
run: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface ConnectionRecoveryOptions {
|
|
17
|
+
/** `useIkonApp().isSessionExpired`. */
|
|
18
|
+
isSessionExpired: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The way out of the offline state, for an overlay to put behind a button.
|
|
22
|
+
*
|
|
23
|
+
* An installed PWA (`"display": "standalone"`, which every scaffolded app ships) has no reload
|
|
24
|
+
* control the user can reach — buried in a menu on desktop, absent entirely on an iOS home-screen
|
|
25
|
+
* app — so telling them to refresh is advice they cannot act on. The button is the affordance.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getConnectionRecovery({ isSessionExpired }: ConnectionRecoveryOptions): ConnectionRecovery;
|
package/app/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { ConnectionStateRenderer, type ConnectedRenderProps, type ConnectionStat
|
|
|
2
2
|
export { useIkonApp, type IkonUiModuleRegistration, type UseIkonAppOptions, type UseIkonAppResult } from './use-ikon-app';
|
|
3
3
|
export { IkonApp, type IkonAppProps, type ConnectingOverlayProp, type ReconnectingOverlayProp, type OfflineOverlayProp, type AccessDeniedScreenProp } from './ikon-app';
|
|
4
4
|
export { useIkonDebug, type UseIkonDebugResult } from './use-ikon-debug';
|
|
5
|
+
export { getConnectionRecovery, type ConnectionRecovery, type ConnectionRecoveryKind, type ConnectionRecoveryOptions } from './connection-recovery';
|
package/app/use-ikon-app.d.ts
CHANGED
|
@@ -36,6 +36,22 @@ export type IkonUiModuleRegistration = (registry: IkonUiRegistry) => void;
|
|
|
36
36
|
* SessionIdentity the connect resolves to, so a hand-typed query parameter must not displace one.
|
|
37
37
|
*/
|
|
38
38
|
export declare function mergeConnectParameters(urlParameters: Record<string, string>, appParameters?: Record<string, string>): Record<string, string>;
|
|
39
|
+
/**
|
|
40
|
+
* Who a session is for, as opposed to what it presents to prove it.
|
|
41
|
+
*
|
|
42
|
+
* A browser access token is worth 15 minutes and is renewed roughly every 13, and a renewal is the
|
|
43
|
+
* same person holding a fresher credential. Keying the connection on the token's value made every
|
|
44
|
+
* renewal look like a different session, so a signed-in app tore its IkonClient down and rebuilt it
|
|
45
|
+
* every renewal period on a perfectly healthy network. Keying on the subject instead leaves only a
|
|
46
|
+
* genuine change of user — or of sign-in method — forcing a reconnect.
|
|
47
|
+
*
|
|
48
|
+
* A token whose subject cannot be read falls back to the token itself: two credentials nobody can
|
|
49
|
+
* identify must not be assumed to name the same person.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveSessionIdentity(session: {
|
|
52
|
+
token: string;
|
|
53
|
+
provider: string;
|
|
54
|
+
} | null | undefined): string | null;
|
|
39
55
|
/**
|
|
40
56
|
* Options for the useIkonApp hook.
|
|
41
57
|
*/
|
|
@@ -92,9 +108,16 @@ export interface UseIkonAppOptions {
|
|
|
92
108
|
/**
|
|
93
109
|
* Enable WebTransport. Off by default — WebTransport has proven unreliable on
|
|
94
110
|
* bad networks. Set to `true` to opt in (also selectable at runtime with
|
|
95
|
-
* `?ikon-
|
|
111
|
+
* `?ikon-transport=wt`). When unset or `false`, the SDK uses WebSocket only.
|
|
96
112
|
*/
|
|
97
113
|
webtransport?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Force the HTTP stream transport only (`true`), or exclude it (`false`). Unset by default, which
|
|
116
|
+
* leaves it as the last rung of the ladder — the one that survives a network permitting HTTPS to
|
|
117
|
+
* this origin while blocking the WebSocket upgrade. Also settable per session with
|
|
118
|
+
* `?ikon-transport=http`.
|
|
119
|
+
*/
|
|
120
|
+
httpstream?: boolean;
|
|
98
121
|
/**
|
|
99
122
|
* Pin the connect tier. When true, only the on-host proxy on 443 is used, and only proxy endpoint
|
|
100
123
|
* types with it. When false, proxy types are excluded. `'lb'` pins the same-origin stream tier
|
package/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type { UiComponentRenderer, UiComponentLibrary, UiNode, UiRenderContext,
|
|
|
15
15
|
export { UiStreamStore, type UiStylePayload } from '../sdk/sdk-ui/src/index.ts';
|
|
16
16
|
export { renderMotionLetters } from './shared/render-motion-letters';
|
|
17
17
|
export { type AuthConfig, type AuthContextValue, type AuthSession, type AuthState, type AuthUser, type LoginMethod, clearAuthSession, loadAuthSession, saveAuthSession, sessionToUser, authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, parseOAuthCallback, parseOAuthError, sendLoginCode, verifyLoginCode, type OAuthCallbackResult, type SendLoginCodeOptions, type VerifyLoginCodeOptions, AuthProvider, useAuth, useAuthOptional, type AuthProviderProps, useAuthGuard, type UseAuthGuardOptions, type UseAuthGuardResult, } from './auth';
|
|
18
|
-
export { ConnectionStateRenderer, type ConnectedRenderProps, type ConnectionStateRendererProps, useIkonApp, type IkonUiModuleRegistration, type UseIkonAppOptions, type UseIkonAppResult, IkonApp, type IkonAppProps, type ConnectingOverlayProp, type ReconnectingOverlayProp, type OfflineOverlayProp, type AccessDeniedScreenProp, useIkonDebug, type UseIkonDebugResult, } from './app';
|
|
18
|
+
export { ConnectionStateRenderer, type ConnectedRenderProps, type ConnectionStateRendererProps, useIkonApp, type IkonUiModuleRegistration, type UseIkonAppOptions, type UseIkonAppResult, IkonApp, type IkonAppProps, type ConnectingOverlayProp, type ReconnectingOverlayProp, type OfflineOverlayProp, type AccessDeniedScreenProp, useIkonDebug, type UseIkonDebugResult, getConnectionRecovery, type ConnectionRecovery, type ConnectionRecoveryKind, type ConnectionRecoveryOptions, } from './app';
|
|
19
19
|
export { useToasts, useIkonReactive, useReactive, type Toast } from './hooks';
|
|
20
20
|
export { I18nProvider, useI18n, type I18nContextValue, type I18nProviderProps } from './i18n';
|
|
21
21
|
export { InspectOverlay, type InspectElementPayload } from './inspect/inspect-overlay';
|