@hyperframes/studio 0.8.50 → 0.8.53-desktop.0
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/assets/{hyperframes-player-CxxDxHTW.js → hyperframes-player-PTEnAHhg.js} +3 -3
- package/dist/assets/{index-DUAIWxkI.js → index--myXp8ui.js} +1 -1
- package/dist/assets/{index-Dt3qBI-9.js → index-BjslOS9g.js} +1 -1
- package/dist/assets/index-BnXZuIJD.css +1 -0
- package/dist/assets/index-CNyviK_l.js +390 -0
- package/dist/index.css +29 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +825 -24
- package/dist/index.html +2 -2
- package/dist/index.js +8911 -9853
- package/dist/index.js.map +1 -1
- package/dist/styles/tailwind-preset.js.map +1 -1
- package/package.json +13 -12
- package/src/App.tsx +145 -163
- package/src/captions/components/CaptionAnimationPanel.tsx +4 -4
- package/src/captions/components/CaptionOverlay.sender.test.tsx +52 -0
- package/src/captions/components/CaptionOverlay.tsx +8 -4
- package/src/captions/components/CaptionOverlayUtils.ts +2 -3
- package/src/captions/components/CaptionPropertyPanel.tsx +3 -3
- package/src/captions/components/CaptionTimeline.tsx +1 -1
- package/src/captions/components/shared.tsx +2 -2
- package/src/components/AskAgentModal.tsx +5 -5
- package/src/components/EditorShell.selectionSync.test.tsx +9 -4
- package/src/components/EditorShell.tsx +59 -62
- package/src/components/ExternalFileConflictBanner.tsx +16 -16
- package/src/components/LintModal.tsx +6 -16
- package/src/components/MediaPreview.tsx +2 -2
- package/src/components/RightPanelTabs.test.tsx +151 -0
- package/src/components/RightPanelTabs.tsx +59 -0
- package/src/components/SaveQueuePausedBanner.tsx +2 -2
- package/src/components/StudioHeader.dom.test.tsx +181 -0
- package/src/components/StudioHeader.test.ts +0 -12
- package/src/components/StudioHeader.tsx +118 -221
- package/src/components/StudioLeftPanels.tsx +202 -0
- package/src/components/StudioOverlays.tsx +1 -1
- package/src/components/{StudioRightPanel.tsx → StudioRightPanels.tsx} +57 -194
- package/src/components/{StudioRightPanel.types.ts → StudioRightPanels.types.ts} +4 -3
- package/src/components/StudioToast.tsx +2 -2
- package/src/components/TimelineHistoryButtons.dom.test.tsx +117 -0
- package/src/components/TimelineHistoryButtons.tsx +54 -0
- package/src/components/TimelineToolbar.test.tsx +8 -0
- package/src/components/TimelineToolbar.tsx +8 -12
- package/src/components/dock/Dock.test.tsx +274 -0
- package/src/components/dock/Dock.tsx +291 -0
- package/src/components/dock/dock.css +28 -0
- package/src/components/dock/dockAccessibility.test.ts +166 -0
- package/src/components/dock/dockAccessibility.ts +98 -0
- package/src/components/dock/dockLayout.test.ts +134 -0
- package/src/components/dock/dockLayout.ts +105 -0
- package/src/components/dock/dockLayoutSchema.ts +66 -0
- package/src/components/dock/dockLayoutStore.test.ts +28 -0
- package/src/components/dock/dockLayoutStore.ts +108 -0
- package/src/components/dock/dockTestHarness.ts +11 -0
- package/src/components/dock/panelRegistry.ts +67 -0
- package/src/components/editor/AnimationCard.tsx +4 -4
- package/src/components/editor/AnimationCardParts.tsx +6 -6
- package/src/components/editor/BlockParamsPanel.tsx +4 -4
- package/src/components/editor/BorderRadiusEditor.tsx +1 -1
- package/src/components/editor/CanvasContextMenu.tsx +1 -1
- package/src/components/editor/ComputedTweenNotice.tsx +1 -1
- package/src/components/editor/DomEditOverlay.tsx +1 -1
- package/src/components/editor/EaseCurveSection.tsx +1 -1
- package/src/components/editor/EaseParamFields.tsx +5 -5
- package/src/components/editor/FileTree.tsx +4 -4
- package/src/components/editor/FileTreeIcons.tsx +1 -1
- package/src/components/editor/FileTreeNodes.tsx +13 -13
- package/src/components/editor/InlineTextToolbar.tsx +1 -1
- package/src/components/editor/InspectorHeaderActions.tsx +3 -3
- package/src/components/editor/KeyframeDiamond.tsx +1 -1
- package/src/components/editor/KeyframeEaseList.tsx +1 -1
- package/src/components/editor/LayersPanel.test.ts +97 -1
- package/src/components/editor/LayersPanel.tsx +7 -5
- package/src/components/editor/MarqueeOverlay.tsx +1 -1
- package/src/components/editor/OffCanvasIndicators.tsx +1 -1
- package/src/components/editor/PreviewGuides.tsx +1 -1
- package/src/components/editor/PromotableControl.tsx +2 -2
- package/src/components/editor/PropertyPanelEmptyState.tsx +7 -7
- package/src/components/editor/PropertyPanelFlatHeader.tsx +2 -2
- package/src/components/editor/SnapToolbar.test.tsx +0 -3
- package/src/components/editor/SnapToolbar.tsx +2 -2
- package/src/components/editor/TimelineFxPopover.tsx +1 -1
- package/src/components/editor/TopologyLens.test.tsx +28 -0
- package/src/components/editor/TopologyLens.tsx +7 -5
- package/src/components/editor/Transform3DCube.tsx +2 -2
- package/src/components/editor/audioFxRevealTarget.ts +1 -0
- package/src/components/editor/domEditing.test.ts +1 -1
- package/src/components/editor/domEditingAgentPrompt.test.ts +8 -6
- package/src/components/editor/domEditingAgentPrompt.ts +4 -3
- package/src/components/editor/propertyPanelColor.tsx +11 -11
- package/src/components/editor/propertyPanelColorCurveGraph.tsx +1 -1
- package/src/components/editor/propertyPanelColorGradingControls.tsx +7 -9
- package/src/components/editor/propertyPanelColorGradingSection.tsx +6 -6
- package/src/components/editor/propertyPanelColorGradingSlider.tsx +5 -5
- package/src/components/editor/propertyPanelColorWheels.tsx +1 -1
- package/src/components/editor/propertyPanelCommitField.tsx +1 -1
- package/src/components/editor/propertyPanelFill.tsx +4 -4
- package/src/components/editor/propertyPanelFlatColorGradingAccessory.tsx +3 -3
- package/src/components/editor/propertyPanelFlatColorGradingSection.tsx +7 -7
- package/src/components/editor/propertyPanelFlatEffectsSection.tsx +4 -4
- package/src/components/editor/propertyPanelFlatMediaSection.tsx +3 -3
- package/src/components/editor/propertyPanelFlatOverlaysSection.tsx +1 -1
- package/src/components/editor/propertyPanelFlatPrimitives.tsx +10 -10
- package/src/components/editor/propertyPanelFlatSelectRow.tsx +3 -3
- package/src/components/editor/propertyPanelFlatTextSection.test.tsx +8 -9
- package/src/components/editor/propertyPanelFlatTextSection.tsx +5 -5
- package/src/components/editor/propertyPanelFlatToggle.tsx +1 -1
- package/src/components/editor/propertyPanelFont.tsx +5 -5
- package/src/components/editor/propertyPanelFxCarveModule.tsx +1 -1
- package/src/components/editor/propertyPanelFxControls.test.tsx +1 -1
- package/src/components/editor/propertyPanelFxControls.tsx +6 -6
- package/src/components/editor/propertyPanelFxEqModule.tsx +2 -2
- package/src/components/editor/propertyPanelFxPresetStyle.ts +2 -2
- package/src/components/editor/propertyPanelGradingNumberField.tsx +1 -1
- package/src/components/editor/propertyPanelMediaSection.tsx +1 -1
- package/src/components/editor/propertyPanelPrimitives.tsx +7 -7
- package/src/components/editor/propertyPanelSections.tsx +8 -8
- package/src/components/editor/useColorGradingController.test.ts +38 -0
- package/src/components/editor/useColorGradingController.ts +9 -1
- package/src/components/editor/useColorGradingPreviews.test.ts +76 -0
- package/src/components/editor/useColorGradingPreviews.ts +11 -1
- package/src/components/editor/usePreviewCompositionRect.test.tsx +95 -0
- package/src/components/editor/usePreviewCompositionRect.ts +21 -0
- package/src/components/feedback/StudioFeedbackCard.tsx +7 -7
- package/src/components/feedback/feedbackTrigger.ts +0 -1
- package/src/components/nle/AssetPreviewOverlay.tsx +6 -2
- package/src/components/nle/CompositionBreadcrumb.tsx +3 -3
- package/src/components/nle/NLEContext.tsx +0 -43
- package/src/components/nle/NLEPreview.tsx +3 -3
- package/src/components/nle/PreviewOverlays.tsx +6 -6
- package/src/components/nle/PreviewPane.tsx +3 -3
- package/src/components/nle/TimelinePane.tsx +53 -67
- package/src/components/panels/SlideshowPanel.tsx +3 -3
- package/src/components/panels/SlideshowSubPanels.tsx +20 -17
- package/src/components/panels/VariablesBindElement.tsx +2 -2
- package/src/components/panels/VariablesDeclarationForm.tsx +2 -2
- package/src/components/panels/VariablesOtherCompositions.tsx +1 -1
- package/src/components/panels/VariablesPanel.tsx +4 -4
- package/src/components/panels/VariablesValueControls.tsx +2 -2
- package/src/components/pointerTargetSize.test.tsx +8 -0
- package/src/components/renders/FfmpegRequiredNotice.tsx +5 -5
- package/src/components/renders/RenderQueue.test.tsx +7 -0
- package/src/components/renders/RenderQueue.tsx +7 -7
- package/src/components/renders/RenderQueueItem.tsx +6 -6
- package/src/components/renders/RenderQueuePanel.tsx +1 -1
- package/src/components/sidebar/AssetCard.tsx +8 -8
- package/src/components/sidebar/AssetContextMenu.tsx +8 -8
- package/src/components/sidebar/AssetsTab.tsx +2 -2
- package/src/components/sidebar/AudioRow.tsx +6 -6
- package/src/components/sidebar/BlocksTab.tsx +6 -6
- package/src/components/sidebar/{LeftSidebar.masterComposition.test.tsx → CompositionsPanel.masterComposition.test.tsx} +6 -9
- package/src/components/sidebar/CompositionsPanel.tsx +15 -0
- package/src/components/sidebar/CompositionsTab.tsx +5 -5
- package/src/components/sidebar/GlobalAssetsView.tsx +1 -1
- package/src/components/sidebar/PromptPreviewModal.tsx +3 -3
- package/src/components/sidebar/SidebarLintButton.test.tsx +53 -0
- package/src/components/sidebar/SidebarLintButton.tsx +50 -0
- package/src/components/timelineToolbarStyles.ts +5 -0
- package/src/components/ui/Button.test.tsx +252 -0
- package/src/components/ui/Button.tsx +89 -126
- package/src/components/ui/IconButton.tsx +38 -0
- package/src/components/ui/Input.tsx +115 -0
- package/src/components/ui/Menu.test.tsx +374 -0
- package/src/components/ui/Menu.tsx +213 -0
- package/src/components/ui/NumberField.tsx +122 -0
- package/src/components/ui/Popover.tsx +74 -0
- package/src/components/ui/SearchInput.tsx +2 -2
- package/src/components/ui/Select.tsx +100 -0
- package/src/components/ui/Slider.tsx +153 -0
- package/src/components/ui/Tabs.test.tsx +98 -0
- package/src/components/ui/Tabs.tsx +71 -0
- package/src/components/ui/Toggle.tsx +63 -0
- package/src/components/ui/Tooltip.test.tsx +110 -0
- package/src/components/ui/Tooltip.tsx +38 -112
- package/src/components/ui/cn.test.ts +30 -0
- package/src/components/ui/cn.ts +25 -0
- package/src/components/ui/index.ts +29 -2
- package/src/components/ui/mountHost.testHelpers.ts +24 -0
- package/src/components/ui/valueControls.test.tsx +524 -0
- package/src/contexts/PanelLayoutContext.tsx +3 -57
- package/src/hooks/appHotkeysDispatch.ts +3 -4
- package/src/hooks/timelineEditPermission.ts +31 -0
- package/src/hooks/useAppHotkeys.previewForwarding.test.tsx +0 -2
- package/src/hooks/useAppHotkeys.test.ts +0 -1
- package/src/hooks/useAppHotkeys.textEditing.test.tsx +0 -3
- package/src/hooks/useAppHotkeys.ts +21 -84
- package/src/hooks/useCaptionDetection.sender.test.tsx +46 -0
- package/src/hooks/useCaptionDetection.ts +3 -1
- package/src/hooks/useDomEditPreviewSync.ts +4 -6
- package/src/hooks/useDomEditSession.ts +0 -7
- package/src/hooks/useDomEditWiring.ts +4 -9
- package/src/hooks/useEditHistoryActions.test.tsx +90 -0
- package/src/hooks/useEditHistoryActions.ts +106 -0
- package/src/hooks/useFileManager.ts +21 -123
- package/src/hooks/useLintModal.test.tsx +65 -0
- package/src/hooks/useLintModal.ts +3 -0
- package/src/hooks/usePanelLayout.test.ts +108 -296
- package/src/hooks/usePanelLayout.ts +50 -255
- package/src/hooks/usePersistentEditHistory.ts +1 -1
- package/src/hooks/useProjectFileWriter.ts +150 -0
- package/src/hooks/useRightPanelIntents.test.ts +181 -0
- package/src/hooks/useRightPanelIntents.ts +63 -0
- package/src/hooks/useSdkSession.lifecycle.test.tsx +49 -4
- package/src/hooks/useSdkSession.ts +43 -10
- package/src/hooks/useServerConnection.hashProject.test.tsx +94 -0
- package/src/hooks/useServerConnection.ts +43 -10
- package/src/hooks/useSlideshowTabState.test.ts +9 -31
- package/src/hooks/useSlideshowTabState.ts +6 -19
- package/src/hooks/useStudioContextValue.test.ts +6 -18
- package/src/hooks/useStudioContextValue.ts +5 -26
- package/src/hooks/useTimelineAssetDropOps.test.tsx +41 -1
- package/src/hooks/useTimelineAssetDropOps.ts +52 -11
- package/src/hooks/useTimelineDeleteOps.test.tsx +111 -0
- package/src/hooks/useTimelineEditing.test.tsx +322 -3
- package/src/hooks/useTimelineEditing.ts +103 -16
- package/src/hooks/useTimelineEditingTypes.ts +3 -0
- package/src/hooks/useTrackPendingTimelineEdit.test.tsx +62 -0
- package/src/hooks/useTrackPendingTimelineEdit.ts +22 -0
- package/src/hostMount.test.tsx +222 -0
- package/src/index.ts +87 -0
- package/src/main.tsx +9 -3
- package/src/player/components/AudioWaveform.tsx +1 -1
- package/src/player/components/AutomationSelectionMenu.tsx +3 -3
- package/src/player/components/ClipContextMenu.tsx +3 -3
- package/src/player/components/CompositionThumbnail.test.ts +0 -3
- package/src/player/components/CompositionThumbnail.tsx +3 -4
- package/src/player/components/EditModal.tsx +1 -1
- package/src/player/components/ImageThumbnail.tsx +1 -1
- package/src/player/components/KeyframeDiamondContextMenu.tsx +4 -4
- package/src/player/components/LayerDisclosureRow.tsx +2 -2
- package/src/player/components/PlayerControls.tsx +1 -1
- package/src/player/components/ShortcutsPanel.tsx +9 -9
- package/src/player/components/SpeedMenu.tsx +3 -5
- package/src/player/components/Timeline.tsx +3 -2
- package/src/player/components/TimelineCanvas.tsx +21 -14
- package/src/player/components/TimelineClip.tsx +0 -1
- package/src/player/components/TimelineDiamondConnectors.tsx +1 -1
- package/src/player/components/TimelineEmptyState.tsx +5 -5
- package/src/player/components/TimelineFxButton.tsx +6 -6
- package/src/player/components/TimelineGroupHeader.tsx +5 -5
- package/src/player/components/TimelineGroupLaneLabels.tsx +1 -1
- package/src/player/components/TimelineGroupRow.tsx +1 -1
- package/src/player/components/TimelineLanes.test.tsx +32 -0
- package/src/player/components/TimelineLanes.tsx +2 -5
- package/src/player/components/TimelineLayerGroupHeader.tsx +2 -2
- package/src/player/components/TimelineRuler.tsx +1 -1
- package/src/player/components/TimelineShortcutHint.tsx +1 -1
- package/src/player/components/TimelineTrackHeader.test.tsx +26 -5
- package/src/player/components/TimelineTrackHeader.tsx +2 -2
- package/src/player/components/TimelineTrackPlainHeader.tsx +3 -3
- package/src/player/components/TimelineTypes.ts +2 -1
- package/src/player/components/TrackGapContextMenu.tsx +1 -1
- package/src/player/components/VideoThumbnail.tsx +4 -2
- package/src/player/components/VolumeControl.tsx +2 -2
- package/src/player/components/timelineCallbacks.ts +8 -8
- package/src/player/components/timelineClipDragPreview.ts +51 -27
- package/src/player/components/timelineClipDragTypes.ts +3 -0
- package/src/player/components/timelineDragDrop.test.tsx +61 -1
- package/src/player/components/timelineDragDrop.ts +57 -15
- package/src/player/components/timelineLaneProps.ts +3 -0
- package/src/player/components/timelineSnapping.test.ts +27 -0
- package/src/player/components/timelineSnapping.ts +14 -1
- package/src/player/components/timelineTheme.test.ts +4 -4
- package/src/player/components/timelineTheme.ts +30 -30
- package/src/player/components/trackHeaderLabelRows.tsx +4 -4
- package/src/player/components/useTimelineClipDrag.resize.test.tsx +136 -2
- package/src/player/components/useTimelineClipDrag.ts +30 -3
- package/src/player/lib/describeClips.ts +3 -54
- package/src/player/lib/playbackShortcuts.ts +2 -0
- package/src/player/lib/timelinePerformanceDiagnostics.test.ts +3 -2
- package/src/player/lib/timelinePerformanceDiagnostics.ts +1 -1
- package/src/player/store/previewIframeStore.notify.test.tsx +75 -0
- package/src/player/store/previewIframeStore.test.tsx +29 -0
- package/src/player/store/previewIframeStore.ts +25 -0
- package/src/renderQueueExports.test.tsx +58 -0
- package/src/styles/classCandidates.test.ts +105 -0
- package/src/styles/classCandidates.ts +281 -0
- package/src/styles/hex-baseline.json +84 -0
- package/src/styles/hexRatchet.test.ts +201 -0
- package/src/styles/iconTokens.ts +20 -0
- package/src/styles/palette-reset.css +6 -0
- package/src/styles/studio.css +24 -21
- package/src/styles/styleSources.test.ts +20 -0
- package/src/styles/styleSources.ts +47 -0
- package/src/styles/tailwind-preset.shared.js +3 -0
- package/src/styles/theme.css +270 -0
- package/src/styles/theme.test.ts +183 -0
- package/src/styles/tokenGate.test.ts +109 -0
- package/src/utils/sourcePatcher.ts +1 -1
- package/src/utils/studioHelpers.test.ts +18 -0
- package/src/utils/studioHelpers.ts +11 -8
- package/src/utils/studioUiPreferences.test.ts +10 -16
- package/src/utils/studioUiPreferences.ts +7 -16
- package/src/utils/timelineDropTrackInsert.test.ts +134 -0
- package/src/utils/timelineDropTrackInsert.ts +83 -0
- package/src/utils/typingTarget.ts +4 -0
- package/dist/assets/index-n2ml4tUn.js +0 -442
- package/dist/assets/index-pO6p0H27.css +0 -1
- package/src/components/PanelTabButton.tsx +0 -31
- package/src/components/StudioLeftSidebar.tsx +0 -204
- package/src/components/nle/TimelineResizeDivider.tsx +0 -101
- package/src/components/sidebar/LeftSidebar.storage.test.ts +0 -28
- package/src/components/sidebar/LeftSidebar.tsx +0 -334
- package/src/components/storyboard/AgentChatMessageButton.test.tsx +0 -47
- package/src/components/storyboard/AgentChatMessageButton.tsx +0 -45
- package/src/components/storyboard/FramePoster.test.tsx +0 -61
- package/src/components/storyboard/FramePoster.tsx +0 -86
- package/src/components/storyboard/StoryboardDirection.tsx +0 -45
- package/src/components/storyboard/StoryboardFrameFocus.tsx +0 -412
- package/src/components/storyboard/StoryboardFrameTile.tsx +0 -117
- package/src/components/storyboard/StoryboardGrid.tsx +0 -55
- package/src/components/storyboard/StoryboardLoaded.tsx +0 -307
- package/src/components/storyboard/StoryboardReviewGuide.tsx +0 -300
- package/src/components/storyboard/StoryboardScriptPanel.tsx +0 -26
- package/src/components/storyboard/StoryboardSourceEditor.tsx +0 -231
- package/src/components/storyboard/StoryboardStatusLegend.tsx +0 -21
- package/src/components/storyboard/StoryboardView.tsx +0 -169
- package/src/components/storyboard/StoryboardViewModeGuard.test.tsx +0 -187
- package/src/components/storyboard/frameComments.test.ts +0 -95
- package/src/components/storyboard/frameComments.ts +0 -115
- package/src/components/storyboard/frameStatus.ts +0 -36
- package/src/components/storyboard/storyboardReviewStage.test.ts +0 -40
- package/src/components/storyboard/storyboardReviewStage.ts +0 -45
- package/src/components/storyboard/useFrameComments.ts +0 -98
- package/src/contexts/ViewModeContext.tsx +0 -142
- package/src/hooks/useInspectorSplitResize.ts +0 -51
- package/src/hooks/useProjectSignaturePoll.test.tsx +0 -135
- package/src/hooks/useProjectSignaturePoll.ts +0 -68
- package/src/hooks/useStoryboard.ts +0 -99
- package/src/utils/fitPanels.test.ts +0 -164
- package/src/utils/fitPanels.ts +0 -151
|
@@ -3,338 +3,150 @@
|
|
|
3
3
|
import React, { act } from "react";
|
|
4
4
|
import { createRoot } from "react-dom/client";
|
|
5
5
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
6
|
-
import {
|
|
6
|
+
import { useDockLayoutStore, type DockController } from "../components/dock/dockLayoutStore";
|
|
7
|
+
import { PANEL_IDS, type PanelId } from "../components/dock/panelRegistry";
|
|
7
8
|
import { trackStudioEvent } from "../utils/studioTelemetry";
|
|
8
|
-
import { usePanelLayout } from "./usePanelLayout";
|
|
9
|
+
import { usePanelLayout, type InitialPanelLayoutState } from "./usePanelLayout";
|
|
9
10
|
|
|
10
11
|
(globalThis as unknown as { IS_REACT_ACT_ENVIRONMENT: boolean }).IS_REACT_ACT_ENVIRONMENT = true;
|
|
11
12
|
|
|
12
13
|
vi.mock("../utils/studioTelemetry", () => ({ trackStudioEvent: vi.fn() }));
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
getItem: (key: string) => entries.get(key) ?? null,
|
|
25
|
-
key: (index: number) => Array.from(entries.keys())[index] ?? null,
|
|
26
|
-
removeItem: (key: string) => entries.delete(key),
|
|
27
|
-
setItem: (key: string, value: string) => entries.set(key, value),
|
|
28
|
-
} satisfies Storage,
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(window, "innerWidth", { configurable: true, value: 1496 });
|
|
31
|
-
});
|
|
15
|
+
function fakeController(): DockController {
|
|
16
|
+
return {
|
|
17
|
+
open: vi.fn(),
|
|
18
|
+
activate: vi.fn(),
|
|
19
|
+
close: vi.fn(),
|
|
20
|
+
setTitle: vi.fn(),
|
|
21
|
+
setGroupVisible: vi.fn(),
|
|
22
|
+
reset: vi.fn(),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
function showDock(visible: PanelId[], controller = fakeController()) {
|
|
27
|
+
useDockLayoutStore.setState({
|
|
28
|
+
controller,
|
|
29
|
+
openPanels: new Set(PANEL_IDS),
|
|
30
|
+
visiblePanels: new Set(visible),
|
|
31
|
+
lastActive: {},
|
|
32
|
+
activePanel: null,
|
|
33
|
+
});
|
|
34
|
+
return controller;
|
|
35
|
+
}
|
|
38
36
|
|
|
39
|
-
function
|
|
37
|
+
function renderLayout(initial?: InitialPanelLayoutState) {
|
|
40
38
|
const host = document.createElement("div");
|
|
41
39
|
document.body.append(host);
|
|
42
40
|
const root = createRoot(host);
|
|
43
41
|
let current: ReturnType<typeof usePanelLayout> | null = null;
|
|
44
|
-
|
|
45
42
|
function Harness() {
|
|
46
|
-
current =
|
|
43
|
+
current = usePanelLayout(initial);
|
|
47
44
|
return null;
|
|
48
45
|
}
|
|
49
|
-
|
|
50
|
-
act(() => {
|
|
51
|
-
root.render(React.createElement(Harness));
|
|
52
|
-
});
|
|
53
|
-
|
|
46
|
+
act(() => root.render(React.createElement(Harness)));
|
|
54
47
|
return {
|
|
55
|
-
|
|
56
|
-
if (!current) throw new Error("
|
|
48
|
+
get layout() {
|
|
49
|
+
if (!current) throw new Error("layout not rendered");
|
|
57
50
|
return current;
|
|
58
51
|
},
|
|
59
52
|
unmount: () => act(() => root.unmount()),
|
|
60
53
|
};
|
|
61
54
|
}
|
|
62
55
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Object.defineProperty(window, "innerWidth", { configurable: true, value: width });
|
|
69
|
-
window.dispatchEvent(new Event("resize"));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
describe("usePanelLayout — right inspector panes", () => {
|
|
73
|
-
it("opens Design with the intended viewport-scaled panel widths", () => {
|
|
74
|
-
const harness = renderPanelLayout();
|
|
75
|
-
|
|
76
|
-
expect(harness.getState()).toMatchObject({
|
|
77
|
-
leftWidth: 384,
|
|
78
|
-
rightWidth: 424,
|
|
79
|
-
rightCollapsed: false,
|
|
80
|
-
rightPanelTab: "design",
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
harness.unmount();
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
it("persists the latest pointer width even before React rerenders", () => {
|
|
87
|
-
const harness = renderPanelLayout();
|
|
88
|
-
const state = harness.getState();
|
|
89
|
-
const target = { setPointerCapture: vi.fn() };
|
|
90
|
-
|
|
91
|
-
act(() => {
|
|
92
|
-
state.handlePanelResizeStart("left", {
|
|
93
|
-
preventDefault: vi.fn(),
|
|
94
|
-
target,
|
|
95
|
-
pointerId: 1,
|
|
96
|
-
clientX: 100,
|
|
97
|
-
} as unknown as React.PointerEvent);
|
|
98
|
-
state.handlePanelResizeMove({ clientX: 140 } as React.PointerEvent);
|
|
99
|
-
state.handlePanelResizeEnd();
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
expect(harness.getState().leftWidth).toBe(424);
|
|
103
|
-
expect(readStudioUiPreferences().leftWidth).toBe(424);
|
|
104
|
-
harness.unmount();
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("accumulates and persists rapid keyboard resize steps", () => {
|
|
108
|
-
const harness = renderPanelLayout();
|
|
109
|
-
const state = harness.getState();
|
|
110
|
-
|
|
111
|
-
act(() => {
|
|
112
|
-
state.adjustPanelWidth("right", 16);
|
|
113
|
-
state.adjustPanelWidth("right", 16);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
expect(harness.getState().rightWidth).toBe(456);
|
|
117
|
-
expect(readStudioUiPreferences().rightWidth).toBe(456);
|
|
118
|
-
harness.unmount();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it("toggleRightInspectorPane independently flips one pane, allowing both open at once", () => {
|
|
122
|
-
const harness = renderPanelLayout();
|
|
123
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: false, design: true });
|
|
124
|
-
|
|
125
|
-
act(() => harness.getState().toggleRightInspectorPane("layers"));
|
|
126
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: true, design: true });
|
|
127
|
-
|
|
128
|
-
harness.unmount();
|
|
129
|
-
});
|
|
56
|
+
beforeEach(() => vi.mocked(trackStudioEvent).mockClear());
|
|
57
|
+
afterEach(() => {
|
|
58
|
+
document.body.innerHTML = "";
|
|
59
|
+
useDockLayoutStore.setState({ controller: null });
|
|
60
|
+
});
|
|
130
61
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
expect(
|
|
136
|
-
|
|
62
|
+
describe("usePanelLayout over the dock", () => {
|
|
63
|
+
it("reads the tab of the right-zone panel that is showing", () => {
|
|
64
|
+
showDock(["preview", "timeline", "compositions", "renders"]);
|
|
65
|
+
const view = renderLayout();
|
|
66
|
+
expect(view.layout.rightPanelTab).toBe("renders");
|
|
67
|
+
expect(view.layout.rightCollapsed).toBe(false);
|
|
137
68
|
});
|
|
138
69
|
|
|
139
|
-
it("
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
expect(
|
|
143
|
-
|
|
144
|
-
act(() => harness.getState().setExclusiveRightInspectorPane("layers"));
|
|
145
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: true, design: false });
|
|
146
|
-
|
|
147
|
-
act(() => harness.getState().setExclusiveRightInspectorPane("design"));
|
|
148
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: false, design: true });
|
|
149
|
-
|
|
150
|
-
harness.unmount();
|
|
70
|
+
it("is collapsed when no right-zone panel is showing", () => {
|
|
71
|
+
showDock(["preview", "timeline", "compositions"]);
|
|
72
|
+
const view = renderLayout();
|
|
73
|
+
expect(view.layout.rightCollapsed).toBe(true);
|
|
74
|
+
expect(view.layout.rightPanelTab).toBe("design");
|
|
151
75
|
});
|
|
152
76
|
|
|
153
|
-
it("
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
77
|
+
it("opens the Design panel for the legacy block-params tab and reports the tab switch", () => {
|
|
78
|
+
const controller = showDock(["preview"]);
|
|
79
|
+
const view = renderLayout();
|
|
80
|
+
act(() => view.layout.setRightPanelTab("block-params"));
|
|
81
|
+
expect(controller.setGroupVisible).toHaveBeenCalledWith("design", true);
|
|
82
|
+
expect(controller.activate).toHaveBeenCalledWith("design");
|
|
83
|
+
expect(trackStudioEvent).toHaveBeenCalledWith("tab_switch", {
|
|
84
|
+
panel: "right_panel",
|
|
85
|
+
tab: "block-params",
|
|
160
86
|
});
|
|
161
|
-
const { usePanelLayout: usePanelLayoutFlatOff } = await import("./usePanelLayout");
|
|
162
|
-
const harness = renderPanelLayoutWith(usePanelLayoutFlatOff);
|
|
163
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: false, design: true });
|
|
164
|
-
|
|
165
|
-
act(() => harness.getState().setRightPanelTab("layers"));
|
|
166
|
-
// Legacy (split-view) behavior: additive, both panes end up open.
|
|
167
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: true, design: true });
|
|
168
|
-
|
|
169
|
-
harness.unmount();
|
|
170
87
|
});
|
|
171
88
|
|
|
172
|
-
it("
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
harness.getState().setRightPanelTab("design");
|
|
178
|
-
});
|
|
89
|
+
it("reports a tab switch only when the tab actually changes", () => {
|
|
90
|
+
showDock(["preview", "design"]);
|
|
91
|
+
const view = renderLayout();
|
|
92
|
+
vi.mocked(trackStudioEvent).mockClear();
|
|
93
|
+
act(() => view.layout.setRightPanelTab("design"));
|
|
179
94
|
expect(trackStudioEvent).not.toHaveBeenCalled();
|
|
180
|
-
|
|
181
|
-
act(() => {
|
|
182
|
-
harness.getState().setRightPanelTab("layers");
|
|
183
|
-
harness.getState().setRightPanelTab("layers");
|
|
184
|
-
});
|
|
185
|
-
expect(trackStudioEvent).toHaveBeenCalledOnce();
|
|
95
|
+
act(() => view.layout.setRightPanelTab("layers"));
|
|
186
96
|
expect(trackStudioEvent).toHaveBeenCalledWith("tab_switch", {
|
|
187
97
|
panel: "right_panel",
|
|
188
98
|
tab: "layers",
|
|
189
99
|
});
|
|
190
|
-
expect(harness.getState().rightPanelTab).toBe("layers");
|
|
191
|
-
|
|
192
|
-
harness.unmount();
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
it("caps a panel relative to the window instead of at a flat 600px", () => {
|
|
196
|
-
resizeWindowTo(700);
|
|
197
|
-
const harness = renderPanelLayout();
|
|
198
|
-
// The old flat cap let the inspector claim 600 of a 700px window.
|
|
199
|
-
expect(harness.getState().rightWidth).toBeLessThanOrEqual(280);
|
|
200
|
-
harness.unmount();
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
it("rails both panels once the window cannot fit them", () => {
|
|
204
|
-
resizeWindowTo(560);
|
|
205
|
-
const harness = renderPanelLayout();
|
|
206
|
-
expect(harness.getState()).toMatchObject({
|
|
207
|
-
effectiveLeftCollapsed: true,
|
|
208
|
-
effectiveRightCollapsed: true,
|
|
209
|
-
leftCollapsed: false,
|
|
210
|
-
rightCollapsed: false,
|
|
211
|
-
});
|
|
212
|
-
harness.unmount();
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
it("auto-collapse never writes the user's persisted or URL-synced intent", () => {
|
|
216
|
-
const harness = renderPanelLayout();
|
|
217
|
-
act(() => resizeWindowTo(560));
|
|
218
|
-
|
|
219
|
-
expect(harness.getState().effectiveLeftCollapsed).toBe(true);
|
|
220
|
-
// localStorage carries leftCollapsed; the shareable URL carries rightCollapsed.
|
|
221
|
-
// A ten-second window drag must rewrite neither.
|
|
222
|
-
expect(readStudioUiPreferences().leftCollapsed).toBeUndefined();
|
|
223
|
-
expect(harness.getState().leftCollapsed).toBe(false);
|
|
224
|
-
expect(harness.getState().rightCollapsed).toBe(false);
|
|
225
|
-
harness.unmount();
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it("returns the user's own width when the window grows back", () => {
|
|
229
|
-
const harness = renderPanelLayout();
|
|
230
|
-
const wide = harness.getState().leftWidth;
|
|
231
|
-
|
|
232
|
-
act(() => resizeWindowTo(560));
|
|
233
|
-
expect(harness.getState().leftWidth).toBeLessThan(wide);
|
|
234
|
-
|
|
235
|
-
act(() => resizeWindowTo(1496));
|
|
236
|
-
expect(harness.getState().leftWidth).toBe(wide);
|
|
237
|
-
harness.unmount();
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
it("keeps an explicitly collapsed sidebar collapsed after a narrow trip", () => {
|
|
241
|
-
const harness = renderPanelLayout();
|
|
242
|
-
act(() => harness.getState().toggleLeftSidebar());
|
|
243
|
-
expect(readStudioUiPreferences().leftCollapsed).toBe(true);
|
|
244
|
-
|
|
245
|
-
act(() => resizeWindowTo(560));
|
|
246
|
-
act(() => resizeWindowTo(1496));
|
|
247
|
-
|
|
248
|
-
expect(harness.getState().effectiveLeftCollapsed).toBe(true);
|
|
249
|
-
harness.unmount();
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
it("lets the user reopen a panel the window auto-collapsed", () => {
|
|
253
|
-
const harness = renderPanelLayout();
|
|
254
|
-
act(() => resizeWindowTo(560));
|
|
255
|
-
expect(harness.getState().effectiveRightCollapsed).toBe(true);
|
|
256
|
-
|
|
257
|
-
// Without this the header Inspector button would be dead below 700px.
|
|
258
|
-
act(() => harness.getState().setRightCollapsed(false));
|
|
259
|
-
expect(harness.getState().effectiveRightCollapsed).toBe(false);
|
|
260
|
-
harness.unmount();
|
|
261
100
|
});
|
|
262
101
|
|
|
263
|
-
it("
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
expect(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const
|
|
284
|
-
act(() =>
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
act(() =>
|
|
297
|
-
expect(
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
>("../components/editor/manualEditingAvailability");
|
|
313
|
-
return { ...actual, STUDIO_FLAT_INSPECTOR_ENABLED: true };
|
|
314
|
-
});
|
|
315
|
-
const { usePanelLayout: usePanelLayoutFlatOn } = await import("./usePanelLayout");
|
|
316
|
-
const harness = renderPanelLayoutWith(usePanelLayoutFlatOn);
|
|
317
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: false, design: true });
|
|
318
|
-
|
|
319
|
-
// The flat inspector can change its visible pane without changing the
|
|
320
|
-
// umbrella rightPanelTab value. A later element selection must still bring
|
|
321
|
-
// Design back even though rightPanelTab already says "design".
|
|
322
|
-
act(() => harness.getState().setExclusiveRightInspectorPane("layers"));
|
|
323
|
-
expect(harness.getState()).toMatchObject({
|
|
324
|
-
rightPanelTab: "design",
|
|
325
|
-
rightInspectorPanes: { layers: true, design: false },
|
|
326
|
-
});
|
|
327
|
-
act(() => harness.getState().setRightPanelTab("design"));
|
|
328
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: false, design: true });
|
|
329
|
-
|
|
330
|
-
// Element-select / block-params-close / header Inspector-button callers
|
|
331
|
-
// all reach setRightPanelTab directly, not through the in-panel tab
|
|
332
|
-
// click's own setExclusiveRightInspectorPane call — this must still
|
|
333
|
-
// enforce exclusivity under the flat flag, or both tabs end up
|
|
334
|
-
// highlighted while only one pane actually renders.
|
|
335
|
-
act(() => harness.getState().setRightPanelTab("layers"));
|
|
336
|
-
expect(harness.getState().rightInspectorPanes).toEqual({ layers: true, design: false });
|
|
337
|
-
|
|
338
|
-
harness.unmount();
|
|
102
|
+
it("collapses every open right-zone panel group and leaves the other zones alone", () => {
|
|
103
|
+
const controller = showDock(["preview", "design"]);
|
|
104
|
+
const view = renderLayout();
|
|
105
|
+
act(() => view.layout.setRightCollapsed(true));
|
|
106
|
+
const hidden = vi.mocked(controller.setGroupVisible).mock.calls;
|
|
107
|
+
expect(hidden.map(([id]) => id).sort()).toEqual(
|
|
108
|
+
["design", "layers", "renders", "slideshow", "variables"].sort(),
|
|
109
|
+
);
|
|
110
|
+
expect(hidden.every(([, visible]) => visible === false)).toBe(true);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("expanding an already-showing right column does nothing to the tab", () => {
|
|
114
|
+
const controller = showDock(["design"]);
|
|
115
|
+
const view = renderLayout();
|
|
116
|
+
act(() => view.layout.setRightCollapsed(false));
|
|
117
|
+
expect(controller.activate).not.toHaveBeenCalled();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it("expanding a fully hidden right column brings Design back", () => {
|
|
121
|
+
const controller = showDock(["preview"]);
|
|
122
|
+
const view = renderLayout();
|
|
123
|
+
act(() => view.layout.setRightCollapsed(false));
|
|
124
|
+
expect(controller.activate).toHaveBeenCalledWith("design");
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("applies the URL's tab and collapse state once, when the dock attaches", () => {
|
|
128
|
+
useDockLayoutStore.setState({ controller: null, openPanels: new Set(PANEL_IDS) });
|
|
129
|
+
const view = renderLayout({ rightPanelTab: "variables", rightCollapsed: true });
|
|
130
|
+
const controller = fakeController();
|
|
131
|
+
act(() => useDockLayoutStore.getState().attach(controller));
|
|
132
|
+
expect(controller.activate).toHaveBeenCalledWith("variables");
|
|
133
|
+
expect(controller.setGroupVisible).toHaveBeenCalledWith("design", false);
|
|
134
|
+
const later = fakeController();
|
|
135
|
+
act(() => useDockLayoutStore.getState().attach(later));
|
|
136
|
+
expect(later.activate).not.toHaveBeenCalled();
|
|
137
|
+
expect(later.setGroupVisible).not.toHaveBeenCalled();
|
|
138
|
+
view.unmount();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("keeps a URL's slideshow tab until the panel opens, then activates it once", () => {
|
|
142
|
+
const opened = new Set<PanelId>(PANEL_IDS.filter((id) => id !== "slideshow"));
|
|
143
|
+
useDockLayoutStore.setState({ controller: null, openPanels: opened });
|
|
144
|
+
const view = renderLayout({ rightPanelTab: "slideshow" });
|
|
145
|
+
const controller = fakeController();
|
|
146
|
+
act(() => useDockLayoutStore.getState().attach(controller));
|
|
147
|
+
expect(controller.activate).not.toHaveBeenCalled();
|
|
148
|
+
act(() => useDockLayoutStore.setState({ openPanels: new Set(PANEL_IDS) }));
|
|
149
|
+
expect(controller.activate).toHaveBeenCalledWith("slideshow");
|
|
150
|
+
view.unmount();
|
|
339
151
|
});
|
|
340
152
|
});
|