@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,88 +0,0 @@
|
|
|
1
|
-
import { prism, val } from '@tomorrowevening/theatre-dataverse';
|
|
2
|
-
import { usePrism } from '@tomorrowevening/theatre-react';
|
|
3
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
4
|
-
import { topStripHeight } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/RightOverlay/TopStrip';
|
|
5
|
-
import React, { useMemo } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
const divWidth = 1000;
|
|
8
|
-
const Curtain = styled.div `
|
|
9
|
-
position: absolute;
|
|
10
|
-
top: ${topStripHeight}px;
|
|
11
|
-
left: 0;
|
|
12
|
-
opacity: 0.15;
|
|
13
|
-
width: ${divWidth}px;
|
|
14
|
-
transform-origin: top left;
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
background-color: ${(props) => (props.enabled ? '#000000' : 'transparent')};
|
|
17
|
-
`;
|
|
18
|
-
const FocusRangeCurtains = ({ layoutP }) => {
|
|
19
|
-
const existingRangeD = useMemo(() => prism(() => {
|
|
20
|
-
const { projectId, sheetId } = val(layoutP.sheet).address;
|
|
21
|
-
const existingRange = val(getStudio().atomP.ahistoric.projects.stateByProjectId[projectId]
|
|
22
|
-
.stateBySheetId[sheetId].sequence.focusRange);
|
|
23
|
-
return existingRange;
|
|
24
|
-
}), [layoutP]);
|
|
25
|
-
return usePrism(() => {
|
|
26
|
-
const existingRange = existingRangeD.getValue();
|
|
27
|
-
if (!existingRange || !existingRange.enabled)
|
|
28
|
-
return null;
|
|
29
|
-
const { range } = existingRange;
|
|
30
|
-
const height = val(layoutP.rightDims.height) - topStripHeight;
|
|
31
|
-
const unitSpaceToClippedSpace = val(layoutP.clippedSpace.fromUnitSpace);
|
|
32
|
-
const clippedSpaceWidth = val(layoutP.clippedSpace.width);
|
|
33
|
-
const els = [];
|
|
34
|
-
{
|
|
35
|
-
// the left (start) curtain
|
|
36
|
-
// starts from 0px
|
|
37
|
-
let startX = 0;
|
|
38
|
-
// ends in the start of the range
|
|
39
|
-
let endX = unitSpaceToClippedSpace(existingRange.range.start);
|
|
40
|
-
let scaleX, translateX;
|
|
41
|
-
// hide the curtain if:
|
|
42
|
-
if (
|
|
43
|
-
// endX would be larger than startX, which means the curtain is to the left of the RightOverlay
|
|
44
|
-
startX > endX) {
|
|
45
|
-
// fully hide it then with scaleX = 0
|
|
46
|
-
translateX = 0;
|
|
47
|
-
scaleX = 0;
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
// clip the end of the curtain if it's going over the right side of RightOverlay
|
|
51
|
-
if (endX > clippedSpaceWidth) {
|
|
52
|
-
//
|
|
53
|
-
endX = clippedSpaceWidth;
|
|
54
|
-
}
|
|
55
|
-
translateX = startX;
|
|
56
|
-
scaleX = (endX - startX) / divWidth;
|
|
57
|
-
}
|
|
58
|
-
els.push({ translateX, scaleX });
|
|
59
|
-
}
|
|
60
|
-
{
|
|
61
|
-
// the right (end) curtain
|
|
62
|
-
// starts at the end of the range
|
|
63
|
-
let startX = unitSpaceToClippedSpace(existingRange.range.end);
|
|
64
|
-
// and ends at the right edge of RightOverlay (which is clippedSpaceWidth)
|
|
65
|
-
let endX = clippedSpaceWidth;
|
|
66
|
-
let scaleX, translateX;
|
|
67
|
-
// if the whole curtain falls to the right of RightOverlay, hide it
|
|
68
|
-
if (startX > endX) {
|
|
69
|
-
translateX = 0;
|
|
70
|
-
scaleX = 0;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
// if the left of the curtain falls on the left of RightOverlay, clip it
|
|
74
|
-
if (startX < 0) {
|
|
75
|
-
startX = 0;
|
|
76
|
-
}
|
|
77
|
-
translateX = startX;
|
|
78
|
-
scaleX = (endX - startX) / divWidth;
|
|
79
|
-
}
|
|
80
|
-
els.push({ translateX, scaleX });
|
|
81
|
-
}
|
|
82
|
-
return (React.createElement(React.Fragment, null, els.map(({ translateX, scaleX }, i) => (React.createElement(Curtain, { key: `curtain-${i}`, enabled: true, style: {
|
|
83
|
-
height: `${height}px`,
|
|
84
|
-
transform: `translateX(${translateX}px) scaleX(${scaleX})`,
|
|
85
|
-
} })))));
|
|
86
|
-
}, [layoutP, existingRangeD]);
|
|
87
|
-
};
|
|
88
|
-
export default FocusRangeCurtains;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import useDrag from '@tomorrowevening/theatre-studio/uiComponents/useDrag';
|
|
2
|
-
import useRefAndState from '@tomorrowevening/theatre-studio/utils/useRefAndState';
|
|
3
|
-
import { usePrism } from '@tomorrowevening/theatre-react';
|
|
4
|
-
import { prism, val } from '@tomorrowevening/theatre-dataverse';
|
|
5
|
-
import { clamp, mapValues } from 'lodash-es';
|
|
6
|
-
import React, { useLayoutEffect, useMemo } from 'react';
|
|
7
|
-
import styled from 'styled-components';
|
|
8
|
-
import { useReceiveVerticalWheelEvent } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/VerticalScrollContainer';
|
|
9
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
10
|
-
import { useCssCursorLock } from '@tomorrowevening/theatre-studio/uiComponents/PointerEventsHandler';
|
|
11
|
-
import DopeSnap from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/RightOverlay/DopeSnap';
|
|
12
|
-
import { snapToAll, snapToNone } from './KeyframeSnapTarget';
|
|
13
|
-
const Container = styled.div `
|
|
14
|
-
position: absolute;
|
|
15
|
-
|
|
16
|
-
right: 0;
|
|
17
|
-
overflow-x: scroll;
|
|
18
|
-
overflow-y: hidden;
|
|
19
|
-
${pointerEventsAutoInNormalMode};
|
|
20
|
-
|
|
21
|
-
// hide the scrollbar on Gecko
|
|
22
|
-
scrollbar-width: none;
|
|
23
|
-
|
|
24
|
-
// hide the scrollbar on Webkit/Blink
|
|
25
|
-
&::-webkit-scrollbar {
|
|
26
|
-
display: none;
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
const HorizontallyScrollableArea = React.memo(({ layoutP, children, height }) => {
|
|
30
|
-
const { width, unitSpaceToScaledSpaceMultiplier } = usePrism(() => ({
|
|
31
|
-
width: val(layoutP.rightDims.width),
|
|
32
|
-
unitSpaceToScaledSpaceMultiplier: val(layoutP.scaledSpace.fromUnitSpace)(1),
|
|
33
|
-
}), [layoutP]);
|
|
34
|
-
const [containerRef, containerNode] = useRefAndState(null);
|
|
35
|
-
useHandlePanAndZoom(layoutP, containerNode);
|
|
36
|
-
useDragPlayheadHandlers(layoutP, containerNode);
|
|
37
|
-
useUpdateScrollFromClippedSpaceRange(layoutP, containerNode);
|
|
38
|
-
return (React.createElement(Container, { ref: containerRef, style: {
|
|
39
|
-
width: width + 'px',
|
|
40
|
-
height: height + 'px',
|
|
41
|
-
// @ts-expect-error
|
|
42
|
-
'--unitSpaceToScaledSpaceMultiplier': unitSpaceToScaledSpaceMultiplier,
|
|
43
|
-
} }, children));
|
|
44
|
-
});
|
|
45
|
-
export default HorizontallyScrollableArea;
|
|
46
|
-
function useDragPlayheadHandlers(layoutP, containerEl) {
|
|
47
|
-
const handlers = useMemo(() => {
|
|
48
|
-
return {
|
|
49
|
-
debugName: 'HorizontallyScrollableArea',
|
|
50
|
-
onDragStart(event) {
|
|
51
|
-
if (event.target instanceof HTMLInputElement) {
|
|
52
|
-
// editing some value
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
|
|
56
|
-
// e.g. marquee selection has shiftKey
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
if (event
|
|
60
|
-
.composedPath()
|
|
61
|
-
.some((el) => el instanceof HTMLElement && el.draggable === true)) {
|
|
62
|
-
// Question: I think to check if we want another descendent element
|
|
63
|
-
// to be able to take control of this drag event.
|
|
64
|
-
// Question: e.g. for `useDragKeyframe`?
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
const initialPositionInClippedSpace = event.clientX - containerEl.getBoundingClientRect().left;
|
|
68
|
-
const initialPositionInUnitSpace = clamp(val(layoutP.clippedSpace.toUnitSpace)(initialPositionInClippedSpace), 0, Infinity);
|
|
69
|
-
const setIsSeeking = val(layoutP.seeker.setIsSeeking);
|
|
70
|
-
const sequence = val(layoutP.sheet).getSequence();
|
|
71
|
-
sequence.position = initialPositionInUnitSpace;
|
|
72
|
-
const posBeforeSeek = initialPositionInUnitSpace;
|
|
73
|
-
const scaledSpaceToUnitSpace = val(layoutP.scaledSpace.toUnitSpace);
|
|
74
|
-
setIsSeeking(true);
|
|
75
|
-
snapToAll();
|
|
76
|
-
return {
|
|
77
|
-
onDrag(dx, _, event) {
|
|
78
|
-
const deltaPos = scaledSpaceToUnitSpace(dx);
|
|
79
|
-
const unsnappedPos = clamp(posBeforeSeek + deltaPos, 0, sequence.length);
|
|
80
|
-
let newPosition = unsnappedPos;
|
|
81
|
-
const snapPos = DopeSnap.checkIfMouseEventSnapToPos(event, {});
|
|
82
|
-
if (snapPos != null) {
|
|
83
|
-
newPosition = snapPos;
|
|
84
|
-
}
|
|
85
|
-
sequence.position = newPosition;
|
|
86
|
-
},
|
|
87
|
-
onDragEnd() {
|
|
88
|
-
setIsSeeking(false);
|
|
89
|
-
snapToNone();
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
}, [layoutP, containerEl]);
|
|
95
|
-
const [isDragging] = useDrag(containerEl, handlers);
|
|
96
|
-
useCssCursorLock(isDragging, 'draggingPositionInSequenceEditor', 'ew-resize');
|
|
97
|
-
}
|
|
98
|
-
function useHandlePanAndZoom(layoutP, node) {
|
|
99
|
-
const receiveVerticalWheelEvent = useReceiveVerticalWheelEvent();
|
|
100
|
-
useLayoutEffect(() => {
|
|
101
|
-
if (!node)
|
|
102
|
-
return;
|
|
103
|
-
const receiveWheelEvent = (event) => {
|
|
104
|
-
// pinch
|
|
105
|
-
if (event.ctrlKey) {
|
|
106
|
-
event.preventDefault();
|
|
107
|
-
event.stopPropagation();
|
|
108
|
-
const pivotPointInClippedSpace = event.clientX - node.getBoundingClientRect().left;
|
|
109
|
-
const pivotPointInUnitSpace = val(layoutP.clippedSpace.toUnitSpace)(pivotPointInClippedSpace);
|
|
110
|
-
const oldRange = val(layoutP.clippedSpace.range);
|
|
111
|
-
const delta = normalize(event.deltaY, [-50, 50]);
|
|
112
|
-
const scaleFactor = 1 + delta * 0.03;
|
|
113
|
-
const newRange = mapValues(oldRange, (originalPos) => {
|
|
114
|
-
return ((originalPos - pivotPointInUnitSpace) * scaleFactor +
|
|
115
|
-
pivotPointInUnitSpace);
|
|
116
|
-
});
|
|
117
|
-
// Set maximum scroll points based on the sequence length.
|
|
118
|
-
// This is to avoid zooming out to infinity.
|
|
119
|
-
const sequenceLength = val(layoutP.sheet).getSequence().length;
|
|
120
|
-
const maxEnd = sequenceLength + sequenceLength * 0.25;
|
|
121
|
-
val(layoutP.clippedSpace.setRange)(normalizeRange(newRange, [0, maxEnd]));
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
// panning
|
|
125
|
-
else if (event.shiftKey) {
|
|
126
|
-
event.preventDefault();
|
|
127
|
-
event.stopPropagation();
|
|
128
|
-
const sequenceLength = val(layoutP.sheet).getSequence().length;
|
|
129
|
-
const oldRange = val(layoutP.clippedSpace.range);
|
|
130
|
-
const windowSize = oldRange.end - oldRange.start;
|
|
131
|
-
const speed = windowSize / sequenceLength;
|
|
132
|
-
// if there's no deltaY, the browser is probably assigning to deltaX because of the shiftKey
|
|
133
|
-
// it appeared that Safari + Chrome continue to use deltaY with shiftKey, while FF on macOS
|
|
134
|
-
// updates the deltaX with deltaY unchanged.
|
|
135
|
-
// this is a little awkward with track pads + shift on macOS FF, but that's not a big deal
|
|
136
|
-
// since scrolling horizontally with macOS track pads is not necessary to hold shift.
|
|
137
|
-
const delta = normalize(event.deltaY || event.deltaX, [-50, 50]);
|
|
138
|
-
const scaleFactor = delta * 0.05 * speed;
|
|
139
|
-
const newRange = mapValues(oldRange, (originalPos) => originalPos + scaleFactor);
|
|
140
|
-
val(layoutP.clippedSpace.setRange)(newRange);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
receiveVerticalWheelEvent(event);
|
|
145
|
-
event.preventDefault();
|
|
146
|
-
event.stopPropagation();
|
|
147
|
-
const scaledSpaceToUnitSpace = val(layoutP.scaledSpace.toUnitSpace);
|
|
148
|
-
const deltaPos = scaledSpaceToUnitSpace(event.deltaX * 1);
|
|
149
|
-
const oldRange = val(layoutP.clippedSpace.range);
|
|
150
|
-
const newRange = mapValues(oldRange, (p) => p + deltaPos);
|
|
151
|
-
const setRange = val(layoutP.clippedSpace.setRange);
|
|
152
|
-
setRange(newRange);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
const listenerOptions = {
|
|
157
|
-
capture: true,
|
|
158
|
-
passive: false,
|
|
159
|
-
};
|
|
160
|
-
node.addEventListener('wheel', receiveWheelEvent, listenerOptions);
|
|
161
|
-
return () => {
|
|
162
|
-
node.removeEventListener('wheel', receiveWheelEvent, listenerOptions);
|
|
163
|
-
};
|
|
164
|
-
}, [node, layoutP]);
|
|
165
|
-
useDrag(node, useMemo(() => {
|
|
166
|
-
return {
|
|
167
|
-
onDragStart(e) {
|
|
168
|
-
const oldRange = val(layoutP.clippedSpace.range);
|
|
169
|
-
const setRange = val(layoutP.clippedSpace.setRange);
|
|
170
|
-
const scaledSpaceToUnitSpace = val(layoutP.scaledSpace.toUnitSpace);
|
|
171
|
-
e.preventDefault();
|
|
172
|
-
e.stopPropagation();
|
|
173
|
-
return {
|
|
174
|
-
onDrag(dx, dy, _, __, deltaYFromLastEvent) {
|
|
175
|
-
receiveVerticalWheelEvent({ deltaY: -deltaYFromLastEvent });
|
|
176
|
-
const delta = -scaledSpaceToUnitSpace(dx);
|
|
177
|
-
const newRange = mapValues(oldRange, (originalPos) => originalPos + delta);
|
|
178
|
-
setRange(newRange);
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
|
-
},
|
|
182
|
-
debugName: 'HorizontallyScrollableArea Middle Button Drag',
|
|
183
|
-
buttons: [1],
|
|
184
|
-
lockCSSCursorTo: 'grabbing',
|
|
185
|
-
};
|
|
186
|
-
}, [layoutP]));
|
|
187
|
-
}
|
|
188
|
-
function normalize(value, [min, max]) {
|
|
189
|
-
return Math.max(Math.min(value, max), min);
|
|
190
|
-
}
|
|
191
|
-
function normalizeRange(range, minMax) {
|
|
192
|
-
return mapValues(range, (pos) => normalize(pos, minMax));
|
|
193
|
-
}
|
|
194
|
-
function useUpdateScrollFromClippedSpaceRange(layoutP, node) {
|
|
195
|
-
useLayoutEffect(() => {
|
|
196
|
-
if (!node)
|
|
197
|
-
return;
|
|
198
|
-
const d = prism(() => {
|
|
199
|
-
const range = val(layoutP.clippedSpace.range);
|
|
200
|
-
const rangeStartInScaledSpace = val(layoutP.scaledSpace.fromUnitSpace)(range.start);
|
|
201
|
-
return rangeStartInScaledSpace;
|
|
202
|
-
});
|
|
203
|
-
const update = () => {
|
|
204
|
-
const rangeStartInScaledSpace = d.getValue();
|
|
205
|
-
node.scrollLeft = rangeStartInScaledSpace;
|
|
206
|
-
};
|
|
207
|
-
const untap = d.onStale(update);
|
|
208
|
-
update();
|
|
209
|
-
const timeout = setTimeout(update, 100);
|
|
210
|
-
return () => {
|
|
211
|
-
clearTimeout(timeout);
|
|
212
|
-
untap();
|
|
213
|
-
};
|
|
214
|
-
}, [layoutP, node]);
|
|
215
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Atom } from '@tomorrowevening/theatre-dataverse';
|
|
2
|
-
import { val } from '@tomorrowevening/theatre-dataverse';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { DopeSnapHitZoneUI } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/RightOverlay/DopeSnapHitZoneUI';
|
|
6
|
-
const HitZone = styled.div `
|
|
7
|
-
z-index: 1;
|
|
8
|
-
cursor: ew-resize;
|
|
9
|
-
|
|
10
|
-
${DopeSnapHitZoneUI.CSS}
|
|
11
|
-
|
|
12
|
-
#pointer-root.draggingPositionInSequenceEditor & {
|
|
13
|
-
${DopeSnapHitZoneUI.CSS_WHEN_SOMETHING_DRAGGING}
|
|
14
|
-
}
|
|
15
|
-
`;
|
|
16
|
-
const Container = styled.div `
|
|
17
|
-
position: absolute;
|
|
18
|
-
`;
|
|
19
|
-
const KeyframeSnapTarget = (props) => {
|
|
20
|
-
return (React.createElement(Container, { style: {
|
|
21
|
-
top: `${props.leaf.nodeHeight / 2}px`,
|
|
22
|
-
left: `calc(${val(props.layoutP.scaledSpace.leftPadding)}px + calc(var(--unitSpaceToScaledSpaceMultiplier) * ${props.position}px))`,
|
|
23
|
-
} },
|
|
24
|
-
React.createElement(HitZone, { ...DopeSnapHitZoneUI.reactProps({
|
|
25
|
-
isDragging: false,
|
|
26
|
-
position: props.position,
|
|
27
|
-
}) })));
|
|
28
|
-
};
|
|
29
|
-
export default KeyframeSnapTarget;
|
|
30
|
-
const stateB = new Atom({ mode: 'snapToNone' });
|
|
31
|
-
export const snapPositionsStateD = stateB.prism;
|
|
32
|
-
export function snapToAll() {
|
|
33
|
-
stateB.set({ mode: 'snapToAll' });
|
|
34
|
-
}
|
|
35
|
-
export function snapToNone() {
|
|
36
|
-
stateB.set({ mode: 'snapToNone' });
|
|
37
|
-
}
|
|
38
|
-
export function snapToSome(positions) {
|
|
39
|
-
stateB.set({ mode: 'snapToSome', positions });
|
|
40
|
-
}
|
|
41
|
-
export function collectKeyframeSnapPositions(tracksByObject, shouldIncludeKeyframe) {
|
|
42
|
-
return Object.fromEntries(Object.entries(tracksByObject).map(([objectKey, trackDataAndTrackIdByPropPath]) => [
|
|
43
|
-
objectKey,
|
|
44
|
-
Object.fromEntries(Object.entries(trackDataAndTrackIdByPropPath.trackData).map(([trackId, track]) => [
|
|
45
|
-
trackId,
|
|
46
|
-
track.keyframes
|
|
47
|
-
.filter((kf) => shouldIncludeKeyframe(kf, {
|
|
48
|
-
trackId,
|
|
49
|
-
trackData: track,
|
|
50
|
-
objectKey,
|
|
51
|
-
}))
|
|
52
|
-
.map((keyframe) => keyframe.position),
|
|
53
|
-
])),
|
|
54
|
-
]));
|
|
55
|
-
}
|
package/dist/panels/SequenceEditorPanel/DopeSheet/Right/LengthIndicator/LengthEditorPopover.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React, { useLayoutEffect, useMemo, useRef } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { usePrism, useVal } from '@tomorrowevening/theatre-react';
|
|
4
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
5
|
-
import BasicNumberInput from '@tomorrowevening/theatre-studio/uiComponents/form/BasicNumberInput';
|
|
6
|
-
import { propNameTextCSS } from '@tomorrowevening/theatre-studio/propEditors/utils/propNameTextCSS';
|
|
7
|
-
const greaterThanZero = (v) => isFinite(v) && v > 0;
|
|
8
|
-
const Container = styled.div `
|
|
9
|
-
display: flex;
|
|
10
|
-
gap: 8px;
|
|
11
|
-
padding: 4px 8px;
|
|
12
|
-
height: 28px;
|
|
13
|
-
align-items: center;
|
|
14
|
-
`;
|
|
15
|
-
const Label = styled.div `
|
|
16
|
-
${propNameTextCSS};
|
|
17
|
-
white-space: nowrap;
|
|
18
|
-
`;
|
|
19
|
-
const nudge = ({ deltaX }) => deltaX * 0.25;
|
|
20
|
-
const LengthEditorPopover = ({ layoutP }) => {
|
|
21
|
-
const sheet = useVal(layoutP.sheet);
|
|
22
|
-
const fns = useMemo(() => {
|
|
23
|
-
let tempTransaction;
|
|
24
|
-
return {
|
|
25
|
-
temporarilySetValue(newLength) {
|
|
26
|
-
if (tempTransaction) {
|
|
27
|
-
tempTransaction.discard();
|
|
28
|
-
tempTransaction = undefined;
|
|
29
|
-
}
|
|
30
|
-
tempTransaction = getStudio().tempTransaction(({ stateEditors }) => {
|
|
31
|
-
stateEditors.coreByProject.historic.sheetsById.sequence.setLength({
|
|
32
|
-
...sheet.address,
|
|
33
|
-
length: newLength,
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
discardTemporaryValue() {
|
|
38
|
-
if (tempTransaction) {
|
|
39
|
-
tempTransaction.discard();
|
|
40
|
-
tempTransaction = undefined;
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
permanentlySetValue(newLength) {
|
|
44
|
-
if (tempTransaction) {
|
|
45
|
-
tempTransaction.discard();
|
|
46
|
-
tempTransaction = undefined;
|
|
47
|
-
}
|
|
48
|
-
getStudio().transaction(({ stateEditors }) => {
|
|
49
|
-
stateEditors.coreByProject.historic.sheetsById.sequence.setLength({
|
|
50
|
-
...sheet.address,
|
|
51
|
-
length: newLength,
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}, [layoutP, sheet]);
|
|
57
|
-
const inputRef = useRef(null);
|
|
58
|
-
useLayoutEffect(() => {
|
|
59
|
-
inputRef.current.focus();
|
|
60
|
-
}, []);
|
|
61
|
-
return usePrism(() => {
|
|
62
|
-
const sequence = sheet.getSequence();
|
|
63
|
-
const sequenceLength = sequence.length;
|
|
64
|
-
return (React.createElement(Container, null,
|
|
65
|
-
React.createElement(Label, null, "Sequence length"),
|
|
66
|
-
React.createElement(BasicNumberInput, { value: sequenceLength, ...fns, isValid: greaterThanZero, inputRef: inputRef, nudge: nudge })));
|
|
67
|
-
}, [sheet, fns, inputRef]);
|
|
68
|
-
};
|
|
69
|
-
export default LengthEditorPopover;
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { usePrism } from '@tomorrowevening/theatre-react';
|
|
2
|
-
import { val } from '@tomorrowevening/theatre-dataverse';
|
|
3
|
-
import React, { useMemo, useRef } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { zIndexes } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/SequenceEditorPanel';
|
|
6
|
-
import { topStripHeight } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/RightOverlay/TopStrip';
|
|
7
|
-
import useRefAndState from '@tomorrowevening/theatre-studio/utils/useRefAndState';
|
|
8
|
-
import useDrag from '@tomorrowevening/theatre-studio/uiComponents/useDrag';
|
|
9
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
10
|
-
import usePopover from '@tomorrowevening/theatre-studio/uiComponents/Popover/usePopover';
|
|
11
|
-
import { includeLockFrameStampAttrs, useLockFrameStampPosition, } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/FrameStampPositionProvider';
|
|
12
|
-
import { GoChevronLeft, GoChevronRight } from 'react-icons/all';
|
|
13
|
-
import LengthEditorPopover from './LengthEditorPopover';
|
|
14
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
15
|
-
import BasicPopover from '@tomorrowevening/theatre-studio/uiComponents/Popover/BasicPopover';
|
|
16
|
-
const coverWidth = 1000;
|
|
17
|
-
const colors = {
|
|
18
|
-
stripNormal: `#0000006c`,
|
|
19
|
-
stripActive: `#000000`,
|
|
20
|
-
};
|
|
21
|
-
const Strip = styled.div `
|
|
22
|
-
position: absolute;
|
|
23
|
-
top: 0;
|
|
24
|
-
left: 0;
|
|
25
|
-
width: 4px;
|
|
26
|
-
z-index: ${() => zIndexes.lengthIndicatorStrip};
|
|
27
|
-
pointer-events: none;
|
|
28
|
-
|
|
29
|
-
&:after {
|
|
30
|
-
display: block;
|
|
31
|
-
content: ' ';
|
|
32
|
-
position: absolute;
|
|
33
|
-
/* top: ${topStripHeight}px; */
|
|
34
|
-
top: 0;
|
|
35
|
-
bottom: 0;
|
|
36
|
-
left: -1px;
|
|
37
|
-
width: 1px;
|
|
38
|
-
background-color: ${colors.stripNormal};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&:hover:after,
|
|
42
|
-
&.dragging:after {
|
|
43
|
-
background-color: ${colors.stripActive};
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
const ThumbContainer = styled.div `
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: ${topStripHeight - 15}px;
|
|
49
|
-
width: 100px;
|
|
50
|
-
left: -50px;
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
align-items: center;
|
|
55
|
-
justify-content: center;
|
|
56
|
-
z-index: 1;
|
|
57
|
-
`;
|
|
58
|
-
const Tooltip = styled.div `
|
|
59
|
-
margin-top: 8px;
|
|
60
|
-
font-size: 10px;
|
|
61
|
-
white-space: nowrap;
|
|
62
|
-
padding: 2px 8px;
|
|
63
|
-
border-radius: 2px;
|
|
64
|
-
${pointerEventsAutoInNormalMode};
|
|
65
|
-
cursor: ew-resize;
|
|
66
|
-
color: #464646;
|
|
67
|
-
background-color: #0000004d;
|
|
68
|
-
display: none;
|
|
69
|
-
|
|
70
|
-
${Strip}:hover &, ${Strip}.dragging & {
|
|
71
|
-
display: block;
|
|
72
|
-
color: white;
|
|
73
|
-
background-color: ${colors.stripActive};
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
const Tumb = styled.div `
|
|
77
|
-
font-size: 10px;
|
|
78
|
-
white-space: nowrap;
|
|
79
|
-
padding: 1px 2px;
|
|
80
|
-
border-radius: 2px;
|
|
81
|
-
${pointerEventsAutoInNormalMode};
|
|
82
|
-
justify-content: center;
|
|
83
|
-
align-items: center;
|
|
84
|
-
cursor: ew-resize;
|
|
85
|
-
color: #5d5d5d;
|
|
86
|
-
background-color: #191919;
|
|
87
|
-
|
|
88
|
-
${Strip}:hover &, ${Strip}.dragging & {
|
|
89
|
-
color: white;
|
|
90
|
-
background-color: ${colors.stripActive};
|
|
91
|
-
|
|
92
|
-
& > svg:first-child {
|
|
93
|
-
margin-right: -1px;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
& > svg:first-child {
|
|
98
|
-
margin-right: -4px;
|
|
99
|
-
}
|
|
100
|
-
`;
|
|
101
|
-
const Cover = styled.div `
|
|
102
|
-
position: absolute;
|
|
103
|
-
top: 0;
|
|
104
|
-
left: 0;
|
|
105
|
-
background-color: rgb(23 23 23 / 43%);
|
|
106
|
-
width: ${coverWidth}px;
|
|
107
|
-
z-index: ${() => zIndexes.lengthIndicatorCover};
|
|
108
|
-
transform-origin: left top;
|
|
109
|
-
|
|
110
|
-
${Strip}.dragging ~ &, ${Strip}:hover ~ & {
|
|
111
|
-
background-color: rgb(23 23 23 / 60%);
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
114
|
-
const RENDER_OUT_OF_VIEW_X = -10000;
|
|
115
|
-
/**
|
|
116
|
-
* This appears at the end of the sequence where you can adjust the length of the sequence.
|
|
117
|
-
* Kinda looks like `< >` at the top bar at end of the sequence editor.
|
|
118
|
-
*/
|
|
119
|
-
const LengthIndicator = ({ layoutP }) => {
|
|
120
|
-
const [nodeRef, node] = useRefAndState(null);
|
|
121
|
-
const [isDragging] = useDragBulge(node, { layoutP });
|
|
122
|
-
const { node: popoverNode, toggle: togglePopover, close: closePopover, } = usePopover({ debugName: 'LengthIndicator' }, () => {
|
|
123
|
-
return (React.createElement(BasicPopover, null,
|
|
124
|
-
React.createElement(LengthEditorPopover, { layoutP: layoutP, onRequestClose: closePopover })));
|
|
125
|
-
});
|
|
126
|
-
return usePrism(() => {
|
|
127
|
-
const sheet = val(layoutP.sheet);
|
|
128
|
-
const height = val(layoutP.rightDims.height);
|
|
129
|
-
const sequence = sheet.getSequence();
|
|
130
|
-
const sequenceLength = sequence.length;
|
|
131
|
-
const startInUnitSpace = sequenceLength;
|
|
132
|
-
let startX = val(layoutP.clippedSpace.fromUnitSpace)(startInUnitSpace);
|
|
133
|
-
let endX = val(layoutP.clippedSpace.width);
|
|
134
|
-
let scaleX, translateX;
|
|
135
|
-
if (startX > endX) {
|
|
136
|
-
translateX = 0;
|
|
137
|
-
scaleX = 0;
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
if (startX < 0) {
|
|
141
|
-
startX = 0;
|
|
142
|
-
}
|
|
143
|
-
translateX = startX;
|
|
144
|
-
scaleX = (endX - startX) / coverWidth;
|
|
145
|
-
}
|
|
146
|
-
return (React.createElement(React.Fragment, null,
|
|
147
|
-
popoverNode,
|
|
148
|
-
React.createElement(Strip, { style: {
|
|
149
|
-
height: height + 'px',
|
|
150
|
-
transform: `translateX(${translateX === 0 ? RENDER_OUT_OF_VIEW_X : translateX}px)`,
|
|
151
|
-
}, className: isDragging ? 'dragging' : '' },
|
|
152
|
-
React.createElement(ThumbContainer, null,
|
|
153
|
-
React.createElement(Tumb, { ref: nodeRef,
|
|
154
|
-
// title="Length of the sequence. Drag or click to change."
|
|
155
|
-
onClick: (e) => {
|
|
156
|
-
togglePopover(e, node);
|
|
157
|
-
}, ...includeLockFrameStampAttrs('hide') },
|
|
158
|
-
React.createElement(GoChevronLeft, null),
|
|
159
|
-
React.createElement(GoChevronRight, null)),
|
|
160
|
-
React.createElement(Tooltip, null,
|
|
161
|
-
"Sequence length:",
|
|
162
|
-
' ',
|
|
163
|
-
sequence.positionFormatter.formatBasic(sequenceLength)))),
|
|
164
|
-
React.createElement(Cover, { title: "Length", style: {
|
|
165
|
-
height: height + 'px',
|
|
166
|
-
transform: `translateX(${translateX}px) scale(${scaleX}, 1)`,
|
|
167
|
-
} })));
|
|
168
|
-
}, [layoutP, nodeRef, isDragging, popoverNode]);
|
|
169
|
-
};
|
|
170
|
-
function useDragBulge(node, props) {
|
|
171
|
-
const propsRef = useRef(props);
|
|
172
|
-
propsRef.current = props;
|
|
173
|
-
const gestureHandlers = useMemo(() => {
|
|
174
|
-
return {
|
|
175
|
-
debugName: 'LengthIndicator/useDragBulge',
|
|
176
|
-
lockCSSCursorTo: 'ew-resize',
|
|
177
|
-
onDragStart(event) {
|
|
178
|
-
let tempTransaction;
|
|
179
|
-
const propsAtStartOfDrag = propsRef.current;
|
|
180
|
-
const sheet = val(propsRef.current.layoutP.sheet);
|
|
181
|
-
const initialLength = sheet.getSequence().length;
|
|
182
|
-
const toUnitSpace = val(propsAtStartOfDrag.layoutP.scaledSpace.toUnitSpace);
|
|
183
|
-
return {
|
|
184
|
-
onDrag(dx, dy, event) {
|
|
185
|
-
const delta = toUnitSpace(dx);
|
|
186
|
-
if (tempTransaction) {
|
|
187
|
-
tempTransaction.discard();
|
|
188
|
-
tempTransaction = undefined;
|
|
189
|
-
}
|
|
190
|
-
tempTransaction = getStudio().tempTransaction(({ stateEditors }) => {
|
|
191
|
-
stateEditors.coreByProject.historic.sheetsById.sequence.setLength({
|
|
192
|
-
...sheet.address,
|
|
193
|
-
length: initialLength + delta,
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
},
|
|
197
|
-
onDragEnd(dragHappened) {
|
|
198
|
-
if (dragHappened) {
|
|
199
|
-
if (tempTransaction) {
|
|
200
|
-
tempTransaction.commit();
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
if (tempTransaction) {
|
|
205
|
-
tempTransaction.discard();
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
};
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
}, []);
|
|
213
|
-
const [isDragging] = useDrag(node, gestureHandlers);
|
|
214
|
-
useLockFrameStampPosition(isDragging, -1);
|
|
215
|
-
return [isDragging];
|
|
216
|
-
}
|
|
217
|
-
export default LengthIndicator;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
2
|
-
import { usePrism } from '@tomorrowevening/theatre-react';
|
|
3
|
-
import { val } from '@tomorrowevening/theatre-dataverse';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import RightRow from './Row';
|
|
6
|
-
import BasicKeyframedTrack from './BasicKeyframedTrack/BasicKeyframedTrack';
|
|
7
|
-
import { useLogger } from '@tomorrowevening/theatre-studio/uiComponents/useLogger';
|
|
8
|
-
const PrimitivePropRow = ({ leaf, layoutP }) => {
|
|
9
|
-
const logger = useLogger('PrimitivePropRow', leaf.pathToProp.join());
|
|
10
|
-
return usePrism(() => {
|
|
11
|
-
const { sheetObject } = leaf;
|
|
12
|
-
const { trackId } = leaf;
|
|
13
|
-
const trackData = val(getStudio().atomP.historic.coreByProject[sheetObject.address.projectId]
|
|
14
|
-
.sheetsById[sheetObject.address.sheetId].sequence.tracksByObject[sheetObject.address.objectKey].trackData[trackId]);
|
|
15
|
-
if (trackData?.type !== 'BasicKeyframedTrack') {
|
|
16
|
-
logger.errorDev(`trackData type ${trackData?.type} is not yet supported on the sequence editor`);
|
|
17
|
-
return (React.createElement(RightRow, { leaf: leaf, isCollapsed: false, node: React.createElement("div", null) }));
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
const node = (React.createElement(BasicKeyframedTrack, { layoutP: layoutP, trackData: trackData, leaf: leaf }));
|
|
21
|
-
return React.createElement(RightRow, { leaf: leaf, isCollapsed: false, node: node });
|
|
22
|
-
}
|
|
23
|
-
}, [leaf, layoutP]);
|
|
24
|
-
};
|
|
25
|
-
export default PrimitivePropRow;
|