doxum 0.1.22 → 0.1.23
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 -5
- package/dist/{advanced-CqrR_4dh.d.ts → advanced-CLJCWkHa.d.cts} +2 -2
- package/dist/{advanced-BTStm2cW.js → advanced-CRNHfJBu.js} +457 -425
- package/dist/advanced-CRNHfJBu.js.map +1 -0
- package/dist/{advanced-GKZ-CZ6a.cjs → advanced-Cle5g3B4.cjs} +590 -438
- package/dist/advanced-Cle5g3B4.cjs.map +1 -0
- package/dist/{advanced-CyR5o3Xr.d.cts → advanced-d6J61er9.d.ts} +2 -2
- package/dist/advanced.cjs +1 -1
- package/dist/advanced.d.cts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +1 -1
- package/dist/context-BcLKGfq8.cjs +149 -0
- package/dist/context-BcLKGfq8.cjs.map +1 -0
- package/dist/context-DFEaDUv5.js +84 -0
- package/dist/context-DFEaDUv5.js.map +1 -0
- package/dist/{contract-CxiNcqMn.d.ts → contract-SYJFP0lM.d.cts} +19 -75
- package/dist/{contract-CRrZ-3sF.d.cts → contract-ULPQmiEs.d.ts} +19 -75
- package/dist/driver-BD3DQOW6.cjs +382 -0
- package/dist/driver-BD3DQOW6.cjs.map +1 -0
- package/dist/{driver-BqRjwFmU.js → driver-yFfvDMX5.js} +155 -26
- package/dist/driver-yFfvDMX5.js.map +1 -0
- package/dist/index.cjs +2130 -529
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +2003 -403
- package/dist/index.js.map +1 -1
- package/dist/local-sync.cjs +5 -5
- package/dist/local-sync.cjs.map +1 -1
- package/dist/local-sync.d.cts +1 -1
- package/dist/local-sync.d.ts +1 -1
- package/dist/local-sync.js +2 -2
- package/dist/local-sync.js.map +1 -1
- package/dist/react.cjs +2 -70
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +0 -1
- package/dist/react.d.ts +1 -2
- package/dist/react.js +3 -71
- package/dist/react.js.map +1 -1
- package/package.json +1 -6
- package/skills/doxum-runtime/SKILL.md +2 -1
- package/skills/doxum-runtime/references/guide.en.md +8 -6
- package/skills/doxum-runtime/references/guide.zh-CN.md +7 -5
- package/skills/doxum-runtime/references/invariants.en.md +5 -3
- package/skills/doxum-runtime/references/invariants.zh-CN.md +4 -3
- package/dist/access-CZXv_DIF.js +0 -958
- package/dist/access-CZXv_DIF.js.map +0 -1
- package/dist/access-D64MFRSm.cjs +0 -1101
- package/dist/access-D64MFRSm.cjs.map +0 -1
- package/dist/advanced-BTStm2cW.js.map +0 -1
- package/dist/advanced-GKZ-CZ6a.cjs.map +0 -1
- package/dist/driver-BC06FEMF.cjs +0 -241
- package/dist/driver-BC06FEMF.cjs.map +0 -1
- package/dist/driver-BqRjwFmU.js.map +0 -1
- package/dist/integration-BqDw7e2w.cjs +0 -30
- package/dist/integration-BqDw7e2w.cjs.map +0 -1
- package/dist/integration-CSXaF8HP.js +0 -25
- package/dist/integration-CSXaF8HP.js.map +0 -1
- package/dist/integration.cjs +0 -13
- package/dist/integration.d.cts +0 -17
- package/dist/integration.d.ts +0 -17
- package/dist/integration.js +0 -5
- package/dist/issue-9U6YLYz3.js +0 -647
- package/dist/issue-9U6YLYz3.js.map +0 -1
- package/dist/issue-Bo0FIO3b.cjs +0 -886
- package/dist/issue-Bo0FIO3b.cjs.map +0 -1
- package/dist/notification-CrZHVx3a.js +0 -176
- package/dist/notification-CrZHVx3a.js.map +0 -1
- package/dist/notification-DFoA9bQY.cjs +0 -235
- package/dist/notification-DFoA9bQY.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -60,10 +60,14 @@ Committed observer failures are returned in `observerErrors` without rollback.
|
|
|
60
60
|
## Read And Observe
|
|
61
61
|
|
|
62
62
|
```ts
|
|
63
|
-
import { read, snapshot } from 'doxum';
|
|
63
|
+
import { read, select, snapshot } from 'doxum';
|
|
64
64
|
|
|
65
65
|
const title = read(document, state => state.title);
|
|
66
66
|
const tasks = read(document, state => snapshot(state.tasks));
|
|
67
|
+
const selectedTitle = select(document, state => state.title);
|
|
68
|
+
const stop = selectedTitle.subscribe(() => {
|
|
69
|
+
console.log(selectedTitle.current());
|
|
70
|
+
});
|
|
67
71
|
document.subscribe(
|
|
68
72
|
path => path.tasks.item('b').title,
|
|
69
73
|
commit => {
|
|
@@ -81,6 +85,10 @@ supported types, while classes/functions need application-specific handling.
|
|
|
81
85
|
Use ordinary properties for fine-grained reads. Data callbacks read real values;
|
|
82
86
|
path callbacks describe symbolic schema locations, including missing entries.
|
|
83
87
|
Subscription paths compile once during registration.
|
|
88
|
+
`select(document, selector, equality?)` returns a standard `Readable`. Core
|
|
89
|
+
tracks exactly the document locations read by the selector, rebinds dependencies
|
|
90
|
+
when selector branches change, and preserves the previous selected reference and
|
|
91
|
+
publication revision when `equality` reports no result change.
|
|
84
92
|
|
|
85
93
|
React integration:
|
|
86
94
|
|
|
@@ -91,9 +99,10 @@ const title = useDocumentSelector(document, state => state.title);
|
|
|
91
99
|
const history = useHistory(document.history);
|
|
92
100
|
```
|
|
93
101
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
capabilities while retaining selection,
|
|
102
|
+
Document dependency tracking belongs to Core's `select`; the React adapter only
|
|
103
|
+
subscribes to the resulting `Readable`. The core has no React dependency.
|
|
104
|
+
`asReadable(document)` removes write capabilities while retaining selection,
|
|
105
|
+
subscription and projection support.
|
|
97
106
|
|
|
98
107
|
## Containers And Parsing
|
|
99
108
|
|
|
@@ -395,7 +404,7 @@ It also reports structural generation advances and distinguishes captured order
|
|
|
395
404
|
baselines from final published order copies. Architecture workloads include order
|
|
396
405
|
round trips and repeated tree edits to expose costs hidden by commit-only benchmarks.
|
|
397
406
|
|
|
398
|
-
Builds produce root `dist` ESM/CJS/declarations for `doxum`,
|
|
407
|
+
Builds produce root `dist` ESM/CJS/declarations for `doxum`,
|
|
399
408
|
`doxum/local-sync`, `doxum/react` and `doxum/advanced`. Source ownership is described in
|
|
400
409
|
[architecture](docs/architecture.md) and [AGENTS.md](AGENTS.md).
|
|
401
410
|
The runtime shares one transaction lifecycle; complete mutation operations are
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as CollectionPath, K as ObjectNode, N as CollectionEntry, P as CollectionId, U as Infer, X as ReadonlyValue, Y as PathValueOf, Z as SchemaPath, _ as Unsubscribe, b as CollectionImpact, g as Readable, o as DocumentReadable, p as Synchronous } from "./contract-SYJFP0lM.cjs";
|
|
2
2
|
|
|
3
3
|
//#region core/src/projection/contract.d.ts
|
|
4
4
|
/** The one processor-facing collection transition protocol. */
|
|
@@ -173,4 +173,4 @@ declare const incremental: typeof createIncrementalValue & {
|
|
|
173
173
|
};
|
|
174
174
|
//#endregion
|
|
175
175
|
export { ProjectionError as C, ProjectionDisposedError as S, ExternalCollectionEvent as _, IncrementalGroupDefine as a, ExternalValueEvent as b, IncrementalValueContext as c, Input as d, Projection as f, CollectionChange as g, observe as h, IncrementalGroupContext as i, IncrementalValueProcessor as l, input as m, IncrementalCollectionContext as n, IncrementalGroupOutputTree as o, derive as p, IncrementalCollectionProcessor as r, IncrementalGroupProcessor as s, GroupProjections as t, incremental as u, ExternalCollectionRead as v, ExternalValueSource as x, ExternalCollectionSource as y };
|
|
176
|
-
//# sourceMappingURL=advanced-
|
|
176
|
+
//# sourceMappingURL=advanced-CLJCWkHa.d.cts.map
|