@tomorrowevening/theatre-studio 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +105 -56
- package/package.json +1 -1
- package/dist/IDBStorage.js +0 -19
- package/dist/PaneManager.js +0 -112
- package/dist/Scrub.js +0 -134
- package/dist/Studio.js +0 -405
- package/dist/StudioBundle.js +0 -21
- package/dist/StudioStore/StudioStore.js +0 -163
- package/dist/StudioStore/createTransactionPrivateApi.js +0 -204
- package/dist/StudioStore/generateDiskStateRevision.js +0 -4
- package/dist/StudioStore/persistStateOfStudio.js +0 -61
- package/dist/TheatreStudio.js +0 -154
- package/dist/UI/UI.js +0 -65
- package/dist/UI/UINonSSRBits.js +0 -60
- package/dist/UIRoot/PanelsRoot.js +0 -19
- package/dist/UIRoot/PointerCapturing.js +0 -96
- package/dist/UIRoot/ProvideTheme.js +0 -9
- package/dist/UIRoot/UIRoot.js +0 -79
- package/dist/UIRoot/useKeyboardShortcuts.js +0 -158
- package/dist/checkForUpdates.js +0 -86
- package/dist/css.js +0 -116
- package/dist/getStudio.js +0 -10
- package/dist/notify.js +0 -328
- package/dist/panels/BasePanel/BasePanel.js +0 -74
- package/dist/panels/BasePanel/ExtensionPaneWrapper.js +0 -138
- package/dist/panels/BasePanel/PanelDragZone.js +0 -88
- package/dist/panels/BasePanel/PanelResizeHandle.js +0 -184
- package/dist/panels/BasePanel/PanelResizers.js +0 -14
- package/dist/panels/BasePanel/PanelWrapper.js +0 -34
- package/dist/panels/BasePanel/common.js +0 -52
- package/dist/panels/DetailPanel/DetailPanel.js +0 -146
- package/dist/panels/DetailPanel/DeterminePropEditorForDetail/DetailCompoundPropEditor.js +0 -169
- package/dist/panels/DetailPanel/DeterminePropEditorForDetail/DetailSimplePropEditor.js +0 -22
- package/dist/panels/DetailPanel/DeterminePropEditorForDetail/SingleRowPropEditor.js +0 -89
- package/dist/panels/DetailPanel/DeterminePropEditorForDetail/getDetailRowHighlightBackground.js +0 -7
- package/dist/panels/DetailPanel/DeterminePropEditorForDetail/rowIndentationFormulaCSS.js +0 -1
- package/dist/panels/DetailPanel/DeterminePropEditorForDetail.js +0 -28
- package/dist/panels/DetailPanel/EmptyState.js +0 -36
- package/dist/panels/DetailPanel/ObjectDetails.js +0 -52
- package/dist/panels/DetailPanel/ProjectDetails/StateConflictRow.js +0 -86
- package/dist/panels/DetailPanel/ProjectDetails.js +0 -98
- package/dist/panels/OutlinePanel/BaseItem.js +0 -136
- package/dist/panels/OutlinePanel/ObjectsList/ObjectItem.js +0 -14
- package/dist/panels/OutlinePanel/ObjectsList/ObjectsList.js +0 -85
- package/dist/panels/OutlinePanel/OutlinePanel.js +0 -73
- package/dist/panels/OutlinePanel/ProjectsList/ProjectListItem.js +0 -38
- package/dist/panels/OutlinePanel/ProjectsList/ProjectsList.js +0 -22
- package/dist/panels/OutlinePanel/SheetsList/SheetInstanceItem.js +0 -36
- package/dist/panels/OutlinePanel/SheetsList/SheetItem.js +0 -23
- package/dist/panels/OutlinePanel/SheetsList/SheetsList.js +0 -15
- package/dist/panels/OutlinePanel/outlinePanelUtils.js +0 -23
- package/dist/panels/SequenceEditorPanel/DopeSheet/DopeSheet.js +0 -21
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/AnyCompositeRow.js +0 -74
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/Left.js +0 -25
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/PrimitivePropRow.js +0 -97
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/PropWithChildrenRow.js +0 -15
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/SheetObjectRow.js +0 -19
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/SheetRow.js +0 -20
- package/dist/panels/SequenceEditorPanel/DopeSheet/Left/usePropHighlightMouseEnter.js +0 -33
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregateKeyframeEditor/AggregateKeyframeConnector.js +0 -187
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregateKeyframeEditor/AggregateKeyframeDot.js +0 -158
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregateKeyframeEditor/AggregateKeyframeEditor.js +0 -32
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregateKeyframeEditor/AggregateKeyframeVisualDot.js +0 -61
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregateKeyframeEditor/iif.js +0 -3
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregateKeyframeEditor/useAggregateKeyframeEditorUtils.js +0 -73
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/AggregatedKeyframeTrack/AggregatedKeyframeTrack.js +0 -407
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/BasicKeyframedTrack.js +0 -108
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/BasicKeyframeConnector.js +0 -185
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/CurveEditorPopover.js +0 -397
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/CurveSegmentEditor.js +0 -136
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/EasingOption.js +0 -52
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/SVGCurveSegment.js +0 -43
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/colors.js +0 -3
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/shared.js +0 -84
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/useFreezableMemo.js +0 -16
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/CurveEditorPopover/useUIOptionGrid.js +0 -82
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/DeterminePropEditorForSingleKeyframe.js +0 -93
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/SingleKeyframeDot.js +0 -254
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/SingleKeyframeEditor.js +0 -22
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/useSingleKeyframeInlineEditorPopover.js +0 -11
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/BasicKeyframedTrack/KeyframeEditor/useTempTransactionEditingTools.js +0 -43
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetBackground.js +0 -24
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/DopeSheetSelectionView.js +0 -272
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/FocusRangeCurtains.js +0 -88
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.js +0 -215
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/KeyframeSnapTarget.js +0 -55
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/LengthIndicator/LengthEditorPopover.js +0 -69
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/LengthIndicator/LengthIndicator.js +0 -217
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/PrimitivePropRow.js +0 -25
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/PropWithChildrenRow.js +0 -18
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/Right.js +0 -30
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/Row.js +0 -50
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/SheetObjectRow.js +0 -14
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/SheetRow.js +0 -14
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/collectAggregateKeyframes.js +0 -92
- package/dist/panels/SequenceEditorPanel/DopeSheet/Right/keyframeRowUI/ConnectorLine.js +0 -62
- package/dist/panels/SequenceEditorPanel/DopeSheet/selections.js +0 -149
- package/dist/panels/SequenceEditorPanel/DopeSheet/setCollapsedSheetObjectOrCompoundProp.js +0 -10
- package/dist/panels/SequenceEditorPanel/FrameGrid/FrameGrid.js +0 -92
- package/dist/panels/SequenceEditorPanel/FrameGrid/StampsGrid.js +0 -99
- package/dist/panels/SequenceEditorPanel/FrameGrid/createGrid.js +0 -49
- package/dist/panels/SequenceEditorPanel/FrameStampPositionProvider.js +0 -189
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/BasicKeyframedTrack.js +0 -91
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/Curve.js +0 -87
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/CurveHandle.js +0 -186
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/GraphEditorDotNonScalar.js +0 -162
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/GraphEditorDotScalar.js +0 -209
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/GraphEditorNonScalarDash.js +0 -23
- package/dist/panels/SequenceEditorPanel/GraphEditor/BasicKeyframedTrack/KeyframeEditor/KeyframeEditor.js +0 -30
- package/dist/panels/SequenceEditorPanel/GraphEditor/GraphEditor.js +0 -73
- package/dist/panels/SequenceEditorPanel/GraphEditor/PrimitivePropGraph.js +0 -20
- package/dist/panels/SequenceEditorPanel/GraphEditorToggle.js +0 -59
- package/dist/panels/SequenceEditorPanel/RightOverlay/DopeSnap.js +0 -36
- package/dist/panels/SequenceEditorPanel/RightOverlay/DopeSnapHitZoneUI.js +0 -57
- package/dist/panels/SequenceEditorPanel/RightOverlay/FocusRangeZone/FocusRangeStrip.js +0 -233
- package/dist/panels/SequenceEditorPanel/RightOverlay/FocusRangeZone/FocusRangeThumb.js +0 -217
- package/dist/panels/SequenceEditorPanel/RightOverlay/FocusRangeZone/FocusRangeZone.js +0 -181
- package/dist/panels/SequenceEditorPanel/RightOverlay/FrameStamp.js +0 -65
- package/dist/panels/SequenceEditorPanel/RightOverlay/HorizontalScrollbar.js +0 -235
- package/dist/panels/SequenceEditorPanel/RightOverlay/Markers/MarkerDot.js +0 -184
- package/dist/panels/SequenceEditorPanel/RightOverlay/Markers/MarkerEditorPopover.js +0 -65
- package/dist/panels/SequenceEditorPanel/RightOverlay/Markers/Markers.js +0 -13
- package/dist/panels/SequenceEditorPanel/RightOverlay/Playhead.js +0 -265
- package/dist/panels/SequenceEditorPanel/RightOverlay/PlayheadPositionPopover.js +0 -64
- package/dist/panels/SequenceEditorPanel/RightOverlay/RightOverlay.js +0 -35
- package/dist/panels/SequenceEditorPanel/RightOverlay/TopStrip.js +0 -31
- package/dist/panels/SequenceEditorPanel/SequenceEditorPanel.js +0 -179
- package/dist/panels/SequenceEditorPanel/VerticalScrollContainer.js +0 -42
- package/dist/panels/SequenceEditorPanel/layout/layout.js +0 -166
- package/dist/panels/SequenceEditorPanel/layout/tree.js +0 -139
- package/dist/panels/SequenceEditorPanel/whatPropIsHighlighted.js +0 -58
- package/dist/propEditors/DefaultValueIndicator.js +0 -64
- package/dist/propEditors/NextPrevKeyframeCursors.js +0 -135
- package/dist/propEditors/getNearbyKeyframesOfTrack.js +0 -46
- package/dist/propEditors/simpleEditors/BooleanPropEditor.js +0 -17
- package/dist/propEditors/simpleEditors/FilePropEditor.js +0 -118
- package/dist/propEditors/simpleEditors/ISimplePropEditorReactProps.js +0 -1
- package/dist/propEditors/simpleEditors/ImagePropEditor.js +0 -126
- package/dist/propEditors/simpleEditors/NumberPropEditor.js +0 -9
- package/dist/propEditors/simpleEditors/RgbaPropEditor.js +0 -73
- package/dist/propEditors/simpleEditors/StringLiteralPropEditor.js +0 -10
- package/dist/propEditors/simpleEditors/StringPropEditor.js +0 -6
- package/dist/propEditors/simpleEditors/simplePropEditorByPropType.js +0 -16
- package/dist/propEditors/useEditingToolsForCompoundProp.js +0 -228
- package/dist/propEditors/useEditingToolsForSimpleProp.js +0 -229
- package/dist/propEditors/utils/IEditingTools.js +0 -1
- package/dist/propEditors/utils/PropConfigForType.js +0 -1
- package/dist/propEditors/utils/getPropTypeByPointer.js +0 -48
- package/dist/propEditors/utils/propNameTextCSS.js +0 -7
- package/dist/selectors.js +0 -63
- package/dist/store/index.js +0 -184
- package/dist/store/stateEditors.js +0 -774
- package/dist/store/types/ahistoric.js +0 -1
- package/dist/store/types/ephemeral.js +0 -1
- package/dist/store/types/historic.js +0 -1
- package/dist/store/types/index.js +0 -3
- package/dist/toolbars/ExtensionToolbar/ExtensionToolbar.js +0 -51
- package/dist/toolbars/ExtensionToolbar/Toolset.js +0 -27
- package/dist/toolbars/ExtensionToolbar/tools/ExtensionFlyoutMenu.js +0 -51
- package/dist/toolbars/ExtensionToolbar/tools/IconButton.js +0 -16
- package/dist/toolbars/ExtensionToolbar/tools/Switch.js +0 -20
- package/dist/toolbars/GlobalToolbar.js +0 -142
- package/dist/toolbars/MoreMenu/MoreMenu.js +0 -133
- package/dist/toolbars/PinButton.js +0 -26
- package/dist/uiComponents/DetailPanelButton.js +0 -21
- package/dist/uiComponents/PointerEventsHandler.js +0 -80
- package/dist/uiComponents/Popover/ArrowContext.js +0 -3
- package/dist/uiComponents/Popover/BasicPopover.js +0 -35
- package/dist/uiComponents/Popover/BasicTooltip.js +0 -10
- package/dist/uiComponents/Popover/ErrorTooltip.js +0 -9
- package/dist/uiComponents/Popover/MinimalTooltip.js +0 -6
- package/dist/uiComponents/Popover/PopoverArrow.js +0 -38
- package/dist/uiComponents/Popover/TooltipContext.js +0 -46
- package/dist/uiComponents/Popover/TooltipWrapper.js +0 -103
- package/dist/uiComponents/Popover/usePopover.js +0 -132
- package/dist/uiComponents/Popover/useTooltip.js +0 -33
- package/dist/uiComponents/RoomToClick.js +0 -10
- package/dist/uiComponents/SVGIcon.js +0 -19
- package/dist/uiComponents/ShowMousePosition.js +0 -30
- package/dist/uiComponents/colorPicker/components/EditingProvider.js +0 -15
- package/dist/uiComponents/colorPicker/components/RgbaColorPicker.js +0 -31
- package/dist/uiComponents/colorPicker/components/common/Alpha.js +0 -54
- package/dist/uiComponents/colorPicker/components/common/AlphaColorPicker.js +0 -28
- package/dist/uiComponents/colorPicker/components/common/Hue.js +0 -41
- package/dist/uiComponents/colorPicker/components/common/Interactive.js +0 -142
- package/dist/uiComponents/colorPicker/components/common/Pointer.js +0 -39
- package/dist/uiComponents/colorPicker/components/common/Saturation.js +0 -44
- package/dist/uiComponents/colorPicker/hooks/useColorManipulation.js +0 -77
- package/dist/uiComponents/colorPicker/hooks/useEventCallback.js +0 -10
- package/dist/uiComponents/colorPicker/hooks/useIsomorphicLayoutEffect.js +0 -5
- package/dist/uiComponents/colorPicker/index.js +0 -1
- package/dist/uiComponents/colorPicker/types.js +0 -1
- package/dist/uiComponents/colorPicker/utils/clamp.js +0 -6
- package/dist/uiComponents/colorPicker/utils/compare.js +0 -25
- package/dist/uiComponents/colorPicker/utils/convert.js +0 -165
- package/dist/uiComponents/colorPicker/utils/round.js +0 -3
- package/dist/uiComponents/colorPicker/utils/validate.js +0 -10
- package/dist/uiComponents/createCursorLock.js +0 -2
- package/dist/uiComponents/form/BasicCheckbox.js +0 -5
- package/dist/uiComponents/form/BasicNumberInput.js +0 -261
- package/dist/uiComponents/form/BasicSelect.js +0 -58
- package/dist/uiComponents/form/BasicStringInput.js +0 -151
- package/dist/uiComponents/form/BasicSwitch.js +0 -60
- package/dist/uiComponents/icons/AddImage.js +0 -6
- package/dist/uiComponents/icons/ArrowClockwise.js +0 -6
- package/dist/uiComponents/icons/ArrowsOutCardinal.js +0 -6
- package/dist/uiComponents/icons/Bell.js +0 -6
- package/dist/uiComponents/icons/Camera.js +0 -7
- package/dist/uiComponents/icons/ChevronDown.js +0 -6
- package/dist/uiComponents/icons/ChevronLeft.js +0 -6
- package/dist/uiComponents/icons/ChevronRight.js +0 -6
- package/dist/uiComponents/icons/Cube.js +0 -6
- package/dist/uiComponents/icons/CubeFull.js +0 -6
- package/dist/uiComponents/icons/CubeHalf.js +0 -6
- package/dist/uiComponents/icons/CubeRendered.js +0 -7
- package/dist/uiComponents/icons/Details.js +0 -6
- package/dist/uiComponents/icons/DoubleChevronLeft.js +0 -6
- package/dist/uiComponents/icons/DoubleChevronRight.js +0 -6
- package/dist/uiComponents/icons/Ellipsis.js +0 -6
- package/dist/uiComponents/icons/EllipsisFill.js +0 -6
- package/dist/uiComponents/icons/GlobeSimple.js +0 -6
- package/dist/uiComponents/icons/Outline.js +0 -6
- package/dist/uiComponents/icons/Package.js +0 -6
- package/dist/uiComponents/icons/Resize.js +0 -7
- package/dist/uiComponents/icons/Trash.js +0 -6
- package/dist/uiComponents/icons/index.js +0 -20
- package/dist/uiComponents/isSafari.js +0 -2
- package/dist/uiComponents/onPointerOutside.js +0 -19
- package/dist/uiComponents/selects/BasicSelect.js +0 -24
- package/dist/uiComponents/simpleContextMenu/ContextMenu/BaseMenu.js +0 -40
- package/dist/uiComponents/simpleContextMenu/ContextMenu/ContextMenu.js +0 -87
- package/dist/uiComponents/simpleContextMenu/ContextMenu/Item.js +0 -37
- package/dist/uiComponents/simpleContextMenu/useContextMenu.js +0 -20
- package/dist/uiComponents/simpleContextMenu/useRequestContextMenu.js +0 -22
- package/dist/uiComponents/toolbar/ToolbarDropdownSelect.js +0 -7
- package/dist/uiComponents/toolbar/ToolbarIconButton.js +0 -74
- package/dist/uiComponents/toolbar/ToolbarSwitchSelect.js +0 -12
- package/dist/uiComponents/toolbar/ToolbarSwitchSelectContainer.js +0 -9
- package/dist/uiComponents/useBoundingClientRect.js +0 -13
- package/dist/uiComponents/useDebugRefreshEvery.js +0 -19
- package/dist/uiComponents/useDrag.js +0 -199
- package/dist/uiComponents/useHotspot.js +0 -30
- package/dist/uiComponents/useHover.js +0 -23
- package/dist/uiComponents/useHoverWithoutDescendants.js +0 -33
- package/dist/uiComponents/useKeyDown.js +0 -9
- package/dist/uiComponents/useKeyDownCallback.js +0 -28
- package/dist/uiComponents/useLockSet.js +0 -17
- package/dist/uiComponents/useLogger.js +0 -16
- package/dist/uiComponents/useOnClickOutside.js +0 -25
- package/dist/uiComponents/useOnKeyDown.js +0 -12
- package/dist/uiComponents/usePresence.js +0 -156
- package/dist/uiComponents/useValToAtom.js +0 -11
- package/dist/utils/absoluteDims.js +0 -7
- package/dist/utils/contextualWebComponents.js +0 -44
- package/dist/utils/copyToClipboard.js +0 -28
- package/dist/utils/derive-utils.js +0 -61
- package/dist/utils/devStringify.js +0 -20
- package/dist/utils/invariant.js +0 -79
- package/dist/utils/isMac.js +0 -2
- package/dist/utils/keyboardUtils.js +0 -23
- package/dist/utils/mousePositionD.js +0 -18
- package/dist/utils/redux/actionCreator.js +0 -15
- package/dist/utils/redux/actionCreator.test.js +0 -35
- package/dist/utils/redux/actionReducersBundle.js +0 -18
- package/dist/utils/redux/atomFromReduxStore.js +0 -11
- package/dist/utils/redux/configureStore.js +0 -18
- package/dist/utils/redux/pointerFriendlySelector.js +0 -8
- package/dist/utils/redux/withHistory/withBatchActions.js +0 -13
- package/dist/utils/redux/withHistory/withHistory.js +0 -157
- package/dist/utils/renderInPortalInContext.js +0 -38
- package/dist/utils/selectClosestHTMLAncestor.js +0 -13
- package/dist/utils/tightJsonStringify.js +0 -27
- package/dist/utils/tightJsonStringify.test.js +0 -25
- package/dist/utils/useRefAndState.js +0 -32
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { Package, Trash } from '@tomorrowevening/theatre-studio/uiComponents/icons';
|
|
2
|
-
import React, { useCallback, useEffect } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
const Container = styled.div `
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
height: 100%;
|
|
8
|
-
gap: 4px;
|
|
9
|
-
`;
|
|
10
|
-
const AddFile = styled.div `
|
|
11
|
-
position: absolute;
|
|
12
|
-
inset: -5px;
|
|
13
|
-
// rotate 45deg
|
|
14
|
-
transform: rotate(45deg);
|
|
15
|
-
--checker-color: #ededed36;
|
|
16
|
-
&:hover {
|
|
17
|
-
--checker-color: #ededed77;
|
|
18
|
-
}
|
|
19
|
-
// checkerboard background with 4px squares
|
|
20
|
-
background-image: linear-gradient(
|
|
21
|
-
45deg,
|
|
22
|
-
var(--checker-color) 25%,
|
|
23
|
-
transparent 25%
|
|
24
|
-
),
|
|
25
|
-
linear-gradient(-45deg, var(--checker-color) 25%, transparent 25%),
|
|
26
|
-
linear-gradient(45deg, transparent 75%, var(--checker-color) 75%),
|
|
27
|
-
linear-gradient(-45deg, transparent 75%, var(--checker-color) 75%);
|
|
28
|
-
background-size: 5px 5px;
|
|
29
|
-
`;
|
|
30
|
-
const InputLabel = styled.label `
|
|
31
|
-
position: relative;
|
|
32
|
-
cursor: default;
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
|
|
35
|
-
height: 18px;
|
|
36
|
-
aspect-ratio: 1;
|
|
37
|
-
display: flex;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
align-items: center;
|
|
40
|
-
font-size: 16px;
|
|
41
|
-
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
color: #ccc;
|
|
44
|
-
&:hover {
|
|
45
|
-
color: white;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
border-radius: 99999px;
|
|
49
|
-
border: 1px solid hwb(220deg 40% 52%);
|
|
50
|
-
&:hover {
|
|
51
|
-
border-color: hwb(220deg 45% 52%);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
${(props) => (props.empty ? css `` : css ``)}
|
|
55
|
-
`;
|
|
56
|
-
// file input
|
|
57
|
-
const Input = styled.input.attrs({ type: 'file' }) `
|
|
58
|
-
display: none;
|
|
59
|
-
`;
|
|
60
|
-
const DeleteButton = styled.button `
|
|
61
|
-
display: flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
outline: none;
|
|
65
|
-
background: transparent;
|
|
66
|
-
color: #a8a8a9;
|
|
67
|
-
|
|
68
|
-
border: none;
|
|
69
|
-
height: 100%;
|
|
70
|
-
aspect-ratio: 1/1;
|
|
71
|
-
|
|
72
|
-
opacity: 0;
|
|
73
|
-
|
|
74
|
-
${Container}:hover & {
|
|
75
|
-
opacity: 0.8;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
&:hover {
|
|
79
|
-
opacity: 1;
|
|
80
|
-
color: white;
|
|
81
|
-
}
|
|
82
|
-
`;
|
|
83
|
-
function FilePropEditor({ propConfig, editingTools, value, autoFocus, }) {
|
|
84
|
-
const [previewUrl, setPreviewUrl] = React.useState();
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (value) {
|
|
87
|
-
setPreviewUrl(editingTools.getAssetUrl(value));
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
setPreviewUrl(undefined);
|
|
91
|
-
}
|
|
92
|
-
}, [value]);
|
|
93
|
-
const onChange = useCallback(async (event) => {
|
|
94
|
-
const file = event.target.files[0];
|
|
95
|
-
editingTools.permanentlySetValue({ type: 'file', id: undefined });
|
|
96
|
-
const fileId = await editingTools.createAsset(file);
|
|
97
|
-
if (!fileId) {
|
|
98
|
-
editingTools.permanentlySetValue(value);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
editingTools.permanentlySetValue({
|
|
102
|
-
type: 'file',
|
|
103
|
-
id: fileId,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
event.target.value = null;
|
|
107
|
-
}, [editingTools, value]);
|
|
108
|
-
const empty = !value?.id;
|
|
109
|
-
return (React.createElement(Container, { empty: empty },
|
|
110
|
-
React.createElement(InputLabel, { empty: empty, title: empty ? 'Upload file' : `"${value.id}" (Click to upload new file)` },
|
|
111
|
-
React.createElement(Input, { type: "file", onChange: onChange, autoFocus: autoFocus }),
|
|
112
|
-
previewUrl ? React.createElement(Package, null) : React.createElement(AddFile, null)),
|
|
113
|
-
!empty && (React.createElement(DeleteButton, { title: "Delete file", onClick: () => {
|
|
114
|
-
editingTools.permanentlySetValue({ type: 'file', id: undefined });
|
|
115
|
-
} },
|
|
116
|
-
React.createElement(Trash, null)))));
|
|
117
|
-
}
|
|
118
|
-
export default FilePropEditor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Trash } from '@tomorrowevening/theatre-studio/uiComponents/icons';
|
|
2
|
-
import React, { useCallback, useEffect } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
const Container = styled.div `
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
height: 100%;
|
|
8
|
-
gap: 4px;
|
|
9
|
-
`;
|
|
10
|
-
const AddImage = styled.div `
|
|
11
|
-
position: absolute;
|
|
12
|
-
inset: -5px;
|
|
13
|
-
// rotate 45deg
|
|
14
|
-
transform: rotate(45deg);
|
|
15
|
-
--checker-color: #ededed36;
|
|
16
|
-
&:hover {
|
|
17
|
-
--checker-color: #ededed77;
|
|
18
|
-
}
|
|
19
|
-
// checkerboard background with 4px squares
|
|
20
|
-
background-image: linear-gradient(
|
|
21
|
-
45deg,
|
|
22
|
-
var(--checker-color) 25%,
|
|
23
|
-
transparent 25%
|
|
24
|
-
),
|
|
25
|
-
linear-gradient(-45deg, var(--checker-color) 25%, transparent 25%),
|
|
26
|
-
linear-gradient(45deg, transparent 75%, var(--checker-color) 75%),
|
|
27
|
-
linear-gradient(-45deg, transparent 75%, var(--checker-color) 75%);
|
|
28
|
-
background-size: 5px 5px;
|
|
29
|
-
`;
|
|
30
|
-
const InputLabel = styled.label `
|
|
31
|
-
position: relative;
|
|
32
|
-
cursor: default;
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
|
|
35
|
-
height: 18px;
|
|
36
|
-
aspect-ratio: 1;
|
|
37
|
-
display: flex;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
align-items: center;
|
|
40
|
-
font-size: 16px;
|
|
41
|
-
|
|
42
|
-
overflow: hidden;
|
|
43
|
-
color: #ccc;
|
|
44
|
-
&:hover {
|
|
45
|
-
color: white;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
border-radius: 99999px;
|
|
49
|
-
border: 1px solid hwb(220deg 40% 52%);
|
|
50
|
-
&:hover {
|
|
51
|
-
border-color: hwb(220deg 45% 52%);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
${(props) => (props.empty ? css `` : css ``)}
|
|
55
|
-
`;
|
|
56
|
-
// file input
|
|
57
|
-
const Input = styled.input.attrs({ type: 'file' }) `
|
|
58
|
-
display: none;
|
|
59
|
-
`;
|
|
60
|
-
const Preview = styled.img `
|
|
61
|
-
position: absolute;
|
|
62
|
-
inset: 0;
|
|
63
|
-
height: 100%;
|
|
64
|
-
aspect-ratio: 1;
|
|
65
|
-
|
|
66
|
-
object-fit: cover;
|
|
67
|
-
`;
|
|
68
|
-
const DeleteButton = styled.button `
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
justify-content: center;
|
|
72
|
-
outline: none;
|
|
73
|
-
background: transparent;
|
|
74
|
-
color: #a8a8a9;
|
|
75
|
-
|
|
76
|
-
border: none;
|
|
77
|
-
height: 100%;
|
|
78
|
-
aspect-ratio: 1/1;
|
|
79
|
-
|
|
80
|
-
opacity: 0;
|
|
81
|
-
|
|
82
|
-
${Container}:hover & {
|
|
83
|
-
opacity: 0.8;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:hover {
|
|
87
|
-
opacity: 1;
|
|
88
|
-
color: white;
|
|
89
|
-
}
|
|
90
|
-
`;
|
|
91
|
-
function ImagePropEditor({ propConfig, editingTools, value, autoFocus, }) {
|
|
92
|
-
const [previewUrl, setPreviewUrl] = React.useState();
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
if (value) {
|
|
95
|
-
setPreviewUrl(editingTools.getAssetUrl(value));
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
setPreviewUrl(undefined);
|
|
99
|
-
}
|
|
100
|
-
}, [value]);
|
|
101
|
-
const onChange = useCallback(async (event) => {
|
|
102
|
-
const file = event.target.files[0];
|
|
103
|
-
editingTools.permanentlySetValue({ type: 'image', id: undefined });
|
|
104
|
-
const imageId = await editingTools.createAsset(file);
|
|
105
|
-
if (!imageId) {
|
|
106
|
-
editingTools.permanentlySetValue(value);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
editingTools.permanentlySetValue({
|
|
110
|
-
type: 'image',
|
|
111
|
-
id: imageId,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
event.target.value = null;
|
|
115
|
-
}, [editingTools, value]);
|
|
116
|
-
const empty = !value?.id;
|
|
117
|
-
return (React.createElement(Container, { empty: empty },
|
|
118
|
-
React.createElement(InputLabel, { empty: empty, title: empty ? 'Upload image' : `"${value.id}" (Click to upload new image)` },
|
|
119
|
-
React.createElement(Input, { type: "file", onChange: onChange, accept: "image/*,.hdr", autoFocus: autoFocus }),
|
|
120
|
-
previewUrl ? React.createElement(Preview, { src: previewUrl }) : React.createElement(AddImage, null)),
|
|
121
|
-
!empty && (React.createElement(DeleteButton, { title: "Delete image", onClick: () => {
|
|
122
|
-
editingTools.permanentlySetValue({ type: 'image', id: undefined });
|
|
123
|
-
} },
|
|
124
|
-
React.createElement(Trash, null)))));
|
|
125
|
-
}
|
|
126
|
-
export default ImagePropEditor;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import BasicNumberInput from '@tomorrowevening/theatre-studio/uiComponents/form/BasicNumberInput';
|
|
2
|
-
import React, { useCallback } from 'react';
|
|
3
|
-
function NumberPropEditor({ propConfig, editingTools, value, autoFocus, }) {
|
|
4
|
-
const nudge = useCallback((params) => {
|
|
5
|
-
return propConfig.nudgeFn({ ...params, config: propConfig });
|
|
6
|
-
}, [propConfig]);
|
|
7
|
-
return (React.createElement(BasicNumberInput, { value: value, temporarilySetValue: editingTools.temporarilySetValue, discardTemporaryValue: editingTools.discardTemporaryValue, permanentlySetValue: editingTools.permanentlySetValue, range: propConfig.range, nudge: nudge, autoFocus: autoFocus }));
|
|
8
|
-
}
|
|
9
|
-
export default NumberPropEditor;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { validHexRegExp } from '@tomorrowevening/theatre-shared/utils/color';
|
|
2
|
-
import { decorateRgba, rgba2hex, parseRgbaFromHex, } from '@tomorrowevening/theatre-shared/utils/color';
|
|
3
|
-
import React, { useCallback, useRef } from 'react';
|
|
4
|
-
import { RgbaColorPicker } from '@tomorrowevening/theatre-studio/uiComponents/colorPicker';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import usePopover from '@tomorrowevening/theatre-studio/uiComponents/Popover/usePopover';
|
|
7
|
-
import BasicStringInput from '@tomorrowevening/theatre-studio/uiComponents/form/BasicStringInput';
|
|
8
|
-
import { popoverBackgroundColor } from '@tomorrowevening/theatre-studio/uiComponents/Popover/BasicPopover';
|
|
9
|
-
const RowContainer = styled.div `
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
height: 100%;
|
|
13
|
-
gap: 4px;
|
|
14
|
-
`;
|
|
15
|
-
const ColorPreviewPuck = styled.div.attrs((props) => ({
|
|
16
|
-
style: {
|
|
17
|
-
// weirdly, rgba2hex is needed to ensure initial render was correct background?
|
|
18
|
-
// huge head scratcher.
|
|
19
|
-
background: rgba2hex(props.rgbaColor),
|
|
20
|
-
},
|
|
21
|
-
})) `
|
|
22
|
-
height: 18px;
|
|
23
|
-
aspect-ratio: 1;
|
|
24
|
-
border-radius: 99999px;
|
|
25
|
-
`;
|
|
26
|
-
const HexInput = styled(BasicStringInput) `
|
|
27
|
-
flex: 1;
|
|
28
|
-
`;
|
|
29
|
-
const noop = () => { };
|
|
30
|
-
const RgbaPopover = styled.div `
|
|
31
|
-
position: absolute;
|
|
32
|
-
background-color: ${popoverBackgroundColor};
|
|
33
|
-
color: white;
|
|
34
|
-
margin: 0;
|
|
35
|
-
cursor: default;
|
|
36
|
-
border-radius: 3px;
|
|
37
|
-
z-index: 10000;
|
|
38
|
-
backdrop-filter: blur(8px);
|
|
39
|
-
|
|
40
|
-
padding: 4px;
|
|
41
|
-
pointer-events: all;
|
|
42
|
-
|
|
43
|
-
border: none;
|
|
44
|
-
box-shadow: none;
|
|
45
|
-
`;
|
|
46
|
-
function RgbaPropEditor({ editingTools, value, autoFocus, }) {
|
|
47
|
-
const containerRef = useRef(null);
|
|
48
|
-
const onChange = useCallback((color) => {
|
|
49
|
-
const rgba = decorateRgba(parseRgbaFromHex(color));
|
|
50
|
-
editingTools.permanentlySetValue(rgba);
|
|
51
|
-
}, [editingTools]);
|
|
52
|
-
const popover = usePopover({ debugName: 'RgbaPropEditor' }, () => (React.createElement(RgbaPopover, null,
|
|
53
|
-
React.createElement(RgbaColorPicker, { color: {
|
|
54
|
-
r: value.r,
|
|
55
|
-
g: value.g,
|
|
56
|
-
b: value.b,
|
|
57
|
-
a: value.a,
|
|
58
|
-
}, temporarilySetValue: (color) => {
|
|
59
|
-
const rgba = decorateRgba(color);
|
|
60
|
-
editingTools.temporarilySetValue(rgba);
|
|
61
|
-
}, permanentlySetValue: (color) => {
|
|
62
|
-
const rgba = decorateRgba(color);
|
|
63
|
-
editingTools.permanentlySetValue(rgba);
|
|
64
|
-
}, discardTemporaryValue: editingTools.discardTemporaryValue }))));
|
|
65
|
-
return (React.createElement(React.Fragment, null,
|
|
66
|
-
React.createElement(RowContainer, null,
|
|
67
|
-
React.createElement(ColorPreviewPuck, { rgbaColor: value, ref: containerRef, onClick: (e) => {
|
|
68
|
-
popover.toggle(e, containerRef.current);
|
|
69
|
-
} }),
|
|
70
|
-
React.createElement(HexInput, { value: rgba2hex(value, { removeAlphaIfOpaque: true }), temporarilySetValue: noop, discardTemporaryValue: noop, permanentlySetValue: onChange, isValid: (v) => !!v.match(validHexRegExp), autoFocus: autoFocus })),
|
|
71
|
-
popover.node));
|
|
72
|
-
}
|
|
73
|
-
export default RgbaPropEditor;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import BasicSwitch from '@tomorrowevening/theatre-studio/uiComponents/form/BasicSwitch';
|
|
3
|
-
import BasicSelect from '@tomorrowevening/theatre-studio/uiComponents/form/BasicSelect';
|
|
4
|
-
function StringLiteralPropEditor({ propConfig, editingTools, value, autoFocus, }) {
|
|
5
|
-
const onChange = useCallback((val) => {
|
|
6
|
-
editingTools.permanentlySetValue(val);
|
|
7
|
-
}, [propConfig, editingTools]);
|
|
8
|
-
return propConfig.as === 'menu' ? (React.createElement(BasicSelect, { value: value, onChange: onChange, options: propConfig.valuesAndLabels, autoFocus: autoFocus })) : (React.createElement(BasicSwitch, { value: value, onChange: onChange, options: propConfig.valuesAndLabels, autoFocus: autoFocus }));
|
|
9
|
-
}
|
|
10
|
-
export default StringLiteralPropEditor;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import BasicStringInput from '@tomorrowevening/theatre-studio/uiComponents/form/BasicStringInput';
|
|
3
|
-
function StringPropEditor({ editingTools, value, autoFocus, }) {
|
|
4
|
-
return (React.createElement(BasicStringInput, { value: value, temporarilySetValue: editingTools.temporarilySetValue, discardTemporaryValue: editingTools.discardTemporaryValue, permanentlySetValue: editingTools.permanentlySetValue, autoFocus: autoFocus }));
|
|
5
|
-
}
|
|
6
|
-
export default StringPropEditor;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import BooleanPropEditor from './BooleanPropEditor';
|
|
2
|
-
import NumberPropEditor from './NumberPropEditor';
|
|
3
|
-
import StringLiteralPropEditor from './StringLiteralPropEditor';
|
|
4
|
-
import StringPropEditor from './StringPropEditor';
|
|
5
|
-
import RgbaPropEditor from './RgbaPropEditor';
|
|
6
|
-
import ImagePropEditor from './ImagePropEditor';
|
|
7
|
-
import FilePropEditor from './FilePropEditor';
|
|
8
|
-
export const simplePropEditorByPropType = {
|
|
9
|
-
number: NumberPropEditor,
|
|
10
|
-
string: StringPropEditor,
|
|
11
|
-
boolean: BooleanPropEditor,
|
|
12
|
-
stringLiteral: StringLiteralPropEditor,
|
|
13
|
-
rgba: RgbaPropEditor,
|
|
14
|
-
image: ImagePropEditor,
|
|
15
|
-
file: FilePropEditor,
|
|
16
|
-
};
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
2
|
-
import getDeep from '@tomorrowevening/theatre-shared/utils/getDeep';
|
|
3
|
-
import { usePrism } from '@tomorrowevening/theatre-react';
|
|
4
|
-
import { getPointerParts, prism, val } from '@tomorrowevening/theatre-dataverse';
|
|
5
|
-
import get from 'lodash-es/get';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import DefaultOrStaticValueIndicator from './DefaultValueIndicator';
|
|
8
|
-
import { compoundHasSimpleDescendants, isPropConfigComposite, iteratePropType, } from '@tomorrowevening/theatre-shared/propTypes/utils';
|
|
9
|
-
import { createStudioSheetItemKey } from '@tomorrowevening/theatre-shared/utils/ids';
|
|
10
|
-
import pointerDeep from '@tomorrowevening/theatre-shared/utils/pointerDeep';
|
|
11
|
-
import NextPrevKeyframeCursors from './NextPrevKeyframeCursors';
|
|
12
|
-
import { getNearbyKeyframesOfTrack } from './getNearbyKeyframesOfTrack';
|
|
13
|
-
import { emptyObject } from '@tomorrowevening/theatre-shared/utils';
|
|
14
|
-
export function useEditingToolsForCompoundProp(pointerToProp, obj, propConfig) {
|
|
15
|
-
const pathToProp = getPointerParts(pointerToProp).path;
|
|
16
|
-
return usePrism(() => {
|
|
17
|
-
// if the compound has no simple descendants, then there isn't much the user can do with it
|
|
18
|
-
if (!compoundHasSimpleDescendants(propConfig)) {
|
|
19
|
-
return {
|
|
20
|
-
type: 'AllStatic',
|
|
21
|
-
beingScrubbed: false,
|
|
22
|
-
contextMenuItems: [],
|
|
23
|
-
controlIndicators: (React.createElement(DefaultOrStaticValueIndicator, { hasStaticOverride: false, obj: obj, pathToProp: pathToProp, propConfig: propConfig })),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* TODO This implementation is wrong because {@link stateEditors.studio.ephemeral.projects.stateByProjectId.stateBySheetId.stateByObjectKey.propsBeingScrubbed.flag}
|
|
28
|
-
* does not prune empty objects
|
|
29
|
-
*/
|
|
30
|
-
const someDescendantsBeingScrubbed = !!val(get(getStudio().atomP.ephemeral.projects.stateByProjectId[obj.address.projectId].stateBySheetId[obj.address.sheetId].stateByObjectKey[obj.address.objectKey].valuesBeingScrubbed, getPointerParts(pointerToProp).path));
|
|
31
|
-
const contextMenuItems = [];
|
|
32
|
-
const common = {
|
|
33
|
-
beingScrubbed: someDescendantsBeingScrubbed,
|
|
34
|
-
contextMenuItems,
|
|
35
|
-
controlIndicators: React.createElement(React.Fragment, null),
|
|
36
|
-
};
|
|
37
|
-
const validSequencedTracks = val(obj.template.getMapOfValidSequenceTracks_forStudio());
|
|
38
|
-
const possibleSequenceTrackIds = getDeep(validSequencedTracks, pathToProp);
|
|
39
|
-
const hasOneOrMoreSequencedTracks = possibleSequenceTrackIds !== undefined &&
|
|
40
|
-
Object.keys(possibleSequenceTrackIds).length !== 0; // check if object is empty or undefined
|
|
41
|
-
const listOfDescendantTrackIds = [];
|
|
42
|
-
const allStaticOverrides = val(obj.template.getStaticButNotSequencedOverrides());
|
|
43
|
-
const staticOverrides = getDeep(allStaticOverrides ?? emptyObject, pathToProp);
|
|
44
|
-
let hasStatics = staticOverrides !== undefined;
|
|
45
|
-
if (hasOneOrMoreSequencedTracks) {
|
|
46
|
-
for (const descendant of iteratePropType(propConfig, [])) {
|
|
47
|
-
if (isPropConfigComposite(descendant.conf))
|
|
48
|
-
continue;
|
|
49
|
-
const sequencedTrackIdBelongingToDescendant = getDeep(possibleSequenceTrackIds, descendant.path);
|
|
50
|
-
if (typeof sequencedTrackIdBelongingToDescendant !== 'string') {
|
|
51
|
-
hasStatics = true;
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
listOfDescendantTrackIds.push(sequencedTrackIdBelongingToDescendant);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (hasStatics || hasOneOrMoreSequencedTracks) {
|
|
59
|
-
contextMenuItems.push({
|
|
60
|
-
label: 'Reset all to default',
|
|
61
|
-
callback: () => {
|
|
62
|
-
getStudio().transaction(({ unset }) => {
|
|
63
|
-
unset(pointerToProp);
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (hasOneOrMoreSequencedTracks) {
|
|
69
|
-
contextMenuItems.push({
|
|
70
|
-
label: 'Make all static',
|
|
71
|
-
callback: () => {
|
|
72
|
-
getStudio().transaction(({ stateEditors }) => {
|
|
73
|
-
for (const { path: subPath, conf } of iteratePropType(propConfig, [])) {
|
|
74
|
-
if (isPropConfigComposite(conf))
|
|
75
|
-
continue;
|
|
76
|
-
const propAddress = {
|
|
77
|
-
...obj.address,
|
|
78
|
-
pathToProp: [...pathToProp, ...subPath],
|
|
79
|
-
};
|
|
80
|
-
const pointerToSub = pointerDeep(pointerToProp, subPath);
|
|
81
|
-
stateEditors.coreByProject.historic.sheetsById.sequence.setPrimitivePropAsStatic({
|
|
82
|
-
...propAddress,
|
|
83
|
-
value: obj.getValueByPointer(pointerToSub),
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
},
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (!hasOneOrMoreSequencedTracks ||
|
|
91
|
-
(hasOneOrMoreSequencedTracks && hasStatics)) {
|
|
92
|
-
contextMenuItems.push({
|
|
93
|
-
label: 'Sequence all',
|
|
94
|
-
callback: () => {
|
|
95
|
-
getStudio().transaction(({ stateEditors }) => {
|
|
96
|
-
for (const { path, conf } of iteratePropType(propConfig, pathToProp)) {
|
|
97
|
-
if (isPropConfigComposite(conf))
|
|
98
|
-
continue;
|
|
99
|
-
const propAddress = { ...obj.address, pathToProp: path };
|
|
100
|
-
stateEditors.coreByProject.historic.sheetsById.sequence.setPrimitivePropAsSequenced(propAddress, propConfig);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
if (hasOneOrMoreSequencedTracks) {
|
|
107
|
-
const controlIndicators = prism.memo(`controlIndicators`, () => (React.createElement(ControlIndicators, { pointerToProp,
|
|
108
|
-
obj,
|
|
109
|
-
possibleSequenceTrackIds,
|
|
110
|
-
listOfDescendantTrackIds })), [possibleSequenceTrackIds, listOfDescendantTrackIds]);
|
|
111
|
-
const ret = {
|
|
112
|
-
...common,
|
|
113
|
-
type: 'HasSequences',
|
|
114
|
-
controlIndicators,
|
|
115
|
-
};
|
|
116
|
-
return ret;
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
return {
|
|
120
|
-
...common,
|
|
121
|
-
type: 'AllStatic',
|
|
122
|
-
controlIndicators: (React.createElement(DefaultOrStaticValueIndicator, { hasStaticOverride: hasStatics, obj: obj, pathToProp: pathToProp, propConfig: propConfig })),
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
}, []);
|
|
126
|
-
}
|
|
127
|
-
function ControlIndicators({ pointerToProp, obj, possibleSequenceTrackIds, listOfDescendantTrackIds, }) {
|
|
128
|
-
return usePrism(() => {
|
|
129
|
-
const pathToProp = getPointerParts(pointerToProp).path;
|
|
130
|
-
const sequencePosition = val(obj.sheet.getSequence().positionPrism);
|
|
131
|
-
/*
|
|
132
|
-
2/10 perf concern:
|
|
133
|
-
When displaying a hierarchy like {props: {transform: {position: {x, y, z}}}},
|
|
134
|
-
we'd be recalculating this variable for both `position` and `transform`. While
|
|
135
|
-
we _could_ be re-using the calculation of `transform` in `position`, I think
|
|
136
|
-
it's unlikely that this optimization would matter.
|
|
137
|
-
*/
|
|
138
|
-
const nearbyKeyframesInEachTrack = listOfDescendantTrackIds
|
|
139
|
-
.map((trackId) => ({
|
|
140
|
-
trackId,
|
|
141
|
-
track: val(obj.template.project.pointers.historic.sheetsById[obj.address.sheetId]
|
|
142
|
-
.sequence.tracksByObject[obj.address.objectKey].trackData[trackId]),
|
|
143
|
-
}))
|
|
144
|
-
.filter(({ track }) => !!track)
|
|
145
|
-
.map((s) => ({
|
|
146
|
-
...s,
|
|
147
|
-
nearbies: getNearbyKeyframesOfTrack(obj, { id: s.trackId, data: s.track, sheetObject: obj }, sequencePosition),
|
|
148
|
-
}));
|
|
149
|
-
const hasCur = nearbyKeyframesInEachTrack.find(({ nearbies }) => !!nearbies.cur);
|
|
150
|
-
const allCur = nearbyKeyframesInEachTrack.every(({ nearbies }) => !!nearbies.cur);
|
|
151
|
-
const closestPrev = nearbyKeyframesInEachTrack.reduce((acc, s) => {
|
|
152
|
-
if (s.nearbies.prev) {
|
|
153
|
-
if (acc === undefined ||
|
|
154
|
-
s.nearbies.prev.kf.position > acc.kf.position) {
|
|
155
|
-
return s.nearbies.prev;
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
return acc;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
return acc;
|
|
163
|
-
}
|
|
164
|
-
}, undefined);
|
|
165
|
-
const closestNext = nearbyKeyframesInEachTrack.reduce((acc, s) => {
|
|
166
|
-
if (s.nearbies.next) {
|
|
167
|
-
if (acc === undefined ||
|
|
168
|
-
s.nearbies.next.kf.position < acc.kf.position) {
|
|
169
|
-
return s.nearbies.next;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
return acc;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
else {
|
|
176
|
-
return acc;
|
|
177
|
-
}
|
|
178
|
-
}, undefined);
|
|
179
|
-
const toggle = () => {
|
|
180
|
-
if (allCur) {
|
|
181
|
-
getStudio().transaction((api) => {
|
|
182
|
-
api.unset(pointerToProp);
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
else if (hasCur) {
|
|
186
|
-
getStudio().transaction((api) => {
|
|
187
|
-
api.set(pointerToProp, val(pointerToProp));
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
else {
|
|
191
|
-
getStudio().transaction((api) => {
|
|
192
|
-
api.set(pointerToProp, val(pointerToProp));
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
const pr = {
|
|
197
|
-
cur: hasCur
|
|
198
|
-
? {
|
|
199
|
-
type: 'on',
|
|
200
|
-
itemKey: createStudioSheetItemKey.forCompoundPropAggregateKeyframe(obj, pathToProp, sequencePosition),
|
|
201
|
-
toggle,
|
|
202
|
-
}
|
|
203
|
-
: {
|
|
204
|
-
toggle,
|
|
205
|
-
type: 'off',
|
|
206
|
-
},
|
|
207
|
-
prev: closestPrev !== undefined
|
|
208
|
-
? {
|
|
209
|
-
position: closestPrev.kf.position,
|
|
210
|
-
itemKey: createStudioSheetItemKey.forCompoundPropAggregateKeyframe(obj, pathToProp, closestPrev.kf.position),
|
|
211
|
-
jump: () => {
|
|
212
|
-
obj.sheet.getSequence().position = closestPrev.kf.position;
|
|
213
|
-
},
|
|
214
|
-
}
|
|
215
|
-
: undefined,
|
|
216
|
-
next: closestNext !== undefined
|
|
217
|
-
? {
|
|
218
|
-
position: closestNext.kf.position,
|
|
219
|
-
itemKey: createStudioSheetItemKey.forCompoundPropAggregateKeyframe(obj, pathToProp, closestNext.kf.position),
|
|
220
|
-
jump: () => {
|
|
221
|
-
obj.sheet.getSequence().position = closestNext.kf.position;
|
|
222
|
-
},
|
|
223
|
-
}
|
|
224
|
-
: undefined,
|
|
225
|
-
};
|
|
226
|
-
return React.createElement(NextPrevKeyframeCursors, { ...pr });
|
|
227
|
-
}, [pointerToProp, obj, possibleSequenceTrackIds, listOfDescendantTrackIds]);
|
|
228
|
-
}
|