@runic-artifex/svelte 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 +14 -9
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -120,6 +120,11 @@ and `navigate.run("showWelcome")`. Called during component initialization, it
|
|
|
120
120
|
stops publishing state when the component is destroyed, even before its first
|
|
121
121
|
effect flush; a run in flight is not cancelled and its promise still settles.
|
|
122
122
|
|
|
123
|
+
`pending` covers only this component's run. Whether .NET can run the command is
|
|
124
|
+
the View's state: a command without an argument publishes `can<Name>` (such as
|
|
125
|
+
`state.canSave`), so disable a button while either says no. A command with an
|
|
126
|
+
argument has the `can<Name>(input)` query on the client instead.
|
|
127
|
+
|
|
123
128
|
For a command that declares a failure (`[RunicFailure]` in .NET), `run` resolves the
|
|
124
129
|
`BridgeOutcome`, and `failure` holds the declared failure of the latest run, typed
|
|
125
130
|
from the outcome, while `error` keeps unexpected failures. Starting a run and
|
|
@@ -169,7 +174,7 @@ Cancel and other callbacks responsive during observation.
|
|
|
169
174
|
## `useLatestOperation()`
|
|
170
175
|
|
|
171
176
|
For rapid read selection, `useLatestOperation()` wraps the framework-neutral
|
|
172
|
-
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
177
|
+
[latest-operation controller](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#operation-feedback-and-latest-selection)
|
|
173
178
|
for the component's lifetime. It coalesces the latest intent across delayed receipts
|
|
174
179
|
and orders the next admission after terminal observation and any application drain
|
|
175
180
|
barrier:
|
|
@@ -200,7 +205,7 @@ establish that replacement boundary and own the old work's drain. Lost terminal
|
|
|
200
205
|
observation blocks further Starts instead of retrying blindly, with its reason in
|
|
201
206
|
`error`; ordinary Cancel does not clear this block. Component destruction settles
|
|
202
207
|
observation without cancelling accepted work. The
|
|
203
|
-
[operations package consumer](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
208
|
+
[operations package consumer](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/tests/fixtures/application/operations-consumer)
|
|
204
209
|
runs this hook against the packed packages and the desktop transport.
|
|
205
210
|
|
|
206
211
|
## `useBridgeConnection(options?)`
|
|
@@ -210,7 +215,7 @@ from `@runic-artifex/views` (re-exported here since 0.11, with the
|
|
|
210
215
|
`BridgeConnectionState` and `BridgeConnectionOptions` types) and returns `{ state }`, a reactive
|
|
211
216
|
`BridgeConnectionState`: `connecting`, `connected`, `reconnecting` or `lost` (a
|
|
212
217
|
closed set, see
|
|
213
|
-
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
218
|
+
[Connection state](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#connection-state)):
|
|
214
219
|
|
|
215
220
|
```svelte
|
|
216
221
|
<script lang="ts">
|
|
@@ -232,7 +237,7 @@ server render does not observe, and destroying the owner unsubscribes. An invali
|
|
|
232
237
|
Follows the declared menu bar of a Runic Desktop window that leaves it to the
|
|
233
238
|
page (`DesktopMenuBarPresentation.Page`) while its owner lives. It wraps
|
|
234
239
|
`createMenuBarController` from `@runic-artifex/views` (see
|
|
235
|
-
[In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
240
|
+
[In-page menu bar](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#in-page-menu-bar)) and returns `{ state, invoke, handleKeyDown }`, where `state` is a
|
|
236
241
|
reactive `MenuBarState` property. The bar is rendered by the menubar component
|
|
237
242
|
of the application's own UI library. Runic ships no menubar component.
|
|
238
243
|
|
|
@@ -261,7 +266,7 @@ the `shortcuts: "app"` lease.
|
|
|
261
266
|
### With Bits UI
|
|
262
267
|
|
|
263
268
|
Bits UI's `Menubar.Root bind:value`; the
|
|
264
|
-
[Notes example](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
269
|
+
[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
|
|
265
270
|
items and is tested with real keys:
|
|
266
271
|
|
|
267
272
|
```svelte
|
|
@@ -325,7 +330,7 @@ const offline = view.error instanceof BridgeError && view.error.kind === "discon
|
|
|
325
330
|
```
|
|
326
331
|
|
|
327
332
|
`instanceof` holds for errors from every copy of the package on the page.
|
|
328
|
-
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
333
|
+
[Errors and diagnostics](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#errors-and-diagnostics)
|
|
329
334
|
lists the kinds. Any other value, such as an exception that your own connect
|
|
330
335
|
function or command callback throws, arrives unchanged.
|
|
331
336
|
|
|
@@ -364,15 +369,15 @@ application's own dialog.
|
|
|
364
369
|
departure before that is answered by the ViewModel's .NET fallback handler, or
|
|
365
370
|
fails closed without one.
|
|
366
371
|
|
|
367
|
-
The [ReactiveUI leave confirmation](https://github.com/Runic-Artifex/runic-sdk/blob/v0.
|
|
372
|
+
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)
|
|
368
373
|
has the .NET side and which View answers which departure. In a frontend test,
|
|
369
374
|
the generated mock's `interactions.<name>.request(input)` resolves with the
|
|
370
|
-
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
375
|
+
registered handler's answer; see the [Testing guide](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#testing).
|
|
371
376
|
|
|
372
377
|
## `useCollectionViewport(options)`
|
|
373
378
|
|
|
374
379
|
Follows a fixed-row-height scroll container and returns `{ viewport, attach }`.
|
|
375
|
-
`viewport` is the reactive [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
380
|
+
`viewport` is the reactive [`collectionViewport`](https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.0/packages/web/views#collectionviewportoptions)
|
|
376
381
|
range; `attach` is an attachment for the container. Call it during component
|
|
377
382
|
initialization and send the range to the ViewModel from an effect:
|
|
378
383
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runic-artifex/svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Svelte 5 Application Views helpers for Runic",
|
|
5
|
-
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.
|
|
5
|
+
"homepage": "https://github.com/Runic-Artifex/runic-sdk/tree/v0.12.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.
|
|
43
|
+
"@runic-artifex/views": "0.12.0"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
},
|
|
54
54
|
"packageManager": "bun@1.4.2",
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@runic-artifex/views": "0.
|
|
56
|
+
"@runic-artifex/views": "0.12.0",
|
|
57
57
|
"@sveltejs/adapter-static": "4.0.0",
|
|
58
58
|
"@sveltejs/kit": "3.0.0",
|
|
59
59
|
"@sveltejs/package": "3.0.0",
|
|
60
60
|
"@sveltejs/vite-plugin-svelte": "7.3.1",
|
|
61
61
|
"@types/node": "24.19.1",
|
|
62
|
-
"happy-dom": "^
|
|
62
|
+
"happy-dom": "^21.0.4",
|
|
63
63
|
"svelte": "5.57.1",
|
|
64
64
|
"svelte-check": "4.7.6",
|
|
65
65
|
"typescript": "6.0.3",
|
|
66
66
|
"vitest": "5.0.3",
|
|
67
67
|
"vite": "8.3.4"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "cb95ea2838ba61c7a24b9cda05bf5f0bd6fcc2d7"
|
|
70
70
|
}
|