@molecule/app-svelte 1.0.3 → 1.0.5

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.
Files changed (2) hide show
  1. package/README.md +23 -14
  2. package/package.json +6 -6
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-21T17:02:43.425Z
6
+ Generated: 2026-10-24T04:18:42.632Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-svelte
@@ -165,6 +165,15 @@ interface AuthClient<T = UserProfile, TRegister extends RegisterExtraShape<TRegi
165
165
  * Gets the current user.
166
166
  */
167
167
  getUser(): T | null;
168
+ /**
169
+ * Optional ownership marker for the current session. Compare values only within
170
+ * this client: replacing or ending a session changes it, including re-adopting
171
+ * the same token and user. Profile updates and same-session refreshes keep it.
172
+ * Consumers can use it to discard stale async work without treating editable
173
+ * user fields as an immutable account identifier. Providers without this
174
+ * capability require the consumer's own stable identity check.
175
+ */
176
+ getSessionRevision?(): number;
168
177
  /**
169
178
  * Updates the cached user object (state + persistent storage) without
170
179
  * hitting the network. Intended for local refreshes after a per-app
@@ -239,6 +248,9 @@ interface AuthClient<T = UserProfile, TRegister extends RegisterExtraShape<TRegi
239
248
  confirmPasswordReset(data: PasswordResetConfirm): Promise<void>;
240
249
  /**
241
250
  * Updates the current user's profile.
251
+ * Returns the saved response. If the session is explicitly replaced or ended
252
+ * while the request is pending, that response does not replace the current
253
+ * session's user or persisted cache.
242
254
  */
243
255
  updateProfile(data: Partial<T>): Promise<T>;
244
256
  /**
@@ -297,16 +309,6 @@ interface AuthClient<T = UserProfile, TRegister extends RegisterExtraShape<TRegi
297
309
  * Resolves IMMEDIATELY when no restore is in flight: before `initialize()` is ever
298
310
  * called, and after it has finished. A restore that failed resolves too (it settled the
299
311
  * question), so an HTTP client can await this before every request without risking one
300
- * held forever. That is what makes the fetch-before-restore race impossible: a page that
301
- * fetches viewer-dependent data on mount waits here instead of going out anonymously
302
- * (see `setAuthGate` in `@molecule/app-http`).
303
- *
304
- * Optional: a provider that restores no session has nothing to wait for. Without it, an
305
- * HTTP client bonded to that provider sends first-paint requests unauthenticated.
306
- *
307
- * A provider whose restore sends a request THROUGH the gated HTTP client must send that
308
- * request with `skipAuthGate: true` (`RequestConfig` in `@molecule/app-http`): the gate
309
- * waits on this promise, so holding the restore's own request makes the gate wait on
310
312
  // … truncated — the full declaration is in node_modules/@molecule/app-svelte/dist
311
313
  ```
312
314
 
@@ -389,7 +391,13 @@ interface FormController<T extends Record<string, unknown> = Record<string, unkn
389
391
  */
390
392
  validate(): Promise<boolean>
391
393
  /**
392
- * Resets the form to initial values.
394
+ * Resets the form and clears errors, touched fields and submission state.
395
+ *
396
+ * With no argument it restores the current baseline — the initial
397
+ * `defaultValues`, or the values a previous `reset(values)` established.
398
+ * Passing `values` merges them over the current baseline and makes the
399
+ * result the new baseline, so a form reset to freshly loaded or saved data
400
+ * reads clean (`isDirty === false`).
393
401
  */
394
402
  reset(values?: Partial<T>): void
395
403
  /**
@@ -421,7 +429,8 @@ Form creation options.
421
429
  ```typescript
422
430
  interface FormOptions<T extends Record<string, unknown>> {
423
431
  /**
424
- * Default values.
432
+ * Default values, captured as the form's clean baseline when the controller
433
+ * is created. Mutating this object afterwards does not change the baseline.
425
434
  */
426
435
  defaultValues?: Partial<T>
427
436
  /**
@@ -2070,7 +2079,7 @@ function createVersionStores(): {
2070
2079
 
2071
2080
  Peer dependencies:
2072
2081
 
2073
- - `@molecule/app-auth` ^1.0.1
2082
+ - `@molecule/app-auth` ^1.0.1 || ^2.0.0
2074
2083
  - `@molecule/app-device` ^1.0.1
2075
2084
  - `@molecule/app-forms` ^1.0.1
2076
2085
  - `@molecule/app-http` ^1.0.1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-svelte",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Svelte framework bindings for molecule.dev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "node": ">=20"
23
23
  },
24
24
  "peerDependencies": {
25
- "@molecule/app-auth": "^1.0.1",
25
+ "@molecule/app-auth": "^1.0.1 || ^2.0.0",
26
26
  "@molecule/app-device": "^1.0.1",
27
27
  "@molecule/app-forms": "^1.0.1",
28
28
  "@molecule/app-http": "^1.0.1",
@@ -40,11 +40,11 @@
40
40
  "svelte": "^4.0.0 || ^5.0.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@molecule/app-utilities": "1.0.4",
44
- "@types/node": "26.1.2",
45
- "svelte": "5.56.8",
43
+ "@molecule/app-utilities": "1.0.5",
44
+ "@types/node": "26.6.5",
45
+ "svelte": "5.57.2",
46
46
  "typescript": "6.0.3",
47
- "vitest": "4.1.11"
47
+ "vitest": "4.1.12"
48
48
  },
49
49
  "repository": {
50
50
  "type": "git",