@runic-artifex/angular 0.11.0 → 0.12.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 +12 -12
- package/dist/esm/view-outlet.d.ts +9 -6
- package/dist/esm/view-outlet.js +14 -17
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -97,8 +97,8 @@ React's `fallback`, Vue's default slot and Svelte's `fallback` snippet.
|
|
|
97
97
|
`ViewOutlet` is the outlet's name in every Runic frontend package (React, Vue,
|
|
98
98
|
Svelte and Angular); its element keeps Angular's prefix convention,
|
|
99
99
|
`<runic-view-outlet>`. Before 0.7.0-preview.7 the Angular class was
|
|
100
|
-
`RunicViewOutlet`. That name is still exported as a deprecated
|
|
101
|
-
|
|
100
|
+
`RunicViewOutlet`. That name is still exported as a deprecated alias of the
|
|
101
|
+
same class, and is removed in the next major release.
|
|
102
102
|
|
|
103
103
|
The outlet is generic over the reference union it receives, so the registry
|
|
104
104
|
must have a component for every kind whose `page` input accepts that reference.
|
|
@@ -147,14 +147,14 @@ For example, a navigation command whose departure guard awaits a dialog's
|
|
|
147
147
|
answer never completes while the answer waits behind it. Order such commands
|
|
148
148
|
by dispatch instead: start the next one once the previous one has been sent,
|
|
149
149
|
as the Notes example's
|
|
150
|
-
[`WindowOperations.runDispatched`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
150
|
+
[`WindowOperations.runDispatched`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/examples/notes-view-first/Angular/src/app/window-operations.ts)
|
|
151
151
|
does for its navigation commands.
|
|
152
152
|
|
|
153
153
|
## Operations
|
|
154
154
|
|
|
155
155
|
`injectOperation(start, options?)` observes a generated `start<Command>()` operation
|
|
156
156
|
through the framework-neutral
|
|
157
|
-
[operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
157
|
+
[operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#operation-feedback-and-latest-selection)
|
|
158
158
|
for the lifetime of the injection context:
|
|
159
159
|
|
|
160
160
|
```ts
|
|
@@ -178,7 +178,7 @@ context.
|
|
|
178
178
|
|
|
179
179
|
`injectLatestOperation(options?)` admits only the newest of several reads, for example
|
|
180
180
|
loading the item the user selected last, through the framework-neutral
|
|
181
|
-
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
181
|
+
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#operation-feedback-and-latest-selection).
|
|
182
182
|
Each `run(intent)` replaces the queued intent and cancels the active read; the next
|
|
183
183
|
read starts only after the previous one reaches its terminal status and the intent's
|
|
184
184
|
optional `waitForCompletion` barrier:
|
|
@@ -210,7 +210,7 @@ from `@runic-artifex/views` (re-exported here since 0.11, with the
|
|
|
210
210
|
`BridgeConnectionState` and `BridgeConnectionOptions` types) and returns `{ state }`, a signal of a
|
|
211
211
|
`BridgeConnectionState`: `connecting`, `connected`, `reconnecting` or `lost` (a
|
|
212
212
|
closed set, see
|
|
213
|
-
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
213
|
+
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#connection-state)):
|
|
214
214
|
|
|
215
215
|
```ts
|
|
216
216
|
import { injectBridgeConnection } from "@runic-artifex/angular";
|
|
@@ -228,7 +228,7 @@ not observe and stays `connecting`. An invalid `lostAfter` throws a `RangeError`
|
|
|
228
228
|
`injectMenuBar(options?)` follows the declared menu bar of a Runic Desktop
|
|
229
229
|
window that leaves it to the page (`DesktopMenuBarPresentation.Page`) for the
|
|
230
230
|
lifetime of the injection context. It wraps `createMenuBarController` from
|
|
231
|
-
`@runic-artifex/views` (see [In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
231
|
+
`@runic-artifex/views` (see [In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#in-page-menu-bar))
|
|
232
232
|
and returns `{ state, invoke, handleKeyDown }`, where `state` is a signal of a
|
|
233
233
|
`MenuBarState`. The bar is rendered by the application's own menubar, for
|
|
234
234
|
example the CDK Menu's `cdkMenuBar`. Runic ships no menubar component.
|
|
@@ -253,7 +253,7 @@ it creates none and stays `connecting`.
|
|
|
253
253
|
### With the CDK Menu
|
|
254
254
|
|
|
255
255
|
The CDK's `cdkMenuBar` with `CdkMenuTrigger.open()` for `open` requests; the
|
|
256
|
-
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
256
|
+
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/examples/notes-view-first#in-page-menu-bar) adds submenus, check and radio
|
|
257
257
|
items (`cdkMenuItemCheckbox`, `cdkMenuItemRadio` in a `cdkMenuGroup`) and is
|
|
258
258
|
tested with real keys:
|
|
259
259
|
|
|
@@ -317,7 +317,7 @@ const offline = error instanceof BridgeError && error.kind === "disconnected";
|
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
`instanceof` holds for errors from every copy of the package on the page.
|
|
320
|
-
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
320
|
+
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#errors-and-diagnostics)
|
|
321
321
|
lists the kinds. Any other value, such as an exception that your own connect
|
|
322
322
|
function or command callback throws, arrives unchanged.
|
|
323
323
|
|
|
@@ -368,16 +368,16 @@ application's own dialog.
|
|
|
368
368
|
departure before that is answered by the ViewModel's .NET fallback handler, or
|
|
369
369
|
fails closed without one.
|
|
370
370
|
|
|
371
|
-
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
371
|
+
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.12.0/packages/dotnet/Runic.Application.Views.ReactiveUI/README.md#leave-confirmation-in-a-web-view)
|
|
372
372
|
has the .NET side and which View answers which departure. In a frontend test,
|
|
373
373
|
the generated mock's `interactions.<name>.request(input)` resolves with the
|
|
374
|
-
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
374
|
+
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#testing).
|
|
375
375
|
|
|
376
376
|
## Collection viewports
|
|
377
377
|
|
|
378
378
|
`injectCollectionViewport(element, options)` follows a fixed-row-height scroll
|
|
379
379
|
container and returns a signal with its
|
|
380
|
-
[`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
380
|
+
[`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#collectionviewportoptions)
|
|
381
381
|
range. Pass the container as a signal, such as a `viewChild`, and the options as
|
|
382
382
|
a function or signal, then send the range to the ViewModel from an effect:
|
|
383
383
|
|
|
@@ -43,10 +43,13 @@ export declare class ViewOutlet<R extends PageReference = PageReference> {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* The name of {@link ViewOutlet} before 0.7.0-preview.7, where React, Vue and Svelte already used
|
|
46
|
-
* `ViewOutlet`. It renders the same `<runic-view-outlet>` element
|
|
47
|
-
*
|
|
46
|
+
* `ViewOutlet`. It is the same component class, so it renders the same `<runic-view-outlet>` element
|
|
47
|
+
* without a second component definition for that selector (NG0912).
|
|
48
|
+
* @deprecated Import `ViewOutlet` instead; this alias is removed in the next major release.
|
|
48
49
|
*/
|
|
49
|
-
export declare
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
export declare const RunicViewOutlet: typeof ViewOutlet;
|
|
51
|
+
/**
|
|
52
|
+
* The name of {@link ViewOutlet} before 0.7.0-preview.7.
|
|
53
|
+
* @deprecated Import `ViewOutlet` instead; this alias is removed in the next major release.
|
|
54
|
+
*/
|
|
55
|
+
export type RunicViewOutlet<R extends PageReference = PageReference> = ViewOutlet<R>;
|
package/dist/esm/view-outlet.js
CHANGED
|
@@ -2,11 +2,6 @@ import { Component, computed, effect, input, signal, untracked, viewChild, ViewC
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
// Projected content renders while there is no reference, like React's `fallback`, Vue's default slot
|
|
4
4
|
// and Svelte's `fallback` snippet: `<runic-view-outlet [content]="…" [registry]="…">Loading…</runic-view-outlet>`.
|
|
5
|
-
const outletTemplate = `
|
|
6
|
-
<ng-container #mount />
|
|
7
|
-
@if (!content()) { <ng-content /> }
|
|
8
|
-
@if (error(); as issue) { <p role="alert">{{ issue }}</p> }
|
|
9
|
-
`;
|
|
10
5
|
/**
|
|
11
6
|
* Headless host for a selected logical .NET View. A changed reference remounts its component, and
|
|
12
7
|
* the projected content renders while there is no reference. A kind without a component renders
|
|
@@ -65,22 +60,24 @@ export class ViewOutlet {
|
|
|
65
60
|
});
|
|
66
61
|
}
|
|
67
62
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: ViewOutlet, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.3", type: ViewOutlet, isStandalone: true, selector: "runic-view-outlet", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, registry: { classPropertyName: "registry", publicName: "registry", isSignal: true, isRequired: true, transformFunction: null }, missing: { classPropertyName: "missing", publicName: "missing", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "mount", first: true, predicate: ["mount"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template:
|
|
63
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.3", type: ViewOutlet, isStandalone: true, selector: "runic-view-outlet", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, registry: { classPropertyName: "registry", publicName: "registry", isSignal: true, isRequired: true, transformFunction: null }, missing: { classPropertyName: "missing", publicName: "missing", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "mount", first: true, predicate: ["mount"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: `
|
|
64
|
+
<ng-container #mount />
|
|
65
|
+
@if (!content()) { <ng-content /> }
|
|
66
|
+
@if (error(); as issue) { <p role="alert">{{ issue }}</p> }
|
|
67
|
+
`, isInline: true });
|
|
69
68
|
}
|
|
70
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: ViewOutlet, decorators: [{
|
|
71
70
|
type: Component,
|
|
72
|
-
args: [{ selector: "runic-view-outlet", standalone: true, template:
|
|
71
|
+
args: [{ selector: "runic-view-outlet", standalone: true, template: `
|
|
72
|
+
<ng-container #mount />
|
|
73
|
+
@if (!content()) { <ng-content /> }
|
|
74
|
+
@if (error(); as issue) { <p role="alert">{{ issue }}</p> }
|
|
75
|
+
` }]
|
|
73
76
|
}], ctorParameters: () => [], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], registry: [{ type: i0.Input, args: [{ isSignal: true, alias: "registry", required: true }] }], missing: [{ type: i0.Input, args: [{ isSignal: true, alias: "missing", required: false }] }], mount: [{ type: i0.ViewChild, args: ["mount", { ...{ read: ViewContainerRef }, isSignal: true }] }] } });
|
|
74
77
|
/**
|
|
75
78
|
* The name of {@link ViewOutlet} before 0.7.0-preview.7, where React, Vue and Svelte already used
|
|
76
|
-
* `ViewOutlet`. It renders the same `<runic-view-outlet>` element
|
|
77
|
-
*
|
|
79
|
+
* `ViewOutlet`. It is the same component class, so it renders the same `<runic-view-outlet>` element
|
|
80
|
+
* without a second component definition for that selector (NG0912).
|
|
81
|
+
* @deprecated Import `ViewOutlet` instead; this alias is removed in the next major release.
|
|
78
82
|
*/
|
|
79
|
-
export
|
|
80
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: RunicViewOutlet, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.3", type: RunicViewOutlet, isStandalone: true, selector: "runic-view-outlet", usesInheritance: true, ngImport: i0, template: "\n <ng-container #mount />\n @if (!content()) { <ng-content /> }\n @if (error(); as issue) { <p role=\"alert\">{{ issue }}</p> }\n ", isInline: true });
|
|
82
|
-
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.3", ngImport: i0, type: RunicViewOutlet, decorators: [{
|
|
84
|
-
type: Component,
|
|
85
|
-
args: [{ selector: "runic-view-outlet", standalone: true, template: outletTemplate }]
|
|
86
|
-
}] });
|
|
83
|
+
export const RunicViewOutlet = ViewOutlet;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runic-artifex/angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@angular/core": ">=22.0.0 <23",
|
|
15
|
-
"@runic-artifex/views": "0.
|
|
15
|
+
"@runic-artifex/views": "0.12.0"
|
|
16
16
|
},
|
|
17
17
|
"description": "Angular outlet and signals for Runic Views",
|
|
18
18
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "git+https://github.com/Runic-Artifex/runic-sdk.git",
|
|
22
22
|
"directory": "packages/web/angular"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
24
|
+
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/angular#readme",
|
|
25
25
|
"bugs": {
|
|
26
26
|
"url": "https://github.com/Runic-Artifex/runic-sdk/issues"
|
|
27
27
|
},
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"pack:check": "bun pm pack --dry-run"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@runic-artifex/views": "0.
|
|
48
|
+
"@runic-artifex/views": "0.12.0",
|
|
49
49
|
"@angular/common": "22.2.3",
|
|
50
50
|
"@angular/compiler": "22.2.3",
|
|
51
51
|
"@angular/compiler-cli": "22.2.3",
|
|
52
52
|
"@angular/core": "22.2.3",
|
|
53
53
|
"@angular/platform-browser": "22.2.3",
|
|
54
|
-
"happy-dom": "
|
|
54
|
+
"happy-dom": "21.0.4",
|
|
55
55
|
"typescript": "6.0.3",
|
|
56
56
|
"vitest": "5.0.3"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "cb95ea2838ba61c7a24b9cda05bf5f0bd6fcc2d7"
|
|
59
59
|
}
|