dirvi-lib 0.8.0 → 0.8.2

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.
Files changed (178) hide show
  1. package/dist/app/app-api.d.ts +74 -0
  2. package/dist/app/app-api.d.ts.map +1 -0
  3. package/dist/app/app-api.js +11 -0
  4. package/dist/app/effect-to-action.d.ts +6 -0
  5. package/dist/app/effect-to-action.d.ts.map +1 -0
  6. package/dist/app/effect-to-action.js +74 -0
  7. package/dist/app/index.d.ts +6 -0
  8. package/dist/app/index.d.ts.map +1 -0
  9. package/dist/app/index.js +5 -0
  10. package/dist/app/reducer-action.d.ts +22 -0
  11. package/dist/app/reducer-action.d.ts.map +1 -0
  12. package/dist/app/reducer.d.ts +5 -0
  13. package/dist/app/reducer.d.ts.map +1 -0
  14. package/dist/app/reducer.js +79 -0
  15. package/dist/app/view-api.d.ts +11 -0
  16. package/dist/app/view-api.d.ts.map +1 -0
  17. package/dist/index.d.ts +4 -7
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +4 -7
  20. package/dist/input/application/index.d.ts.map +1 -0
  21. package/dist/input/application/intent-to-effect-no-state.test.d.ts.map +1 -0
  22. package/dist/input/application/intent-to-effect.d.ts +14 -0
  23. package/dist/input/application/intent-to-effect.d.ts.map +1 -0
  24. package/dist/{tree-surfer-ui → input}/application/intent-to-effect.js +36 -17
  25. package/dist/input/application/parse-command.d.ts +14 -0
  26. package/dist/input/application/parse-command.d.ts.map +1 -0
  27. package/dist/{tree-surfer-ui → input}/application/parse-command.js +13 -1
  28. package/dist/input/application/user-input-to-intent.d.ts.map +1 -0
  29. package/dist/input/application/user-input-to-intent.test.d.ts.map +1 -0
  30. package/dist/input/domain/effect.d.ts +55 -0
  31. package/dist/input/domain/effect.d.ts.map +1 -0
  32. package/dist/input/domain/index.d.ts.map +1 -0
  33. package/dist/input/domain/input-mode-state.d.ts.map +1 -0
  34. package/dist/input/domain/intent.d.ts.map +1 -0
  35. package/dist/input/domain/user-input.d.ts.map +1 -0
  36. package/dist/trees/cursor.d.ts.map +1 -0
  37. package/dist/trees/fold-node/deprecated/fold-node.impl.d.ts +10 -0
  38. package/dist/trees/fold-node/deprecated/fold-node.impl.d.ts.map +1 -0
  39. package/dist/trees/fold-node/deprecated/fold-node.impl.js +248 -0
  40. package/dist/trees/fold-node/deprecated/fold-node.test.d.ts +2 -0
  41. package/dist/trees/fold-node/deprecated/fold-node.test.d.ts.map +1 -0
  42. package/dist/trees/fold-node/deprecated/fold-node.test.js +130 -0
  43. package/dist/{tree-surfer/fold-node → trees/fold-node/deprecated}/fold-node.types.d.ts +15 -76
  44. package/dist/trees/fold-node/deprecated/fold-node.types.d.ts.map +1 -0
  45. package/dist/trees/fold-node/fold-node.impl.d.ts +16 -0
  46. package/dist/trees/fold-node/fold-node.impl.d.ts.map +1 -0
  47. package/dist/trees/fold-node/fold-node.impl.js +451 -0
  48. package/dist/trees/fold-node/fold-node.model.d.ts +120 -0
  49. package/dist/trees/fold-node/fold-node.model.d.ts.map +1 -0
  50. package/dist/trees/fold-node/fold-node.model.js +80 -0
  51. package/dist/trees/fold-node/fold-node.types.d.ts +206 -0
  52. package/dist/trees/fold-node/fold-node.types.d.ts.map +1 -0
  53. package/dist/trees/fold-node/index.d.ts +4 -0
  54. package/dist/trees/fold-node/index.d.ts.map +1 -0
  55. package/dist/trees/fold-node/index.js +3 -0
  56. package/dist/trees/index.d.ts +9 -0
  57. package/dist/trees/index.d.ts.map +1 -0
  58. package/dist/trees/index.js +8 -0
  59. package/dist/trees/nav-node/nav-node.impl.d.ts +29 -0
  60. package/dist/trees/nav-node/nav-node.impl.d.ts.map +1 -0
  61. package/dist/{tree-surfer → trees}/nav-node/nav-node.impl.js +89 -42
  62. package/dist/trees/nav-node/nav-node.types.d.ts +103 -0
  63. package/dist/trees/nav-node/nav-node.types.d.ts.map +1 -0
  64. package/dist/trees/state/state.impl.d.ts +8 -0
  65. package/dist/trees/state/state.impl.d.ts.map +1 -0
  66. package/dist/trees/state/state.impl.js +128 -0
  67. package/dist/trees/state/state.schemas.d.ts +25 -0
  68. package/dist/trees/state/state.schemas.d.ts.map +1 -0
  69. package/dist/trees/state/state.schemas.js +17 -0
  70. package/dist/trees/state/state.types.d.ts +36 -0
  71. package/dist/trees/state/state.types.d.ts.map +1 -0
  72. package/dist/trees/state/state.types.js +1 -0
  73. package/dist/trees/tree-node/deprecated/tree-node.arb.d.ts.map +1 -0
  74. package/dist/trees/tree-node/deprecated/tree-node.arb.debug.test.d.ts.map +1 -0
  75. package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.arb.debug.test.js +1 -1
  76. package/dist/trees/tree-node/deprecated/tree-node.impl.d.ts.map +1 -0
  77. package/dist/trees/tree-node/deprecated/tree-node.schemas.d.ts.map +1 -0
  78. package/dist/trees/tree-node/deprecated/tree-node.test.d.ts.map +1 -0
  79. package/dist/trees/tree-node/deprecated/tree-node.types.d.ts.map +1 -0
  80. package/dist/trees/tree-node/deprecated/tree-node.types.js +1 -0
  81. package/dist/trees/tree-node/index.d.ts +4 -0
  82. package/dist/trees/tree-node/index.d.ts.map +1 -0
  83. package/dist/trees/tree-node/index.js +3 -0
  84. package/dist/trees/tree-node/tree-node.arb.d.ts +104 -0
  85. package/dist/trees/tree-node/tree-node.arb.d.ts.map +1 -0
  86. package/dist/trees/tree-node/tree-node.arb.js +191 -0
  87. package/dist/trees/tree-node/tree-node.impl.d.ts +15 -0
  88. package/dist/trees/tree-node/tree-node.impl.d.ts.map +1 -0
  89. package/dist/trees/tree-node/tree-node.impl.js +286 -0
  90. package/dist/trees/tree-node/tree-node.model.d.ts +78 -0
  91. package/dist/trees/tree-node/tree-node.model.d.ts.map +1 -0
  92. package/dist/trees/tree-node/tree-node.model.js +37 -0
  93. package/dist/trees/tree-node/tree-node.types.d.ts +419 -0
  94. package/dist/trees/tree-node/tree-node.types.d.ts.map +1 -0
  95. package/dist/trees/tree-node/tree-node.types.js +1 -0
  96. package/package.json +1 -1
  97. package/dist/tree-surfer/cursor.d.ts.map +0 -1
  98. package/dist/tree-surfer/fold-node/fold-node.arb.d.ts +0 -2
  99. package/dist/tree-surfer/fold-node/fold-node.arb.d.ts.map +0 -1
  100. package/dist/tree-surfer/fold-node/fold-node.impl.d.ts +0 -4
  101. package/dist/tree-surfer/fold-node/fold-node.impl.d.ts.map +0 -1
  102. package/dist/tree-surfer/fold-node/fold-node.impl.js +0 -149
  103. package/dist/tree-surfer/fold-node/fold-node.schema.d.ts +0 -5
  104. package/dist/tree-surfer/fold-node/fold-node.schema.d.ts.map +0 -1
  105. package/dist/tree-surfer/fold-node/fold-node.schema.js +0 -9
  106. package/dist/tree-surfer/fold-node/fold-node.types.d.ts.map +0 -1
  107. package/dist/tree-surfer/fold-node/tree-node.test.d.ts.map +0 -1
  108. package/dist/tree-surfer/fold-node/tree-node.test.js +0 -90
  109. package/dist/tree-surfer/index.d.ts +0 -13
  110. package/dist/tree-surfer/index.d.ts.map +0 -1
  111. package/dist/tree-surfer/index.js +0 -12
  112. package/dist/tree-surfer/nav-node/nav-node.impl.d.ts +0 -6
  113. package/dist/tree-surfer/nav-node/nav-node.impl.d.ts.map +0 -1
  114. package/dist/tree-surfer/nav-node/nav-node.types.d.ts +0 -70
  115. package/dist/tree-surfer/nav-node/nav-node.types.d.ts.map +0 -1
  116. package/dist/tree-surfer/state/state.impl.d.ts +0 -7
  117. package/dist/tree-surfer/state/state.impl.d.ts.map +0 -1
  118. package/dist/tree-surfer/state/state.impl.js +0 -89
  119. package/dist/tree-surfer/state/state.schemas.d.ts +0 -9
  120. package/dist/tree-surfer/state/state.schemas.d.ts.map +0 -1
  121. package/dist/tree-surfer/state/state.schemas.js +0 -8
  122. package/dist/tree-surfer/state/state.types.d.ts +0 -21
  123. package/dist/tree-surfer/state/state.types.d.ts.map +0 -1
  124. package/dist/tree-surfer/tree-node/tree-node.arb.d.ts.map +0 -1
  125. package/dist/tree-surfer/tree-node/tree-node.arb.debug.test.d.ts.map +0 -1
  126. package/dist/tree-surfer/tree-node/tree-node.impl.d.ts.map +0 -1
  127. package/dist/tree-surfer/tree-node/tree-node.schemas.d.ts.map +0 -1
  128. package/dist/tree-surfer/tree-node/tree-node.test.d.ts +0 -2
  129. package/dist/tree-surfer/tree-node/tree-node.test.d.ts.map +0 -1
  130. package/dist/tree-surfer/tree-node/tree-node.types.d.ts.map +0 -1
  131. package/dist/tree-surfer-ui/application/index.d.ts.map +0 -1
  132. package/dist/tree-surfer-ui/application/intent-to-effect-no-state.test.d.ts.map +0 -1
  133. package/dist/tree-surfer-ui/application/intent-to-effect.d.ts +0 -10
  134. package/dist/tree-surfer-ui/application/intent-to-effect.d.ts.map +0 -1
  135. package/dist/tree-surfer-ui/application/parse-command.d.ts +0 -4
  136. package/dist/tree-surfer-ui/application/parse-command.d.ts.map +0 -1
  137. package/dist/tree-surfer-ui/application/user-input-to-intent.d.ts.map +0 -1
  138. package/dist/tree-surfer-ui/application/user-input-to-intent.test.d.ts.map +0 -1
  139. package/dist/tree-surfer-ui/domain/effect.d.ts +0 -43
  140. package/dist/tree-surfer-ui/domain/effect.d.ts.map +0 -1
  141. package/dist/tree-surfer-ui/domain/index.d.ts.map +0 -1
  142. package/dist/tree-surfer-ui/domain/input-mode-state.d.ts.map +0 -1
  143. package/dist/tree-surfer-ui/domain/intent.d.ts.map +0 -1
  144. package/dist/tree-surfer-ui/domain/user-input.d.ts.map +0 -1
  145. /package/dist/{tree-surfer-ui/domain/effect.js → app/reducer-action.js} +0 -0
  146. /package/dist/{tree-surfer-ui/domain/input-mode-state.js → app/view-api.js} +0 -0
  147. /package/dist/{tree-surfer-ui → input}/application/index.d.ts +0 -0
  148. /package/dist/{tree-surfer-ui → input}/application/index.js +0 -0
  149. /package/dist/{tree-surfer-ui → input}/application/intent-to-effect-no-state.test.d.ts +0 -0
  150. /package/dist/{tree-surfer-ui → input}/application/intent-to-effect-no-state.test.js +0 -0
  151. /package/dist/{tree-surfer-ui → input}/application/user-input-to-intent.d.ts +0 -0
  152. /package/dist/{tree-surfer-ui → input}/application/user-input-to-intent.js +0 -0
  153. /package/dist/{tree-surfer-ui → input}/application/user-input-to-intent.test.d.ts +0 -0
  154. /package/dist/{tree-surfer-ui → input}/application/user-input-to-intent.test.js +0 -0
  155. /package/dist/{tree-surfer-ui/domain/intent.js → input/domain/effect.js} +0 -0
  156. /package/dist/{tree-surfer-ui → input}/domain/index.d.ts +0 -0
  157. /package/dist/{tree-surfer-ui → input}/domain/index.js +0 -0
  158. /package/dist/{tree-surfer-ui → input}/domain/input-mode-state.d.ts +0 -0
  159. /package/dist/{tree-surfer-ui/domain/user-input.js → input/domain/input-mode-state.js} +0 -0
  160. /package/dist/{tree-surfer-ui → input}/domain/intent.d.ts +0 -0
  161. /package/dist/{tree-surfer/fold-node/fold-node.arb.js → input/domain/intent.js} +0 -0
  162. /package/dist/{tree-surfer-ui → input}/domain/user-input.d.ts +0 -0
  163. /package/dist/{tree-surfer/fold-node/fold-node.types.js → input/domain/user-input.js} +0 -0
  164. /package/dist/{tree-surfer → trees}/cursor.d.ts +0 -0
  165. /package/dist/{tree-surfer → trees}/cursor.js +0 -0
  166. /package/dist/{tree-surfer/nav-node/nav-node.types.js → trees/fold-node/deprecated/fold-node.types.js} +0 -0
  167. /package/dist/{tree-surfer/state/state.types.js → trees/fold-node/fold-node.types.js} +0 -0
  168. /package/dist/{tree-surfer/tree-node/tree-node.types.js → trees/nav-node/nav-node.types.js} +0 -0
  169. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.arb.d.ts +0 -0
  170. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.arb.debug.test.d.ts +0 -0
  171. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.arb.js +0 -0
  172. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.impl.d.ts +0 -0
  173. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.impl.js +0 -0
  174. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.schemas.d.ts +0 -0
  175. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.schemas.js +0 -0
  176. /package/dist/{tree-surfer/fold-node → trees/tree-node/deprecated}/tree-node.test.d.ts +0 -0
  177. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.test.js +0 -0
  178. /package/dist/{tree-surfer/tree-node → trees/tree-node/deprecated}/tree-node.types.d.ts +0 -0
@@ -1,90 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { createTreeNodeApi } from '../tree-node/tree-node.impl.js';
3
- import { createFoldNodeService } from './fold-node.impl.js';
4
- const foldNodeApi = createTreeNodeApi();
5
- const service = createFoldNodeService(foldNodeApi);
6
- describe('createFoldNodeService', () => {
7
- it('UT: adds a new entry to foldedChildren', () => {
8
- const root = service.createEmptyNode(0);
9
- const updated = service.addFoldedEntryAtPath(root, [], 0);
10
- expect(updated).toStrictEqual({
11
- id: 0,
12
- children: [],
13
- foldedChildren: [
14
- {
15
- id: 0,
16
- children: [],
17
- foldedChildren: [],
18
- },
19
- ],
20
- });
21
- });
22
- it('UT: moves an existing structural entry to foldedChildren', () => {
23
- const child = {
24
- id: 1,
25
- children: [],
26
- foldedChildren: [],
27
- };
28
- const root = {
29
- id: 0,
30
- children: [child],
31
- foldedChildren: [],
32
- };
33
- const updated = service.addFoldedEntryAtPath(root, [], 1);
34
- expect(updated).toStrictEqual({
35
- id: 0,
36
- children: [],
37
- foldedChildren: [child],
38
- });
39
- });
40
- it('UT: preserves nested fold state when moving an entry', () => {
41
- const nestedChild = {
42
- id: 2,
43
- children: [],
44
- foldedChildren: [],
45
- };
46
- const child = {
47
- id: 1,
48
- children: [],
49
- foldedChildren: [nestedChild],
50
- };
51
- const root = {
52
- id: 0,
53
- children: [child],
54
- foldedChildren: [],
55
- };
56
- const updated = service.addFoldedEntryAtPath(root, [], 1);
57
- expect(updated).toStrictEqual({
58
- id: 0,
59
- children: [],
60
- foldedChildren: [
61
- {
62
- id: 1,
63
- children: [],
64
- foldedChildren: [nestedChild],
65
- },
66
- ],
67
- });
68
- expect(updated?.foldedChildren[0]).toBe(child);
69
- expect(updated?.foldedChildren[0]?.foldedChildren[0]).toBe(nestedChild);
70
- });
71
- it('UT: rejects a path through a folded entry', () => {
72
- const foldedChild = {
73
- id: 1,
74
- children: [],
75
- foldedChildren: [],
76
- };
77
- const root = {
78
- id: 0,
79
- children: [],
80
- foldedChildren: [foldedChild],
81
- };
82
- const updated = service.addFoldedEntryAtPath(root, [1], 2);
83
- expect(updated).toBeUndefined();
84
- expect(root).toStrictEqual({
85
- id: 0,
86
- children: [],
87
- foldedChildren: [foldedChild],
88
- });
89
- });
90
- });
@@ -1,13 +0,0 @@
1
- export * from './fold-node/fold-node.impl.js';
2
- export * from './fold-node/fold-node.schema.js';
3
- export * from './fold-node/fold-node.types.js';
4
- export * from './nav-node/nav-node.impl.js';
5
- export * from './nav-node/nav-node.types.js';
6
- export * from './tree-node/tree-node.impl.js';
7
- export * from './tree-node/tree-node.schemas.js';
8
- export * from './tree-node/tree-node.types.js';
9
- export * from './cursor.js';
10
- export * from './state/state.impl.js';
11
- export * from './state/state.schemas.js';
12
- export * from './state/state.types.js';
13
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tree-surfer/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,cAAc,aAAa,CAAC;AAE5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
@@ -1,12 +0,0 @@
1
- export * from './fold-node/fold-node.impl.js';
2
- export * from './fold-node/fold-node.schema.js';
3
- export * from './fold-node/fold-node.types.js';
4
- export * from './nav-node/nav-node.impl.js';
5
- export * from './nav-node/nav-node.types.js';
6
- export * from './tree-node/tree-node.impl.js';
7
- export * from './tree-node/tree-node.schemas.js';
8
- export * from './tree-node/tree-node.types.js';
9
- export * from './cursor.js';
10
- export * from './state/state.impl.js';
11
- export * from './state/state.schemas.js';
12
- export * from './state/state.types.js';
@@ -1,6 +0,0 @@
1
- import type { SerializableKey, TreeNode, TreeNodeApi } from '../tree-node/tree-node.types.js';
2
- import type { FoldNodeService } from '../fold-node/fold-node.types.js';
3
- import type { CursorApi } from '../cursor.js';
4
- import type { NavNodeApi } from './nav-node.types.js';
5
- export declare function createNavNodeApi<Id extends SerializableKey, Node extends TreeNode<Id, Node>>(treeNodeApi: TreeNodeApi<Id, Node>, foldNodeService: FoldNodeService<Id>, cursorApi: CursorApi<Id>): NavNodeApi<Id, Node>;
6
- //# sourceMappingURL=nav-node.impl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nav-node.impl.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/nav-node/nav-node.impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,KAAK,EAAU,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAIV,UAAU,EACX,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,gBAAgB,CAC9B,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAE/B,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,EAClC,eAAe,EAAE,eAAe,CAAC,EAAE,CAAC,EACpC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,GACvB,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,CA2RtB"}
@@ -1,70 +0,0 @@
1
- import { BranchTreeNode, SerializableKey, TreeNode } from '../tree-node/tree-node.types.js';
2
- import { Cursor } from '../cursor.js';
3
- import { FoldNode } from '../fold-node/fold-node.types.js';
4
- export type NavNode<Id extends SerializableKey> = {
5
- /**
6
- * Synthetic UI entry representing folded children.
7
- *
8
- * It is absent when this directory has no folded children.
9
- */
10
- folded: NavFoldEntry<Id> | null;
11
- /**
12
- * Loaded entries that are not folded at this directory, corresponding to
13
- * navigable rows. Entries retain the order from the TreeNode.
14
- */
15
- entries: NavEntry<Id>[];
16
- };
17
- export type NavFoldEntry<Id extends SerializableKey> = {
18
- /**
19
- * Folded entries that are present in the loaded TreeNode.
20
- *
21
- * This is information for rendering the folded row.
22
- */
23
- entries: NavEntry<Id>[];
24
- };
25
- export type NavEntry<Id extends SerializableKey> = NavLeaf<Id> | NavBranch<Id>;
26
- export type NavLeaf<Id extends SerializableKey> = {
27
- id: Id;
28
- };
29
- export type NavBranch<Id extends SerializableKey> = {
30
- id: Id;
31
- children: NavNode<Id> | null;
32
- };
33
- export type NavNodeApi<Id extends SerializableKey, Node extends TreeNode<Id, Node>> = {
34
- /**
35
- * Tests whether a navigation entry represents a branch.
36
- *
37
- * A branch is an entry with a `children` property. Its `children` value is
38
- * `null` when the corresponding tree branch has not been loaded or opened.
39
- */
40
- entryIsBranch(entry: NavEntry<Id>): entry is NavBranch<Id>;
41
- /**
42
- * Creates a navigation projection of the tree node root.
43
- *
44
- * The root must be a branch node because navigation is rooted at a
45
- * directory-like node. The returned navigation entry is always a `NavBranch`.
46
- *
47
- * The TreeNode is authoritative for:
48
- *
49
- * - entry identity and order;
50
- * - whether the entry is a leaf or branch;
51
- * - whether branch children are loaded; and
52
- * - the loaded child entries.
53
- *
54
- * The optional FoldNode is authoritative for folding. When `foldRoot` is
55
- * undefined, the projection contains no folded entries.
56
- *
57
- * A folded entry is omitted from its parent's navigable entries and is
58
- * represented by that parent's synthetic `folded` entry instead.
59
- */
60
- from(root: Node & BranchTreeNode<Id, Node>, foldRoot: FoldNode<Id> | undefined): NavBranch<Id>;
61
- getNodeAtPath(navigation: NavNode<Id>, path: readonly Id[]): NavNode<Id> | undefined;
62
- getEntryAtPath(navigation: NavNode<Id>, path: readonly Id[]): NavEntry<Id> | undefined;
63
- nextCursor(rootNode: NavBranch<Id>, cursor: Cursor<Id>): Cursor<Id> | undefined;
64
- previousCursor(rootNode: NavBranch<Id>, cursor: Cursor<Id>): Cursor<Id> | undefined;
65
- cursorAfterFold(rootNode: NavBranch<Id>, cursor: Cursor<Id>): Cursor<Id> | undefined;
66
- parentCursor(navigation: NavNode<Id>, cursor: Cursor<Id>): Cursor<Id> | undefined;
67
- cursors(navigation: NavNode<Id>, parentPath?: Id[]): Cursor<Id>[];
68
- visibleLeavesPaths(navigation: NavNode<Id>, parentPath?: readonly Id[]): Id[][];
69
- };
70
- //# sourceMappingURL=nav-node.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nav-node.types.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/nav-node/nav-node.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,eAAe,IAAI;IAChD;;;;OAIG;IACH,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAEhC;;;OAGG;IACH,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,eAAe,IAAI;IACrD;;;;OAIG;IACH,OAAO,EAAE,Q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MAAM,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAE1B,cAAc,CACZ,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC,EACvB,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GACjB,MAAM,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAE1B,eAAe,CACb,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC,EACvB,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GACjB,MAAM,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAE1B,YAAY,CACV,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,EACvB,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,GACjB,MAAM,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAE1B,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;IAElE,kBAAkB,CAChB,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,EACvB,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,GACzB,EAAE,EAAE,EAAE,CAAC;CACX,CAAC"}
@@ -1,7 +0,0 @@
1
- import { SerializableKey, TreeNode, TreeNodeApi } from '../tree-node/tree-node.types.js';
2
- import { FoldNodeApi } from '../fold-node/fold-node.types.js';
3
- import { CursorApi } from '../cursor.js';
4
- import { NavNodeApi } from '../nav-node/nav-node.types.js';
5
- import { StateApi } from './state.types.js';
6
- export declare function createStateApi<Id extends SerializableKey, Node extends TreeNode<Id, Node>>(treeNodeApi: TreeNodeApi<Id, Node>, foldNodeApi: FoldNodeApi<Id>, cursorApi: CursorApi<Id>, navNodeApi: NavNodeApi<Id, Node>): StateApi<Id, Node>;
7
- //# sourceMappingURL=state.impl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.impl.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/state/state.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACzG,OAAO,EAAY,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAU,SAAS,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAS,MAAM,kBAAkB,CAAC;AAEnD,wBAAgB,cAAc,CAC5B,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAE/B,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,EAClC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAC,EAC5B,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,EACxB,UAAU,EAAE,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,GAC/B,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAoIpB"}
@@ -1,89 +0,0 @@
1
- export function createStateApi(treeNodeApi, foldNodeApi, cursorApi, navNodeApi) {
2
- /**
3
- * Create a new root and fold root.
4
- *
5
- * Works on fold root and descendant fold nodes using the generic.
6
- *
7
- * TODO: Later: Filter the fold node
8
- */
9
- async function reload(oldRoot, oldFoldNode, parentPath, loadBranches) {
10
- // Do not load a branch that was already closed.
11
- if (!treeNodeApi.isOpenBranch(oldRoot)) {
12
- return {
13
- root: oldRoot,
14
- foldRoot: oldFoldNode,
15
- };
16
- }
17
- const newChildren = await loadBranches(parentPath);
18
- let newRoot = {
19
- ...oldRoot,
20
- children: newChildren,
21
- };
22
- let newFoldNode = oldFoldNode; // Start with assumption of no changes
23
- for (const oldEntry of oldRoot.children) {
24
- if (!treeNodeApi.isBranch(oldEntry) ||
25
- !treeNodeApi.isOpenBranch(oldEntry)) {
26
- continue;
27
- }
28
- const oldChildFoldNode = oldFoldNode === undefined
29
- ? undefined
30
- : foldNodeApi.getChildById(oldFoldNode, oldEntry.id);
31
- const entryPath = [...parentPath, oldEntry.id];
32
- const reloadedChild = await reload(oldEntry, oldChildFoldNode, entryPath, loadBranches);
33
- const updatedRoot = treeNodeApi.modifyAtPath(newRoot, [oldEntry.id], (entry) => {
34
- if (!treeNodeApi.isBranch(entry)) {
35
- return undefined;
36
- }
37
- return {
38
- ...entry,
39
- children: reloadedChild.root.children,
40
- };
41
- });
42
- if (updatedRoot !== undefined && treeNodeApi.isOpenBranch(updatedRoot)) {
43
- newRoot = updatedRoot;
44
- }
45
- }
46
- return {
47
- root: newRoot,
48
- foldRoot: newFoldNode,
49
- };
50
- }
51
- /**
52
- * Currently the cursor just goes to root.
53
- *
54
- * TODO: Cursor policy:
55
- * 1. Keep the exact cursor if it survives,
56
- * 2. Otherwise, choose the deepest surviving ancestor entry,
57
- * 3. Otherwise, choose the nearest preceding old cursor that still survives,
58
- * 4. Otherwise, choose the first new cursor.
59
- * 5. If no cursor exists, use the root fold cursor.
60
- */
61
- function resyncCursor(oldState, newRoot, newFoldNode) {
62
- return [];
63
- }
64
- return {
65
- getNodeAtCursor(state) {
66
- const path = cursorApi.getPath(state.cursor);
67
- return treeNodeApi.getAtPath(state.root, path, (node) => node);
68
- },
69
- async resync(oldState, loadChildren) {
70
- const reloaded = await reload(oldState.root, oldState.foldRoot, [], loadChildren);
71
- /*
72
- * `oldState.foldNode` is always present. At the root reload starts with
73
- * that node, so `reloaded.foldNode` should also always be present.
74
- *
75
- * The fallback expresses the State invariant while satisfying the
76
- * optional return type needed by recursive child reloads.
77
- */
78
- const foldRoot = reloaded.foldRoot ?? oldState.foldRoot;
79
- const cursor = resyncCursor(oldState, reloaded.root, foldRoot) ?? [];
80
- const root = reloaded.root;
81
- return {
82
- ...oldState,
83
- root,
84
- foldRoot,
85
- cursor,
86
- };
87
- },
88
- };
89
- }
@@ -1,9 +0,0 @@
1
- import { z } from 'zod';
2
- import { SerializableKey, TreeNode } from '../tree-node/tree-node.types.js';
3
- import { State } from './state.types.js';
4
- export declare function createStateSchema<Id extends SerializableKey, Node extends TreeNode<Id, Node>>(rootSchema: z.ZodType<State<Id, Node>['root']>, foldNodeRootSchema: z.ZodType<State<Id, Node>['foldRoot']>, cursorSchema: z.ZodType<State<Id, Node>['cursor']>): z.ZodObject<{
5
- root: z.ZodType<Node & import("../tree-node/tree-node.types.js").BranchTreeNode<Id, Node>, unknown, z.core.$ZodTypeInternals<Node & import("../tree-node/tree-node.types.js").BranchTreeNode<Id, Node>, unknown>>;
6
- foldRoot: z.ZodType<import("../index.js").FoldNode<Id>, unknown, z.core.$ZodTypeInternals<import("../index.js").FoldNode<Id>, unknown>>;
7
- cursor: z.ZodType<import("../cursor.js").Cursor<Id>, unknown, z.core.$ZodTypeInternals<import("../cursor.js").Cursor<Id>, unknown>>;
8
- }, z.core.$strip>;
9
- //# sourceMappingURL=state.schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.schemas.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/state/state.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,wBAAgB,iBAAiB,CAC/B,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAE/B,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,EAC9C,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,EAC1D,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;;;;kBAOnD"}
@@ -1,8 +0,0 @@
1
- import { z } from 'zod';
2
- export function createStateSchema(rootSchema, foldNodeRootSchema, cursorSchema) {
3
- return z.object({
4
- root: rootSchema,
5
- foldRoot: foldNodeRootSchema,
6
- cursor: cursorSchema,
7
- });
8
- }
@@ -1,21 +0,0 @@
1
- import type { Cursor } from '../cursor.js';
2
- import { BranchTreeNode, SerializableKey, TreeNode } from '../tree-node/tree-node.types.js';
3
- import type { FoldNode } from '../fold-node/fold-node.types.js';
4
- export type State<Id extends SerializableKey, Node extends TreeNode<Id, Node>> = {
5
- root: Node & BranchTreeNode<Id, Node>;
6
- foldRoot: FoldNode<Id>;
7
- cursor: Cursor<Id>;
8
- };
9
- export type StateApi<Id extends SerializableKey, Node extends TreeNode<Id, Node>> = {
10
- getNodeAtCursor(state: State<Id, Node>): Node | undefined;
11
- /**
12
- * Reloads the root's children and all descendant branches that were loaded in
13
- * the previous state.
14
- *
15
- * `loadBranches([])` loads the root's direct children.
16
- * `loadBranches(['src'])` loads the children of `src`, where 'src' is the
17
- * id of a root's child.
18
- */
19
- resync(oldState: State<Id, Node>, loadBranches: (path: Id[]) => Promise<Node[]>): Promise<State<Id, Node>>;
20
- };
21
- //# sourceMappingURL=state.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.types.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/state/state.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,MAAM,MAAM,KAAK,CACf,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAC7B;IACF,IAAI,EAAE,IAAI,GAAG,cAAc,CA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E,CAAC;CAC9B,CAAC;AAqEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,sCAEhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,sCAExC,CAAC;AAaF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,SAAS,CAAC,sBAAsB,CA0C5D,CAAC;AAEP;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,wCAIjC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;;;EAK3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;EAQnC,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;;;EAYpC,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,qBAE1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,4BAGhC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-node.arb.debug.test.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.arb.debug.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-node.impl.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.impl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,KAC5B,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,CAqGzB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-node.schemas.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,iDAA6C,CAAC;AAEhF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAC/B,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;EAoBrD"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tree-node.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-node.test.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-node.types.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer/tree-node/tree-node.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,QAAQ,CAClB,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAC7B,YAAY,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAEhD,+BAA+B;AAC/B,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,eAAe,IAAI;IACrD,EAAE,EAAE,EAAE,CAAC;IACP,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC;AAEF,gEAAgE;AAChE,MAAM,MAAM,cAAc,CACxB,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,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,EAAE,kBAAkB,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAE3E;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,MAAM,EACd,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,SAAS,EAAE,EAAE,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAC/B,MAAM,GAAG,SAAS,CAAC;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CACV,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,SAAS,EAAE,EAAE,EACnB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GACzC,IAAI,GAAG,SAAS,CAAC;CACrB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-to-effect-no-state.test.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/intent-to-effect-no-state.test.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- import { SerializableKey, TreeNode, TreeNodeApi } from '../../tree-surfer/index.js';
2
- import { Effect, Intent } from '../domain/index.js';
3
- import { CursorApi, State, StateApi } from '../../tree-surfer/index.js';
4
- /**
5
- * By design "effect = intent + state", so it awaits based on the intent and
6
- * the current state whether an effect should be executed.
7
- */
8
- export type IntentToEffect<Id extends SerializableKey, Node extends TreeNode<Id, Node>> = (intent: Intent, state: State<Id, Node>) => Effect<Id, Node> | undefined;
9
- export declare function createIntentToEffect<Id extends SerializableKey, Node extends TreeNode<Id, Node>>(stateApi: StateApi<Id, Node>, cursorApi: CursorApi<Id>, treeNodeApi: TreeNodeApi<Id, Node>): IntentToEffect<Id, Node>;
10
- //# sourceMappingURL=intent-to-effect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent-to-effect.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/intent-to-effect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAgB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAGxE;;;GAGG;AACH,MAAM,MAAM,cAAc,CACxB,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAC7B,CACF,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,KACnB,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,SAAS,CAAC;AAElC,wBAAgB,oBAAoB,CAClC,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAE/B,QAAQ,EAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAC5B,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,EACxB,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,GACjC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,CAmE1B"}
@@ -1,4 +0,0 @@
1
- import { SerializableKey, TreeNode } from '../../tree-surfer/index.js';
2
- import { Effect } from '../domain/index.js';
3
- export declare function parseCommand<Id extends SerializableKey, BufferNode extends TreeNode<Id, BufferNode>>(commandLine: string): Effect<Id, BufferNode> | undefined;
4
- //# sourceMappingURL=parse-command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-command.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/parse-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI5C,wBAAgB,YAAY,CAC1B,EAAE,SAAS,eAAe,EAC1B,UAAU,SAAS,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC,EAC3C,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC,GAAG,SAAS,CAqDzD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-input-to-intent.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/user-input-to-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,GAC7B,MAAM,GAAG,SAAS,CAQpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-input-to-intent.test.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/application/user-input-to-intent.test.ts"],"names":[],"mappings":""}
@@ -1,43 +0,0 @@
1
- import type { InputModeState } from './input-mode-state.js';
2
- import { SerializableKey, TreeNode } from '../../tree-surfer/index.js';
3
- export type Effect<Id extends SerializableKey, Node extends TreeNode<Id, Node>> = {
4
- effectType: 'dispatchEffectAction';
5
- action: EffectAction<Id, Node>;
6
- } | {
7
- effectType: 'loadBranchEntries';
8
- path: Id[];
9
- } | {
10
- effectType: 'peekFold';
11
- parentPath: readonly Id[];
12
- } | {
13
- effectType: 'saveView';
14
- name: string;
15
- overwrite: boolean;
16
- } | {
17
- effectType: 'loadView';
18
- name: string;
19
- } | {
20
- effectType: 'emitVisibleLeavesPaths';
21
- } | {
22
- effectType: 'quit';
23
- exitMessage: string;
24
- } | {
25
- effectType: 'setInputState';
26
- inputState: InputModeState;
27
- };
28
- export type EffectAction<Id extends SerializableKey, Node extends TreeNode<Id, Node>> = {
29
- effectActionType: 'nextEntry';
30
- } | {
31
- effectActionType: 'prevEntry';
32
- } | {
33
- effectActionType: 'setBranchEntries';
34
- path: Id[];
35
- entries: Node[] | null;
36
- } | {
37
- effectActionType: 'navigateToParent';
38
- } | {
39
- effectActionType: 'fold';
40
- } | {
41
- effectActionType: 'unfold';
42
- };
43
- //# sourceMappingURL=effect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEvE,MAAM,MAAM,MAAM,CAChB,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAE7B;IACE,UAAU,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;CAChC,GACD;IACE,UAAU,EAAE,mBAAmB,CAAC;IAChC,IAAI,EAAE,EAAE,EAAE,CAAC;CACZ,GACD;IACE,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC;CAC3B,GACD;IACE,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,GACD;IACE,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,UAAU,EAAE,wBAAwB,CAAC;CACtC,GACD;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,cAAc,CAAC;CAC5B,CAAC;AAGN,MAAM,MAAM,YAAY,CACtB,EAAE,SAAS,eAAe,EAC1B,IAAI,SAAS,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,IAE7B;IACE,gBAAgB,EAAE,WAAW,CAAC;CAC/B,GACD;IACE,gBAAgB,EAAE,WAAW,CAAC;CAC/B,GACD;IACE,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,IAAI,EAAE,EAAE,EAAE,CAAC;IACX,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;CACxB,GACD;IACE,gBAAgB,EAAE,kBAAkB,CAAC;CACtC,GACD;IACE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACD;IACE,gBAAgB,EAAE,QAAQ,CAAC;CAC5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-mode-state.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/input-mode-state.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACtB;IACE,SAAS,EAAE,QAAQ,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,GACD;IACE,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/intent.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GACxB;IACE,UAAU,EAAE,aAAa,CAAC;CAC3B,GACD;IACE,UAAU,EAAE,YAAY,CAAC;CAC1B,GACD;IACE,UAAU,EAAE,YAAY,CAAC;CAC1B,GACD;IACE,UAAU,EAAE,UAAU,CAAC;CACxB,GACD;IACE,UAAU,EAAE,iBAAiB,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,iBAAiB,GACzB;IACE,UAAU,EAAE,sBAAsB,CAAC;CACpC,GACD;IACE,UAAU,EAAE,gBAAgB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,UAAU,EAAE,oBAAoB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,UAAU,EAAE,qBAAqB,CAAC;CACnC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"user-input.d.ts","sourceRoot":"","sources":["../../../src/tree-surfer-ui/domain/user-input.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GACjB;IACE,aAAa,EAAE,WAAW,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,aAAa,EAAE,OAAO,CAAC;CACxB,GACD;IACE,aAAa,EAAE,WAAW,CAAC;CAC5B,GACD;IACE,aAAa,EAAE,KAAK,CAAC;CACtB,GACD;IACE,aAAa,EAAE,YAAY,CAAC;CAC7B,GACD;IACE,aAAa,EAAE,WAAW,CAAC;CAC5B,GACD;IACE,aAAa,EAAE,WAAW,CAAC;CAC5B,GACD;IACE,aAAa,EAAE,SAAS,CAAC;CAC1B,CAAC"}
File without changes
File without changes
File without changes