dirvi-lib 0.11.0-beta.1 → 0.11.0-beta.13
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/dist/app/app-methods.d.ts +53 -0
- package/dist/app/app-methods.d.ts.map +1 -0
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/app/reducer/effect-to-action.d.ts +2 -2
- package/dist/app/reducer/effect-to-action.d.ts.map +1 -1
- package/dist/app/reducer/effect-to-action.js +87 -32
- package/dist/app/reducer/reducer-action.d.ts +12 -6
- package/dist/app/reducer/reducer-action.d.ts.map +1 -1
- package/dist/app/reducer/reducer.d.ts +4 -2
- package/dist/app/reducer/reducer.d.ts.map +1 -1
- package/dist/app/reducer/reducer.js +106 -72
- package/dist/feedback/feedback.impl.d.ts.map +1 -1
- package/dist/feedback/feedback.types.d.ts +1 -1
- package/dist/feedback/feedback.types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/input/application/intent-to-effect.d.ts +2 -2
- package/dist/input/application/intent-to-effect.d.ts.map +1 -1
- package/dist/input/application/intent-to-effect.js +10 -11
- package/dist/input/application/parse-ex-command.d.ts +17 -0
- package/dist/input/application/parse-ex-command.d.ts.map +1 -0
- package/dist/input/application/{parse-command.js → parse-ex-command.js} +84 -54
- package/dist/input/application/parse-normal-command.d.ts +1 -1
- package/dist/input/application/parse-normal-command.d.ts.map +1 -1
- package/dist/input/domain/effect.d.ts +20 -9
- package/dist/input/domain/effect.d.ts.map +1 -1
- package/dist/state-and-nav/cursor.d.ts +89 -0
- package/dist/state-and-nav/cursor.d.ts.map +1 -0
- package/dist/state-and-nav/cursor.js +84 -0
- package/dist/{trees → state-and-nav}/fold-node/deprecated/fold-node.impl.d.ts +1 -1
- package/dist/state-and-nav/fold-node/deprecated/fold-node.impl.d.ts.map +1 -0
- package/dist/state-and-nav/fold-node/deprecated/fold-node.test.d.ts.map +1 -0
- package/dist/{trees → state-and-nav}/fold-node/deprecated/fold-node.test.js +2 -2
- package/dist/{trees → state-and-nav}/fold-node/deprecated/fold-node.types.d.ts +2 -2
- package/dist/state-and-nav/fold-node/deprecated/fold-node.types.d.ts.map +1 -0
- package/dist/{trees → state-and-nav}/fold-node/fold-node.impl.d.ts +3 -3
- package/dist/state-and-nav/fold-node/fold-node.impl.d.ts.map +1 -0
- package/dist/{trees → state-and-nav}/fold-node/fold-node.impl.js +2 -2
- package/dist/{trees → state-and-nav}/fold-node/fold-node.model.d.ts +1 -1
- package/dist/state-and-nav/fold-node/fold-node.model.d.ts.map +1 -0
- package/dist/{trees → state-and-nav}/fold-node/fold-node.types.d.ts +2 -2
- package/dist/state-and-nav/fold-node/fold-node.types.d.ts.map +1 -0
- package/dist/state-and-nav/fold-node/index.d.ts.map +1 -0
- package/dist/state-and-nav/index.d.ts +16 -0
- package/dist/state-and-nav/index.d.ts.map +1 -0
- package/dist/state-and-nav/index.js +6 -0
- package/dist/state-and-nav/nav/nav.ordered.impl.d.ts +12 -0
- package/dist/state-and-nav/nav/nav.ordered.impl.d.ts.map +1 -0
- package/dist/state-and-nav/nav/nav.ordered.impl.js +77 -0
- package/dist/state-and-nav/nav/nav.traversal.d.ts +11 -0
- package/dist/state-and-nav/nav/nav.traversal.d.ts.map +1 -0
- package/dist/state-and-nav/nav/nav.traversal.js +204 -0
- package/dist/{trees/nav-node/nav-node.types.d.ts → state-and-nav/nav/nav.types.d.ts} +37 -23
- package/dist/state-and-nav/nav/nav.types.d.ts.map +1 -0
- package/dist/state-and-nav/nav/nav.unordered.impl.d.ts +13 -0
- package/dist/state-and-nav/nav/nav.unordered.impl.d.ts.map +1 -0
- package/dist/state-and-nav/nav/nav.unordered.impl.js +77 -0
- package/dist/state-and-nav/state/state.impl.d.ts +9 -0
- package/dist/state-and-nav/state/state.impl.d.ts.map +1 -0
- package/dist/{trees → state-and-nav}/state/state.impl.js +62 -9
- package/dist/state-and-nav/state/state.schemas.d.ts +2 -0
- package/dist/state-and-nav/state/state.schemas.d.ts.map +1 -0
- package/dist/state-and-nav/state/state.schemas.js +39 -0
- package/dist/state-and-nav/state/state.types.d.ts +72 -0
- package/dist/state-and-nav/state/state.types.d.ts.map +1 -0
- package/dist/state-and-nav/tree/deprecated/tree-node.arb.d.ts.map +1 -0
- package/dist/state-and-nav/tree/deprecated/tree-node.arb.debug.test.d.ts.map +1 -0
- package/dist/state-and-nav/tree/deprecated/tree-node.impl.d.ts.map +1 -0
- package/dist/state-and-nav/tree/deprecated/tree-node.schemas.d.ts.map +1 -0
- package/dist/state-and-nav/tree/deprecated/tree-node.test.d.ts.map +1 -0
- package/dist/state-and-nav/tree/deprecated/tree-node.types.d.ts.map +1 -0
- package/dist/state-and-nav/tree/index.d.ts +7 -0
- package/dist/state-and-nav/tree/index.d.ts.map +1 -0
- package/dist/state-and-nav/tree/index.js +1 -0
- package/dist/state-and-nav/tree/tree-node.arb.d.ts +94 -0
- package/dist/state-and-nav/tree/tree-node.arb.d.ts.map +1 -0
- package/dist/state-and-nav/tree/tree-node.arb.debug.test.d.ts +2 -0
- package/dist/state-and-nav/tree/tree-node.arb.debug.test.d.ts.map +1 -0
- package/dist/state-and-nav/tree/tree-node.arb.debug.test.js +54 -0
- package/dist/state-and-nav/tree/tree-node.arb.js +188 -0
- package/dist/state-and-nav/tree/tree-node.model.d.ts +194 -0
- package/dist/state-and-nav/tree/tree-node.model.d.ts.map +1 -0
- package/dist/state-and-nav/tree/tree-node.model.js +110 -0
- package/dist/state-and-nav/tree/tree-node.test.d.ts +2 -0
- package/dist/state-and-nav/tree/tree-node.test.d.ts.map +1 -0
- package/dist/state-and-nav/tree/tree-node.test.js +234 -0
- package/dist/{trees/tree-node/tree-node.impl.d.ts → state-and-nav/tree/tree.impl.d.ts} +3 -3
- package/dist/state-and-nav/tree/tree.impl.d.ts.map +1 -0
- package/dist/{trees/tree-node/tree-node.impl.js → state-and-nav/tree/tree.impl.js} +20 -17
- package/dist/{trees/tree-node/tree-node.types.d.ts → state-and-nav/tree/tree.types.d.ts} +67 -47
- package/dist/state-and-nav/tree/tree.types.d.ts.map +1 -0
- package/dist/state-and-nav/tree/tree.types.js +1 -0
- package/package.json +3 -2
- package/dist/app/app-api.d.ts +0 -74
- package/dist/app/app-api.d.ts.map +0 -1
- package/dist/app/app-api.js +0 -11
- package/dist/input/application/parse-command.d.ts +0 -14
- package/dist/input/application/parse-command.d.ts.map +0 -1
- package/dist/trees/cursor.d.ts +0 -59
- package/dist/trees/cursor.d.ts.map +0 -1
- package/dist/trees/cursor.js +0 -55
- package/dist/trees/fold-node/deprecated/fold-node.impl.d.ts.map +0 -1
- package/dist/trees/fold-node/deprecated/fold-node.test.d.ts.map +0 -1
- package/dist/trees/fold-node/deprecated/fold-node.types.d.ts.map +0 -1
- package/dist/trees/fold-node/fold-node.impl.d.ts.map +0 -1
- package/dist/trees/fold-node/fold-node.model.d.ts.map +0 -1
- package/dist/trees/fold-node/fold-node.types.d.ts.map +0 -1
- package/dist/trees/fold-node/index.d.ts.map +0 -1
- package/dist/trees/index.d.ts +0 -9
- package/dist/trees/index.d.ts.map +0 -1
- package/dist/trees/index.js +0 -8
- package/dist/trees/nav-node/nav-node.impl.d.ts +0 -29
- package/dist/trees/nav-node/nav-node.impl.d.ts.map +0 -1
- package/dist/trees/nav-node/nav-node.impl.js +0 -223
- package/dist/trees/nav-node/nav-node.types.d.ts.map +0 -1
- package/dist/trees/state/state.impl.d.ts +0 -8
- package/dist/trees/state/state.impl.d.ts.map +0 -1
- package/dist/trees/state/state.schemas.d.ts +0 -25
- package/dist/trees/state/state.schemas.d.ts.map +0 -1
- package/dist/trees/state/state.schemas.js +0 -17
- package/dist/trees/state/state.types.d.ts +0 -36
- package/dist/trees/state/state.types.d.ts.map +0 -1
- package/dist/trees/tree-node/deprecated/tree-node.arb.d.ts.map +0 -1
- package/dist/trees/tree-node/deprecated/tree-node.arb.debug.test.d.ts.map +0 -1
- package/dist/trees/tree-node/deprecated/tree-node.impl.d.ts.map +0 -1
- package/dist/trees/tree-node/deprecated/tree-node.schemas.d.ts.map +0 -1
- package/dist/trees/tree-node/deprecated/tree-node.test.d.ts.map +0 -1
- package/dist/trees/tree-node/deprecated/tree-node.types.d.ts.map +0 -1
- package/dist/trees/tree-node/index.d.ts +0 -5
- package/dist/trees/tree-node/index.d.ts.map +0 -1
- package/dist/trees/tree-node/index.js +0 -2
- package/dist/trees/tree-node/tree-node.arb.d.ts +0 -104
- package/dist/trees/tree-node/tree-node.arb.d.ts.map +0 -1
- package/dist/trees/tree-node/tree-node.arb.js +0 -188
- package/dist/trees/tree-node/tree-node.impl.d.ts.map +0 -1
- package/dist/trees/tree-node/tree-node.model.d.ts +0 -78
- package/dist/trees/tree-node/tree-node.model.d.ts.map +0 -1
- package/dist/trees/tree-node/tree-node.model.js +0 -37
- package/dist/trees/tree-node/tree-node.types.d.ts.map +0 -1
- /package/dist/{trees/fold-node/deprecated/fold-node.types.js → app/app-methods.js} +0 -0
- /package/dist/{trees → state-and-nav}/fold-node/deprecated/fold-node.impl.js +0 -0
- /package/dist/{trees → state-and-nav}/fold-node/deprecated/fold-node.test.d.ts +0 -0
- /package/dist/{trees/fold-node → state-and-nav/fold-node/deprecated}/fold-node.types.js +0 -0
- /package/dist/{trees → state-and-nav}/fold-node/fold-node.model.js +0 -0
- /package/dist/{trees/nav-node/nav-node.types.js → state-and-nav/fold-node/fold-node.types.js} +0 -0
- /package/dist/{trees → state-and-nav}/fold-node/index.d.ts +0 -0
- /package/dist/{trees → state-and-nav}/fold-node/index.js +0 -0
- /package/dist/{trees/state/state.types.js → state-and-nav/nav/nav.types.js} +0 -0
- /package/dist/{trees/tree-node/deprecated/tree-node.types.js → state-and-nav/state/state.types.js} +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.arb.d.ts +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.arb.debug.test.d.ts +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.arb.debug.test.js +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.arb.js +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.impl.d.ts +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.impl.js +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.schemas.d.ts +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.schemas.js +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.test.d.ts +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.test.js +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree}/deprecated/tree-node.types.d.ts +0 -0
- /package/dist/{trees/tree-node → state-and-nav/tree/deprecated}/tree-node.types.js +0 -0
|
@@ -25,7 +25,7 @@ declare const treeNodeBrand: unique symbol;
|
|
|
25
25
|
* @remarks
|
|
26
26
|
*
|
|
27
27
|
* `TreeNode` is intentionally opaque. Callers may hold, compare by reference,
|
|
28
|
-
* pass, store, and return nodes, but should use {@link
|
|
28
|
+
* pass, store, and return nodes, but should use {@link TreeMethods} operations
|
|
29
29
|
* to create, inspect, and update them.
|
|
30
30
|
*
|
|
31
31
|
* In particular, callers do not depend on:
|
|
@@ -111,14 +111,14 @@ export type TreeNodeKind = 'leaf' | 'unloaded-branch' | 'loaded-branch';
|
|
|
111
111
|
*
|
|
112
112
|
* @remarks
|
|
113
113
|
*
|
|
114
|
-
* `
|
|
115
|
-
*
|
|
116
|
-
*
|
|
114
|
+
* `MatchByKind` provides exhaustive pattern matching over the node's semantic
|
|
115
|
+
* state. It is the preferred operation when behavior differs between leaves,
|
|
116
|
+
* unloaded branches, and loaded branches:
|
|
117
117
|
*
|
|
118
118
|
* - `leaf` receives no `children`, because a leaf cannot have children;
|
|
119
119
|
* - `unloadedBranch` receives no `children`, because its children are not loaded;
|
|
120
|
-
* - `loadedBranch` receives an iterable of loaded direct child nodes
|
|
121
|
-
*
|
|
120
|
+
* - `loadedBranch` receives an iterable of loaded direct child nodes in
|
|
121
|
+
* child order.
|
|
122
122
|
*
|
|
123
123
|
* Every handler must return the same `Result` type.
|
|
124
124
|
*
|
|
@@ -129,7 +129,7 @@ export type TreeNodeKind = 'leaf' | 'unloaded-branch' | 'loaded-branch';
|
|
|
129
129
|
* @example
|
|
130
130
|
*
|
|
131
131
|
* ```ts
|
|
132
|
-
* const label = api.
|
|
132
|
+
* const label = api.matchByKind(node, {
|
|
133
133
|
* leaf: ({ value }) => value.label,
|
|
134
134
|
*
|
|
135
135
|
* unloadedBranch: ({ value }) => `${value.label} (loading…)`,
|
|
@@ -146,7 +146,7 @@ export type TreeNodeKind = 'leaf' | 'unloaded-branch' | 'loaded-branch';
|
|
|
146
146
|
* });
|
|
147
147
|
* ```
|
|
148
148
|
*/
|
|
149
|
-
export type
|
|
149
|
+
export type MatchByKind<Id extends SerializableKey, Value, Result> = Readonly<{
|
|
150
150
|
leaf: (node: Readonly<{
|
|
151
151
|
id: Id;
|
|
152
152
|
value: Value;
|
|
@@ -168,12 +168,16 @@ export type TreeNodeMatch<Id extends SerializableKey, Value, Result> = Readonly<
|
|
|
168
168
|
*
|
|
169
169
|
* A `TreeNodeApi` is specialized to one ID type and one application-value
|
|
170
170
|
* type. It owns the structural tree rules: leaf/branch state, child loading
|
|
171
|
-
* state, sibling-ID uniqueness, and immutable ancestor
|
|
171
|
+
* state, child order, sibling-ID uniqueness, and immutable ancestor
|
|
172
|
+
* reconstruction.
|
|
172
173
|
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
174
|
+
* Loaded children form an ordered sequence. Construction and child-replacement
|
|
175
|
+
* operations preserve the supplied iterable's iteration order. Inspection
|
|
176
|
+
* operations expose children in that order, and model conversion preserves it.
|
|
177
|
+
* Replacing a descendant retains its position among siblings.
|
|
178
|
+
*
|
|
179
|
+
* The backing representation is private; these ordering guarantees do not
|
|
180
|
+
* require callers to depend on a particular storage structure.
|
|
177
181
|
*
|
|
178
182
|
* Tree nodes are plain immutable values at runtime. Update operations do not
|
|
179
183
|
* mutate supplied nodes or their loaded child collections. When an update
|
|
@@ -191,19 +195,19 @@ export type TreeNodeMatch<Id extends SerializableKey, Value, Result> = Readonly<
|
|
|
191
195
|
*
|
|
192
196
|
* the root is addressed by `[]`, and `child` is addressed by `['child']`.
|
|
193
197
|
*
|
|
194
|
-
* Paths cannot pass through leaves or
|
|
195
|
-
* selected as the final node in a path, but its unloaded descendants cannot
|
|
196
|
-
* addressed.
|
|
198
|
+
* Paths cannot pass through leaves or unloaded branches. An unloaded branch may
|
|
199
|
+
* be selected as the final node in a path, but its unloaded descendants cannot
|
|
200
|
+
* be addressed.
|
|
197
201
|
*
|
|
198
202
|
* @typeParam Id - The type used to identify nodes among siblings.
|
|
199
203
|
* @typeParam Value - The application-specific value stored at each node.
|
|
200
204
|
*/
|
|
201
|
-
export type
|
|
205
|
+
export type TreeMethods<Id extends SerializableKey, Value> = Readonly<{
|
|
202
206
|
/**
|
|
203
207
|
* Creates a leaf node.
|
|
204
208
|
*
|
|
205
209
|
* A leaf cannot contain children. To convert an existing node to a leaf while
|
|
206
|
-
* retaining its ID and value, use {@link
|
|
210
|
+
* retaining its ID and value, use {@link TreeMethods.toLeaf}.
|
|
207
211
|
*
|
|
208
212
|
* @param id - The ID that identifies this node among its siblings.
|
|
209
213
|
* @param value - Application-owned data stored on the node.
|
|
@@ -219,7 +223,13 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
219
223
|
*/
|
|
220
224
|
createUnloadedBranch(id: Id, value: Value): TreeNode<Id, Value>;
|
|
221
225
|
/**
|
|
222
|
-
* Creates a branch with
|
|
226
|
+
* Creates a branch with an ordered, loaded child collection.
|
|
227
|
+
*
|
|
228
|
+
* Children are copied in the supplied iterable's iteration order. Subsequent
|
|
229
|
+
* changes to the supplied collection do not affect the created branch.
|
|
230
|
+
*
|
|
231
|
+
* Direct siblings must have unique IDs. Returns `undefined` if the supplied
|
|
232
|
+
* children contain duplicate sibling IDs.
|
|
223
233
|
*
|
|
224
234
|
* An empty child collection creates a loaded branch with no current children;
|
|
225
235
|
* it does not create a leaf.
|
|
@@ -245,7 +255,7 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
245
255
|
/**
|
|
246
256
|
* Returns the semantic kind of a node.
|
|
247
257
|
*
|
|
248
|
-
* Prefer {@link
|
|
258
|
+
* Prefer {@link TreeMethods.matchByKind} when behavior differs by node kind and all
|
|
249
259
|
* three variants must be handled.
|
|
250
260
|
*
|
|
251
261
|
* @param node - The node to inspect.
|
|
@@ -256,24 +266,24 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
256
266
|
* Inspects a node by handling its semantic state exhaustively.
|
|
257
267
|
*
|
|
258
268
|
* @param node - The node to inspect.
|
|
259
|
-
* @param handlers - Case handlers for leaf,
|
|
269
|
+
* @param handlers - Case handlers for leaf, and unloaded/loaded branch
|
|
260
270
|
* states.
|
|
261
271
|
* @returns The value returned by the selected case handler.
|
|
262
272
|
*/
|
|
263
|
-
|
|
273
|
+
matchByKind<Result>(node: TreeNode<Id, Value>, handlers: MatchByKind<Id, Value, Result>): Result;
|
|
264
274
|
/**
|
|
265
|
-
* Returns the loaded direct children of a loaded branch.
|
|
275
|
+
* Returns the loaded direct children of a loaded branch in child order.
|
|
266
276
|
*
|
|
267
|
-
* The returned child nodes are existing values,
|
|
268
|
-
*
|
|
277
|
+
* The returned iterable is reusable. Its child nodes are existing values,
|
|
278
|
+
* not defensive clones.
|
|
269
279
|
*
|
|
270
280
|
* Returns `undefined` when `node` is a leaf or an unloaded branch. Use
|
|
271
|
-
* {@link
|
|
281
|
+
* {@link TreeMethods.kind} or {@link TreeMethods.matchByKind} when those cases need
|
|
272
282
|
* to be distinguished.
|
|
273
283
|
*
|
|
274
284
|
* @param node - The node whose direct children to inspect.
|
|
275
285
|
* @returns An iterable of loaded direct children, or `undefined` when children
|
|
276
|
-
* are unavailable because `node` is a leaf or
|
|
286
|
+
* are unavailable because `node` is a leaf or unloaded branch.
|
|
277
287
|
*/
|
|
278
288
|
getLoadedChildren(node: TreeNode<Id, Value>): Iterable<TreeNode<Id, Value>> | undefined;
|
|
279
289
|
/**
|
|
@@ -284,16 +294,16 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
284
294
|
*
|
|
285
295
|
* @param node - The node whose loaded direct children to search.
|
|
286
296
|
* @param id - The sibling ID to find.
|
|
287
|
-
* @returns The existing matching child, or `undefined` when `node` is not
|
|
288
|
-
*
|
|
297
|
+
* @returns The existing matching child, or `undefined` when `node` is not a
|
|
298
|
+
* loaded branch or does not have a direct child with `id`.
|
|
289
299
|
*/
|
|
290
300
|
findChildById(node: TreeNode<Id, Value>, id: Id): TreeNode<Id, Value> | undefined;
|
|
291
301
|
/**
|
|
292
302
|
* Returns an equivalent node with replacement application data.
|
|
293
303
|
*
|
|
294
304
|
* The returned node retains the original node's ID, semantic child state,
|
|
295
|
-
* and when applicable, existing child-node references.
|
|
296
|
-
* not mutated.
|
|
305
|
+
* and when applicable, child order and existing child-node references.
|
|
306
|
+
* The supplied node is not mutated.
|
|
297
307
|
*
|
|
298
308
|
* @param node - The node to update.
|
|
299
309
|
* @param value - Replacement application-owned data.
|
|
@@ -317,17 +327,18 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
317
327
|
* Any currently loaded child collection is discarded.
|
|
318
328
|
*
|
|
319
329
|
* @param node - The node to convert.
|
|
320
|
-
* @returns
|
|
330
|
+
* @returns An unloaded branch with the source node's ID and value.
|
|
321
331
|
*/
|
|
322
332
|
toUnloadedBranch(node: TreeNode<Id, Value>): TreeNode<Id, Value>;
|
|
323
333
|
/**
|
|
324
|
-
* Converts a node to
|
|
334
|
+
* Converts a node to a loaded branch with replacement children.
|
|
325
335
|
*
|
|
326
336
|
* The returned node retains the source node's ID and application value.
|
|
327
337
|
* Any previous child state is replaced.
|
|
328
338
|
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
339
|
+
* Children are copied in the supplied iterable's iteration order. That order
|
|
340
|
+
* becomes the replacement child order. Subsequent changes to the supplied
|
|
341
|
+
* collection do not affect the returned node.
|
|
331
342
|
*
|
|
332
343
|
* Direct siblings must have unique IDs. If two or more supplied children have
|
|
333
344
|
* the same ID, no replacement node is created and this method returns
|
|
@@ -338,8 +349,8 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
338
349
|
* @param node - The node to convert or update.
|
|
339
350
|
* @param children - Replacement loaded direct children. Their IDs must be
|
|
340
351
|
* unique among direct siblings.
|
|
341
|
-
* @returns
|
|
342
|
-
* when `children` contains duplicate sibling IDs.
|
|
352
|
+
* @returns A loaded branch with the source node's ID and value, or
|
|
353
|
+
* `undefined` when `children` contains duplicate sibling IDs.
|
|
343
354
|
*/
|
|
344
355
|
withLoadedChildren(node: TreeNode<Id, Value>, children: Iterable<TreeNode<Id, Value>>): TreeNode<Id, Value> | undefined;
|
|
345
356
|
/**
|
|
@@ -361,7 +372,7 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
361
372
|
* selected node is supplied as the existing node value and is not cloned.
|
|
362
373
|
*
|
|
363
374
|
* An empty path selects `root`. Resolution fails when a path refers to a
|
|
364
|
-
* missing child or attempts to pass through a leaf or
|
|
375
|
+
* missing child or attempts to pass through a leaf or an unloaded branch.
|
|
365
376
|
*
|
|
366
377
|
* @param root - The root node relative to which `path` is interpreted.
|
|
367
378
|
* @param path - A sibling-ID path relative to `root`.
|
|
@@ -373,40 +384,49 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
373
384
|
/**
|
|
374
385
|
* Immutably replaces the node addressed by a path relative to `root`.
|
|
375
386
|
*
|
|
376
|
-
* The
|
|
377
|
-
* `undefined` aborts the operation and causes this method to return
|
|
387
|
+
* The update callback runs only after the complete path has been resolved.
|
|
388
|
+
* Returning `undefined` aborts the operation and causes this method to return
|
|
378
389
|
* `undefined`.
|
|
379
390
|
*
|
|
380
391
|
* An empty path selects `root`. When a descendant is replaced, replacement
|
|
381
392
|
* nodes are created only along the path from `root` to that descendant. Nodes
|
|
382
393
|
* outside that path retain their original object identity.
|
|
383
394
|
*
|
|
384
|
-
* The
|
|
395
|
+
* The `update` may return a node with a different ID. If it does, the
|
|
385
396
|
* replacement is subsequently addressed by its new ID rather than the old
|
|
386
|
-
* path segment.
|
|
397
|
+
* path segment. The replacement retains the original node's position among
|
|
398
|
+
* siblings, and all other siblings retain their relative order.
|
|
387
399
|
*
|
|
388
400
|
* The update also fails when the replacement node's ID duplicates the ID of
|
|
389
|
-
* one of its new siblings. This can occur when `
|
|
401
|
+
* one of its new siblings. This can occur when `update` returns a node with
|
|
390
402
|
* a different ID.
|
|
391
403
|
*
|
|
392
404
|
* @param root - The root node relative to which `path` is interpreted.
|
|
393
405
|
* @param path - A sibling-ID path relative to `root`.
|
|
394
406
|
* @param update - Produces a replacement node, or `undefined` to abort.
|
|
395
407
|
* @returns A replacement root, or `undefined` when the path cannot be
|
|
396
|
-
* resolved, `
|
|
408
|
+
* resolved, `update` aborts, or the replacement would create duplicate
|
|
397
409
|
* sibling IDs.
|
|
398
410
|
*/
|
|
399
411
|
updateAtPath(root: TreeNode<Id, Value>, path: readonly Id[], update: (node: TreeNode<Id, Value>) => TreeNode<Id, Value> | undefined): TreeNode<Id, Value> | undefined;
|
|
400
412
|
/**
|
|
401
413
|
* Converts an opaque runtime node into a public structural model.
|
|
402
414
|
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
415
|
+
* Creates fresh model objects and child arrays recursively, preserving child
|
|
416
|
+
* order at every loaded branch. Application-owned values are retained by
|
|
417
|
+
* reference, not cloned; callers must treat those values as immutable.
|
|
418
|
+
*
|
|
419
|
+
* The model is suitable for JSON serialization when `Id` and `Value` are
|
|
420
|
+
* JSON-serializable.
|
|
405
421
|
*/
|
|
406
422
|
toModel(node: TreeNode<Id, Value>): TreeNodeModel<Id, Value>;
|
|
407
423
|
/**
|
|
408
424
|
* Constructs an opaque tree from a public structural model.
|
|
409
425
|
*
|
|
426
|
+
* Creates new runtime nodes and child collections, preserving child order
|
|
427
|
+
* at every loaded branch. Application-owned values are retained by reference,
|
|
428
|
+
* not cloned.
|
|
429
|
+
*
|
|
410
430
|
* Returns `undefined` if any loaded child collection contains duplicate
|
|
411
431
|
* sibling IDs.
|
|
412
432
|
*
|
|
@@ -416,4 +436,4 @@ export type TreeNodeApi<Id extends SerializableKey, Value> = Readonly<{
|
|
|
416
436
|
fromModel(model: TreeNodeModel<Id, Value>): TreeNode<Id, Value> | undefined;
|
|
417
437
|
}>;
|
|
418
438
|
export {};
|
|
419
|
-
//# sourceMappingURL=tree
|
|
439
|
+
//# sourceMappingURL=tree.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.types.d.ts","sourceRoot":"","sources":["../../../src/state-and-nav/tree/tree.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE3E;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,CAAC,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,MAAM,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,IAAI;IACxD;;;;;;;;OAQG;IACH,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE;QACxB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;QAChB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;KACvB,CAAC;CACH,CAAC;AAEF;;;;;;;;;;;;;;;;;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IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAE7D;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,SAAS,CAAC;CAC7E,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dirvi-lib",
|
|
3
|
-
"version": "0.11.0-beta.
|
|
3
|
+
"version": "0.11.0-beta.13",
|
|
4
4
|
"description": "Dependency for dirvi.",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"zod": "^4.4.3"
|
|
13
|
+
"zod": "^4.4.3",
|
|
14
|
+
"dirvi-apis": "0.11.0-beta.13"
|
|
14
15
|
},
|
|
15
16
|
"devDependencies": {
|
|
16
17
|
"@types/node": "^22.0.0",
|
package/dist/app/app-api.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { ViewApi } from './view-api.js';
|
|
2
|
-
import type { CursorApi, FoldsApi, NavNodeApi, SerializableKey, State, StateApi, TreeNode, TreeNodeApi } from '../trees/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Application-specific tree dependencies and operations.
|
|
5
|
-
*
|
|
6
|
-
* This is currently migrated through the generic TreeNode and State APIs.
|
|
7
|
-
* Navigation-specific APIs remain outside this type until NavNodeApi has been
|
|
8
|
-
* migrated from the old structural TreeNode API.
|
|
9
|
-
*
|
|
10
|
-
* @typeParam Id - The sibling-unique tree-node ID type.
|
|
11
|
-
* @typeParam Value - Application-owned data stored in each tree node.
|
|
12
|
-
* @typeParam ViewKey - The key used to identify view implementations.
|
|
13
|
-
*/
|
|
14
|
-
export type AppApi<Id extends SerializableKey, Value, ViewKey = string> = Readonly<{
|
|
15
|
-
/**
|
|
16
|
-
* Name used to distinguish the application, for example `posix` for a
|
|
17
|
-
* POSIX-directory application.
|
|
18
|
-
*/
|
|
19
|
-
appId: string;
|
|
20
|
-
/**
|
|
21
|
-
* Name used to distinguish a particular application instance.
|
|
22
|
-
*/
|
|
23
|
-
name: string;
|
|
24
|
-
/**
|
|
25
|
-
* ID used for the application's root node.
|
|
26
|
-
*/
|
|
27
|
-
rootId: Id;
|
|
28
|
-
/**
|
|
29
|
-
* Loads direct children for the branch addressed by `path`.
|
|
30
|
-
*
|
|
31
|
-
* Returned nodes must be opaque tree values created or decoded through this
|
|
32
|
-
* application's TreeNodeApi specialization.
|
|
33
|
-
*/
|
|
34
|
-
loadBranches: (path: readonly Id[]) => Promise<readonly TreeNode<Id, Value>[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Creates the application's root node.
|
|
37
|
-
*
|
|
38
|
-
* Invariant: the returned node is an open branch. That invariant is checked
|
|
39
|
-
* when an initial State is created.
|
|
40
|
-
*/
|
|
41
|
-
createRoot: () => Promise<TreeNode<Id, Value>>;
|
|
42
|
-
/**
|
|
43
|
-
* Subscribes to external data changes that require tree state to be loaded
|
|
44
|
-
* again.
|
|
45
|
-
*
|
|
46
|
-
* Returns an unsubscribe function.
|
|
47
|
-
*/
|
|
48
|
-
subscribeToResync: (listener: () => void) => () => void;
|
|
49
|
-
/**
|
|
50
|
-
* Generic structural operations for this application's buffer tree.
|
|
51
|
-
*/
|
|
52
|
-
treeNodeApi: TreeNodeApi<Id, Value>;
|
|
53
|
-
/**
|
|
54
|
-
* Semantic fold-state operations.
|
|
55
|
-
*
|
|
56
|
-
* This remains temporarily available while FoldNode itself is migrated.
|
|
57
|
-
*/
|
|
58
|
-
foldsApi: FoldsApi<Id>;
|
|
59
|
-
cursorApi: CursorApi<Id>;
|
|
60
|
-
stateApi: StateApi<Id, Value>;
|
|
61
|
-
/**
|
|
62
|
-
* UI navigation projection and cursor-navigation operations.
|
|
63
|
-
*/
|
|
64
|
-
navNodeApi: NavNodeApi<Id, Value>;
|
|
65
|
-
viewKey: ViewKey;
|
|
66
|
-
viewApi: ViewApi<State<Id, Value>, ViewKey>;
|
|
67
|
-
}>;
|
|
68
|
-
export type AppStateApis<Id extends SerializableKey, Value> = Readonly<{
|
|
69
|
-
treeNodeApi: TreeNodeApi<Id, Value>;
|
|
70
|
-
cursorApi: CursorApi<Id>;
|
|
71
|
-
stateApi: StateApi<Id, Value>;
|
|
72
|
-
}>;
|
|
73
|
-
export declare function createAppStateApis<Id extends SerializableKey, Value>(): AppStateApis<Id, Value>;
|
|
74
|
-
//# sourceMappingURL=app-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-api.d.ts","sourceRoot":"","sources":["../../src/app/app-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,eAAe,EACf,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAO3B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,MAAM,CAChB,EAAE,SAAS,eAAe,EAC1B,KAAK,EACL,OAAO,GAAG,MAAM,IACd,QAAQ,CAAC;IACX;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;IAEX;;;;;OAKG;IACH,YAAY,EAAE,CACZ,IAAI,EAAE,SAAS,EAAE,EAAE,KAChB,OAAO,CAAC,SAAS,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;IAE7C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAE/C;;;;;OAKG;IACH,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAExD;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAEpC;;;;OAIG;IACH,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEvB,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IAEzB,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAE9B;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAElC,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,IAAI,QAAQ,CAAC;IACrE,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACpC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEH,wBAAgB,kBAAkB,CAChC,EAAE,SAAS,eAAe,EAC1B,KAAK,KACF,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAU3B"}
|
package/dist/app/app-api.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createCursorApi, createStateApi, createTreeNodeApi, } from '../trees/index.js';
|
|
2
|
-
export function createAppStateApis() {
|
|
3
|
-
const treeNodeApi = createTreeNodeApi();
|
|
4
|
-
const cursorApi = createCursorApi();
|
|
5
|
-
const stateApi = createStateApi(treeNodeApi, cursorApi);
|
|
6
|
-
return {
|
|
7
|
-
treeNodeApi,
|
|
8
|
-
cursorApi,
|
|
9
|
-
stateApi,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SerializableKey } from '../../trees/index.js';
|
|
2
|
-
import type { Effect } from '../domain/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Parses a command-line command into an application effect.
|
|
5
|
-
*
|
|
6
|
-
* Command parsing is independent of the concrete tree-node value type, but the
|
|
7
|
-
* generic parameters allow its result to compose with the application's
|
|
8
|
-
* Effect<Id, Value> pipeline.
|
|
9
|
-
*
|
|
10
|
-
* @typeParam Id - The sibling-unique tree-node ID type.
|
|
11
|
-
* @typeParam Value - Application-owned data stored in each tree node.
|
|
12
|
-
*/
|
|
13
|
-
export declare function parseCommand<Id extends SerializableKey, Value>(commandLine: string): Effect<Id, Value> | undefined;
|
|
14
|
-
//# sourceMappingURL=parse-command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-command.d.ts","sourceRoot":"","sources":["../../../src/input/application/parse-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AA8GjD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EAC5D,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,SAAS,CAyD/B"}
|
package/dist/trees/cursor.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* A root-relative path identifying the current tree position.
|
|
4
|
-
*
|
|
5
|
-
* The empty path identifies the tree root. A non-empty path identifies a
|
|
6
|
-
* descendant by following child IDs from the root.
|
|
7
|
-
*
|
|
8
|
-
* For example, given:
|
|
9
|
-
*
|
|
10
|
-
* ```
|
|
11
|
-
* root
|
|
12
|
-
* └── src
|
|
13
|
-
* └── main.ts
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* the cursors are:
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* [] // root
|
|
20
|
-
* ['src'] // src
|
|
21
|
-
* ['src', 'main.ts'] // main.ts
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @typeParam Id - The type of node IDs.
|
|
25
|
-
*/
|
|
26
|
-
export type Cursor<Id> = readonly Id[];
|
|
27
|
-
/**
|
|
28
|
-
* Creates a schema for root-relative tree cursors.
|
|
29
|
-
*
|
|
30
|
-
* The schema validates the IDs in the path, but does not verify that the path
|
|
31
|
-
* exists in a particular tree.
|
|
32
|
-
*/
|
|
33
|
-
export declare function createCursorSchema<IdSchema extends z.ZodTypeAny>(idSchema: IdSchema): z.ZodArray<IdSchema>;
|
|
34
|
-
/**
|
|
35
|
-
* Operations for comparing and inspecting root-relative tree cursors.
|
|
36
|
-
*
|
|
37
|
-
* @typeParam Id - The type of node IDs.
|
|
38
|
-
*/
|
|
39
|
-
export type CursorApi<Id> = {
|
|
40
|
-
/**
|
|
41
|
-
* Tests whether two cursors identify the same tree position.
|
|
42
|
-
*/
|
|
43
|
-
equal(left: Cursor<Id>, right: Cursor<Id>): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Returns a mutable copy of the cursor path.
|
|
46
|
-
*
|
|
47
|
-
* The empty path identifies the tree root.
|
|
48
|
-
*/
|
|
49
|
-
getPath(cursor: Cursor<Id>): Id[];
|
|
50
|
-
/**
|
|
51
|
-
* Tests whether the cursor is within the subtree at `entryPath`.
|
|
52
|
-
*
|
|
53
|
-
* The subtree includes the node at `entryPath` itself. Therefore, equal
|
|
54
|
-
* paths return `true`, and an empty `entryPath` contains every cursor.
|
|
55
|
-
*/
|
|
56
|
-
cursorBelongsToSubtree(cursor: Cursor<Id>, entryPath: readonly Id[]): boolean;
|
|
57
|
-
};
|
|
58
|
-
export declare function createCursorApi<Id>(): CursorApi<Id>;
|
|
59
|
-
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/trees/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,MAAM,CAAC,EAAE,IAAI,SAAS,EAAE,EAAE,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,CAAC,CAAC,UAAU,EAC9D,QAAQ,EAAE,QAAQ,wBAGnB;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,EAAE,IAAI;IAC1B;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC;IAEpD;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;IAElC;;;;;OAKG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC;CAC/E,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE,CAAC,CAcnD"}
|
package/dist/trees/cursor.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a schema for root-relative tree cursors.
|
|
4
|
-
*
|
|
5
|
-
* The schema validates the IDs in the path, but does not verify that the path
|
|
6
|
-
* exists in a particular tree.
|
|
7
|
-
*/
|
|
8
|
-
export function createCursorSchema(idSchema) {
|
|
9
|
-
return z.array(idSchema);
|
|
10
|
-
}
|
|
11
|
-
export function createCursorApi() {
|
|
12
|
-
return {
|
|
13
|
-
equal(left, right) {
|
|
14
|
-
return idPathEqual(left, right);
|
|
15
|
-
},
|
|
16
|
-
getPath(cursor) {
|
|
17
|
-
return [...cursor];
|
|
18
|
-
},
|
|
19
|
-
cursorBelongsToSubtree(cursor, entryPath) {
|
|
20
|
-
return isPathPrefix(entryPath, cursor);
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Returns true when both root-relative paths contain the same IDs in the same
|
|
26
|
-
* order.
|
|
27
|
-
*/
|
|
28
|
-
function idPathEqual(left, right) {
|
|
29
|
-
if (left.length !== right.length) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
for (let index = 0; index < left.length; index += 1) {
|
|
33
|
-
if (left[index] !== right[index]) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Returns true when `prefix` is a prefix of `path`.
|
|
41
|
-
*
|
|
42
|
-
* Equal paths are included. An empty prefix is therefore a prefix of every
|
|
43
|
-
* path.
|
|
44
|
-
*/
|
|
45
|
-
function isPathPrefix(prefix, path) {
|
|
46
|
-
if (prefix.length > path.length) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
for (let index = 0; index < prefix.length; index += 1) {
|
|
50
|
-
if (prefix[index] !== path[index]) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fold-node.impl.d.ts","sourceRoot":"","sources":["../../../../src/trees/fold-node/deprecated/fold-node.impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,SAAS,eAAe,EAC9D,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,GAC3B,eAAe,CAAC,EAAE,CAAC,CA0WrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fold-node.test.d.ts","sourceRoot":"","sources":["../../../../src/trees/fold-node/deprecated/fold-node.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fold-node.types.d.ts","sourceRoot":"","sources":["../../../../src/trees/fold-node/deprecated/fold-node.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,eAAe,IAAI,QAAQ,CAAC;IAC/D,cAAc,EAAE,SAAS,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;CACzC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,EAAE,SAAS,eAAe,IAAI,QAAQ,CACzD,EAAE,EACF,aAAa,CAAC,EAAE,CAAC,CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,EAAE,SAAS,eAAe,IAAI,WAAW,CAC/D,EAAE,EACF,aAAa,CAAC,EAAE,CAAC,CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,eAAe,IAAI;IACxD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEtC;;;;;;;;;;;;;;OAcG;IACH,sBAAsB,CACpB,QAAQ,EAAE,QAAQ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AAS,EAChB,IAAI,EAAE,SAAS,EAAE,EAAE,EACnB,OAAO,EAAE,EAAE,GACV,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAEzB;;OAEG;IACH,eAAe,CACb,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAChB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,SAAS,EAAE,EAAE,EACnB,OAAO,EAAE,EAAE,GACV,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAEzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,0BAA0B,CACxB,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAChB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,SAAS,EAAE,EAAE,GAClB,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAEzB;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;CACzD,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/trees/fold-node/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
package/dist/trees/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './fold-node/index.js';
|
|
2
|
-
export * from './nav-node/nav-node.impl.js';
|
|
3
|
-
export * from './nav-node/nav-node.types.js';
|
|
4
|
-
export * from './tree-node/index.js';
|
|
5
|
-
export * from './cursor.js';
|
|
6
|
-
export * from './state/state.impl.js';
|
|
7
|
-
export * from './state/state.schemas.js';
|
|
8
|
-
export * from './state/state.types.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trees/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AAErC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,sBAAsB,CAAC;AAErC,cAAc,aAAa,CAAC;AAE5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
package/dist/trees/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './fold-node/index.js';
|
|
2
|
-
export * from './nav-node/nav-node.impl.js';
|
|
3
|
-
export * from './nav-node/nav-node.types.js';
|
|
4
|
-
export * from './tree-node/index.js';
|
|
5
|
-
export * from './cursor.js';
|
|
6
|
-
export * from './state/state.impl.js';
|
|
7
|
-
export * from './state/state.schemas.js';
|
|
8
|
-
export * from './state/state.types.js';
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { SerializableKey, TreeNodeApi } from '../tree-node/index.js';
|
|
2
|
-
import type { FoldsApi } from '../fold-node/index.js';
|
|
3
|
-
import type { CursorApi } from '../cursor.js';
|
|
4
|
-
import type { NavNodeApi } from './nav-node.types.js';
|
|
5
|
-
export type NavEntryComparator<Id extends SerializableKey, Value> = (left: Readonly<{
|
|
6
|
-
id: Id;
|
|
7
|
-
value: Value;
|
|
8
|
-
}>, right: Readonly<{
|
|
9
|
-
id: Id;
|
|
10
|
-
value: Value;
|
|
11
|
-
}>) => number;
|
|
12
|
-
export type CreateNavNodeApiOptions<Id extends SerializableKey, Value> = Readonly<{
|
|
13
|
-
/**
|
|
14
|
-
* Defines display and cursor-navigation order among sibling entries.
|
|
15
|
-
*
|
|
16
|
-
* For deterministic navigation, this should define a total order for
|
|
17
|
-
* distinct sibling entries. If two entries compare equal, their order falls
|
|
18
|
-
* back to the source TreeNode child iteration order.
|
|
19
|
-
*/
|
|
20
|
-
compareEntries: NavEntryComparator<Id, Value>;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Creates operations for projecting an opaque tree into a navigation model.
|
|
24
|
-
*
|
|
25
|
-
* Navigation ordering is intentionally a UI concern. The underlying TreeNode
|
|
26
|
-
* API need not promise a particular child-storage representation or ordering.
|
|
27
|
-
*/
|
|
28
|
-
export declare function createNavNodeApi<Id extends SerializableKey, Value>(treeNodeApi: TreeNodeApi<Id, Value>, foldsApi: FoldsApi<Id>, cursorApi: CursorApi<Id>, options: CreateNavNodeApiOptions<Id, Value>): NavNodeApi<Id, Value>;
|
|
29
|
-
//# sourceMappingURL=nav-node.impl.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nav-node.impl.d.ts","sourceRoot":"","sources":["../../../src/trees/nav-node/nav-node.impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAEf,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAU,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAIV,UAAU,EACX,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,kBAAkB,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,IAAI,CAClE,IAAI,EAAE,QAAQ,CAAC;IACb,EAAE,EAAE,EAAE,CAAC;IACP,KAAK,EAAE,KAAK,CAAC;CACd,CAAC,EACF,KAAK,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,EAAE,CAAC;IACP,KAAK,EAAE,KAAK,CAAC;CACd,CAAC,KACC,MAAM,CAAC;AAEZ,MAAM,MAAM,uBAAuB,CACjC,EAAE,SAAS,eAAe,EAC1B,KAAK,IACH,QAAQ,CAAC;IACX;;;;;;OAMG;IACH,cAAc,EAAE,kBAAkB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;CAC/C,CAAC,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,eAAe,EAAE,KAAK,EAChE,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,EACnC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,EACtB,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,EACxB,OAAO,EAAE,uBAAuB,CAAC,EAAE,EAAE,KAAK,CAAC,GAC1C,UAAU,CAAC,EAAE,EAAE,KAAK,CAAC,CA8UvB"}
|