@ikonai/sdk-react-ui 1.0.80 → 1.1.1
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/boot-snapshot-variant.d.ts +8 -0
- package/app/connection-state-renderer.d.ts +1 -1
- package/app/use-ikon-app.d.ts +10 -2
- package/app/use-ikon-debug.d.ts +1 -1
- package/auth/auth-context.d.ts +1 -1
- package/auth/auth-service.d.ts +4 -2
- package/auth/index.d.ts +1 -1
- package/auth/storage.d.ts +8 -0
- package/auth/types.d.ts +16 -4
- package/auth/use-auth-guard.d.ts +10 -0
- package/debug/debug-overlay.d.ts +1 -1
- package/hooks/use-ikon-reactive.d.ts +1 -1
- package/hooks/use-reactive.d.ts +1 -1
- package/i18n/i18n.d.ts +1 -1
- package/ikon-ui.d.ts +2 -2
- package/index.d.ts +2 -2
- package/index.js +3887 -3933
- package/motion/motion-controller.d.ts +1 -1
- package/package.json +1 -1
- package/parallax-view.d.ts +2 -2
- package/renderer/types.d.ts +8 -8
- package/renderer/ui-renderer.d.ts +3 -3
- package/renderer/use-root-view.d.ts +1 -1
- package/renderer/use-ui-node.d.ts +1 -1
- package/renderer/use-ui-store.d.ts +1 -1
- package/surface.d.ts +4 -4
- package/use-ikon-styles.d.ts +1 -1
- package/vite.config.d.ts +2 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BootSnapshotVariant } from '../../sdk/sdk-ui/src/index.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The one seed-axis rule shared by the early prefetch and the IkonUi construction in useIkonApp:
|
|
4
|
+
* disabled stays disabled; a signed-in load resolves through the SignedInSeeds rules (the route
|
|
5
|
+
* boot snapshots depict the app's PUBLIC entry views, which identity-split apps override there);
|
|
6
|
+
* everything else resolves through the guest axis.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveBootSnapshotSeedVariant(bootSnapshot: boolean | undefined, signedInLikely: boolean): BootSnapshotVariant | false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionState, IkonClient } from '
|
|
1
|
+
import { ConnectionState, IkonClient } from '../../sdk/sdk/src/index.ts';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { IkonUiRegistry } from '../ikon-ui-registry';
|
|
4
4
|
import { IkonUiStoreEntry } from '../surface';
|
package/app/use-ikon-app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionState, IkonClient, TimeoutConfig, WebRTCTrackMapInfo } from '
|
|
1
|
+
import { ConnectionState, IkonClient, TimeoutConfig, WebRTCTrackMapInfo } from '../../sdk/sdk/src/index.ts';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
3
|
import { AuthConfig, LoginMethod } from '../auth/types';
|
|
4
4
|
import { IkonUiRegistry } from '../ikon-ui-registry';
|
|
@@ -7,9 +7,11 @@ import { IkonUiStoreEntry } from '../surface';
|
|
|
7
7
|
declare global {
|
|
8
8
|
interface Window {
|
|
9
9
|
__IKON_AUTH_CONFIG__?: {
|
|
10
|
-
enabled: boolean;
|
|
11
10
|
methods: LoginMethod[];
|
|
11
|
+
requireSignIn?: boolean;
|
|
12
12
|
spaceId: string;
|
|
13
|
+
/** @deprecated Compat mirror of requireSignIn. */
|
|
14
|
+
enabled?: boolean;
|
|
13
15
|
backendUrl?: string;
|
|
14
16
|
authUrl?: string;
|
|
15
17
|
devLoginToken?: string;
|
|
@@ -114,6 +116,12 @@ export interface UseIkonAppResult {
|
|
|
114
116
|
* "at capacity" message (the offline overlay) rather than a transient offline/reconnecting state.
|
|
115
117
|
*/
|
|
116
118
|
isServerFull: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* True when the connect named a specific app session (`?ikon-session=`) that is no longer live.
|
|
121
|
+
* Terminal — the SDK does not retry and never falls back to a fresh session, so the app should
|
|
122
|
+
* say the session has ended rather than show a generic connection error.
|
|
123
|
+
*/
|
|
124
|
+
isSessionExpired: boolean;
|
|
117
125
|
/**
|
|
118
126
|
* UI stores for rendering.
|
|
119
127
|
*/
|
package/app/use-ikon-debug.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionState } from '
|
|
1
|
+
import { ConnectionState } from '../../sdk/sdk/src/index.ts';
|
|
2
2
|
import { UseIkonAppResult } from './use-ikon-app';
|
|
3
3
|
/**
|
|
4
4
|
* Result of useIkonDebug — same shape as the input `UseIkonAppResult` (so it can be spread
|
package/auth/auth-context.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface AuthProviderProps {
|
|
|
8
8
|
* Authentication provider that manages auth state and provides auth methods.
|
|
9
9
|
* This is a headless provider - it manages state only, no UI rendering.
|
|
10
10
|
*/
|
|
11
|
-
export declare function AuthProvider({ children, config }: AuthProviderProps): import("react
|
|
11
|
+
export declare function AuthProvider({ children, config }: AuthProviderProps): import("react").JSX.Element;
|
|
12
12
|
/**
|
|
13
13
|
* Hook to access the auth context.
|
|
14
14
|
* Throws if used outside of AuthProvider.
|
package/auth/auth-service.d.ts
CHANGED
|
@@ -9,9 +9,11 @@ export interface OAuthCallbackResult {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Authenticate anonymously with the Ikon auth service.
|
|
12
|
-
* Returns a session with a token for anonymous users.
|
|
12
|
+
* Returns a session with a token for anonymous users. `flavor` names which not-signed-in identity
|
|
13
|
+
* to enter as — 'guest' (device-scoped) or 'global' (the space-wide shared identity); omitted =
|
|
14
|
+
* the space's preference, global first. The server enforces it against the space's login methods.
|
|
13
15
|
*/
|
|
14
|
-
export declare function authenticateAnonymous(spaceId: string, authUrl: string): Promise<AuthSession>;
|
|
16
|
+
export declare function authenticateAnonymous(spaceId: string, authUrl: string, flavor?: 'global' | 'guest'): Promise<AuthSession>;
|
|
15
17
|
/**
|
|
16
18
|
* Options for requesting a one-time login code via email.
|
|
17
19
|
*/
|
package/auth/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { AuthConfig, AuthContextValue, AuthSession, AuthState, AuthUser, LoginMethod } from './types';
|
|
2
|
-
export { clearAuthSession, loadAuthSession, saveAuthSession, sessionToUser } from './storage';
|
|
2
|
+
export { clearAuthSession, isSignedInBootLikely, loadAuthSession, saveAuthSession, sessionToUser } from './storage';
|
|
3
3
|
export { authenticateAnonymous, buildOAuthRedirectUrl, clearOAuthParams, getPasskeyAuthenticationOptions, getPasskeyRegistrationOptions, isPasskeySupported, parseOAuthCallback, parseOAuthError, sendLoginCode, verifyLoginCode, verifyPasskeyAuthentication, verifyPasskeyRegistration, type OAuthCallbackResult, type SendLoginCodeOptions, type VerifyLoginCodeOptions, } from './auth-service';
|
|
4
4
|
export { AuthProvider, useAuth, useAuthOptional, type AuthProviderProps } from './auth-context';
|
|
5
5
|
export { useAuthGuard, type UseAuthGuardOptions, type UseAuthGuardResult } from './use-auth-guard';
|
package/auth/storage.d.ts
CHANGED
|
@@ -13,6 +13,14 @@ export declare function saveAuthSession(session: AuthSession): void;
|
|
|
13
13
|
* Returns null if no session exists or if the session has expired.
|
|
14
14
|
*/
|
|
15
15
|
export declare function loadAuthSession(): AuthSession | null;
|
|
16
|
+
/**
|
|
17
|
+
* Pre-auth heuristic for "this load will connect as a signed-in user": a stored non-anonymous
|
|
18
|
+
* session, or an OAuth callback in flight (the provider just redirected back with `ikon_token` in
|
|
19
|
+
* the URL — the session lands in localStorage only after the auth context mounts). Drives
|
|
20
|
+
* first-paint decisions (which boot-snapshot variant to prefetch) before AuthProvider resolves;
|
|
21
|
+
* post-auth code should use the real session object instead.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isSignedInBootLikely(): boolean;
|
|
16
24
|
/**
|
|
17
25
|
* Clear the authenticated user session from localStorage.
|
|
18
26
|
*/
|
package/auth/types.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* All supported login methods.
|
|
2
|
+
* All supported login methods. The two not-signed-in flavors: 'guest' enters as a device-scoped
|
|
3
|
+
* anonymous user (private per-visitor sessions); 'global' enters as the space-wide GLOBAL
|
|
4
|
+
* anonymous identity (all visitors collapse onto a shared app instance).
|
|
3
5
|
*/
|
|
4
|
-
export type LoginMethod = 'google' | 'facebook' | 'apple' | 'microsoft' | 'signicat' | '
|
|
6
|
+
export type LoginMethod = 'google' | 'facebook' | 'apple' | 'microsoft' | 'signicat' | 'email' | 'passkey' | 'guest' | 'global';
|
|
5
7
|
/**
|
|
6
8
|
* Authenticated user information.
|
|
7
9
|
*
|
|
@@ -27,9 +29,19 @@ export interface AuthState {
|
|
|
27
29
|
* Authentication configuration.
|
|
28
30
|
*/
|
|
29
31
|
export interface AuthConfig {
|
|
30
|
-
enabled: boolean;
|
|
31
32
|
methods: LoginMethod[];
|
|
32
33
|
spaceId: string;
|
|
34
|
+
/**
|
|
35
|
+
* When true, the frontend shows a mandatory sign-in wall before the app loads; listing 'guest' in
|
|
36
|
+
* {@link methods} adds a "Continue as guest" button to that wall. When false (the default) visitors
|
|
37
|
+
* enter immediately as an anonymous session and sign in on demand via ClientFunctions.LoginAsync —
|
|
38
|
+
* the AuthProvider is mounted either way, so sign-in is always available.
|
|
39
|
+
*/
|
|
40
|
+
requireSignIn?: boolean;
|
|
41
|
+
/** @deprecated Compat mirror of {@link requireSignIn}; read by app source not yet migrated to the always-mounted AuthProvider. */
|
|
42
|
+
enabled?: boolean;
|
|
43
|
+
/** @deprecated Superseded by {@link requireSignIn}; anonymous-start is now the default. */
|
|
44
|
+
deferLogin?: boolean;
|
|
33
45
|
/** Optional backend API URL. If not provided, derived from environment. */
|
|
34
46
|
backendUrl?: string;
|
|
35
47
|
/** Optional custom auth URL. If not provided, derived from environment. */
|
|
@@ -58,7 +70,7 @@ export interface AuthSession {
|
|
|
58
70
|
*/
|
|
59
71
|
export interface AuthContextValue {
|
|
60
72
|
state: AuthState;
|
|
61
|
-
login: (method: LoginMethod) => void
|
|
73
|
+
login: (method: LoginMethod) => Promise<void>;
|
|
62
74
|
logout: () => void;
|
|
63
75
|
getToken: () => string | null;
|
|
64
76
|
registerPasskey: (name?: string) => Promise<void>;
|
package/auth/use-auth-guard.d.ts
CHANGED
|
@@ -27,6 +27,16 @@ export interface UseAuthGuardResult {
|
|
|
27
27
|
* Current auth error, if any.
|
|
28
28
|
*/
|
|
29
29
|
error: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* True when the login screen is showing in response to an on-demand prompt (ClientFunctions.LoginShowAsync
|
|
32
|
+
* or a login_required error) while the app is otherwise accessible — as opposed to a hard sign-in wall.
|
|
33
|
+
* Use it to offer a dismiss affordance.
|
|
34
|
+
*/
|
|
35
|
+
isLoginPrompt: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Dismiss an on-demand login prompt and return to the app. No effect on a hard sign-in wall.
|
|
38
|
+
*/
|
|
39
|
+
dismissLoginPrompt: () => void;
|
|
30
40
|
}
|
|
31
41
|
/**
|
|
32
42
|
* Headless hook for route protection logic.
|
package/debug/debug-overlay.d.ts
CHANGED
|
@@ -21,4 +21,4 @@ export interface DebugOverlayProps {
|
|
|
21
21
|
/**
|
|
22
22
|
* The overlay component. Returns null unless `?ikon-debug-overlay=true` is set or `forceVisible`.
|
|
23
23
|
*/
|
|
24
|
-
export declare function DebugOverlay({ state, forceVisible }: DebugOverlayProps): import("react
|
|
24
|
+
export declare function DebugOverlay({ state, forceVisible }: DebugOverlayProps): import("react").JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IkonClient } from '
|
|
1
|
+
import { IkonClient } from '../../sdk/sdk/src/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Subscribe to a server-side <c>Reactive<T></c> and re-render whenever
|
|
4
4
|
* the value changes. The hook returns the current value, starting from the
|
package/hooks/use-reactive.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IkonClient } from '
|
|
1
|
+
import { IkonClient } from '../../sdk/sdk/src/index.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Subscribe to a server-side <c>Reactive<T></c> by the C# member name it
|
|
4
4
|
* was declared with. Resolves the stable id once via the framework function
|
package/i18n/i18n.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export interface I18nProviderProps<T> {
|
|
|
11
11
|
defaultLanguage?: string;
|
|
12
12
|
detectLanguage?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare function I18nProvider<T extends object>({ children, translations, defaultLanguage, detectLanguage, }: I18nProviderProps<T>): import("react
|
|
14
|
+
export declare function I18nProvider<T extends object>({ children, translations, defaultLanguage, detectLanguage, }: I18nProviderProps<T>): import("react").JSX.Element;
|
|
15
15
|
export declare function useI18n<T extends object>(): I18nContextValue<T>;
|
|
16
16
|
export {};
|
package/ikon-ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IkonClient } from '
|
|
2
|
-
import { IkonUiCore, IkonUiCoreConfig, IkonUiStreamListener, IkonUiUpdateListener, UiStyleListener, UiStyleDeleteListener, UiStylePayload } from '
|
|
1
|
+
import { IkonClient } from '../sdk/sdk/src/index.ts';
|
|
2
|
+
import { IkonUiCore, IkonUiCoreConfig, IkonUiStreamListener, IkonUiUpdateListener, UiStyleListener, UiStyleDeleteListener, UiStylePayload } from '../sdk/sdk-ui/src/index.ts';
|
|
3
3
|
import { IkonUiStoreEntry } from './surface';
|
|
4
4
|
export interface IkonUiConfig {
|
|
5
5
|
client?: IkonClient | null;
|
package/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { IKON_UI_MEDIA_MODULE, IKON_UI_VIDEO_CANVAS_TYPE, IKON_UI_VIDEO_URL_PLAY
|
|
|
9
9
|
export { IKON_UI_SHADERTOY_MODULE, IKON_UI_SHADERTOY_TYPE, createShadertoyRendererResolver, loadShadertoyModule, registerShadertoyModule } from './shadertoy/shadertoy-module';
|
|
10
10
|
export { UiRenderer, type UiRendererProps, UiComponentRegistry, createComponentLibrary, useUiStore, useUiNode, renderChildren } from './renderer';
|
|
11
11
|
export type { UiComponentRenderer, UiComponentLibrary, UiNode, UiRenderContext, UiComponentRendererProps, ParsedUiUpdate, UiSnapshot, UiFullSnapshot, UiDiffSnapshot, UiNodeDiff, TextDelta, UiNodeProps, UiUpdateType, UiStoreSnapshot } from './renderer';
|
|
12
|
-
export { UiStreamStore, type UiStylePayload } from '
|
|
12
|
+
export { UiStreamStore, type UiStylePayload } from '../sdk/sdk-ui/src/index.ts';
|
|
13
13
|
export { renderMotionLetters } from './shared/render-motion-letters';
|
|
14
14
|
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';
|
|
15
15
|
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';
|
|
@@ -17,4 +17,4 @@ export { useLazyFont, useToasts, useIkonReactive, useReactive, type Toast } from
|
|
|
17
17
|
export { I18nProvider, useI18n, type I18nContextValue, type I18nProviderProps } from './i18n';
|
|
18
18
|
export { InspectOverlay, type InspectElementPayload } from './inspect/inspect-overlay';
|
|
19
19
|
export { DebugOverlay, DEBUG_OVERLAY_ENABLED, type DebugOverlayProps } from './debug/debug-overlay';
|
|
20
|
-
export { randomUuid } from '
|
|
20
|
+
export { randomUuid } from '../sdk/sdk/src/index.ts';
|