@tutti-os/workbench-surface 0.0.168 → 0.0.170
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/README.md +9 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +355 -240
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1554,7 +1554,7 @@ function createWorkbenchController(initialState = {}, options = {}) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
|
|
1556
1556
|
// src/host/WorkbenchHost.tsx
|
|
1557
|
-
import { useMemo as
|
|
1557
|
+
import { useMemo as useMemo11 } from "react";
|
|
1558
1558
|
|
|
1559
1559
|
// src/mission-control/WorkbenchMissionControlOverlay.tsx
|
|
1560
1560
|
import {
|
|
@@ -2289,7 +2289,7 @@ function useWorkbenchMissionControlState({
|
|
|
2289
2289
|
|
|
2290
2290
|
// src/react/WorkbenchSurface.tsx
|
|
2291
2291
|
import {
|
|
2292
|
-
useCallback as
|
|
2292
|
+
useCallback as useCallback8,
|
|
2293
2293
|
useEffect as useEffect5
|
|
2294
2294
|
} from "react";
|
|
2295
2295
|
|
|
@@ -2523,10 +2523,16 @@ function WorkbenchLockedSlotLayer() {
|
|
|
2523
2523
|
}
|
|
2524
2524
|
|
|
2525
2525
|
// src/react/WorkbenchNodeLayer.tsx
|
|
2526
|
-
import { Fragment as Fragment3, memo, useMemo as
|
|
2526
|
+
import { Fragment as Fragment3, memo, useMemo as useMemo5 } from "react";
|
|
2527
2527
|
import { createPortal } from "react-dom";
|
|
2528
2528
|
|
|
2529
2529
|
// src/react/WorkbenchWindowFrame.tsx
|
|
2530
|
+
import {
|
|
2531
|
+
useCallback as useCallback6,
|
|
2532
|
+
useLayoutEffect as useLayoutEffect3,
|
|
2533
|
+
useMemo as useMemo4,
|
|
2534
|
+
useRef as useRef3
|
|
2535
|
+
} from "react";
|
|
2530
2536
|
import { createI18nRuntime } from "@tutti-os/ui-i18n-runtime";
|
|
2531
2537
|
import { Checkbox } from "@tutti-os/ui-system";
|
|
2532
2538
|
|
|
@@ -2844,10 +2850,14 @@ function resolveWorkbenchWindowHeader({
|
|
|
2844
2850
|
controller,
|
|
2845
2851
|
defaultActions,
|
|
2846
2852
|
genie,
|
|
2853
|
+
isDragging,
|
|
2854
|
+
isFocused,
|
|
2855
|
+
isResizing,
|
|
2847
2856
|
node,
|
|
2848
2857
|
onDoubleClick,
|
|
2849
2858
|
onDragStart,
|
|
2850
2859
|
renderHeader,
|
|
2860
|
+
renderRevision,
|
|
2851
2861
|
windowChromeMode = "system"
|
|
2852
2862
|
}) {
|
|
2853
2863
|
const context = {
|
|
@@ -2859,7 +2869,11 @@ function resolveWorkbenchWindowHeader({
|
|
|
2859
2869
|
onPointerDown: onDragStart
|
|
2860
2870
|
},
|
|
2861
2871
|
genie,
|
|
2872
|
+
isDragging,
|
|
2873
|
+
isFocused,
|
|
2874
|
+
isResizing,
|
|
2862
2875
|
node,
|
|
2876
|
+
renderRevision,
|
|
2863
2877
|
surfaceSize: controller.getSnapshot().surfaceSize
|
|
2864
2878
|
};
|
|
2865
2879
|
const customHeader = windowChromeMode === "custom-header" && renderHeader ? renderHeader(context) : null;
|
|
@@ -2938,11 +2952,31 @@ function WorkbenchWindowFrame({
|
|
|
2938
2952
|
controller.commands.focusNode(node.id);
|
|
2939
2953
|
controller.commands.applySnapTarget(node.id, "top");
|
|
2940
2954
|
};
|
|
2941
|
-
const
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2955
|
+
const minimizeNodeToAnchorRef = useRef3(genie.minimizeNodeToAnchor);
|
|
2956
|
+
useLayoutEffect3(() => {
|
|
2957
|
+
minimizeNodeToAnchorRef.current = genie.minimizeNodeToAnchor;
|
|
2958
|
+
}, [genie.minimizeNodeToAnchor]);
|
|
2959
|
+
const minimizeNodeToAnchor = useCallback6(
|
|
2960
|
+
(nodeID, minimize) => {
|
|
2961
|
+
minimizeNodeToAnchorRef.current(nodeID, minimize);
|
|
2962
|
+
},
|
|
2963
|
+
[]
|
|
2964
|
+
);
|
|
2965
|
+
const genieControls = useMemo4(
|
|
2966
|
+
() => ({ minimizeNodeToAnchor }),
|
|
2967
|
+
[minimizeNodeToAnchor]
|
|
2968
|
+
);
|
|
2969
|
+
const headerRenderRevision = useMemo4(
|
|
2970
|
+
() => ({}),
|
|
2971
|
+
[
|
|
2972
|
+
controller,
|
|
2973
|
+
edgeSnapEnabled,
|
|
2974
|
+
interactive,
|
|
2975
|
+
renderActions,
|
|
2976
|
+
renderHeader,
|
|
2977
|
+
windowChromeI18n
|
|
2978
|
+
]
|
|
2979
|
+
);
|
|
2946
2980
|
const defaultActions = interactive ? /* @__PURE__ */ jsxs4(
|
|
2947
2981
|
"div",
|
|
2948
2982
|
{
|
|
@@ -2974,10 +3008,14 @@ function WorkbenchWindowFrame({
|
|
|
2974
3008
|
controller,
|
|
2975
3009
|
defaultActions,
|
|
2976
3010
|
genie: genieControls,
|
|
3011
|
+
isDragging,
|
|
3012
|
+
isFocused,
|
|
3013
|
+
isResizing,
|
|
2977
3014
|
node,
|
|
2978
3015
|
onDoubleClick: onHeaderDoubleClick,
|
|
2979
3016
|
onDragStart,
|
|
2980
3017
|
renderHeader: interactive ? renderHeader : void 0,
|
|
3018
|
+
renderRevision: headerRenderRevision,
|
|
2981
3019
|
windowChromeMode
|
|
2982
3020
|
});
|
|
2983
3021
|
const shouldRenderCustomHeader = resolvedHeader.windowChromeMode === "custom-header";
|
|
@@ -3145,7 +3183,7 @@ function WorkbenchNodeLayer({
|
|
|
3145
3183
|
windowChromeMode,
|
|
3146
3184
|
windowChromeI18n
|
|
3147
3185
|
}) {
|
|
3148
|
-
const selectRenderedNodeIDs =
|
|
3186
|
+
const selectRenderedNodeIDs = useMemo5(
|
|
3149
3187
|
() => createRenderedWorkbenchNodeIDsSelector(shouldKeepMinimizedNodeMounted),
|
|
3150
3188
|
[shouldKeepMinimizedNodeMounted]
|
|
3151
3189
|
);
|
|
@@ -3490,10 +3528,10 @@ function resolveLockedMoveDirection(target) {
|
|
|
3490
3528
|
}
|
|
3491
3529
|
|
|
3492
3530
|
// src/react/hooks/useWorkbenchSurfaceSize.ts
|
|
3493
|
-
import { useLayoutEffect as
|
|
3531
|
+
import { useLayoutEffect as useLayoutEffect4, useRef as useRef4 } from "react";
|
|
3494
3532
|
function useWorkbenchSurfaceSize(onSizeChange) {
|
|
3495
|
-
const ref =
|
|
3496
|
-
|
|
3533
|
+
const ref = useRef4(null);
|
|
3534
|
+
useLayoutEffect4(() => {
|
|
3497
3535
|
const element = ref.current;
|
|
3498
3536
|
if (!element) {
|
|
3499
3537
|
return;
|
|
@@ -3523,9 +3561,11 @@ function useWorkbenchSurfaceSize(onSizeChange) {
|
|
|
3523
3561
|
|
|
3524
3562
|
// src/react/useWorkbenchGenieAnimation.tsx
|
|
3525
3563
|
import {
|
|
3526
|
-
useCallback as
|
|
3564
|
+
useCallback as useCallback7,
|
|
3527
3565
|
useEffect as useEffect4,
|
|
3528
|
-
|
|
3566
|
+
useLayoutEffect as useLayoutEffect5,
|
|
3567
|
+
useMemo as useMemo6,
|
|
3568
|
+
useRef as useRef5,
|
|
3529
3569
|
useState as useState4
|
|
3530
3570
|
} from "react";
|
|
3531
3571
|
import { createPortal as createPortal2, flushSync } from "react-dom";
|
|
@@ -4301,28 +4341,28 @@ function useWorkbenchGenieAnimation({
|
|
|
4301
4341
|
resolveDockPreviewCacheKey: resolveDockPreviewCacheKey2,
|
|
4302
4342
|
shouldCaptureNodePreviewImage
|
|
4303
4343
|
}) {
|
|
4304
|
-
const dockAnchorElementsRef =
|
|
4305
|
-
const canvasRef =
|
|
4306
|
-
const rafRef =
|
|
4307
|
-
const animationGenerationRef =
|
|
4308
|
-
const animationCleanupRef =
|
|
4309
|
-
const minimizedDockEnterAnimationNodeIdsRef =
|
|
4310
|
-
const minimizedDockEnterAnimationTimersRef =
|
|
4344
|
+
const dockAnchorElementsRef = useRef5(/* @__PURE__ */ new Map());
|
|
4345
|
+
const canvasRef = useRef5(null);
|
|
4346
|
+
const rafRef = useRef5(null);
|
|
4347
|
+
const animationGenerationRef = useRef5(0);
|
|
4348
|
+
const animationCleanupRef = useRef5(null);
|
|
4349
|
+
const minimizedDockEnterAnimationNodeIdsRef = useRef5(/* @__PURE__ */ new Set());
|
|
4350
|
+
const minimizedDockEnterAnimationTimersRef = useRef5(
|
|
4311
4351
|
/* @__PURE__ */ new Map()
|
|
4312
4352
|
);
|
|
4313
|
-
const minimizedGenieTextureByNodeIDRef =
|
|
4353
|
+
const minimizedGenieTextureByNodeIDRef = useRef5(
|
|
4314
4354
|
/* @__PURE__ */ new Map()
|
|
4315
4355
|
);
|
|
4316
|
-
const renderedPreviewCaptureIDRef =
|
|
4317
|
-
const renderedPreviewCaptureElementRef =
|
|
4318
|
-
const pendingRenderedPreviewCaptureRef =
|
|
4356
|
+
const renderedPreviewCaptureIDRef = useRef5(0);
|
|
4357
|
+
const renderedPreviewCaptureElementRef = useRef5(null);
|
|
4358
|
+
const pendingRenderedPreviewCaptureRef = useRef5(null);
|
|
4319
4359
|
const [isCanvasActive, setIsCanvasActive] = useState4(false);
|
|
4320
4360
|
const [genieHiddenNodeIDs, setGenieHiddenNodeIDs] = useState4(
|
|
4321
4361
|
() => /* @__PURE__ */ new Set()
|
|
4322
4362
|
);
|
|
4323
4363
|
const [pendingMinimizedNode, setPendingMinimizedNode] = useState4(null);
|
|
4324
4364
|
const [pendingRenderedPreviewCapture, setPendingRenderedPreviewCapture] = useState4(null);
|
|
4325
|
-
const registerDockAnchor =
|
|
4365
|
+
const registerDockAnchor = useCallback7(
|
|
4326
4366
|
(anchorKey, element) => {
|
|
4327
4367
|
if (element) {
|
|
4328
4368
|
dockAnchorElementsRef.current.set(anchorKey, element);
|
|
@@ -4332,14 +4372,14 @@ function useWorkbenchGenieAnimation({
|
|
|
4332
4372
|
},
|
|
4333
4373
|
[]
|
|
4334
4374
|
);
|
|
4335
|
-
const resolveDockAnchorRect =
|
|
4375
|
+
const resolveDockAnchorRect = useCallback7((anchorKey) => {
|
|
4336
4376
|
const element = dockAnchorElementsRef.current.get(anchorKey) ?? null;
|
|
4337
4377
|
if (!element) {
|
|
4338
4378
|
return null;
|
|
4339
4379
|
}
|
|
4340
4380
|
return resolveDockAnchorViewportRect(element);
|
|
4341
4381
|
}, []);
|
|
4342
|
-
const resolveDockAnchorRectAfterRender =
|
|
4382
|
+
const resolveDockAnchorRectAfterRender = useCallback7(
|
|
4343
4383
|
async (anchorKey, isCurrent) => {
|
|
4344
4384
|
let dockRect = resolveDockAnchorRect(anchorKey);
|
|
4345
4385
|
for (let frame = 0; (!dockRect || !isUsableGenieRect(dockRect)) && frame < dockAnchorResolveMaxAnimationFrames; frame += 1) {
|
|
@@ -4353,16 +4393,16 @@ function useWorkbenchGenieAnimation({
|
|
|
4353
4393
|
},
|
|
4354
4394
|
[resolveDockAnchorRect]
|
|
4355
4395
|
);
|
|
4356
|
-
const resolveNodeElement =
|
|
4396
|
+
const resolveNodeElement = useCallback7((nodeID) => {
|
|
4357
4397
|
return Array.from(
|
|
4358
4398
|
document.querySelectorAll("[data-workbench-window-id]")
|
|
4359
4399
|
).find((candidate) => candidate.dataset.workbenchWindowId === nodeID) ?? null;
|
|
4360
4400
|
}, []);
|
|
4361
|
-
const resolveAnchorKeyForNode =
|
|
4401
|
+
const resolveAnchorKeyForNode = useCallback7(
|
|
4362
4402
|
(node) => resolveDockAnchorKey?.(node) ?? node.id,
|
|
4363
4403
|
[resolveDockAnchorKey]
|
|
4364
4404
|
);
|
|
4365
|
-
const releaseMinimizedDockEnterAnimation =
|
|
4405
|
+
const releaseMinimizedDockEnterAnimation = useCallback7((nodeID) => {
|
|
4366
4406
|
const timer = minimizedDockEnterAnimationTimersRef.current.get(nodeID);
|
|
4367
4407
|
if (timer) {
|
|
4368
4408
|
clearTimeout(timer);
|
|
@@ -4370,14 +4410,14 @@ function useWorkbenchGenieAnimation({
|
|
|
4370
4410
|
}
|
|
4371
4411
|
minimizedDockEnterAnimationNodeIdsRef.current.delete(nodeID);
|
|
4372
4412
|
}, []);
|
|
4373
|
-
const registerMinimizedDockEnterAnimation =
|
|
4413
|
+
const registerMinimizedDockEnterAnimation = useCallback7(
|
|
4374
4414
|
(nodeID) => {
|
|
4375
4415
|
releaseMinimizedDockEnterAnimation(nodeID);
|
|
4376
4416
|
minimizedDockEnterAnimationNodeIdsRef.current.add(nodeID);
|
|
4377
4417
|
},
|
|
4378
4418
|
[releaseMinimizedDockEnterAnimation]
|
|
4379
4419
|
);
|
|
4380
|
-
const scheduleReleaseMinimizedDockEnterAnimation =
|
|
4420
|
+
const scheduleReleaseMinimizedDockEnterAnimation = useCallback7(
|
|
4381
4421
|
(nodeID, delayMs = minimizedDockSlotEnterAnimationMs) => {
|
|
4382
4422
|
const existing = minimizedDockEnterAnimationTimersRef.current.get(nodeID);
|
|
4383
4423
|
if (existing) {
|
|
@@ -4393,13 +4433,13 @@ function useWorkbenchGenieAnimation({
|
|
|
4393
4433
|
},
|
|
4394
4434
|
[]
|
|
4395
4435
|
);
|
|
4396
|
-
const shouldAnimateMinimizedDockEnter =
|
|
4436
|
+
const shouldAnimateMinimizedDockEnter = useCallback7((nodeID) => {
|
|
4397
4437
|
return minimizedDockEnterAnimationNodeIdsRef.current.has(nodeID);
|
|
4398
4438
|
}, []);
|
|
4399
|
-
const readMinimizedGenieTexture =
|
|
4439
|
+
const readMinimizedGenieTexture = useCallback7((nodeID) => {
|
|
4400
4440
|
return minimizedGenieTextureByNodeIDRef.current.get(nodeID) ?? null;
|
|
4401
4441
|
}, []);
|
|
4402
|
-
const writeMinimizedGenieTexture =
|
|
4442
|
+
const writeMinimizedGenieTexture = useCallback7(
|
|
4403
4443
|
(nodeID, texture) => {
|
|
4404
4444
|
const cache = minimizedGenieTextureByNodeIDRef.current;
|
|
4405
4445
|
cache.delete(nodeID);
|
|
@@ -4407,10 +4447,10 @@ function useWorkbenchGenieAnimation({
|
|
|
4407
4447
|
},
|
|
4408
4448
|
[]
|
|
4409
4449
|
);
|
|
4410
|
-
const clearMinimizedGenieTexture =
|
|
4450
|
+
const clearMinimizedGenieTexture = useCallback7((nodeID) => {
|
|
4411
4451
|
minimizedGenieTextureByNodeIDRef.current.delete(nodeID);
|
|
4412
4452
|
}, []);
|
|
4413
|
-
const pruneMinimizedGenieTextures =
|
|
4453
|
+
const pruneMinimizedGenieTextures = useCallback7(
|
|
4414
4454
|
(retainNodeID) => {
|
|
4415
4455
|
const minimizedNodeIDs = new Set(
|
|
4416
4456
|
controller.getSnapshot().nodes.filter((node) => node.isMinimized === true).map((node) => node.id)
|
|
@@ -4426,7 +4466,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4426
4466
|
},
|
|
4427
4467
|
[controller]
|
|
4428
4468
|
);
|
|
4429
|
-
const hideNodeForGenie =
|
|
4469
|
+
const hideNodeForGenie = useCallback7((nodeID) => {
|
|
4430
4470
|
setGenieHiddenNodeIDs((current) => {
|
|
4431
4471
|
if (current.has(nodeID)) {
|
|
4432
4472
|
return current;
|
|
@@ -4434,7 +4474,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4434
4474
|
return /* @__PURE__ */ new Set([...current, nodeID]);
|
|
4435
4475
|
});
|
|
4436
4476
|
}, []);
|
|
4437
|
-
const showNodeForGenie =
|
|
4477
|
+
const showNodeForGenie = useCallback7((nodeID) => {
|
|
4438
4478
|
setGenieHiddenNodeIDs((current) => {
|
|
4439
4479
|
if (!current.has(nodeID)) {
|
|
4440
4480
|
return current;
|
|
@@ -4444,12 +4484,12 @@ function useWorkbenchGenieAnimation({
|
|
|
4444
4484
|
return next;
|
|
4445
4485
|
});
|
|
4446
4486
|
}, []);
|
|
4447
|
-
const clearPendingMinimizedNode =
|
|
4487
|
+
const clearPendingMinimizedNode = useCallback7((nodeID) => {
|
|
4448
4488
|
setPendingMinimizedNode(
|
|
4449
4489
|
(current) => current?.id === nodeID ? null : current
|
|
4450
4490
|
);
|
|
4451
4491
|
}, []);
|
|
4452
|
-
const clearRenderedPreviewCapture =
|
|
4492
|
+
const clearRenderedPreviewCapture = useCallback7((id) => {
|
|
4453
4493
|
if (pendingRenderedPreviewCaptureRef.current?.id !== id) {
|
|
4454
4494
|
return;
|
|
4455
4495
|
}
|
|
@@ -4457,7 +4497,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4457
4497
|
renderedPreviewCaptureElementRef.current = null;
|
|
4458
4498
|
setPendingRenderedPreviewCapture(null);
|
|
4459
4499
|
}, []);
|
|
4460
|
-
const requestRenderedGeniePreviewTexture =
|
|
4500
|
+
const requestRenderedGeniePreviewTexture = useCallback7(
|
|
4461
4501
|
async ({
|
|
4462
4502
|
node,
|
|
4463
4503
|
textureRect
|
|
@@ -4524,7 +4564,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4524
4564
|
},
|
|
4525
4565
|
[clearRenderedPreviewCapture, renderNodeGeniePreview]
|
|
4526
4566
|
);
|
|
4527
|
-
const setupCanvas =
|
|
4567
|
+
const setupCanvas = useCallback7(() => {
|
|
4528
4568
|
const canvas = canvasRef.current;
|
|
4529
4569
|
if (!canvas) {
|
|
4530
4570
|
return null;
|
|
@@ -4546,7 +4586,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4546
4586
|
context.setTransform(devicePixelRatio, 0, 0, devicePixelRatio, 0, 0);
|
|
4547
4587
|
return { context, viewportHeight, viewportWidth };
|
|
4548
4588
|
}, []);
|
|
4549
|
-
const clearCanvas =
|
|
4589
|
+
const clearCanvas = useCallback7(() => {
|
|
4550
4590
|
const canvas = canvasRef.current;
|
|
4551
4591
|
const context = canvas?.getContext("2d") ?? null;
|
|
4552
4592
|
if (canvas && context) {
|
|
@@ -4554,7 +4594,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4554
4594
|
}
|
|
4555
4595
|
setIsCanvasActive(false);
|
|
4556
4596
|
}, []);
|
|
4557
|
-
const stopAnimation =
|
|
4597
|
+
const stopAnimation = useCallback7((runCleanup = true) => {
|
|
4558
4598
|
animationGenerationRef.current += 1;
|
|
4559
4599
|
if (rafRef.current !== null) {
|
|
4560
4600
|
window.cancelAnimationFrame(rafRef.current);
|
|
@@ -4566,7 +4606,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4566
4606
|
cleanup?.();
|
|
4567
4607
|
}
|
|
4568
4608
|
}, []);
|
|
4569
|
-
const runGenieAnimation =
|
|
4609
|
+
const runGenieAnimation = useCallback7(
|
|
4570
4610
|
({
|
|
4571
4611
|
direction,
|
|
4572
4612
|
dockRect,
|
|
@@ -4636,7 +4676,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4636
4676
|
},
|
|
4637
4677
|
[setupCanvas, stopAnimation]
|
|
4638
4678
|
);
|
|
4639
|
-
const runScaleWindowAnimation =
|
|
4679
|
+
const runScaleWindowAnimation = useCallback7(
|
|
4640
4680
|
({
|
|
4641
4681
|
direction,
|
|
4642
4682
|
dockRect,
|
|
@@ -4728,7 +4768,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4728
4768
|
[stopAnimation]
|
|
4729
4769
|
);
|
|
4730
4770
|
useEffect4(() => () => stopAnimation(false), [stopAnimation]);
|
|
4731
|
-
const startOpenOrRestoreAnimation =
|
|
4771
|
+
const startOpenOrRestoreAnimation = useCallback7(
|
|
4732
4772
|
async (nodeID, anchorKey, generation, dockRectFallback, minimizedNode) => {
|
|
4733
4773
|
const effectiveMinimizeAnimation = shouldReduceMotion() ? "off" : minimizeAnimation;
|
|
4734
4774
|
if (effectiveMinimizeAnimation === "off") {
|
|
@@ -4841,7 +4881,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4841
4881
|
showNodeForGenie
|
|
4842
4882
|
]
|
|
4843
4883
|
);
|
|
4844
|
-
const launchNodeFromAnchor =
|
|
4884
|
+
const launchNodeFromAnchor = useCallback7(
|
|
4845
4885
|
(anchorKey, nodeID, launch) => {
|
|
4846
4886
|
const target = controller.getSnapshot().nodes.find((node) => node.id === nodeID);
|
|
4847
4887
|
if (!target) {
|
|
@@ -4910,7 +4950,7 @@ function useWorkbenchGenieAnimation({
|
|
|
4910
4950
|
stopAnimation
|
|
4911
4951
|
]
|
|
4912
4952
|
);
|
|
4913
|
-
const minimizeNodeToAnchor =
|
|
4953
|
+
const minimizeNodeToAnchor = useCallback7(
|
|
4914
4954
|
(nodeID, minimize) => {
|
|
4915
4955
|
void (async () => {
|
|
4916
4956
|
pruneMinimizedGenieTextures();
|
|
@@ -5385,8 +5425,18 @@ function useWorkbenchGenieAnimation({
|
|
|
5385
5425
|
},
|
|
5386
5426
|
[]
|
|
5387
5427
|
);
|
|
5388
|
-
|
|
5389
|
-
|
|
5428
|
+
const minimizeNodeToAnchorRef = useRef5(minimizeNodeToAnchor);
|
|
5429
|
+
useLayoutEffect5(() => {
|
|
5430
|
+
minimizeNodeToAnchorRef.current = minimizeNodeToAnchor;
|
|
5431
|
+
}, [minimizeNodeToAnchor]);
|
|
5432
|
+
const stableMinimizeNodeToAnchor = useCallback7(
|
|
5433
|
+
(nodeID, minimize) => {
|
|
5434
|
+
minimizeNodeToAnchorRef.current(nodeID, minimize);
|
|
5435
|
+
},
|
|
5436
|
+
[]
|
|
5437
|
+
);
|
|
5438
|
+
const genieLayer = useMemo6(
|
|
5439
|
+
() => typeof document === "undefined" ? null : createPortal2(
|
|
5390
5440
|
/* @__PURE__ */ jsxs6(Fragment4, { children: [
|
|
5391
5441
|
/* @__PURE__ */ jsx9(
|
|
5392
5442
|
"canvas",
|
|
@@ -5416,20 +5466,38 @@ function useWorkbenchGenieAnimation({
|
|
|
5416
5466
|
] }),
|
|
5417
5467
|
document.body
|
|
5418
5468
|
),
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
),
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
),
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5469
|
+
[isCanvasActive, pendingRenderedPreviewCapture]
|
|
5470
|
+
);
|
|
5471
|
+
const isNodeGenieHidden = useCallback7(
|
|
5472
|
+
(nodeID) => genieHiddenNodeIDs.has(nodeID),
|
|
5473
|
+
[genieHiddenNodeIDs]
|
|
5474
|
+
);
|
|
5475
|
+
const isPendingMinimizedDockNode = useCallback7(
|
|
5476
|
+
(nodeID) => pendingMinimizedNode?.id === nodeID,
|
|
5477
|
+
[pendingMinimizedNode]
|
|
5478
|
+
);
|
|
5479
|
+
return useMemo6(
|
|
5480
|
+
() => ({
|
|
5481
|
+
genieLayer,
|
|
5482
|
+
isNodeGenieHidden,
|
|
5483
|
+
isPendingMinimizedDockNode,
|
|
5484
|
+
launchNodeFromAnchor,
|
|
5485
|
+
minimizeNodeToAnchor: stableMinimizeNodeToAnchor,
|
|
5486
|
+
pendingMinimizedNode,
|
|
5487
|
+
registerDockAnchor,
|
|
5488
|
+
shouldAnimateMinimizedDockEnter
|
|
5489
|
+
}),
|
|
5490
|
+
[
|
|
5491
|
+
genieLayer,
|
|
5492
|
+
isNodeGenieHidden,
|
|
5493
|
+
isPendingMinimizedDockNode,
|
|
5494
|
+
launchNodeFromAnchor,
|
|
5495
|
+
pendingMinimizedNode,
|
|
5496
|
+
registerDockAnchor,
|
|
5497
|
+
shouldAnimateMinimizedDockEnter,
|
|
5498
|
+
stableMinimizeNodeToAnchor
|
|
5499
|
+
]
|
|
5500
|
+
);
|
|
5433
5501
|
}
|
|
5434
5502
|
|
|
5435
5503
|
// src/react/WorkbenchSurface.tsx
|
|
@@ -5539,7 +5607,7 @@ function WorkbenchSurfaceInner({
|
|
|
5539
5607
|
windowChromeI18n
|
|
5540
5608
|
}) {
|
|
5541
5609
|
const controller = useWorkbenchController();
|
|
5542
|
-
const onSizeChange =
|
|
5610
|
+
const onSizeChange = useCallback8(
|
|
5543
5611
|
(size) => {
|
|
5544
5612
|
controller.commands.setSurfaceSize(size);
|
|
5545
5613
|
},
|
|
@@ -5802,7 +5870,7 @@ function resolveHostClosePreparer(contributions) {
|
|
|
5802
5870
|
}
|
|
5803
5871
|
|
|
5804
5872
|
// src/host/useWorkbenchHostRuntime.ts
|
|
5805
|
-
import { useEffect as useEffect6, useMemo as
|
|
5873
|
+
import { useEffect as useEffect6, useMemo as useMemo8, useState as useState5 } from "react";
|
|
5806
5874
|
|
|
5807
5875
|
// src/store/createDerivedSnapshotGetter.ts
|
|
5808
5876
|
function createDerivedSnapshotGetter(input) {
|
|
@@ -6676,7 +6744,7 @@ function projectedSubjectsEqual(left, right) {
|
|
|
6676
6744
|
}
|
|
6677
6745
|
|
|
6678
6746
|
// src/host/externalState.ts
|
|
6679
|
-
import { useCallback as
|
|
6747
|
+
import { useCallback as useCallback9, useMemo as useMemo7, useSyncExternalStore } from "react";
|
|
6680
6748
|
var noopSubscribe = () => () => {
|
|
6681
6749
|
};
|
|
6682
6750
|
function createWorkbenchHostExternalStateLookupInput(input) {
|
|
@@ -6690,33 +6758,33 @@ function createWorkbenchHostExternalStateLookupInput(input) {
|
|
|
6690
6758
|
};
|
|
6691
6759
|
}
|
|
6692
6760
|
function useWorkbenchHostExternalState(input) {
|
|
6693
|
-
const lookupInput =
|
|
6761
|
+
const lookupInput = useMemo7(
|
|
6694
6762
|
() => createWorkbenchHostExternalStateLookupInput({
|
|
6695
6763
|
node: input.node,
|
|
6696
6764
|
workspaceId: input.workspaceId
|
|
6697
6765
|
}),
|
|
6698
6766
|
[input.node, input.workspaceId]
|
|
6699
6767
|
);
|
|
6700
|
-
const workspaceInput =
|
|
6768
|
+
const workspaceInput = useMemo7(
|
|
6701
6769
|
() => ({ workspaceId: input.workspaceId }),
|
|
6702
6770
|
[input.workspaceId]
|
|
6703
6771
|
);
|
|
6704
|
-
const subscribeNodeState =
|
|
6772
|
+
const subscribeNodeState = useCallback9(
|
|
6705
6773
|
(listener) => input.externalStateSource?.subscribeNodeState?.(lookupInput, listener) ?? noopSubscribe(),
|
|
6706
6774
|
[input.externalStateSource, lookupInput]
|
|
6707
6775
|
);
|
|
6708
|
-
const getNodeState =
|
|
6776
|
+
const getNodeState = useCallback9(
|
|
6709
6777
|
() => input.externalStateSource?.getNodeState(lookupInput) ?? input.node.data.snapshotNodeState ?? null,
|
|
6710
6778
|
[input.externalStateSource, input.node.data.snapshotNodeState, lookupInput]
|
|
6711
6779
|
);
|
|
6712
|
-
const subscribeWorkspaceState =
|
|
6780
|
+
const subscribeWorkspaceState = useCallback9(
|
|
6713
6781
|
(listener) => input.externalStateSource?.subscribeWorkspaceState?.(
|
|
6714
6782
|
workspaceInput,
|
|
6715
6783
|
listener
|
|
6716
6784
|
) ?? noopSubscribe(),
|
|
6717
6785
|
[input.externalStateSource, workspaceInput]
|
|
6718
6786
|
);
|
|
6719
|
-
const getWorkspaceState =
|
|
6787
|
+
const getWorkspaceState = useCallback9(
|
|
6720
6788
|
() => input.externalStateSource?.getWorkspaceState(workspaceInput) ?? null,
|
|
6721
6789
|
[input.externalStateSource, workspaceInput]
|
|
6722
6790
|
);
|
|
@@ -7781,7 +7849,7 @@ function useWorkbenchHostRuntime({
|
|
|
7781
7849
|
workspaceId
|
|
7782
7850
|
}) {
|
|
7783
7851
|
const [, bumpHydrationRevision] = useState5(0);
|
|
7784
|
-
const hostSession =
|
|
7852
|
+
const hostSession = useMemo8(() => {
|
|
7785
7853
|
logWorkbenchHostDebug("create-session", debugDiagnostics, {
|
|
7786
7854
|
nodeTypeIDs: nodes.map((node) => node.typeId),
|
|
7787
7855
|
projectedNodeCount: projectedNodes?.length ?? 0,
|
|
@@ -7806,32 +7874,32 @@ function useWorkbenchHostRuntime({
|
|
|
7806
7874
|
snapshotRepository,
|
|
7807
7875
|
workspaceId
|
|
7808
7876
|
]);
|
|
7809
|
-
const hostI18n =
|
|
7810
|
-
const missionControlI18n =
|
|
7877
|
+
const hostI18n = useMemo8(() => createWorkbenchHostI18nRuntime(i18n), [i18n]);
|
|
7878
|
+
const missionControlI18n = useMemo8(
|
|
7811
7879
|
() => createWorkbenchMissionControlI18nRuntime(i18n),
|
|
7812
7880
|
[i18n]
|
|
7813
7881
|
);
|
|
7814
|
-
const windowChromeI18n =
|
|
7882
|
+
const windowChromeI18n = useMemo8(
|
|
7815
7883
|
() => createWorkbenchWindowChromeI18nRuntime(i18n),
|
|
7816
7884
|
[i18n]
|
|
7817
7885
|
);
|
|
7818
|
-
const nodeDefinitionByType =
|
|
7886
|
+
const nodeDefinitionByType = useMemo8(
|
|
7819
7887
|
() => new Map(nodes.map((definition) => [definition.typeId, definition])),
|
|
7820
7888
|
[nodes]
|
|
7821
7889
|
);
|
|
7822
7890
|
const isHydrating = hostSession.isHydrating?.() ?? false;
|
|
7823
|
-
const missionControlAdapter =
|
|
7891
|
+
const missionControlAdapter = useMemo8(
|
|
7824
7892
|
() => missionControlEnabled && !isHydrating ? createWorkbenchHostMissionControlAdapter({
|
|
7825
7893
|
activateNode: hostSession.activateNode.bind(hostSession),
|
|
7826
7894
|
controller: hostSession.controller
|
|
7827
7895
|
}) : null,
|
|
7828
7896
|
[hostSession.controller, isHydrating, missionControlEnabled]
|
|
7829
7897
|
);
|
|
7830
|
-
const chromeController =
|
|
7898
|
+
const chromeController = useMemo8(
|
|
7831
7899
|
() => isHydrating ? createReadOnlyWorkbenchController(hostSession.controller) : hostSession.controller,
|
|
7832
7900
|
[hostSession.controller, isHydrating]
|
|
7833
7901
|
);
|
|
7834
|
-
const chromeContext =
|
|
7902
|
+
const chromeContext = useMemo8(
|
|
7835
7903
|
() => ({
|
|
7836
7904
|
activateNode: hostSession.activateNode.bind(hostSession),
|
|
7837
7905
|
controller: chromeController,
|
|
@@ -7920,15 +7988,15 @@ function logWorkbenchHostDebug(event, debugDiagnostics, payload) {
|
|
|
7920
7988
|
}
|
|
7921
7989
|
|
|
7922
7990
|
// src/host/useWorkbenchHostSurfaceRenderers.tsx
|
|
7923
|
-
import { Component, useCallback as
|
|
7991
|
+
import { Component, memo as memo2, useCallback as useCallback13, useMemo as useMemo10 } from "react";
|
|
7924
7992
|
|
|
7925
7993
|
// src/host/WorkbenchHostDock.tsx
|
|
7926
7994
|
import {
|
|
7927
|
-
useCallback as
|
|
7995
|
+
useCallback as useCallback12,
|
|
7928
7996
|
useEffect as useEffect10,
|
|
7929
|
-
useLayoutEffect as
|
|
7930
|
-
useMemo as
|
|
7931
|
-
useRef as
|
|
7997
|
+
useLayoutEffect as useLayoutEffect7,
|
|
7998
|
+
useMemo as useMemo9,
|
|
7999
|
+
useRef as useRef9,
|
|
7932
8000
|
useState as useState8
|
|
7933
8001
|
} from "react";
|
|
7934
8002
|
import {
|
|
@@ -8032,7 +8100,7 @@ function isWorkbenchDockEntryBlocked(entry) {
|
|
|
8032
8100
|
}
|
|
8033
8101
|
|
|
8034
8102
|
// src/host/dockMagnification.ts
|
|
8035
|
-
import { useCallback as
|
|
8103
|
+
import { useCallback as useCallback10, useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
8036
8104
|
|
|
8037
8105
|
// src/host/dockMagnificationBounds.ts
|
|
8038
8106
|
function resolveDockMagnificationViewportBounds(viewportRect, dockPlacement) {
|
|
@@ -8350,28 +8418,28 @@ function useDockMagnification({
|
|
|
8350
8418
|
dockViewportRef,
|
|
8351
8419
|
slotRefs
|
|
8352
8420
|
}) {
|
|
8353
|
-
const pointerAxisRef =
|
|
8354
|
-
const pendingPointerAxisRef =
|
|
8355
|
-
const springsRef =
|
|
8356
|
-
const appliedStylesRef =
|
|
8421
|
+
const pointerAxisRef = useRef6(null);
|
|
8422
|
+
const pendingPointerAxisRef = useRef6(null);
|
|
8423
|
+
const springsRef = useRef6(/* @__PURE__ */ new Map());
|
|
8424
|
+
const appliedStylesRef = useRef6(
|
|
8357
8425
|
/* @__PURE__ */ new Map()
|
|
8358
8426
|
);
|
|
8359
|
-
const animationFrameRef =
|
|
8360
|
-
const lastFrameTimeRef =
|
|
8361
|
-
const entryRampStartedAtRef =
|
|
8362
|
-
const restCentersRef =
|
|
8363
|
-
const hitBoundsRef =
|
|
8364
|
-
const visibleSlotRectsRef =
|
|
8365
|
-
const slotOrderRef =
|
|
8366
|
-
const magnifyActiveRef =
|
|
8367
|
-
const globalPointerTrackerRef =
|
|
8368
|
-
const handleGlobalPointerMoveRef =
|
|
8427
|
+
const animationFrameRef = useRef6(null);
|
|
8428
|
+
const lastFrameTimeRef = useRef6(null);
|
|
8429
|
+
const entryRampStartedAtRef = useRef6(null);
|
|
8430
|
+
const restCentersRef = useRef6(null);
|
|
8431
|
+
const hitBoundsRef = useRef6(null);
|
|
8432
|
+
const visibleSlotRectsRef = useRef6(null);
|
|
8433
|
+
const slotOrderRef = useRef6([]);
|
|
8434
|
+
const magnifyActiveRef = useRef6(false);
|
|
8435
|
+
const globalPointerTrackerRef = useRef6(null);
|
|
8436
|
+
const handleGlobalPointerMoveRef = useRef6(() => {
|
|
8369
8437
|
return;
|
|
8370
8438
|
});
|
|
8371
|
-
const handleGlobalPointerCancelRef =
|
|
8439
|
+
const handleGlobalPointerCancelRef = useRef6(() => {
|
|
8372
8440
|
return;
|
|
8373
8441
|
});
|
|
8374
|
-
const setMagnifyActive =
|
|
8442
|
+
const setMagnifyActive = useCallback10(
|
|
8375
8443
|
(active) => {
|
|
8376
8444
|
if (magnifyActiveRef.current === active) {
|
|
8377
8445
|
return;
|
|
@@ -8385,14 +8453,14 @@ function useDockMagnification({
|
|
|
8385
8453
|
},
|
|
8386
8454
|
[dockRootRef]
|
|
8387
8455
|
);
|
|
8388
|
-
const stopAnimation =
|
|
8456
|
+
const stopAnimation = useCallback10(() => {
|
|
8389
8457
|
if (animationFrameRef.current !== null) {
|
|
8390
8458
|
cancelAnimationFrame(animationFrameRef.current);
|
|
8391
8459
|
animationFrameRef.current = null;
|
|
8392
8460
|
}
|
|
8393
8461
|
lastFrameTimeRef.current = null;
|
|
8394
8462
|
}, []);
|
|
8395
|
-
const captureRestCenters =
|
|
8463
|
+
const captureRestCenters = useCallback10(() => {
|
|
8396
8464
|
const slots = slotRefs.current;
|
|
8397
8465
|
const centers = /* @__PURE__ */ new Map();
|
|
8398
8466
|
const slotRects = [];
|
|
@@ -8429,7 +8497,7 @@ function useDockMagnification({
|
|
|
8429
8497
|
});
|
|
8430
8498
|
restCentersRef.current = centers;
|
|
8431
8499
|
}, [dockPlacement, dockViewportRef, slotRefs]);
|
|
8432
|
-
const isPointerInsideAnyVisibleDockSlot =
|
|
8500
|
+
const isPointerInsideAnyVisibleDockSlot = useCallback10(
|
|
8433
8501
|
(clientX, clientY) => {
|
|
8434
8502
|
for (const rect of visibleSlotRectsRef.current ?? []) {
|
|
8435
8503
|
if (isDockMagnificationPointInsideSlotRect({
|
|
@@ -8444,12 +8512,12 @@ function useDockMagnification({
|
|
|
8444
8512
|
},
|
|
8445
8513
|
[]
|
|
8446
8514
|
);
|
|
8447
|
-
const ensureDockMagnificationGeometry =
|
|
8515
|
+
const ensureDockMagnificationGeometry = useCallback10(() => {
|
|
8448
8516
|
if (restCentersRef.current === null || hitBoundsRef.current === null || visibleSlotRectsRef.current === null) {
|
|
8449
8517
|
captureRestCenters();
|
|
8450
8518
|
}
|
|
8451
8519
|
}, [captureRestCenters]);
|
|
8452
|
-
const isPointerInsideDockMagnificationTarget =
|
|
8520
|
+
const isPointerInsideDockMagnificationTarget = useCallback10(
|
|
8453
8521
|
(clientX, clientY) => isDockMagnificationPointInsideHitBounds({
|
|
8454
8522
|
clientX,
|
|
8455
8523
|
clientY,
|
|
@@ -8458,7 +8526,7 @@ function useDockMagnification({
|
|
|
8458
8526
|
}) || isPointerInsideAnyVisibleDockSlot(clientX, clientY),
|
|
8459
8527
|
[dockPlacement, isPointerInsideAnyVisibleDockSlot]
|
|
8460
8528
|
);
|
|
8461
|
-
const runAnimationFrame =
|
|
8529
|
+
const runAnimationFrame = useCallback10(
|
|
8462
8530
|
(frameTime) => {
|
|
8463
8531
|
if (pendingPointerAxisRef.current !== null) {
|
|
8464
8532
|
pointerAxisRef.current = pendingPointerAxisRef.current;
|
|
@@ -8568,16 +8636,16 @@ function useDockMagnification({
|
|
|
8568
8636
|
},
|
|
8569
8637
|
[captureRestCenters, setMagnifyActive, slotRefs]
|
|
8570
8638
|
);
|
|
8571
|
-
const scheduleAnimation =
|
|
8639
|
+
const scheduleAnimation = useCallback10(() => {
|
|
8572
8640
|
if (animationFrameRef.current !== null) {
|
|
8573
8641
|
return;
|
|
8574
8642
|
}
|
|
8575
8643
|
animationFrameRef.current = requestAnimationFrame(runAnimationFrame);
|
|
8576
8644
|
}, [runAnimationFrame]);
|
|
8577
|
-
const stopGlobalPointerTracking =
|
|
8645
|
+
const stopGlobalPointerTracking = useCallback10(() => {
|
|
8578
8646
|
globalPointerTrackerRef.current?.stop();
|
|
8579
8647
|
}, []);
|
|
8580
|
-
const startGlobalPointerTracking =
|
|
8648
|
+
const startGlobalPointerTracking = useCallback10(() => {
|
|
8581
8649
|
if (typeof document === "undefined") {
|
|
8582
8650
|
return;
|
|
8583
8651
|
}
|
|
@@ -8593,17 +8661,17 @@ function useDockMagnification({
|
|
|
8593
8661
|
});
|
|
8594
8662
|
globalPointerTrackerRef.current.start();
|
|
8595
8663
|
}, []);
|
|
8596
|
-
const clearTrackedPointer =
|
|
8664
|
+
const clearTrackedPointer = useCallback10(() => {
|
|
8597
8665
|
pendingPointerAxisRef.current = null;
|
|
8598
8666
|
pointerAxisRef.current = null;
|
|
8599
8667
|
entryRampStartedAtRef.current = null;
|
|
8600
8668
|
scheduleAnimation();
|
|
8601
8669
|
}, [scheduleAnimation]);
|
|
8602
|
-
const handleGlobalPointerCancel =
|
|
8670
|
+
const handleGlobalPointerCancel = useCallback10(() => {
|
|
8603
8671
|
stopGlobalPointerTracking();
|
|
8604
8672
|
clearTrackedPointer();
|
|
8605
8673
|
}, [clearTrackedPointer, stopGlobalPointerTracking]);
|
|
8606
|
-
const handlePointerMove =
|
|
8674
|
+
const handlePointerMove = useCallback10(
|
|
8607
8675
|
(clientX, clientY) => {
|
|
8608
8676
|
ensureDockMagnificationGeometry();
|
|
8609
8677
|
if (!isPointerInsideDockMagnificationTarget(clientX, clientY)) {
|
|
@@ -8712,12 +8780,12 @@ function useDockMagnification({
|
|
|
8712
8780
|
handlePointerMove,
|
|
8713
8781
|
isPointerInsideDockMagnificationTarget
|
|
8714
8782
|
]);
|
|
8715
|
-
const handlePointerLeave =
|
|
8783
|
+
const handlePointerLeave = useCallback10(() => {
|
|
8716
8784
|
pendingPointerAxisRef.current = null;
|
|
8717
8785
|
pointerAxisRef.current = null;
|
|
8718
8786
|
scheduleAnimation();
|
|
8719
8787
|
}, [scheduleAnimation]);
|
|
8720
|
-
const clearSlotMagnification =
|
|
8788
|
+
const clearSlotMagnification = useCallback10(
|
|
8721
8789
|
(anchorKey) => {
|
|
8722
8790
|
springsRef.current.delete(anchorKey);
|
|
8723
8791
|
restCentersRef.current?.delete(anchorKey);
|
|
@@ -8734,7 +8802,7 @@ function useDockMagnification({
|
|
|
8734
8802
|
},
|
|
8735
8803
|
[slotRefs]
|
|
8736
8804
|
);
|
|
8737
|
-
const pauseMagnification =
|
|
8805
|
+
const pauseMagnification = useCallback10(() => {
|
|
8738
8806
|
stopGlobalPointerTracking();
|
|
8739
8807
|
stopAnimation();
|
|
8740
8808
|
pendingPointerAxisRef.current = null;
|
|
@@ -8742,7 +8810,7 @@ function useDockMagnification({
|
|
|
8742
8810
|
entryRampStartedAtRef.current = null;
|
|
8743
8811
|
lastFrameTimeRef.current = null;
|
|
8744
8812
|
}, [stopAnimation, stopGlobalPointerTracking]);
|
|
8745
|
-
const resetMagnification =
|
|
8813
|
+
const resetMagnification = useCallback10(() => {
|
|
8746
8814
|
stopGlobalPointerTracking();
|
|
8747
8815
|
stopAnimation();
|
|
8748
8816
|
for (const slotElement of slotRefs.current.values()) {
|
|
@@ -8955,7 +9023,7 @@ function orderWorkbenchMinimizedDockNodes(input) {
|
|
|
8955
9023
|
}
|
|
8956
9024
|
|
|
8957
9025
|
// src/host/minimizedDockStackPromotion.ts
|
|
8958
|
-
import { useEffect as useEffect8, useRef as
|
|
9026
|
+
import { useEffect as useEffect8, useRef as useRef7, useState as useState6 } from "react";
|
|
8959
9027
|
var minimizedDockStackPromotionDurationMs = 520;
|
|
8960
9028
|
function detectMinimizedDockStackPromotion(previous, next) {
|
|
8961
9029
|
const previousVisibleNodeIds = new Set(
|
|
@@ -8975,8 +9043,8 @@ function detectMinimizedDockStackPromotion(previous, next) {
|
|
|
8975
9043
|
return null;
|
|
8976
9044
|
}
|
|
8977
9045
|
function useMinimizedDockStackPromotion(slots) {
|
|
8978
|
-
const previousSlotsRef =
|
|
8979
|
-
const promotionTimerRef =
|
|
9046
|
+
const previousSlotsRef = useRef7(slots);
|
|
9047
|
+
const promotionTimerRef = useRef7(null);
|
|
8980
9048
|
const [promotedNodeId, setPromotedNodeId] = useState6(null);
|
|
8981
9049
|
const [stackDispatching, setStackDispatching] = useState6(false);
|
|
8982
9050
|
useEffect8(() => {
|
|
@@ -9045,10 +9113,10 @@ function resolveWorkbenchMinimizedDockRestoreIntent(input) {
|
|
|
9045
9113
|
// src/host/WorkbenchHostDockPopup.tsx
|
|
9046
9114
|
import {
|
|
9047
9115
|
forwardRef,
|
|
9048
|
-
useCallback as
|
|
9116
|
+
useCallback as useCallback11,
|
|
9049
9117
|
useEffect as useEffect9,
|
|
9050
|
-
useLayoutEffect as
|
|
9051
|
-
useRef as
|
|
9118
|
+
useLayoutEffect as useLayoutEffect6,
|
|
9119
|
+
useRef as useRef8,
|
|
9052
9120
|
useState as useState7
|
|
9053
9121
|
} from "react";
|
|
9054
9122
|
import { createPortal as createPortal3 } from "react-dom";
|
|
@@ -9317,12 +9385,12 @@ function WorkbenchHostDockPopup({
|
|
|
9317
9385
|
const isMinimizedStack = resolvedVariant === "minimized-stack";
|
|
9318
9386
|
const isContextMenu = resolvedVariant === "context-menu";
|
|
9319
9387
|
const createCardCount = showCreateNew === false ? 0 : 1;
|
|
9320
|
-
const cardElementsRef =
|
|
9321
|
-
const cardRefCallbacksRef =
|
|
9388
|
+
const cardElementsRef = useRef8(/* @__PURE__ */ new Map());
|
|
9389
|
+
const cardRefCallbacksRef = useRef8(
|
|
9322
9390
|
/* @__PURE__ */ new Map()
|
|
9323
9391
|
);
|
|
9324
|
-
const popupRootRef =
|
|
9325
|
-
const minimizedStackViewportRef =
|
|
9392
|
+
const popupRootRef = useRef8(null);
|
|
9393
|
+
const minimizedStackViewportRef = useRef8(null);
|
|
9326
9394
|
const [pointer, setPointer] = useState7(null);
|
|
9327
9395
|
const [minimizedStackScrollOffset, setMinimizedStackScrollOffset] = useState7(0);
|
|
9328
9396
|
const [verticalClampOffsetPx, setVerticalClampOffsetPx] = useState7(0);
|
|
@@ -9411,7 +9479,7 @@ function WorkbenchHostDockPopup({
|
|
|
9411
9479
|
popupDiagnosticKey,
|
|
9412
9480
|
resolvedVariant
|
|
9413
9481
|
]);
|
|
9414
|
-
|
|
9482
|
+
useLayoutEffect6(() => {
|
|
9415
9483
|
const rootElement = popupRootRef.current;
|
|
9416
9484
|
const panelElement = rootElement?.querySelector(
|
|
9417
9485
|
"[data-desktop-dock-popup-panel]"
|
|
@@ -9424,7 +9492,7 @@ function WorkbenchHostDockPopup({
|
|
|
9424
9492
|
viewportWidth: window.innerWidth
|
|
9425
9493
|
});
|
|
9426
9494
|
}, [debugDiagnostics, popupDiagnosticKey]);
|
|
9427
|
-
|
|
9495
|
+
useLayoutEffect6(() => {
|
|
9428
9496
|
if (isMinimizedStack || typeof window === "undefined") {
|
|
9429
9497
|
return;
|
|
9430
9498
|
}
|
|
@@ -9463,7 +9531,7 @@ function WorkbenchHostDockPopup({
|
|
|
9463
9531
|
popupCenterY,
|
|
9464
9532
|
popupDiagnosticKey
|
|
9465
9533
|
]);
|
|
9466
|
-
const registerCard =
|
|
9534
|
+
const registerCard = useCallback11((nodeId) => {
|
|
9467
9535
|
const existing = cardRefCallbacksRef.current.get(nodeId);
|
|
9468
9536
|
if (existing) {
|
|
9469
9537
|
return existing;
|
|
@@ -10196,7 +10264,7 @@ var WorkbenchHostDockPopupCard = forwardRef(function WorkbenchHostDockPopupCard2
|
|
|
10196
10264
|
const title = item.title?.trim() || item.node.title;
|
|
10197
10265
|
const isMinimizedStack = variant === "minimized-stack";
|
|
10198
10266
|
const [isLaunching, setIsLaunching] = useState7(false);
|
|
10199
|
-
const launchTimerRef =
|
|
10267
|
+
const launchTimerRef = useRef8(null);
|
|
10200
10268
|
useEffect9(
|
|
10201
10269
|
() => () => {
|
|
10202
10270
|
if (launchTimerRef.current !== null) {
|
|
@@ -10205,7 +10273,7 @@ var WorkbenchHostDockPopupCard = forwardRef(function WorkbenchHostDockPopupCard2
|
|
|
10205
10273
|
},
|
|
10206
10274
|
[]
|
|
10207
10275
|
);
|
|
10208
|
-
const handleSelect =
|
|
10276
|
+
const handleSelect = useCallback11(() => {
|
|
10209
10277
|
if (!isMinimizedStack) {
|
|
10210
10278
|
onSelectNode(item.node.id);
|
|
10211
10279
|
return;
|
|
@@ -10219,7 +10287,7 @@ var WorkbenchHostDockPopupCard = forwardRef(function WorkbenchHostDockPopupCard2
|
|
|
10219
10287
|
onSelectNode(item.node.id);
|
|
10220
10288
|
}, dockPopupMinimizedStackLaunchDisappearMs);
|
|
10221
10289
|
}, [isMinimizedStack, item.node.id, onSelectNode]);
|
|
10222
|
-
const handleSelectKeyDown =
|
|
10290
|
+
const handleSelectKeyDown = useCallback11(
|
|
10223
10291
|
(event) => {
|
|
10224
10292
|
if (event.key !== "Enter" && event.key !== " ") {
|
|
10225
10293
|
return;
|
|
@@ -10404,38 +10472,38 @@ function WorkbenchHostDock({
|
|
|
10404
10472
|
onMissionControlRequestOpen,
|
|
10405
10473
|
workspaceId
|
|
10406
10474
|
}) {
|
|
10407
|
-
const minimizedNodeIDs =
|
|
10475
|
+
const minimizedNodeIDs = useMemo9(
|
|
10408
10476
|
() => new Set(context.minimizedNodes.map((node) => node.id)),
|
|
10409
10477
|
[context.minimizedNodes]
|
|
10410
10478
|
);
|
|
10411
|
-
const dockMeasureRef =
|
|
10412
|
-
const dockItemsRef =
|
|
10413
|
-
const hoverPanelRef =
|
|
10414
|
-
const hoverPanelCloseTimerRef =
|
|
10479
|
+
const dockMeasureRef = useRef9(null);
|
|
10480
|
+
const dockItemsRef = useRef9(null);
|
|
10481
|
+
const hoverPanelRef = useRef9(null);
|
|
10482
|
+
const hoverPanelCloseTimerRef = useRef9(
|
|
10415
10483
|
null
|
|
10416
10484
|
);
|
|
10417
|
-
const hoverPanelOpenTimerRef =
|
|
10485
|
+
const hoverPanelOpenTimerRef = useRef9(
|
|
10418
10486
|
null
|
|
10419
10487
|
);
|
|
10420
|
-
const labelTooltipOpenTimerRef =
|
|
10488
|
+
const labelTooltipOpenTimerRef = useRef9(
|
|
10421
10489
|
null
|
|
10422
10490
|
);
|
|
10423
|
-
const hoverPanelScheduledPointRef =
|
|
10424
|
-
const labelTooltipScheduledPointRef =
|
|
10425
|
-
const hoverPanelRestTargetRef =
|
|
10426
|
-
const activeHoverPanelRef =
|
|
10491
|
+
const hoverPanelScheduledPointRef = useRef9(null);
|
|
10492
|
+
const labelTooltipScheduledPointRef = useRef9(null);
|
|
10493
|
+
const hoverPanelRestTargetRef = useRef9(null);
|
|
10494
|
+
const activeHoverPanelRef = useRef9(
|
|
10427
10495
|
null
|
|
10428
10496
|
);
|
|
10429
|
-
const activeLabelTooltipRef =
|
|
10430
|
-
const pendingDockStateRefreshRef =
|
|
10431
|
-
const slotRefs =
|
|
10432
|
-
const wallpaperToneElementRefs =
|
|
10433
|
-
const dockSlotRefCallbacksRef =
|
|
10497
|
+
const activeLabelTooltipRef = useRef9(null);
|
|
10498
|
+
const pendingDockStateRefreshRef = useRef9(false);
|
|
10499
|
+
const slotRefs = useRef9(/* @__PURE__ */ new Map());
|
|
10500
|
+
const wallpaperToneElementRefs = useRef9(/* @__PURE__ */ new Map());
|
|
10501
|
+
const dockSlotRefCallbacksRef = useRef9(
|
|
10434
10502
|
/* @__PURE__ */ new Map()
|
|
10435
10503
|
);
|
|
10436
|
-
const previousAttentionTokenByEntryId =
|
|
10437
|
-
const dockEntryClickThrottleUntilRef =
|
|
10438
|
-
const attentionTimeouts =
|
|
10504
|
+
const previousAttentionTokenByEntryId = useRef9(/* @__PURE__ */ new Map());
|
|
10505
|
+
const dockEntryClickThrottleUntilRef = useRef9(/* @__PURE__ */ new Map());
|
|
10506
|
+
const attentionTimeouts = useRef9(
|
|
10439
10507
|
/* @__PURE__ */ new Map()
|
|
10440
10508
|
);
|
|
10441
10509
|
const [activeAttentionEntryIds, setActiveAttentionEntryIds] = useState8(/* @__PURE__ */ new Set());
|
|
@@ -10459,17 +10527,17 @@ function WorkbenchHostDock({
|
|
|
10459
10527
|
collapsingMinimizedLaunchAnchorKeys,
|
|
10460
10528
|
setCollapsingMinimizedLaunchAnchorKeys
|
|
10461
10529
|
] = useState8(() => /* @__PURE__ */ new Set());
|
|
10462
|
-
const collapsingMinimizedLaunchTimerRef =
|
|
10530
|
+
const collapsingMinimizedLaunchTimerRef = useRef9(
|
|
10463
10531
|
/* @__PURE__ */ new Map()
|
|
10464
10532
|
);
|
|
10465
|
-
const clearHoverPanelCloseTimer =
|
|
10533
|
+
const clearHoverPanelCloseTimer = useCallback12(() => {
|
|
10466
10534
|
if (hoverPanelCloseTimerRef.current === null) {
|
|
10467
10535
|
return;
|
|
10468
10536
|
}
|
|
10469
10537
|
clearTimeout(hoverPanelCloseTimerRef.current);
|
|
10470
10538
|
hoverPanelCloseTimerRef.current = null;
|
|
10471
10539
|
}, []);
|
|
10472
|
-
const clearHoverPanelOpenTimer =
|
|
10540
|
+
const clearHoverPanelOpenTimer = useCallback12(() => {
|
|
10473
10541
|
if (hoverPanelOpenTimerRef.current === null) {
|
|
10474
10542
|
return;
|
|
10475
10543
|
}
|
|
@@ -10477,7 +10545,7 @@ function WorkbenchHostDock({
|
|
|
10477
10545
|
hoverPanelOpenTimerRef.current = null;
|
|
10478
10546
|
hoverPanelScheduledPointRef.current = null;
|
|
10479
10547
|
}, []);
|
|
10480
|
-
const clearLabelTooltipOpenTimer =
|
|
10548
|
+
const clearLabelTooltipOpenTimer = useCallback12(() => {
|
|
10481
10549
|
if (labelTooltipOpenTimerRef.current === null) {
|
|
10482
10550
|
return;
|
|
10483
10551
|
}
|
|
@@ -10501,7 +10569,7 @@ function WorkbenchHostDock({
|
|
|
10501
10569
|
clearLabelTooltipOpenTimer
|
|
10502
10570
|
]
|
|
10503
10571
|
);
|
|
10504
|
-
const clearCollapsingMinimizedLaunch =
|
|
10572
|
+
const clearCollapsingMinimizedLaunch = useCallback12((anchorKey) => {
|
|
10505
10573
|
const timer = collapsingMinimizedLaunchTimerRef.current.get(anchorKey);
|
|
10506
10574
|
if (timer) {
|
|
10507
10575
|
clearTimeout(timer);
|
|
@@ -10520,7 +10588,7 @@ function WorkbenchHostDock({
|
|
|
10520
10588
|
return next;
|
|
10521
10589
|
});
|
|
10522
10590
|
}, []);
|
|
10523
|
-
const scheduleCollapsingMinimizedLaunchClear =
|
|
10591
|
+
const scheduleCollapsingMinimizedLaunchClear = useCallback12(
|
|
10524
10592
|
(anchorKey) => {
|
|
10525
10593
|
const existing = collapsingMinimizedLaunchTimerRef.current.get(anchorKey);
|
|
10526
10594
|
if (existing) {
|
|
@@ -10535,7 +10603,7 @@ function WorkbenchHostDock({
|
|
|
10535
10603
|
},
|
|
10536
10604
|
[clearCollapsingMinimizedLaunch]
|
|
10537
10605
|
);
|
|
10538
|
-
|
|
10606
|
+
useLayoutEffect7(() => {
|
|
10539
10607
|
const element = dockMeasureRef.current;
|
|
10540
10608
|
if (!element || typeof window === "undefined") {
|
|
10541
10609
|
return void 0;
|
|
@@ -10572,7 +10640,7 @@ function WorkbenchHostDock({
|
|
|
10572
10640
|
window.removeEventListener("resize", scheduleUpdate);
|
|
10573
10641
|
};
|
|
10574
10642
|
}, [dockPlacement]);
|
|
10575
|
-
const flushPendingDockStateRefresh =
|
|
10643
|
+
const flushPendingDockStateRefresh = useCallback12(() => {
|
|
10576
10644
|
if (!pendingDockStateRefreshRef.current) {
|
|
10577
10645
|
return;
|
|
10578
10646
|
}
|
|
@@ -10591,14 +10659,14 @@ function WorkbenchHostDock({
|
|
|
10591
10659
|
setDockStateRevision((revision) => revision + 1);
|
|
10592
10660
|
});
|
|
10593
10661
|
}, [dockStateSource]);
|
|
10594
|
-
const renderedDockEntries =
|
|
10662
|
+
const renderedDockEntries = useMemo9(
|
|
10595
10663
|
() => dockEntries.map((entry) => {
|
|
10596
10664
|
const dynamicState = dockStateSource?.getEntryState(entry.id);
|
|
10597
10665
|
return dynamicState ? { ...entry, ...dynamicState } : entry;
|
|
10598
10666
|
}),
|
|
10599
10667
|
[dockEntries, dockStateRevision, dockStateSource]
|
|
10600
10668
|
);
|
|
10601
|
-
const resolvedEntries =
|
|
10669
|
+
const resolvedEntries = useMemo9(
|
|
10602
10670
|
() => resolveWorkbenchDockEntries({
|
|
10603
10671
|
dockEntries: renderedDockEntries,
|
|
10604
10672
|
minimizedNodeIds: minimizedNodeIDs,
|
|
@@ -10606,7 +10674,7 @@ function WorkbenchHostDock({
|
|
|
10606
10674
|
}),
|
|
10607
10675
|
[context.nodes, minimizedNodeIDs, renderedDockEntries]
|
|
10608
10676
|
);
|
|
10609
|
-
const minimizedDockSlots =
|
|
10677
|
+
const minimizedDockSlots = useMemo9(
|
|
10610
10678
|
() => resolveWorkbenchMinimizedDockSlots({
|
|
10611
10679
|
nodeDefinitions,
|
|
10612
10680
|
nodes: context.minimizedNodes
|
|
@@ -10614,7 +10682,7 @@ function WorkbenchHostDock({
|
|
|
10614
10682
|
[context.minimizedNodes, nodeDefinitions]
|
|
10615
10683
|
);
|
|
10616
10684
|
const { promotedNodeId, stackDispatching } = useMinimizedDockStackPromotion(minimizedDockSlots);
|
|
10617
|
-
const dockItems =
|
|
10685
|
+
const dockItems = useMemo9(
|
|
10618
10686
|
() => createWorkbenchHostDockItems({
|
|
10619
10687
|
minimizedDockSlots,
|
|
10620
10688
|
resolvedEntries
|
|
@@ -10625,7 +10693,7 @@ function WorkbenchHostDock({
|
|
|
10625
10693
|
dockItems,
|
|
10626
10694
|
(nodeId) => context.genie.shouldAnimateMinimizedDockEnter(nodeId)
|
|
10627
10695
|
);
|
|
10628
|
-
const presentDockItemKeys =
|
|
10696
|
+
const presentDockItemKeys = useMemo9(
|
|
10629
10697
|
() => presentDockItems.map((item) => item.key).join("\n"),
|
|
10630
10698
|
[presentDockItems]
|
|
10631
10699
|
);
|
|
@@ -10634,7 +10702,7 @@ function WorkbenchHostDock({
|
|
|
10634
10702
|
elementRefs: wallpaperToneElementRefs,
|
|
10635
10703
|
itemKeys: presentDockItemKeys
|
|
10636
10704
|
});
|
|
10637
|
-
const dockWidth =
|
|
10705
|
+
const dockWidth = useMemo9(
|
|
10638
10706
|
() => resolveWorkbenchHostDockItemsWidth(dockItems),
|
|
10639
10707
|
[dockItems]
|
|
10640
10708
|
);
|
|
@@ -10650,10 +10718,10 @@ function WorkbenchHostDock({
|
|
|
10650
10718
|
dockViewportRef: dockItemsRef,
|
|
10651
10719
|
slotRefs
|
|
10652
10720
|
});
|
|
10653
|
-
const clearSlotMagnificationRef =
|
|
10721
|
+
const clearSlotMagnificationRef = useRef9(() => {
|
|
10654
10722
|
return;
|
|
10655
10723
|
});
|
|
10656
|
-
const registerDockAnchorRef =
|
|
10724
|
+
const registerDockAnchorRef = useRef9(
|
|
10657
10725
|
(anchorKey, element) => {
|
|
10658
10726
|
context.genie.registerDockAnchor(anchorKey, element);
|
|
10659
10727
|
}
|
|
@@ -10664,7 +10732,7 @@ function WorkbenchHostDock({
|
|
|
10664
10732
|
registerDockAnchorRef.current = (anchorKey, element) => {
|
|
10665
10733
|
context.genie.registerDockAnchor(anchorKey, element);
|
|
10666
10734
|
};
|
|
10667
|
-
const registerWallpaperToneElement =
|
|
10735
|
+
const registerWallpaperToneElement = useCallback12(
|
|
10668
10736
|
(key) => (element) => {
|
|
10669
10737
|
if (element) {
|
|
10670
10738
|
wallpaperToneElementRefs.current.set(key, element);
|
|
@@ -10674,7 +10742,7 @@ function WorkbenchHostDock({
|
|
|
10674
10742
|
},
|
|
10675
10743
|
[]
|
|
10676
10744
|
);
|
|
10677
|
-
const setDockHoverPanelOpen =
|
|
10745
|
+
const setDockHoverPanelOpen = useCallback12((open) => {
|
|
10678
10746
|
if (open) {
|
|
10679
10747
|
dockMeasureRef.current?.setAttribute(
|
|
10680
10748
|
"data-dock-hover-panel-open",
|
|
@@ -10690,7 +10758,7 @@ function WorkbenchHostDock({
|
|
|
10690
10758
|
useEffect10(() => {
|
|
10691
10759
|
activeLabelTooltipRef.current = activeLabelTooltip;
|
|
10692
10760
|
}, [activeLabelTooltip]);
|
|
10693
|
-
const closeLabelTooltipImmediate =
|
|
10761
|
+
const closeLabelTooltipImmediate = useCallback12(
|
|
10694
10762
|
(targetKey) => {
|
|
10695
10763
|
clearLabelTooltipOpenTimer();
|
|
10696
10764
|
if (targetKey !== void 0 && activeLabelTooltipRef.current?.key !== targetKey) {
|
|
@@ -10704,7 +10772,7 @@ function WorkbenchHostDock({
|
|
|
10704
10772
|
},
|
|
10705
10773
|
[clearLabelTooltipOpenTimer]
|
|
10706
10774
|
);
|
|
10707
|
-
const closeHoverPanelImmediate =
|
|
10775
|
+
const closeHoverPanelImmediate = useCallback12(
|
|
10708
10776
|
(entryId) => {
|
|
10709
10777
|
clearHoverPanelOpenTimer();
|
|
10710
10778
|
clearHoverPanelCloseTimer();
|
|
@@ -10727,7 +10795,7 @@ function WorkbenchHostDock({
|
|
|
10727
10795
|
setDockHoverPanelOpen
|
|
10728
10796
|
]
|
|
10729
10797
|
);
|
|
10730
|
-
const scheduleHoverPanelClose =
|
|
10798
|
+
const scheduleHoverPanelClose = useCallback12(
|
|
10731
10799
|
(entryId) => {
|
|
10732
10800
|
clearHoverPanelOpenTimer();
|
|
10733
10801
|
clearHoverPanelCloseTimer();
|
|
@@ -10744,7 +10812,7 @@ function WorkbenchHostDock({
|
|
|
10744
10812
|
handleDockPointerLeave
|
|
10745
10813
|
]
|
|
10746
10814
|
);
|
|
10747
|
-
const showHoverPanel =
|
|
10815
|
+
const showHoverPanel = useCallback12(
|
|
10748
10816
|
(entryId, anchorKey, anchorElement) => {
|
|
10749
10817
|
const dockElement = dockMeasureRef.current;
|
|
10750
10818
|
if (!dockElement) {
|
|
@@ -10770,7 +10838,7 @@ function WorkbenchHostDock({
|
|
|
10770
10838
|
},
|
|
10771
10839
|
[clearHoverPanelCloseTimer, pauseDockMagnification, setDockHoverPanelOpen]
|
|
10772
10840
|
);
|
|
10773
|
-
const scheduleHoverPanelAfterRest =
|
|
10841
|
+
const scheduleHoverPanelAfterRest = useCallback12(
|
|
10774
10842
|
(entryId, anchorKey) => {
|
|
10775
10843
|
hoverPanelRestTargetRef.current = { anchorKey, entryId };
|
|
10776
10844
|
clearHoverPanelOpenTimer();
|
|
@@ -10791,7 +10859,7 @@ function WorkbenchHostDock({
|
|
|
10791
10859
|
},
|
|
10792
10860
|
[clearHoverPanelOpenTimer, showHoverPanel]
|
|
10793
10861
|
);
|
|
10794
|
-
const showLabelTooltip =
|
|
10862
|
+
const showLabelTooltip = useCallback12(
|
|
10795
10863
|
(target, anchorKey, anchorElement) => {
|
|
10796
10864
|
const dockElement = dockMeasureRef.current;
|
|
10797
10865
|
if (!dockElement) {
|
|
@@ -10816,7 +10884,7 @@ function WorkbenchHostDock({
|
|
|
10816
10884
|
},
|
|
10817
10885
|
[clearLabelTooltipOpenTimer]
|
|
10818
10886
|
);
|
|
10819
|
-
const scheduleLabelTooltipAfterRest =
|
|
10887
|
+
const scheduleLabelTooltipAfterRest = useCallback12(
|
|
10820
10888
|
(target, anchorKey) => {
|
|
10821
10889
|
clearLabelTooltipOpenTimer();
|
|
10822
10890
|
labelTooltipScheduledPointRef.current = null;
|
|
@@ -10832,7 +10900,7 @@ function WorkbenchHostDock({
|
|
|
10832
10900
|
},
|
|
10833
10901
|
[clearLabelTooltipOpenTimer, showLabelTooltip]
|
|
10834
10902
|
);
|
|
10835
|
-
const resolveHoverPanelTargetAtPoint =
|
|
10903
|
+
const resolveHoverPanelTargetAtPoint = useCallback12(
|
|
10836
10904
|
(clientX, clientY) => {
|
|
10837
10905
|
for (const [anchorKey, slotElement] of slotRefs.current) {
|
|
10838
10906
|
const entryId = slotElement.dataset.dockHoverPanelEntryId;
|
|
@@ -10848,7 +10916,7 @@ function WorkbenchHostDock({
|
|
|
10848
10916
|
},
|
|
10849
10917
|
[]
|
|
10850
10918
|
);
|
|
10851
|
-
const resolveLabelTooltipTargetAtPoint =
|
|
10919
|
+
const resolveLabelTooltipTargetAtPoint = useCallback12(
|
|
10852
10920
|
(clientX, clientY) => {
|
|
10853
10921
|
for (const [anchorKey, slotElement] of slotRefs.current) {
|
|
10854
10922
|
if (slotElement.dataset.dockHoverPanelEntryId) {
|
|
@@ -10875,7 +10943,7 @@ function WorkbenchHostDock({
|
|
|
10875
10943
|
},
|
|
10876
10944
|
[]
|
|
10877
10945
|
);
|
|
10878
|
-
const isPointerInsideActiveHoverPanelRegion =
|
|
10946
|
+
const isPointerInsideActiveHoverPanelRegion = useCallback12(
|
|
10879
10947
|
(clientX, clientY) => {
|
|
10880
10948
|
const activeHoverPanel2 = activeHoverPanelRef.current;
|
|
10881
10949
|
if (!activeHoverPanel2) {
|
|
@@ -10907,7 +10975,7 @@ function WorkbenchHostDock({
|
|
|
10907
10975
|
},
|
|
10908
10976
|
[]
|
|
10909
10977
|
);
|
|
10910
|
-
const scheduleHoverPanelAtPointAfterRest =
|
|
10978
|
+
const scheduleHoverPanelAtPointAfterRest = useCallback12(
|
|
10911
10979
|
(clientX, clientY) => {
|
|
10912
10980
|
const scheduledPoint = hoverPanelScheduledPointRef.current;
|
|
10913
10981
|
if (hoverPanelOpenTimerRef.current !== null && scheduledPoint && Math.abs(clientX - scheduledPoint.clientX) <= dockHoverPanelPointerRestTolerancePx && Math.abs(clientY - scheduledPoint.clientY) <= dockHoverPanelPointerRestTolerancePx) {
|
|
@@ -10935,7 +11003,7 @@ function WorkbenchHostDock({
|
|
|
10935
11003
|
},
|
|
10936
11004
|
[clearHoverPanelOpenTimer, resolveHoverPanelTargetAtPoint, showHoverPanel]
|
|
10937
11005
|
);
|
|
10938
|
-
const scheduleLabelTooltipAtPointAfterRest =
|
|
11006
|
+
const scheduleLabelTooltipAtPointAfterRest = useCallback12(
|
|
10939
11007
|
(clientX, clientY) => {
|
|
10940
11008
|
if (activeLabelTooltipRef.current !== null) {
|
|
10941
11009
|
return;
|
|
@@ -10965,7 +11033,7 @@ function WorkbenchHostDock({
|
|
|
10965
11033
|
showLabelTooltip
|
|
10966
11034
|
]
|
|
10967
11035
|
);
|
|
10968
|
-
const beginDockIconInteraction =
|
|
11036
|
+
const beginDockIconInteraction = useCallback12(
|
|
10969
11037
|
(anchorKey) => {
|
|
10970
11038
|
hoverPanelRestTargetRef.current = null;
|
|
10971
11039
|
clearHoverPanelOpenTimer();
|
|
@@ -10980,20 +11048,20 @@ function WorkbenchHostDock({
|
|
|
10980
11048
|
triggerDockBounce
|
|
10981
11049
|
]
|
|
10982
11050
|
);
|
|
10983
|
-
const isDockEntryClickThrottled =
|
|
11051
|
+
const isDockEntryClickThrottled = useCallback12(
|
|
10984
11052
|
(anchorKey) => {
|
|
10985
11053
|
const throttledUntil = dockEntryClickThrottleUntilRef.current.get(anchorKey);
|
|
10986
11054
|
return throttledUntil !== void 0 && Date.now() < throttledUntil;
|
|
10987
11055
|
},
|
|
10988
11056
|
[]
|
|
10989
11057
|
);
|
|
10990
|
-
const claimDockEntryClick =
|
|
11058
|
+
const claimDockEntryClick = useCallback12((anchorKey) => {
|
|
10991
11059
|
dockEntryClickThrottleUntilRef.current.set(
|
|
10992
11060
|
anchorKey,
|
|
10993
11061
|
Date.now() + DOCK_ENTRY_CLICK_THROTTLE_MS
|
|
10994
11062
|
);
|
|
10995
11063
|
}, []);
|
|
10996
|
-
const beginDockMinimizedInteraction =
|
|
11064
|
+
const beginDockMinimizedInteraction = useCallback12(
|
|
10997
11065
|
(anchorKey) => {
|
|
10998
11066
|
hoverPanelRestTargetRef.current = null;
|
|
10999
11067
|
clearHoverPanelOpenTimer();
|
|
@@ -11033,7 +11101,7 @@ function WorkbenchHostDock({
|
|
|
11033
11101
|
pauseDockMagnification
|
|
11034
11102
|
]
|
|
11035
11103
|
);
|
|
11036
|
-
const runDockMinimizedLaunchAfterCollapse =
|
|
11104
|
+
const runDockMinimizedLaunchAfterCollapse = useCallback12(
|
|
11037
11105
|
(intent, launch) => {
|
|
11038
11106
|
const { anchorKey } = intent;
|
|
11039
11107
|
beginDockMinimizedInteraction(anchorKey);
|
|
@@ -11047,14 +11115,14 @@ function WorkbenchHostDock({
|
|
|
11047
11115
|
},
|
|
11048
11116
|
[beginDockMinimizedInteraction, scheduleCollapsingMinimizedLaunchClear]
|
|
11049
11117
|
);
|
|
11050
|
-
const runDockMinimizedStackLaunch =
|
|
11118
|
+
const runDockMinimizedStackLaunch = useCallback12(
|
|
11051
11119
|
(intent, launch) => {
|
|
11052
11120
|
beginDockMinimizedInteraction();
|
|
11053
11121
|
launch(intent);
|
|
11054
11122
|
},
|
|
11055
11123
|
[beginDockMinimizedInteraction]
|
|
11056
11124
|
);
|
|
11057
|
-
const handleDockPointerTravel =
|
|
11125
|
+
const handleDockPointerTravel = useCallback12(
|
|
11058
11126
|
(clientX, clientY) => {
|
|
11059
11127
|
if (activeHoverPanelRef.current !== null) {
|
|
11060
11128
|
closeLabelTooltipImmediate();
|
|
@@ -11089,7 +11157,7 @@ function WorkbenchHostDock({
|
|
|
11089
11157
|
scheduleLabelTooltipAtPointAfterRest
|
|
11090
11158
|
]
|
|
11091
11159
|
);
|
|
11092
|
-
const updateDockScrollState =
|
|
11160
|
+
const updateDockScrollState = useCallback12(() => {
|
|
11093
11161
|
const scrollElement = dockItemsRef.current;
|
|
11094
11162
|
const viewportElement = dockMeasureRef.current;
|
|
11095
11163
|
if (!scrollElement || !viewportElement) {
|
|
@@ -11116,7 +11184,7 @@ function WorkbenchHostDock({
|
|
|
11116
11184
|
(current) => current.canScrollBackward === nextState.canScrollBackward && current.canScrollForward === nextState.canScrollForward && current.hasOverflow === nextState.hasOverflow ? current : nextState
|
|
11117
11185
|
);
|
|
11118
11186
|
}, [dockPlacement, dockWidth]);
|
|
11119
|
-
|
|
11187
|
+
useLayoutEffect7(() => {
|
|
11120
11188
|
const element = dockItemsRef.current;
|
|
11121
11189
|
if (!element || typeof window === "undefined") {
|
|
11122
11190
|
return void 0;
|
|
@@ -11234,7 +11302,7 @@ function WorkbenchHostDock({
|
|
|
11234
11302
|
},
|
|
11235
11303
|
[]
|
|
11236
11304
|
);
|
|
11237
|
-
const captureMinimizedNodePreview =
|
|
11305
|
+
const captureMinimizedNodePreview = useCallback12(
|
|
11238
11306
|
async (node) => {
|
|
11239
11307
|
const minimizedDock = nodeDefinitions.get(node.data.typeId)?.window?.minimizedDock;
|
|
11240
11308
|
const capturePreview = minimizedDock?.kind === "snapshot" ? minimizedDock.capturePreview : void 0;
|
|
@@ -11265,7 +11333,7 @@ function WorkbenchHostDock({
|
|
|
11265
11333
|
workspaceId
|
|
11266
11334
|
]
|
|
11267
11335
|
);
|
|
11268
|
-
const provideMinimizedNodePreview =
|
|
11336
|
+
const provideMinimizedNodePreview = useCallback12(
|
|
11269
11337
|
(node) => {
|
|
11270
11338
|
const minimizedDock = nodeDefinitions.get(node.data.typeId)?.window?.minimizedDock;
|
|
11271
11339
|
if (minimizedDock?.kind !== "component") {
|
|
@@ -11294,7 +11362,7 @@ function WorkbenchHostDock({
|
|
|
11294
11362
|
workspaceId
|
|
11295
11363
|
]
|
|
11296
11364
|
);
|
|
11297
|
-
const provideMinimizedNodePreviewForNode =
|
|
11365
|
+
const provideMinimizedNodePreviewForNode = useCallback12(
|
|
11298
11366
|
(node) => {
|
|
11299
11367
|
const minimizedDock = nodeDefinitions.get(node.data.typeId)?.window?.minimizedDock;
|
|
11300
11368
|
return minimizedDock?.kind === "component" ? provideMinimizedNodePreview : void 0;
|
|
@@ -11330,7 +11398,7 @@ function WorkbenchHostDock({
|
|
|
11330
11398
|
top: isVertical ? delta : 0
|
|
11331
11399
|
});
|
|
11332
11400
|
};
|
|
11333
|
-
const registerDockSlot =
|
|
11401
|
+
const registerDockSlot = useCallback12((anchorKey) => {
|
|
11334
11402
|
const existing = dockSlotRefCallbacksRef.current.get(anchorKey);
|
|
11335
11403
|
if (existing) {
|
|
11336
11404
|
return existing;
|
|
@@ -11351,7 +11419,7 @@ function WorkbenchHostDock({
|
|
|
11351
11419
|
dockSlotRefCallbacksRef.current.set(anchorKey, callback);
|
|
11352
11420
|
return callback;
|
|
11353
11421
|
}, []);
|
|
11354
|
-
const runDockEntryAction =
|
|
11422
|
+
const runDockEntryAction = useCallback12(
|
|
11355
11423
|
(entryId, actionId) => {
|
|
11356
11424
|
const actionKey = dockActionKey(entryId, actionId);
|
|
11357
11425
|
if (pendingActionKeys.has(actionKey)) {
|
|
@@ -12568,9 +12636,9 @@ function WorkbenchHostDockFrozenComponentPreview({
|
|
|
12568
12636
|
className,
|
|
12569
12637
|
preview
|
|
12570
12638
|
}) {
|
|
12571
|
-
const sourceRef =
|
|
12639
|
+
const sourceRef = useRef9(null);
|
|
12572
12640
|
const [frozenMarkup, setFrozenMarkup] = useState8(null);
|
|
12573
|
-
|
|
12641
|
+
useLayoutEffect7(() => {
|
|
12574
12642
|
if (frozenMarkup !== null) {
|
|
12575
12643
|
return;
|
|
12576
12644
|
}
|
|
@@ -12681,7 +12749,7 @@ function WorkbenchHostDockHoverPanel({
|
|
|
12681
12749
|
setPendingActionKeys,
|
|
12682
12750
|
state
|
|
12683
12751
|
}) {
|
|
12684
|
-
const lastPointerActionAtRef =
|
|
12752
|
+
const lastPointerActionAtRef = useRef9(/* @__PURE__ */ new Map());
|
|
12685
12753
|
if (!entry) {
|
|
12686
12754
|
return null;
|
|
12687
12755
|
}
|
|
@@ -12966,8 +13034,8 @@ function resolveDockPresenceSettleMs(items) {
|
|
|
12966
13034
|
return dockPresenceAnimationMs;
|
|
12967
13035
|
}
|
|
12968
13036
|
function useDockPresenceItems(items, shouldAnimateMinimizedDockEnter) {
|
|
12969
|
-
const latestItemsByKey =
|
|
12970
|
-
const shouldAnimateMinimizedDockEnterRef =
|
|
13037
|
+
const latestItemsByKey = useRef9(/* @__PURE__ */ new Map());
|
|
13038
|
+
const shouldAnimateMinimizedDockEnterRef = useRef9(
|
|
12971
13039
|
shouldAnimateMinimizedDockEnter
|
|
12972
13040
|
);
|
|
12973
13041
|
latestItemsByKey.current = new Map(items.map((item) => [item.key, item]));
|
|
@@ -12980,7 +13048,7 @@ function useDockPresenceItems(items, shouldAnimateMinimizedDockEnter) {
|
|
|
12980
13048
|
presence: "present"
|
|
12981
13049
|
}))
|
|
12982
13050
|
);
|
|
12983
|
-
const initialized =
|
|
13051
|
+
const initialized = useRef9(false);
|
|
12984
13052
|
useEffect10(() => {
|
|
12985
13053
|
let nextSettleMs = dockPresenceAnimationMs;
|
|
12986
13054
|
setPresentItems((current) => {
|
|
@@ -13022,7 +13090,7 @@ function useDockWallpaperTones({
|
|
|
13022
13090
|
const [tones, setTones] = useState8(
|
|
13023
13091
|
() => /* @__PURE__ */ new Map()
|
|
13024
13092
|
);
|
|
13025
|
-
|
|
13093
|
+
useLayoutEffect7(() => {
|
|
13026
13094
|
if (typeof window === "undefined") {
|
|
13027
13095
|
return void 0;
|
|
13028
13096
|
}
|
|
@@ -13209,8 +13277,8 @@ function dockWallpaperToneMapsEqual(left, right) {
|
|
|
13209
13277
|
var DOCK_BOUNCE_MS = 600;
|
|
13210
13278
|
var DOCK_ENTRY_CLICK_THROTTLE_MS = DOCK_BOUNCE_MS;
|
|
13211
13279
|
function useDockBounce(slotRefs) {
|
|
13212
|
-
const timeoutsRef =
|
|
13213
|
-
const clearDockBounce =
|
|
13280
|
+
const timeoutsRef = useRef9(/* @__PURE__ */ new Map());
|
|
13281
|
+
const clearDockBounce = useCallback12(
|
|
13214
13282
|
(anchorKey) => {
|
|
13215
13283
|
const timeout = timeoutsRef.current.get(anchorKey);
|
|
13216
13284
|
const slotElement = slotRefs.current.get(anchorKey);
|
|
@@ -13233,7 +13301,7 @@ function useDockBounce(slotRefs) {
|
|
|
13233
13301
|
},
|
|
13234
13302
|
[clearDockBounce]
|
|
13235
13303
|
);
|
|
13236
|
-
const triggerDockBounce =
|
|
13304
|
+
const triggerDockBounce = useCallback12(
|
|
13237
13305
|
(anchorKey) => {
|
|
13238
13306
|
const shouldRestartAnimation = clearDockBounce(anchorKey);
|
|
13239
13307
|
const slotElement = slotRefs.current.get(anchorKey);
|
|
@@ -13313,6 +13381,9 @@ function createWorkbenchHostNodeHeaderWindowActions(context, input = {}) {
|
|
|
13313
13381
|
focus() {
|
|
13314
13382
|
context.controller.commands.focusNode(context.node.id);
|
|
13315
13383
|
},
|
|
13384
|
+
getFrame() {
|
|
13385
|
+
return context.controller.getSnapshot().nodes.find((node) => node.id === context.node.id)?.frame ?? context.node.frame;
|
|
13386
|
+
},
|
|
13316
13387
|
minimize() {
|
|
13317
13388
|
context.genie.minimizeNodeToAnchor(
|
|
13318
13389
|
context.node.id,
|
|
@@ -13390,7 +13461,9 @@ function createWorkbenchHostNodeHeaderContext({
|
|
|
13390
13461
|
externalWorkspaceState: resolvedExternalState.externalWorkspaceState,
|
|
13391
13462
|
instanceId: context.node.data.instanceId,
|
|
13392
13463
|
instanceKey: context.node.data.instanceKey ?? null,
|
|
13393
|
-
|
|
13464
|
+
isDragging: context.isDragging,
|
|
13465
|
+
isFocused: context.isFocused,
|
|
13466
|
+
isResizing: context.isResizing,
|
|
13394
13467
|
node: context.node,
|
|
13395
13468
|
surfaceSize: context.surfaceSize,
|
|
13396
13469
|
windowActions: createWorkbenchHostNodeHeaderWindowActions(context, {
|
|
@@ -13438,7 +13511,7 @@ function WorkbenchHostWindowActions({
|
|
|
13438
13511
|
// src/host/useWorkbenchHostSurfaceRenderers.tsx
|
|
13439
13512
|
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
13440
13513
|
function useWorkbenchHostSurfaceRenderers(input) {
|
|
13441
|
-
const renderBottomChrome =
|
|
13514
|
+
const renderBottomChrome = useMemo10(() => {
|
|
13442
13515
|
const renderChrome = input.renderBottomChrome;
|
|
13443
13516
|
return renderChrome ? () => /* @__PURE__ */ jsx14(
|
|
13444
13517
|
WorkbenchHostSurfaceRenderErrorBoundary,
|
|
@@ -13466,7 +13539,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13466
13539
|
input.renderBottomChrome,
|
|
13467
13540
|
input.workspaceId
|
|
13468
13541
|
]);
|
|
13469
|
-
const renderTopChrome =
|
|
13542
|
+
const renderTopChrome = useMemo10(() => {
|
|
13470
13543
|
const renderChrome = input.renderTopChrome;
|
|
13471
13544
|
return renderChrome ? () => /* @__PURE__ */ jsx14(
|
|
13472
13545
|
WorkbenchHostSurfaceRenderErrorBoundary,
|
|
@@ -13494,7 +13567,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13494
13567
|
input.renderTopChrome,
|
|
13495
13568
|
input.workspaceId
|
|
13496
13569
|
]);
|
|
13497
|
-
const captureNodePreviewImage =
|
|
13570
|
+
const captureNodePreviewImage = useCallback13(
|
|
13498
13571
|
async (node) => {
|
|
13499
13572
|
const definition = input.nodeDefinitionByType.get(node.data.typeId);
|
|
13500
13573
|
const minimizedDock = definition?.window?.minimizedDock;
|
|
@@ -13527,7 +13600,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13527
13600
|
input.workspaceId
|
|
13528
13601
|
]
|
|
13529
13602
|
);
|
|
13530
|
-
const renderDock =
|
|
13603
|
+
const renderDock = useCallback13(
|
|
13531
13604
|
(context) => /* @__PURE__ */ jsx14(
|
|
13532
13605
|
WorkbenchHostSurfaceRenderErrorBoundary,
|
|
13533
13606
|
{
|
|
@@ -13579,7 +13652,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13579
13652
|
input.workspaceId
|
|
13580
13653
|
]
|
|
13581
13654
|
);
|
|
13582
|
-
const renderNode =
|
|
13655
|
+
const renderNode = useCallback13(
|
|
13583
13656
|
(context) => {
|
|
13584
13657
|
const definition = input.nodeDefinitionByType.get(
|
|
13585
13658
|
context.node.data.typeId
|
|
@@ -13607,7 +13680,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13607
13680
|
input.workspaceId
|
|
13608
13681
|
]
|
|
13609
13682
|
);
|
|
13610
|
-
const renderWindowActions =
|
|
13683
|
+
const renderWindowActions = useCallback13(
|
|
13611
13684
|
(context) => /* @__PURE__ */ jsx14(
|
|
13612
13685
|
WorkbenchHostWindowActions,
|
|
13613
13686
|
{
|
|
@@ -13619,7 +13692,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13619
13692
|
),
|
|
13620
13693
|
[input.hostI18n, input.hostSession, input.nodeDefinitionByType]
|
|
13621
13694
|
);
|
|
13622
|
-
const renderWindowHeader =
|
|
13695
|
+
const renderWindowHeader = useCallback13(
|
|
13623
13696
|
(context) => {
|
|
13624
13697
|
const definition = input.nodeDefinitionByType.get(
|
|
13625
13698
|
context.node.data.typeId
|
|
@@ -13628,7 +13701,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13628
13701
|
return null;
|
|
13629
13702
|
}
|
|
13630
13703
|
return /* @__PURE__ */ jsx14(
|
|
13631
|
-
|
|
13704
|
+
MemoizedWorkbenchHostNodeHeaderStateBridge,
|
|
13632
13705
|
{
|
|
13633
13706
|
context,
|
|
13634
13707
|
definition,
|
|
@@ -13645,21 +13718,21 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13645
13718
|
input.workspaceId
|
|
13646
13719
|
]
|
|
13647
13720
|
);
|
|
13648
|
-
const shouldKeepMinimizedNodeMounted =
|
|
13721
|
+
const shouldKeepMinimizedNodeMounted = useCallback13(
|
|
13649
13722
|
(node) => {
|
|
13650
13723
|
const capability = input.nodeDefinitionByType.get(node.data.typeId)?.window?.keepMountedWhenMinimized;
|
|
13651
13724
|
return typeof capability === "function" ? capability(node) : capability === true;
|
|
13652
13725
|
},
|
|
13653
13726
|
[input.nodeDefinitionByType]
|
|
13654
13727
|
);
|
|
13655
|
-
const shouldCaptureNodePreviewImage =
|
|
13728
|
+
const shouldCaptureNodePreviewImage = useCallback13(
|
|
13656
13729
|
(node) => {
|
|
13657
13730
|
const minimizedDock = input.nodeDefinitionByType.get(node.data.typeId)?.window?.minimizedDock;
|
|
13658
13731
|
return minimizedDock?.kind !== "component";
|
|
13659
13732
|
},
|
|
13660
13733
|
[input.nodeDefinitionByType]
|
|
13661
13734
|
);
|
|
13662
|
-
const renderNodeGeniePreview =
|
|
13735
|
+
const renderNodeGeniePreview = useCallback13(
|
|
13663
13736
|
(node, {
|
|
13664
13737
|
previewViewport
|
|
13665
13738
|
}) => {
|
|
@@ -13693,7 +13766,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13693
13766
|
input.workspaceId
|
|
13694
13767
|
]
|
|
13695
13768
|
);
|
|
13696
|
-
const resolveDockAnchorKey =
|
|
13769
|
+
const resolveDockAnchorKey = useCallback13(
|
|
13697
13770
|
(node) => {
|
|
13698
13771
|
if (node.isMinimized && isWorkbenchMinimizedDockEligibleNode({
|
|
13699
13772
|
node,
|
|
@@ -13726,7 +13799,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13726
13799
|
},
|
|
13727
13800
|
[input.dockEntries, input.hostSession, input.nodeDefinitionByType]
|
|
13728
13801
|
);
|
|
13729
|
-
const resolveDockPreviewCacheKey2 =
|
|
13802
|
+
const resolveDockPreviewCacheKey2 = useCallback13(
|
|
13730
13803
|
(node) => ({
|
|
13731
13804
|
instanceId: node.data.instanceId,
|
|
13732
13805
|
instanceKey: node.data.instanceKey ?? null,
|
|
@@ -13736,16 +13809,16 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
13736
13809
|
}),
|
|
13737
13810
|
[input.workspaceId]
|
|
13738
13811
|
);
|
|
13739
|
-
const windowChromeMode =
|
|
13812
|
+
const windowChromeMode = useCallback13(
|
|
13740
13813
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.renderHeader ? "custom-header" : "system",
|
|
13741
13814
|
[input.nodeDefinitionByType]
|
|
13742
13815
|
);
|
|
13743
|
-
const resolveWindowZIndex =
|
|
13744
|
-
const resolveWindowSurfaceLayer =
|
|
13816
|
+
const resolveWindowZIndex = useCallback13(({ baseZIndex }) => baseZIndex, []);
|
|
13817
|
+
const resolveWindowSurfaceLayer = useCallback13(
|
|
13745
13818
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.window?.surfaceLayer ?? "default",
|
|
13746
13819
|
[input.nodeDefinitionByType]
|
|
13747
13820
|
);
|
|
13748
|
-
const resolveFullscreenHeaderMode =
|
|
13821
|
+
const resolveFullscreenHeaderMode = useCallback13(
|
|
13749
13822
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.window?.fullscreenHeaderMode,
|
|
13750
13823
|
[input.nodeDefinitionByType]
|
|
13751
13824
|
);
|
|
@@ -13782,7 +13855,7 @@ function WorkbenchHostNodeRenderer(input) {
|
|
|
13782
13855
|
host: input.host,
|
|
13783
13856
|
workspaceId: input.workspaceId
|
|
13784
13857
|
});
|
|
13785
|
-
const resetKey =
|
|
13858
|
+
const resetKey = useMemo10(
|
|
13786
13859
|
() => [
|
|
13787
13860
|
input.context.node.id,
|
|
13788
13861
|
input.context.node.data.typeId,
|
|
@@ -13817,23 +13890,65 @@ function WorkbenchHostNodeRenderer(input) {
|
|
|
13817
13890
|
}
|
|
13818
13891
|
);
|
|
13819
13892
|
}
|
|
13820
|
-
function
|
|
13893
|
+
function WorkbenchHostNodeHeaderStateBridge(input) {
|
|
13821
13894
|
const externalState = useWorkbenchHostExternalState({
|
|
13822
13895
|
externalStateSource: input.externalStateSource,
|
|
13823
13896
|
node: input.context.node,
|
|
13824
13897
|
workspaceId: input.workspaceId
|
|
13825
13898
|
});
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13899
|
+
const context = createWorkbenchHostNodeHeaderContext({
|
|
13900
|
+
context: input.context,
|
|
13901
|
+
definition: input.definition,
|
|
13902
|
+
externalState,
|
|
13903
|
+
externalStateSource: input.externalStateSource,
|
|
13904
|
+
host: input.host,
|
|
13905
|
+
workspaceId: input.workspaceId
|
|
13906
|
+
});
|
|
13907
|
+
const getFrameRenderKey = input.definition.getHeaderFrameRenderKey;
|
|
13908
|
+
return /* @__PURE__ */ jsx14(
|
|
13909
|
+
MemoizedWorkbenchHostNodeHeaderRenderer,
|
|
13910
|
+
{
|
|
13911
|
+
context,
|
|
13829
13912
|
definition: input.definition,
|
|
13830
|
-
|
|
13831
|
-
|
|
13913
|
+
frameRenderKey: getFrameRenderKey?.(context) ?? null,
|
|
13914
|
+
hasFrameRenderKey: getFrameRenderKey !== void 0,
|
|
13832
13915
|
host: input.host,
|
|
13833
|
-
|
|
13834
|
-
}
|
|
13916
|
+
renderRevision: input.context.renderRevision
|
|
13917
|
+
}
|
|
13835
13918
|
);
|
|
13836
13919
|
}
|
|
13920
|
+
function areWorkbenchHostNodeHeaderStateBridgePropsEqual(previous, next) {
|
|
13921
|
+
return previous.definition === next.definition && previous.externalStateSource === next.externalStateSource && previous.host === next.host && previous.workspaceId === next.workspaceId && previous.context.controller === next.context.controller && previous.context.isDragging === next.context.isDragging && previous.context.isFocused === next.context.isFocused && previous.context.isResizing === next.context.isResizing && previous.context.node === next.context.node && previous.context.renderRevision === next.context.renderRevision && previous.context.surfaceSize.width === next.context.surfaceSize.width && previous.context.surfaceSize.height === next.context.surfaceSize.height;
|
|
13922
|
+
}
|
|
13923
|
+
var MemoizedWorkbenchHostNodeHeaderStateBridge = memo2(
|
|
13924
|
+
WorkbenchHostNodeHeaderStateBridge,
|
|
13925
|
+
areWorkbenchHostNodeHeaderStateBridgePropsEqual
|
|
13926
|
+
);
|
|
13927
|
+
function WorkbenchHostNodeHeaderRenderer(input) {
|
|
13928
|
+
return input.definition.renderHeader?.(input.context);
|
|
13929
|
+
}
|
|
13930
|
+
function areWorkbenchHostNodeHeaderRendererPropsEqual(previous, next) {
|
|
13931
|
+
if (previous.definition !== next.definition || previous.host !== next.host || previous.renderRevision !== next.renderRevision || previous.context.activation !== next.context.activation || previous.context.externalNodeState !== next.context.externalNodeState || previous.context.externalWorkspaceState !== next.context.externalWorkspaceState || previous.context.isDragging !== next.context.isDragging || previous.context.isFocused !== next.context.isFocused || previous.context.isResizing !== next.context.isResizing) {
|
|
13932
|
+
return false;
|
|
13933
|
+
}
|
|
13934
|
+
const previousNode = previous.context.node;
|
|
13935
|
+
const nextNode = next.context.node;
|
|
13936
|
+
const nonFrameInputsEqual = previous.context.surfaceSize.width === next.context.surfaceSize.width && previous.context.surfaceSize.height === next.context.surfaceSize.height && previousNode.id === nextNode.id && previousNode.kind === nextNode.kind && previousNode.title === nextNode.title && previousNode.displayMode === nextNode.displayMode && previousNode.restoreFrame === nextNode.restoreFrame && previousNode.isMinimized === nextNode.isMinimized && previousNode.minimizedAtUnixMs === nextNode.minimizedAtUnixMs && previousNode.sizeConstraints === nextNode.sizeConstraints && previousNode.data === nextNode.data;
|
|
13937
|
+
if (!nonFrameInputsEqual) {
|
|
13938
|
+
return false;
|
|
13939
|
+
}
|
|
13940
|
+
if ((next.context.isDragging || next.context.isResizing) && next.hasFrameRenderKey) {
|
|
13941
|
+
return Object.is(previous.frameRenderKey, next.frameRenderKey);
|
|
13942
|
+
}
|
|
13943
|
+
return areWorkbenchFramesEqual(previousNode.frame, nextNode.frame);
|
|
13944
|
+
}
|
|
13945
|
+
function areWorkbenchFramesEqual(previous, next) {
|
|
13946
|
+
return previous.x === next.x && previous.y === next.y && previous.width === next.width && previous.height === next.height;
|
|
13947
|
+
}
|
|
13948
|
+
var MemoizedWorkbenchHostNodeHeaderRenderer = memo2(
|
|
13949
|
+
WorkbenchHostNodeHeaderRenderer,
|
|
13950
|
+
areWorkbenchHostNodeHeaderRendererPropsEqual
|
|
13951
|
+
);
|
|
13837
13952
|
var WorkbenchHostSurfaceRenderErrorBoundary = class extends Component {
|
|
13838
13953
|
state = {
|
|
13839
13954
|
hasError: false
|
|
@@ -14035,7 +14150,7 @@ function WorkbenchHost({
|
|
|
14035
14150
|
windowManagement,
|
|
14036
14151
|
workspaceId
|
|
14037
14152
|
}) {
|
|
14038
|
-
const hostRuntimeConfig =
|
|
14153
|
+
const hostRuntimeConfig = useMemo11(
|
|
14039
14154
|
() => resolveWorkbenchHostRuntimeConfig({
|
|
14040
14155
|
contributions,
|
|
14041
14156
|
externalStateSource,
|
|
@@ -14051,7 +14166,7 @@ function WorkbenchHost({
|
|
|
14051
14166
|
onNodeCloseRequest
|
|
14052
14167
|
]
|
|
14053
14168
|
);
|
|
14054
|
-
const hostDockEntries =
|
|
14169
|
+
const hostDockEntries = useMemo11(
|
|
14055
14170
|
() => resolveWorkbenchHostDockEntries({
|
|
14056
14171
|
contributions,
|
|
14057
14172
|
dockEntryPresentationOverrides,
|