@@ -51,7 +51,8 @@ export default function (
51
51
52
52
const leaves = computed ( getLeaves ) ;
53
53
54
- const atlas = toReactive ( computed ( getAtlas ) ) ;
54
+ const arrLeaves = toReactive ( leaves ) ,
55
+ objLeaves = toReactive ( computed ( getObjLeaves ) ) ;
55
56
56
57
function getLeaves ( ) {
57
58
return getSiblingLeaves ( { value } ) ;
@@ -83,7 +84,7 @@ export default function (
83
84
return siblings . value . flatMap ( defineProperties ) ;
84
85
}
85
86
86
- function getAtlas ( ) {
87
+ function getObjLeaves ( ) {
87
88
return Object . fromEntries ( leaves . value . map ( getLeafEntry ) ) ;
88
89
}
89
90
@@ -94,7 +95,7 @@ export default function (
94
95
}
95
96
96
97
function add ( pId : string ) {
97
- const the = atlas [ pId ] ;
98
+ const the = objLeaves [ pId ] ;
98
99
if ( the ) {
99
100
const children = the [ keyChildren ] as
100
101
| Record < string , unknown > [ ]
@@ -119,7 +120,7 @@ export default function (
119
120
}
120
121
121
122
function down ( pId : string ) {
122
- const the = atlas [ pId ] ;
123
+ const the = objLeaves [ pId ] ;
123
124
if ( the ) {
124
125
const index = the [ keyIndex ] as number ,
125
126
nextIndex = index + 1 ,
@@ -133,7 +134,7 @@ export default function (
133
134
}
134
135
135
136
function left ( pId : string ) {
136
- const the = atlas [ pId ] ;
137
+ const the = objLeaves [ pId ] ;
137
138
if ( the ) {
138
139
const parent = the [ keyParent ] as Record < string , unknown > | undefined ;
139
140
if ( parent ?. [ keyParent ] ) {
@@ -154,7 +155,7 @@ export default function (
154
155
}
155
156
156
157
function remove ( pId : string ) {
157
- const the = atlas [ pId ] ;
158
+ const the = objLeaves [ pId ] ;
158
159
if ( the ) {
159
160
const parent = the [ keyParent ] as Record < string , unknown > | undefined ;
160
161
if ( parent ) {
@@ -174,7 +175,7 @@ export default function (
174
175
}
175
176
176
177
function right ( pId : string ) {
177
- const the = atlas [ pId ] ;
178
+ const the = objLeaves [ pId ] ;
178
179
if ( the ) {
179
180
const prev = the [ keyPrev ] as Record < string , unknown > | undefined ;
180
181
if ( prev ) {
@@ -192,7 +193,7 @@ export default function (
192
193
}
193
194
194
195
function up ( pId : string ) {
195
- const the = atlas [ pId ] ;
196
+ const the = objLeaves [ pId ] ;
196
197
if ( the ) {
197
198
const index = the [ keyIndex ] as number ,
198
199
prevIndex = index - 1 ,
@@ -205,5 +206,5 @@ export default function (
205
206
}
206
207
}
207
208
208
- return { add, atlas , down, leaves, left, remove, right, up } ;
209
+ return { add, arrLeaves , down, leaves, left, objLeaves , remove, right, up } ;
209
210
}
0 commit comments