refactor: Assorted VFCs, dead code removal, use Nominals in ahistoric

This commit is contained in:
Cole Lawrence 2022-05-16 13:38:00 -04:00
parent 84daaaf94a
commit 9400aa12a1
6 changed files with 10 additions and 15 deletions

View file

@ -6,7 +6,7 @@ import {useVal} from '@theatre/react'
import ExtensionPaneWrapper from '@theatre/studio/panels/BasePanel/ExtensionPaneWrapper' import ExtensionPaneWrapper from '@theatre/studio/panels/BasePanel/ExtensionPaneWrapper'
import SequenceEditorPanel from '@theatre/studio/panels/SequenceEditorPanel/SequenceEditorPanel' import SequenceEditorPanel from '@theatre/studio/panels/SequenceEditorPanel/SequenceEditorPanel'
const PanelsRoot: React.FC = () => { const PanelsRoot: React.VFC = () => {
const panes = useVal(getStudio().paneManager.allPanesD) const panes = useVal(getStudio().paneManager.allPanesD)
const paneEls = Object.entries(panes).map(([instanceId, paneInstance]) => { const paneEls = Object.entries(panes).map(([instanceId, paneInstance]) => {
return ( return (

View file

@ -14,7 +14,7 @@ const Container = styled.div`
right: 0; right: 0;
` `
const DopeSheet: React.FC<{layoutP: Pointer<SequenceEditorPanelLayout>}> = ({ const DopeSheet: React.VFC<{layoutP: Pointer<SequenceEditorPanelLayout>}> = ({
layoutP, layoutP,
}) => { }) => {
const height = useVal(layoutP.dopeSheetDims.height) const height = useVal(layoutP.dopeSheetDims.height)

View file

@ -18,7 +18,7 @@ const ListContainer = styled.ul`
list-style: none; list-style: none;
` `
const Left: React.FC<{ const Left: React.VFC<{
layoutP: Pointer<SequenceEditorPanelLayout> layoutP: Pointer<SequenceEditorPanelLayout>
}> = ({layoutP}) => { }> = ({layoutP}) => {
return usePrism(() => { return usePrism(() => {

View file

@ -1,12 +1,9 @@
import type {SequenceEditorTree_Sheet} from '@theatre/studio/panels/SequenceEditorPanel/layout/tree' import type {SequenceEditorTree_Sheet} from '@theatre/studio/panels/SequenceEditorPanel/layout/tree'
import {usePrism} from '@theatre/react' import {usePrism} from '@theatre/react'
import React from 'react' import React from 'react'
import styled from 'styled-components'
import SheetObjectRow from './SheetObjectRow' import SheetObjectRow from './SheetObjectRow'
const Container = styled.div`` const SheetRow: React.VFC<{
const SheetRow: React.FC<{
leaf: SequenceEditorTree_Sheet leaf: SequenceEditorTree_Sheet
}> = ({leaf}) => { }> = ({leaf}) => {
return usePrism(() => { return usePrism(() => {

View file

@ -3,18 +3,13 @@ import type {SequenceEditorTree_Sheet} from '@theatre/studio/panels/SequenceEdit
import {usePrism} from '@theatre/react' import {usePrism} from '@theatre/react'
import type {Pointer} from '@theatre/dataverse' import type {Pointer} from '@theatre/dataverse'
import React from 'react' import React from 'react'
import styled from 'styled-components'
import SheetObjectRow from './SheetObjectRow' import SheetObjectRow from './SheetObjectRow'
const Container = styled.div``
const SheetRow: React.FC<{ const SheetRow: React.FC<{
leaf: SequenceEditorTree_Sheet leaf: SequenceEditorTree_Sheet
layoutP: Pointer<SequenceEditorPanelLayout> layoutP: Pointer<SequenceEditorPanelLayout>
}> = ({leaf, layoutP}) => { }> = ({leaf, layoutP}) => {
return usePrism(() => { return usePrism(() => {
const node = <div />
return ( return (
<> <>
{leaf.children.map((sheetObjectLeaf) => ( {leaf.children.map((sheetObjectLeaf) => (

View file

@ -1,6 +1,9 @@
import type {ProjectState} from '@theatre/core/projects/store/storeTypes' import type {ProjectState} from '@theatre/core/projects/store/storeTypes'
import type {Keyframe} from '@theatre/core/projects/store/types/SheetState_Historic' import type {Keyframe} from '@theatre/core/projects/store/types/SheetState_Historic'
import type {ProjectId} from '@theatre/shared/utils/ids' import type {
ProjectId,
SheetId,
} from '@theatre/shared/utils/ids'
import type {IRange, StrictRecord} from '@theatre/shared/utils/types' import type {IRange, StrictRecord} from '@theatre/shared/utils/types'
export type StudioAhistoricState = { export type StudioAhistoricState = {
@ -18,10 +21,10 @@ export type StudioAhistoricState = {
} }
projects: { projects: {
stateByProjectId: StrictRecord< stateByProjectId: StrictRecord<
string, ProjectId,
{ {
stateBySheetId: StrictRecord< stateBySheetId: StrictRecord<
string, SheetId,
{ {
sequence?: { sequence?: {
/** /**