@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,184 +0,0 @@
|
|
|
1
|
-
import useRefAndState from '@tomorrowevening/theatre-studio/utils/useRefAndState';
|
|
2
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
3
|
-
import useDrag from '@tomorrowevening/theatre-studio/uiComponents/useDrag';
|
|
4
|
-
import { lighten } from 'polished';
|
|
5
|
-
import React, { useMemo, useRef } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { panelDimsToPanelPosition, usePanel } from './BasePanel';
|
|
8
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
9
|
-
import { clamp } from 'lodash-es';
|
|
10
|
-
import { minVisibleSize } from './common';
|
|
11
|
-
const Base = styled.div `
|
|
12
|
-
position: absolute;
|
|
13
|
-
${pointerEventsAutoInNormalMode};
|
|
14
|
-
&:after {
|
|
15
|
-
position: absolute;
|
|
16
|
-
inset: -5px;
|
|
17
|
-
display: block;
|
|
18
|
-
content: ' ';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
opacity: 0;
|
|
22
|
-
background-color: #478698;
|
|
23
|
-
|
|
24
|
-
&.isHighlighted {
|
|
25
|
-
opacity: 0.7;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&.isDragging {
|
|
29
|
-
opacity: 1;
|
|
30
|
-
/* background-color: ${lighten(0.2, '#478698')}; */
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&:hover {
|
|
34
|
-
opacity: 1;
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
const Side = styled(Base) `
|
|
38
|
-
/**
|
|
39
|
-
The horizintal/vertical resize handles have z-index:-1 and are offset 1px outside of the panel
|
|
40
|
-
to make sure they don't occlude any element that pops out of the panel (like the Playhead in SequenceEditorPanel).
|
|
41
|
-
|
|
42
|
-
This means that panels will always need an extra 1px margin for their resize handles to be visible, but that's not a problem
|
|
43
|
-
that we have to deal with right now (if it is at all a problem).
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
z-index: -1;
|
|
47
|
-
`;
|
|
48
|
-
const Horizontal = styled(Side) `
|
|
49
|
-
left: 0px;
|
|
50
|
-
right: 0px;
|
|
51
|
-
height: 1px;
|
|
52
|
-
`;
|
|
53
|
-
const Top = styled(Horizontal) `
|
|
54
|
-
top: -1px;
|
|
55
|
-
`;
|
|
56
|
-
const Bottom = styled(Horizontal) `
|
|
57
|
-
bottom: -1px;
|
|
58
|
-
`;
|
|
59
|
-
const Vertical = styled(Side) `
|
|
60
|
-
z-index: -1;
|
|
61
|
-
top: -1px;
|
|
62
|
-
bottom: -1px;
|
|
63
|
-
width: 1px;
|
|
64
|
-
`;
|
|
65
|
-
const Left = styled(Vertical) `
|
|
66
|
-
left: -1px;
|
|
67
|
-
`;
|
|
68
|
-
const Right = styled(Vertical) `
|
|
69
|
-
right: -1px;
|
|
70
|
-
`;
|
|
71
|
-
const Angle = styled(Base) `
|
|
72
|
-
// The angles have z-index: 10 to make sure they _do_ occlude other elements in the panel.
|
|
73
|
-
z-index: 10;
|
|
74
|
-
width: 8px;
|
|
75
|
-
height: 8px;
|
|
76
|
-
`;
|
|
77
|
-
const TopLeft = styled(Angle) `
|
|
78
|
-
top: 0;
|
|
79
|
-
left: 0;
|
|
80
|
-
`;
|
|
81
|
-
const TopRight = styled(Angle) `
|
|
82
|
-
top: 0;
|
|
83
|
-
right: 0;
|
|
84
|
-
`;
|
|
85
|
-
const BottomLeft = styled(Angle) `
|
|
86
|
-
bottom: 0;
|
|
87
|
-
left: 0;
|
|
88
|
-
`;
|
|
89
|
-
const BottomRight = styled(Angle) `
|
|
90
|
-
bottom: 0;
|
|
91
|
-
right: 0;
|
|
92
|
-
`;
|
|
93
|
-
const els = {
|
|
94
|
-
Top,
|
|
95
|
-
TopLeft,
|
|
96
|
-
TopRight,
|
|
97
|
-
Bottom,
|
|
98
|
-
BottomLeft,
|
|
99
|
-
BottomRight,
|
|
100
|
-
Left,
|
|
101
|
-
Right,
|
|
102
|
-
};
|
|
103
|
-
const cursors = {
|
|
104
|
-
Top: 'ns-resize',
|
|
105
|
-
Bottom: 'ns-resize',
|
|
106
|
-
Left: 'ew-resize',
|
|
107
|
-
Right: 'ew-resize',
|
|
108
|
-
TopLeft: 'nw-resize',
|
|
109
|
-
TopRight: 'ne-resize',
|
|
110
|
-
BottomLeft: 'sw-resize',
|
|
111
|
-
BottomRight: 'se-resize',
|
|
112
|
-
};
|
|
113
|
-
const PanelResizeHandle = ({ which }) => {
|
|
114
|
-
const panelStuff = usePanel();
|
|
115
|
-
const panelStuffRef = useRef(panelStuff);
|
|
116
|
-
panelStuffRef.current = panelStuff;
|
|
117
|
-
const [ref, node] = useRefAndState(null);
|
|
118
|
-
const dragOpts = useMemo(() => {
|
|
119
|
-
return {
|
|
120
|
-
debugName: 'PanelResizeHandle',
|
|
121
|
-
lockCursorTo: cursors[which],
|
|
122
|
-
onDragStart() {
|
|
123
|
-
let tempTransaction;
|
|
124
|
-
const stuffBeforeDrag = panelStuffRef.current;
|
|
125
|
-
const unlock = panelStuff.addBoundsHighlightLock();
|
|
126
|
-
return {
|
|
127
|
-
onDrag(dx, dy) {
|
|
128
|
-
const newDims = {
|
|
129
|
-
...stuffBeforeDrag.dims,
|
|
130
|
-
};
|
|
131
|
-
if (which.startsWith('Bottom')) {
|
|
132
|
-
newDims.height = Math.max(newDims.height + dy, stuffBeforeDrag.minDims.height);
|
|
133
|
-
}
|
|
134
|
-
else if (which.startsWith('Top')) {
|
|
135
|
-
const bottom = newDims.top + newDims.height;
|
|
136
|
-
const top = clamp(newDims.top + dy, 0, Math.min(bottom - stuffBeforeDrag.minDims.height, window.innerHeight - minVisibleSize));
|
|
137
|
-
const height = bottom - top;
|
|
138
|
-
newDims.height = height;
|
|
139
|
-
newDims.top = top;
|
|
140
|
-
}
|
|
141
|
-
if (which.endsWith('Left')) {
|
|
142
|
-
const right = newDims.left + newDims.width;
|
|
143
|
-
const left = Math.min(newDims.left + dx, Math.min(right - stuffBeforeDrag.minDims.width, window.innerWidth - minVisibleSize));
|
|
144
|
-
const width = right - left;
|
|
145
|
-
newDims.width = width;
|
|
146
|
-
newDims.left = left;
|
|
147
|
-
}
|
|
148
|
-
else if (which.endsWith('Right')) {
|
|
149
|
-
newDims.width = Math.max(newDims.width + dx, Math.max(stuffBeforeDrag.minDims.width, minVisibleSize - stuffBeforeDrag.dims.left));
|
|
150
|
-
}
|
|
151
|
-
const position = panelDimsToPanelPosition(newDims, {
|
|
152
|
-
width: window.innerWidth,
|
|
153
|
-
height: window.innerHeight,
|
|
154
|
-
});
|
|
155
|
-
tempTransaction?.discard();
|
|
156
|
-
tempTransaction = getStudio().tempTransaction(({ stateEditors }) => {
|
|
157
|
-
stateEditors.studio.historic.panelPositions.setPanelPosition({
|
|
158
|
-
position,
|
|
159
|
-
panelId: stuffBeforeDrag.panelId,
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
},
|
|
163
|
-
onDragEnd(dragHappened) {
|
|
164
|
-
unlock();
|
|
165
|
-
if (dragHappened) {
|
|
166
|
-
tempTransaction?.commit();
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
tempTransaction?.discard();
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
},
|
|
174
|
-
};
|
|
175
|
-
}, [which]);
|
|
176
|
-
const [isDragging] = useDrag(node, dragOpts);
|
|
177
|
-
const Comp = els[which];
|
|
178
|
-
const isOnCorner = which.length <= 6;
|
|
179
|
-
return (React.createElement(Comp, { ref: ref, className: [
|
|
180
|
-
isDragging ? 'isDragging' : '',
|
|
181
|
-
panelStuff.boundsHighlighted && isOnCorner ? 'isHighlighted' : '',
|
|
182
|
-
].join(' '), style: { cursor: cursors[which] } }));
|
|
183
|
-
};
|
|
184
|
-
export default PanelResizeHandle;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PanelResizeHandle from './PanelResizeHandle';
|
|
3
|
-
const PanelResizers = (props) => {
|
|
4
|
-
return (React.createElement(React.Fragment, null,
|
|
5
|
-
React.createElement(PanelResizeHandle, { which: "Bottom" }),
|
|
6
|
-
React.createElement(PanelResizeHandle, { which: "Top" }),
|
|
7
|
-
React.createElement(PanelResizeHandle, { which: "Left" }),
|
|
8
|
-
React.createElement(PanelResizeHandle, { which: "Right" }),
|
|
9
|
-
React.createElement(PanelResizeHandle, { which: "TopLeft" }),
|
|
10
|
-
React.createElement(PanelResizeHandle, { which: "TopRight" }),
|
|
11
|
-
React.createElement(PanelResizeHandle, { which: "BottomLeft" }),
|
|
12
|
-
React.createElement(PanelResizeHandle, { which: "BottomRight" })));
|
|
13
|
-
};
|
|
14
|
-
export default PanelResizers;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { usePanel } from './BasePanel';
|
|
5
|
-
import PanelResizers from './PanelResizers';
|
|
6
|
-
const Container = styled.div `
|
|
7
|
-
position: absolute;
|
|
8
|
-
user-select: none;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
${pointerEventsAutoInNormalMode};
|
|
11
|
-
/* box-shadow: 1px 2px 10px -5px black; */
|
|
12
|
-
|
|
13
|
-
z-index: 1000;
|
|
14
|
-
`;
|
|
15
|
-
const PanelWrapper = React.forwardRef((props, ref) => {
|
|
16
|
-
const stuff = usePanel();
|
|
17
|
-
const { style, children, ...otherProps } = props;
|
|
18
|
-
return (
|
|
19
|
-
// @ts-ignore
|
|
20
|
-
React.createElement(Container
|
|
21
|
-
// @ts-ignore
|
|
22
|
-
, {
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
ref: ref, ...otherProps, style: {
|
|
25
|
-
width: stuff.dims.width + 'px',
|
|
26
|
-
height: stuff.dims.height + 'px',
|
|
27
|
-
top: stuff.dims.top + 'px',
|
|
28
|
-
left: stuff.dims.left + 'px',
|
|
29
|
-
...(style ?? {}),
|
|
30
|
-
} },
|
|
31
|
-
React.createElement(PanelResizers, null),
|
|
32
|
-
children));
|
|
33
|
-
});
|
|
34
|
-
export default PanelWrapper;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { theme } from '@tomorrowevening/theatre-studio/css';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
export const panelZIndexes = {
|
|
4
|
-
get outlinePanel() {
|
|
5
|
-
return 1;
|
|
6
|
-
},
|
|
7
|
-
get propsPanel() {
|
|
8
|
-
return panelZIndexes.outlinePanel;
|
|
9
|
-
},
|
|
10
|
-
get sequenceEditorPanel() {
|
|
11
|
-
return this.outlinePanel - 1;
|
|
12
|
-
},
|
|
13
|
-
get toolbar() {
|
|
14
|
-
return this.outlinePanel + 1;
|
|
15
|
-
},
|
|
16
|
-
get pluginPanes() {
|
|
17
|
-
return this.sequenceEditorPanel - 1;
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
export const propsEditorBackground = theme.panel.bg;
|
|
21
|
-
export const TitleBar_Piece = styled.span `
|
|
22
|
-
white-space: nowrap;
|
|
23
|
-
`;
|
|
24
|
-
export const TitleBar_Punctuation = styled.span `
|
|
25
|
-
white-space: nowrap;
|
|
26
|
-
color: ${theme.panel.head.punctuation.color};
|
|
27
|
-
`;
|
|
28
|
-
export const F2 = styled.div `
|
|
29
|
-
background: ${propsEditorBackground};
|
|
30
|
-
flex-grow: 1;
|
|
31
|
-
overflow-y: scroll;
|
|
32
|
-
padding: 0;
|
|
33
|
-
`;
|
|
34
|
-
export const titleBarHeight = 18;
|
|
35
|
-
export const TitleBar = styled.div `
|
|
36
|
-
height: ${titleBarHeight}px;
|
|
37
|
-
box-sizing: border-box;
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
padding: 0 10px;
|
|
41
|
-
position: relative;
|
|
42
|
-
color: #adadadb3;
|
|
43
|
-
border-bottom: 1px solid rgb(0 0 0 / 13%);
|
|
44
|
-
background-color: #25272b;
|
|
45
|
-
font-size: 10px;
|
|
46
|
-
font-weight: 500;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
white-space: nowrap;
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
|
-
`;
|
|
51
|
-
// the minimum visible width or height when the panel is partially offscreen
|
|
52
|
-
export const minVisibleSize = 100;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { getOutlineSelection } from '@tomorrowevening/theatre-studio/selectors';
|
|
2
|
-
import { usePrism, useVal } from '@tomorrowevening/theatre-react';
|
|
3
|
-
import React, { createContext, useContext, useEffect, useLayoutEffect, useState, } from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { isProject, isSheetObject } from '@tomorrowevening/theatre-shared/instanceTypes';
|
|
6
|
-
import { panelZIndexes, TitleBar_Piece, TitleBar_Punctuation, } from '@tomorrowevening/theatre-studio/panels/BasePanel/common';
|
|
7
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
8
|
-
import ObjectDetails from './ObjectDetails';
|
|
9
|
-
import ProjectDetails from './ProjectDetails';
|
|
10
|
-
import getStudio from '@tomorrowevening/theatre-studio/getStudio';
|
|
11
|
-
import useHotspot from '@tomorrowevening/theatre-studio/uiComponents/useHotspot';
|
|
12
|
-
import { Atom, prism, val } from '@tomorrowevening/theatre-dataverse';
|
|
13
|
-
import EmptyState from './EmptyState';
|
|
14
|
-
import useLockSet from '@tomorrowevening/theatre-studio/uiComponents/useLockSet';
|
|
15
|
-
import { usePresenceListenersOnRootElement } from '@tomorrowevening/theatre-studio/uiComponents/usePresence';
|
|
16
|
-
const headerHeight = `32px`;
|
|
17
|
-
const Container = styled.div `
|
|
18
|
-
${pointerEventsAutoInNormalMode};
|
|
19
|
-
background-color: rgba(40, 43, 47, 0.8);
|
|
20
|
-
position: fixed;
|
|
21
|
-
right: 8px;
|
|
22
|
-
top: 50px;
|
|
23
|
-
// Temporary, see comment about CSS grid in SingleRowPropEditor.
|
|
24
|
-
width: 280px;
|
|
25
|
-
height: fit-content;
|
|
26
|
-
z-index: ${panelZIndexes.propsPanel};
|
|
27
|
-
|
|
28
|
-
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.15);
|
|
29
|
-
backdrop-filter: blur(14px);
|
|
30
|
-
border-radius: 2px;
|
|
31
|
-
|
|
32
|
-
display: ${({ pin }) => (pin ? 'block' : 'none')};
|
|
33
|
-
|
|
34
|
-
&:hover {
|
|
35
|
-
display: block;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@supports not (backdrop-filter: blur()) {
|
|
39
|
-
background: rgba(40, 43, 47, 0.95);
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
const Title = styled.div `
|
|
43
|
-
margin: 0 10px;
|
|
44
|
-
color: #919191;
|
|
45
|
-
font-weight: 500;
|
|
46
|
-
font-size: 10px;
|
|
47
|
-
user-select: none;
|
|
48
|
-
${pointerEventsAutoInNormalMode};
|
|
49
|
-
white-space: nowrap;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
text-overflow: ellipsis;
|
|
52
|
-
`;
|
|
53
|
-
const Header = styled.div `
|
|
54
|
-
height: ${headerHeight};
|
|
55
|
-
display: flex;
|
|
56
|
-
align-items: center;
|
|
57
|
-
`;
|
|
58
|
-
const Body = styled.div `
|
|
59
|
-
${pointerEventsAutoInNormalMode};
|
|
60
|
-
max-height: calc(100vh - 100px);
|
|
61
|
-
overflow-y: scroll;
|
|
62
|
-
&::-webkit-scrollbar {
|
|
63
|
-
display: none;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
scrollbar-width: none;
|
|
67
|
-
padding: 0;
|
|
68
|
-
user-select: none;
|
|
69
|
-
|
|
70
|
-
/* Set the font-size for input values in the detail panel */
|
|
71
|
-
font-size: 12px;
|
|
72
|
-
`;
|
|
73
|
-
export const contextMenuShownContext = createContext([false, () => () => { }]);
|
|
74
|
-
const DetailPanel = (props) => {
|
|
75
|
-
const pin = useVal(getStudio().atomP.ahistoric.pinDetails) !== false;
|
|
76
|
-
const hotspotActive = useHotspot('right');
|
|
77
|
-
useLayoutEffect(() => {
|
|
78
|
-
isDetailPanelHotspotActiveB.set(hotspotActive);
|
|
79
|
-
}, [hotspotActive]);
|
|
80
|
-
// cleanup
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
return () => {
|
|
83
|
-
isDetailPanelHoveredB.set(false);
|
|
84
|
-
isDetailPanelHotspotActiveB.set(false);
|
|
85
|
-
};
|
|
86
|
-
}, []);
|
|
87
|
-
const [isContextMenuShown] = useContext(contextMenuShownContext);
|
|
88
|
-
const showDetailsPanel = pin || hotspotActive || isContextMenuShown;
|
|
89
|
-
const [containerElt, setContainerElt] = useState(null);
|
|
90
|
-
usePresenceListenersOnRootElement(containerElt);
|
|
91
|
-
return usePrism(() => {
|
|
92
|
-
const selection = getOutlineSelection();
|
|
93
|
-
const obj = selection.find(isSheetObject);
|
|
94
|
-
if (obj) {
|
|
95
|
-
return (React.createElement(Container, { "data-testid": "DetailPanel-Object", pin: showDetailsPanel, ref: setContainerElt, onMouseEnter: () => {
|
|
96
|
-
isDetailPanelHoveredB.set(true);
|
|
97
|
-
}, onMouseLeave: () => {
|
|
98
|
-
isDetailPanelHoveredB.set(false);
|
|
99
|
-
} },
|
|
100
|
-
React.createElement(Header, null,
|
|
101
|
-
React.createElement(Title, { title: `${obj.sheet.address.sheetId}: ${obj.sheet.address.sheetInstanceId} > ${obj.address.objectKey}` },
|
|
102
|
-
React.createElement(TitleBar_Piece, null,
|
|
103
|
-
obj.sheet.address.sheetId,
|
|
104
|
-
" "),
|
|
105
|
-
React.createElement(TitleBar_Punctuation, null,
|
|
106
|
-
':',
|
|
107
|
-
"\u00A0"),
|
|
108
|
-
React.createElement(TitleBar_Piece, null,
|
|
109
|
-
obj.sheet.address.sheetInstanceId,
|
|
110
|
-
' '),
|
|
111
|
-
React.createElement(TitleBar_Punctuation, null, "\u00A0\u2192\u00A0"),
|
|
112
|
-
React.createElement(TitleBar_Piece, null, obj.address.objectKey))),
|
|
113
|
-
React.createElement(Body, null,
|
|
114
|
-
React.createElement(ObjectDetails, { objects: [obj] }))));
|
|
115
|
-
}
|
|
116
|
-
const project = selection.find(isProject);
|
|
117
|
-
if (project) {
|
|
118
|
-
return (React.createElement(Container, { pin: showDetailsPanel },
|
|
119
|
-
React.createElement(Header, null,
|
|
120
|
-
React.createElement(Title, { title: `${project.address.projectId}` },
|
|
121
|
-
React.createElement(TitleBar_Piece, null,
|
|
122
|
-
project.address.projectId,
|
|
123
|
-
" "))),
|
|
124
|
-
React.createElement(Body, null,
|
|
125
|
-
React.createElement(ProjectDetails, { projects: [project] }))));
|
|
126
|
-
}
|
|
127
|
-
return (React.createElement(Container, { pin: showDetailsPanel, onMouseEnter: () => {
|
|
128
|
-
isDetailPanelHoveredB.set(true);
|
|
129
|
-
}, onMouseLeave: () => {
|
|
130
|
-
isDetailPanelHoveredB.set(false);
|
|
131
|
-
} },
|
|
132
|
-
React.createElement(EmptyState, null)));
|
|
133
|
-
}, [showDetailsPanel]);
|
|
134
|
-
};
|
|
135
|
-
export default () => {
|
|
136
|
-
const lockSet = useLockSet();
|
|
137
|
-
return (React.createElement(contextMenuShownContext.Provider, { value: lockSet },
|
|
138
|
-
React.createElement(DetailPanel, null)));
|
|
139
|
-
};
|
|
140
|
-
const isDetailPanelHotspotActiveB = new Atom(false);
|
|
141
|
-
const isDetailPanelHoveredB = new Atom(false);
|
|
142
|
-
export const shouldShowDetailD = prism(() => {
|
|
143
|
-
const isHovered = val(isDetailPanelHoveredB.prism);
|
|
144
|
-
const isHotspotActive = val(isDetailPanelHotspotActiveB.prism);
|
|
145
|
-
return isHovered || isHotspotActive;
|
|
146
|
-
});
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { isPropConfigComposite } from '@tomorrowevening/theatre-shared/propTypes/utils';
|
|
2
|
-
import { Atom, getPointerParts } from '@tomorrowevening/theatre-dataverse';
|
|
3
|
-
import last from 'lodash-es/last';
|
|
4
|
-
import { darken, transparentize } from 'polished';
|
|
5
|
-
import React, { useLayoutEffect, useMemo } from 'react';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import { rowIndentationFormulaCSS } from '@tomorrowevening/theatre-studio/panels/DetailPanel/DeterminePropEditorForDetail/rowIndentationFormulaCSS';
|
|
8
|
-
import { propNameTextCSS } from '@tomorrowevening/theatre-studio/propEditors/utils/propNameTextCSS';
|
|
9
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
10
|
-
import useRefAndState from '@tomorrowevening/theatre-studio/utils/useRefAndState';
|
|
11
|
-
import DeterminePropEditorForDetail from '@tomorrowevening/theatre-studio/panels/DetailPanel/DeterminePropEditorForDetail';
|
|
12
|
-
import useContextMenu from '@tomorrowevening/theatre-studio/uiComponents/simpleContextMenu/useContextMenu';
|
|
13
|
-
import { useEditingToolsForCompoundProp } from '@tomorrowevening/theatre-studio/propEditors/useEditingToolsForCompoundProp';
|
|
14
|
-
import { whatPropIsHighlighted } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/whatPropIsHighlighted';
|
|
15
|
-
import { deriver } from '@tomorrowevening/theatre-studio/utils/derive-utils';
|
|
16
|
-
import NumberPropEditor from '@tomorrowevening/theatre-studio/propEditors/simpleEditors/NumberPropEditor';
|
|
17
|
-
import { useEditingToolsForSimplePropInDetailsPanel } from '@tomorrowevening/theatre-studio/propEditors/useEditingToolsForSimpleProp';
|
|
18
|
-
import { usePrism } from '@tomorrowevening/theatre-react';
|
|
19
|
-
import { val } from '@tomorrowevening/theatre-dataverse';
|
|
20
|
-
import { HiOutlineChevronRight } from 'react-icons/all';
|
|
21
|
-
import memoizeFn from '@tomorrowevening/theatre-shared/utils/memoizeFn';
|
|
22
|
-
const Container = styled.div `
|
|
23
|
-
--step: 15px;
|
|
24
|
-
--left-pad: 15px;
|
|
25
|
-
${pointerEventsAutoInNormalMode};
|
|
26
|
-
--right-width: 60%;
|
|
27
|
-
`;
|
|
28
|
-
const Header = styled.div `
|
|
29
|
-
height: 30px;
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: stretch;
|
|
32
|
-
position: relative;
|
|
33
|
-
`;
|
|
34
|
-
const Padding = styled.div `
|
|
35
|
-
padding-left: ${rowIndentationFormulaCSS};
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
${({ isVectorProp }) => isVectorProp ? 'width: calc(100% - var(--right-width))' : ''};
|
|
40
|
-
`;
|
|
41
|
-
const ControlIndicators = styled.div `
|
|
42
|
-
flexshrink: 0;
|
|
43
|
-
`;
|
|
44
|
-
const PropName = deriver(styled.div `
|
|
45
|
-
margin-left: 4px;
|
|
46
|
-
cursor: default;
|
|
47
|
-
height: 100%;
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
gap: 4px;
|
|
51
|
-
user-select: none;
|
|
52
|
-
&:hover {
|
|
53
|
-
color: white;
|
|
54
|
-
}
|
|
55
|
-
overflow: hidden;
|
|
56
|
-
|
|
57
|
-
${() => propNameTextCSS};
|
|
58
|
-
`);
|
|
59
|
-
const CollapseIcon = styled.span `
|
|
60
|
-
width: 28px;
|
|
61
|
-
height: 28px;
|
|
62
|
-
font-size: 9px;
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
|
|
67
|
-
transition: transform 0.05s ease-out, color 0.1s ease-out;
|
|
68
|
-
transform: rotateZ(${(props) => (props.isCollapsed ? 0 : 90)}deg);
|
|
69
|
-
color: #66686a;
|
|
70
|
-
|
|
71
|
-
visibility: ${(props) =>
|
|
72
|
-
// If it's a vector, show the collapse icon only when it's expanded
|
|
73
|
-
(!props.isVector && props.isCollapsed) ||
|
|
74
|
-
// If it's a regular compond prop, show the collapse icon only when it's collapsed
|
|
75
|
-
(props.isVector && !props.isCollapsed)
|
|
76
|
-
? 'visible'
|
|
77
|
-
: 'hidden'};
|
|
78
|
-
|
|
79
|
-
${Header}:hover & {
|
|
80
|
-
visibility: visible;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&:hover {
|
|
84
|
-
transform: rotateZ(${(props) => (props.isCollapsed ? 15 : 75)}deg);
|
|
85
|
-
color: #c0c4c9;
|
|
86
|
-
}
|
|
87
|
-
`;
|
|
88
|
-
const color = transparentize(0.05, `#282b2f`);
|
|
89
|
-
const SubProps = styled.div `
|
|
90
|
-
/* background: ${({ depth }) => darken(depth * 0.03, color)}; */
|
|
91
|
-
/* padding: ${(props) => (props.lastSubIsComposite ? 0 : '4px')} 0; */
|
|
92
|
-
`;
|
|
93
|
-
const isVectorProp = memoizeFn((propConfig) => {
|
|
94
|
-
const props = Object.entries(propConfig.props);
|
|
95
|
-
return (props.length <= 3 &&
|
|
96
|
-
props.every(([name, conf]) => conf.type === 'number' && ['x', 'y', 'z'].includes(name)));
|
|
97
|
-
});
|
|
98
|
-
function VectorComponentEditor({ propConfig, pointerToProp, obj, SimpleEditorComponent: EditorComponent, }) {
|
|
99
|
-
const editingTools = useEditingToolsForSimplePropInDetailsPanel(pointerToProp, obj, propConfig);
|
|
100
|
-
return (React.createElement(NumberPropEditor, { editingTools: editingTools, propConfig: propConfig, value: editingTools.value }));
|
|
101
|
-
}
|
|
102
|
-
const InputContainer = styled.div `
|
|
103
|
-
display: flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: stretch;
|
|
106
|
-
padding: 0 8px 0 2px;
|
|
107
|
-
box-sizing: border-box;
|
|
108
|
-
height: 100%;
|
|
109
|
-
width: var(--right-width);
|
|
110
|
-
flex-shrink: 0;
|
|
111
|
-
flex-grow: 0;
|
|
112
|
-
`;
|
|
113
|
-
function DetailCompoundPropEditor({ pointerToProp, obj, propConfig, visualIndentation, }) {
|
|
114
|
-
const propName = propConfig.label ?? last(getPointerParts(pointerToProp).path);
|
|
115
|
-
const allSubs = Object.entries(propConfig.props);
|
|
116
|
-
const compositeSubs = allSubs.filter(([_, conf]) => isPropConfigComposite(conf));
|
|
117
|
-
const nonCompositeSubs = allSubs.filter(([_, conf]) => !isPropConfigComposite(conf));
|
|
118
|
-
const [propNameContainerRef, propNameContainer] = useRefAndState(null);
|
|
119
|
-
const tools = useEditingToolsForCompoundProp(pointerToProp, obj, propConfig);
|
|
120
|
-
const [contextMenu] = useContextMenu(propNameContainer, {
|
|
121
|
-
menuItems: tools.contextMenuItems,
|
|
122
|
-
});
|
|
123
|
-
const lastSubPropIsComposite = compositeSubs.length > 0;
|
|
124
|
-
const isPropHighlightedD = useMemo(() => whatPropIsHighlighted.getIsPropHighlightedD({
|
|
125
|
-
...obj.address,
|
|
126
|
-
pathToProp: getPointerParts(pointerToProp).path,
|
|
127
|
-
}), [pointerToProp]);
|
|
128
|
-
const globalPointerPath = `${obj.address.projectId},${obj.address.sheetId},${obj.address.sheetInstanceId},${obj.address.objectKey},${getPointerParts(pointerToProp).path.join()}`;
|
|
129
|
-
// isVectorProp is already memoized, so no need to wrap this in `useMemo()`
|
|
130
|
-
const isVector = isVectorProp(propConfig);
|
|
131
|
-
useLayoutEffect(() => {
|
|
132
|
-
if (!collapsedMap.has(globalPointerPath)) {
|
|
133
|
-
collapsedMap.set(globalPointerPath, new Atom(isVector));
|
|
134
|
-
}
|
|
135
|
-
}, [globalPointerPath, propConfig]);
|
|
136
|
-
const box = collapsedMap.get(globalPointerPath);
|
|
137
|
-
const isCollapsed = usePrism(() => {
|
|
138
|
-
return box ? val(box.pointer) : isVector;
|
|
139
|
-
}, [box]);
|
|
140
|
-
return (React.createElement(Container, null,
|
|
141
|
-
contextMenu,
|
|
142
|
-
React.createElement(Header
|
|
143
|
-
// @ts-ignore
|
|
144
|
-
, {
|
|
145
|
-
// @ts-ignore
|
|
146
|
-
style: { '--depth': visualIndentation - 1 } },
|
|
147
|
-
React.createElement(Padding, { isVectorProp: isVector },
|
|
148
|
-
React.createElement(ControlIndicators, null, tools.controlIndicators),
|
|
149
|
-
React.createElement(PropName, { isHighlighted: isPropHighlightedD, ref: propNameContainerRef },
|
|
150
|
-
React.createElement("span", null, propName || 'Props')),
|
|
151
|
-
React.createElement(CollapseIcon, { isCollapsed: isCollapsed, isVector: isVector, onClick: () => {
|
|
152
|
-
box?.set(!box.get());
|
|
153
|
-
} },
|
|
154
|
-
React.createElement(HiOutlineChevronRight, null))),
|
|
155
|
-
isVector && isCollapsed && (React.createElement(InputContainer, null, [...allSubs].map(([subPropKey, subPropConfig]) => {
|
|
156
|
-
return (React.createElement(VectorComponentEditor, { key: 'prop-' + subPropKey,
|
|
157
|
-
// @ts-ignore
|
|
158
|
-
propConfig: subPropConfig, pointerToProp: pointerToProp[subPropKey], obj: obj }));
|
|
159
|
-
})))),
|
|
160
|
-
!isCollapsed && (React.createElement(SubProps
|
|
161
|
-
// @ts-ignore
|
|
162
|
-
, {
|
|
163
|
-
// @ts-ignore
|
|
164
|
-
style: { '--depth': visualIndentation }, depth: visualIndentation, lastSubIsComposite: lastSubPropIsComposite }, [...nonCompositeSubs, ...compositeSubs].map(([subPropKey, subPropConfig]) => {
|
|
165
|
-
return (React.createElement(DeterminePropEditorForDetail, { key: 'prop-' + subPropKey, propConfig: subPropConfig, pointerToProp: pointerToProp[subPropKey], obj: obj, visualIndentation: visualIndentation + 1 }));
|
|
166
|
-
})))));
|
|
167
|
-
}
|
|
168
|
-
export default React.memo(DetailCompoundPropEditor);
|
|
169
|
-
const collapsedMap = new Map();
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import { useEditingToolsForSimplePropInDetailsPanel } from '@tomorrowevening/theatre-studio/propEditors/useEditingToolsForSimpleProp';
|
|
3
|
-
import { SingleRowPropEditor } from '@tomorrowevening/theatre-studio/panels/DetailPanel/DeterminePropEditorForDetail/SingleRowPropEditor';
|
|
4
|
-
import { getPointerParts } from '@tomorrowevening/theatre-dataverse';
|
|
5
|
-
import { whatPropIsHighlighted } from '@tomorrowevening/theatre-studio/panels/SequenceEditorPanel/whatPropIsHighlighted';
|
|
6
|
-
/**
|
|
7
|
-
* Shown in the Object details panel, changes to this editor are usually reflected at either
|
|
8
|
-
* the playhead position (the `sequence.position`) or if static, the static override value.
|
|
9
|
-
*/
|
|
10
|
-
function DetailSimplePropEditor({ propConfig, pointerToProp, obj, SimpleEditorComponent: EditorComponent, }) {
|
|
11
|
-
const editingTools = useEditingToolsForSimplePropInDetailsPanel(pointerToProp, obj, propConfig);
|
|
12
|
-
const isPropHighlightedD = useMemo(() => whatPropIsHighlighted.getIsPropHighlightedD({
|
|
13
|
-
...obj.address,
|
|
14
|
-
pathToProp: getPointerParts(pointerToProp).path,
|
|
15
|
-
}), [pointerToProp]);
|
|
16
|
-
return (React.createElement(SingleRowPropEditor, { editingTools: editingTools,
|
|
17
|
-
propConfig,
|
|
18
|
-
pointerToProp,
|
|
19
|
-
isPropHighlightedD },
|
|
20
|
-
React.createElement(EditorComponent, { editingTools: editingTools, propConfig: propConfig, value: editingTools.value })));
|
|
21
|
-
}
|
|
22
|
-
export default React.memo(DetailSimplePropEditor);
|