1
- import {
2
- CodeTween ,
3
- CodeConfig ,
4
- CodeStep ,
5
- } from "../smooth-code"
1
+ import { CodeTween , CodeStep } from "../smooth-code"
6
2
import React from "react"
7
3
import { codeToText } from "utils"
4
+ import { CodeSettings } from "../core/types"
8
5
9
6
export type CodeFile = CodeStep & {
10
7
name : string
@@ -56,7 +53,7 @@ type Snapshot = {
56
53
southTabs : TabsSnapshot | null
57
54
}
58
55
59
- function northConfig ( codeConfig : CodeConfig ) {
56
+ function northConfig ( codeConfig : CodeSettings ) {
60
57
if ( Array . isArray ( codeConfig . rows ) ) {
61
58
return {
62
59
...codeConfig ,
@@ -66,7 +63,7 @@ function northConfig(codeConfig: CodeConfig) {
66
63
return codeConfig
67
64
}
68
65
69
- function southConfig ( codeConfig : CodeConfig ) {
66
+ function southConfig ( codeConfig : CodeSettings ) {
70
67
if ( Array . isArray ( codeConfig . rows ) ) {
71
68
return {
72
69
...codeConfig ,
@@ -82,7 +79,7 @@ export function useTransition(
82
79
next : EditorStep ,
83
80
t : number ,
84
81
backward : boolean ,
85
- codeConfig : CodeConfig
82
+ codeConfig : CodeSettings
86
83
) : Transition {
87
84
// prevSnapshot has the dimensions of the editor for t=0
88
85
// nextSnapshot has the dimensions of the editor for t=1
@@ -174,7 +171,7 @@ export function useTransition(
174
171
function startingPosition (
175
172
prev : EditorStep ,
176
173
next : EditorStep ,
177
- codeConfig : CodeConfig
174
+ codeConfig : CodeSettings
178
175
) : Transition {
179
176
const inputNorthPanel = prev . northPanel
180
177
const inputSouthPanel = prev . southPanel
@@ -235,7 +232,7 @@ function startingPosition(
235
232
function endingPosition (
236
233
prev : EditorStep ,
237
234
next : EditorStep ,
238
- codeConfig : CodeConfig
235
+ codeConfig : CodeSettings
239
236
) : Transition {
240
237
const inputNorthPanel = next . northPanel
241
238
const inputSouthPanel = next . southPanel
@@ -312,7 +309,7 @@ function CodeTransition({
312
309
nextFile : CodeFile
313
310
t : number
314
311
parentHeight : string
315
- codeConfig : CodeConfig & { htmlProps ?: any }
312
+ codeConfig : CodeSettings & { htmlProps ?: any }
316
313
} ) {
317
314
const htmlProps = {
318
315
...codeConfig ?. htmlProps ,
0 commit comments