@konitif/workbench 0.284.1
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/LICENSE.md +21 -0
- package/README.md +54 -0
- package/dist/application/boot/applicationBoot.d.ts +48 -0
- package/dist/application/boot/applicationBoot.js +174 -0
- package/dist/application/experiment/ControlledExperimentCampaign.d.ts +12 -0
- package/dist/application/experiment/ControlledExperimentCampaign.js +159 -0
- package/dist/application/experiment/ControlledExperimentRecorder.d.ts +17 -0
- package/dist/application/experiment/ControlledExperimentRecorder.js +215 -0
- package/dist/application/i18n/WorkbenchTranslationRegistry.d.ts +19 -0
- package/dist/application/i18n/WorkbenchTranslationRegistry.js +179 -0
- package/dist/application/layout/surfaceCommandRouter.d.ts +18 -0
- package/dist/application/layout/surfaceCommandRouter.js +247 -0
- package/dist/application/physics/NoopPhysicsBackend.d.ts +2 -0
- package/dist/application/physics/NoopPhysicsBackend.js +2 -0
- package/dist/application/physics/PhysicsService.d.ts +2 -0
- package/dist/application/physics/PhysicsService.js +2 -0
- package/dist/application/project/ProjectManifest.d.ts +15 -0
- package/dist/application/project/ProjectManifest.js +107 -0
- package/dist/application/repository/RepositoryPreflightEngine.d.ts +6 -0
- package/dist/application/repository/RepositoryPreflightEngine.js +301 -0
- package/dist/application/runtime/RuntimeBackendConnection.d.ts +9 -0
- package/dist/application/runtime/RuntimeBackendConnection.js +34 -0
- package/dist/application/runtime/RuntimeBackendSubscription.d.ts +8 -0
- package/dist/application/runtime/RuntimeBackendSubscription.js +52 -0
- package/dist/application/runtime/RuntimeCheckpointStore.d.ts +20 -0
- package/dist/application/runtime/RuntimeCheckpointStore.js +65 -0
- package/dist/application/runtime/RuntimeLaunchProgress.d.ts +3 -0
- package/dist/application/runtime/RuntimeLaunchProgress.js +38 -0
- package/dist/application/runtime/RuntimeLaunchStateSnapshot.d.ts +48 -0
- package/dist/application/runtime/RuntimeLaunchStateSnapshot.js +73 -0
- package/dist/application/runtime/RuntimeObservabilityHub.d.ts +28 -0
- package/dist/application/runtime/RuntimeObservabilityHub.js +262 -0
- package/dist/application/runtime/RuntimeObservationEvents.d.ts +15 -0
- package/dist/application/runtime/RuntimeObservationEvents.js +18 -0
- package/dist/application/runtime/RuntimeOffloadManager.d.ts +24 -0
- package/dist/application/runtime/RuntimeOffloadManager.js +96 -0
- package/dist/application/runtime/RuntimePlanEngine.d.ts +11 -0
- package/dist/application/runtime/RuntimePlanEngine.js +67 -0
- package/dist/application/runtime/RuntimeProjectionCatalog.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionCatalog.js +48 -0
- package/dist/application/runtime/RuntimeProjectionSession.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionSession.js +4 -0
- package/dist/application/runtime/RuntimeProjectionSessionKeys.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionSessionKeys.js +10 -0
- package/dist/application/runtime/RuntimeProjectionSessionReducers.d.ts +7 -0
- package/dist/application/runtime/RuntimeProjectionSessionReducers.js +101 -0
- package/dist/application/runtime/RuntimeProjectionSessionSerialization.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionSessionSerialization.js +89 -0
- package/dist/application/runtime/RuntimeProjectionSessionSharedState.d.ts +3 -0
- package/dist/application/runtime/RuntimeProjectionSessionSharedState.js +53 -0
- package/dist/application/runtime/RuntimeProjectionSessionTypes.d.ts +38 -0
- package/dist/application/runtime/RuntimeProjectionSessionTypes.js +1 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionSync.d.ts +29 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionSync.js +39 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionUpdates.d.ts +27 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionUpdates.js +38 -0
- package/dist/application/runtime/RuntimeRegistryOwner.d.ts +20 -0
- package/dist/application/runtime/RuntimeRegistryOwner.js +71 -0
- package/dist/application/runtime/RuntimeRegistrySnapshots.d.ts +6 -0
- package/dist/application/runtime/RuntimeRegistrySnapshots.js +51 -0
- package/dist/application/runtime/RuntimeRegistryTypes.d.ts +29 -0
- package/dist/application/runtime/RuntimeRegistryTypes.js +1 -0
- package/dist/application/runtime/RuntimeSharedState.d.ts +6 -0
- package/dist/application/runtime/RuntimeSharedState.js +47 -0
- package/dist/application/runtime/WorkbenchRuntimeCore.d.ts +82 -0
- package/dist/application/runtime/WorkbenchRuntimeCore.js +463 -0
- package/dist/application/runtime/WorkbenchRuntimeSanitizers.d.ts +9 -0
- package/dist/application/runtime/WorkbenchRuntimeSanitizers.js +62 -0
- package/dist/application/shell/state.d.ts +22 -0
- package/dist/application/shell/state.js +308 -0
- package/dist/application/widgets/createWorkbenchWidgetAdapter.d.ts +9 -0
- package/dist/application/widgets/createWorkbenchWidgetAdapter.js +30 -0
- package/dist/application/workspace/canonicalizeLayout.d.ts +2 -0
- package/dist/application/workspace/canonicalizeLayout.js +91 -0
- package/dist/application/workspace/closePanel.d.ts +6 -0
- package/dist/application/workspace/closePanel.js +43 -0
- package/dist/application/workspace/collapseSplit.d.ts +7 -0
- package/dist/application/workspace/collapseSplit.js +45 -0
- package/dist/application/workspace/collapseSplitBoundary.d.ts +8 -0
- package/dist/application/workspace/collapseSplitBoundary.js +106 -0
- package/dist/application/workspace/commands.d.ts +71 -0
- package/dist/application/workspace/commands.js +216 -0
- package/dist/application/workspace/createPeripheralBands.d.ts +14 -0
- package/dist/application/workspace/createPeripheralBands.js +62 -0
- package/dist/application/workspace/createWorkspace.d.ts +7 -0
- package/dist/application/workspace/createWorkspace.js +12 -0
- package/dist/application/workspace/detachPanelToWindow.d.ts +12 -0
- package/dist/application/workspace/detachPanelToWindow.js +57 -0
- package/dist/application/workspace/dockPanel.d.ts +10 -0
- package/dist/application/workspace/dockPanel.js +399 -0
- package/dist/application/workspace/finalizeWorkspace.d.ts +4 -0
- package/dist/application/workspace/finalizeWorkspace.js +23 -0
- package/dist/application/workspace/focusPanel.d.ts +2 -0
- package/dist/application/workspace/focusPanel.js +19 -0
- package/dist/application/workspace/joinPanelArea.d.ts +13 -0
- package/dist/application/workspace/joinPanelArea.js +281 -0
- package/dist/application/workspace/layoutInteraction.d.ts +176 -0
- package/dist/application/workspace/layoutInteraction.js +852 -0
- package/dist/application/workspace/layoutTree.d.ts +34 -0
- package/dist/application/workspace/layoutTree.js +135 -0
- package/dist/application/workspace/openTool.d.ts +15 -0
- package/dist/application/workspace/openTool.js +89 -0
- package/dist/application/workspace/presetArtifacts.d.ts +60 -0
- package/dist/application/workspace/presetArtifacts.js +231 -0
- package/dist/application/workspace/presets.d.ts +5 -0
- package/dist/application/workspace/presets.js +12 -0
- package/dist/application/workspace/reattachWorkspaceWindow.d.ts +7 -0
- package/dist/application/workspace/reattachWorkspaceWindow.js +24 -0
- package/dist/application/workspace/resizeSplit.d.ts +7 -0
- package/dist/application/workspace/resizeSplit.js +12 -0
- package/dist/application/workspace/resizeSplitBoundary.d.ts +10 -0
- package/dist/application/workspace/resizeSplitBoundary.js +115 -0
- package/dist/application/workspace/runToolShellCommand.d.ts +11 -0
- package/dist/application/workspace/runToolShellCommand.js +133 -0
- package/dist/application/workspace/session.d.ts +9 -0
- package/dist/application/workspace/session.js +36 -0
- package/dist/application/workspace/setActiveStackChild.d.ts +7 -0
- package/dist/application/workspace/setActiveStackChild.js +12 -0
- package/dist/application/workspace/setDesignSystemThemeSession.d.ts +3 -0
- package/dist/application/workspace/setDesignSystemThemeSession.js +12 -0
- package/dist/application/workspace/setPanelFullscreenToggleVisibility.d.ts +7 -0
- package/dist/application/workspace/setPanelFullscreenToggleVisibility.js +7 -0
- package/dist/application/workspace/setStackHeaderVisibility.d.ts +7 -0
- package/dist/application/workspace/setStackHeaderVisibility.js +7 -0
- package/dist/application/workspace/setToolPanelTitleOverride.d.ts +9 -0
- package/dist/application/workspace/setToolPanelTitleOverride.js +33 -0
- package/dist/application/workspace/setToolShellStatus.d.ts +8 -0
- package/dist/application/workspace/setToolShellStatus.js +32 -0
- package/dist/application/workspace/setWorkspaceFullscreenPanel.d.ts +3 -0
- package/dist/application/workspace/setWorkspaceFullscreenPanel.js +26 -0
- package/dist/application/workspace/snapshots.d.ts +10 -0
- package/dist/application/workspace/snapshots.js +34 -0
- package/dist/application/workspace/splitPanel.d.ts +10 -0
- package/dist/application/workspace/splitPanel.js +21 -0
- package/dist/application/workspace/subdividePanel.d.ts +39 -0
- package/dist/application/workspace/subdividePanel.js +128 -0
- package/dist/application/workspace/swapPanelArea.d.ts +11 -0
- package/dist/application/workspace/swapPanelArea.js +163 -0
- package/dist/application/workspace/targetWindow.d.ts +4 -0
- package/dist/application/workspace/targetWindow.js +22 -0
- package/dist/application/workspace/toolCapabilities.d.ts +11 -0
- package/dist/application/workspace/toolCapabilities.js +59 -0
- package/dist/application/workspace/toolRuntime.d.ts +32 -0
- package/dist/application/workspace/toolRuntime.js +65 -0
- package/dist/application/workspace/updateToolState.d.ts +8 -0
- package/dist/application/workspace/updateToolState.js +20 -0
- package/dist/boot/applicationBoot.d.ts +1 -0
- package/dist/boot/applicationBoot.js +2 -0
- package/dist/boot/events.d.ts +43 -0
- package/dist/boot/events.js +16 -0
- package/dist/boot/executor.d.ts +13 -0
- package/dist/boot/executor.js +210 -0
- package/dist/boot/graph.d.ts +16 -0
- package/dist/boot/graph.js +126 -0
- package/dist/boot/index.d.ts +2 -0
- package/dist/boot/index.js +3 -0
- package/dist/boot/mechanism.d.ts +5 -0
- package/dist/boot/mechanism.js +6 -0
- package/dist/boot/projection.d.ts +72 -0
- package/dist/boot/projection.js +398 -0
- package/dist/boot/types.d.ts +80 -0
- package/dist/boot/types.js +46 -0
- package/dist/domain/composition/dockArrangement.d.ts +57 -0
- package/dist/domain/composition/dockArrangement.js +304 -0
- package/dist/domain/composition/docking.d.ts +68 -0
- package/dist/domain/composition/docking.js +187 -0
- package/dist/domain/design-system/themeSession.d.ts +12 -0
- package/dist/domain/design-system/themeSession.js +42 -0
- package/dist/domain/experiment/model.d.ts +149 -0
- package/dist/domain/experiment/model.js +1 -0
- package/dist/domain/i18n/languageRegistry.d.ts +57 -0
- package/dist/domain/i18n/languageRegistry.js +1 -0
- package/dist/domain/i18n/model.d.ts +31 -0
- package/dist/domain/i18n/model.js +1 -0
- package/dist/domain/icon/model.d.ts +8 -0
- package/dist/domain/icon/model.js +1 -0
- package/dist/domain/input/interactionBindings.d.ts +2 -0
- package/dist/domain/input/interactionBindings.js +2 -0
- package/dist/domain/launch/model.d.ts +58 -0
- package/dist/domain/launch/model.js +109 -0
- package/dist/domain/layout/interaction.d.ts +90 -0
- package/dist/domain/layout/interaction.js +1 -0
- package/dist/domain/layout/model.d.ts +28 -0
- package/dist/domain/layout/model.js +1 -0
- package/dist/domain/layout/selectors.d.ts +12 -0
- package/dist/domain/layout/selectors.js +84 -0
- package/dist/domain/layout/surfaceProjection.d.ts +56 -0
- package/dist/domain/layout/surfaceProjection.js +249 -0
- package/dist/domain/layout/validation.d.ts +9 -0
- package/dist/domain/layout/validation.js +71 -0
- package/dist/domain/panel/model.d.ts +9 -0
- package/dist/domain/panel/model.js +1 -0
- package/dist/domain/physics/colliderGeometry.d.ts +2 -0
- package/dist/domain/physics/colliderGeometry.js +1 -0
- package/dist/domain/physics/contracts.d.ts +2 -0
- package/dist/domain/physics/contracts.js +1 -0
- package/dist/domain/physics/kinematicBinding.d.ts +22 -0
- package/dist/domain/physics/kinematicBinding.js +1 -0
- package/dist/domain/physics/model.d.ts +4 -0
- package/dist/domain/physics/model.js +1 -0
- package/dist/domain/physics/mujoco.d.ts +5 -0
- package/dist/domain/physics/mujoco.js +1 -0
- package/dist/domain/physics/observationProfile.d.ts +2 -0
- package/dist/domain/physics/observationProfile.js +1 -0
- package/dist/domain/physics/presentationBinding.d.ts +6 -0
- package/dist/domain/physics/presentationBinding.js +1 -0
- package/dist/domain/physics/simulationProfile.d.ts +2 -0
- package/dist/domain/physics/simulationProfile.js +1 -0
- package/dist/domain/physics/visualAlignment.d.ts +17 -0
- package/dist/domain/physics/visualAlignment.js +1 -0
- package/dist/domain/presentation/readingLevel.d.ts +12 -0
- package/dist/domain/presentation/readingLevel.js +29 -0
- package/dist/domain/project/model.d.ts +55 -0
- package/dist/domain/project/model.js +1 -0
- package/dist/domain/repo-quality/model.d.ts +111 -0
- package/dist/domain/repo-quality/model.js +1 -0
- package/dist/domain/repository/model.d.ts +110 -0
- package/dist/domain/repository/model.js +1 -0
- package/dist/domain/runtime/checkpoint.d.ts +37 -0
- package/dist/domain/runtime/checkpoint.js +87 -0
- package/dist/domain/runtime/hydration.d.ts +26 -0
- package/dist/domain/runtime/hydration.js +92 -0
- package/dist/domain/runtime/initialization.d.ts +25 -0
- package/dist/domain/runtime/initialization.js +87 -0
- package/dist/domain/runtime/lifecycle.d.ts +51 -0
- package/dist/domain/runtime/lifecycle.js +118 -0
- package/dist/domain/runtime/model.d.ts +252 -0
- package/dist/domain/runtime/model.js +13 -0
- package/dist/domain/runtime/observability.d.ts +142 -0
- package/dist/domain/runtime/observability.js +1 -0
- package/dist/domain/runtime/offload.d.ts +56 -0
- package/dist/domain/runtime/offload.js +129 -0
- package/dist/domain/runtime/plan.d.ts +26 -0
- package/dist/domain/runtime/plan.js +1 -0
- package/dist/domain/runtime/qualityPolicy.d.ts +28 -0
- package/dist/domain/runtime/qualityPolicy.js +97 -0
- package/dist/domain/runtime/recovery.d.ts +61 -0
- package/dist/domain/runtime/recovery.js +129 -0
- package/dist/domain/runtime/suspension.d.ts +32 -0
- package/dist/domain/runtime/suspension.js +107 -0
- package/dist/domain/runtime/teardown.d.ts +33 -0
- package/dist/domain/runtime/teardown.js +109 -0
- package/dist/domain/shared/id.d.ts +1 -0
- package/dist/domain/shared/id.js +5 -0
- package/dist/domain/shared/json.d.ts +9 -0
- package/dist/domain/shared/json.js +24 -0
- package/dist/domain/shell/model.d.ts +40 -0
- package/dist/domain/shell/model.js +1 -0
- package/dist/domain/shell/runtime.d.ts +76 -0
- package/dist/domain/shell/runtime.js +40 -0
- package/dist/domain/surface/model.d.ts +97 -0
- package/dist/domain/surface/model.js +71 -0
- package/dist/domain/temporal/model.d.ts +95 -0
- package/dist/domain/temporal/model.js +45 -0
- package/dist/domain/tool/internalTab.d.ts +11 -0
- package/dist/domain/tool/internalTab.js +20 -0
- package/dist/domain/tool/model.d.ts +207 -0
- package/dist/domain/tool/model.js +1 -0
- package/dist/domain/tool/runtime.d.ts +122 -0
- package/dist/domain/tool/runtime.js +2 -0
- package/dist/domain/tool/shell.d.ts +38 -0
- package/dist/domain/tool/shell.js +175 -0
- package/dist/domain/widget/composition.d.ts +79 -0
- package/dist/domain/widget/composition.js +250 -0
- package/dist/domain/widget/model.d.ts +35 -0
- package/dist/domain/widget/model.js +8 -0
- package/dist/domain/widget/toolDock.d.ts +30 -0
- package/dist/domain/widget/toolDock.js +52 -0
- package/dist/domain/workbench/model.d.ts +35 -0
- package/dist/domain/workbench/model.js +1 -0
- package/dist/domain/workbench/routing.d.ts +17 -0
- package/dist/domain/workbench/routing.js +72 -0
- package/dist/domain/workspace/factories.d.ts +9 -0
- package/dist/domain/workspace/factories.js +47 -0
- package/dist/domain/workspace/model.d.ts +23 -0
- package/dist/domain/workspace/model.js +1 -0
- package/dist/domain/workspace/persistence.d.ts +5 -0
- package/dist/domain/workspace/persistence.js +1 -0
- package/dist/domain/workspace/selectors.d.ts +19 -0
- package/dist/domain/workspace/selectors.js +90 -0
- package/dist/domain/workspace/session.d.ts +9 -0
- package/dist/domain/workspace/session.js +1 -0
- package/dist/domain/workspace/validation.d.ts +10 -0
- package/dist/domain/workspace/validation.js +231 -0
- package/dist/hosting.d.ts +15 -0
- package/dist/hosting.js +12 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +111 -0
- package/dist/infrastructure/audio/WorkbenchAudioManager.d.ts +36 -0
- package/dist/infrastructure/audio/WorkbenchAudioManager.js +100 -0
- package/dist/infrastructure/backend/HttpWorkbenchBackendClient.d.ts +30 -0
- package/dist/infrastructure/backend/HttpWorkbenchBackendClient.js +314 -0
- package/dist/infrastructure/persistence/LocalWorkspacePersistence.d.ts +8 -0
- package/dist/infrastructure/persistence/LocalWorkspacePersistence.js +29 -0
- package/dist/infrastructure/surfaces/InMemorySurfaceViewerRegistry.d.ts +58 -0
- package/dist/infrastructure/surfaces/InMemorySurfaceViewerRegistry.js +121 -0
- package/dist/infrastructure/temporal/InMemoryTemporalDialectRegistry.d.ts +8 -0
- package/dist/infrastructure/temporal/InMemoryTemporalDialectRegistry.js +38 -0
- package/dist/infrastructure/tools/InMemoryToolRegistry.d.ts +46 -0
- package/dist/infrastructure/tools/InMemoryToolRegistry.js +82 -0
- package/dist/infrastructure/widgets/InMemoryShellWidgetRegistry.d.ts +42 -0
- package/dist/infrastructure/widgets/InMemoryShellWidgetRegistry.js +66 -0
- package/dist/infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.d.ts +20 -0
- package/dist/infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.js +35 -0
- package/dist/infrastructure/workbenches/InMemoryWorkbenchRegistry.d.ts +7 -0
- package/dist/infrastructure/workbenches/InMemoryWorkbenchRegistry.js +28 -0
- package/dist/physics-runtime.d.ts +4 -0
- package/dist/physics-runtime.js +2 -0
- package/dist/stage/easing.d.ts +5 -0
- package/dist/stage/easing.js +15 -0
- package/dist/stage/index.d.ts +6 -0
- package/dist/stage/index.js +6 -0
- package/dist/stage/projection.d.ts +4 -0
- package/dist/stage/projection.js +74 -0
- package/dist/stage/stageRuntime.d.ts +2 -0
- package/dist/stage/stageRuntime.js +32 -0
- package/dist/stage/timeline.d.ts +3 -0
- package/dist/stage/timeline.js +69 -0
- package/dist/stage/tween.d.ts +3 -0
- package/dist/stage/tween.js +104 -0
- package/dist/stage/types.d.ts +104 -0
- package/dist/stage/types.js +30 -0
- package/dist/temporal/clock/audioClock.d.ts +1 -0
- package/dist/temporal/clock/audioClock.js +1 -0
- package/dist/temporal/clock/clockGraph.d.ts +1 -0
- package/dist/temporal/clock/clockGraph.js +1 -0
- package/dist/temporal/clock/clockTypes.d.ts +1 -0
- package/dist/temporal/clock/clockTypes.js +1 -0
- package/dist/temporal/clock/fixedStepClock.d.ts +1 -0
- package/dist/temporal/clock/fixedStepClock.js +1 -0
- package/dist/temporal/clock/musicalClock.d.ts +7 -0
- package/dist/temporal/clock/musicalClock.js +35 -0
- package/dist/temporal/clock/rootClock.d.ts +1 -0
- package/dist/temporal/clock/rootClock.js +1 -0
- package/dist/temporal/clock/videoClock.d.ts +1 -0
- package/dist/temporal/clock/videoClock.js +1 -0
- package/dist/temporal/easing/easingFunctions.d.ts +2 -0
- package/dist/temporal/easing/easingFunctions.js +19 -0
- package/dist/temporal/easing/easingRegistry.d.ts +10 -0
- package/dist/temporal/easing/easingRegistry.js +32 -0
- package/dist/temporal/easing/easingShaderSource.d.ts +2 -0
- package/dist/temporal/easing/easingShaderSource.js +16 -0
- package/dist/temporal/easing/easingTypes.d.ts +9 -0
- package/dist/temporal/easing/easingTypes.js +1 -0
- package/dist/temporal/history/runtimeHistory.d.ts +77 -0
- package/dist/temporal/history/runtimeHistory.js +5 -0
- package/dist/temporal/history/temporalHistoryCore.d.ts +1 -0
- package/dist/temporal/history/temporalHistoryCore.js +1 -0
- package/dist/temporal/index.d.ts +20 -0
- package/dist/temporal/index.js +20 -0
- package/dist/temporal/invalidation/invalidationController.d.ts +1 -0
- package/dist/temporal/invalidation/invalidationController.js +1 -0
- package/dist/temporal/scheduler/browserSchedulerHost.d.ts +3 -0
- package/dist/temporal/scheduler/browserSchedulerHost.js +19 -0
- package/dist/temporal/scheduler/frameBudget.d.ts +1 -0
- package/dist/temporal/scheduler/frameBudget.js +1 -0
- package/dist/temporal/scheduler/temporalScheduler.d.ts +4 -0
- package/dist/temporal/scheduler/temporalScheduler.js +6 -0
- package/dist/temporal/scheduler/temporalSchedulerCore.d.ts +1 -0
- package/dist/temporal/scheduler/temporalSchedulerCore.js +1 -0
- package/dist/temporal/scheduler/visibilityPolicy.d.ts +2 -0
- package/dist/temporal/scheduler/visibilityPolicy.js +1 -0
- package/dist/temporal/transport/temporalTransport.d.ts +1 -0
- package/dist/temporal/transport/temporalTransport.js +1 -0
- package/dist/temporal/transport/transportScope.d.ts +7 -0
- package/dist/temporal/transport/transportScope.js +3 -0
- package/dist/temporal/transport/transportTimeline.d.ts +22 -0
- package/dist/temporal/transport/transportTimeline.js +36 -0
- package/dist/temporal/transport/transportTypes.d.ts +1 -0
- package/dist/temporal/transport/transportTypes.js +1 -0
- package/dist/workspace-contracts.d.ts +36 -0
- package/dist/workspace-contracts.js +28 -0
- package/package.json +57 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { getActiveWindow } from "../../domain/workspace/selectors.js";
|
|
2
|
+
import { findStack } from "../../domain/layout/selectors.js";
|
|
3
|
+
import { createSplit, createStack } from "../../domain/workspace/factories.js";
|
|
4
|
+
import { canonicalizeLayout } from "./canonicalizeLayout.js";
|
|
5
|
+
import { updateActiveWindowRoot } from "./layoutTree.js";
|
|
6
|
+
import { LAYOUT_MIN_SPLIT_SIZE } from "../../domain/layout/validation.js";
|
|
7
|
+
import { updateWorkspaceTargetWindow } from "./targetWindow.js";
|
|
8
|
+
const WORKSPACE_EDGE_DOCK_RATIO = 0.25;
|
|
9
|
+
export function dockPanel(workspace, input) {
|
|
10
|
+
return updateWorkspaceTargetWindow(workspace, input.panelId, (selected) => dockPanelInActiveWindow(selected, input));
|
|
11
|
+
}
|
|
12
|
+
function dockPanelInActiveWindow(workspace, input) {
|
|
13
|
+
const activeWindow = getActiveWindow(workspace);
|
|
14
|
+
if (!activeWindow) {
|
|
15
|
+
return workspace;
|
|
16
|
+
}
|
|
17
|
+
const sourceStack = findStackContainingPanel(activeWindow.root, input.panelId);
|
|
18
|
+
if (!sourceStack) {
|
|
19
|
+
return workspace;
|
|
20
|
+
}
|
|
21
|
+
if (input.target.kind === 'workspace-edge') {
|
|
22
|
+
const extracted = extractPanelFromNode(activeWindow.root, input.panelId);
|
|
23
|
+
if (!extracted.panel || !extracted.nextNode) {
|
|
24
|
+
return workspace;
|
|
25
|
+
}
|
|
26
|
+
const nextRoot = wrapRootWithDockedPanel(extracted.nextNode, extracted.panel, input.target.side);
|
|
27
|
+
return updateActiveWindowRoot(workspace, () => canonicalizeLayout(nextRoot));
|
|
28
|
+
}
|
|
29
|
+
const targetStack = findStack(activeWindow.root, input.target.stackId);
|
|
30
|
+
if (!targetStack) {
|
|
31
|
+
return workspace;
|
|
32
|
+
}
|
|
33
|
+
if (input.target.placement === 'center' && sourceStack.id === targetStack.id) {
|
|
34
|
+
return reorderPanelWithinStack(workspace, sourceStack, input.panelId, input.target.tabIndex ?? null);
|
|
35
|
+
}
|
|
36
|
+
if (input.target.placement !== 'center' && sourceStack.id === targetStack.id && sourceStack.children.length <= 1) {
|
|
37
|
+
return workspace;
|
|
38
|
+
}
|
|
39
|
+
if (input.target.placement !== 'center' && sourceStack.children.length === 1) {
|
|
40
|
+
const reorderedWorkspace = reorderWholeStackWithinAlignedBand(workspace, activeWindow.root, sourceStack.id, targetStack.id, input.target.placement);
|
|
41
|
+
if (reorderedWorkspace) {
|
|
42
|
+
return reorderedWorkspace;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const preferredSplitSizes = resolveDockPreferredSplitSizes(activeWindow.root, sourceStack.id, targetStack.id, input.target.placement);
|
|
46
|
+
const extracted = extractPanelFromNode(activeWindow.root, input.panelId);
|
|
47
|
+
if (!extracted.panel || !extracted.nextNode) {
|
|
48
|
+
return workspace;
|
|
49
|
+
}
|
|
50
|
+
const nextRoot = insertPanelIntoDockTarget(extracted.nextNode, extracted.panel, input.target, preferredSplitSizes);
|
|
51
|
+
if (!nextRoot) {
|
|
52
|
+
return workspace;
|
|
53
|
+
}
|
|
54
|
+
return updateActiveWindowRoot(workspace, () => canonicalizeLayout(nextRoot));
|
|
55
|
+
}
|
|
56
|
+
function insertPanelIntoDockTarget(node, panel, target, preferredSplitSizes) {
|
|
57
|
+
if (node.kind === 'stack') {
|
|
58
|
+
if (node.id !== target.stackId) {
|
|
59
|
+
return node;
|
|
60
|
+
}
|
|
61
|
+
if (target.placement === 'center') {
|
|
62
|
+
const insertionIndex = clampTabInsertionIndex(target.tabIndex ?? node.children.length, node.children.length);
|
|
63
|
+
const nextChildren = [...node.children];
|
|
64
|
+
nextChildren.splice(insertionIndex, 0, panel);
|
|
65
|
+
return {
|
|
66
|
+
...node,
|
|
67
|
+
activeChildId: panel.id,
|
|
68
|
+
children: nextChildren
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const movedStack = createStack([panel]);
|
|
72
|
+
const orientation = target.placement === 'left' || target.placement === 'right' ? 'horizontal' : 'vertical';
|
|
73
|
+
const nextChildren = target.placement === 'left' || target.placement === 'top'
|
|
74
|
+
? [movedStack, node]
|
|
75
|
+
: [node, movedStack];
|
|
76
|
+
return createSplit(orientation, nextChildren, preferredSplitSizes ?? [1, 1]);
|
|
77
|
+
}
|
|
78
|
+
const nextChildren = node.children.map((child) => insertPanelIntoDockTarget(child, panel, target, preferredSplitSizes));
|
|
79
|
+
if (nextChildren[0] === null && nextChildren[1] === null) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
if (nextChildren[0] === null) {
|
|
83
|
+
return nextChildren[1];
|
|
84
|
+
}
|
|
85
|
+
if (nextChildren[1] === null) {
|
|
86
|
+
return nextChildren[0];
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
...node,
|
|
90
|
+
children: nextChildren
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function extractPanelFromNode(node, panelId) {
|
|
94
|
+
if (node.kind === 'stack') {
|
|
95
|
+
const panel = node.children.find((entry) => entry.id === panelId) ?? null;
|
|
96
|
+
if (!panel) {
|
|
97
|
+
return { nextNode: node, panel: null };
|
|
98
|
+
}
|
|
99
|
+
if (node.children.length === 1) {
|
|
100
|
+
return {
|
|
101
|
+
nextNode: null,
|
|
102
|
+
panel
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const nextChildren = node.children.filter((entry) => entry.id !== panelId);
|
|
106
|
+
const activeChildId = node.activeChildId === panelId
|
|
107
|
+
? nextChildren[Math.max(0, node.children.findIndex((entry) => entry.id === panelId) - 1)]?.id ?? nextChildren[0].id
|
|
108
|
+
: node.activeChildId;
|
|
109
|
+
return {
|
|
110
|
+
nextNode: {
|
|
111
|
+
...node,
|
|
112
|
+
activeChildId,
|
|
113
|
+
children: nextChildren
|
|
114
|
+
},
|
|
115
|
+
panel
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
const leftResult = extractPanelFromNode(node.children[0], panelId);
|
|
119
|
+
if (leftResult.panel) {
|
|
120
|
+
if (!leftResult.nextNode) {
|
|
121
|
+
return {
|
|
122
|
+
nextNode: node.children[1],
|
|
123
|
+
panel: leftResult.panel
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
nextNode: {
|
|
128
|
+
...node,
|
|
129
|
+
children: [leftResult.nextNode, node.children[1]]
|
|
130
|
+
},
|
|
131
|
+
panel: leftResult.panel
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const rightResult = extractPanelFromNode(node.children[1], panelId);
|
|
135
|
+
if (rightResult.panel) {
|
|
136
|
+
if (!rightResult.nextNode) {
|
|
137
|
+
return {
|
|
138
|
+
nextNode: node.children[0],
|
|
139
|
+
panel: rightResult.panel
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
nextNode: {
|
|
144
|
+
...node,
|
|
145
|
+
children: [node.children[0], rightResult.nextNode]
|
|
146
|
+
},
|
|
147
|
+
panel: rightResult.panel
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return { nextNode: node, panel: null };
|
|
151
|
+
}
|
|
152
|
+
function findStackContainingPanel(node, panelId) {
|
|
153
|
+
if (node.kind === 'stack') {
|
|
154
|
+
return node.children.some((panel) => panel.id === panelId) ? node : undefined;
|
|
155
|
+
}
|
|
156
|
+
return findStackContainingPanel(node.children[0], panelId) ?? findStackContainingPanel(node.children[1], panelId);
|
|
157
|
+
}
|
|
158
|
+
export function createStackDockTarget(stackId, placement, tabIndex = null) {
|
|
159
|
+
return {
|
|
160
|
+
kind: 'stack',
|
|
161
|
+
stackId,
|
|
162
|
+
placement,
|
|
163
|
+
tabIndex
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export function createWorkspaceEdgeDockTarget(side) {
|
|
167
|
+
return {
|
|
168
|
+
kind: 'workspace-edge',
|
|
169
|
+
side
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
export function isEdgeDockPlacement(placement) {
|
|
173
|
+
return placement !== 'center';
|
|
174
|
+
}
|
|
175
|
+
function wrapRootWithDockedPanel(root, panel, side) {
|
|
176
|
+
const dockedStack = createStack([panel]);
|
|
177
|
+
const orientation = side === 'left' || side === 'right' ? 'horizontal' : 'vertical';
|
|
178
|
+
const leadingSizes = [WORKSPACE_EDGE_DOCK_RATIO, 1 - WORKSPACE_EDGE_DOCK_RATIO];
|
|
179
|
+
const trailingSizes = [1 - WORKSPACE_EDGE_DOCK_RATIO, WORKSPACE_EDGE_DOCK_RATIO];
|
|
180
|
+
if (side === 'left' || side === 'top') {
|
|
181
|
+
return createSplit(orientation, [dockedStack, root], leadingSizes);
|
|
182
|
+
}
|
|
183
|
+
return createSplit(orientation, [root, dockedStack], trailingSizes);
|
|
184
|
+
}
|
|
185
|
+
function reorderPanelWithinStack(workspace, stack, panelId, targetTabIndex) {
|
|
186
|
+
const currentIndex = stack.children.findIndex((panel) => panel.id === panelId);
|
|
187
|
+
if (currentIndex === -1) {
|
|
188
|
+
return workspace;
|
|
189
|
+
}
|
|
190
|
+
const rawTargetIndex = clampTabInsertionIndex(targetTabIndex ?? currentIndex, stack.children.length);
|
|
191
|
+
const nextIndex = rawTargetIndex > currentIndex ? rawTargetIndex - 1 : rawTargetIndex;
|
|
192
|
+
if (nextIndex === currentIndex) {
|
|
193
|
+
return workspace;
|
|
194
|
+
}
|
|
195
|
+
const nextChildren = [...stack.children];
|
|
196
|
+
const [movedPanel] = nextChildren.splice(currentIndex, 1);
|
|
197
|
+
nextChildren.splice(nextIndex, 0, movedPanel);
|
|
198
|
+
return updateActiveWindowRoot(workspace, (root) => replaceStackById(root, stack.id, {
|
|
199
|
+
...stack,
|
|
200
|
+
activeChildId: panelId,
|
|
201
|
+
children: nextChildren
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
function replaceStackById(node, stackId, replacement) {
|
|
205
|
+
if (node.kind === 'stack') {
|
|
206
|
+
return node.id === stackId ? replacement : node;
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
...node,
|
|
210
|
+
children: [
|
|
211
|
+
replaceStackById(node.children[0], stackId, replacement),
|
|
212
|
+
replaceStackById(node.children[1], stackId, replacement)
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function reorderWholeStackWithinAlignedBand(workspace, root, sourceStackId, targetStackId, placement) {
|
|
217
|
+
const orientation = placement === 'left' || placement === 'right' ? 'horizontal' : 'vertical';
|
|
218
|
+
const sourceBounds = findNodeBounds(root, sourceStackId);
|
|
219
|
+
const targetBounds = findNodeBounds(root, targetStackId);
|
|
220
|
+
if (!sourceBounds || !targetBounds) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
const crossAxisOverlap = orientation === 'horizontal'
|
|
224
|
+
? resolveRangeOverlapRatio(sourceBounds.vertical, targetBounds.vertical)
|
|
225
|
+
: resolveRangeOverlapRatio(sourceBounds.horizontal, targetBounds.horizontal);
|
|
226
|
+
if (crossAxisOverlap < 0.95) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const container = findMinimalSameOrientationContainer(root, sourceStackId, targetStackId, orientation);
|
|
230
|
+
if (!container) {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
const segments = flattenSameOrientationChain(container, orientation);
|
|
234
|
+
const sourceIndex = segments.findIndex((segment) => segment.node.kind === 'stack' && segment.node.id === sourceStackId);
|
|
235
|
+
const targetIndex = segments.findIndex((segment) => segment.node.kind === 'stack' && segment.node.id === targetStackId);
|
|
236
|
+
if (sourceIndex === -1 || targetIndex === -1) {
|
|
237
|
+
return null;
|
|
238
|
+
}
|
|
239
|
+
const nextSegments = [...segments];
|
|
240
|
+
const [sourceSegment] = nextSegments.splice(sourceIndex, 1);
|
|
241
|
+
const targetIndexAfterRemoval = nextSegments.findIndex((segment) => segment.node.kind === 'stack' && segment.node.id === targetStackId);
|
|
242
|
+
if (targetIndexAfterRemoval === -1) {
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
const insertionIndex = placement === 'left' || placement === 'top' ? targetIndexAfterRemoval : targetIndexAfterRemoval + 1;
|
|
246
|
+
nextSegments.splice(insertionIndex, 0, sourceSegment);
|
|
247
|
+
if (segmentsHaveSameOrder(segments, nextSegments)) {
|
|
248
|
+
return workspace;
|
|
249
|
+
}
|
|
250
|
+
const nextChain = buildSameOrientationChain(orientation, nextSegments);
|
|
251
|
+
return updateActiveWindowRoot(workspace, (currentRoot) => canonicalizeLayout(replaceNodeById(currentRoot, container.id, nextChain)));
|
|
252
|
+
}
|
|
253
|
+
function findMinimalSameOrientationContainer(node, sourceStackId, targetStackId, orientation) {
|
|
254
|
+
if (node.kind === 'stack') {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
if (node.orientation !== orientation) {
|
|
258
|
+
return (findMinimalSameOrientationContainer(node.children[0], sourceStackId, targetStackId, orientation) ??
|
|
259
|
+
findMinimalSameOrientationContainer(node.children[1], sourceStackId, targetStackId, orientation));
|
|
260
|
+
}
|
|
261
|
+
const containsSource = containsNodeId(node, sourceStackId);
|
|
262
|
+
const containsTarget = containsNodeId(node, targetStackId);
|
|
263
|
+
if (!containsSource || !containsTarget) {
|
|
264
|
+
return (findMinimalSameOrientationContainer(node.children[0], sourceStackId, targetStackId, orientation) ??
|
|
265
|
+
findMinimalSameOrientationContainer(node.children[1], sourceStackId, targetStackId, orientation));
|
|
266
|
+
}
|
|
267
|
+
const nestedMatch = findMinimalSameOrientationContainer(node.children[0], sourceStackId, targetStackId, orientation) ??
|
|
268
|
+
findMinimalSameOrientationContainer(node.children[1], sourceStackId, targetStackId, orientation);
|
|
269
|
+
return nestedMatch ?? node;
|
|
270
|
+
}
|
|
271
|
+
function containsNodeId(node, targetNodeId) {
|
|
272
|
+
if (node.id === targetNodeId) {
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
if (node.kind === 'stack') {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
return containsNodeId(node.children[0], targetNodeId) || containsNodeId(node.children[1], targetNodeId);
|
|
279
|
+
}
|
|
280
|
+
function flattenSameOrientationChain(node, orientation, inheritedSize = 1) {
|
|
281
|
+
if (node.kind === 'split' && node.orientation === orientation) {
|
|
282
|
+
return [
|
|
283
|
+
...flattenSameOrientationChain(node.children[0], orientation, inheritedSize * node.sizes[0]),
|
|
284
|
+
...flattenSameOrientationChain(node.children[1], orientation, inheritedSize * node.sizes[1])
|
|
285
|
+
];
|
|
286
|
+
}
|
|
287
|
+
return [{ node, size: inheritedSize }];
|
|
288
|
+
}
|
|
289
|
+
function buildSameOrientationChain(orientation, segments) {
|
|
290
|
+
if (segments.length === 1) {
|
|
291
|
+
return segments[0].node;
|
|
292
|
+
}
|
|
293
|
+
const [firstSegment, ...restSegments] = segments;
|
|
294
|
+
const totalSize = segments.reduce((sum, segment) => sum + segment.size, 0);
|
|
295
|
+
const firstRatio = totalSize > 0 ? firstSegment.size / totalSize : 0.5;
|
|
296
|
+
return createSplit(orientation, [firstSegment.node, buildSameOrientationChain(orientation, restSegments)], [firstRatio, 1 - firstRatio]);
|
|
297
|
+
}
|
|
298
|
+
function replaceNodeById(node, targetNodeId, replacement) {
|
|
299
|
+
if (node.id === targetNodeId) {
|
|
300
|
+
return replacement;
|
|
301
|
+
}
|
|
302
|
+
if (node.kind === 'stack') {
|
|
303
|
+
return node;
|
|
304
|
+
}
|
|
305
|
+
return {
|
|
306
|
+
...node,
|
|
307
|
+
children: [
|
|
308
|
+
replaceNodeById(node.children[0], targetNodeId, replacement),
|
|
309
|
+
replaceNodeById(node.children[1], targetNodeId, replacement)
|
|
310
|
+
]
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function segmentsHaveSameOrder(first, second) {
|
|
314
|
+
if (first.length !== second.length) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
return first.every((segment, index) => segment.node.id === second[index]?.node.id);
|
|
318
|
+
}
|
|
319
|
+
function clampTabInsertionIndex(index, length) {
|
|
320
|
+
return Math.max(0, Math.min(length, Math.round(index)));
|
|
321
|
+
}
|
|
322
|
+
function resolveDockPreferredSplitSizes(root, sourceStackId, targetStackId, placement) {
|
|
323
|
+
if (placement === 'center') {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
const orientation = placement === 'left' || placement === 'right' ? 'horizontal' : 'vertical';
|
|
327
|
+
const sourceBounds = findNodeBounds(root, sourceStackId);
|
|
328
|
+
const targetBounds = findNodeBounds(root, targetStackId);
|
|
329
|
+
if (!sourceBounds || !targetBounds) {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
const crossAxisOverlap = orientation === 'horizontal'
|
|
333
|
+
? resolveRangeOverlapRatio(sourceBounds.vertical, targetBounds.vertical)
|
|
334
|
+
: resolveRangeOverlapRatio(sourceBounds.horizontal, targetBounds.horizontal);
|
|
335
|
+
if (crossAxisOverlap < 0.95) {
|
|
336
|
+
return null;
|
|
337
|
+
}
|
|
338
|
+
const sourceSpan = orientation === 'horizontal'
|
|
339
|
+
? sourceBounds.horizontal.end - sourceBounds.horizontal.start
|
|
340
|
+
: sourceBounds.vertical.end - sourceBounds.vertical.start;
|
|
341
|
+
const targetSpan = orientation === 'horizontal'
|
|
342
|
+
? targetBounds.horizontal.end - targetBounds.horizontal.start
|
|
343
|
+
: targetBounds.vertical.end - targetBounds.vertical.start;
|
|
344
|
+
if (!Number.isFinite(sourceSpan) || !Number.isFinite(targetSpan) || sourceSpan <= 0 || targetSpan <= 0) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
const movedRatio = Math.max(LAYOUT_MIN_SPLIT_SIZE, Math.min(1 - LAYOUT_MIN_SPLIT_SIZE, sourceSpan / targetSpan));
|
|
348
|
+
return placement === 'left' || placement === 'top'
|
|
349
|
+
? [movedRatio, 1 - movedRatio]
|
|
350
|
+
: [1 - movedRatio, movedRatio];
|
|
351
|
+
}
|
|
352
|
+
function findNodeBounds(node, targetNodeId, bounds = {
|
|
353
|
+
horizontal: { start: 0, end: 1 },
|
|
354
|
+
vertical: { start: 0, end: 1 }
|
|
355
|
+
}) {
|
|
356
|
+
if (node.id === targetNodeId) {
|
|
357
|
+
return bounds;
|
|
358
|
+
}
|
|
359
|
+
if (node.kind === 'stack') {
|
|
360
|
+
return null;
|
|
361
|
+
}
|
|
362
|
+
const [firstSize] = node.sizes;
|
|
363
|
+
if (node.orientation === 'horizontal') {
|
|
364
|
+
const width = bounds.horizontal.end - bounds.horizontal.start;
|
|
365
|
+
const splitPoint = bounds.horizontal.start + width * firstSize;
|
|
366
|
+
const firstBounds = {
|
|
367
|
+
horizontal: { start: bounds.horizontal.start, end: splitPoint },
|
|
368
|
+
vertical: bounds.vertical
|
|
369
|
+
};
|
|
370
|
+
const secondBounds = {
|
|
371
|
+
horizontal: { start: splitPoint, end: bounds.horizontal.end },
|
|
372
|
+
vertical: bounds.vertical
|
|
373
|
+
};
|
|
374
|
+
return findNodeBounds(node.children[0], targetNodeId, firstBounds) ??
|
|
375
|
+
findNodeBounds(node.children[1], targetNodeId, secondBounds);
|
|
376
|
+
}
|
|
377
|
+
const height = bounds.vertical.end - bounds.vertical.start;
|
|
378
|
+
const splitPoint = bounds.vertical.start + height * firstSize;
|
|
379
|
+
const firstBounds = {
|
|
380
|
+
horizontal: bounds.horizontal,
|
|
381
|
+
vertical: { start: bounds.vertical.start, end: splitPoint }
|
|
382
|
+
};
|
|
383
|
+
const secondBounds = {
|
|
384
|
+
horizontal: bounds.horizontal,
|
|
385
|
+
vertical: { start: splitPoint, end: bounds.vertical.end }
|
|
386
|
+
};
|
|
387
|
+
return findNodeBounds(node.children[0], targetNodeId, firstBounds) ??
|
|
388
|
+
findNodeBounds(node.children[1], targetNodeId, secondBounds);
|
|
389
|
+
}
|
|
390
|
+
function resolveRangeOverlapRatio(first, second) {
|
|
391
|
+
const overlapStart = Math.max(first.start, second.start);
|
|
392
|
+
const overlapEnd = Math.min(first.end, second.end);
|
|
393
|
+
const overlap = Math.max(0, overlapEnd - overlapStart);
|
|
394
|
+
const base = Math.min(first.end - first.start, second.end - second.start);
|
|
395
|
+
if (base <= 0) {
|
|
396
|
+
return 0;
|
|
397
|
+
}
|
|
398
|
+
return overlap / base;
|
|
399
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LayoutNode } from "../../domain/layout/model.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
export declare function updateCanonicalizedActiveWindowRoot(workspace: Workspace, updater: (root: LayoutNode) => LayoutNode): Workspace;
|
|
4
|
+
export declare function pruneUnusedToolInstances(workspace: Workspace, candidateToolInstanceIds?: Iterable<string>): Workspace;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { collectReferencedToolInstanceIds } from "../../domain/workspace/selectors.js";
|
|
2
|
+
import { canonicalizeLayout } from "./canonicalizeLayout.js";
|
|
3
|
+
import { updateActiveWindowRoot } from "./layoutTree.js";
|
|
4
|
+
export function updateCanonicalizedActiveWindowRoot(workspace, updater) {
|
|
5
|
+
return updateActiveWindowRoot(workspace, (root) => canonicalizeLayout(updater(root)));
|
|
6
|
+
}
|
|
7
|
+
export function pruneUnusedToolInstances(workspace, candidateToolInstanceIds) {
|
|
8
|
+
const liveToolInstanceIds = collectReferencedToolInstanceIds(workspace);
|
|
9
|
+
if (!candidateToolInstanceIds) {
|
|
10
|
+
return {
|
|
11
|
+
...workspace,
|
|
12
|
+
toolInstances: Object.fromEntries(Object.entries(workspace.toolInstances).filter(([toolInstanceId]) => liveToolInstanceIds.has(toolInstanceId)))
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const candidateSet = new Set(candidateToolInstanceIds);
|
|
16
|
+
if (candidateSet.size === 0) {
|
|
17
|
+
return workspace;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
...workspace,
|
|
21
|
+
toolInstances: Object.fromEntries(Object.entries(workspace.toolInstances).filter(([toolInstanceId]) => !candidateSet.has(toolInstanceId) || liveToolInstanceIds.has(toolInstanceId)))
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { findStackContainingPanelInWorkspace, findWindowContainingPanel } from "../../domain/workspace/selectors.js";
|
|
2
|
+
import { setActiveStackChild } from "./setActiveStackChild.js";
|
|
3
|
+
import { createWorkspaceSessionState } from "./session.js";
|
|
4
|
+
// Shared by direct commands and editable layout projections. The owning
|
|
5
|
+
// window must be selected before updating its active stack child.
|
|
6
|
+
export function focusPanel(state, panelId) {
|
|
7
|
+
const containingStack = findStackContainingPanelInWorkspace(state.workspace, panelId);
|
|
8
|
+
const containingWindow = findWindowContainingPanel(state.workspace, panelId);
|
|
9
|
+
if (!containingStack || !containingWindow) {
|
|
10
|
+
return state;
|
|
11
|
+
}
|
|
12
|
+
const workspaceWithActiveWindow = state.workspace.activeWindowId === containingWindow.id
|
|
13
|
+
? state.workspace
|
|
14
|
+
: { ...state.workspace, activeWindowId: containingWindow.id };
|
|
15
|
+
const nextWorkspace = containingStack.activeChildId === panelId
|
|
16
|
+
? workspaceWithActiveWindow
|
|
17
|
+
: setActiveStackChild(workspaceWithActiveWindow, { stackId: containingStack.id, panelId });
|
|
18
|
+
return createWorkspaceSessionState(nextWorkspace, { activePanelId: panelId });
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LayoutEdge } from "../../domain/layout/interaction.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
export type JoinPanelAreaSide = 'left' | 'right' | 'top' | 'bottom';
|
|
4
|
+
interface JoinPanelAreaInput {
|
|
5
|
+
panelId: string;
|
|
6
|
+
edge: LayoutEdge;
|
|
7
|
+
side: JoinPanelAreaSide;
|
|
8
|
+
sourceAreaPanelIds?: readonly string[];
|
|
9
|
+
siblingAreaPanelIds?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function canJoinPanelArea(workspace: Workspace, input: Omit<JoinPanelAreaInput, 'side'>): boolean;
|
|
12
|
+
export declare function joinPanelArea(workspace: Workspace, input: JoinPanelAreaInput): Workspace;
|
|
13
|
+
export {};
|