@runic-artifex/vue 0.18.0 → 0.20.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 +26 -23
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -196,10 +196,10 @@ is written. A string set on `value` of a field that is not text is taken as its
|
|
|
196
196
|
`errors` holds the member's validation messages from the descriptor (`[]` when valid), `error` why the latest write
|
|
197
197
|
or text failed (a `BridgeError` or a `FieldError`, whose `kind` is `rejected`, `conflict`, `committed-with-error` or
|
|
198
198
|
`invalid-text`). `FieldError`, `FieldOptions`, `FieldState` and `BridgeField` are exported from this package. See the
|
|
199
|
-
[field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
199
|
+
[field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#fields) for the receipts
|
|
200
200
|
and text forms. An `invalid-text` error has a `reason` and `arguments`: render `useText(() => title.error)` after
|
|
201
201
|
`configureFieldErrorText` to show your own text for it in the window's language
|
|
202
|
-
([Translating field errors](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
202
|
+
([Translating field errors](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#translating-field-errors)).
|
|
203
203
|
|
|
204
204
|
#### Row cells and nested members
|
|
205
205
|
|
|
@@ -208,7 +208,7 @@ Since 0.16, `InvoiceFields.address.street` and `InvoiceFields.lines.at(line.id).
|
|
|
208
208
|
`useField` in the row's component (`v-model="quantity.text"`); `at(key)` returns the same descriptor for the same
|
|
209
209
|
key. Such a field always writes checked, conflicts only when another writer changed the same cell, and shows the
|
|
210
210
|
messages .NET reports at the cell's validation path. See
|
|
211
|
-
[Fields below a member and row cells](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
211
|
+
[Fields below a member and row cells](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/web/vue/../views/README.md#fields-below-a-member-and-row-cells).
|
|
212
212
|
|
|
213
213
|
### Forms: `useForm(fields, options?)`
|
|
214
214
|
|
|
@@ -223,7 +223,7 @@ const form = useForm({ title, step }, { dirty: () => editor.state.value?.isDirty
|
|
|
223
223
|
### Text inputs: `useTextField(view, read, write, options?)`
|
|
224
224
|
|
|
225
225
|
Binds a text input to a member through the framework-neutral
|
|
226
|
-
[text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
226
|
+
[text field controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#text-inputs)
|
|
227
227
|
while the effect scope is active. Each field is a ref, so the handle can be destructured:
|
|
228
228
|
|
|
229
229
|
```vue
|
|
@@ -291,7 +291,7 @@ const { state } = useView({ connect: connectWorkspace });
|
|
|
291
291
|
`satisfies ViewRegistry<…>` checks that every kind has a component whose `page`
|
|
292
292
|
prop accepts that reference. A component whose `page` is a shared page
|
|
293
293
|
reference, such as `ResultPagePageReference` of a .NET
|
|
294
|
-
[`[RunicSharedClient]`](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
294
|
+
[`[RunicSharedClient]`](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/web/vue/../../dotnet/Runic.Application.Views/README.md#shared-clients)
|
|
295
295
|
interface, registers for each of its kinds:
|
|
296
296
|
`{ ...registryEntries(resultPageKinds, ResultPage), settings: Settings }`.
|
|
297
297
|
|
|
@@ -396,7 +396,7 @@ neither.
|
|
|
396
396
|
## `useOperation(start, options?)`
|
|
397
397
|
|
|
398
398
|
Observes a generated `start<Command>()` operation through the framework-neutral
|
|
399
|
-
[operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
399
|
+
[operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#operation-feedback-and-latest-selection)
|
|
400
400
|
and returns each state field as a shallow ref, with `run`, `cancel` and `reset`:
|
|
401
401
|
|
|
402
402
|
```vue
|
|
@@ -428,7 +428,7 @@ Disposing the effect scope settles run promises without cancelling accepted work
|
|
|
428
428
|
|
|
429
429
|
Admits only the newest of several reads, for example loading the item the user
|
|
430
430
|
selected last, through the framework-neutral
|
|
431
|
-
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
431
|
+
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#operation-feedback-and-latest-selection),
|
|
432
432
|
and returns each state field as a shallow ref, with `run` and `clear`. Each
|
|
433
433
|
`run(intent)` replaces the queued intent and cancels the active read; the next read
|
|
434
434
|
starts only after the previous one reaches its terminal status and the intent's
|
|
@@ -465,7 +465,7 @@ from `@runic-artifex/views` (re-exported here since 0.11, with the
|
|
|
465
465
|
`BridgeConnectionState` and `BridgeConnectionOptions` types) and returns `{ state }`, a shallow ref holding a
|
|
466
466
|
`BridgeConnectionState`: `connecting`, `connected`, `reconnecting`, `lost` or `closed` (the
|
|
467
467
|
application closed the window, since 0.15; a closed set, see
|
|
468
|
-
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
468
|
+
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#connection-state)):
|
|
469
469
|
|
|
470
470
|
```vue
|
|
471
471
|
<script setup lang="ts">
|
|
@@ -488,7 +488,7 @@ development builds warn. An invalid `lostAfter` throws a `RangeError`.
|
|
|
488
488
|
Follows the declared menu bar of a Runic Desktop window that leaves it to the
|
|
489
489
|
page (`DesktopMenuBarPresentation.Page`) until the current effect scope is
|
|
490
490
|
disposed. It wraps `createMenuBarController` from `@runic-artifex/views` (see
|
|
491
|
-
[In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
491
|
+
[In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#in-page-menu-bar)) and returns `{ state, invoke, handleKeyDown }`: `state` is a shallow ref
|
|
492
492
|
of a `MenuBarState`, and the bar is rendered by the menubar component of the
|
|
493
493
|
application's own UI library. Runic ships no menubar component.
|
|
494
494
|
|
|
@@ -519,7 +519,7 @@ rendering creates no controller: `state` stays `connecting`.
|
|
|
519
519
|
### With Reka UI
|
|
520
520
|
|
|
521
521
|
Reka UI's `MenubarRoot` with `v-model` of the open menu; the
|
|
522
|
-
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
522
|
+
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/examples/notes-view-first#in-page-menu-bar) adds submenus, check and radio
|
|
523
523
|
items and is tested with real keys:
|
|
524
524
|
|
|
525
525
|
```vue
|
|
@@ -570,13 +570,16 @@ Shows a text reference that a ViewModel produced, such as a status line or a
|
|
|
570
570
|
validation error's `text`, in the window's language, and renders again when the
|
|
571
571
|
language changes. A string shows as it is; `null` and `undefined` show
|
|
572
572
|
`fallback`. Connect the page's Translations runtime once with
|
|
573
|
-
`configureTranslatedText` ([Translated text](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
573
|
+
`configureTranslatedText` ([Translated text](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/dotnet/Runic.Application.Views/README.md#translated-text)).
|
|
574
574
|
`useWindowLocale()` reads the window's locale.
|
|
575
575
|
|
|
576
576
|
`useTextLocale()` is the locale that text is shown in, as a ref. It is one ref
|
|
577
577
|
for the page and needs no effect scope, so the locale resolver can read it;
|
|
578
|
-
templates that call `m.*()` then render again on a language switch
|
|
579
|
-
`
|
|
578
|
+
templates that call `m.*()` then render again on a language switch, and in
|
|
579
|
+
`vite dev` with the Translations Vite plugin 0.12.0 or later also when you save
|
|
580
|
+
an edited message: the new text shows in place and components keep their state.
|
|
581
|
+
An added, removed or renamed message, or changed inputs or markup, still reload
|
|
582
|
+
the page ([Edited messages in `vite dev`](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/dotnet/Runic.Application.Views/README.md#translated-text)). `syncDocumentLocale()` keeps `<html lang dir>` on that locale:
|
|
580
583
|
|
|
581
584
|
```ts
|
|
582
585
|
// main.ts
|
|
@@ -597,7 +600,7 @@ The page's appearance as a ref that renders, computes and watches again when it
|
|
|
597
600
|
changes, while the calling component or effect scope lives: the colour scheme,
|
|
598
601
|
contrast and reduced motion of the page's engine, combined with the desktop's
|
|
599
602
|
text scale, accent colour, forced-colours palette, contrast and motion that a
|
|
600
|
-
Runic host pushes ([Appearance](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
603
|
+
Runic host pushes ([Appearance](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/web/views/README.md#appearance)). Every member is `null` under
|
|
601
604
|
server rendering.
|
|
602
605
|
|
|
603
606
|
```ts
|
|
@@ -622,7 +625,7 @@ const message = computed(() => describeBridgeError(error.value));
|
|
|
622
625
|
```
|
|
623
626
|
|
|
624
627
|
`instanceof` holds for errors from every copy of the package on the page.
|
|
625
|
-
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
628
|
+
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#errors-and-diagnostics)
|
|
626
629
|
lists the kinds. Any other value, such as an exception that your own connect
|
|
627
630
|
function or command callback throws, arrives unchanged.
|
|
628
631
|
|
|
@@ -669,10 +672,10 @@ application's own dialog.
|
|
|
669
672
|
departure before that is answered by the ViewModel's .NET fallback handler, or
|
|
670
673
|
fails closed without one.
|
|
671
674
|
|
|
672
|
-
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
675
|
+
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/dotnet/Runic.Application.Views.ReactiveUI/README.md#leave-confirmation-in-a-web-view)
|
|
673
676
|
has the .NET side and which View answers which departure. In a frontend test,
|
|
674
677
|
the generated mock's `interactions.<name>.request(input)` resolves with the
|
|
675
|
-
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
678
|
+
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#testing).
|
|
676
679
|
|
|
677
680
|
## View requests
|
|
678
681
|
|
|
@@ -708,14 +711,14 @@ the page painted the state the request was raised with, so the field of that
|
|
|
708
711
|
state is rendered; `signal` aborts when the handler is replaced or removed, the
|
|
709
712
|
client is disposed or the connection is lost. A request is never replayed: one
|
|
710
713
|
raised before the effect ran, or while the page is disconnected, is not
|
|
711
|
-
delivered later. See [View requests](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
714
|
+
delivered later. See [View requests](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#view-requests) for the rules, and in a frontend
|
|
712
715
|
test raise one with the generated mock's `requests.<name>.raise(input)` (the
|
|
713
|
-
[Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
716
|
+
[Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#testing)).
|
|
714
717
|
|
|
715
718
|
## `useCollectionViewport(options)`
|
|
716
719
|
|
|
717
720
|
Follows a fixed-row-height scroll container and returns `{ viewport, attach }`.
|
|
718
|
-
`viewport` is a shallow ref with the [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
721
|
+
`viewport` is a shallow ref with the [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#collectionviewportoptions)
|
|
719
722
|
range; `attach` is a function ref for the container. Bind it to a native element
|
|
720
723
|
such as a `<div>`: a component instance (`:ref="attach"` on a component) or a
|
|
721
724
|
non-HTML element detaches the viewport, and development builds warn. Pass a getter for the
|
|
@@ -739,7 +742,7 @@ watch(() => [viewport.value.start, viewport.value.size] as const, ([start, size]
|
|
|
739
742
|
|
|
740
743
|
## `useQueryCollection(collection, options)`
|
|
741
744
|
|
|
742
|
-
Follows a scroll container for a [query collection](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
745
|
+
Follows a scroll container for a [query collection](https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/views#query-collections) (`client.queries.{name}`), whose rows stay in .NET: it
|
|
743
746
|
loads the rows the container shows, with placeholders until they arrive, and lays them out with variable heights.
|
|
744
747
|
Pass the collection or a getter (`() => client.value?.queries.rows`) and the options. `viewport` is a ref of the
|
|
745
748
|
`QueryViewport` (`items` with `top` and `size`, `totalSize`, `total`, `query`, `loading`, `error`); bind `attach` to the
|
|
@@ -766,13 +769,13 @@ The package re-exports `installBackNavigation`, `installNavigationPath`,
|
|
|
766
769
|
`@runic-artifex/views` (since 0.16). Call the installs once where the page
|
|
767
770
|
starts, before or after mounting: the mouse's Back button and Alt+Left then go
|
|
768
771
|
back in the .NET window, and `#/customers/42` follows its path region. See
|
|
769
|
-
[Back and the URL](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
772
|
+
[Back and the URL](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/web/views/README.md#back-and-the-url).
|
|
770
773
|
|
|
771
774
|
## Hosted regions (experimental)
|
|
772
775
|
|
|
773
776
|
`RunicHostedRegion` from `@runic-artifex/vue/experimental` renders
|
|
774
777
|
`<runic-hosted-region>`, a region where the host application shows a hosted guest's
|
|
775
|
-
Window ([hosted regions](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
778
|
+
Window ([hosted regions](https://github.com/Runic-Artifex/runic-sdk/blob/v0.20.0/packages/web/vue/../views/README.md#hosted-regions-experimental)). Its `fallback` slot, scoped with the region's
|
|
776
779
|
`state`, shows while no guest page shows in it:
|
|
777
780
|
|
|
778
781
|
```vue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runic-artifex/vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Vue composables for generated Runic Views clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"vue": ">=3.5.30 <4",
|
|
38
|
-
"@runic-artifex/views": "0.
|
|
38
|
+
"@runic-artifex/views": "0.20.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@runic-artifex/views": "0.
|
|
41
|
+
"@runic-artifex/views": "0.20.0",
|
|
42
42
|
"esbuild": "0.28.2",
|
|
43
43
|
"happy-dom": "21.0.4",
|
|
44
44
|
"playwright-core": "1.63.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"url": "git+https://github.com/Runic-Artifex/runic-sdk.git",
|
|
56
56
|
"directory": "packages/web/vue"
|
|
57
57
|
},
|
|
58
|
-
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
58
|
+
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.20.0/packages/web/vue#readme",
|
|
59
59
|
"bugs": {
|
|
60
60
|
"url": "https://github.com/Runic-Artifex/runic-sdk/issues"
|
|
61
61
|
},
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"views",
|
|
66
66
|
"vue"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "8288005e35e9cc377ca280db1ab44b91582cd705"
|
|
69
69
|
}
|