@owlmeans/client 0.1.18-rc.6 → 0.1.18-rc.8
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/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client/SKILL.md +40 -8
- package/build/store.d.ts.map +1 -1
- package/build/store.js +6 -1
- package/build/store.js.map +1 -1
- package/package.json +8 -8
- package/src/store.ts +6 -1
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/client",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.18-rc.8",
|
|
5
|
+
"generatedAt": "2026-08-24T21:14:00.123Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: client
|
|
3
|
-
description: How to use @owlmeans/client — platform-agnostic React client framework (works with web and React Native) providing context, components, services,
|
|
3
|
+
description: How to use @owlmeans/client — platform-agnostic React client framework (works with web and React Native) providing context, components, services, useNavigate/Navigator, RoutedComponent, store. Auto-invoked when importing client framework primitives or navigating between screens.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,16 +8,17 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/client
|
|
9
9
|
|
|
10
10
|
**Layer:** Client
|
|
11
|
-
**Install:** `"@owlmeans/client": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/client": "^0.1.18-rc.8"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
15
15
|
| Export | Description |
|
|
16
16
|
|--------|-------------|
|
|
17
17
|
| `App` / context helpers | Mount the React app, provide context |
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
18
|
+
| `useNavigate` | Hook returning the `Navigator` — programmatic navigation by entrypoint alias |
|
|
19
|
+
| `RoutedComponent` | Type of a component elevated on a frontend entrypoint (`{ alias, path, params, context }` props) |
|
|
20
|
+
| `entrypoint` helpers | Resolve entrypoints by alias |
|
|
21
|
+
| `useStoreModel` / `useStoreList` | React hooks over a `@owlmeans/state` resource — one record by id, or a live query. Not re-exported by `@owlmeans/web-client`; import them from here |
|
|
21
22
|
| `components` | Cross-platform components (e.g. error boundaries) |
|
|
22
23
|
| `value`, `debug` | Render-time helpers |
|
|
23
24
|
| Errors | Client-side typed errors |
|
|
@@ -31,12 +32,43 @@ user-invocable: false
|
|
|
31
32
|
|
|
32
33
|
This is the platform-agnostic substrate that `@owlmeans/web-client` (browser) and the native equivalent build on. Most apps import from `@owlmeans/web-client` directly; use `@owlmeans/client` only for cross-platform code.
|
|
33
34
|
|
|
35
|
+
Navigation addresses an ALIAS, never a URL — the path lives in the entrypoint declaration, so a
|
|
36
|
+
component never builds one. `useNavigate()` returns the `Navigator`:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { useNavigate } from '@owlmeans/client'
|
|
40
|
+
import type { RoutedComponent } from '@owlmeans/client'
|
|
41
|
+
|
|
42
|
+
export const ProjectScreen: RoutedComponent = ({ params }) => {
|
|
43
|
+
const nav = useNavigate()
|
|
44
|
+
|
|
45
|
+
// `go` navigates; `press` returns the handler for an onClick. `params` fills the path
|
|
46
|
+
// parameters of the target entrypoint, `query` the query string, `replace` swaps the
|
|
47
|
+
// history entry instead of pushing one.
|
|
48
|
+
void nav.go(PROJECT_ITEM, { params: { id: params.id }, query: { tab: 'files' } })
|
|
49
|
+
|
|
50
|
+
return <a onClick={nav.press(PROJECT_LIST)}>Back to the list</a>
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`nav.back()` / `nav.pressBack()` go one entry back, and `nav.location()` reads the current one.
|
|
55
|
+
An elevated screen receives `{ alias, path, params, context }` as props — read path parameters
|
|
56
|
+
from `params` and pass them down; a nested component never resolves route parameters itself.
|
|
57
|
+
|
|
58
|
+
## Client state
|
|
59
|
+
|
|
60
|
+
State lives on the context as a `@owlmeans/state` resource; these hooks subscribe to it.
|
|
61
|
+
|
|
34
62
|
```typescript
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
63
|
+
import { useStoreList, useStoreModel } from '@owlmeans/client'
|
|
64
|
+
|
|
65
|
+
const task = useStoreModel<Task>(id, TASK_STATE) // one record
|
|
66
|
+
const open = useStoreList<Task>({ query: { status: 'open' }, resource: TASK_STATE }) // live query
|
|
38
67
|
```
|
|
39
68
|
|
|
69
|
+
`useStoreModel` returns a `StateModel` — read `model.record`, write with `model.update({ ... })`.
|
|
70
|
+
Assigning to `model.record` directly is a silent no-op. Full contract: [[state]].
|
|
71
|
+
|
|
40
72
|
## Depends On
|
|
41
73
|
|
|
42
74
|
- `@owlmeans/client-context`, `@owlmeans/client-entrypoint`, `@owlmeans/client-route`
|
package/build/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,cAAc,EAAyB,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAI5G,eAAO,MAAM,aAAa,EAAE,cAQ3B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,cAAc,EAAyB,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAI5G,eAAO,MAAM,aAAa,EAAE,cAQ3B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,kBAyD1B,CAAA"}
|
package/build/store.js
CHANGED
|
@@ -26,7 +26,12 @@ export const useStoreList = (ids, opts) => {
|
|
|
26
26
|
const resource = useMemo(() => context.getStateResource(params.resource), [params.resource]);
|
|
27
27
|
const deps = [
|
|
28
28
|
Array.isArray(params.id) ? params.id.join(',') : params.id,
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The query's CONTENT, not merely whether one was given. A subscription is to the criteria,
|
|
31
|
+
* so a screen that narrows its filter has to re-subscribe — keyed on `query == null` it kept
|
|
32
|
+
* answering the first filter it ever saw, and nothing indicated the list had gone stale.
|
|
33
|
+
*/
|
|
34
|
+
JSON.stringify(params.query),
|
|
30
35
|
JSON.stringify(params.default),
|
|
31
36
|
params.listen
|
|
32
37
|
];
|
package/build/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,MAAM,CAAC,MAAM,aAAa,GAAmB,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;IACxD,MAAM,IAAI,GAAG,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IAEnC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,WAAW,CAAC,uDAAuD,CAAC,CAAA;IAChF,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAuB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IAC5D,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACnD,IAAI,GAAG,GAAG,CAAA;IACZ,CAAC;IACD,MAAM,MAAM,GAA0C,OAAO,IAAI,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
+
"version": "0.1.18-rc.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@owlmeans/auth": "^0.1.18-rc.6",
|
|
32
|
-
"@owlmeans/client-context": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
34
|
-
"@owlmeans/client-resource": "^0.1.18-rc.
|
|
35
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
32
|
+
"@owlmeans/client-context": "^0.1.18-rc.7",
|
|
33
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.7",
|
|
34
|
+
"@owlmeans/client-resource": "^0.1.18-rc.7",
|
|
35
|
+
"@owlmeans/config": "^0.1.18-rc.7",
|
|
36
36
|
"@owlmeans/context": "^0.1.18-rc.6",
|
|
37
37
|
"@owlmeans/error": "^0.1.18-rc.6",
|
|
38
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
39
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
38
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.7",
|
|
39
|
+
"@owlmeans/resource": "^0.1.18-rc.7",
|
|
40
40
|
"@owlmeans/router": "^0.1.18-rc.6",
|
|
41
|
-
"@owlmeans/state": "^0.1.18-rc.
|
|
41
|
+
"@owlmeans/state": "^0.1.18-rc.8"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@remix-run/router": "*",
|
package/src/store.ts
CHANGED
|
@@ -33,7 +33,12 @@ export const useStoreList: UseStoreListHelper = (ids, opts) => {
|
|
|
33
33
|
|
|
34
34
|
const deps = [
|
|
35
35
|
Array.isArray(params.id) ? params.id.join(',') : params.id,
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The query's CONTENT, not merely whether one was given. A subscription is to the criteria,
|
|
38
|
+
* so a screen that narrows its filter has to re-subscribe — keyed on `query == null` it kept
|
|
39
|
+
* answering the first filter it ever saw, and nothing indicated the list had gone stale.
|
|
40
|
+
*/
|
|
41
|
+
JSON.stringify(params.query),
|
|
37
42
|
JSON.stringify(params.default),
|
|
38
43
|
params.listen
|
|
39
44
|
]
|