@molecule/app-react 1.11.0 → 2.0.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/README.md +103 -83
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-26T04:14:39.028Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-react
|
|
@@ -250,9 +250,12 @@ interface AuthClient<T = UserProfile, TRegister extends RegisterExtraShape<TRegi
|
|
|
250
250
|
confirmPasswordReset(data: PasswordResetConfirm): Promise<void>;
|
|
251
251
|
/**
|
|
252
252
|
* Updates the current user's profile.
|
|
253
|
-
* Returns the saved
|
|
254
|
-
*
|
|
255
|
-
*
|
|
253
|
+
* Returns the saved profile: the answer applied onto the signed-in user field
|
|
254
|
+
* by field, with or without an `id` — a field it carries replaces the value
|
|
255
|
+
* (`null` clears it), one it omits or leaves `undefined` is kept, so a field
|
|
256
|
+
* cleared by omission must arrive as `null`. A non-object answer is returned
|
|
257
|
+
* as it came. An answer for a replaced or ended session leaves the current one
|
|
258
|
+
* untouched.
|
|
256
259
|
*/
|
|
257
260
|
updateProfile(data: Partial<T>): Promise<T>;
|
|
258
261
|
/**
|
|
@@ -308,9 +311,6 @@ interface AuthClient<T = UserProfile, TRegister extends RegisterExtraShape<TRegi
|
|
|
308
311
|
* Resolves when the session restore started by `initialize()` has settled — the point
|
|
309
312
|
* after which the client knows whether this visitor is signed in.
|
|
310
313
|
*
|
|
311
|
-
* Resolves IMMEDIATELY when no restore is in flight: before `initialize()` is ever
|
|
312
|
-
* called, and after it has finished. A restore that failed resolves too (it settled the
|
|
313
|
-
* question), so an HTTP client can await this before every request without risking one
|
|
314
314
|
// … truncated — the full declaration is in node_modules/@molecule/app-react/dist
|
|
315
315
|
```
|
|
316
316
|
|
|
@@ -518,12 +518,50 @@ interface HttpClient {
|
|
|
518
518
|
addErrorInterceptor(interceptor: ErrorInterceptor): () => void
|
|
519
519
|
/**
|
|
520
520
|
* Sets the authorization token.
|
|
521
|
+
*
|
|
522
|
+
* A static token: every request carries it until the next `setAuthToken` call. A client
|
|
523
|
+
* that has a {@link HttpClient.setAuthTokenResolver | resolver} (registered through
|
|
524
|
+
* `@molecule/app-http`'s `setAuthTokenSource`) ignores this value when it assembles a
|
|
525
|
+
* request — the resolver IS the session, and reading it per request is what keeps a
|
|
526
|
+
* session adopted without an auth event from sending the previous account's bearer. Once
|
|
527
|
+
* the resolver is removed, the static token is sent again.
|
|
521
528
|
*/
|
|
522
529
|
setAuthToken(token: string | null): void
|
|
523
530
|
/**
|
|
524
|
-
* Returns the
|
|
531
|
+
* Returns the token the client applies to its next request: the resolver's answer when one
|
|
532
|
+
* is registered, else the static token from `setAuthToken`.
|
|
525
533
|
*/
|
|
526
534
|
getAuthToken(): string | null
|
|
535
|
+
/**
|
|
536
|
+
* Registers the LIVE token resolver every request of this client reads, or clears it with
|
|
537
|
+
* `null`.
|
|
538
|
+
*
|
|
539
|
+
* `@molecule/app-http`'s `setAuthTokenSource()` calls this on every client it bonds, and the
|
|
540
|
+
* client MUST consult the resolver again each time it assembles a request (and report it from
|
|
541
|
+
* `getAuthToken()`). A session can change with no auth event and no observable state change —
|
|
542
|
+
* `authClient.setSession()` with the same profile data, or the OAuth callback's
|
|
543
|
+
* `setAccessToken()` — so a token pushed only at bond time or on `login`/`logout` events
|
|
544
|
+
* leaves every later request carrying the PREVIOUS session's bearer while the UI shows the
|
|
545
|
+
* new one.
|
|
546
|
+
*
|
|
547
|
+
* The resolved token takes the static token's place, with the same precedence: an
|
|
548
|
+
* `Authorization` header passed per request or in the client's default headers wins over it
|
|
549
|
+
* exactly where it won over a static token in this transport.
|
|
550
|
+
*
|
|
551
|
+
* A resolver that returns `null` (or `undefined`) means "this session has no body token": the
|
|
552
|
+
* request carries no `Authorization` header of the client's own. A cookie-session API issues
|
|
553
|
+
* no bearer, and the server prefers the header over the fresh cookie, so a kept bearer
|
|
554
|
+
* authenticates as the prior — possibly deleted — session.
|
|
555
|
+
*
|
|
556
|
+
* Optional, so an implementation written against the previous interface still conforms.
|
|
557
|
+
* `setAuthTokenSource()` follows such a client through a request interceptor instead, pushing
|
|
558
|
+
* the source with `setAuthToken` before each request: that request carries the change only
|
|
559
|
+
* when the transport applies its token after running its interceptors, so a transport that
|
|
560
|
+
* applies it earlier sends a session adopted mid-page from the following request on.
|
|
561
|
+
*
|
|
562
|
+
* @param resolver - Returns the current access token (or null/undefined), or `null` to clear.
|
|
563
|
+
*/
|
|
564
|
+
setAuthTokenResolver?(resolver: AuthTokenResolver | null): void
|
|
527
565
|
/**
|
|
528
566
|
* Registers a handler for authentication errors (401).
|
|
529
567
|
*
|
|
@@ -1418,7 +1456,7 @@ interface UseAuthResult<
|
|
|
1418
1456
|
*
|
|
1419
1457
|
* `setUser` alone does NOT sign the client in, and `setAccessToken` changes
|
|
1420
1458
|
* storage only — using those two for a caller-issued session leaves every
|
|
1421
|
-
* `authenticated` read signed out
|
|
1459
|
+
* `authenticated` read signed out.
|
|
1422
1460
|
*/
|
|
1423
1461
|
setSession: AuthClient<T>['setSession']
|
|
1424
1462
|
isAuthenticated: boolean
|
|
@@ -1874,7 +1912,7 @@ function useAIModels(projectId?: string): UseAIModelsResult
|
|
|
1874
1912
|
Hook like useState but accepts Promises and supports partial state extension.
|
|
1875
1913
|
|
|
1876
1914
|
```typescript
|
|
1877
|
-
function useAsyncState(initialState: T): [T, AsyncSetState<T>, AsyncExtendState<T>]
|
|
1915
|
+
function useAsyncState<T>(initialState: T): [T, AsyncSetState<T>, AsyncExtendState<T>]
|
|
1878
1916
|
```
|
|
1879
1917
|
|
|
1880
1918
|
- `initialState` — Initial state value
|
|
@@ -1890,7 +1928,10 @@ Pass the same generics the client was created with —
|
|
|
1890
1928
|
the app's own fields.
|
|
1891
1929
|
|
|
1892
1930
|
```typescript
|
|
1893
|
-
function useAuthClient
|
|
1931
|
+
function useAuthClient<
|
|
1932
|
+
T = unknown,
|
|
1933
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
1934
|
+
>(): AuthClient<T, TRegister>
|
|
1894
1935
|
```
|
|
1895
1936
|
|
|
1896
1937
|
**Returns:** The auth client from context
|
|
@@ -1920,7 +1961,10 @@ call (and `requestBody` receives the same payload). Without it, `register`
|
|
|
1920
1961
|
accepts only the base fields.
|
|
1921
1962
|
|
|
1922
1963
|
```typescript
|
|
1923
|
-
function useAuth
|
|
1964
|
+
function useAuth<
|
|
1965
|
+
T = unknown,
|
|
1966
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
1967
|
+
>(options?: UseAuthOptions): UseAuthResult<T, TRegister>
|
|
1924
1968
|
```
|
|
1925
1969
|
|
|
1926
1970
|
- `options` — Hook options
|
|
@@ -1932,7 +1976,7 @@ function useAuth(options?: UseAuthOptions): UseAuthResult<T, TRegister>
|
|
|
1932
1976
|
Hook to get just the authenticated user.
|
|
1933
1977
|
|
|
1934
1978
|
```typescript
|
|
1935
|
-
function useUser(): T | null
|
|
1979
|
+
function useUser<T = unknown>(): T | null
|
|
1936
1980
|
```
|
|
1937
1981
|
|
|
1938
1982
|
**Returns:** The authenticated user or null
|
|
@@ -2094,7 +2138,7 @@ wires a form library once (`setProvider` from `@molecule/app-forms`) and
|
|
|
2094
2138
|
every form picks it up. Passing `createForm` overrides that for one form.
|
|
2095
2139
|
|
|
2096
2140
|
```typescript
|
|
2097
|
-
function useForm(options?: UseFormOptions<T>): UseFormResult<T>
|
|
2141
|
+
function useForm<T extends Record<string, unknown>>(options?: UseFormOptions<T>): UseFormResult<T>
|
|
2098
2142
|
```
|
|
2099
2143
|
|
|
2100
2144
|
- `options` — Form options. `defaultValues`, `mode` and the form-level `validate` are forwarded to the provider; omit the options entirely for a form whose fields are registered with their own defaults.
|
|
@@ -2106,7 +2150,10 @@ function useForm(options?: UseFormOptions<T>): UseFormResult<T>
|
|
|
2106
2150
|
Hook to watch a specific field value.
|
|
2107
2151
|
|
|
2108
2152
|
```typescript
|
|
2109
|
-
function useWatch
|
|
2153
|
+
function useWatch<T extends Record<string, unknown>, K extends keyof T>(
|
|
2154
|
+
form: FormController<T>,
|
|
2155
|
+
name: K,
|
|
2156
|
+
): T[K]
|
|
2110
2157
|
```
|
|
2111
2158
|
|
|
2112
2159
|
- `form` — Form controller
|
|
@@ -2119,7 +2166,10 @@ function useWatch(form: FormController<T>, name: K): T[K]
|
|
|
2119
2166
|
Hook to get field-level state.
|
|
2120
2167
|
|
|
2121
2168
|
```typescript
|
|
2122
|
-
function useFieldState
|
|
2169
|
+
function useFieldState<T extends Record<string, unknown>>(
|
|
2170
|
+
form: FormController<T>,
|
|
2171
|
+
name: keyof T,
|
|
2172
|
+
): FieldState<T[keyof T]>
|
|
2123
2173
|
```
|
|
2124
2174
|
|
|
2125
2175
|
- `form` — Form controller
|
|
@@ -2151,7 +2201,7 @@ the client does replace `execute` (it selects a different request) and
|
|
|
2151
2201
|
re-runs such an effect.
|
|
2152
2202
|
|
|
2153
2203
|
```typescript
|
|
2154
|
-
function useHttp(
|
|
2204
|
+
function useHttp<T>(
|
|
2155
2205
|
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
|
|
2156
2206
|
url: string,
|
|
2157
2207
|
options?: UseHttpOptions<T>,
|
|
@@ -2169,7 +2219,7 @@ function useHttp(
|
|
|
2169
2219
|
Hook for GET requests.
|
|
2170
2220
|
|
|
2171
2221
|
```typescript
|
|
2172
|
-
function useGet(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2222
|
+
function useGet<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2173
2223
|
```
|
|
2174
2224
|
|
|
2175
2225
|
- `url` — Request URL to fetch from.
|
|
@@ -2182,7 +2232,7 @@ function useGet(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2182
2232
|
Hook for POST requests.
|
|
2183
2233
|
|
|
2184
2234
|
```typescript
|
|
2185
|
-
function usePost(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2235
|
+
function usePost<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2186
2236
|
```
|
|
2187
2237
|
|
|
2188
2238
|
- `url` — Request URL to post to.
|
|
@@ -2195,7 +2245,7 @@ function usePost(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2195
2245
|
Hook for PUT requests.
|
|
2196
2246
|
|
|
2197
2247
|
```typescript
|
|
2198
|
-
function usePut(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2248
|
+
function usePut<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2199
2249
|
```
|
|
2200
2250
|
|
|
2201
2251
|
- `url` — Request URL to send the PUT request to.
|
|
@@ -2208,7 +2258,7 @@ function usePut(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2208
2258
|
Hook for PATCH requests.
|
|
2209
2259
|
|
|
2210
2260
|
```typescript
|
|
2211
|
-
function usePatch(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2261
|
+
function usePatch<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2212
2262
|
```
|
|
2213
2263
|
|
|
2214
2264
|
- `url` — Request URL to send the PATCH request to.
|
|
@@ -2221,7 +2271,7 @@ function usePatch(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
|
2221
2271
|
Hook for DELETE requests.
|
|
2222
2272
|
|
|
2223
2273
|
```typescript
|
|
2224
|
-
function useDelete(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2274
|
+
function useDelete<T>(url: string, options?: UseHttpOptions<T>): UseHttpResult<T>
|
|
2225
2275
|
```
|
|
2226
2276
|
|
|
2227
2277
|
- `url` — Request URL of the resource to delete.
|
|
@@ -2284,7 +2334,7 @@ no separate `useRegister` hook. Use `usePromise(register)` when the form
|
|
|
2284
2334
|
needs the same pending/error tracking as this login hook.
|
|
2285
2335
|
|
|
2286
2336
|
```typescript
|
|
2287
|
-
function useLogin(): UseLoginReturn<T>
|
|
2337
|
+
function useLogin<T = unknown>(): UseLoginReturn<T>
|
|
2288
2338
|
```
|
|
2289
2339
|
|
|
2290
2340
|
**Returns:** Login state and action
|
|
@@ -2379,7 +2429,7 @@ the clean baseline; edits made while saving remain dirty. No request is made
|
|
|
2379
2429
|
for a patch with no fields. A failed request retains the edits and shared user.
|
|
2380
2430
|
|
|
2381
2431
|
```typescript
|
|
2382
|
-
function useProfileForm(
|
|
2432
|
+
function useProfileForm<TUser, TValues extends Record<string, unknown>>(
|
|
2383
2433
|
options: UseProfileFormOptions<TUser, TValues>,
|
|
2384
2434
|
): UseProfileFormResult<TUser, TValues>
|
|
2385
2435
|
```
|
|
@@ -2393,7 +2443,7 @@ function useProfileForm(
|
|
|
2393
2443
|
Hook that wraps an async function with state tracking.
|
|
2394
2444
|
|
|
2395
2445
|
```typescript
|
|
2396
|
-
function usePromise(
|
|
2446
|
+
function usePromise<T extends (...args: any[]) => Promise<any>>(
|
|
2397
2447
|
asyncFn: T,
|
|
2398
2448
|
): [
|
|
2399
2449
|
UsePromiseState<Awaited<ReturnType<T>>>,
|
|
@@ -2454,7 +2504,7 @@ function useLocation(): RouteLocation
|
|
|
2454
2504
|
Hook to get route parameters.
|
|
2455
2505
|
|
|
2456
2506
|
```typescript
|
|
2457
|
-
function useParams(): T
|
|
2507
|
+
function useParams<T extends Record<string, string> = RouteParams>(): T
|
|
2458
2508
|
```
|
|
2459
2509
|
|
|
2460
2510
|
**Returns:** The current route parameters
|
|
@@ -2464,7 +2514,7 @@ function useParams(): T
|
|
|
2464
2514
|
Hook to get query parameters.
|
|
2465
2515
|
|
|
2466
2516
|
```typescript
|
|
2467
|
-
function useQuery(): T
|
|
2517
|
+
function useQuery<T extends QueryParams = QueryParams>(): T
|
|
2468
2518
|
```
|
|
2469
2519
|
|
|
2470
2520
|
**Returns:** The current query parameters
|
|
@@ -2497,7 +2547,10 @@ function useIsActive(path: string, exact?: boolean): boolean
|
|
|
2497
2547
|
Hook for user registration with async state tracking.
|
|
2498
2548
|
|
|
2499
2549
|
```typescript
|
|
2500
|
-
function useSignup
|
|
2550
|
+
function useSignup<
|
|
2551
|
+
T = unknown,
|
|
2552
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
2553
|
+
>(): UseSignupReturn<T, TRegister>
|
|
2501
2554
|
```
|
|
2502
2555
|
|
|
2503
2556
|
**Returns:** Signup state and action
|
|
@@ -2517,7 +2570,10 @@ function useStorageProvider(): StorageProvider
|
|
|
2517
2570
|
Hook to manage a single storage value with React state sync.
|
|
2518
2571
|
|
|
2519
2572
|
```typescript
|
|
2520
|
-
function useStorageValue
|
|
2573
|
+
function useStorageValue<T>(
|
|
2574
|
+
key: string,
|
|
2575
|
+
options?: UseStorageValueOptions<T>,
|
|
2576
|
+
): UseStorageValueResult<T>
|
|
2521
2577
|
```
|
|
2522
2578
|
|
|
2523
2579
|
- `key` — Storage key
|
|
@@ -2569,7 +2625,7 @@ the state context. A store minted outside the `state` bond — the direct
|
|
|
2569
2625
|
therefore as valid here as one `@molecule/app-state`'s `createStore()` made.
|
|
2570
2626
|
|
|
2571
2627
|
```typescript
|
|
2572
|
-
function useStore(store: Store<T>, options?: UseStoreOptions<T, S>): S
|
|
2628
|
+
function useStore<T, S = T>(store: Store<T>, options?: UseStoreOptions<T, S>): S
|
|
2573
2629
|
```
|
|
2574
2630
|
|
|
2575
2631
|
- `store` — The store to subscribe to
|
|
@@ -2582,7 +2638,7 @@ function useStore(store: Store<T>, options?: UseStoreOptions<T, S>): S
|
|
|
2582
2638
|
Hook to get the store's setState function.
|
|
2583
2639
|
|
|
2584
2640
|
```typescript
|
|
2585
|
-
function useSetStore(store: Store<T>):
|
|
2641
|
+
function useSetStore<T>(store: Store<T>): Store<T>['setState']
|
|
2586
2642
|
```
|
|
2587
2643
|
|
|
2588
2644
|
- `store` — The store to get setState from
|
|
@@ -2594,7 +2650,7 @@ function useSetStore(store: Store<T>): (partial: Partial<T> | ((state: T) => Par
|
|
|
2594
2650
|
Hook to create a bound action for a store.
|
|
2595
2651
|
|
|
2596
2652
|
```typescript
|
|
2597
|
-
function useStoreAction(
|
|
2653
|
+
function useStoreAction<T, Args extends unknown[], R>(
|
|
2598
2654
|
store: Store<T>,
|
|
2599
2655
|
action: (setState: Store<T>['setState'], getState: Store<T>['getState']) => (...args: Args) => R,
|
|
2600
2656
|
): (...args: Args) => R
|
|
@@ -2650,7 +2706,7 @@ function useThemeMode(): 'light' | 'dark'
|
|
|
2650
2706
|
Hook to get theme colors.
|
|
2651
2707
|
|
|
2652
2708
|
```typescript
|
|
2653
|
-
function useThemeColors():
|
|
2709
|
+
function useThemeColors(): Theme['colors']
|
|
2654
2710
|
```
|
|
2655
2711
|
|
|
2656
2712
|
**Returns:** The current theme colors
|
|
@@ -2811,10 +2867,7 @@ function useWorkspace(): UseWorkspaceResult
|
|
|
2811
2867
|
Provider for state management.
|
|
2812
2868
|
|
|
2813
2869
|
```typescript
|
|
2814
|
-
function StateProvider({
|
|
2815
|
-
provider,
|
|
2816
|
-
children,
|
|
2817
|
-
}: StateProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2870
|
+
function StateProvider({ provider, children }: StateProviderProps): React.ReactElement
|
|
2818
2871
|
```
|
|
2819
2872
|
|
|
2820
2873
|
- `props` — Component props (see {@link StateProviderProps}).
|
|
@@ -2826,10 +2879,7 @@ function StateProvider({
|
|
|
2826
2879
|
Provider for authentication.
|
|
2827
2880
|
|
|
2828
2881
|
```typescript
|
|
2829
|
-
function AuthProvider({
|
|
2830
|
-
client,
|
|
2831
|
-
children,
|
|
2832
|
-
}: AuthProviderProps<T>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2882
|
+
function AuthProvider<T = unknown>({ client, children }: AuthProviderProps<T>): React.ReactElement
|
|
2833
2883
|
```
|
|
2834
2884
|
|
|
2835
2885
|
- `props` — Component props (see {@link AuthProviderProps}).
|
|
@@ -2841,10 +2891,7 @@ function AuthProvider({
|
|
|
2841
2891
|
Provider for theming.
|
|
2842
2892
|
|
|
2843
2893
|
```typescript
|
|
2844
|
-
function ThemeProvider({
|
|
2845
|
-
provider,
|
|
2846
|
-
children,
|
|
2847
|
-
}: ThemeProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2894
|
+
function ThemeProvider({ provider, children }: ThemeProviderProps): React.ReactElement
|
|
2848
2895
|
```
|
|
2849
2896
|
|
|
2850
2897
|
- `props` — Component props (see {@link ThemeProviderProps}).
|
|
@@ -2856,10 +2903,7 @@ function ThemeProvider({
|
|
|
2856
2903
|
Provider for routing.
|
|
2857
2904
|
|
|
2858
2905
|
```typescript
|
|
2859
|
-
function RouterProvider({
|
|
2860
|
-
router,
|
|
2861
|
-
children,
|
|
2862
|
-
}: RouterProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2906
|
+
function RouterProvider({ router, children }: RouterProviderProps): React.ReactElement
|
|
2863
2907
|
```
|
|
2864
2908
|
|
|
2865
2909
|
- `props` — Component props (see {@link RouterProviderProps}).
|
|
@@ -2871,10 +2915,7 @@ function RouterProvider({
|
|
|
2871
2915
|
Provider for internationalization.
|
|
2872
2916
|
|
|
2873
2917
|
```typescript
|
|
2874
|
-
function I18nProvider({
|
|
2875
|
-
provider,
|
|
2876
|
-
children,
|
|
2877
|
-
}: I18nProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2918
|
+
function I18nProvider({ provider, children }: I18nProviderProps): React.ReactElement
|
|
2878
2919
|
```
|
|
2879
2920
|
|
|
2880
2921
|
- `props` — Component props (see {@link I18nProviderProps}).
|
|
@@ -2886,10 +2927,7 @@ function I18nProvider({
|
|
|
2886
2927
|
Provider for HTTP client.
|
|
2887
2928
|
|
|
2888
2929
|
```typescript
|
|
2889
|
-
function HttpProvider({
|
|
2890
|
-
client,
|
|
2891
|
-
children,
|
|
2892
|
-
}: HttpProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2930
|
+
function HttpProvider({ client, children }: HttpProviderProps): React.ReactElement
|
|
2893
2931
|
```
|
|
2894
2932
|
|
|
2895
2933
|
- `props` — Component props (see {@link HttpProviderProps}).
|
|
@@ -2901,10 +2939,7 @@ function HttpProvider({
|
|
|
2901
2939
|
Provider for storage.
|
|
2902
2940
|
|
|
2903
2941
|
```typescript
|
|
2904
|
-
function StorageProvider({
|
|
2905
|
-
provider,
|
|
2906
|
-
children,
|
|
2907
|
-
}: StorageProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2942
|
+
function StorageProvider({ provider, children }: StorageProviderProps): React.ReactElement
|
|
2908
2943
|
```
|
|
2909
2944
|
|
|
2910
2945
|
- `props` — Component props (see {@link StorageProviderProps}).
|
|
@@ -2916,10 +2951,7 @@ function StorageProvider({
|
|
|
2916
2951
|
Provider for logging.
|
|
2917
2952
|
|
|
2918
2953
|
```typescript
|
|
2919
|
-
function LoggerProvider({
|
|
2920
|
-
provider,
|
|
2921
|
-
children,
|
|
2922
|
-
}: LoggerProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2954
|
+
function LoggerProvider({ provider, children }: LoggerProviderProps): React.ReactElement
|
|
2923
2955
|
```
|
|
2924
2956
|
|
|
2925
2957
|
- `props` — Component props (see {@link LoggerProviderProps}).
|
|
@@ -2931,10 +2963,7 @@ function LoggerProvider({
|
|
|
2931
2963
|
Provider for AI chat.
|
|
2932
2964
|
|
|
2933
2965
|
```typescript
|
|
2934
|
-
function ChatProvider({
|
|
2935
|
-
provider,
|
|
2936
|
-
children,
|
|
2937
|
-
}: ChatProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2966
|
+
function ChatProvider({ provider, children }: ChatProviderProps): React.ReactElement
|
|
2938
2967
|
```
|
|
2939
2968
|
|
|
2940
2969
|
- `props` — Component props (see {@link ChatProviderProps}).
|
|
@@ -2946,10 +2975,7 @@ function ChatProvider({
|
|
|
2946
2975
|
Provider for IDE workspace.
|
|
2947
2976
|
|
|
2948
2977
|
```typescript
|
|
2949
|
-
function WorkspaceProvider({
|
|
2950
|
-
provider,
|
|
2951
|
-
children,
|
|
2952
|
-
}: WorkspaceProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2978
|
+
function WorkspaceProvider({ provider, children }: WorkspaceProviderProps): React.ReactElement
|
|
2953
2979
|
```
|
|
2954
2980
|
|
|
2955
2981
|
- `props` — Component props (see {@link WorkspaceProviderProps}).
|
|
@@ -2961,10 +2987,7 @@ function WorkspaceProvider({
|
|
|
2961
2987
|
Provider for code editor.
|
|
2962
2988
|
|
|
2963
2989
|
```typescript
|
|
2964
|
-
function EditorProvider({
|
|
2965
|
-
provider,
|
|
2966
|
-
children,
|
|
2967
|
-
}: EditorProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
2990
|
+
function EditorProvider({ provider, children }: EditorProviderProps): React.ReactElement
|
|
2968
2991
|
```
|
|
2969
2992
|
|
|
2970
2993
|
- `props` — Component props (see {@link EditorProviderProps}).
|
|
@@ -2976,10 +2999,7 @@ function EditorProvider({
|
|
|
2976
2999
|
Provider for live preview.
|
|
2977
3000
|
|
|
2978
3001
|
```typescript
|
|
2979
|
-
function PreviewProvider({
|
|
2980
|
-
provider,
|
|
2981
|
-
children,
|
|
2982
|
-
}: PreviewProviderProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>
|
|
3002
|
+
function PreviewProvider({ provider, children }: PreviewProviderProps): React.ReactElement
|
|
2983
3003
|
```
|
|
2984
3004
|
|
|
2985
3005
|
- `props` — Component props (see {@link PreviewProviderProps}).
|
|
@@ -3011,7 +3031,7 @@ function MoleculeProvider({
|
|
|
3011
3031
|
workspace,
|
|
3012
3032
|
editor,
|
|
3013
3033
|
preview,
|
|
3014
|
-
}: MoleculeProviderProps): React.ReactElement
|
|
3034
|
+
}: MoleculeProviderProps): React.ReactElement
|
|
3015
3035
|
```
|
|
3016
3036
|
|
|
3017
3037
|
- `props` — Component props (see {@link MoleculeProviderProps}) — each service is optional, and ONLY the services passed are provided to the tree.
|
|
@@ -3148,7 +3168,7 @@ const PreviewContext: Context<PreviewProvider | null>
|
|
|
3148
3168
|
|
|
3149
3169
|
Peer dependencies:
|
|
3150
3170
|
|
|
3151
|
-
- `@molecule/app-auth` ^
|
|
3171
|
+
- `@molecule/app-auth` ^3.0.0
|
|
3152
3172
|
- `@molecule/app-ai-models` ^1.0.1
|
|
3153
3173
|
- `@molecule/app-forms` ^1.0.1
|
|
3154
3174
|
- `@molecule/app-utilities` ^1.0.1
|
package/dist/types.d.ts
CHANGED
|
@@ -161,7 +161,7 @@ export interface UseAuthResult<T = unknown, TRegister extends RegisterExtraShape
|
|
|
161
161
|
*
|
|
162
162
|
* `setUser` alone does NOT sign the client in, and `setAccessToken` changes
|
|
163
163
|
* storage only — using those two for a caller-issued session leaves every
|
|
164
|
-
* `authenticated` read signed out
|
|
164
|
+
* `authenticated` read signed out.
|
|
165
165
|
*/
|
|
166
166
|
setSession: AuthClient<T>['setSession'];
|
|
167
167
|
isAuthenticated: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "React framework bindings for molecule.dev",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@molecule/app-auth": "^
|
|
26
|
+
"@molecule/app-auth": "^3.0.0",
|
|
27
27
|
"@molecule/app-ai-models": "^1.0.1",
|
|
28
28
|
"@molecule/app-forms": "^1.0.1",
|
|
29
29
|
"@molecule/app-utilities": "^1.0.1",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@molecule/app-ai-models": "1.4.3",
|
|
64
|
-
"@molecule/app-bonds-default-react": "
|
|
65
|
-
"@molecule/app-i18n": "1.1.
|
|
64
|
+
"@molecule/app-bonds-default-react": "3.0.0",
|
|
65
|
+
"@molecule/app-i18n": "1.1.1",
|
|
66
66
|
"@testing-library/dom": "10.4.2",
|
|
67
67
|
"@testing-library/react": "16.3.3",
|
|
68
68
|
"@types/node": "26.6.5",
|