From 1cb23c4a1639f513856e73002f11394d1856ecc5 Mon Sep 17 00:00:00 2001 From: Adam Krebs Date: Tue, 6 Jun 2023 18:54:41 -0700 Subject: [PATCH] Bring back compound prop sequencing logic --- .../src/propEditors/DefaultValueIndicator.tsx | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/theatre/studio/src/propEditors/DefaultValueIndicator.tsx b/theatre/studio/src/propEditors/DefaultValueIndicator.tsx index 860db1e..c046403 100644 --- a/theatre/studio/src/propEditors/DefaultValueIndicator.tsx +++ b/theatre/studio/src/propEditors/DefaultValueIndicator.tsx @@ -6,6 +6,10 @@ import type {PathToProp} from '@theatre/shared/utils/addresses' import type SheetObject from '@theatre/core/sheetObjects/SheetObject' import type {PropTypeConfig} from '@theatre/core/propTypes' import {nextPrevCursorsTheme} from './NextPrevKeyframeCursors' +import { + isPropConfigComposite, + iteratePropType, +} from '@theatre/shared/propTypes/utils' const theme = { defaultState: { @@ -18,7 +22,9 @@ const theme = { }, } -const Container = styled.div<{hasStaticOverride: boolean}>` +const Container = styled.div<{ + hasStaticOverride: boolean +}>` width: 16px; margin: 0 0px 0 2px; display: flex; @@ -65,12 +71,15 @@ const DefaultOrStaticValueIndicator: React.FC<{ const {hasStaticOverride, obj, propConfig, pathToProp} = props const sequenceCb = () => { getStudio()!.transaction(({stateEditors}) => { - const propAddress = {...obj.address, pathToProp} + for (const {path, conf} of iteratePropType(propConfig, pathToProp)) { + if (isPropConfigComposite(conf)) continue + const propAddress = {...obj.address, pathToProp: path} - stateEditors.coreByProject.historic.sheetsById.sequence.setPrimitivePropAsSequenced( - propAddress, - propConfig, - ) + stateEditors.coreByProject.historic.sheetsById.sequence.setPrimitivePropAsSequenced( + propAddress, + propConfig, + ) + } }) } return (