@runic-artifex/svelte 0.14.0 → 0.15.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 CHANGED
@@ -82,7 +82,7 @@ the failure. Await it with `{#await}`:
82
82
  The source is read once: wrap the component in `{#key page}` to follow another
83
83
  reference. Do not `{#await page.connect()}` directly: nothing would dispose
84
84
  that client. In SvelteKit, connect in a `load` function instead
85
- ([`@runic-artifex/sveltekit`](https://github.com/Runic-Artifex/runic-sdk/blob/v0.14.0/packages/web/svelte/../sveltekit/README.md#connecting-in-load)).
85
+ ([`@runic-artifex/sveltekit`](https://github.com/Runic-Artifex/runic-sdk/blob/v0.15.0/packages/web/svelte/../sveltekit/README.md#connecting-in-load)).
86
86
 
87
87
  ### Selecting state: `$derived`
88
88
 
@@ -166,8 +166,9 @@ handle also has `value` and `text`, which `bind:value={title.value}` reads and s
166
166
 
167
167
  - `commit: "pause"` writes the draft after `delay` milliseconds without input (700 by default) and at once on
168
168
  `commit()`, which blur calls; use it where each write is an undo step or starts work in .NET. The default,
169
- `commit: "input"`, writes each input. `commit()` resolves once the field's writes settled, so a command that
170
- depends on the field can follow them: `await title.commit(); await editor.save()`.
169
+ `commit: "input"`, writes each input. `commit()` resolves with the field's state once its writes settled, so a
170
+ command that depends on the field can follow them and skip a failed write:
171
+ `if ((await title.commit()).error === undefined) await editor.save()`.
171
172
  - `checked: true` writes with the member's checked write, so a change by another writer while the user edits is a
172
173
  conflict instead of being overwritten. A `rejected` receipt keeps the draft and sets `error` to a `FieldError` with
173
174
  the setter's message; a `conflict` keeps the draft, sets `conflict` to the producer's `{ value, version }` and
@@ -177,14 +178,14 @@ handle also has `value` and `text`, which `bind:value={title.value}` reads and s
177
178
  `errors` holds the member's validation messages from the descriptor (`[]` when valid), `error` why the latest write
178
179
  or text failed (a `BridgeError` or a `FieldError`, whose `kind` is `rejected`, `conflict`, `committed-with-error` or
179
180
  `invalid-text`). `FieldError`, `FieldOptions`, `FieldState` and `BridgeField` are exported from this package. See the
180
- [field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#fields) for the receipts
181
+ [field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#fields) for the receipts
181
182
  and text forms.
182
183
 
183
184
  ### Text inputs: `useTextField(view, read, write, options?)`
184
185
 
185
186
  Call during component initialization to bind a text input to a member through the
186
187
  framework-neutral
187
- [text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#text-inputs):
188
+ [text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#text-inputs):
188
189
 
189
190
  ```svelte
190
191
  <script lang="ts">
@@ -323,7 +324,7 @@ Cancel and other callbacks responsive during observation.
323
324
  ## `useLatestOperation()`
324
325
 
325
326
  For rapid read selection, `useLatestOperation()` wraps the framework-neutral
326
- [latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#operation-feedback-and-latest-selection)
327
+ [latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#operation-feedback-and-latest-selection)
327
328
  for the component's lifetime. It coalesces the latest intent across delayed receipts
328
329
  and orders the next admission after terminal observation and any application drain
329
330
  barrier:
@@ -354,7 +355,7 @@ establish that replacement boundary and own the old work's drain. Lost terminal
354
355
  observation blocks further Starts instead of retrying blindly, with its reason in
355
356
  `error`; ordinary Cancel does not clear this block. Component destruction settles
356
357
  observation without cancelling accepted work. The
357
- [operations package consumer](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/tests/fixtures/application/operations-consumer)
358
+ [operations package consumer](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/tests/fixtures/application/operations-consumer)
358
359
  runs this hook against the packed packages and the desktop transport.
359
360
 
360
361
  ## `useBridgeConnection(options?)`
@@ -362,9 +363,9 @@ runs this hook against the packed packages and the desktop transport.
362
363
  Follows the page's connection to its .NET host. It wraps `onBridgeConnection`
363
364
  from `@runic-artifex/views` (re-exported here since 0.11, with the
364
365
  `BridgeConnectionState` and `BridgeConnectionOptions` types) and returns `{ state }`, a reactive
365
- `BridgeConnectionState`: `connecting`, `connected`, `reconnecting` or `lost` (a
366
- closed set, see
367
- [Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#connection-state)):
366
+ `BridgeConnectionState`: `connecting`, `connected`, `reconnecting`, `lost` or `closed` (the
367
+ application closed the window, since 0.15; a closed set, see
368
+ [Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#connection-state)):
368
369
 
369
370
  ```svelte
370
371
  <script lang="ts">
@@ -386,7 +387,7 @@ server render does not observe, and destroying the owner unsubscribes. An invali
386
387
  Follows the declared menu bar of a Runic Desktop window that leaves it to the
387
388
  page (`DesktopMenuBarPresentation.Page`) while its owner lives. It wraps
388
389
  `createMenuBarController` from `@runic-artifex/views` (see
389
- [In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#in-page-menu-bar)) and returns `{ state, invoke, handleKeyDown }`, where `state` is a
390
+ [In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#in-page-menu-bar)) and returns `{ state, invoke, handleKeyDown }`, where `state` is a
390
391
  reactive `MenuBarState` property. The bar is rendered by the menubar component
391
392
  of the application's own UI library. Runic ships no menubar component.
392
393
 
@@ -415,7 +416,7 @@ the `shortcuts: "app"` lease.
415
416
  ### With Bits UI
416
417
 
417
418
  Bits UI's `Menubar.Root bind:value`; the
418
- [Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/examples/notes-view-first#in-page-menu-bar) adds submenus, check and radio
419
+ [Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/examples/notes-view-first#in-page-menu-bar) adds submenus, check and radio
419
420
  items and is tested with real keys:
420
421
 
421
422
  ```svelte
@@ -482,7 +483,7 @@ const message = $derived(describeBridgeError(view.error));
482
483
  ```
483
484
 
484
485
  `instanceof` holds for errors from every copy of the package on the page.
485
- [Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#errors-and-diagnostics)
486
+ [Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#errors-and-diagnostics)
486
487
  lists the kinds. Any other value, such as an exception that your own connect
487
488
  function or command callback throws, arrives unchanged.
488
489
 
@@ -521,15 +522,15 @@ application's own dialog.
521
522
  departure before that is answered by the ViewModel's .NET fallback handler, or
522
523
  fails closed without one.
523
524
 
524
- The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.14.0/packages/dotnet/Runic.Application.Views.ReactiveUI/README.md#leave-confirmation-in-a-web-view)
525
+ The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.15.0/packages/dotnet/Runic.Application.Views.ReactiveUI/README.md#leave-confirmation-in-a-web-view)
525
526
  has the .NET side and which View answers which departure. In a frontend test,
526
527
  the generated mock's `interactions.<name>.request(input)` resolves with the
527
- registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#testing).
528
+ registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#testing).
528
529
 
529
530
  ## `useCollectionViewport(options)`
530
531
 
531
532
  Follows a fixed-row-height scroll container and returns `{ viewport, attach }`.
532
- `viewport` is the reactive [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#collectionviewportoptions)
533
+ `viewport` is the reactive [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#collectionviewportoptions)
533
534
  range; `attach` is an attachment for the container. Call it during component
534
535
  initialization and send the range to the ViewModel from an effect:
535
536
 
@@ -4,8 +4,8 @@ export interface BridgeConnectionHandle {
4
4
  readonly state: BridgeConnectionState;
5
5
  }
6
6
  /**
7
- * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting` or
8
- * `lost`) through `onBridgeConnection` while its owner lives. `state` holds the current state at
7
+ * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting`,
8
+ * `lost` or `closed`) through `onBridgeConnection` while its owner lives. `state` holds the current state at
9
9
  * once; the subscription starts with the owner's effects, so server rendering never observes.
10
10
  * Call during component initialization (or in `$effect.root`); owner destruction unsubscribes.
11
11
  *
@@ -1,7 +1,7 @@
1
1
  import { onBridgeConnection } from "@runic-artifex/views";
2
2
  /**
3
- * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting` or
4
- * `lost`) through `onBridgeConnection` while its owner lives. `state` holds the current state at
3
+ * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting`,
4
+ * `lost` or `closed`) through `onBridgeConnection` while its owner lives. `state` holds the current state at
5
5
  * once; the subscription starts with the owner's effects, so server rendering never observes.
6
6
  * Call during component initialization (or in `$effect.root`); owner destruction unsubscribes.
7
7
  *
@@ -31,7 +31,8 @@ export interface FieldHandle<TValue> {
31
31
  /**
32
32
  * The user is done with the field (`attach` calls it on blur): with `commit: "pause"` the draft is written now.
33
33
  * Resolves with the field's state once its writes settled, so a command that depends on the field can run after
34
- * it: `await title.commit(); await editor.save()`. Never rejects; a failure is `error`.
34
+ * it and skip a failed write: `if ((await title.commit()).error === undefined) await editor.save()`. Never
35
+ * rejects; a failure is `error`.
35
36
  */
36
37
  commit(): Promise<FieldState<TValue>>;
37
38
  /** Writes the draft again after a failed write; after a `conflict`, over the producer's value. */
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@runic-artifex/svelte",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Svelte 5 Application Views helpers for Runic",
5
- "homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/svelte#readme",
5
+ "homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/svelte#readme",
6
6
  "bugs": {
7
7
  "url": "https://github.com/Runic-Artifex/runic-sdk/issues"
8
8
  },
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "peerDependencies": {
42
42
  "svelte": ">=5.57.1 <6",
43
- "@runic-artifex/views": "0.14.0"
43
+ "@runic-artifex/views": "0.15.0"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "packageManager": "bun@1.4.4",
55
55
  "devDependencies": {
56
- "@runic-artifex/views": "0.14.0",
56
+ "@runic-artifex/views": "0.15.0",
57
57
  "@sveltejs/adapter-static": "4.0.0",
58
58
  "@sveltejs/kit": "3.0.0",
59
59
  "@sveltejs/package": "3.0.0",
@@ -67,5 +67,5 @@
67
67
  "vitest": "5.0.3",
68
68
  "vite": "8.3.4"
69
69
  },
70
- "gitHead": "11dc038ea80315c4d2b7e15cbd03dfe175ed6124"
70
+ "gitHead": "c94bda07cf363bad056eda86ae77c514b66e61dd"
71
71
  }