@runic-artifex/angular 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
@@ -138,7 +138,7 @@ export class CounterPage {
138
138
 
139
139
  Bind a text input to a member with `injectTextField(view, read, write, options?)`,
140
140
  which wraps the framework-neutral
141
- [text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#text-inputs)
141
+ [text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#text-inputs)
142
142
  for the lifetime of the injection context:
143
143
 
144
144
  ```ts
@@ -181,7 +181,7 @@ text at once and hides the race.
181
181
 
182
182
  For generated Views prefer `injectField(view, field, options?)`: pass a descriptor of the
183
183
  generated `{View}Fields`, such as `EditorFields.title`. It wraps the framework-neutral
184
- [field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#fields)
184
+ [field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#fields)
185
185
  for every kind (text, numbers, booleans, enums) and returns signals and actions:
186
186
 
187
187
  - `value`, `text` (what a text input shows: `1.` stays while typing `1.5`), `editing`,
@@ -216,9 +216,10 @@ The options are those of the controller and `injector`:
216
216
 
217
217
  - `commit: "pause"` writes the draft after `delay` milliseconds without input (700
218
218
  by default) and at once on `commit()`, which blur calls; use it where each write is
219
- an undo step or starts work in .NET. `commit()` resolves once the field's writes
220
- settled, so a command that depends on the field can follow it:
221
- `await this.title.commit(); await this.editor.client()?.save();`.
219
+ an undo step or starts work in .NET. `commit()` resolves with the field's state
220
+ once its writes settled, so a command that depends on the field can follow it
221
+ and skip a failed write:
222
+ `if ((await this.title.commit()).error === undefined) await this.editor.client()?.save();`.
222
223
  - `checked: true` writes with the member's checked write: a change by another writer
223
224
  since the draft started is a conflict instead of being overwritten.
224
225
  - `coalesce` and `keepDraftOnError`, as for `injectTextField`.
@@ -392,14 +393,14 @@ For example, a navigation command whose departure guard awaits a dialog's
392
393
  answer never completes while the answer waits behind it. Order such commands
393
394
  by dispatch instead: start the next one once the previous one has been sent,
394
395
  as the Notes example's
395
- [`WindowOperations.runDispatched`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/examples/notes-view-first/Angular/src/app/window-operations.ts)
396
+ [`WindowOperations.runDispatched`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/examples/notes-view-first/Angular/src/app/window-operations.ts)
396
397
  does for its navigation commands.
397
398
 
398
399
  ## Operations
399
400
 
400
401
  `injectOperation(start, options?)` observes a generated `start<Command>()` operation
401
402
  through the framework-neutral
402
- [operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#operation-feedback-and-latest-selection)
403
+ [operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#operation-feedback-and-latest-selection)
403
404
  for the lifetime of the injection context:
404
405
 
405
406
  ```ts
@@ -425,7 +426,7 @@ context.
425
426
 
426
427
  `injectLatestOperation(options?)` admits only the newest of several reads, for example
427
428
  loading the item the user selected last, through the framework-neutral
428
- [latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#operation-feedback-and-latest-selection).
429
+ [latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#operation-feedback-and-latest-selection).
429
430
  Each `run(intent)` replaces the queued intent and cancels the active read; the next
430
431
  read starts only after the previous one reaches its terminal status and the intent's
431
432
  optional `waitForCompletion` barrier:
@@ -455,9 +456,9 @@ cancelling accepted work. Pass `injector` outside an injection context.
455
456
  host for the lifetime of the injection context. It wraps `onBridgeConnection`
456
457
  from `@runic-artifex/views` (re-exported here since 0.11, with the
457
458
  `BridgeConnectionState` and `BridgeConnectionOptions` types) and returns `{ state }`, a signal of a
458
- `BridgeConnectionState`: `connecting`, `connected`, `reconnecting` or `lost` (a
459
- closed set, see
460
- [Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#connection-state)):
459
+ `BridgeConnectionState`: `connecting`, `connected`, `reconnecting`, `lost` or `closed` (the
460
+ application closed the window, since 0.15; a closed set, see
461
+ [Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#connection-state)):
461
462
 
462
463
  ```ts
463
464
  import { injectBridgeConnection } from "@runic-artifex/angular";
@@ -475,7 +476,7 @@ not observe and stays `connecting`. An invalid `lostAfter` throws a `RangeError`
475
476
  `injectMenuBar(options?)` follows the declared menu bar of a Runic Desktop
476
477
  window that leaves it to the page (`DesktopMenuBarPresentation.Page`) for the
477
478
  lifetime of the injection context. It wraps `createMenuBarController` from
478
- `@runic-artifex/views` (see [In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#in-page-menu-bar))
479
+ `@runic-artifex/views` (see [In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#in-page-menu-bar))
479
480
  and returns `{ state, invoke, handleKeyDown }`, where `state` is a signal of a
480
481
  `MenuBarState`. The bar is rendered by the application's own menubar, for
481
482
  example the CDK Menu's `cdkMenuBar`. Runic ships no menubar component.
@@ -500,7 +501,7 @@ it creates none and stays `connecting`.
500
501
  ### With the CDK Menu
501
502
 
502
503
  The CDK's `cdkMenuBar` with `CdkMenuTrigger.open()` for `open` requests; the
503
- [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
504
+ [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
504
505
  items (`cdkMenuItemCheckbox`, `cdkMenuItemRadio` in a `cdkMenuGroup`) and is
505
506
  tested with real keys:
506
507
 
@@ -566,7 +567,7 @@ readonly message = computed(() => describeBridgeError(this.view.error()));
566
567
  ```
567
568
 
568
569
  `instanceof` holds for errors from every copy of the package on the page.
569
- [Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#errors-and-diagnostics)
570
+ [Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#errors-and-diagnostics)
570
571
  lists the kinds. Any other value, such as an exception that your own connect
571
572
  function or command callback throws, arrives unchanged.
572
573
 
@@ -617,16 +618,16 @@ application's own dialog.
617
618
  departure before that is answered by the ViewModel's .NET fallback handler, or
618
619
  fails closed without one.
619
620
 
620
- 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)
621
+ 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)
621
622
  has the .NET side and which View answers which departure. In a frontend test,
622
623
  the generated mock's `interactions.<name>.request(input)` resolves with the
623
- registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#testing).
624
+ registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#testing).
624
625
 
625
626
  ## Collection viewports
626
627
 
627
628
  `injectCollectionViewport(element, options)` follows a fixed-row-height scroll
628
629
  container and returns a signal with its
629
- [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/views#collectionviewportoptions)
630
+ [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/views#collectionviewportoptions)
630
631
  range. Pass the container as a signal, such as a `viewChild`, and the options as
631
632
  a function or signal, then send the range to the ViewModel from an effect:
632
633
 
@@ -9,8 +9,8 @@ export interface InjectBridgeConnectionOptions extends BridgeConnectionOptions {
9
9
  readonly injector?: Injector;
10
10
  }
11
11
  /**
12
- * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting` or
13
- * `lost`) as a signal through `onBridgeConnection`, for the lifetime of the injection context.
12
+ * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting`,
13
+ * `lost` or `closed`) as a signal through `onBridgeConnection`, for the lifetime of the injection context.
14
14
  * Destruction unsubscribes. Under server rendering (`PLATFORM_ID` `"server"`) it does not
15
15
  * observe and stays `connecting`.
16
16
  *
@@ -1,8 +1,8 @@
1
1
  import { assertInInjectionContext, DestroyRef, inject, Injector, PLATFORM_ID, signal } from "@angular/core";
2
2
  import { onBridgeConnection } from "@runic-artifex/views";
3
3
  /**
4
- * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting` or
5
- * `lost`) as a signal through `onBridgeConnection`, for the lifetime of the injection context.
4
+ * Follows the page's connection to its .NET host (`connecting`, `connected`, `reconnecting`,
5
+ * `lost` or `closed`) as a signal through `onBridgeConnection`, for the lifetime of the injection context.
6
6
  * Destruction unsubscribes. Under server rendering (`PLATFORM_ID` `"server"`) it does not
7
7
  * observe and stays `connecting`.
8
8
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runic-artifex/angular",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,7 +18,7 @@
18
18
  "peerDependencies": {
19
19
  "@angular/core": ">=22.0.0 <23",
20
20
  "@angular/forms": ">=22.0.0 <23",
21
- "@runic-artifex/views": "0.14.0"
21
+ "@runic-artifex/views": "0.15.0"
22
22
  },
23
23
  "peerDependenciesMeta": {
24
24
  "@angular/forms": {
@@ -32,7 +32,7 @@
32
32
  "url": "git+https://github.com/Runic-Artifex/runic-sdk.git",
33
33
  "directory": "packages/web/angular"
34
34
  },
35
- "homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.14.0/packages/web/angular#readme",
35
+ "homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.0/packages/web/angular#readme",
36
36
  "bugs": {
37
37
  "url": "https://github.com/Runic-Artifex/runic-sdk/issues"
38
38
  },
@@ -56,7 +56,7 @@
56
56
  "pack:check": "bun pm pack --dry-run"
57
57
  },
58
58
  "devDependencies": {
59
- "@runic-artifex/views": "0.14.0",
59
+ "@runic-artifex/views": "0.15.0",
60
60
  "@angular/common": "22.2.3",
61
61
  "@angular/compiler": "22.2.3",
62
62
  "@angular/compiler-cli": "22.2.3",
@@ -69,5 +69,5 @@
69
69
  "typescript": "6.0.3",
70
70
  "vitest": "5.0.3"
71
71
  },
72
- "gitHead": "11dc038ea80315c4d2b7e15cbd03dfe175ed6124"
72
+ "gitHead": "c94bda07cf363bad056eda86ae77c514b66e61dd"
73
73
  }