@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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/client",
4
- "version": "0.1.18-rc.6",
5
- "generatedAt": "2026-08-18T14:48:00.521Z",
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, navigate, store. Auto-invoked when importing client framework primitives.
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.6"` in `dependencies`
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
- | `navigate` helpers | Programmatic navigation via the router service |
19
- | `module` helpers | Resolve modules by alias |
20
- | `store` helpers | Client store integration |
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 { navigate } from '@owlmeans/client'
36
- const navigateTo = navigate(context)
37
- navigateTo('/projects')
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`
@@ -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,kBAoD1B,CAAA"}
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
- params.query == null,
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
  ];
@@ -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,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IAER,SAAS,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IAElC,OAAO,OAA4B,CAAA;AACrC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/client",
3
- "version": "0.1.18-rc.6",
3
+ "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.6",
33
- "@owlmeans/client-entrypoint": "^0.1.18-rc.6",
34
- "@owlmeans/client-resource": "^0.1.18-rc.6",
35
- "@owlmeans/config": "^0.1.18-rc.6",
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.6",
39
- "@owlmeans/resource": "^0.1.18-rc.6",
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.6"
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
- params.query == null,
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
  ]