@@ -56,6 +56,26 @@ type Snapshot = {
5656 southTabs : TabsSnapshot | null
5757}
5858
59+ function northConfig ( codeConfig : CodeConfig ) {
60+ if ( Array . isArray ( codeConfig . rows ) ) {
61+ return {
62+ ...codeConfig ,
63+ rows : codeConfig . rows [ 0 ] ,
64+ }
65+ }
66+ return codeConfig
67+ }
68+
69+ function southConfig ( codeConfig : CodeConfig ) {
70+ if ( Array . isArray ( codeConfig . rows ) ) {
71+ return {
72+ ...codeConfig ,
73+ rows : codeConfig . rows [ 1 ] ,
74+ }
75+ }
76+ return codeConfig
77+ }
78+
5979export function useTransition (
6080 ref : React . RefObject < HTMLDivElement > ,
6181 prev : EditorStep ,
@@ -119,7 +139,7 @@ export function useTransition(
119139 style : northStyle ,
120140 children : (
121141 < CodeTransition
122- codeConfig = { codeConfig }
142+ codeConfig = { northConfig ( codeConfig ) }
123143 prevFile = { prevNorthFile }
124144 nextFile = { nextNorthFile }
125145 t = { t }
@@ -136,7 +156,7 @@ export function useTransition(
136156 style : southStyle ! ,
137157 children : (
138158 < CodeTransition
139- codeConfig = { codeConfig }
159+ codeConfig = { southConfig ( codeConfig ) }
140160 prevFile = { prevSouthFile ! }
141161 nextFile = { nextSouthFile ! }
142162 t = { t }
@@ -180,7 +200,7 @@ function startingPosition(
180200 } ,
181201 children : (
182202 < CodeTransition
183- codeConfig = { codeConfig }
203+ codeConfig = { northConfig ( codeConfig ) }
184204 prevFile = { prevNorthFile }
185205 nextFile = { prevNorthFile }
186206 t = { 0 }
@@ -201,7 +221,7 @@ function startingPosition(
201221 } ,
202222 children : (
203223 < CodeTransition
204- codeConfig = { codeConfig }
224+ codeConfig = { southConfig ( codeConfig ) }
205225 prevFile = { prevSouthFile ! }
206226 nextFile = { prevSouthFile ! }
207227 t = { 0 }
@@ -249,7 +269,7 @@ function endingPosition(
249269 } ,
250270 children : (
251271 < CodeTransition
252- codeConfig = { codeConfig }
272+ codeConfig = { northConfig ( codeConfig ) }
253273 prevFile = { nextNorthFile }
254274 nextFile = { nextNorthFile }
255275 t = { 1 }
@@ -270,7 +290,7 @@ function endingPosition(
270290 } ,
271291 children : (
272292 < CodeTransition
273- codeConfig = { codeConfig }
293+ codeConfig = { southConfig ( codeConfig ) }
274294 prevFile = { nextSouthFile ! }
275295 nextFile = { nextSouthFile ! }
276296 t = { 1 }
0 commit comments