@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,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
function EllipsisFill(props) {
|
|
3
|
-
return (React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
4
|
-
React.createElement("path", { d: "M10.667 8a1.333 1.333 0 112.666 0 1.333 1.333 0 01-2.666 0zm-4 0a1.333 1.333 0 112.666 0 1.333 1.333 0 01-2.666 0zm-4 0a1.333 1.333 0 112.666 0 1.333 1.333 0 01-2.666 0z", fill: "currentColor" })));
|
|
5
|
-
}
|
|
6
|
-
export default EllipsisFill;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
function GlobeSimple(props) {
|
|
3
|
-
return (React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
4
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zm4.75-5.216A5.505 5.505 0 002.522 7.5H5.01c.051-1.468.328-2.807.764-3.825.14-.326.298-.626.477-.89zM13.478 7.5A5.505 5.505 0 009.75 2.784c.179.265.338.565.477.891.436 1.018.713 2.357.764 3.825h2.487zm0 1a5.505 5.505 0 01-3.729 4.716c.18-.264.339-.566.478-.892.436-1.018.713-2.356.764-3.824h2.487zM6.25 13.216A5.505 5.505 0 012.522 8.5H5.01c.051 1.468.328 2.806.764 3.824.14.326.299.627.478.892zm.44-9.147c-.374.874-.63 2.074-.682 3.431h3.982c-.051-1.357-.308-2.557-.683-3.431-.21-.491-.448-.857-.686-1.092-.236-.234-.446-.315-.622-.315s-.386.081-.622.315c-.238.235-.476.6-.686 1.092zm2.617 7.862c.375-.875.631-2.075.683-3.431H6.009c.052 1.356.308 2.556.683 3.43.21.492.448.857.686 1.093.236.233.446.314.622.314s.386-.081.622-.314c.238-.236.476-.601.686-1.092z", fill: "currentColor" })));
|
|
5
|
-
}
|
|
6
|
-
export default GlobeSimple;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
function Outline(props) {
|
|
3
|
-
return (React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
4
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.775 2.781a.5.5 0 01.5.5v1.7H4.67c.108-.957.92-1.7 1.905-1.7h6.608a1.917 1.917 0 110 3.834H6.574c-.78 0-1.452-.466-1.751-1.135H2.275v5.03h2.39a2.032 2.032 0 012.023-1.854h6.38a2.031 2.031 0 110 4.063h-6.38c-.83 0-1.543-.497-1.858-1.21H1.775a.5.5 0 01-.5-.5V3.281a.5.5 0 01.5-.5zm4.799 1.5h6.608a.917.917 0 110 1.834H6.574a.917.917 0 110-1.834zm.114 5.875h6.38a1.031 1.031 0 110 2.063h-6.38a1.032 1.032 0 110-2.063z", fill: "currentColor" })));
|
|
5
|
-
}
|
|
6
|
-
export default Outline;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
function Package(props) {
|
|
3
|
-
return (React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
4
|
-
React.createElement("path", { d: "M8.339 4.5l-2.055.644 4.451 1.393v2.748l-2.966.928-2.504-.783V6.738l2.42.758 2.055-.644-4.458-1.395L4 5.858v4.463L7.768 11.5 12 10.175V5.646L8.339 4.5z", fill: "currentColor" })));
|
|
5
|
-
}
|
|
6
|
-
export default Package;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
function Resize(props) {
|
|
3
|
-
return (React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
4
|
-
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.452 3.452a2 2 0 012-2h9.096a2 2 0 012 2v9.096a2 2 0 01-2 2H3.452a2 2 0 01-2-2V3.452zm2-1h9.096a1 1 0 011 1v9.096a1 1 0 01-1 1h-5.06V8.511H2.451V3.452a1 1 0 011-1z", fill: "currentColor" }),
|
|
5
|
-
React.createElement("path", { d: "M12.501 4.09a.5.5 0 00-.5-.5H8.95a.5.5 0 100 1h1.98l-2.45 2.449a.5.5 0 10.707.707l2.315-2.315v1.627a.5.5 0 001 0V4.09z", fill: "currentColor" })));
|
|
6
|
-
}
|
|
7
|
-
export default Resize;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
function Trash(props) {
|
|
3
|
-
return (React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props },
|
|
4
|
-
React.createElement("path", { d: "M6.8 11.6a.6.6 0 00.6-.6V7.4a.6.6 0 00-1.2 0V11a.6.6 0 00.6.6zm6-7.2h-2.4v-.6A1.8 1.8 0 008.6 2H7.4a1.8 1.8 0 00-1.8 1.8v.6H3.2a.6.6 0 100 1.2h.6v6.6A1.8 1.8 0 005.6 14h4.8a1.8 1.8 0 001.8-1.8V5.6h.6a.6.6 0 100-1.2zm-6-.6a.6.6 0 01.6-.6h1.2a.6.6 0 01.6.6v.6H6.8v-.6zm4.2 8.4a.6.6 0 01-.6.6H5.6a.6.6 0 01-.6-.6V5.6h6v6.6zm-1.8-.6a.6.6 0 00.6-.6V7.4a.6.6 0 00-1.2 0V11a.6.6 0 00.6.6z", fill: "currentColor" })));
|
|
5
|
-
}
|
|
6
|
-
export default Trash;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export { default as Outline } from './Outline';
|
|
2
|
-
export { default as ArrowClockwise } from './ArrowClockwise';
|
|
3
|
-
export { default as ArrowsOutCardinal } from './ArrowsOutCardinal';
|
|
4
|
-
export { default as Camera } from './Camera';
|
|
5
|
-
export { default as ChevronDown } from './ChevronDown';
|
|
6
|
-
export { default as ChevronRight } from './ChevronRight';
|
|
7
|
-
export { default as ChevronLeft } from './ChevronLeft';
|
|
8
|
-
export { default as Cube } from './Cube';
|
|
9
|
-
export { default as CubeFull } from './CubeFull';
|
|
10
|
-
export { default as CubeHalf } from './CubeHalf';
|
|
11
|
-
export { default as CubeRendered } from './CubeRendered';
|
|
12
|
-
export { default as Details } from './Details';
|
|
13
|
-
export { default as Ellipsis } from './Ellipsis';
|
|
14
|
-
export { default as GlobeSimple } from './GlobeSimple';
|
|
15
|
-
export { default as Resize } from './Resize';
|
|
16
|
-
export { default as Package } from './Package';
|
|
17
|
-
export { default as Bell } from './Bell';
|
|
18
|
-
export { default as Trash } from './Trash';
|
|
19
|
-
export { default as AddImage } from './AddImage';
|
|
20
|
-
export { default as EllipsisFill } from './EllipsisFill';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calls the callback when the mouse pointer moves outside the
|
|
3
|
-
* bounds of the node.
|
|
4
|
-
*/
|
|
5
|
-
export default function onPointerOutside(node, threshold, onPointerOutside) {
|
|
6
|
-
const containerRect = node.getBoundingClientRect();
|
|
7
|
-
const onMouseMove = (e) => {
|
|
8
|
-
if (e.clientX < containerRect.left - threshold ||
|
|
9
|
-
e.clientX > containerRect.left + containerRect.width + threshold ||
|
|
10
|
-
e.clientY < containerRect.top - threshold ||
|
|
11
|
-
e.clientY > containerRect.top + containerRect.height + threshold) {
|
|
12
|
-
onPointerOutside(e);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
window.addEventListener('mousemove', onMouseMove);
|
|
16
|
-
return () => {
|
|
17
|
-
window.removeEventListener('mousemove', onMouseMove);
|
|
18
|
-
};
|
|
19
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
const Container = styled.div `
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-grow: 1;
|
|
6
|
-
`;
|
|
7
|
-
const Label = styled.div `
|
|
8
|
-
flex-grow: 0;
|
|
9
|
-
color: hsl(0, 0%, 80%);
|
|
10
|
-
`;
|
|
11
|
-
const SelectedValueLabel = styled.div `
|
|
12
|
-
flex-grow: 1;
|
|
13
|
-
padding-left: 8px;
|
|
14
|
-
`;
|
|
15
|
-
const BasicSelect = (props) => {
|
|
16
|
-
// const [isOpen, setIsOpen] = useState<boolean>(false)
|
|
17
|
-
const selectedValue = typeof props.value === 'string' ? props.value : props.defaultOption;
|
|
18
|
-
const selectedLabel = props.options.find((opt) => opt.value === selectedValue)?.label;
|
|
19
|
-
return (React.createElement(Container, null,
|
|
20
|
-
React.createElement(Label, null,
|
|
21
|
-
React.createElement(React.Fragment, null, props.label)),
|
|
22
|
-
React.createElement(SelectedValueLabel, null, selectedLabel)));
|
|
23
|
-
};
|
|
24
|
-
export default BasicSelect;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Item from './Item';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { transparentize } from 'polished';
|
|
5
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
6
|
-
const minWidth = 190;
|
|
7
|
-
const SHOW_OPTIONAL_MENU_TITLE = true;
|
|
8
|
-
const MenuContainer = styled.ul `
|
|
9
|
-
position: absolute;
|
|
10
|
-
min-width: ${minWidth}px;
|
|
11
|
-
z-index: 10000;
|
|
12
|
-
background: ${transparentize(0.2, '#111')};
|
|
13
|
-
backdrop-filter: blur(2px);
|
|
14
|
-
color: white;
|
|
15
|
-
list-style-type: none;
|
|
16
|
-
padding: 2px 0;
|
|
17
|
-
margin: 0;
|
|
18
|
-
border-radius: 1px;
|
|
19
|
-
cursor: default;
|
|
20
|
-
${pointerEventsAutoInNormalMode};
|
|
21
|
-
border-radius: 3px;
|
|
22
|
-
`;
|
|
23
|
-
const MenuTitle = styled.div `
|
|
24
|
-
padding: 4px 10px;
|
|
25
|
-
border-bottom: 1px solid #6262626d;
|
|
26
|
-
color: #adadadb3;
|
|
27
|
-
font-size: 11px;
|
|
28
|
-
font-weight: 500;
|
|
29
|
-
`;
|
|
30
|
-
const BaseMenu = React.forwardRef((props, ref) => {
|
|
31
|
-
return (React.createElement(MenuContainer, { ref: ref },
|
|
32
|
-
SHOW_OPTIONAL_MENU_TITLE && props.displayName ? (React.createElement(MenuTitle, null, props.displayName)) : null,
|
|
33
|
-
props.items.map((item, i) => (React.createElement(Item, { key: `item-${i}`, label: item.label, enabled: item.enabled === false ? false : true, onClick: (e) => {
|
|
34
|
-
if (item.callback) {
|
|
35
|
-
item.callback(e);
|
|
36
|
-
}
|
|
37
|
-
props.onRequestClose();
|
|
38
|
-
} })))));
|
|
39
|
-
});
|
|
40
|
-
export default BaseMenu;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import useBoundingClientRect from '@tomorrowevening/theatre-studio/uiComponents/useBoundingClientRect';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { useContext } from 'react';
|
|
4
|
-
import React, { useLayoutEffect, useState } from 'react';
|
|
5
|
-
import { createPortal } from 'react-dom';
|
|
6
|
-
import useWindowSize from 'react-use/esm/useWindowSize';
|
|
7
|
-
import { height as itemHeight } from './Item';
|
|
8
|
-
import { PortalContext } from 'reakit';
|
|
9
|
-
import useOnKeyDown from '@tomorrowevening/theatre-studio/uiComponents/useOnKeyDown';
|
|
10
|
-
import BaseMenu from './BaseMenu';
|
|
11
|
-
/**
|
|
12
|
-
* How far from the menu should the pointer travel to auto close the menu
|
|
13
|
-
*/
|
|
14
|
-
const pointerDistanceThreshold = 20;
|
|
15
|
-
/**
|
|
16
|
-
* TODO let's make sure that triggering a context menu would close
|
|
17
|
-
* the other open context menu (if one _is_ open).
|
|
18
|
-
*/
|
|
19
|
-
const ContextMenu = (props) => {
|
|
20
|
-
const [container, setContainer] = useState(null);
|
|
21
|
-
const rect = useBoundingClientRect(container);
|
|
22
|
-
const windowSize = useWindowSize();
|
|
23
|
-
useLayoutEffect(() => {
|
|
24
|
-
if (!rect || !container)
|
|
25
|
-
return;
|
|
26
|
-
const preferredAnchorPoint = {
|
|
27
|
-
left: rect.width / 2,
|
|
28
|
-
// if there is a displayName, make sure to move the context menu up by one item,
|
|
29
|
-
// so that the first active item is the one the mouse is hovering over
|
|
30
|
-
top: itemHeight / 2 + (props.displayName ? itemHeight : 0),
|
|
31
|
-
};
|
|
32
|
-
const pos = {
|
|
33
|
-
left: props.clickPoint.clientX - preferredAnchorPoint.left,
|
|
34
|
-
top: props.clickPoint.clientY - preferredAnchorPoint.top,
|
|
35
|
-
};
|
|
36
|
-
if (pos.left < 0) {
|
|
37
|
-
pos.left = 0;
|
|
38
|
-
}
|
|
39
|
-
else if (pos.left + rect.width > windowSize.width) {
|
|
40
|
-
pos.left = windowSize.width - rect.width;
|
|
41
|
-
}
|
|
42
|
-
if (pos.top < 0) {
|
|
43
|
-
pos.top = 0;
|
|
44
|
-
}
|
|
45
|
-
else if (pos.top + rect.height > windowSize.height) {
|
|
46
|
-
pos.top = windowSize.height - rect.height;
|
|
47
|
-
}
|
|
48
|
-
container.style.left = pos.left + 'px';
|
|
49
|
-
container.style.top = pos.top + 'px';
|
|
50
|
-
const onMouseMove = (e) => {
|
|
51
|
-
if (e.clientX < pos.left - pointerDistanceThreshold ||
|
|
52
|
-
e.clientX > pos.left + rect.width + pointerDistanceThreshold ||
|
|
53
|
-
e.clientY < pos.top - pointerDistanceThreshold ||
|
|
54
|
-
e.clientY > pos.top + rect.height + pointerDistanceThreshold) {
|
|
55
|
-
props.onRequestClose();
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
window.addEventListener('mousemove', onMouseMove);
|
|
59
|
-
return () => {
|
|
60
|
-
window.removeEventListener('mousemove', onMouseMove);
|
|
61
|
-
};
|
|
62
|
-
}, [rect, container, props.clickPoint, windowSize, props.onRequestClose]);
|
|
63
|
-
const portalLayer = useContext(PortalContext);
|
|
64
|
-
useOnKeyDown((ev) => {
|
|
65
|
-
if (ev.key === 'Escape')
|
|
66
|
-
props.onRequestClose();
|
|
67
|
-
});
|
|
68
|
-
const items = useMemo(() => {
|
|
69
|
-
const itemsArr = Array.isArray(props.items) ? props.items : props.items();
|
|
70
|
-
if (itemsArr.length > 0)
|
|
71
|
-
return itemsArr;
|
|
72
|
-
else
|
|
73
|
-
return [
|
|
74
|
-
{
|
|
75
|
-
/**
|
|
76
|
-
* TODO Need design for this
|
|
77
|
-
*/
|
|
78
|
-
label: props.displayName
|
|
79
|
-
? `No actions for ${props.displayName}`
|
|
80
|
-
: `No actions found`,
|
|
81
|
-
enabled: false,
|
|
82
|
-
},
|
|
83
|
-
];
|
|
84
|
-
}, [props.items]);
|
|
85
|
-
return createPortal(React.createElement(BaseMenu, { items: items, onRequestClose: props.onRequestClose, displayName: props.displayName, ref: setContainer }), portalLayer);
|
|
86
|
-
};
|
|
87
|
-
export default ContextMenu;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import noop from '@tomorrowevening/theatre-shared/utils/noop';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
export const height = 26;
|
|
5
|
-
const ItemContainer = styled.li `
|
|
6
|
-
height: ${height}px;
|
|
7
|
-
padding: 0 12px;
|
|
8
|
-
margin: 0;
|
|
9
|
-
display: flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
font-size: 11px;
|
|
12
|
-
font-weight: 400;
|
|
13
|
-
position: relative;
|
|
14
|
-
color: ${(props) => (props.enabled ? 'white' : '#8f8f8f')};
|
|
15
|
-
cursor: ${(props) => (props.enabled ? 'normal' : 'not-allowed')};
|
|
16
|
-
|
|
17
|
-
&:after {
|
|
18
|
-
position: absolute;
|
|
19
|
-
inset: 2px 1px;
|
|
20
|
-
display: block;
|
|
21
|
-
content: ' ';
|
|
22
|
-
pointer-events: none;
|
|
23
|
-
z-index: -1;
|
|
24
|
-
border-radius: 3px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&:hover:after {
|
|
28
|
-
background-color: ${(props) => props.enabled ? 'rgba(63, 174, 191, 0.75)' : 'initial'};
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
const ItemLabel = styled.span ``;
|
|
32
|
-
const Item = (props) => {
|
|
33
|
-
return (React.createElement(ItemContainer, { onClick: props.enabled ? props.onClick : noop, enabled: props.enabled, title: props.enabled ? undefined : 'Disabled' },
|
|
34
|
-
React.createElement(ItemLabel, null,
|
|
35
|
-
React.createElement(React.Fragment, null, props.label))));
|
|
36
|
-
};
|
|
37
|
-
export default Item;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useEffect } from 'react';
|
|
2
|
-
import ContextMenu from './ContextMenu/ContextMenu';
|
|
3
|
-
import useRequestContextMenu from './useRequestContextMenu';
|
|
4
|
-
import { contextMenuShownContext } from '@tomorrowevening/theatre-studio/panels/DetailPanel/DetailPanel';
|
|
5
|
-
const emptyNode = React.createElement(React.Fragment, null);
|
|
6
|
-
export default function useContextMenu(target, opts) {
|
|
7
|
-
const [status, close] = useRequestContextMenu(target, opts);
|
|
8
|
-
// TODO: this lock is now exported from the detail panel, do refactor it when you get the chance
|
|
9
|
-
const [, addContextMenu] = useContext(contextMenuShownContext);
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
let removeContextMenu;
|
|
12
|
-
if (status.isOpen) {
|
|
13
|
-
opts.onOpen?.();
|
|
14
|
-
removeContextMenu = addContextMenu();
|
|
15
|
-
}
|
|
16
|
-
return () => removeContextMenu?.();
|
|
17
|
-
}, [status.isOpen, opts.onOpen]);
|
|
18
|
-
const node = !status.isOpen ? (emptyNode) : (React.createElement(ContextMenu, { items: opts.menuItems, displayName: opts.displayName, clickPoint: status.event, onRequestClose: close }));
|
|
19
|
-
return [node, close, status.isOpen];
|
|
20
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
const useRequestContextMenu = (target, opts) => {
|
|
3
|
-
const [state, setState] = useState({ isOpen: false });
|
|
4
|
-
const close = useCallback(() => setState({ isOpen: false }), []);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
if (!target || opts.disabled === true) {
|
|
7
|
-
setState({ isOpen: false });
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const onTrigger = (event) => {
|
|
11
|
-
setState({ isOpen: true, event });
|
|
12
|
-
event.preventDefault();
|
|
13
|
-
event.stopPropagation();
|
|
14
|
-
};
|
|
15
|
-
target.addEventListener('contextmenu', onTrigger);
|
|
16
|
-
return () => {
|
|
17
|
-
target.removeEventListener('contextmenu', onTrigger);
|
|
18
|
-
};
|
|
19
|
-
}, [target, opts.disabled]);
|
|
20
|
-
return [state, close];
|
|
21
|
-
};
|
|
22
|
-
export default useRequestContextMenu;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { pointerEventsAutoInNormalMode } from '@tomorrowevening/theatre-studio/css';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import useTooltip from '@tomorrowevening/theatre-studio/uiComponents/Popover/useTooltip';
|
|
5
|
-
import { mergeRefs } from 'react-merge-refs';
|
|
6
|
-
import MinimalTooltip from '@tomorrowevening/theatre-studio/uiComponents/Popover/MinimalTooltip';
|
|
7
|
-
import ToolbarSwitchSelectContainer from './ToolbarSwitchSelectContainer';
|
|
8
|
-
export const Container = styled.button `
|
|
9
|
-
${pointerEventsAutoInNormalMode};
|
|
10
|
-
position: relative;
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
justify-content: center;
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
width: 32px;
|
|
17
|
-
height: 32px;
|
|
18
|
-
outline: none;
|
|
19
|
-
|
|
20
|
-
color: #a8a8a9;
|
|
21
|
-
|
|
22
|
-
background: rgba(40, 43, 47, 0.8);
|
|
23
|
-
backdrop-filter: blur(14px);
|
|
24
|
-
border: none;
|
|
25
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
|
26
|
-
border-radius: 2px;
|
|
27
|
-
|
|
28
|
-
svg {
|
|
29
|
-
display: block;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&:hover {
|
|
33
|
-
background: rgba(59, 63, 69, 0.8);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:active {
|
|
37
|
-
background: rgba(82, 88, 96, 0.8);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.selected {
|
|
41
|
-
color: rgba(255, 255, 255, 0.8);
|
|
42
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.7);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Don't blur if in a button group, because it already blurs. We need to blur
|
|
46
|
-
// on the group-level, otherwise we get seams.
|
|
47
|
-
${ToolbarSwitchSelectContainer} > & {
|
|
48
|
-
backdrop-filter: none;
|
|
49
|
-
filter: none;
|
|
50
|
-
border-radius: 0;
|
|
51
|
-
|
|
52
|
-
&:first-child {
|
|
53
|
-
border-top-left-radius: 2px;
|
|
54
|
-
border-bottom-left-radius: 2px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&:last-child {
|
|
58
|
-
border-bottom-right-radius: 2px;
|
|
59
|
-
border-top-right-radius: 2px;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@supports not (backdrop-filter: blur()) {
|
|
64
|
-
background: rgba(40, 43, 47, 0.95);
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
const ToolbarIconButton = React.forwardRef(({ title, ...props }, ref) => {
|
|
68
|
-
const [tooltip, localRef] = useTooltip({ enabled: typeof title === 'string' }, () => React.createElement(MinimalTooltip, null, title));
|
|
69
|
-
return (React.createElement(React.Fragment, null,
|
|
70
|
-
tooltip,
|
|
71
|
-
React.createElement(Container, { ref: mergeRefs([localRef, ref]), ...props }),
|
|
72
|
-
' '));
|
|
73
|
-
});
|
|
74
|
-
export default ToolbarIconButton;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from 'reakit';
|
|
3
|
-
import ButtonImpl from './ToolbarIconButton';
|
|
4
|
-
import Container from './ToolbarSwitchSelectContainer';
|
|
5
|
-
function OptionButton({ value, label, icon, onClick, isSelected, }) {
|
|
6
|
-
return (React.createElement(React.Fragment, null,
|
|
7
|
-
React.createElement(ButtonImpl, { forwardedAs: Button, className: isSelected ? 'selected' : undefined, "aria-label": label, onClick: onClick, title: label }, icon)));
|
|
8
|
-
}
|
|
9
|
-
const ToolbarSwitchSelect = ({ value: valueOfSwitch, onChange, options, }) => {
|
|
10
|
-
return (React.createElement(Container, null, options.map(({ label, icon, value: optionValue }) => (React.createElement(OptionButton, { key: optionValue, value: optionValue, isSelected: valueOfSwitch === optionValue, label: label, icon: icon, onClick: () => onChange(optionValue) })))));
|
|
11
|
-
};
|
|
12
|
-
export default ToolbarSwitchSelect;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect, useState } from 'react';
|
|
2
|
-
export default function useBoundingClientRect(node) {
|
|
3
|
-
const [bounds, set] = useState(null);
|
|
4
|
-
useLayoutEffect(() => {
|
|
5
|
-
if (node) {
|
|
6
|
-
set(node.getBoundingClientRect());
|
|
7
|
-
}
|
|
8
|
-
return () => {
|
|
9
|
-
set(null);
|
|
10
|
-
};
|
|
11
|
-
}, [node]);
|
|
12
|
-
return bounds;
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Little utility hook that refreshes a react element every `ms` milliseconds. Use
|
|
4
|
-
* it to debug whether the props of the element, or the return values of its hooks
|
|
5
|
-
* are getting properly updated.
|
|
6
|
-
*
|
|
7
|
-
* @param ms - interval in milliseconds
|
|
8
|
-
*/
|
|
9
|
-
export default function useDebugRefreshEvery(ms = 500) {
|
|
10
|
-
const [_, setState] = useState(0);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const interval = setInterval(() => {
|
|
13
|
-
setState((i) => i + 1);
|
|
14
|
-
}, ms);
|
|
15
|
-
return () => {
|
|
16
|
-
clearInterval(interval);
|
|
17
|
-
};
|
|
18
|
-
}, []);
|
|
19
|
-
}
|