@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,42 +0,0 @@
|
|
|
1
|
-
import noop from '@tomorrowevening/theatre-shared/utils/noop';
|
|
2
|
-
import React, { createContext, useCallback, useContext, useRef } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { zIndexes } from './SequenceEditorPanel';
|
|
5
|
-
const Container = styled.div `
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
right: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
bottom: 0;
|
|
11
|
-
overflow-x: hidden;
|
|
12
|
-
overflow-y: scroll;
|
|
13
|
-
z-index: ${() => zIndexes.scrollableArea};
|
|
14
|
-
|
|
15
|
-
&::-webkit-scrollbar {
|
|
16
|
-
display: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
scrollbar-width: none;
|
|
20
|
-
`;
|
|
21
|
-
const ctx = createContext(noop);
|
|
22
|
-
/**
|
|
23
|
-
* See {@link VerticalScrollContainer} and references for how to use this.
|
|
24
|
-
*/
|
|
25
|
-
export const useReceiveVerticalWheelEvent = () => useContext(ctx);
|
|
26
|
-
/**
|
|
27
|
-
* This is used in the sequence editor where we block wheel events to handle
|
|
28
|
-
* pan/zoom on the time axis. The issue this solves, is that when blocking those
|
|
29
|
-
* wheel events, we prevent the vertical scroll events from being fired. This container
|
|
30
|
-
* comes with a context and a hook (see {@link useReceiveVerticalWheelEvent}) that allows
|
|
31
|
-
* the code that traps the wheel events to pass them to the vertical scroller root, which
|
|
32
|
-
* we then use to manually dispatch scroll events.
|
|
33
|
-
*/
|
|
34
|
-
const VerticalScrollContainer = (props) => {
|
|
35
|
-
const ref = useRef(null);
|
|
36
|
-
const receiveVerticalWheelEvent = useCallback((event) => {
|
|
37
|
-
ref.current.scrollBy(0, event.deltaY);
|
|
38
|
-
}, []);
|
|
39
|
-
return (React.createElement(ctx.Provider, { value: receiveVerticalWheelEvent },
|
|
40
|
-
React.createElement(Container, { ref: ref }, props.children)));
|
|
41
|
-
};
|
|
42
|
-
export default VerticalScrollContainer;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
2
|
-
import subPrism from '@tomorrowevening/theatre-shared/utils/subPrism';
|
|
3
|
-
import { valToAtom } from '@tomorrowevening/theatre-shared/utils/valToAtom';
|
|
4
|
-
import { Atom, prism, val } from '@tomorrowevening/theatre-dataverse';
|
|
5
|
-
import { calculateSequenceEditorTree } from './tree';
|
|
6
|
-
import { clamp } from 'lodash-es';
|
|
7
|
-
// type UnitSpaceProression = number
|
|
8
|
-
// type ClippedSpaceProgression = number
|
|
9
|
-
/**
|
|
10
|
-
* This means the left side of the panel is 20% of its width, and the
|
|
11
|
-
* right side is 80%
|
|
12
|
-
*/
|
|
13
|
-
const panelSplitRatio = 0.2;
|
|
14
|
-
const initialClippedSpaceRange = { start: 0, end: 10 };
|
|
15
|
-
export function sequenceEditorPanelLayout(sheet, panelDimsP) {
|
|
16
|
-
const studio = getStudio();
|
|
17
|
-
const ahistoricStateP = studio.atomP.ahistoric.projects.stateByProjectId[sheet.address.projectId]
|
|
18
|
-
.stateBySheetId[sheet.address.sheetId];
|
|
19
|
-
const historicStateP = studio.atomP.historic.projects.stateByProjectId[sheet.address.projectId]
|
|
20
|
-
.stateBySheetId[sheet.address.sheetId];
|
|
21
|
-
return prism(() => {
|
|
22
|
-
const tree = subPrism('tree', () => calculateSequenceEditorTree(sheet, studio), []);
|
|
23
|
-
const panelDims = val(panelDimsP);
|
|
24
|
-
const graphEditorState = val(studio.atomP.historic.panels.sequenceEditor.graphEditor);
|
|
25
|
-
const selectedPropsByObject = val(historicStateP.sequenceEditor.selectedPropsByObject);
|
|
26
|
-
const graphEditorAvailable = !!selectedPropsByObject && Object.keys(selectedPropsByObject).length > 0;
|
|
27
|
-
const { leftDims, rightDims, graphEditorDims, dopeSheetDims, horizontalScrollbarDims, } = prism.memo('leftDims', () => {
|
|
28
|
-
const leftDims = {
|
|
29
|
-
width: Math.floor(panelDims.width * panelSplitRatio),
|
|
30
|
-
height: panelDims.height,
|
|
31
|
-
screenX: panelDims.screenX,
|
|
32
|
-
screenY: panelDims.screenY,
|
|
33
|
-
};
|
|
34
|
-
const rightDims = {
|
|
35
|
-
width: panelDims.width - leftDims.width,
|
|
36
|
-
height: panelDims.height,
|
|
37
|
-
screenX: (panelDims.screenX +
|
|
38
|
-
leftDims.width),
|
|
39
|
-
screenY: panelDims.screenY,
|
|
40
|
-
};
|
|
41
|
-
const graphEditorOpen = graphEditorAvailable && graphEditorState?.isOpen === true;
|
|
42
|
-
const graphEditorHeight = Math.floor((graphEditorOpen
|
|
43
|
-
? clamp(graphEditorState?.height ?? 0.5, 0.1, 0.7)
|
|
44
|
-
: 0) * panelDims.heightWithoutBorder);
|
|
45
|
-
const bottomHeight = 0 + graphEditorHeight;
|
|
46
|
-
const dopeSheetHeight = panelDims.height - bottomHeight;
|
|
47
|
-
const dopeSheetDims = {
|
|
48
|
-
width: panelDims.width,
|
|
49
|
-
height: dopeSheetHeight,
|
|
50
|
-
screenX: panelDims.screenX,
|
|
51
|
-
screenY: panelDims.screenY,
|
|
52
|
-
};
|
|
53
|
-
// const graphEditorHeight = panelDims.height - dopeSheetDims.height
|
|
54
|
-
const graphEditorDims = {
|
|
55
|
-
isAvailable: graphEditorAvailable,
|
|
56
|
-
isOpen: graphEditorOpen,
|
|
57
|
-
width: rightDims.width,
|
|
58
|
-
height: graphEditorHeight,
|
|
59
|
-
screenX: panelDims.screenX,
|
|
60
|
-
screenY: panelDims.screenY + dopeSheetHeight,
|
|
61
|
-
padding: {
|
|
62
|
-
top: 20,
|
|
63
|
-
bottom: 20,
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
const horizontalScrollbarDims = {
|
|
67
|
-
bottom: graphEditorOpen ? 0 : 0,
|
|
68
|
-
};
|
|
69
|
-
return {
|
|
70
|
-
leftDims,
|
|
71
|
-
rightDims,
|
|
72
|
-
graphEditorDims,
|
|
73
|
-
dopeSheetDims,
|
|
74
|
-
horizontalScrollbarDims,
|
|
75
|
-
};
|
|
76
|
-
}, [panelDims, graphEditorState, graphEditorAvailable]);
|
|
77
|
-
const graphEditorVerticalSpace = prism.memo('graphEditorVerticalSpace', () => {
|
|
78
|
-
const space = graphEditorDims.height -
|
|
79
|
-
graphEditorDims.padding.top -
|
|
80
|
-
graphEditorDims.padding.bottom;
|
|
81
|
-
return {
|
|
82
|
-
space,
|
|
83
|
-
fromExtremumSpace(ex) {
|
|
84
|
-
return ex * space;
|
|
85
|
-
},
|
|
86
|
-
toExtremumSpace(s) {
|
|
87
|
-
return s / space;
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
}, [graphEditorDims]);
|
|
91
|
-
const [isSeeking, setIsSeeking] = prism.state('isSeeking', false);
|
|
92
|
-
const seeker = {
|
|
93
|
-
isSeeking,
|
|
94
|
-
setIsSeeking,
|
|
95
|
-
};
|
|
96
|
-
const unitSpace = {};
|
|
97
|
-
const clippedSpaceRange = val(ahistoricStateP.sequence.clippedSpaceRange) ??
|
|
98
|
-
initialClippedSpaceRange;
|
|
99
|
-
const scaledSpace = prism.memo('scaledSpace', () => {
|
|
100
|
-
const unitsShownInClippedSpace = clippedSpaceRange.end - clippedSpaceRange.start;
|
|
101
|
-
const pixelsShownInClippedSpace = rightDims.width;
|
|
102
|
-
const unitToPixelRatio = unitsShownInClippedSpace / pixelsShownInClippedSpace;
|
|
103
|
-
const pixelToUnitRatio = pixelsShownInClippedSpace / unitsShownInClippedSpace;
|
|
104
|
-
return {
|
|
105
|
-
fromUnitSpace(u) {
|
|
106
|
-
return u * pixelToUnitRatio;
|
|
107
|
-
},
|
|
108
|
-
toUnitSpace(s) {
|
|
109
|
-
return s * unitToPixelRatio;
|
|
110
|
-
},
|
|
111
|
-
leftPadding: 10,
|
|
112
|
-
};
|
|
113
|
-
}, [clippedSpaceRange, rightDims.width]);
|
|
114
|
-
const setClippedSpaceRange = prism.memo('setClippedSpaceRange', () => {
|
|
115
|
-
return function setClippedSpaceRange(_range) {
|
|
116
|
-
studio.transaction(({ stateEditors }) => {
|
|
117
|
-
const range = { ..._range };
|
|
118
|
-
if (range.end <= range.start) {
|
|
119
|
-
range.end = range.start + 1;
|
|
120
|
-
}
|
|
121
|
-
if (range.start < 0) {
|
|
122
|
-
const length = range.end - range.start;
|
|
123
|
-
range.start = 0;
|
|
124
|
-
range.end = length;
|
|
125
|
-
}
|
|
126
|
-
stateEditors.studio.ahistoric.projects.stateByProjectId.stateBySheetId.sequence.clippedSpaceRange.set({ ...sheet.address, range });
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
}, []);
|
|
130
|
-
const clippedSpace = prism.memo('clippedSpace', () => {
|
|
131
|
-
return {
|
|
132
|
-
range: clippedSpaceRange,
|
|
133
|
-
width: rightDims.width,
|
|
134
|
-
fromUnitSpace(u) {
|
|
135
|
-
return (scaledSpace.fromUnitSpace(u - clippedSpaceRange.start) +
|
|
136
|
-
scaledSpace.leftPadding);
|
|
137
|
-
},
|
|
138
|
-
toUnitSpace(c) {
|
|
139
|
-
return (scaledSpace.toUnitSpace(c - scaledSpace.leftPadding) +
|
|
140
|
-
clippedSpaceRange.start);
|
|
141
|
-
},
|
|
142
|
-
setRange: setClippedSpaceRange,
|
|
143
|
-
};
|
|
144
|
-
}, [clippedSpaceRange, rightDims.width, scaledSpace, setClippedSpaceRange]);
|
|
145
|
-
const selectionAtom = prism.memo('selection.current', () => {
|
|
146
|
-
return new Atom({});
|
|
147
|
-
}, []);
|
|
148
|
-
const finalAtom = valToAtom('finalAtom', {
|
|
149
|
-
sheet,
|
|
150
|
-
tree,
|
|
151
|
-
panelDims,
|
|
152
|
-
leftDims,
|
|
153
|
-
rightDims,
|
|
154
|
-
dopeSheetDims,
|
|
155
|
-
horizontalScrollbarDims,
|
|
156
|
-
seeker,
|
|
157
|
-
unitSpace,
|
|
158
|
-
scaledSpace,
|
|
159
|
-
clippedSpace,
|
|
160
|
-
graphEditorDims,
|
|
161
|
-
graphEditorVerticalSpace,
|
|
162
|
-
selectionAtom,
|
|
163
|
-
});
|
|
164
|
-
return finalAtom.pointer;
|
|
165
|
-
});
|
|
166
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { createStudioSheetItemKey } from '@tomorrowevening/theatre-shared/utils/ids';
|
|
2
|
-
import { prism, val, pointerToPrism } from '@tomorrowevening/theatre-dataverse';
|
|
3
|
-
import logger from '@tomorrowevening/theatre-shared/logger';
|
|
4
|
-
import { titleBarHeight } from '@tomorrowevening/theatre-studio/panels/BasePanel/common';
|
|
5
|
-
const HEIGHT_OF_ANY_TITLE = 28;
|
|
6
|
-
/**
|
|
7
|
-
* Must run inside prism()
|
|
8
|
-
*/
|
|
9
|
-
export const calculateSequenceEditorTree = (sheet, studio) => {
|
|
10
|
-
prism.ensurePrism();
|
|
11
|
-
const rootShouldRender = true;
|
|
12
|
-
let topSoFar = titleBarHeight + (rootShouldRender ? HEIGHT_OF_ANY_TITLE : 0);
|
|
13
|
-
let nSoFar = 0;
|
|
14
|
-
const collapsableItemSetP = studio.atomP.ahistoric.projects.stateByProjectId[sheet.address.projectId]
|
|
15
|
-
.stateBySheetId[sheet.address.sheetId].sequence.collapsableItems;
|
|
16
|
-
const isCollapsedP = collapsableItemSetP.byId[createStudioSheetItemKey.forSheet()].isCollapsed;
|
|
17
|
-
const isCollapsed = pointerToPrism(isCollapsedP).getValue() ?? false;
|
|
18
|
-
const tree = {
|
|
19
|
-
type: 'sheet',
|
|
20
|
-
isCollapsed,
|
|
21
|
-
sheet,
|
|
22
|
-
children: [],
|
|
23
|
-
sheetItemKey: createStudioSheetItemKey.forSheet(),
|
|
24
|
-
shouldRender: rootShouldRender,
|
|
25
|
-
top: titleBarHeight,
|
|
26
|
-
depth: 0,
|
|
27
|
-
n: nSoFar,
|
|
28
|
-
nodeHeight: rootShouldRender ? HEIGHT_OF_ANY_TITLE : 0,
|
|
29
|
-
heightIncludingChildren: -1, // calculated below
|
|
30
|
-
};
|
|
31
|
-
if (rootShouldRender) {
|
|
32
|
-
nSoFar += 1;
|
|
33
|
-
}
|
|
34
|
-
for (const sheetObject of Object.values(val(sheet.objectsP))) {
|
|
35
|
-
if (sheetObject) {
|
|
36
|
-
addObject(sheetObject, tree.children, tree.depth + 1, rootShouldRender && !isCollapsed);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
tree.heightIncludingChildren = topSoFar - tree.top;
|
|
40
|
-
function addObject(sheetObject, arrayOfChildren, level, shouldRender) {
|
|
41
|
-
const trackSetups = val(sheetObject.template.getMapOfValidSequenceTracks_forStudio());
|
|
42
|
-
const objectConfig = val(sheetObject.template.configPointer);
|
|
43
|
-
if (Object.keys(trackSetups).length === 0)
|
|
44
|
-
return;
|
|
45
|
-
const isCollapsedP = collapsableItemSetP.byId[createStudioSheetItemKey.forSheetObject(sheetObject)].isCollapsed;
|
|
46
|
-
const isCollapsed = pointerToPrism(isCollapsedP).getValue() ?? false;
|
|
47
|
-
const row = {
|
|
48
|
-
type: 'sheetObject',
|
|
49
|
-
isCollapsed,
|
|
50
|
-
sheetItemKey: createStudioSheetItemKey.forSheetObject(sheetObject),
|
|
51
|
-
shouldRender,
|
|
52
|
-
top: topSoFar,
|
|
53
|
-
children: [],
|
|
54
|
-
depth: level,
|
|
55
|
-
n: nSoFar,
|
|
56
|
-
sheetObject: sheetObject,
|
|
57
|
-
nodeHeight: shouldRender ? HEIGHT_OF_ANY_TITLE : 0,
|
|
58
|
-
heightIncludingChildren: -1, // calculated below
|
|
59
|
-
};
|
|
60
|
-
arrayOfChildren.push(row);
|
|
61
|
-
if (shouldRender) {
|
|
62
|
-
nSoFar += 1;
|
|
63
|
-
// As we add rows to the tree, top to bottom, we accumulate the pixel
|
|
64
|
-
// distance to the top of the tree from the bottom of the current row:
|
|
65
|
-
topSoFar += row.nodeHeight;
|
|
66
|
-
}
|
|
67
|
-
addProps(sheetObject, trackSetups, [], objectConfig, row.children, level + 1, shouldRender && !isCollapsed);
|
|
68
|
-
row.heightIncludingChildren = topSoFar - row.top;
|
|
69
|
-
}
|
|
70
|
-
function addProps(sheetObject, trackSetups, pathSoFar, parentPropConfig, arrayOfChildren, level, shouldRender) {
|
|
71
|
-
for (const [propKey, setupOrSetups] of Object.entries(trackSetups)) {
|
|
72
|
-
const propConfig = parentPropConfig.props[propKey];
|
|
73
|
-
addProp(sheetObject, setupOrSetups, [...pathSoFar, propKey], propConfig, arrayOfChildren, level, shouldRender);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function addProp(sheetObject, trackIdOrMapping, pathToProp, conf, arrayOfChildren, level, shouldRender) {
|
|
77
|
-
if (conf.type === 'compound') {
|
|
78
|
-
const trackMapping = trackIdOrMapping;
|
|
79
|
-
addProp_compound(sheetObject, trackMapping, conf, pathToProp, conf, arrayOfChildren, level, shouldRender);
|
|
80
|
-
}
|
|
81
|
-
else if (conf.type === 'enum') {
|
|
82
|
-
logger.warn('Prop type enum is not yet supported in the sequence editor');
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
const trackId = trackIdOrMapping;
|
|
86
|
-
addProp_primitive(sheetObject, trackId, pathToProp, conf, arrayOfChildren, level, shouldRender);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function addProp_compound(sheetObject, trackMapping, propConf, pathToProp, conf, arrayOfChildren, level, shouldRender) {
|
|
90
|
-
const isCollapsedP = collapsableItemSetP.byId[createStudioSheetItemKey.forSheetObjectProp(sheetObject, pathToProp)].isCollapsed;
|
|
91
|
-
const isCollapsed = pointerToPrism(isCollapsedP).getValue() ?? false;
|
|
92
|
-
const row = {
|
|
93
|
-
type: 'propWithChildren',
|
|
94
|
-
isCollapsed,
|
|
95
|
-
propConf,
|
|
96
|
-
pathToProp,
|
|
97
|
-
sheetItemKey: createStudioSheetItemKey.forSheetObjectProp(sheetObject, pathToProp),
|
|
98
|
-
sheetObject: sheetObject,
|
|
99
|
-
shouldRender,
|
|
100
|
-
top: topSoFar,
|
|
101
|
-
children: [],
|
|
102
|
-
nodeHeight: shouldRender ? HEIGHT_OF_ANY_TITLE : 0,
|
|
103
|
-
heightIncludingChildren: -1,
|
|
104
|
-
depth: level,
|
|
105
|
-
trackMapping,
|
|
106
|
-
n: nSoFar,
|
|
107
|
-
};
|
|
108
|
-
arrayOfChildren.push(row);
|
|
109
|
-
if (shouldRender) {
|
|
110
|
-
topSoFar += row.nodeHeight;
|
|
111
|
-
nSoFar += 1;
|
|
112
|
-
}
|
|
113
|
-
addProps(sheetObject, trackMapping, pathToProp, conf, row.children, level + 1,
|
|
114
|
-
// collapsed shouldn't render child props
|
|
115
|
-
shouldRender && !isCollapsed);
|
|
116
|
-
// }
|
|
117
|
-
row.heightIncludingChildren = topSoFar - row.top;
|
|
118
|
-
}
|
|
119
|
-
function addProp_primitive(sheetObject, trackId, pathToProp, propConf, arrayOfChildren, level, shouldRender) {
|
|
120
|
-
const row = {
|
|
121
|
-
type: 'primitiveProp',
|
|
122
|
-
propConf: propConf,
|
|
123
|
-
depth: level,
|
|
124
|
-
sheetItemKey: createStudioSheetItemKey.forSheetObjectProp(sheetObject, pathToProp),
|
|
125
|
-
sheetObject: sheetObject,
|
|
126
|
-
pathToProp,
|
|
127
|
-
shouldRender,
|
|
128
|
-
top: topSoFar,
|
|
129
|
-
nodeHeight: shouldRender ? HEIGHT_OF_ANY_TITLE : 0,
|
|
130
|
-
heightIncludingChildren: shouldRender ? HEIGHT_OF_ANY_TITLE : 0,
|
|
131
|
-
trackId,
|
|
132
|
-
n: nSoFar,
|
|
133
|
-
};
|
|
134
|
-
arrayOfChildren.push(row);
|
|
135
|
-
nSoFar += 1;
|
|
136
|
-
topSoFar += row.nodeHeight;
|
|
137
|
-
}
|
|
138
|
-
return tree;
|
|
139
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { val } from '@tomorrowevening/theatre-dataverse';
|
|
2
|
-
import { Atom } from '@tomorrowevening/theatre-dataverse';
|
|
3
|
-
import { prism } from '@tomorrowevening/theatre-dataverse';
|
|
4
|
-
import pointerDeep from '@tomorrowevening/theatre-shared/utils/pointerDeep';
|
|
5
|
-
import lodashSet from 'lodash-es/set';
|
|
6
|
-
/** constant global manager */
|
|
7
|
-
export const whatPropIsHighlighted = createWhatPropIsHighlightedState();
|
|
8
|
-
function createWhatPropIsHighlightedState() {
|
|
9
|
-
let lastLockId = 0;
|
|
10
|
-
const whatIsHighlighted = new Atom({ hasLock: false });
|
|
11
|
-
return {
|
|
12
|
-
replaceLock(address, cleanup) {
|
|
13
|
-
const lockId = lastLockId++;
|
|
14
|
-
const existingState = whatIsHighlighted.get();
|
|
15
|
-
if (existingState.hasLock)
|
|
16
|
-
existingState.cleanup();
|
|
17
|
-
whatIsHighlighted.set({
|
|
18
|
-
hasLock: true,
|
|
19
|
-
lockId,
|
|
20
|
-
cleanup,
|
|
21
|
-
deepPath: arrayToDeepObject(addressToArray(address)),
|
|
22
|
-
});
|
|
23
|
-
return function unlock() {
|
|
24
|
-
const curr = whatIsHighlighted.get();
|
|
25
|
-
if (curr.hasLock && curr.lockId === lockId) {
|
|
26
|
-
curr.cleanup();
|
|
27
|
-
whatIsHighlighted.set({ hasLock: false });
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
getIsPropHighlightedD(address) {
|
|
32
|
-
const highlightedP = pointerDeep(whatIsHighlighted.pointer.deepPath, addressToArray(address));
|
|
33
|
-
return prism(() => {
|
|
34
|
-
const value = val(highlightedP);
|
|
35
|
-
return value === true
|
|
36
|
-
? 'self'
|
|
37
|
-
: // obj continues deep path prop from here
|
|
38
|
-
value
|
|
39
|
-
? 'descendent'
|
|
40
|
-
: // some other prop or no lock
|
|
41
|
-
null;
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function addressToArray(address) {
|
|
47
|
-
return [
|
|
48
|
-
address.projectId,
|
|
49
|
-
address.sheetId,
|
|
50
|
-
address.objectKey,
|
|
51
|
-
...address.pathToProp,
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
function arrayToDeepObject(arr) {
|
|
55
|
-
const obj = {};
|
|
56
|
-
lodashSet(obj, arr, true);
|
|
57
|
-
return obj;
|
|
58
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { transparentize } from 'polished';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
5
|
-
import { nextPrevCursorsTheme } from './NextPrevKeyframeCursors';
|
|
6
|
-
import { isPropConfigComposite, iteratePropType, } from '@tomorrowevening/theatre-shared/propTypes/utils';
|
|
7
|
-
const theme = {
|
|
8
|
-
defaultState: {
|
|
9
|
-
color: transparentize(0.95, `#C4C4C4`),
|
|
10
|
-
hoverColor: transparentize(0.15, nextPrevCursorsTheme.onColor),
|
|
11
|
-
},
|
|
12
|
-
withStaticOverride: {
|
|
13
|
-
color: transparentize(0.85, `#C4C4C4`),
|
|
14
|
-
hoverColor: transparentize(0.15, nextPrevCursorsTheme.onColor),
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
const Container = styled.div `
|
|
18
|
-
width: 16px;
|
|
19
|
-
margin: 0 0px 0 2px;
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
align-items: center;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
|
|
25
|
-
color: ${(props) => props.hasStaticOverride
|
|
26
|
-
? theme.withStaticOverride.color
|
|
27
|
-
: theme.defaultState.color};
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
color: ${(props) => props.hasStaticOverride
|
|
31
|
-
? theme.withStaticOverride.hoverColor
|
|
32
|
-
: theme.defaultState.hoverColor};
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
const DefaultIcon = styled.div `
|
|
36
|
-
width: 5px;
|
|
37
|
-
height: 5px;
|
|
38
|
-
border-radius: 1px;
|
|
39
|
-
transform: rotate(45deg);
|
|
40
|
-
/* border: 1px solid currentColor; */
|
|
41
|
-
background-color: currentColor;
|
|
42
|
-
`;
|
|
43
|
-
const FilledIcon = styled.div `
|
|
44
|
-
width: 5px;
|
|
45
|
-
height: 5px;
|
|
46
|
-
background-color: currentColor;
|
|
47
|
-
border-radius: 1px;
|
|
48
|
-
transform: rotate(45deg);
|
|
49
|
-
`;
|
|
50
|
-
const DefaultOrStaticValueIndicator = (props) => {
|
|
51
|
-
const { hasStaticOverride, obj, propConfig, pathToProp } = props;
|
|
52
|
-
const sequenceCb = () => {
|
|
53
|
-
getStudio().transaction(({ stateEditors }) => {
|
|
54
|
-
for (const { path, conf } of iteratePropType(propConfig, pathToProp)) {
|
|
55
|
-
if (isPropConfigComposite(conf))
|
|
56
|
-
continue;
|
|
57
|
-
const propAddress = { ...obj.address, pathToProp: path };
|
|
58
|
-
stateEditors.coreByProject.historic.sheetsById.sequence.setPrimitivePropAsSequenced(propAddress, propConfig);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
return (React.createElement(Container, { hasStaticOverride: hasStaticOverride, onClick: sequenceCb, title: "Sequence this prop" }, hasStaticOverride ? (React.createElement(FilledIcon, { title: "The default value is overridden" })) : (React.createElement(DefaultIcon, { title: "This is the default value for this prop" }))));
|
|
63
|
-
};
|
|
64
|
-
export default DefaultOrStaticValueIndicator;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
2
|
-
import { transparentize } from 'polished';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import styled, { css } from 'styled-components';
|
|
5
|
-
import { PresenceFlag } from '@tomorrowevening/theatre-studio/uiComponents/usePresence';
|
|
6
|
-
import usePresence from '@tomorrowevening/theatre-studio/uiComponents/usePresence';
|
|
7
|
-
const Container = styled.div `
|
|
8
|
-
display: flex;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
align-items: center;
|
|
11
|
-
width: 16px;
|
|
12
|
-
margin: 0 0px 0 2px;
|
|
13
|
-
position: relative;
|
|
14
|
-
z-index: 0;
|
|
15
|
-
opacity: 0.7;
|
|
16
|
-
|
|
17
|
-
&:after {
|
|
18
|
-
position: absolute;
|
|
19
|
-
left: -14px;
|
|
20
|
-
right: -14px;
|
|
21
|
-
top: -2px;
|
|
22
|
-
bottom: -2px;
|
|
23
|
-
content: ' ';
|
|
24
|
-
display: none;
|
|
25
|
-
z-index: -1;
|
|
26
|
-
background: ${transparentize(0.2, 'black')};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:hover {
|
|
30
|
-
opacity: 1;
|
|
31
|
-
&:after {
|
|
32
|
-
display: block;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
const Button = styled.div `
|
|
37
|
-
background: none;
|
|
38
|
-
position: relative;
|
|
39
|
-
border: 0;
|
|
40
|
-
transition: transform 0.1s ease-out;
|
|
41
|
-
z-index: 0;
|
|
42
|
-
outline: none;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
|
|
45
|
-
&:after {
|
|
46
|
-
display: none;
|
|
47
|
-
${Container}:hover & {
|
|
48
|
-
display: block;
|
|
49
|
-
}
|
|
50
|
-
position: absolute;
|
|
51
|
-
left: -4px;
|
|
52
|
-
right: -4px;
|
|
53
|
-
top: -4px;
|
|
54
|
-
bottom: -4px;
|
|
55
|
-
content: ' ';
|
|
56
|
-
z-index: -1;
|
|
57
|
-
}
|
|
58
|
-
`;
|
|
59
|
-
export const nextPrevCursorsTheme = {
|
|
60
|
-
offColor: '#555',
|
|
61
|
-
onColor: '#e0c917',
|
|
62
|
-
};
|
|
63
|
-
const CurButton = styled(Button) `
|
|
64
|
-
&:hover {
|
|
65
|
-
color: #e0c917;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
color: ${(props) => props.presence === PresenceFlag.Primary
|
|
69
|
-
? 'white'
|
|
70
|
-
: props.isOn
|
|
71
|
-
? nextPrevCursorsTheme.onColor
|
|
72
|
-
: nextPrevCursorsTheme.offColor};
|
|
73
|
-
`;
|
|
74
|
-
const pointerEventsNone = css `
|
|
75
|
-
pointer-events: none !important;
|
|
76
|
-
`;
|
|
77
|
-
const PrevOrNextButton = styled(Button) `
|
|
78
|
-
color: ${(props) => props.flag === PresenceFlag.Primary
|
|
79
|
-
? 'white'
|
|
80
|
-
: props.available
|
|
81
|
-
? nextPrevCursorsTheme.onColor
|
|
82
|
-
: nextPrevCursorsTheme.offColor};
|
|
83
|
-
|
|
84
|
-
${(props) => props.available ? pointerEventsAutoInNormalMode : pointerEventsNone};
|
|
85
|
-
`;
|
|
86
|
-
const Prev = styled(PrevOrNextButton) `
|
|
87
|
-
transform: translateX(2px);
|
|
88
|
-
${Container}:hover & {
|
|
89
|
-
transform: translateX(-7px);
|
|
90
|
-
}
|
|
91
|
-
`;
|
|
92
|
-
const Next = styled(PrevOrNextButton) `
|
|
93
|
-
transform: translateX(-2px);
|
|
94
|
-
${Container}:hover & {
|
|
95
|
-
transform: translateX(7px);
|
|
96
|
-
}
|
|
97
|
-
`;
|
|
98
|
-
var Icons;
|
|
99
|
-
(function (Icons) {
|
|
100
|
-
const Chevron_Group = styled.g `
|
|
101
|
-
stroke-width: 1;
|
|
102
|
-
${PrevOrNextButton}:hover & path {
|
|
103
|
-
stroke-width: 3;
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
106
|
-
Icons.Prev = () => (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
107
|
-
React.createElement(Chevron_Group, { transform: `translate(6 3)` },
|
|
108
|
-
React.createElement("path", { d: "M4 1L1 4L4 7", stroke: "currentColor" }))));
|
|
109
|
-
Icons.Next = () => (React.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
110
|
-
React.createElement(Chevron_Group, { transform: `translate(1 3)` },
|
|
111
|
-
React.createElement("path", { d: "M1 1L4 4L1 7", stroke: "currentColor" }))));
|
|
112
|
-
const Cur_Group = styled.g `
|
|
113
|
-
stroke-width: 0;
|
|
114
|
-
${CurButton}:hover & path {
|
|
115
|
-
stroke: currentColor;
|
|
116
|
-
stroke-width: 2;
|
|
117
|
-
}
|
|
118
|
-
`;
|
|
119
|
-
Icons.Cur = () => (React.createElement("svg", { width: "8", height: "12", viewBox: "0 0 8 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
120
|
-
React.createElement(Cur_Group, { transform: "translate(1 4)" },
|
|
121
|
-
React.createElement("path", { d: "M3 0L6 3L3 6L0 3L3 0Z", fill: "currentColor" }))));
|
|
122
|
-
})(Icons || (Icons = {}));
|
|
123
|
-
const NextPrevKeyframeCursors = (props) => {
|
|
124
|
-
const prevPresence = usePresence(props.prev?.itemKey);
|
|
125
|
-
const curPresence = usePresence(props.cur?.type === 'on' ? props.cur.itemKey : undefined);
|
|
126
|
-
const nextPresence = usePresence(props.next?.itemKey);
|
|
127
|
-
return (React.createElement(Container, null,
|
|
128
|
-
React.createElement(Prev, { available: !!props.prev, onClick: props.prev?.jump, flag: prevPresence.flag, ...prevPresence.attrs },
|
|
129
|
-
React.createElement(Icons.Prev, null)),
|
|
130
|
-
React.createElement(CurButton, { isOn: props.cur.type === 'on', onClick: props.cur.toggle, presence: curPresence.flag, ...curPresence.attrs },
|
|
131
|
-
React.createElement(Icons.Cur, null)),
|
|
132
|
-
React.createElement(Next, { available: !!props.next, onClick: props.next?.jump, flag: nextPresence.flag, ...nextPresence.attrs },
|
|
133
|
-
React.createElement(Icons.Next, null))));
|
|
134
|
-
};
|
|
135
|
-
export default NextPrevKeyframeCursors;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createStudioSheetItemKey } from '@tomorrowevening/theatre-shared/utils/ids';
|
|
2
|
-
const cache = new WeakMap();
|
|
3
|
-
const noKeyframes = {};
|
|
4
|
-
export function getNearbyKeyframesOfTrack(obj, track, sequencePosition) {
|
|
5
|
-
if (!track || track.data.keyframes.length === 0)
|
|
6
|
-
return noKeyframes;
|
|
7
|
-
const cachedItem = cache.get(track.data);
|
|
8
|
-
if (cachedItem && cachedItem[0] === sequencePosition) {
|
|
9
|
-
return cachedItem[1];
|
|
10
|
-
}
|
|
11
|
-
function getKeyframeWithTrackId(idx) {
|
|
12
|
-
if (!track)
|
|
13
|
-
return;
|
|
14
|
-
const found = track.data.keyframes[idx];
|
|
15
|
-
return (found && {
|
|
16
|
-
kf: found,
|
|
17
|
-
track,
|
|
18
|
-
itemKey: createStudioSheetItemKey.forTrackKeyframe(obj, track.id, found.id),
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
const calculate = () => {
|
|
22
|
-
const nextOrCurIdx = track.data.keyframes.findIndex((kf) => kf.position >= sequencePosition);
|
|
23
|
-
if (nextOrCurIdx === -1) {
|
|
24
|
-
return {
|
|
25
|
-
prev: getKeyframeWithTrackId(track.data.keyframes.length - 1),
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
const nextOrCur = getKeyframeWithTrackId(nextOrCurIdx);
|
|
29
|
-
if (nextOrCur.kf.position === sequencePosition) {
|
|
30
|
-
return {
|
|
31
|
-
prev: getKeyframeWithTrackId(nextOrCurIdx - 1),
|
|
32
|
-
cur: nextOrCur,
|
|
33
|
-
next: getKeyframeWithTrackId(nextOrCurIdx + 1),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
return {
|
|
38
|
-
next: nextOrCur,
|
|
39
|
-
prev: getKeyframeWithTrackId(nextOrCurIdx - 1),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const result = calculate();
|
|
44
|
-
cache.set(track.data, [sequencePosition, result]);
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React, { useCallback } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import BasicCheckbox from '@tomorrowevening/theatre-studio/uiComponents/form/BasicCheckbox';
|
|
4
|
-
const Input = styled(BasicCheckbox) `
|
|
5
|
-
margin-left: 6px;
|
|
6
|
-
|
|
7
|
-
:focus {
|
|
8
|
-
outline: 1px solid #555;
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
function BooleanPropEditor({ propConfig, editingTools, value, autoFocus, }) {
|
|
12
|
-
const onChange = useCallback((el) => {
|
|
13
|
-
editingTools.permanentlySetValue(Boolean(el.target.checked));
|
|
14
|
-
}, [propConfig, editingTools]);
|
|
15
|
-
return React.createElement(Input, { checked: value, onChange: onChange, autoFocus: autoFocus });
|
|
16
|
-
}
|
|
17
|
-
export default BooleanPropEditor;
|