@molecule/app-svelte 3.8.0 → 3.10.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/README.md +411 -373
- package/dist/context.d.ts +17 -5
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +25 -11
- package/dist/hooks/useChangePassword.d.ts +8 -2
- package/dist/hooks/useChangePassword.d.ts.map +1 -1
- package/dist/hooks/useLogin.d.ts +8 -2
- package/dist/hooks/useLogin.d.ts.map +1 -1
- package/dist/hooks/usePasswordReset.d.ts +8 -2
- package/dist/hooks/usePasswordReset.d.ts.map +1 -1
- package/dist/hooks/useSignup.d.ts +8 -2
- package/dist/hooks/useSignup.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/providers/AuthProvider.svelte +24 -0
- package/dist/providers/AuthProvider.svelte.d.ts +5 -0
- package/dist/providers/AuthProvider.svelte.d.ts.map +1 -0
- package/dist/providers/ChatProvider.svelte +15 -0
- package/dist/providers/ChatProvider.svelte.d.ts +5 -0
- package/dist/providers/ChatProvider.svelte.d.ts.map +1 -0
- package/dist/providers/EditorProvider.svelte +15 -0
- package/dist/providers/EditorProvider.svelte.d.ts +5 -0
- package/dist/providers/EditorProvider.svelte.d.ts.map +1 -0
- package/dist/providers/HttpProvider.svelte +15 -0
- package/dist/providers/HttpProvider.svelte.d.ts +5 -0
- package/dist/providers/HttpProvider.svelte.d.ts.map +1 -0
- package/dist/providers/I18nProvider.svelte +15 -0
- package/dist/providers/I18nProvider.svelte.d.ts +5 -0
- package/dist/providers/I18nProvider.svelte.d.ts.map +1 -0
- package/dist/providers/LoggerProvider.svelte +15 -0
- package/dist/providers/LoggerProvider.svelte.d.ts +5 -0
- package/dist/providers/LoggerProvider.svelte.d.ts.map +1 -0
- package/dist/providers/MoleculeProvider.svelte +62 -0
- package/dist/providers/MoleculeProvider.svelte.d.ts +5 -0
- package/dist/providers/MoleculeProvider.svelte.d.ts.map +1 -0
- package/dist/providers/PreviewProvider.svelte +15 -0
- package/dist/providers/PreviewProvider.svelte.d.ts +5 -0
- package/dist/providers/PreviewProvider.svelte.d.ts.map +1 -0
- package/dist/providers/Provided.svelte +27 -0
- package/dist/providers/Provided.svelte.d.ts +11 -0
- package/dist/providers/Provided.svelte.d.ts.map +1 -0
- package/dist/providers/RouterProvider.svelte +18 -0
- package/dist/providers/RouterProvider.svelte.d.ts +5 -0
- package/dist/providers/RouterProvider.svelte.d.ts.map +1 -0
- package/dist/providers/StateProvider.svelte +15 -0
- package/dist/providers/StateProvider.svelte.d.ts +5 -0
- package/dist/providers/StateProvider.svelte.d.ts.map +1 -0
- package/dist/providers/StorageProvider.svelte +15 -0
- package/dist/providers/StorageProvider.svelte.d.ts +5 -0
- package/dist/providers/StorageProvider.svelte.d.ts.map +1 -0
- package/dist/providers/ThemeProvider.svelte +15 -0
- package/dist/providers/ThemeProvider.svelte.d.ts +5 -0
- package/dist/providers/ThemeProvider.svelte.d.ts.map +1 -0
- package/dist/providers/WorkspaceProvider.svelte +15 -0
- package/dist/providers/WorkspaceProvider.svelte.d.ts +5 -0
- package/dist/providers/WorkspaceProvider.svelte.d.ts.map +1 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +7 -0
- package/dist/providers/providers.d.ts +133 -0
- package/dist/providers/providers.d.ts.map +1 -0
- package/dist/providers/providers.js +105 -0
- package/dist/providers/services.d.ts +26 -0
- package/dist/providers/services.d.ts.map +1 -0
- package/dist/providers/services.js +86 -0
- package/dist/routed-view/RoutedView.svelte +13 -0
- package/dist/routed-view/RoutedView.svelte.d.ts +19 -0
- package/dist/routed-view/RoutedView.svelte.d.ts.map +1 -0
- package/dist/routed-view/index.d.ts +8 -0
- package/dist/routed-view/index.d.ts.map +1 -0
- package/dist/routed-view/index.js +7 -0
- package/dist/routed-view-context.d.ts +25 -0
- package/dist/routed-view-context.d.ts.map +1 -0
- package/dist/routed-view-context.js +34 -0
- package/dist/types.d.ts +124 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -2
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-11-
|
|
6
|
+
Generated: 2026-11-22T07:13:44.407Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-svelte
|
|
@@ -566,6 +566,21 @@ interface FormController<T extends FormValuesConstraint<T> = Record<string, unkn
|
|
|
566
566
|
}
|
|
567
567
|
```
|
|
568
568
|
|
|
569
|
+
#### `FormResetOptions`
|
|
570
|
+
|
|
571
|
+
Options controlling how externally supplied values replace a form's baseline.
|
|
572
|
+
|
|
573
|
+
```typescript
|
|
574
|
+
interface FormResetOptions {
|
|
575
|
+
/**
|
|
576
|
+
* Keep fields whose current value differs from their baseline when `values`
|
|
577
|
+
* changes. Pristine fields still take the new values. False by default, so a
|
|
578
|
+
* new record can replace edits from the previous record.
|
|
579
|
+
*/
|
|
580
|
+
keepDirtyValues?: boolean
|
|
581
|
+
}
|
|
582
|
+
```
|
|
583
|
+
|
|
569
584
|
#### `FormOptions`
|
|
570
585
|
|
|
571
586
|
Form creation options.
|
|
@@ -808,188 +823,6 @@ interface HttpClient {
|
|
|
808
823
|
|
|
809
824
|
_(The longest member comment is shortened to its first sentence to fit; the full declaration is in `node_modules/@molecule/app-http/dist/client.d.ts`.)_
|
|
810
825
|
|
|
811
|
-
#### `I18nProvider`
|
|
812
|
-
|
|
813
|
-
i18n provider interface.
|
|
814
|
-
|
|
815
|
-
All i18n providers must implement this interface.
|
|
816
|
-
|
|
817
|
-
```typescript
|
|
818
|
-
interface I18nProvider {
|
|
819
|
-
/**
|
|
820
|
-
* Gets the current locale.
|
|
821
|
-
*/
|
|
822
|
-
getLocale(): string
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* Sets the current locale.
|
|
826
|
-
*
|
|
827
|
-
* **Fleet contract:** every conformant provider (the core simple provider,
|
|
828
|
-
* `@molecule/api-i18n-simple`, `@molecule/app-i18n-i18next`, and
|
|
829
|
-
* `@molecule/app-i18n-react-i18next`) MUST throw `Error('Locale "<code>"
|
|
830
|
-
* not found')` when `locale` is not registered — via the constructor's
|
|
831
|
-
* `initialLocales`/`locales` config, `addLocale()`, or `addTranslations()`
|
|
832
|
-
* (all three register a locale). It must NOT silently degrade to
|
|
833
|
-
* fallback-locale text while `getLocale()` reports the unregistered code —
|
|
834
|
-
* that divergence makes a misconfigured locale switch indistinguishable
|
|
835
|
-
* from a working one until a user notices the wrong language on screen.
|
|
836
|
-
*/
|
|
837
|
-
setLocale(locale: string): Promise<void>
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Gets all available locales.
|
|
841
|
-
*/
|
|
842
|
-
getLocales(): LocaleConfig[]
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* Adds a locale.
|
|
846
|
-
*/
|
|
847
|
-
addLocale(config: LocaleConfig): void
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Removes a locale by code, notifying subscribers so language pickers
|
|
851
|
-
* built on `onLocaleChange` re-render their list. If the removed locale
|
|
852
|
-
* is currently active, the caller is responsible for switching to a
|
|
853
|
-
* fallback (e.g. `'en'`) BEFORE calling this — the provider will not
|
|
854
|
-
* auto-fall-back on its own.
|
|
855
|
-
*
|
|
856
|
-
* Returns `true` if the locale was registered and removed, `false`
|
|
857
|
-
* otherwise.
|
|
858
|
-
*/
|
|
859
|
-
removeLocale(code: string): boolean
|
|
860
|
-
|
|
861
|
-
/**
|
|
862
|
-
* Adds translations to a locale. Auto-creates the locale if it doesn't exist.
|
|
863
|
-
*
|
|
864
|
-
* **Fleet contract:** merges are DEEP, not a shallow spread — registering
|
|
865
|
-
* two calls (e.g. two modules) that share a top-level namespace key merges
|
|
866
|
-
* their subtrees instead of the second call clobbering the first's nested
|
|
867
|
-
* translations wholesale. `@molecule/api-i18n-simple` implements the same
|
|
868
|
-
* contract on the API side.
|
|
869
|
-
*/
|
|
870
|
-
addTranslations(locale: string, translations: Translations, namespace?: string): void
|
|
871
|
-
|
|
872
|
-
/**
|
|
873
|
-
* Translates a key with optional interpolation values and pluralization.
|
|
874
|
-
*
|
|
875
|
-
* **Fleet plural contract (matches i18next's own key resolution order):**
|
|
876
|
-
* when `options.count` is provided, the plural-suffixed key
|
|
877
|
-
* (`` `${key}_${pluralForm}` ``, e.g. `item_one`/`item_few`/…, falling back
|
|
878
|
-
* to `` `${key}_other` ``) is looked up FIRST and wins over the base `key`
|
|
879
|
-
* if BOTH are registered. Only when no plural-suffixed key exists at all
|
|
880
|
-
* does resolution fall back to the base key. A catalog that ships both
|
|
881
|
-
* `item` and `item_one`/`item_other` therefore pluralizes identically
|
|
882
|
-
* whichever provider is bonded.
|
|
883
|
-
*
|
|
884
|
-
* @returns The translated string, or the default value / key if not found.
|
|
885
|
-
*/
|
|
886
|
-
t(key: string, values?: InterpolationValues, options?: TranslateOptions): string
|
|
887
|
-
|
|
888
|
-
/**
|
|
889
|
-
* Checks if a translation key exists.
|
|
890
|
-
*
|
|
891
|
-
* **Fleet contract:** follows the SAME locale-resolution chain as `t()` —
|
|
892
|
-
* the active locale, then the English fallback — so `exists(key) === true`
|
|
893
|
-
* whenever `t(key)` would render real translated text (not the raw key or
|
|
894
|
-
* an inline `defaultValue`). Do not narrow this to "only the active
|
|
895
|
-
* locale's own catalog"; that made `exists()` return `false` for keys `t()`
|
|
896
|
-
* happily rendered via the English fallback, and the answer differed by
|
|
897
|
-
* provider.
|
|
898
|
-
*
|
|
899
|
-
* @returns `true` if the key has a translation.
|
|
900
|
-
*/
|
|
901
|
-
exists(key: string): boolean
|
|
902
|
-
|
|
903
|
-
/**
|
|
904
|
-
* Formats a number according to the current locale.
|
|
905
|
-
*
|
|
906
|
-
* @returns The locale-formatted number string.
|
|
907
|
-
*/
|
|
908
|
-
formatNumber(value: number, options?: NumberFormatOptions): string
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* Formats a date according to the current locale.
|
|
912
|
-
*
|
|
913
|
-
* @returns The locale-formatted date string.
|
|
914
|
-
*/
|
|
915
|
-
formatDate(value: Date | number | string, options?: DateFormatOptions): string
|
|
916
|
-
|
|
917
|
-
/**
|
|
918
|
-
* Formats a relative time (e.g. "2 hours ago").
|
|
919
|
-
*
|
|
920
|
-
* @returns The locale-formatted relative time string.
|
|
921
|
-
*/
|
|
922
|
-
formatRelativeTime(value: Date | number, options?: { unit?: Intl.RelativeTimeFormatUnit }): string
|
|
923
|
-
|
|
924
|
-
/**
|
|
925
|
-
* Formats a list (e.g. "A, B, and C").
|
|
926
|
-
*
|
|
927
|
-
* @returns The locale-formatted list string.
|
|
928
|
-
*/
|
|
929
|
-
formatList(values: string[], options?: { type?: 'conjunction' | 'disjunction' | 'unit' }): string
|
|
930
|
-
|
|
931
|
-
/**
|
|
932
|
-
* Subscribes to locale changes.
|
|
933
|
-
*
|
|
934
|
-
* @returns An unsubscribe function.
|
|
935
|
-
*/
|
|
936
|
-
onLocaleChange(listener: (locale: string) => void): () => void
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* Gets a counter that advances for every change `onLocaleChange` announces:
|
|
940
|
-
* a locale switch, a locale-list change, or translations added for a locale
|
|
941
|
-
* `t()` reads (the active locale and the locales it falls back to — English
|
|
942
|
-
* for `createSimpleI18nProvider`). It does NOT advance for a re-registration
|
|
943
|
-
* that leaves every rendered string identical.
|
|
944
|
-
*
|
|
945
|
-
* **Optional — read it only when present.** A consumer that observes the
|
|
946
|
-
* provider through `useSyncExternalStore` (the React hooks do) compares this
|
|
947
|
-
* value across renders, so it also sees a change that happened before its
|
|
948
|
-
* listener existed: a notification fired from a child's or an earlier
|
|
949
|
-
* sibling's layout effect, or while React kept the tree hidden with its
|
|
950
|
-
* effects unmounted. Providers written before this method existed keep the
|
|
951
|
-
* listener-only behaviour; consumers must fall back to counting
|
|
952
|
-
* notifications.
|
|
953
|
-
*
|
|
954
|
-
* Reads must be side-effect free, and the value must never decrease.
|
|
955
|
-
*
|
|
956
|
-
* @returns The provider's current revision.
|
|
957
|
-
*/
|
|
958
|
-
getRevision?(): number
|
|
959
|
-
|
|
960
|
-
/**
|
|
961
|
-
* Gets the text direction for the current locale.
|
|
962
|
-
*
|
|
963
|
-
* @returns `'ltr'` or `'rtl'`.
|
|
964
|
-
*/
|
|
965
|
-
getDirection(): 'ltr' | 'rtl'
|
|
966
|
-
|
|
967
|
-
/**
|
|
968
|
-
* Checks if a translation key exists (alias for exists).
|
|
969
|
-
*/
|
|
970
|
-
hasKey?(key: string): boolean
|
|
971
|
-
|
|
972
|
-
/**
|
|
973
|
-
* Checks if the provider is ready.
|
|
974
|
-
*/
|
|
975
|
-
isReady?(): boolean
|
|
976
|
-
|
|
977
|
-
/**
|
|
978
|
-
* Registers a callback for when the provider is ready.
|
|
979
|
-
*/
|
|
980
|
-
onReady?(callback: () => void): () => void
|
|
981
|
-
|
|
982
|
-
/**
|
|
983
|
-
* Registers a lazily-loaded content module for automatic reload on locale changes.
|
|
984
|
-
* All registered content is reloaded during `setLocale()` before listeners fire,
|
|
985
|
-
* ensuring content is available on the first re-render with no flash.
|
|
986
|
-
*
|
|
987
|
-
* Idempotent: registering the same module name twice is a no-op.
|
|
988
|
-
*/
|
|
989
|
-
registerContent?(module: string, loader: (locale: string) => Promise<void>): void
|
|
990
|
-
}
|
|
991
|
-
```
|
|
992
|
-
|
|
993
826
|
#### `Logger`
|
|
994
827
|
|
|
995
828
|
Logger instance with leveled logging methods, child logger creation,
|
|
@@ -1054,57 +887,6 @@ interface Logger {
|
|
|
1054
887
|
}
|
|
1055
888
|
```
|
|
1056
889
|
|
|
1057
|
-
#### `LoggerProvider`
|
|
1058
|
-
|
|
1059
|
-
Logger provider interface that all logger bond packages must implement.
|
|
1060
|
-
Creates and manages logger instances and global log configuration.
|
|
1061
|
-
|
|
1062
|
-
```typescript
|
|
1063
|
-
interface LoggerProvider {
|
|
1064
|
-
/**
|
|
1065
|
-
* Gets a logger by name, or the root logger if no name given.
|
|
1066
|
-
*/
|
|
1067
|
-
getLogger(name?: string): Logger
|
|
1068
|
-
|
|
1069
|
-
/**
|
|
1070
|
-
* Creates a named logger.
|
|
1071
|
-
*/
|
|
1072
|
-
createLogger(nameOrConfig: string | LoggerConfig, config?: LoggerConfig): Logger
|
|
1073
|
-
|
|
1074
|
-
/**
|
|
1075
|
-
* Sets the global log level.
|
|
1076
|
-
*/
|
|
1077
|
-
setLevel(level: LogLevel): void
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* Gets the global log level.
|
|
1081
|
-
*/
|
|
1082
|
-
getLevel(): LogLevel
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* Adds a global transport.
|
|
1086
|
-
*/
|
|
1087
|
-
addTransport(transport: LogTransport): () => void
|
|
1088
|
-
|
|
1089
|
-
/**
|
|
1090
|
-
* Enables logging.
|
|
1091
|
-
*/
|
|
1092
|
-
enable(): void
|
|
1093
|
-
|
|
1094
|
-
/**
|
|
1095
|
-
* Disables logging.
|
|
1096
|
-
*/
|
|
1097
|
-
disable(): void
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* Checks if logging is enabled.
|
|
1101
|
-
*
|
|
1102
|
-
* @returns `true` if logging is currently enabled.
|
|
1103
|
-
*/
|
|
1104
|
-
isEnabled(): boolean
|
|
1105
|
-
}
|
|
1106
|
-
```
|
|
1107
|
-
|
|
1108
890
|
#### `RouteLocation`
|
|
1109
891
|
|
|
1110
892
|
Current URL decomposed into pathname, search string, hash, navigation state, and unique key.
|
|
@@ -1273,6 +1055,31 @@ interface Router {
|
|
|
1273
1055
|
}
|
|
1274
1056
|
```
|
|
1275
1057
|
|
|
1058
|
+
#### `RouterConfig` _(deprecated)_
|
|
1059
|
+
|
|
1060
|
+
> **Deprecated:** Use `BrowserRouterConfig` (`createBrowserRouter`) or `MemoryRouterConfig` (`createMemoryRouter`): each takes only the options it acts on.
|
|
1061
|
+
|
|
1062
|
+
Configuration options for creating a router instance.
|
|
1063
|
+
|
|
1064
|
+
```typescript
|
|
1065
|
+
interface RouterConfig {
|
|
1066
|
+
/**
|
|
1067
|
+
* Router mode.
|
|
1068
|
+
*/
|
|
1069
|
+
mode?: 'history' | 'hash' | 'memory'
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Base path.
|
|
1073
|
+
*/
|
|
1074
|
+
basePath?: string
|
|
1075
|
+
|
|
1076
|
+
/**
|
|
1077
|
+
* Initial routes.
|
|
1078
|
+
*/
|
|
1079
|
+
routes?: RouteDefinition[]
|
|
1080
|
+
}
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1276
1083
|
#### `StoreConfig`
|
|
1277
1084
|
|
|
1278
1085
|
Configuration for creating a store (initial state, optional name, and middleware chain).
|
|
@@ -1327,145 +1134,34 @@ interface Store<T> {
|
|
|
1327
1134
|
}
|
|
1328
1135
|
```
|
|
1329
1136
|
|
|
1330
|
-
#### `
|
|
1331
|
-
|
|
1332
|
-
State provider interface that all state management bond packages
|
|
1333
|
-
must implement. Provides the store creation factory.
|
|
1334
|
-
|
|
1335
|
-
```typescript
|
|
1336
|
-
interface StateProvider {
|
|
1337
|
-
/**
|
|
1338
|
-
* Creates a new store.
|
|
1339
|
-
*/
|
|
1340
|
-
createStore<T>(config: StoreConfig<T>): Store<T>
|
|
1341
|
-
}
|
|
1342
|
-
```
|
|
1343
|
-
|
|
1344
|
-
#### `StorageProvider`
|
|
1345
|
-
|
|
1346
|
-
Storage provider interface.
|
|
1137
|
+
#### `Store`
|
|
1347
1138
|
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
```typescript
|
|
1351
|
-
interface StorageProvider {
|
|
1352
|
-
/**
|
|
1353
|
-
* Gets a value from storage.
|
|
1354
|
-
*/
|
|
1355
|
-
get<T = unknown>(key: string): Promise<T | null>
|
|
1356
|
-
|
|
1357
|
-
/**
|
|
1358
|
-
* Sets a value in storage.
|
|
1359
|
-
*/
|
|
1360
|
-
set<T = unknown>(key: string, value: T): Promise<void>
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* Removes a value from storage.
|
|
1364
|
-
*/
|
|
1365
|
-
remove(key: string): Promise<void>
|
|
1366
|
-
|
|
1367
|
-
/**
|
|
1368
|
-
* Clears all values from storage.
|
|
1369
|
-
*/
|
|
1370
|
-
clear(): Promise<void>
|
|
1371
|
-
|
|
1372
|
-
/**
|
|
1373
|
-
* Gets all keys in storage.
|
|
1374
|
-
*/
|
|
1375
|
-
keys(): Promise<string[]>
|
|
1376
|
-
|
|
1377
|
-
/**
|
|
1378
|
-
* Gets multiple values from storage.
|
|
1379
|
-
*/
|
|
1380
|
-
getMany?<T = unknown>(keys: string[]): Promise<Map<string, T | null>>
|
|
1381
|
-
|
|
1382
|
-
/**
|
|
1383
|
-
* Sets multiple values in storage.
|
|
1384
|
-
*/
|
|
1385
|
-
setMany?<T = unknown>(entries: Array<[string, T]>): Promise<void>
|
|
1386
|
-
|
|
1387
|
-
/**
|
|
1388
|
-
* Removes multiple values from storage.
|
|
1389
|
-
*/
|
|
1390
|
-
removeMany?(keys: string[]): Promise<void>
|
|
1391
|
-
|
|
1392
|
-
/**
|
|
1393
|
-
* Reads a value synchronously.
|
|
1394
|
-
*
|
|
1395
|
-
* Optional: only a provider backed by a SYNCHRONOUS store (browser
|
|
1396
|
-
* `localStorage`, an in-memory map) can answer without I/O. A render-time
|
|
1397
|
-
* caller reads through `getPreferenceStore()`, which uses this method to see
|
|
1398
|
-
* the persisted value on the first paint; a provider without it is read
|
|
1399
|
-
* through {@link StorageProvider.get} and subscribers update when the value
|
|
1400
|
-
* lands.
|
|
1401
|
-
* @param key - The storage key.
|
|
1402
|
-
* @returns The stored value, or `null` when it is absent, unreadable or corrupt.
|
|
1403
|
-
*/
|
|
1404
|
-
getSync?<T = unknown>(key: string): T | null
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* Subscribes to changes made to a key OUTSIDE this provider instance — for
|
|
1408
|
-
* example another browser tab's `localStorage` write.
|
|
1409
|
-
*
|
|
1410
|
-
* Writes made through the same provider instance do not re-emit here; a
|
|
1411
|
-
* synchronous caller observes them through `getPreferenceStore()`'s own
|
|
1412
|
-
* subscribers.
|
|
1413
|
-
* @param key - The storage key.
|
|
1414
|
-
* @param listener - Called with the new value, or `null` when it was removed.
|
|
1415
|
-
* @returns A function that stops the subscription.
|
|
1416
|
-
*/
|
|
1417
|
-
subscribe?(key: string, listener: (value: unknown) => void): () => void
|
|
1418
|
-
}
|
|
1419
|
-
```
|
|
1420
|
-
|
|
1421
|
-
#### `ThemeProvider`
|
|
1139
|
+
Reactive state container with getState, setState, subscribe, and destroy.
|
|
1422
1140
|
|
|
1423
|
-
|
|
1424
|
-
and change subscriptions.
|
|
1141
|
+
All state management providers must implement this interface.
|
|
1425
1142
|
|
|
1426
1143
|
```typescript
|
|
1427
|
-
interface
|
|
1428
|
-
/**
|
|
1429
|
-
* Returns the currently active theme.
|
|
1430
|
-
*/
|
|
1431
|
-
getTheme(): Theme
|
|
1432
|
-
|
|
1433
|
-
/**
|
|
1434
|
-
* Sets the active theme by reference or by name.
|
|
1435
|
-
*
|
|
1436
|
-
* @param theme - A `Theme` object or a theme name string to activate.
|
|
1437
|
-
*/
|
|
1438
|
-
setTheme(theme: Theme | string): void
|
|
1439
|
-
|
|
1144
|
+
interface Store<T> {
|
|
1440
1145
|
/**
|
|
1441
|
-
*
|
|
1146
|
+
* Gets the current state.
|
|
1442
1147
|
*/
|
|
1443
|
-
|
|
1148
|
+
getState(): T
|
|
1444
1149
|
|
|
1445
1150
|
/**
|
|
1446
|
-
*
|
|
1447
|
-
* `setTheme()` or `toggleMode()` is called.
|
|
1448
|
-
*
|
|
1449
|
-
* @param callback - Invoked with the new theme after each change.
|
|
1450
|
-
* @returns An unsubscribe function.
|
|
1151
|
+
* Sets the state (partial or via updater function).
|
|
1451
1152
|
*/
|
|
1452
|
-
|
|
1153
|
+
setState(partial: Partial<T> | ((state: T) => Partial<T>)): void
|
|
1453
1154
|
|
|
1454
1155
|
/**
|
|
1455
|
-
*
|
|
1456
|
-
*
|
|
1156
|
+
* Subscribes to state changes.
|
|
1157
|
+
* Returns an unsubscribe function.
|
|
1457
1158
|
*/
|
|
1458
|
-
|
|
1159
|
+
subscribe(listener: StateListener<T>): () => void
|
|
1459
1160
|
|
|
1460
1161
|
/**
|
|
1461
|
-
*
|
|
1462
|
-
* build-time render, which has no storage and no `prefers-color-scheme`
|
|
1463
|
-
* to read. A hydrating client renders this theme first, so its markup
|
|
1464
|
-
* matches what the server sent, and switches to `getTheme()` right
|
|
1465
|
-
* after. Optional — a provider whose theme cannot differ between the two
|
|
1466
|
-
* need not implement it.
|
|
1162
|
+
* Destroys the store and cleans up subscriptions.
|
|
1467
1163
|
*/
|
|
1468
|
-
|
|
1164
|
+
destroy(): void
|
|
1469
1165
|
}
|
|
1470
1166
|
```
|
|
1471
1167
|
|
|
@@ -1571,12 +1267,12 @@ interface UseAuthResult<
|
|
|
1571
1267
|
}
|
|
1572
1268
|
```
|
|
1573
1269
|
|
|
1574
|
-
#### `
|
|
1270
|
+
#### `UseChangePasswordReturn`
|
|
1575
1271
|
|
|
1576
1272
|
What {@link useChangePassword} returns.
|
|
1577
1273
|
|
|
1578
1274
|
```typescript
|
|
1579
|
-
interface
|
|
1275
|
+
interface UseChangePasswordReturn {
|
|
1580
1276
|
/** The latest call's status. */
|
|
1581
1277
|
status: Readable<UsePromiseState<void>['status']>
|
|
1582
1278
|
/** The latest call's rejection. */
|
|
@@ -1799,12 +1495,12 @@ interface UseHttpOptions<T> extends RequestConfig {
|
|
|
1799
1495
|
}
|
|
1800
1496
|
```
|
|
1801
1497
|
|
|
1802
|
-
#### `
|
|
1498
|
+
#### `UseLoginReturn`
|
|
1803
1499
|
|
|
1804
1500
|
What {@link useLogin} returns: the promise state's value fields as stores plus the action.
|
|
1805
1501
|
|
|
1806
1502
|
```typescript
|
|
1807
|
-
interface
|
|
1503
|
+
interface UseLoginReturn<T = unknown> {
|
|
1808
1504
|
/** The latest call's status. */
|
|
1809
1505
|
status: Readable<UsePromiseState<AuthResult<T>>['status']>
|
|
1810
1506
|
/** The latest call's resolved value. */
|
|
@@ -1927,12 +1623,12 @@ interface UseOptimisticValueResult<T> {
|
|
|
1927
1623
|
}
|
|
1928
1624
|
```
|
|
1929
1625
|
|
|
1930
|
-
#### `
|
|
1626
|
+
#### `UsePasswordResetReturn`
|
|
1931
1627
|
|
|
1932
1628
|
What {@link usePasswordReset} returns: two independent trackers plus a combined reset.
|
|
1933
1629
|
|
|
1934
1630
|
```typescript
|
|
1935
|
-
interface
|
|
1631
|
+
interface UsePasswordResetReturn {
|
|
1936
1632
|
/** The request step's status. */
|
|
1937
1633
|
requestStatus: Readable<UsePromiseState<void>['status']>
|
|
1938
1634
|
/** The request step's rejection. */
|
|
@@ -2201,12 +1897,12 @@ interface UseListRouteResult<Filter extends string = string, Selection extends s
|
|
|
2201
1897
|
}
|
|
2202
1898
|
```
|
|
2203
1899
|
|
|
2204
|
-
#### `
|
|
1900
|
+
#### `UseSignupReturn`
|
|
2205
1901
|
|
|
2206
1902
|
What {@link useSignup} returns.
|
|
2207
1903
|
|
|
2208
1904
|
```typescript
|
|
2209
|
-
interface
|
|
1905
|
+
interface UseSignupReturn<
|
|
2210
1906
|
T = unknown,
|
|
2211
1907
|
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
2212
1908
|
> {
|
|
@@ -2642,6 +2338,181 @@ interface SessionReadyProps {
|
|
|
2642
2338
|
}
|
|
2643
2339
|
```
|
|
2644
2340
|
|
|
2341
|
+
#### `ProviderProps`
|
|
2342
|
+
|
|
2343
|
+
What every provider component takes besides its service: the tree that reads it, as
|
|
2344
|
+
React's `children` (a snippet here).
|
|
2345
|
+
|
|
2346
|
+
```typescript
|
|
2347
|
+
interface ProviderProps {
|
|
2348
|
+
/** The tree that reads the provided service. */
|
|
2349
|
+
children?: Snippet
|
|
2350
|
+
}
|
|
2351
|
+
```
|
|
2352
|
+
|
|
2353
|
+
#### `StateProviderProps`
|
|
2354
|
+
|
|
2355
|
+
Props for the `StateProvider` component.
|
|
2356
|
+
|
|
2357
|
+
```typescript
|
|
2358
|
+
interface StateProviderProps extends ProviderProps {
|
|
2359
|
+
provider: StateProvider
|
|
2360
|
+
}
|
|
2361
|
+
```
|
|
2362
|
+
|
|
2363
|
+
#### `AuthProviderProps`
|
|
2364
|
+
|
|
2365
|
+
Props for the `AuthProvider` component.
|
|
2366
|
+
|
|
2367
|
+
```typescript
|
|
2368
|
+
interface AuthProviderProps<T = unknown> extends ProviderProps {
|
|
2369
|
+
client: AuthClient<T>
|
|
2370
|
+
/** Wait for initial session restoration by default. Set false for a deliberately ungated shell or synchronous SSR. */
|
|
2371
|
+
awaitSession?: boolean
|
|
2372
|
+
/** Content shown while the initial session status is loading; default nothing. */
|
|
2373
|
+
sessionFallback?: Snippet
|
|
2374
|
+
}
|
|
2375
|
+
```
|
|
2376
|
+
|
|
2377
|
+
#### `ThemeProviderProps`
|
|
2378
|
+
|
|
2379
|
+
Props for the `ThemeProvider` component.
|
|
2380
|
+
|
|
2381
|
+
```typescript
|
|
2382
|
+
interface ThemeProviderProps extends ProviderProps {
|
|
2383
|
+
provider: ThemeProvider
|
|
2384
|
+
/**
|
|
2385
|
+
* Not read: the theme a page starts on comes from the theme provider itself (`defaultTheme` and the
|
|
2386
|
+
* saved choice in `@molecule/app-theme-css-variables`), and setting one here would overwrite a
|
|
2387
|
+
* visitor's saved theme on every load.
|
|
2388
|
+
*
|
|
2389
|
+
* @deprecated Ignored. Pass `defaultTheme` to the theme provider (`createCSSVariablesThemeProvider({ defaultTheme })`) instead.
|
|
2390
|
+
*/
|
|
2391
|
+
initialTheme?: string
|
|
2392
|
+
}
|
|
2393
|
+
```
|
|
2394
|
+
|
|
2395
|
+
#### `RouterProviderProps`
|
|
2396
|
+
|
|
2397
|
+
Props for the `RouterProvider` component.
|
|
2398
|
+
|
|
2399
|
+
```typescript
|
|
2400
|
+
interface RouterProviderProps extends ProviderProps {
|
|
2401
|
+
router: Router
|
|
2402
|
+
/**
|
|
2403
|
+
* The component that renders the matched child route where a layout or guard puts it, so
|
|
2404
|
+
* `<RoutedView />` works under any routing bond. A routing bond passes it; leave it out when
|
|
2405
|
+
* the bond has none (SvelteKit gives a layout its page as `children`), and `<RoutedView />`
|
|
2406
|
+
* then throws an error saying so.
|
|
2407
|
+
*/
|
|
2408
|
+
routedView?: Component
|
|
2409
|
+
}
|
|
2410
|
+
```
|
|
2411
|
+
|
|
2412
|
+
#### `I18nProviderProps`
|
|
2413
|
+
|
|
2414
|
+
Props for the `I18nProvider` component.
|
|
2415
|
+
|
|
2416
|
+
```typescript
|
|
2417
|
+
interface I18nProviderProps extends ProviderProps {
|
|
2418
|
+
provider: I18nProvider
|
|
2419
|
+
}
|
|
2420
|
+
```
|
|
2421
|
+
|
|
2422
|
+
#### `HttpProviderProps`
|
|
2423
|
+
|
|
2424
|
+
Props for the `HttpProvider` component.
|
|
2425
|
+
|
|
2426
|
+
```typescript
|
|
2427
|
+
interface HttpProviderProps extends ProviderProps {
|
|
2428
|
+
client: HttpClient
|
|
2429
|
+
}
|
|
2430
|
+
```
|
|
2431
|
+
|
|
2432
|
+
#### `StorageProviderProps`
|
|
2433
|
+
|
|
2434
|
+
Props for the `StorageProvider` component.
|
|
2435
|
+
|
|
2436
|
+
```typescript
|
|
2437
|
+
interface StorageProviderProps extends ProviderProps {
|
|
2438
|
+
provider: StorageProvider
|
|
2439
|
+
}
|
|
2440
|
+
```
|
|
2441
|
+
|
|
2442
|
+
#### `LoggerProviderProps`
|
|
2443
|
+
|
|
2444
|
+
Props for the `LoggerProvider` component.
|
|
2445
|
+
|
|
2446
|
+
```typescript
|
|
2447
|
+
interface LoggerProviderProps extends ProviderProps {
|
|
2448
|
+
provider: LoggerProvider
|
|
2449
|
+
}
|
|
2450
|
+
```
|
|
2451
|
+
|
|
2452
|
+
#### `ChatProviderProps`
|
|
2453
|
+
|
|
2454
|
+
Props for the `ChatProvider` component.
|
|
2455
|
+
|
|
2456
|
+
```typescript
|
|
2457
|
+
interface ChatProviderProps extends ProviderProps {
|
|
2458
|
+
provider: ChatProvider
|
|
2459
|
+
}
|
|
2460
|
+
```
|
|
2461
|
+
|
|
2462
|
+
#### `WorkspaceProviderProps`
|
|
2463
|
+
|
|
2464
|
+
Props for the `WorkspaceProvider` component.
|
|
2465
|
+
|
|
2466
|
+
```typescript
|
|
2467
|
+
interface WorkspaceProviderProps extends ProviderProps {
|
|
2468
|
+
provider: WorkspaceProvider
|
|
2469
|
+
}
|
|
2470
|
+
```
|
|
2471
|
+
|
|
2472
|
+
#### `EditorProviderProps`
|
|
2473
|
+
|
|
2474
|
+
Props for the `EditorProvider` component.
|
|
2475
|
+
|
|
2476
|
+
```typescript
|
|
2477
|
+
interface EditorProviderProps extends ProviderProps {
|
|
2478
|
+
provider: EditorProvider
|
|
2479
|
+
}
|
|
2480
|
+
```
|
|
2481
|
+
|
|
2482
|
+
#### `PreviewProviderProps`
|
|
2483
|
+
|
|
2484
|
+
Props for the `PreviewProvider` component.
|
|
2485
|
+
|
|
2486
|
+
```typescript
|
|
2487
|
+
interface PreviewProviderProps extends ProviderProps {
|
|
2488
|
+
provider: PreviewProvider
|
|
2489
|
+
}
|
|
2490
|
+
```
|
|
2491
|
+
|
|
2492
|
+
#### `MoleculeProviderProps`
|
|
2493
|
+
|
|
2494
|
+
Props for the `MoleculeProvider` component: each service is optional, and only the
|
|
2495
|
+
services passed are provided (`state` falls back to the bonded state provider).
|
|
2496
|
+
|
|
2497
|
+
```typescript
|
|
2498
|
+
interface MoleculeProviderProps extends ProviderProps, MoleculeConfig {
|
|
2499
|
+
/**
|
|
2500
|
+
* Render the app only once `auth` leaves its initial loading status ({@link SessionReadyProps}). Defaults to true.
|
|
2501
|
+
* With the bundled JWT client, a stored token AND cached user restore synchronously.
|
|
2502
|
+
* Token-only and cookie-only sessions need an asynchronous current-user request;
|
|
2503
|
+
* until it answers `useAuth().user` is `null` — a public page's signed-in action
|
|
2504
|
+
* (`if (!$user) return`, a redirect to `/login`) then treats a signed-in visitor as signed out.
|
|
2505
|
+
* When restoration succeeds, every page's first render reads the restored user. An
|
|
2506
|
+
* `'unavailable'` session also renders, but remains unconfirmed and may have a null user.
|
|
2507
|
+
* A visitor with no session candidate settles synchronously without a request.
|
|
2508
|
+
* Ignored without `auth`.
|
|
2509
|
+
*/
|
|
2510
|
+
awaitSession?: boolean
|
|
2511
|
+
/** Rendered instead of the app while {@link MoleculeProviderProps.awaitSession} waits; default nothing. */
|
|
2512
|
+
sessionFallback?: Snippet
|
|
2513
|
+
}
|
|
2514
|
+
```
|
|
2515
|
+
|
|
2645
2516
|
#### `HttpState`
|
|
2646
2517
|
|
|
2647
2518
|
State for async HTTP operations.
|
|
@@ -2758,6 +2629,36 @@ type UseCapacitorAppResult = {
|
|
|
2758
2629
|
}
|
|
2759
2630
|
```
|
|
2760
2631
|
|
|
2632
|
+
#### `UseChangePasswordResult` _(deprecated)_
|
|
2633
|
+
|
|
2634
|
+
> **Deprecated:** Renamed to {@link UseChangePasswordReturn}, `@molecule/app-react`'s name for it.
|
|
2635
|
+
|
|
2636
|
+
The former name of {@link UseChangePasswordReturn}.
|
|
2637
|
+
|
|
2638
|
+
```typescript
|
|
2639
|
+
type UseChangePasswordResult = UseChangePasswordReturn
|
|
2640
|
+
```
|
|
2641
|
+
|
|
2642
|
+
#### `UseLoginResult` _(deprecated)_
|
|
2643
|
+
|
|
2644
|
+
> **Deprecated:** Renamed to {@link UseLoginReturn}, `@molecule/app-react`'s name for it.
|
|
2645
|
+
|
|
2646
|
+
The former name of {@link UseLoginReturn}.
|
|
2647
|
+
|
|
2648
|
+
```typescript
|
|
2649
|
+
type UseLoginResult<T = unknown> = UseLoginReturn<T>
|
|
2650
|
+
```
|
|
2651
|
+
|
|
2652
|
+
#### `UsePasswordResetResult` _(deprecated)_
|
|
2653
|
+
|
|
2654
|
+
> **Deprecated:** Renamed to {@link UsePasswordResetReturn}, `@molecule/app-react`'s name for it.
|
|
2655
|
+
|
|
2656
|
+
The former name of {@link UsePasswordResetReturn}.
|
|
2657
|
+
|
|
2658
|
+
```typescript
|
|
2659
|
+
type UsePasswordResetResult = UsePasswordResetReturn
|
|
2660
|
+
```
|
|
2661
|
+
|
|
2761
2662
|
#### `UsePromiseStore`
|
|
2762
2663
|
|
|
2763
2664
|
The store {@link usePromise} returns: the current `[state, call]` tuple.
|
|
@@ -2776,6 +2677,19 @@ The store {@link useConsumedSearchParam} returns: the current `[value, set]` tup
|
|
|
2776
2677
|
type UseConsumedSearchParamStore = Readable<readonly [string, (value: string) => void]>
|
|
2777
2678
|
```
|
|
2778
2679
|
|
|
2680
|
+
#### `UseSignupResult` _(deprecated)_
|
|
2681
|
+
|
|
2682
|
+
> **Deprecated:** Renamed to {@link UseSignupReturn}, `@molecule/app-react`'s name for it.
|
|
2683
|
+
|
|
2684
|
+
The former name of {@link UseSignupReturn}.
|
|
2685
|
+
|
|
2686
|
+
```typescript
|
|
2687
|
+
type UseSignupResult<
|
|
2688
|
+
T = unknown,
|
|
2689
|
+
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
2690
|
+
> = UseSignupReturn<T, TRegister>
|
|
2691
|
+
```
|
|
2692
|
+
|
|
2779
2693
|
#### `UseTShorthandOptions`
|
|
2780
2694
|
|
|
2781
2695
|
Options for the shorthand form of {@link UseTFunction}: the fallback text
|
|
@@ -2876,7 +2790,11 @@ type SignupStore<T = unknown> = PromiseStore<AuthResult<T>, [RegisterData]>
|
|
|
2876
2790
|
|
|
2877
2791
|
Set all molecule providers in Svelte context.
|
|
2878
2792
|
|
|
2879
|
-
Call this in your root layout/component.
|
|
2793
|
+
Call this in your root layout/component. Only the services passed are set, except `state`,
|
|
2794
|
+
which falls back to the state provider bonded under `@molecule/app-state` (as
|
|
2795
|
+
`MoleculeProvider` does), so `useStore()` works without a `state` option. To hold the app
|
|
2796
|
+
until the session is decided, render `MoleculeProvider` (its `awaitSession`) or
|
|
2797
|
+
`SessionReady` instead.
|
|
2880
2798
|
|
|
2881
2799
|
```typescript
|
|
2882
2800
|
function setMoleculeContext(config: MoleculeConfig): void
|
|
@@ -2914,15 +2832,17 @@ function setThemeContext(provider: ThemeProvider): void
|
|
|
2914
2832
|
|
|
2915
2833
|
- `provider` — The theme provider to store in Svelte context.
|
|
2916
2834
|
|
|
2917
|
-
#### `setRouterContext(router)`
|
|
2835
|
+
#### `setRouterContext(router, options)`
|
|
2918
2836
|
|
|
2919
2837
|
Sets the router context.
|
|
2920
2838
|
|
|
2921
2839
|
```typescript
|
|
2922
|
-
function setRouterContext(router: Router): void
|
|
2840
|
+
function setRouterContext(router: Router, options?: { routedView?: Component }): void
|
|
2923
2841
|
```
|
|
2924
2842
|
|
|
2925
2843
|
- `router` — The router instance to store in Svelte context.
|
|
2844
|
+
- `options` — From a routing bond: its routed view (see `RoutedView`). Given, it is set too (`null` without `routedView`).
|
|
2845
|
+
- `options.routedView` — The component that renders the matched child route.
|
|
2926
2846
|
|
|
2927
2847
|
#### `setI18nContext(provider)`
|
|
2928
2848
|
|
|
@@ -3376,7 +3296,7 @@ Svelte's idiom: call it during component init under
|
|
|
3376
3296
|
resolves `void`.
|
|
3377
3297
|
|
|
3378
3298
|
```typescript
|
|
3379
|
-
function useChangePassword():
|
|
3299
|
+
function useChangePassword(): UseChangePasswordReturn
|
|
3380
3300
|
```
|
|
3381
3301
|
|
|
3382
3302
|
**Returns:** Change-password state as stores and the action.
|
|
@@ -3642,7 +3562,7 @@ no separate `useRegister` hook; use `usePromise(register)` when a form
|
|
|
3642
3562
|
needs the same pending/error tracking as this login hook.
|
|
3643
3563
|
|
|
3644
3564
|
```typescript
|
|
3645
|
-
function useLogin<T = unknown>():
|
|
3565
|
+
function useLogin<T = unknown>(): UseLoginReturn<T>
|
|
3646
3566
|
```
|
|
3647
3567
|
|
|
3648
3568
|
- `T` — The user profile the API returns.
|
|
@@ -3736,7 +3656,7 @@ steps, React's `usePasswordReset` in Svelte's idiom: call it during
|
|
|
3736
3656
|
component init under `setMoleculeContext({ auth })`.
|
|
3737
3657
|
|
|
3738
3658
|
```typescript
|
|
3739
|
-
function usePasswordReset():
|
|
3659
|
+
function usePasswordReset(): UsePasswordResetReturn
|
|
3740
3660
|
```
|
|
3741
3661
|
|
|
3742
3662
|
**Returns:** Both steps' state as stores and their actions.
|
|
@@ -3978,7 +3898,7 @@ Svelte's idiom: call it during component init under
|
|
|
3978
3898
|
function useSignup<
|
|
3979
3899
|
T = unknown,
|
|
3980
3900
|
TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
|
|
3981
|
-
>():
|
|
3901
|
+
>(): UseSignupReturn<T, TRegister>
|
|
3982
3902
|
```
|
|
3983
3903
|
|
|
3984
3904
|
- `T` — The user profile the API returns.
|
|
@@ -4962,6 +4882,12 @@ function createVersionStores(): {
|
|
|
4962
4882
|
const Link: LegacyComponentType
|
|
4963
4883
|
```
|
|
4964
4884
|
|
|
4885
|
+
#### `RoutedView`
|
|
4886
|
+
|
|
4887
|
+
```typescript
|
|
4888
|
+
const RoutedView: LegacyComponentType
|
|
4889
|
+
```
|
|
4890
|
+
|
|
4965
4891
|
#### `SessionReady`
|
|
4966
4892
|
|
|
4967
4893
|
```typescript
|
|
@@ -4994,6 +4920,118 @@ passes its own.
|
|
|
4994
4920
|
const DEFAULT_AGENT_IDENTITY: AgentIdentity
|
|
4995
4921
|
```
|
|
4996
4922
|
|
|
4923
|
+
#### `MoleculeProvider`
|
|
4924
|
+
|
|
4925
|
+
Combined provider for every molecule service, as `@molecule/app-react`'s `MoleculeProvider`.
|
|
4926
|
+
|
|
4927
|
+
Only the services passed are provided, except `state`, which falls back to the state provider
|
|
4928
|
+
bonded under `@molecule/app-state` (set by `setupAllDefaultBonds()` or a state bond) so
|
|
4929
|
+
`useStore()` works without a `state` prop. Given `auth`, it renders its children only once
|
|
4930
|
+
the session is decided (`awaitSession`, default true), with the `sessionFallback` snippet
|
|
4931
|
+
meanwhile.
|
|
4932
|
+
|
|
4933
|
+
```typescript
|
|
4934
|
+
const MoleculeProvider: LegacyComponentType
|
|
4935
|
+
```
|
|
4936
|
+
|
|
4937
|
+
#### `AuthProvider`
|
|
4938
|
+
|
|
4939
|
+
Provider for authentication, as `@molecule/app-react`'s `AuthProvider`: it provides the
|
|
4940
|
+
client and, unless `awaitSession` is `false`, renders its children only once the session is
|
|
4941
|
+
decided (`SessionReady`), with the `sessionFallback` snippet meanwhile.
|
|
4942
|
+
|
|
4943
|
+
```typescript
|
|
4944
|
+
const AuthProvider: LegacyComponentType
|
|
4945
|
+
```
|
|
4946
|
+
|
|
4947
|
+
#### `StateProvider`
|
|
4948
|
+
|
|
4949
|
+
Provider for state management, as `@molecule/app-react`'s `StateProvider`.
|
|
4950
|
+
|
|
4951
|
+
```typescript
|
|
4952
|
+
const StateProvider: LegacyComponentType
|
|
4953
|
+
```
|
|
4954
|
+
|
|
4955
|
+
#### `ThemeProvider`
|
|
4956
|
+
|
|
4957
|
+
Provider for theming, as `@molecule/app-react`'s `ThemeProvider`.
|
|
4958
|
+
|
|
4959
|
+
```typescript
|
|
4960
|
+
const ThemeProvider: LegacyComponentType
|
|
4961
|
+
```
|
|
4962
|
+
|
|
4963
|
+
#### `RouterProvider`
|
|
4964
|
+
|
|
4965
|
+
Provider for routing, as `@molecule/app-react`'s `RouterProvider`.
|
|
4966
|
+
|
|
4967
|
+
```typescript
|
|
4968
|
+
const RouterProvider: LegacyComponentType
|
|
4969
|
+
```
|
|
4970
|
+
|
|
4971
|
+
#### `I18nProvider`
|
|
4972
|
+
|
|
4973
|
+
Provider for internationalization, as `@molecule/app-react`'s `I18nProvider`.
|
|
4974
|
+
|
|
4975
|
+
```typescript
|
|
4976
|
+
const I18nProvider: LegacyComponentType
|
|
4977
|
+
```
|
|
4978
|
+
|
|
4979
|
+
#### `HttpProvider`
|
|
4980
|
+
|
|
4981
|
+
Provider for the HTTP client, as `@molecule/app-react`'s `HttpProvider`.
|
|
4982
|
+
|
|
4983
|
+
```typescript
|
|
4984
|
+
const HttpProvider: LegacyComponentType
|
|
4985
|
+
```
|
|
4986
|
+
|
|
4987
|
+
#### `StorageProvider`
|
|
4988
|
+
|
|
4989
|
+
Provider for storage, as `@molecule/app-react`'s `StorageProvider`.
|
|
4990
|
+
|
|
4991
|
+
```typescript
|
|
4992
|
+
const StorageProvider: LegacyComponentType
|
|
4993
|
+
```
|
|
4994
|
+
|
|
4995
|
+
#### `LoggerProvider`
|
|
4996
|
+
|
|
4997
|
+
Provider for logging, as `@molecule/app-react`'s `LoggerProvider`.
|
|
4998
|
+
|
|
4999
|
+
```typescript
|
|
5000
|
+
const LoggerProvider: LegacyComponentType
|
|
5001
|
+
```
|
|
5002
|
+
|
|
5003
|
+
#### `ChatProvider`
|
|
5004
|
+
|
|
5005
|
+
Provider for AI chat, as `@molecule/app-react`'s `ChatProvider`.
|
|
5006
|
+
|
|
5007
|
+
```typescript
|
|
5008
|
+
const ChatProvider: LegacyComponentType
|
|
5009
|
+
```
|
|
5010
|
+
|
|
5011
|
+
#### `WorkspaceProvider`
|
|
5012
|
+
|
|
5013
|
+
Provider for the IDE workspace, as `@molecule/app-react`'s `WorkspaceProvider`.
|
|
5014
|
+
|
|
5015
|
+
```typescript
|
|
5016
|
+
const WorkspaceProvider: LegacyComponentType
|
|
5017
|
+
```
|
|
5018
|
+
|
|
5019
|
+
#### `EditorProvider`
|
|
5020
|
+
|
|
5021
|
+
Provider for the code editor, as `@molecule/app-react`'s `EditorProvider`.
|
|
5022
|
+
|
|
5023
|
+
```typescript
|
|
5024
|
+
const EditorProvider: LegacyComponentType
|
|
5025
|
+
```
|
|
5026
|
+
|
|
5027
|
+
#### `PreviewProvider`
|
|
5028
|
+
|
|
5029
|
+
Provider for the live preview, as `@molecule/app-react`'s `PreviewProvider`.
|
|
5030
|
+
|
|
5031
|
+
```typescript
|
|
5032
|
+
const PreviewProvider: LegacyComponentType
|
|
5033
|
+
```
|
|
5034
|
+
|
|
4997
5035
|
#### `convergeHistory`
|
|
4998
5036
|
|
|
4999
5037
|
Converges the local transcript with authoritative server history. See
|