@tutti-os/workbench-surface 0.0.233 → 0.0.234
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 +12 -4
- package/dist/index.js +370 -212
- package/dist/index.js.map +1 -1
- package/dist/styles/workbench.css +10 -6
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3093,16 +3093,18 @@ function WorkbenchWindowFrame({
|
|
|
3093
3093
|
"data-presentation-mode": presentationMode ?? "default",
|
|
3094
3094
|
"data-presentation-visibility": isPresentationHidden ? "hidden" : "visible",
|
|
3095
3095
|
"data-slot": "viewport-menu-boundary",
|
|
3096
|
+
"data-viewport-menu-portal-target": "body",
|
|
3096
3097
|
"data-workbench-node-type-id": resolveWorkbenchNodeTypeId(node.data),
|
|
3097
3098
|
"data-workbench-window-id": node.id,
|
|
3098
3099
|
"data-window-drag-state": isDragging ? "dragging" : "idle",
|
|
3099
3100
|
"data-window-resize-state": isResizing ? "resizing" : "idle",
|
|
3100
3101
|
style: {
|
|
3101
3102
|
height: node.frame.height,
|
|
3102
|
-
left:
|
|
3103
|
-
top:
|
|
3103
|
+
left: 0,
|
|
3104
|
+
top: 0,
|
|
3104
3105
|
transform: shellTransform,
|
|
3105
3106
|
transformOrigin: "top left",
|
|
3107
|
+
translate: `${node.frame.x}px ${node.frame.y}px`,
|
|
3106
3108
|
width: node.frame.width,
|
|
3107
3109
|
zIndex
|
|
3108
3110
|
},
|
|
@@ -8800,7 +8802,7 @@ function logWorkbenchHostDebug(event, debugDiagnostics, payload) {
|
|
|
8800
8802
|
}
|
|
8801
8803
|
|
|
8802
8804
|
// src/host/useWorkbenchHostSurfaceRenderers.tsx
|
|
8803
|
-
import { Component, memo as
|
|
8805
|
+
import { Component, memo as memo3, useCallback as useCallback13, useMemo as useMemo10 } from "react";
|
|
8804
8806
|
|
|
8805
8807
|
// src/host/WorkbenchHostDock.tsx
|
|
8806
8808
|
import {
|
|
@@ -8949,6 +8951,35 @@ function isWorkbenchDockEntryBlocked(entry) {
|
|
|
8949
8951
|
import { useCallback as useCallback10, useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
8950
8952
|
|
|
8951
8953
|
// src/host/dockMagnificationBounds.ts
|
|
8954
|
+
var DOCK_MAGNIFICATION_CROSS_AXIS_PADDING = 8;
|
|
8955
|
+
function resolveDockMagnificationHitBounds(slotRects, dockPlacement, crossAxisPadding = DOCK_MAGNIFICATION_CROSS_AXIS_PADDING) {
|
|
8956
|
+
if (slotRects.length === 0) {
|
|
8957
|
+
return null;
|
|
8958
|
+
}
|
|
8959
|
+
let mainStart = Number.POSITIVE_INFINITY;
|
|
8960
|
+
let mainEnd = Number.NEGATIVE_INFINITY;
|
|
8961
|
+
let crossStart = Number.POSITIVE_INFINITY;
|
|
8962
|
+
let crossEnd = Number.NEGATIVE_INFINITY;
|
|
8963
|
+
for (const rect of slotRects) {
|
|
8964
|
+
if (dockPlacement === "left") {
|
|
8965
|
+
mainStart = Math.min(mainStart, rect.top);
|
|
8966
|
+
mainEnd = Math.max(mainEnd, rect.bottom);
|
|
8967
|
+
crossStart = Math.min(crossStart, rect.left);
|
|
8968
|
+
crossEnd = Math.max(crossEnd, rect.right);
|
|
8969
|
+
} else {
|
|
8970
|
+
mainStart = Math.min(mainStart, rect.left);
|
|
8971
|
+
mainEnd = Math.max(mainEnd, rect.right);
|
|
8972
|
+
crossStart = Math.min(crossStart, rect.top);
|
|
8973
|
+
crossEnd = Math.max(crossEnd, rect.bottom);
|
|
8974
|
+
}
|
|
8975
|
+
}
|
|
8976
|
+
return {
|
|
8977
|
+
crossEnd: crossEnd + crossAxisPadding,
|
|
8978
|
+
crossStart: crossStart - crossAxisPadding,
|
|
8979
|
+
mainEnd,
|
|
8980
|
+
mainStart
|
|
8981
|
+
};
|
|
8982
|
+
}
|
|
8952
8983
|
function resolveDockMagnificationViewportBounds(viewportRect, dockPlacement) {
|
|
8953
8984
|
return dockPlacement === "left" ? {
|
|
8954
8985
|
crossEnd: viewportRect.right,
|
|
@@ -9034,27 +9065,10 @@ function isDockMagnificationPointInsideSlotRect({
|
|
|
9034
9065
|
return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
|
|
9035
9066
|
}
|
|
9036
9067
|
|
|
9037
|
-
// src/host/
|
|
9068
|
+
// src/host/dockMagnificationGeometry.ts
|
|
9038
9069
|
var DOCK_ICON_BASE_SIZE = 43.2;
|
|
9039
9070
|
var DOCK_ICON_PEAK_SIZE = DOCK_ICON_BASE_SIZE * 1.7;
|
|
9040
9071
|
var DOCK_MAGNIFICATION_HALF_RANGE = DOCK_ICON_BASE_SIZE * 2.4;
|
|
9041
|
-
var DOCK_MAGNIFICATION_SPRING_MASS = 0.1;
|
|
9042
|
-
var DOCK_MAGNIFICATION_SPRING_STIFFNESS = 200;
|
|
9043
|
-
var DOCK_MAGNIFICATION_SPRING_DAMPING = 14;
|
|
9044
|
-
var MAGNIFICATION_SETTLE_EPSILON = 0.2;
|
|
9045
|
-
var MAGNIFICATION_SIZE_EPSILON = 0.2;
|
|
9046
|
-
var MAX_MAGNIFICATION_STEP_SECONDS = 1 / 30;
|
|
9047
|
-
var MAGNIFICATION_INFLUENCE_PADDING = 8;
|
|
9048
|
-
var DOCK_MAGNIFICATION_ENTRY_RAMP_MS = 90;
|
|
9049
|
-
var DOCK_MAGNIFICATION_CROSS_AXIS_PADDING = 8;
|
|
9050
|
-
var DOCK_MAGNIFICATION_MAIN_AXIS_EDGE_PADDING = DOCK_ICON_BASE_SIZE / 2;
|
|
9051
|
-
var DOCK_MAGNIFICATION_AMBIENT_EDGE_RANGE = 180;
|
|
9052
|
-
var DOCK_MAGNIFICATION_AMBIENT_VIEWPORT_PADDING = 8;
|
|
9053
|
-
var dockMagnificationShellBySlot = /* @__PURE__ */ new WeakMap();
|
|
9054
|
-
var globalPointerListenerOptions = {
|
|
9055
|
-
capture: true,
|
|
9056
|
-
passive: true
|
|
9057
|
-
};
|
|
9058
9072
|
function mapDistanceToTargetSize(distance, baseSize = DOCK_ICON_BASE_SIZE, peakSize = DOCK_ICON_PEAK_SIZE, halfRange = DOCK_MAGNIFICATION_HALF_RANGE) {
|
|
9059
9073
|
const absoluteDistance = Math.abs(distance);
|
|
9060
9074
|
if (absoluteDistance >= halfRange) {
|
|
@@ -9067,34 +9081,65 @@ function applyDockMagnificationEntryRamp(targetSize, baseSize, progress) {
|
|
|
9067
9081
|
const clampedProgress = Math.min(1, Math.max(0, progress));
|
|
9068
9082
|
return baseSize + (targetSize - baseSize) * clampedProgress;
|
|
9069
9083
|
}
|
|
9070
|
-
function
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
9084
|
+
function resolveDockMagnificationSlotCenter(rect, dockPlacement, baseSize = DOCK_ICON_BASE_SIZE) {
|
|
9085
|
+
return dockPlacement === "left" ? rect.top + baseSize / 2 : rect.left + baseSize / 2;
|
|
9086
|
+
}
|
|
9087
|
+
function projectDockMagnificationGeometry({
|
|
9088
|
+
appliedSizes,
|
|
9089
|
+
dockPlacement,
|
|
9090
|
+
mainAxisStartAligned,
|
|
9091
|
+
order,
|
|
9092
|
+
restRects
|
|
9093
|
+
}) {
|
|
9094
|
+
const growthByAnchorKey = /* @__PURE__ */ new Map();
|
|
9095
|
+
let totalGrowth = 0;
|
|
9096
|
+
for (const anchorKey of order) {
|
|
9097
|
+
const restRect = restRects.get(anchorKey);
|
|
9098
|
+
if (!restRect) {
|
|
9099
|
+
continue;
|
|
9100
|
+
}
|
|
9101
|
+
const restMainSize = dockPlacement === "left" ? restRect.bottom - restRect.top : restRect.right - restRect.left;
|
|
9102
|
+
const growth = (appliedSizes.get(anchorKey) ?? restMainSize) - restMainSize;
|
|
9103
|
+
growthByAnchorKey.set(anchorKey, growth);
|
|
9104
|
+
totalGrowth += growth;
|
|
9105
|
+
}
|
|
9106
|
+
let mainAxisOffset = mainAxisStartAligned ? 0 : -totalGrowth / 2;
|
|
9107
|
+
const centers = /* @__PURE__ */ new Map();
|
|
9108
|
+
const slotRects = [];
|
|
9109
|
+
for (const anchorKey of order) {
|
|
9110
|
+
const restRect = restRects.get(anchorKey);
|
|
9111
|
+
if (!restRect) {
|
|
9112
|
+
continue;
|
|
9089
9113
|
}
|
|
9114
|
+
const growth = growthByAnchorKey.get(anchorKey) ?? 0;
|
|
9115
|
+
const restMainSize = dockPlacement === "left" ? restRect.bottom - restRect.top : restRect.right - restRect.left;
|
|
9116
|
+
const size = restMainSize + growth;
|
|
9117
|
+
const rect = dockPlacement === "left" ? {
|
|
9118
|
+
bottom: restRect.top + mainAxisOffset + size,
|
|
9119
|
+
left: (restRect.left + restRect.right - size) / 2,
|
|
9120
|
+
right: (restRect.left + restRect.right + size) / 2,
|
|
9121
|
+
top: restRect.top + mainAxisOffset
|
|
9122
|
+
} : {
|
|
9123
|
+
bottom: restRect.bottom,
|
|
9124
|
+
left: restRect.left + mainAxisOffset,
|
|
9125
|
+
right: restRect.left + mainAxisOffset + size,
|
|
9126
|
+
top: restRect.bottom - size
|
|
9127
|
+
};
|
|
9128
|
+
slotRects.push(rect);
|
|
9129
|
+
centers.set(
|
|
9130
|
+
anchorKey,
|
|
9131
|
+
resolveDockMagnificationSlotCenter(rect, dockPlacement)
|
|
9132
|
+
);
|
|
9133
|
+
mainAxisOffset += growth;
|
|
9090
9134
|
}
|
|
9091
|
-
return {
|
|
9092
|
-
crossEnd: crossEnd + crossAxisPadding,
|
|
9093
|
-
crossStart: crossStart - crossAxisPadding,
|
|
9094
|
-
mainEnd,
|
|
9095
|
-
mainStart
|
|
9096
|
-
};
|
|
9135
|
+
return { centers, slotRects };
|
|
9097
9136
|
}
|
|
9137
|
+
|
|
9138
|
+
// src/host/dockMagnificationPointerTracker.ts
|
|
9139
|
+
var dockMagnificationPointerListenerOptions = {
|
|
9140
|
+
capture: true,
|
|
9141
|
+
passive: true
|
|
9142
|
+
};
|
|
9098
9143
|
function createDockMagnificationGlobalPointerTracker({
|
|
9099
9144
|
blurTarget,
|
|
9100
9145
|
onPointerCancel,
|
|
@@ -9118,12 +9163,12 @@ function createDockMagnificationGlobalPointerTracker({
|
|
|
9118
9163
|
pointerTarget.addEventListener(
|
|
9119
9164
|
"pointermove",
|
|
9120
9165
|
handlePointerMove,
|
|
9121
|
-
|
|
9166
|
+
dockMagnificationPointerListenerOptions
|
|
9122
9167
|
);
|
|
9123
9168
|
pointerTarget.addEventListener(
|
|
9124
9169
|
"pointercancel",
|
|
9125
9170
|
handlePointerCancel,
|
|
9126
|
-
|
|
9171
|
+
dockMagnificationPointerListenerOptions
|
|
9127
9172
|
);
|
|
9128
9173
|
blurTarget?.addEventListener("blur", handlePointerCancel);
|
|
9129
9174
|
};
|
|
@@ -9135,12 +9180,12 @@ function createDockMagnificationGlobalPointerTracker({
|
|
|
9135
9180
|
pointerTarget.removeEventListener(
|
|
9136
9181
|
"pointermove",
|
|
9137
9182
|
handlePointerMove,
|
|
9138
|
-
|
|
9183
|
+
dockMagnificationPointerListenerOptions
|
|
9139
9184
|
);
|
|
9140
9185
|
pointerTarget.removeEventListener(
|
|
9141
9186
|
"pointercancel",
|
|
9142
9187
|
handlePointerCancel,
|
|
9143
|
-
|
|
9188
|
+
dockMagnificationPointerListenerOptions
|
|
9144
9189
|
);
|
|
9145
9190
|
blurTarget?.removeEventListener("blur", handlePointerCancel);
|
|
9146
9191
|
};
|
|
@@ -9150,10 +9195,13 @@ function createDockMagnificationGlobalPointerTracker({
|
|
|
9150
9195
|
stop
|
|
9151
9196
|
};
|
|
9152
9197
|
}
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9198
|
+
|
|
9199
|
+
// src/host/dockMagnificationSpring.ts
|
|
9200
|
+
var DOCK_MAGNIFICATION_SPRING_MASS = 0.1;
|
|
9201
|
+
var DOCK_MAGNIFICATION_SPRING_STIFFNESS = 200;
|
|
9202
|
+
var DOCK_MAGNIFICATION_SPRING_DAMPING = 14;
|
|
9156
9203
|
var DOCK_MAGNIFICATION_SPRING_SUBSTEPS = 8;
|
|
9204
|
+
var MAGNIFICATION_SETTLE_EPSILON = 0.2;
|
|
9157
9205
|
function advanceDockMagnificationSpring(current, target, deltaSeconds) {
|
|
9158
9206
|
const subDeltaSeconds = deltaSeconds / DOCK_MAGNIFICATION_SPRING_SUBSTEPS;
|
|
9159
9207
|
let { value, velocity } = current;
|
|
@@ -9168,6 +9216,16 @@ function advanceDockMagnificationSpring(current, target, deltaSeconds) {
|
|
|
9168
9216
|
function isDockMagnificationSpringSettled(spring, target) {
|
|
9169
9217
|
return Math.abs(spring.value - target) <= MAGNIFICATION_SETTLE_EPSILON && Math.abs(spring.velocity) <= MAGNIFICATION_SETTLE_EPSILON;
|
|
9170
9218
|
}
|
|
9219
|
+
|
|
9220
|
+
// src/host/dockMagnification.ts
|
|
9221
|
+
var MAGNIFICATION_SIZE_EPSILON = 0.2;
|
|
9222
|
+
var MAX_MAGNIFICATION_STEP_SECONDS = 1 / 30;
|
|
9223
|
+
var MAGNIFICATION_INFLUENCE_PADDING = 8;
|
|
9224
|
+
var DOCK_MAGNIFICATION_ENTRY_RAMP_MS = 90;
|
|
9225
|
+
var DOCK_MAGNIFICATION_MAIN_AXIS_EDGE_PADDING = DOCK_ICON_BASE_SIZE / 2;
|
|
9226
|
+
var DOCK_MAGNIFICATION_AMBIENT_EDGE_RANGE = 180;
|
|
9227
|
+
var DOCK_MAGNIFICATION_AMBIENT_VIEWPORT_PADDING = 8;
|
|
9228
|
+
var dockMagnificationShellBySlot = /* @__PURE__ */ new WeakMap();
|
|
9171
9229
|
function roundDockMagnificationSize(size) {
|
|
9172
9230
|
return Math.round(size * 10) / 10;
|
|
9173
9231
|
}
|
|
@@ -9274,10 +9332,11 @@ function useDockMagnification({
|
|
|
9274
9332
|
const animationFrameRef = useRef6(null);
|
|
9275
9333
|
const lastFrameTimeRef = useRef6(null);
|
|
9276
9334
|
const entryRampStartedAtRef = useRef6(null);
|
|
9277
|
-
const
|
|
9335
|
+
const centersRef = useRef6(null);
|
|
9278
9336
|
const hitBoundsRef = useRef6(null);
|
|
9279
9337
|
const visibleSlotRectsRef = useRef6(null);
|
|
9280
9338
|
const slotOrderRef = useRef6([]);
|
|
9339
|
+
const geometryBasisRef = useRef6(null);
|
|
9281
9340
|
const magnifyActiveRef = useRef6(false);
|
|
9282
9341
|
const globalPointerTrackerRef = useRef6(null);
|
|
9283
9342
|
const handleGlobalPointerMoveRef = useRef6(() => {
|
|
@@ -9309,23 +9368,51 @@ function useDockMagnification({
|
|
|
9309
9368
|
}
|
|
9310
9369
|
lastFrameTimeRef.current = null;
|
|
9311
9370
|
}, []);
|
|
9312
|
-
const
|
|
9371
|
+
const updateProjectedGeometry = useCallback10(() => {
|
|
9372
|
+
const basis = geometryBasisRef.current;
|
|
9373
|
+
if (!basis) {
|
|
9374
|
+
return;
|
|
9375
|
+
}
|
|
9376
|
+
const appliedSizes = /* @__PURE__ */ new Map();
|
|
9377
|
+
for (const [anchorKey, style] of appliedStylesRef.current) {
|
|
9378
|
+
appliedSizes.set(anchorKey, style.size);
|
|
9379
|
+
}
|
|
9380
|
+
const geometry = projectDockMagnificationGeometry({
|
|
9381
|
+
appliedSizes,
|
|
9382
|
+
dockPlacement,
|
|
9383
|
+
mainAxisStartAligned: basis.mainAxisStartAligned,
|
|
9384
|
+
order: slotOrderRef.current,
|
|
9385
|
+
restRects: basis.slotRects
|
|
9386
|
+
});
|
|
9387
|
+
hitBoundsRef.current = resolveDockMagnificationVisibleHitBounds({
|
|
9388
|
+
dockPlacement,
|
|
9389
|
+
hitBounds: resolveDockMagnificationHitBounds(
|
|
9390
|
+
geometry.slotRects,
|
|
9391
|
+
dockPlacement
|
|
9392
|
+
),
|
|
9393
|
+
mainAxisEdgePadding: DOCK_MAGNIFICATION_MAIN_AXIS_EDGE_PADDING,
|
|
9394
|
+
viewportRect: basis.viewportRect
|
|
9395
|
+
});
|
|
9396
|
+
visibleSlotRectsRef.current = resolveDockMagnificationVisibleSlotRects({
|
|
9397
|
+
slotRects: geometry.slotRects,
|
|
9398
|
+
viewportRect: basis.viewportRect
|
|
9399
|
+
});
|
|
9400
|
+
centersRef.current = geometry.centers;
|
|
9401
|
+
}, [dockPlacement]);
|
|
9402
|
+
const captureBaseGeometry = useCallback10(() => {
|
|
9313
9403
|
const slots = slotRefs.current;
|
|
9314
|
-
const
|
|
9315
|
-
const slotRects = [];
|
|
9404
|
+
const slotRects = /* @__PURE__ */ new Map();
|
|
9316
9405
|
const order = [];
|
|
9317
9406
|
const viewportRect = dockViewportRef.current?.getBoundingClientRect();
|
|
9318
9407
|
for (const [anchorKey, slotElement] of slots) {
|
|
9319
9408
|
order.push(anchorKey);
|
|
9320
9409
|
const rect = slotElement.getBoundingClientRect();
|
|
9321
|
-
slotRects.
|
|
9410
|
+
slotRects.set(anchorKey, {
|
|
9322
9411
|
bottom: rect.bottom,
|
|
9323
9412
|
left: rect.left,
|
|
9324
9413
|
right: rect.right,
|
|
9325
9414
|
top: rect.top
|
|
9326
9415
|
});
|
|
9327
|
-
const center = resolveDockMagnificationSlotCenter(rect, dockPlacement);
|
|
9328
|
-
centers.set(anchorKey, center);
|
|
9329
9416
|
}
|
|
9330
9417
|
slotOrderRef.current = order;
|
|
9331
9418
|
const visibleViewportRect = viewportRect ? {
|
|
@@ -9334,18 +9421,13 @@ function useDockMagnification({
|
|
|
9334
9421
|
right: viewportRect.right,
|
|
9335
9422
|
top: viewportRect.top
|
|
9336
9423
|
} : null;
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
hitBounds: resolveDockMagnificationHitBounds(slotRects, dockPlacement),
|
|
9340
|
-
mainAxisEdgePadding: DOCK_MAGNIFICATION_MAIN_AXIS_EDGE_PADDING,
|
|
9341
|
-
viewportRect: visibleViewportRect
|
|
9342
|
-
});
|
|
9343
|
-
visibleSlotRectsRef.current = resolveDockMagnificationVisibleSlotRects({
|
|
9424
|
+
geometryBasisRef.current = {
|
|
9425
|
+
mainAxisStartAligned: dockRootRef.current?.hasAttribute("data-scroll-overflow") ?? false,
|
|
9344
9426
|
slotRects,
|
|
9345
9427
|
viewportRect: visibleViewportRect
|
|
9346
|
-
}
|
|
9347
|
-
|
|
9348
|
-
}, [
|
|
9428
|
+
};
|
|
9429
|
+
updateProjectedGeometry();
|
|
9430
|
+
}, [dockRootRef, dockViewportRef, slotRefs, updateProjectedGeometry]);
|
|
9349
9431
|
const isPointerInsideAnyVisibleDockSlot = useCallback10(
|
|
9350
9432
|
(clientX, clientY) => {
|
|
9351
9433
|
for (const rect of visibleSlotRectsRef.current ?? []) {
|
|
@@ -9362,10 +9444,10 @@ function useDockMagnification({
|
|
|
9362
9444
|
[]
|
|
9363
9445
|
);
|
|
9364
9446
|
const ensureDockMagnificationGeometry = useCallback10(() => {
|
|
9365
|
-
if (
|
|
9366
|
-
|
|
9447
|
+
if (centersRef.current === null || hitBoundsRef.current === null || visibleSlotRectsRef.current === null) {
|
|
9448
|
+
captureBaseGeometry();
|
|
9367
9449
|
}
|
|
9368
|
-
}, [
|
|
9450
|
+
}, [captureBaseGeometry]);
|
|
9369
9451
|
const isPointerInsideDockMagnificationTarget = useCallback10(
|
|
9370
9452
|
(clientX, clientY) => isDockMagnificationPointInsideHitBounds({
|
|
9371
9453
|
clientX,
|
|
@@ -9382,7 +9464,6 @@ function useDockMagnification({
|
|
|
9382
9464
|
}
|
|
9383
9465
|
const pointerAxis = pointerAxisRef.current;
|
|
9384
9466
|
if (pointerAxis !== null) {
|
|
9385
|
-
captureRestCenters();
|
|
9386
9467
|
entryRampStartedAtRef.current ??= frameTime;
|
|
9387
9468
|
}
|
|
9388
9469
|
const slots = slotRefs.current;
|
|
@@ -9402,7 +9483,7 @@ function useDockMagnification({
|
|
|
9402
9483
|
if (!anchorKey) {
|
|
9403
9484
|
continue;
|
|
9404
9485
|
}
|
|
9405
|
-
const center =
|
|
9486
|
+
const center = centersRef.current?.get(anchorKey);
|
|
9406
9487
|
if (center === void 0) {
|
|
9407
9488
|
continue;
|
|
9408
9489
|
}
|
|
@@ -9463,6 +9544,7 @@ function useDockMagnification({
|
|
|
9463
9544
|
appliedStylesRef.current
|
|
9464
9545
|
);
|
|
9465
9546
|
}
|
|
9547
|
+
updateProjectedGeometry();
|
|
9466
9548
|
if (pointerAxis !== null) {
|
|
9467
9549
|
shouldContinue = true;
|
|
9468
9550
|
} else if (!allSettled) {
|
|
@@ -9470,10 +9552,11 @@ function useDockMagnification({
|
|
|
9470
9552
|
}
|
|
9471
9553
|
if (pointerAxis === null && allSettled) {
|
|
9472
9554
|
entryRampStartedAtRef.current = null;
|
|
9473
|
-
|
|
9555
|
+
centersRef.current = null;
|
|
9474
9556
|
hitBoundsRef.current = null;
|
|
9475
9557
|
visibleSlotRectsRef.current = null;
|
|
9476
9558
|
slotOrderRef.current = [];
|
|
9559
|
+
geometryBasisRef.current = null;
|
|
9477
9560
|
setMagnifyActive(false);
|
|
9478
9561
|
}
|
|
9479
9562
|
if (shouldContinue) {
|
|
@@ -9483,7 +9566,7 @@ function useDockMagnification({
|
|
|
9483
9566
|
animationFrameRef.current = null;
|
|
9484
9567
|
lastFrameTimeRef.current = null;
|
|
9485
9568
|
},
|
|
9486
|
-
[
|
|
9569
|
+
[setMagnifyActive, slotRefs, updateProjectedGeometry]
|
|
9487
9570
|
);
|
|
9488
9571
|
const scheduleAnimation = useCallback10(() => {
|
|
9489
9572
|
if (animationFrameRef.current !== null) {
|
|
@@ -9612,13 +9695,13 @@ function useDockMagnification({
|
|
|
9612
9695
|
document.addEventListener(
|
|
9613
9696
|
"pointermove",
|
|
9614
9697
|
handleAmbientPointerMove,
|
|
9615
|
-
|
|
9698
|
+
dockMagnificationPointerListenerOptions
|
|
9616
9699
|
);
|
|
9617
9700
|
return () => {
|
|
9618
9701
|
document.removeEventListener(
|
|
9619
9702
|
"pointermove",
|
|
9620
9703
|
handleAmbientPointerMove,
|
|
9621
|
-
|
|
9704
|
+
dockMagnificationPointerListenerOptions
|
|
9622
9705
|
);
|
|
9623
9706
|
clearAmbientPointerSample();
|
|
9624
9707
|
};
|
|
@@ -9637,10 +9720,11 @@ function useDockMagnification({
|
|
|
9637
9720
|
const clearSlotMagnification = useCallback10(
|
|
9638
9721
|
(anchorKey) => {
|
|
9639
9722
|
springsRef.current.delete(anchorKey);
|
|
9640
|
-
|
|
9723
|
+
centersRef.current = null;
|
|
9641
9724
|
appliedStylesRef.current.delete(anchorKey);
|
|
9642
9725
|
hitBoundsRef.current = null;
|
|
9643
9726
|
visibleSlotRectsRef.current = null;
|
|
9727
|
+
geometryBasisRef.current = null;
|
|
9644
9728
|
slotOrderRef.current = slotOrderRef.current.filter(
|
|
9645
9729
|
(key) => key !== anchorKey
|
|
9646
9730
|
);
|
|
@@ -9667,10 +9751,11 @@ function useDockMagnification({
|
|
|
9667
9751
|
}
|
|
9668
9752
|
springsRef.current.clear();
|
|
9669
9753
|
appliedStylesRef.current.clear();
|
|
9670
|
-
|
|
9754
|
+
centersRef.current = null;
|
|
9671
9755
|
hitBoundsRef.current = null;
|
|
9672
9756
|
visibleSlotRectsRef.current = null;
|
|
9673
9757
|
slotOrderRef.current = [];
|
|
9758
|
+
geometryBasisRef.current = null;
|
|
9674
9759
|
pointerAxisRef.current = null;
|
|
9675
9760
|
pendingPointerAxisRef.current = null;
|
|
9676
9761
|
entryRampStartedAtRef.current = null;
|
|
@@ -10144,7 +10229,7 @@ var dockPopupMinimizedStackLaunchDisappearMs = 0;
|
|
|
10144
10229
|
var dockPopupMinimizedStackPopupZIndex = 100300;
|
|
10145
10230
|
var dockPopupPreviewCacheMaxEntries = 64;
|
|
10146
10231
|
var dockPopupPreviewByMemoryKey = /* @__PURE__ */ new Map();
|
|
10147
|
-
var
|
|
10232
|
+
var pendingDockPopupPreviewCaptureKeys = /* @__PURE__ */ new Set();
|
|
10148
10233
|
var popupCardMagnificationRange = 160;
|
|
10149
10234
|
var popupCardMaxScale = 1.16;
|
|
10150
10235
|
var popupCardMaxLiftPx = 10;
|
|
@@ -10235,6 +10320,7 @@ function WorkbenchHostDockPopup({
|
|
|
10235
10320
|
const resolvedVariant = variant ?? "default";
|
|
10236
10321
|
const isMinimizedStack = resolvedVariant === "minimized-stack";
|
|
10237
10322
|
const isContextMenu = resolvedVariant === "context-menu";
|
|
10323
|
+
const hasCapturePreview = Boolean(capturePreview);
|
|
10238
10324
|
const createCardCount = showCreateNew === false ? 0 : 1;
|
|
10239
10325
|
const cardElementsRef = useRef8(/* @__PURE__ */ new Map());
|
|
10240
10326
|
const cardRefCallbacksRef = useRef8(
|
|
@@ -10246,6 +10332,16 @@ function WorkbenchHostDockPopup({
|
|
|
10246
10332
|
const [minimizedStackScrollOffset, setMinimizedStackScrollOffset] = useState7(0);
|
|
10247
10333
|
const [verticalClampOffsetPx, setVerticalClampOffsetPx] = useState7(0);
|
|
10248
10334
|
const [capturedPreviewByMemoryKey, setCapturedPreviewByMemoryKey] = useState7({});
|
|
10335
|
+
const capturedPreviewByMemoryKeyRef = useRef8(capturedPreviewByMemoryKey);
|
|
10336
|
+
const capturePreviewRef = useRef8(capturePreview);
|
|
10337
|
+
const debugDiagnosticsRef = useRef8(debugDiagnostics);
|
|
10338
|
+
const dockPreviewCacheRef = useRef8(dockPreviewCache);
|
|
10339
|
+
const resolveDockPreviewCacheKeyRef = useRef8(resolveDockPreviewCacheKey2);
|
|
10340
|
+
capturedPreviewByMemoryKeyRef.current = capturedPreviewByMemoryKey;
|
|
10341
|
+
capturePreviewRef.current = capturePreview;
|
|
10342
|
+
debugDiagnosticsRef.current = debugDiagnostics;
|
|
10343
|
+
dockPreviewCacheRef.current = dockPreviewCache;
|
|
10344
|
+
resolveDockPreviewCacheKeyRef.current = resolveDockPreviewCacheKey2;
|
|
10249
10345
|
const columnCount = isContextMenu ? 1 : Math.min(Math.max(items.length + createCardCount, 1), 3);
|
|
10250
10346
|
const popupWidthPx = isContextMenu ? 268 : columnCount * dockPopupCardWidthPx + Math.max(0, columnCount - 1) * dockPopupGridGapPx + dockPopupPanelPaddingInlinePx * 2 + dockPopupPanelBorderInlinePx;
|
|
10251
10347
|
const popupCenterY = anchorRect.top + anchorRect.height / 2;
|
|
@@ -10434,9 +10530,18 @@ function WorkbenchHostDockPopup({
|
|
|
10434
10530
|
window.removeEventListener("keydown", handleKeyDown);
|
|
10435
10531
|
};
|
|
10436
10532
|
}, [onClose]);
|
|
10437
|
-
const previewCaptureKey = items.map(
|
|
10438
|
-
|
|
10439
|
-
|
|
10533
|
+
const previewCaptureKey = items.map((item) => {
|
|
10534
|
+
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10535
|
+
item.node,
|
|
10536
|
+
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
10537
|
+
);
|
|
10538
|
+
return [
|
|
10539
|
+
previewMemoryKey,
|
|
10540
|
+
item.isMinimized ? "minimized" : "visible",
|
|
10541
|
+
previewCacheToken(item.preview),
|
|
10542
|
+
item.previewRevision ?? ""
|
|
10543
|
+
].join(":");
|
|
10544
|
+
}).join("|");
|
|
10440
10545
|
useEffect9(() => {
|
|
10441
10546
|
if (!isMinimizedStack) {
|
|
10442
10547
|
return;
|
|
@@ -10465,20 +10570,25 @@ function WorkbenchHostDockPopup({
|
|
|
10465
10570
|
return () => viewport.removeEventListener("wheel", handleWheel);
|
|
10466
10571
|
}, [isMinimizedStack, minimizedStackMaxScrollOffset]);
|
|
10467
10572
|
useEffect9(() => {
|
|
10468
|
-
if (!
|
|
10573
|
+
if (!capturePreviewRef.current || isContextMenu) {
|
|
10469
10574
|
return;
|
|
10470
10575
|
}
|
|
10471
10576
|
let cancelled = false;
|
|
10577
|
+
const startedCaptureKeys = /* @__PURE__ */ new Set();
|
|
10472
10578
|
const missingItems = items.filter((item) => {
|
|
10473
10579
|
const revision = item.previewRevision;
|
|
10474
10580
|
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10475
10581
|
item.node,
|
|
10476
|
-
|
|
10582
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
10583
|
+
);
|
|
10584
|
+
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
10585
|
+
previewMemoryKey,
|
|
10586
|
+
revision
|
|
10477
10587
|
);
|
|
10478
|
-
const capturedPreview =
|
|
10588
|
+
const capturedPreview = capturedPreviewByMemoryKeyRef.current[previewMemoryKey] ?? readDockPopupPreviewImage(previewMemoryKey);
|
|
10479
10589
|
const hasCapturedPreview = capturedPreview !== void 0 && capturedPreview.revision === revision;
|
|
10480
10590
|
const shouldCaptureMissingPreview = !item.preview && !hasCapturedPreview;
|
|
10481
|
-
return shouldCaptureMissingPreview && !
|
|
10591
|
+
return shouldCaptureMissingPreview && !pendingDockPopupPreviewCaptureKeys.has(pendingCaptureKey);
|
|
10482
10592
|
});
|
|
10483
10593
|
if (missingItems.length === 0) {
|
|
10484
10594
|
logWorkbenchDockPopupDebug(
|
|
@@ -10502,10 +10612,14 @@ function WorkbenchHostDockPopup({
|
|
|
10502
10612
|
}
|
|
10503
10613
|
);
|
|
10504
10614
|
for (const item of missingItems) {
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10615
|
+
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10616
|
+
item.node,
|
|
10617
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
10618
|
+
);
|
|
10619
|
+
pendingDockPopupPreviewCaptureKeys.add(
|
|
10620
|
+
resolveDockPopupPreviewCaptureKey(
|
|
10621
|
+
previewMemoryKey,
|
|
10622
|
+
item.previewRevision
|
|
10509
10623
|
)
|
|
10510
10624
|
);
|
|
10511
10625
|
}
|
|
@@ -10515,121 +10629,130 @@ function WorkbenchHostDockPopup({
|
|
|
10515
10629
|
break;
|
|
10516
10630
|
}
|
|
10517
10631
|
const revision = item.previewRevision;
|
|
10518
|
-
logWorkbenchDockPopupDebug(
|
|
10519
|
-
"dock.popup.preview_capture.started",
|
|
10520
|
-
debugDiagnostics,
|
|
10521
|
-
{
|
|
10522
|
-
isMinimized: item.isMinimized,
|
|
10523
|
-
nodeId: item.node.id,
|
|
10524
|
-
revision
|
|
10525
|
-
}
|
|
10526
|
-
);
|
|
10527
10632
|
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10528
10633
|
item.node,
|
|
10529
|
-
|
|
10634
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
10530
10635
|
);
|
|
10531
|
-
const
|
|
10532
|
-
|
|
10636
|
+
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
10637
|
+
previewMemoryKey,
|
|
10533
10638
|
revision
|
|
10534
10639
|
);
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10640
|
+
startedCaptureKeys.add(pendingCaptureKey);
|
|
10641
|
+
try {
|
|
10642
|
+
logWorkbenchDockPopupDebug(
|
|
10643
|
+
"dock.popup.preview_capture.started",
|
|
10644
|
+
debugDiagnosticsRef.current,
|
|
10645
|
+
{
|
|
10646
|
+
isMinimized: item.isMinimized,
|
|
10647
|
+
nodeId: item.node.id,
|
|
10648
|
+
revision
|
|
10649
|
+
}
|
|
10650
|
+
);
|
|
10651
|
+
const cacheKey = resolveDockPopupPreviewCacheKey(
|
|
10652
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null,
|
|
10653
|
+
revision
|
|
10539
10654
|
);
|
|
10655
|
+
if (item.isMinimized && cacheKey) {
|
|
10656
|
+
const minimizedPersistedPreview = await readPersistedDockPreview(
|
|
10657
|
+
dockPreviewCacheRef.current,
|
|
10658
|
+
cacheKey
|
|
10659
|
+
);
|
|
10660
|
+
if (cancelled) {
|
|
10661
|
+
break;
|
|
10662
|
+
}
|
|
10663
|
+
if (minimizedPersistedPreview) {
|
|
10664
|
+
const persistedPreview = {
|
|
10665
|
+
kind: "image",
|
|
10666
|
+
src: minimizedPersistedPreview
|
|
10667
|
+
};
|
|
10668
|
+
writeCachedWorkbenchNodePreviewImage(
|
|
10669
|
+
item.node.id,
|
|
10670
|
+
minimizedPersistedPreview
|
|
10671
|
+
);
|
|
10672
|
+
writeDockPopupPreviewImage(
|
|
10673
|
+
previewMemoryKey,
|
|
10674
|
+
persistedPreview,
|
|
10675
|
+
revision
|
|
10676
|
+
);
|
|
10677
|
+
setCapturedPreviewByMemoryKey((current) => ({
|
|
10678
|
+
...current,
|
|
10679
|
+
[previewMemoryKey]: {
|
|
10680
|
+
preview: persistedPreview,
|
|
10681
|
+
revision
|
|
10682
|
+
}
|
|
10683
|
+
}));
|
|
10684
|
+
continue;
|
|
10685
|
+
}
|
|
10686
|
+
}
|
|
10687
|
+
const preview = normalizeDockPopupPreviewContentResult(
|
|
10688
|
+
item.isMinimized ? await capturePreviewRef.current?.(item) ?? await captureWorkbenchNodePreviewImage(item.node.id, {
|
|
10689
|
+
bypassCache: false
|
|
10690
|
+
}) : await Promise.resolve(
|
|
10691
|
+
capturePreviewRef.current?.(item) ?? null
|
|
10692
|
+
).catch(() => null),
|
|
10693
|
+
revision
|
|
10694
|
+
);
|
|
10695
|
+
if (cancelled) {
|
|
10696
|
+
break;
|
|
10697
|
+
}
|
|
10698
|
+
logWorkbenchDockPopupDebug(
|
|
10699
|
+
"dock.popup.preview_capture.resolved",
|
|
10700
|
+
debugDiagnosticsRef.current,
|
|
10701
|
+
{
|
|
10702
|
+
hasPreview: Boolean(preview),
|
|
10703
|
+
nodeId: item.node.id,
|
|
10704
|
+
providerRevision: preview?.revision ?? null,
|
|
10705
|
+
revision
|
|
10706
|
+
}
|
|
10707
|
+
);
|
|
10708
|
+
if (preview) {
|
|
10709
|
+
if (preview.kind === "image") {
|
|
10710
|
+
writeCachedWorkbenchNodePreviewImage(item.node.id, preview.src);
|
|
10711
|
+
}
|
|
10712
|
+
writeDockPopupPreviewImage(previewMemoryKey, preview, revision);
|
|
10713
|
+
if (cacheKey && preview.kind === "image") {
|
|
10714
|
+
dockPreviewCacheRef.current?.write({
|
|
10715
|
+
key: cacheKey,
|
|
10716
|
+
previewImageUrl: preview.src
|
|
10717
|
+
});
|
|
10718
|
+
}
|
|
10719
|
+
setCapturedPreviewByMemoryKey((current) => ({
|
|
10720
|
+
...current,
|
|
10721
|
+
[previewMemoryKey]: { preview, revision }
|
|
10722
|
+
}));
|
|
10723
|
+
continue;
|
|
10724
|
+
}
|
|
10725
|
+
const fallbackPersistedPreview = !item.isMinimized && cacheKey ? await readPersistedDockPreview(
|
|
10726
|
+
dockPreviewCacheRef.current,
|
|
10727
|
+
cacheKey
|
|
10728
|
+
) : null;
|
|
10540
10729
|
if (cancelled) {
|
|
10541
10730
|
break;
|
|
10542
10731
|
}
|
|
10543
|
-
if (
|
|
10544
|
-
const persistedPreview = {
|
|
10545
|
-
kind: "image",
|
|
10546
|
-
src: minimizedPersistedPreview
|
|
10547
|
-
};
|
|
10732
|
+
if (fallbackPersistedPreview) {
|
|
10548
10733
|
writeCachedWorkbenchNodePreviewImage(
|
|
10549
10734
|
item.node.id,
|
|
10550
|
-
|
|
10735
|
+
fallbackPersistedPreview
|
|
10551
10736
|
);
|
|
10737
|
+
}
|
|
10738
|
+
if (fallbackPersistedPreview || item.isMinimized) {
|
|
10739
|
+
const fallbackPreview = fallbackPersistedPreview ? { kind: "image", src: fallbackPersistedPreview } : null;
|
|
10552
10740
|
writeDockPopupPreviewImage(
|
|
10553
10741
|
previewMemoryKey,
|
|
10554
|
-
|
|
10742
|
+
fallbackPreview,
|
|
10555
10743
|
revision
|
|
10556
10744
|
);
|
|
10745
|
+
}
|
|
10746
|
+
if (!cancelled) {
|
|
10747
|
+
const fallbackPreview = fallbackPersistedPreview ? { kind: "image", src: fallbackPersistedPreview } : null;
|
|
10557
10748
|
setCapturedPreviewByMemoryKey((current) => ({
|
|
10558
10749
|
...current,
|
|
10559
|
-
[previewMemoryKey]: {
|
|
10560
|
-
preview: persistedPreview,
|
|
10561
|
-
revision
|
|
10562
|
-
}
|
|
10750
|
+
[previewMemoryKey]: { preview: fallbackPreview, revision }
|
|
10563
10751
|
}));
|
|
10564
|
-
pendingDockPopupPreviewMemoryKeys.delete(previewMemoryKey);
|
|
10565
|
-
continue;
|
|
10566
|
-
}
|
|
10567
|
-
}
|
|
10568
|
-
const preview = normalizeDockPopupPreviewContentResult(
|
|
10569
|
-
item.isMinimized ? await capturePreview?.(item) ?? await captureWorkbenchNodePreviewImage(item.node.id, {
|
|
10570
|
-
bypassCache: false
|
|
10571
|
-
}) : await Promise.resolve(capturePreview?.(item) ?? null).catch(
|
|
10572
|
-
() => null
|
|
10573
|
-
),
|
|
10574
|
-
revision
|
|
10575
|
-
);
|
|
10576
|
-
if (cancelled) {
|
|
10577
|
-
break;
|
|
10578
|
-
}
|
|
10579
|
-
logWorkbenchDockPopupDebug(
|
|
10580
|
-
"dock.popup.preview_capture.resolved",
|
|
10581
|
-
debugDiagnostics,
|
|
10582
|
-
{
|
|
10583
|
-
hasPreview: Boolean(preview),
|
|
10584
|
-
nodeId: item.node.id,
|
|
10585
|
-
providerRevision: preview?.revision ?? null,
|
|
10586
|
-
revision
|
|
10587
|
-
}
|
|
10588
|
-
);
|
|
10589
|
-
if (preview) {
|
|
10590
|
-
if (preview.kind === "image") {
|
|
10591
|
-
writeCachedWorkbenchNodePreviewImage(item.node.id, preview.src);
|
|
10592
|
-
}
|
|
10593
|
-
writeDockPopupPreviewImage(previewMemoryKey, preview, revision);
|
|
10594
|
-
if (cacheKey && preview.kind === "image") {
|
|
10595
|
-
dockPreviewCache?.write({
|
|
10596
|
-
key: cacheKey,
|
|
10597
|
-
previewImageUrl: preview.src
|
|
10598
|
-
});
|
|
10599
10752
|
}
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
[previewMemoryKey]: { preview, revision }
|
|
10603
|
-
}));
|
|
10604
|
-
pendingDockPopupPreviewMemoryKeys.delete(previewMemoryKey);
|
|
10605
|
-
continue;
|
|
10606
|
-
}
|
|
10607
|
-
const fallbackPersistedPreview = !item.isMinimized && cacheKey ? await readPersistedDockPreview(dockPreviewCache, cacheKey) : null;
|
|
10608
|
-
if (cancelled) {
|
|
10609
|
-
break;
|
|
10610
|
-
}
|
|
10611
|
-
if (fallbackPersistedPreview) {
|
|
10612
|
-
writeCachedWorkbenchNodePreviewImage(
|
|
10613
|
-
item.node.id,
|
|
10614
|
-
fallbackPersistedPreview
|
|
10615
|
-
);
|
|
10616
|
-
}
|
|
10617
|
-
if (fallbackPersistedPreview || item.isMinimized) {
|
|
10618
|
-
const fallbackPreview = fallbackPersistedPreview ? { kind: "image", src: fallbackPersistedPreview } : null;
|
|
10619
|
-
writeDockPopupPreviewImage(
|
|
10620
|
-
previewMemoryKey,
|
|
10621
|
-
fallbackPreview,
|
|
10622
|
-
revision
|
|
10623
|
-
);
|
|
10624
|
-
}
|
|
10625
|
-
if (!cancelled) {
|
|
10626
|
-
const fallbackPreview = fallbackPersistedPreview ? { kind: "image", src: fallbackPersistedPreview } : null;
|
|
10627
|
-
setCapturedPreviewByMemoryKey((current) => ({
|
|
10628
|
-
...current,
|
|
10629
|
-
[previewMemoryKey]: { preview: fallbackPreview, revision }
|
|
10630
|
-
}));
|
|
10753
|
+
} finally {
|
|
10754
|
+
pendingDockPopupPreviewCaptureKeys.delete(pendingCaptureKey);
|
|
10631
10755
|
}
|
|
10632
|
-
pendingDockPopupPreviewMemoryKeys.delete(previewMemoryKey);
|
|
10633
10756
|
}
|
|
10634
10757
|
})().catch(() => {
|
|
10635
10758
|
for (const item of missingItems) {
|
|
@@ -10642,7 +10765,12 @@ function WorkbenchHostDockPopup({
|
|
|
10642
10765
|
null,
|
|
10643
10766
|
item.previewRevision
|
|
10644
10767
|
);
|
|
10645
|
-
|
|
10768
|
+
pendingDockPopupPreviewCaptureKeys.delete(
|
|
10769
|
+
resolveDockPopupPreviewCaptureKey(
|
|
10770
|
+
previewMemoryKey,
|
|
10771
|
+
item.previewRevision
|
|
10772
|
+
)
|
|
10773
|
+
);
|
|
10646
10774
|
}
|
|
10647
10775
|
if (!cancelled) {
|
|
10648
10776
|
setCapturedPreviewByMemoryKey((current) => ({
|
|
@@ -10665,22 +10793,20 @@ function WorkbenchHostDockPopup({
|
|
|
10665
10793
|
return () => {
|
|
10666
10794
|
cancelled = true;
|
|
10667
10795
|
for (const item of missingItems) {
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10796
|
+
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10797
|
+
item.node,
|
|
10798
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
10799
|
+
);
|
|
10800
|
+
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
10801
|
+
previewMemoryKey,
|
|
10802
|
+
item.previewRevision
|
|
10673
10803
|
);
|
|
10804
|
+
if (!startedCaptureKeys.has(pendingCaptureKey)) {
|
|
10805
|
+
pendingDockPopupPreviewCaptureKeys.delete(pendingCaptureKey);
|
|
10806
|
+
}
|
|
10674
10807
|
}
|
|
10675
10808
|
};
|
|
10676
|
-
}, [
|
|
10677
|
-
capturePreview,
|
|
10678
|
-
dockPreviewCache,
|
|
10679
|
-
isContextMenu,
|
|
10680
|
-
items,
|
|
10681
|
-
previewCaptureKey,
|
|
10682
|
-
resolveDockPreviewCacheKey2
|
|
10683
|
-
]);
|
|
10809
|
+
}, [hasCapturePreview, isContextMenu, previewCaptureKey]);
|
|
10684
10810
|
const content = /* @__PURE__ */ jsx11(
|
|
10685
10811
|
"div",
|
|
10686
10812
|
{
|
|
@@ -11030,6 +11156,9 @@ function resolveDockPopupPreviewMemoryKey(node, cacheKey) {
|
|
|
11030
11156
|
workspaceId: cacheKey.workspaceId
|
|
11031
11157
|
})}`;
|
|
11032
11158
|
}
|
|
11159
|
+
function resolveDockPopupPreviewCaptureKey(memoryKey, revision) {
|
|
11160
|
+
return `${memoryKey}\0${revision ?? ""}`;
|
|
11161
|
+
}
|
|
11033
11162
|
function normalizeDockPopupPreviewContentResult(preview, revision) {
|
|
11034
11163
|
if (!preview) {
|
|
11035
11164
|
return null;
|
|
@@ -14221,6 +14350,41 @@ var dockSeparatorOuterWidthPx = 8.1;
|
|
|
14221
14350
|
var dockSlotWidthPx = 43.2;
|
|
14222
14351
|
var desktopDockPlateChromeWidth = 15.3;
|
|
14223
14352
|
|
|
14353
|
+
// src/host/WorkbenchHostNodeBodyRenderer.tsx
|
|
14354
|
+
import { memo as memo2 } from "react";
|
|
14355
|
+
function WorkbenchHostNodeBodyRenderer(input) {
|
|
14356
|
+
return input.definition.renderBody(input.context);
|
|
14357
|
+
}
|
|
14358
|
+
function areWorkbenchHostNodeBodyRendererPropsEqual(previous, next) {
|
|
14359
|
+
const previousContext = previous.context;
|
|
14360
|
+
const nextContext = next.context;
|
|
14361
|
+
if (previous.definition !== next.definition || previousContext.activation !== nextContext.activation || previousContext.displayMode !== nextContext.displayMode || previousContext.externalNodeState !== nextContext.externalNodeState || previousContext.externalWorkspaceState !== nextContext.externalWorkspaceState || previousContext.host !== nextContext.host || previousContext.instanceId !== nextContext.instanceId || previousContext.instanceKey !== nextContext.instanceKey || previousContext.isDragging !== nextContext.isDragging || previousContext.isFocused !== nextContext.isFocused || previousContext.isResizing !== nextContext.isResizing || previousContext.isVisible !== nextContext.isVisible || previousContext.presentationMode !== nextContext.presentationMode || !areWorkbenchOptionalSizesEqual(
|
|
14362
|
+
previousContext.previewViewport,
|
|
14363
|
+
nextContext.previewViewport
|
|
14364
|
+
)) {
|
|
14365
|
+
return false;
|
|
14366
|
+
}
|
|
14367
|
+
const previousNode = previousContext.node;
|
|
14368
|
+
const nextNode = nextContext.node;
|
|
14369
|
+
if (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) {
|
|
14370
|
+
return false;
|
|
14371
|
+
}
|
|
14372
|
+
if (nextContext.isDragging || nextContext.isResizing) {
|
|
14373
|
+
return previousNode.frame.width === nextNode.frame.width && previousNode.frame.height === nextNode.frame.height;
|
|
14374
|
+
}
|
|
14375
|
+
return areWorkbenchFramesEqual(previousNode.frame, nextNode.frame);
|
|
14376
|
+
}
|
|
14377
|
+
function areWorkbenchFramesEqual(previous, next) {
|
|
14378
|
+
return previous.x === next.x && previous.y === next.y && previous.width === next.width && previous.height === next.height;
|
|
14379
|
+
}
|
|
14380
|
+
function areWorkbenchOptionalSizesEqual(previous, next) {
|
|
14381
|
+
return previous === next || previous !== void 0 && next !== void 0 && previous.width === next.width && previous.height === next.height;
|
|
14382
|
+
}
|
|
14383
|
+
var MemoizedWorkbenchHostNodeBodyRenderer = memo2(
|
|
14384
|
+
WorkbenchHostNodeBodyRenderer,
|
|
14385
|
+
areWorkbenchHostNodeBodyRendererPropsEqual
|
|
14386
|
+
);
|
|
14387
|
+
|
|
14224
14388
|
// src/host/windowActions.ts
|
|
14225
14389
|
function createWorkbenchHostNodeHeaderWindowActions(context, input = {}) {
|
|
14226
14390
|
return {
|
|
@@ -14774,7 +14938,7 @@ function WorkbenchHostNodeRenderer(input) {
|
|
|
14774
14938
|
resetKey,
|
|
14775
14939
|
workspaceId: input.workspaceId,
|
|
14776
14940
|
children: /* @__PURE__ */ jsx14(
|
|
14777
|
-
|
|
14941
|
+
MemoizedWorkbenchHostNodeBodyRenderer,
|
|
14778
14942
|
{
|
|
14779
14943
|
context: bodyContext,
|
|
14780
14944
|
definition: input.definition
|
|
@@ -14813,7 +14977,7 @@ function WorkbenchHostNodeHeaderStateBridge(input) {
|
|
|
14813
14977
|
function areWorkbenchHostNodeHeaderStateBridgePropsEqual(previous, next) {
|
|
14814
14978
|
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;
|
|
14815
14979
|
}
|
|
14816
|
-
var MemoizedWorkbenchHostNodeHeaderStateBridge =
|
|
14980
|
+
var MemoizedWorkbenchHostNodeHeaderStateBridge = memo3(
|
|
14817
14981
|
WorkbenchHostNodeHeaderStateBridge,
|
|
14818
14982
|
areWorkbenchHostNodeHeaderStateBridgePropsEqual
|
|
14819
14983
|
);
|
|
@@ -14833,12 +14997,12 @@ function areWorkbenchHostNodeHeaderRendererPropsEqual(previous, next) {
|
|
|
14833
14997
|
if ((next.context.isDragging || next.context.isResizing) && next.hasFrameRenderKey) {
|
|
14834
14998
|
return Object.is(previous.frameRenderKey, next.frameRenderKey);
|
|
14835
14999
|
}
|
|
14836
|
-
return
|
|
15000
|
+
return areWorkbenchFramesEqual2(previousNode.frame, nextNode.frame);
|
|
14837
15001
|
}
|
|
14838
|
-
function
|
|
15002
|
+
function areWorkbenchFramesEqual2(previous, next) {
|
|
14839
15003
|
return previous.x === next.x && previous.y === next.y && previous.width === next.width && previous.height === next.height;
|
|
14840
15004
|
}
|
|
14841
|
-
var MemoizedWorkbenchHostNodeHeaderRenderer =
|
|
15005
|
+
var MemoizedWorkbenchHostNodeHeaderRenderer = memo3(
|
|
14842
15006
|
WorkbenchHostNodeHeaderRenderer,
|
|
14843
15007
|
areWorkbenchHostNodeHeaderRendererPropsEqual
|
|
14844
15008
|
);
|
|
@@ -14994,12 +15158,6 @@ var WorkbenchHostNodeRenderErrorBoundary = class extends Component {
|
|
|
14994
15158
|
return this.props.children;
|
|
14995
15159
|
}
|
|
14996
15160
|
};
|
|
14997
|
-
function WorkbenchHostNodeBodyRenderer({
|
|
14998
|
-
context,
|
|
14999
|
-
definition
|
|
15000
|
-
}) {
|
|
15001
|
-
return definition.renderBody(context);
|
|
15002
|
-
}
|
|
15003
15161
|
function WorkbenchHostChromeRenderer({
|
|
15004
15162
|
context,
|
|
15005
15163
|
renderChrome
|