@runic-artifex/vue 0.15.0 → 0.15.1
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 +14 -11
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -50,6 +50,9 @@ connected:
|
|
|
50
50
|
"Connecting…" and do not open the route again. `keepAlive: 0` disposes at
|
|
51
51
|
once.
|
|
52
52
|
- An already connected client is observed and left to its owner.
|
|
53
|
+
- Each member is its own ref: `client` stays the same object for the
|
|
54
|
+
connection, so a `watch` or `watchEffect` that reads only `client` does not
|
|
55
|
+
run again when the View's state changes.
|
|
53
56
|
- The source can be a value, a ref or a getter such as `() => props.page`.
|
|
54
57
|
- `pending` is true while a reference connects. `error` holds a failed
|
|
55
58
|
connection; `retry()` connects again.
|
|
@@ -193,13 +196,13 @@ is written. A string set on `value` of a field that is not text is taken as its
|
|
|
193
196
|
`errors` holds the member's validation messages from the descriptor (`[]` when valid), `error` why the latest write
|
|
194
197
|
or text failed (a `BridgeError` or a `FieldError`, whose `kind` is `rejected`, `conflict`, `committed-with-error` or
|
|
195
198
|
`invalid-text`). `FieldError`, `FieldOptions`, `FieldState` and `BridgeField` are exported from this package. See the
|
|
196
|
-
[field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
199
|
+
[field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#fields) for the receipts
|
|
197
200
|
and text forms.
|
|
198
201
|
|
|
199
202
|
### Text inputs: `useTextField(view, read, write, options?)`
|
|
200
203
|
|
|
201
204
|
Binds a text input to a member through the framework-neutral
|
|
202
|
-
[text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
205
|
+
[text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#text-inputs)
|
|
203
206
|
while the effect scope is active. Each field is a ref, so the handle can be destructured:
|
|
204
207
|
|
|
205
208
|
```vue
|
|
@@ -301,7 +304,7 @@ neither.
|
|
|
301
304
|
## `useOperation(start, options?)`
|
|
302
305
|
|
|
303
306
|
Observes a generated `start<Command>()` operation through the framework-neutral
|
|
304
|
-
[operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
307
|
+
[operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#operation-feedback-and-latest-selection)
|
|
305
308
|
and returns each state field as a shallow ref, with `run`, `cancel` and `reset`:
|
|
306
309
|
|
|
307
310
|
```vue
|
|
@@ -333,7 +336,7 @@ Disposing the effect scope settles run promises without cancelling accepted work
|
|
|
333
336
|
|
|
334
337
|
Admits only the newest of several reads, for example loading the item the user
|
|
335
338
|
selected last, through the framework-neutral
|
|
336
|
-
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
339
|
+
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#operation-feedback-and-latest-selection),
|
|
337
340
|
and returns each state field as a shallow ref, with `run` and `clear`. Each
|
|
338
341
|
`run(intent)` replaces the queued intent and cancels the active read; the next read
|
|
339
342
|
starts only after the previous one reaches its terminal status and the intent's
|
|
@@ -370,7 +373,7 @@ from `@runic-artifex/views` (re-exported here since 0.11, with the
|
|
|
370
373
|
`BridgeConnectionState` and `BridgeConnectionOptions` types) and returns `{ state }`, a shallow ref holding a
|
|
371
374
|
`BridgeConnectionState`: `connecting`, `connected`, `reconnecting`, `lost` or `closed` (the
|
|
372
375
|
application closed the window, since 0.15; a closed set, see
|
|
373
|
-
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
376
|
+
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#connection-state)):
|
|
374
377
|
|
|
375
378
|
```vue
|
|
376
379
|
<script setup lang="ts">
|
|
@@ -393,7 +396,7 @@ development builds warn. An invalid `lostAfter` throws a `RangeError`.
|
|
|
393
396
|
Follows the declared menu bar of a Runic Desktop window that leaves it to the
|
|
394
397
|
page (`DesktopMenuBarPresentation.Page`) until the current effect scope is
|
|
395
398
|
disposed. It wraps `createMenuBarController` from `@runic-artifex/views` (see
|
|
396
|
-
[In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
399
|
+
[In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#in-page-menu-bar)) and returns `{ state, invoke, handleKeyDown }`: `state` is a shallow ref
|
|
397
400
|
of a `MenuBarState`, and the bar is rendered by the menubar component of the
|
|
398
401
|
application's own UI library. Runic ships no menubar component.
|
|
399
402
|
|
|
@@ -424,7 +427,7 @@ rendering creates no controller: `state` stays `connecting`.
|
|
|
424
427
|
### With Reka UI
|
|
425
428
|
|
|
426
429
|
Reka UI's `MenubarRoot` with `v-model` of the open menu; the
|
|
427
|
-
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
430
|
+
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/examples/notes-view-first#in-page-menu-bar) adds submenus, check and radio
|
|
428
431
|
items and is tested with real keys:
|
|
429
432
|
|
|
430
433
|
```vue
|
|
@@ -486,7 +489,7 @@ const message = computed(() => describeBridgeError(error.value));
|
|
|
486
489
|
```
|
|
487
490
|
|
|
488
491
|
`instanceof` holds for errors from every copy of the package on the page.
|
|
489
|
-
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
492
|
+
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#errors-and-diagnostics)
|
|
490
493
|
lists the kinds. Any other value, such as an exception that your own connect
|
|
491
494
|
function or command callback throws, arrives unchanged.
|
|
492
495
|
|
|
@@ -533,15 +536,15 @@ application's own dialog.
|
|
|
533
536
|
departure before that is answered by the ViewModel's .NET fallback handler, or
|
|
534
537
|
fails closed without one.
|
|
535
538
|
|
|
536
|
-
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.15.
|
|
539
|
+
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.15.1/packages/dotnet/Runic.Application.Views.ReactiveUI/README.md#leave-confirmation-in-a-web-view)
|
|
537
540
|
has the .NET side and which View answers which departure. In a frontend test,
|
|
538
541
|
the generated mock's `interactions.<name>.request(input)` resolves with the
|
|
539
|
-
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
542
|
+
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#testing).
|
|
540
543
|
|
|
541
544
|
## `useCollectionViewport(options)`
|
|
542
545
|
|
|
543
546
|
Follows a fixed-row-height scroll container and returns `{ viewport, attach }`.
|
|
544
|
-
`viewport` is a shallow ref with the [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
547
|
+
`viewport` is a shallow ref with the [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/views#collectionviewportoptions)
|
|
545
548
|
range; `attach` is a function ref for the container. Bind it to a native element
|
|
546
549
|
such as a `<div>`: a component instance (`:ref="attach"` on a component) or a
|
|
547
550
|
non-HTML element detaches the viewport, and development builds warn. Pass a getter for the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runic-artifex/vue",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Vue composables for generated Runic Views clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"vue": ">=3.5.30 <4",
|
|
33
|
-
"@runic-artifex/views": "0.15.
|
|
33
|
+
"@runic-artifex/views": "0.15.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@runic-artifex/views": "0.15.
|
|
36
|
+
"@runic-artifex/views": "0.15.1",
|
|
37
37
|
"esbuild": "0.28.2",
|
|
38
38
|
"happy-dom": "21.0.4",
|
|
39
39
|
"playwright-core": "1.63.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"url": "git+https://github.com/Runic-Artifex/runic-sdk.git",
|
|
51
51
|
"directory": "packages/web/vue"
|
|
52
52
|
},
|
|
53
|
-
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.
|
|
53
|
+
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.15.1/packages/web/vue#readme",
|
|
54
54
|
"bugs": {
|
|
55
55
|
"url": "https://github.com/Runic-Artifex/runic-sdk/issues"
|
|
56
56
|
},
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"views",
|
|
61
61
|
"vue"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "fce42f47296a4784532fbba0fec9602cd3778fbb"
|
|
64
64
|
}
|