@tutti-os/workbench-surface 0.0.238 → 0.0.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1211 -1143
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -9063,16 +9063,16 @@ function logWorkbenchHostDebug(event, debugDiagnostics, payload) {
|
|
|
9063
9063
|
}
|
|
9064
9064
|
|
|
9065
9065
|
// src/host/useWorkbenchHostSurfaceRenderers.tsx
|
|
9066
|
-
import { Component, memo as memo3, useCallback as
|
|
9066
|
+
import { Component, memo as memo3, useCallback as useCallback14, useMemo as useMemo11 } from "react";
|
|
9067
9067
|
|
|
9068
9068
|
// src/host/WorkbenchHostDock.tsx
|
|
9069
9069
|
import {
|
|
9070
|
-
useCallback as
|
|
9071
|
-
useEffect as
|
|
9072
|
-
useLayoutEffect as
|
|
9070
|
+
useCallback as useCallback13,
|
|
9071
|
+
useEffect as useEffect12,
|
|
9072
|
+
useLayoutEffect as useLayoutEffect8,
|
|
9073
9073
|
useMemo as useMemo10,
|
|
9074
|
-
useRef as
|
|
9075
|
-
useState as
|
|
9074
|
+
useRef as useRef11,
|
|
9075
|
+
useState as useState10
|
|
9076
9076
|
} from "react";
|
|
9077
9077
|
import {
|
|
9078
9078
|
ArrowLeftIcon,
|
|
@@ -10307,26 +10307,14 @@ function resolveWorkbenchMinimizedDockRestoreIntent(input) {
|
|
|
10307
10307
|
|
|
10308
10308
|
// src/host/WorkbenchHostDockPopup.tsx
|
|
10309
10309
|
import {
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
useState as useState7
|
|
10310
|
+
useCallback as useCallback12,
|
|
10311
|
+
useEffect as useEffect11,
|
|
10312
|
+
useLayoutEffect as useLayoutEffect7,
|
|
10313
|
+
useRef as useRef10,
|
|
10314
|
+
useState as useState9
|
|
10316
10315
|
} from "react";
|
|
10317
10316
|
import { createPortal as createPortal3 } from "react-dom";
|
|
10318
|
-
import {
|
|
10319
|
-
Button as Button2,
|
|
10320
|
-
CheckIcon,
|
|
10321
|
-
CloseIcon,
|
|
10322
|
-
FileCreateIcon,
|
|
10323
|
-
MaximizeIcon,
|
|
10324
|
-
MinimizeIcon,
|
|
10325
|
-
OverviewLayoutIcon,
|
|
10326
|
-
PinFilledIcon,
|
|
10327
|
-
PinIcon,
|
|
10328
|
-
cn
|
|
10329
|
-
} from "@tutti-os/ui-system";
|
|
10317
|
+
import { FileCreateIcon as FileCreateIcon2, cn as cn2 } from "@tutti-os/ui-system";
|
|
10330
10318
|
|
|
10331
10319
|
// src/host/minimizedStackScroll.ts
|
|
10332
10320
|
var minimizedStackViewportMarginPx = 56;
|
|
@@ -10473,24 +10461,28 @@ function resolveDockPopupVerticalClampOffsetPx(input) {
|
|
|
10473
10461
|
return 0;
|
|
10474
10462
|
}
|
|
10475
10463
|
|
|
10476
|
-
// src/host/
|
|
10464
|
+
// src/host/WorkbenchHostDockPopupPresentation.tsx
|
|
10465
|
+
import {
|
|
10466
|
+
forwardRef,
|
|
10467
|
+
useCallback as useCallback11,
|
|
10468
|
+
useEffect as useEffect9,
|
|
10469
|
+
useRef as useRef8,
|
|
10470
|
+
useState as useState7
|
|
10471
|
+
} from "react";
|
|
10472
|
+
import {
|
|
10473
|
+
Button as Button2,
|
|
10474
|
+
CheckIcon,
|
|
10475
|
+
CloseIcon,
|
|
10476
|
+
FileCreateIcon,
|
|
10477
|
+
MaximizeIcon,
|
|
10478
|
+
MinimizeIcon,
|
|
10479
|
+
OverviewLayoutIcon,
|
|
10480
|
+
PinFilledIcon,
|
|
10481
|
+
PinIcon,
|
|
10482
|
+
cn
|
|
10483
|
+
} from "@tutti-os/ui-system";
|
|
10477
10484
|
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
10478
|
-
var dockPopupCardWidthPx = 165;
|
|
10479
|
-
var dockPopupCardHeightPx = 103;
|
|
10480
|
-
var dockPopupPreviewInsetPx = 4;
|
|
10481
|
-
var workbenchHostDockPopupPreviewViewport = Object.freeze({
|
|
10482
|
-
height: dockPopupCardHeightPx - dockPopupPreviewInsetPx * 2,
|
|
10483
|
-
width: dockPopupCardWidthPx - dockPopupPreviewInsetPx * 2
|
|
10484
|
-
});
|
|
10485
|
-
var dockPopupGridGapPx = 8;
|
|
10486
|
-
var dockPopupPanelPaddingInlinePx = 12;
|
|
10487
|
-
var dockPopupPanelBorderInlinePx = 2;
|
|
10488
|
-
var dockPopupPlacementGapPx = 14;
|
|
10489
10485
|
var dockPopupMinimizedStackLaunchDisappearMs = 0;
|
|
10490
|
-
var dockPopupMinimizedStackPopupZIndex = 100300;
|
|
10491
|
-
var dockPopupPreviewCacheMaxEntries = 64;
|
|
10492
|
-
var dockPopupPreviewByMemoryKey = /* @__PURE__ */ new Map();
|
|
10493
|
-
var pendingDockPopupPreviewCaptureKeys = /* @__PURE__ */ new Set();
|
|
10494
10486
|
var popupCardMagnificationRange = 160;
|
|
10495
10487
|
var popupCardMaxScale = 1.16;
|
|
10496
10488
|
var popupCardMaxLiftPx = 10;
|
|
@@ -10529,344 +10521,442 @@ function resolvePopupFanCardStyle(index, count, placement) {
|
|
|
10529
10521
|
"--desktop-dock-popup-fan-y": `${Math.round(arcY)}px`
|
|
10530
10522
|
};
|
|
10531
10523
|
}
|
|
10532
|
-
function
|
|
10533
|
-
|
|
10534
|
-
}
|
|
10535
|
-
function writeDockPopupPreviewImage(memoryKey, preview, revision) {
|
|
10536
|
-
dockPopupPreviewByMemoryKey.delete(memoryKey);
|
|
10537
|
-
dockPopupPreviewByMemoryKey.set(memoryKey, { preview, revision });
|
|
10538
|
-
while (dockPopupPreviewByMemoryKey.size > dockPopupPreviewCacheMaxEntries) {
|
|
10539
|
-
const oldestMemoryKey = dockPopupPreviewByMemoryKey.keys().next().value;
|
|
10540
|
-
if (typeof oldestMemoryKey !== "string") {
|
|
10541
|
-
break;
|
|
10542
|
-
}
|
|
10543
|
-
dockPopupPreviewByMemoryKey.delete(oldestMemoryKey);
|
|
10544
|
-
}
|
|
10545
|
-
}
|
|
10546
|
-
function WorkbenchHostDockPopup({
|
|
10547
|
-
anchorRect,
|
|
10524
|
+
function WorkbenchHostDockContextMenu({
|
|
10525
|
+
canCreateNew,
|
|
10548
10526
|
canEnterFullscreen,
|
|
10549
10527
|
canShowAllWindows,
|
|
10550
|
-
capturePreview,
|
|
10551
|
-
debugDiagnostics,
|
|
10552
10528
|
dockRetention,
|
|
10553
|
-
dockPreviewCache,
|
|
10554
10529
|
fullscreenLabel,
|
|
10555
10530
|
hideLabel,
|
|
10556
10531
|
items,
|
|
10557
|
-
label,
|
|
10558
|
-
labelMode,
|
|
10559
10532
|
newWindowLabel,
|
|
10560
|
-
closeWindowLabel,
|
|
10561
|
-
onClose,
|
|
10562
|
-
onCloseNode,
|
|
10563
10533
|
onCreateNew,
|
|
10564
10534
|
onEnterFullscreen,
|
|
10565
10535
|
onHide,
|
|
10536
|
+
onQuit,
|
|
10566
10537
|
onRunDockRetentionAction,
|
|
10567
10538
|
onSelectNode,
|
|
10568
10539
|
onShowAllWindows,
|
|
10569
|
-
onQuit,
|
|
10570
|
-
placement = "bottom",
|
|
10571
10540
|
quitLabel,
|
|
10572
|
-
resolveDockPreviewCacheKey: resolveDockPreviewCacheKey2,
|
|
10573
10541
|
showAllWindowsLabel,
|
|
10574
|
-
|
|
10575
|
-
showCreateNewInContextMenu,
|
|
10576
|
-
showOpen,
|
|
10577
|
-
variant
|
|
10542
|
+
showOpen
|
|
10578
10543
|
}) {
|
|
10579
|
-
const
|
|
10580
|
-
const
|
|
10581
|
-
const
|
|
10582
|
-
const
|
|
10583
|
-
const
|
|
10584
|
-
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
|
|
10588
|
-
|
|
10544
|
+
const hasOpenWindows = items.length > 0;
|
|
10545
|
+
const hasNewWindowCommand = hasOpenWindows && canCreateNew;
|
|
10546
|
+
const hasOpenCommand = !hasOpenWindows;
|
|
10547
|
+
const hasDockActionGroup = Boolean(dockRetention) || hasNewWindowCommand || hasOpenCommand;
|
|
10548
|
+
const hasWindowActionGroup = hasOpenWindows;
|
|
10549
|
+
return /* @__PURE__ */ jsxs8(
|
|
10550
|
+
"div",
|
|
10551
|
+
{
|
|
10552
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
10553
|
+
"data-desktop-dock-context-menu": "true",
|
|
10554
|
+
role: "menu",
|
|
10555
|
+
children: [
|
|
10556
|
+
hasOpenWindows ? /* @__PURE__ */ jsx11("div", { className: "max-h-48 min-w-0 overflow-auto overscroll-contain", children: items.map((item) => /* @__PURE__ */ jsx11(
|
|
10557
|
+
WorkbenchHostDockContextMenuItem,
|
|
10558
|
+
{
|
|
10559
|
+
checked: !item.isMinimized,
|
|
10560
|
+
label: item.title?.trim() || item.node.title,
|
|
10561
|
+
onSelect: () => onSelectNode(item.node.id)
|
|
10562
|
+
},
|
|
10563
|
+
item.node.id
|
|
10564
|
+
)) }) : null,
|
|
10565
|
+
hasOpenWindows && (hasDockActionGroup || hasWindowActionGroup) ? /* @__PURE__ */ jsx11(WorkbenchHostDockContextMenuSeparator, {}) : null,
|
|
10566
|
+
dockRetention ? /* @__PURE__ */ jsx11(
|
|
10567
|
+
WorkbenchHostDockContextMenuItem,
|
|
10568
|
+
{
|
|
10569
|
+
checked: dockRetention.checked,
|
|
10570
|
+
checkedIcon: /* @__PURE__ */ jsx11(
|
|
10571
|
+
PinFilledIcon,
|
|
10572
|
+
{
|
|
10573
|
+
"aria-hidden": "true",
|
|
10574
|
+
className: "size-4 text-[var(--tutti-purple)]"
|
|
10575
|
+
}
|
|
10576
|
+
),
|
|
10577
|
+
disabled: dockRetention.disabled,
|
|
10578
|
+
icon: /* @__PURE__ */ jsx11(PinIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10579
|
+
label: dockRetention.pendingLabel ?? dockRetention.label,
|
|
10580
|
+
onSelect: onRunDockRetentionAction
|
|
10581
|
+
}
|
|
10582
|
+
) : null,
|
|
10583
|
+
hasNewWindowCommand ? /* @__PURE__ */ jsx11(
|
|
10584
|
+
WorkbenchHostDockContextMenuItem,
|
|
10585
|
+
{
|
|
10586
|
+
icon: /* @__PURE__ */ jsx11(FileCreateIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10587
|
+
label: newWindowLabel,
|
|
10588
|
+
onSelect: onCreateNew
|
|
10589
|
+
}
|
|
10590
|
+
) : null,
|
|
10591
|
+
hasOpenCommand ? /* @__PURE__ */ jsx11(
|
|
10592
|
+
WorkbenchHostDockContextMenuItem,
|
|
10593
|
+
{
|
|
10594
|
+
disabled: !showOpen,
|
|
10595
|
+
icon: /* @__PURE__ */ jsx11(FileCreateIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10596
|
+
label: newWindowLabel,
|
|
10597
|
+
onSelect: onCreateNew
|
|
10598
|
+
}
|
|
10599
|
+
) : null,
|
|
10600
|
+
hasOpenWindows ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
10601
|
+
hasDockActionGroup ? /* @__PURE__ */ jsx11(WorkbenchHostDockContextMenuSeparator, {}) : null,
|
|
10602
|
+
canShowAllWindows && onShowAllWindows ? /* @__PURE__ */ jsx11(
|
|
10603
|
+
WorkbenchHostDockContextMenuItem,
|
|
10604
|
+
{
|
|
10605
|
+
icon: /* @__PURE__ */ jsx11(OverviewLayoutIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10606
|
+
label: showAllWindowsLabel,
|
|
10607
|
+
onSelect: onShowAllWindows
|
|
10608
|
+
}
|
|
10609
|
+
) : null,
|
|
10610
|
+
/* @__PURE__ */ jsx11(
|
|
10611
|
+
WorkbenchHostDockContextMenuItem,
|
|
10612
|
+
{
|
|
10613
|
+
disabled: !canEnterFullscreen || !onEnterFullscreen,
|
|
10614
|
+
icon: /* @__PURE__ */ jsx11(MaximizeIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10615
|
+
label: fullscreenLabel,
|
|
10616
|
+
onSelect: onEnterFullscreen
|
|
10617
|
+
}
|
|
10618
|
+
),
|
|
10619
|
+
/* @__PURE__ */ jsx11(
|
|
10620
|
+
WorkbenchHostDockContextMenuItem,
|
|
10621
|
+
{
|
|
10622
|
+
disabled: !onHide,
|
|
10623
|
+
icon: /* @__PURE__ */ jsx11(MinimizeIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10624
|
+
label: hideLabel,
|
|
10625
|
+
onSelect: onHide
|
|
10626
|
+
}
|
|
10627
|
+
),
|
|
10628
|
+
/* @__PURE__ */ jsx11(
|
|
10629
|
+
WorkbenchHostDockContextMenuItem,
|
|
10630
|
+
{
|
|
10631
|
+
disabled: !onQuit,
|
|
10632
|
+
icon: /* @__PURE__ */ jsx11(CloseIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
10633
|
+
label: quitLabel,
|
|
10634
|
+
onSelect: onQuit
|
|
10635
|
+
}
|
|
10636
|
+
)
|
|
10637
|
+
] }) : null
|
|
10638
|
+
]
|
|
10639
|
+
}
|
|
10589
10640
|
);
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10641
|
+
}
|
|
10642
|
+
function WorkbenchHostDockContextMenuItem({
|
|
10643
|
+
checked,
|
|
10644
|
+
checkedIcon,
|
|
10645
|
+
disabled,
|
|
10646
|
+
icon,
|
|
10647
|
+
label,
|
|
10648
|
+
onSelect
|
|
10649
|
+
}) {
|
|
10650
|
+
return /* @__PURE__ */ jsxs8(
|
|
10651
|
+
"button",
|
|
10652
|
+
{
|
|
10653
|
+
className: cn(
|
|
10654
|
+
"flex h-8 w-full min-w-0 items-center gap-2 rounded-md px-2 text-left text-sm text-[var(--text-primary)] transition-colors",
|
|
10655
|
+
disabled ? "cursor-default opacity-45" : "hover:bg-transparency-hover focus-visible:bg-transparency-hover focus-visible:outline-none"
|
|
10656
|
+
),
|
|
10657
|
+
disabled,
|
|
10658
|
+
role: "menuitem",
|
|
10659
|
+
type: "button",
|
|
10660
|
+
onClick: () => {
|
|
10661
|
+
if (disabled || !onSelect) {
|
|
10662
|
+
return;
|
|
10663
|
+
}
|
|
10664
|
+
onSelect();
|
|
10665
|
+
},
|
|
10666
|
+
children: [
|
|
10667
|
+
/* @__PURE__ */ jsx11("span", { className: "flex size-4 shrink-0 items-center justify-center text-[var(--text-secondary)]", children: checked && checkedIcon ? checkedIcon : checked ? /* @__PURE__ */ jsx11(
|
|
10668
|
+
CheckIcon,
|
|
10669
|
+
{
|
|
10670
|
+
"aria-hidden": "true",
|
|
10671
|
+
className: "size-4 text-[var(--tutti-purple)]"
|
|
10672
|
+
}
|
|
10673
|
+
) : icon ?? null }),
|
|
10674
|
+
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate", children: label })
|
|
10675
|
+
]
|
|
10676
|
+
}
|
|
10612
10677
|
);
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10621
|
-
scrollOffset: minimizedStackScrollOffset,
|
|
10622
|
-
trackHeightPx: minimizedStackTrackHeightPx,
|
|
10623
|
-
viewportHeightPx: minimizedStackViewportHeightPx
|
|
10624
|
-
}) : 0;
|
|
10625
|
-
const minimizedStackLeftGutterPx = isLeftMinimizedStack ? resolveMinimizedStackLeftGutterPx({
|
|
10626
|
-
itemCount: items.length,
|
|
10627
|
-
placement,
|
|
10628
|
-
scrollOffset: minimizedStackScrollOffset,
|
|
10629
|
-
trackHeightPx: minimizedStackTrackHeightPx,
|
|
10630
|
-
viewportHeightPx: minimizedStackViewportHeightPx,
|
|
10631
|
-
trackTranslateXPx: minimizedStackTrackTranslateXPx
|
|
10632
|
-
}) : 0;
|
|
10633
|
-
const minimizedStackPanelWidthPx = isLeftMinimizedStack ? resolveMinimizedStackPanelWidthPx(items.length, placement, {
|
|
10634
|
-
leftGutterPx: minimizedStackLeftGutterPx
|
|
10635
|
-
}) : null;
|
|
10636
|
-
const popupStyle = {
|
|
10637
|
-
"--desktop-dock-popup-columns": String(columnCount),
|
|
10638
|
-
"--desktop-dock-popup-width": minimizedStackPanelWidthPx != null ? `${minimizedStackPanelWidthPx}px` : `${popupWidthPx}px`,
|
|
10639
|
-
...minimizedStackPanelWidthPx != null ? {
|
|
10640
|
-
"--desktop-dock-minimized-stack-width": `${minimizedStackPanelWidthPx}px`,
|
|
10641
|
-
minWidth: minimizedStackPanelWidthPx,
|
|
10642
|
-
width: minimizedStackPanelWidthPx
|
|
10643
|
-
} : {},
|
|
10644
|
-
left: isLeftMinimizedStack ? resolveMinimizedStackPopupLeftPx({
|
|
10645
|
-
anchorLeft: anchorRect.left,
|
|
10646
|
-
anchorWidth: anchorRect.width,
|
|
10647
|
-
dockRightPx: anchorRect.dockRight,
|
|
10648
|
-
leftGutterPx: minimizedStackLeftGutterPx
|
|
10649
|
-
}) : placement === "left" ? anchorRect.left + anchorRect.width + dockPopupPlacementGapPx : anchorRect.left + anchorRect.width / 2,
|
|
10650
|
-
top: isLeftMinimizedStack ? resolveMinimizedStackPopupTopPx({ anchorTop: anchorRect.top }) : placement === "left" ? popupCenterY : anchorRect.top - dockPopupPlacementGapPx,
|
|
10651
|
-
...isLeftMinimizedStack ? { zIndex: dockPopupMinimizedStackPopupZIndex } : {},
|
|
10652
|
-
...isMinimizedStack ? {} : { "--desktop-dock-popup-clamp-offset": `${verticalClampOffsetPx}px` }
|
|
10653
|
-
};
|
|
10654
|
-
const minimizedStackMaxScrollOffset = Math.max(
|
|
10655
|
-
0,
|
|
10656
|
-
minimizedStackTrackHeightPx - minimizedStackViewportHeightPx
|
|
10657
|
-
);
|
|
10658
|
-
const initialMinimizedStackScrollOffset = resolveInitialMinimizedStackScrollOffset({
|
|
10659
|
-
maxScrollOffset: minimizedStackMaxScrollOffset
|
|
10660
|
-
});
|
|
10661
|
-
const panelStyle = {
|
|
10662
|
-
"--desktop-dock-popup-columns": String(columnCount),
|
|
10663
|
-
"--desktop-dock-popup-item-count": String(Math.max(1, items.length)),
|
|
10664
|
-
...isMinimizedStack ? {
|
|
10665
|
-
height: minimizedStackViewportHeightPx,
|
|
10666
|
-
minHeight: minimizedStackViewportHeightPx,
|
|
10667
|
-
...isLeftMinimizedStack && minimizedStackPanelWidthPx != null ? {
|
|
10668
|
-
width: minimizedStackPanelWidthPx,
|
|
10669
|
-
minWidth: minimizedStackPanelWidthPx,
|
|
10670
|
-
"--desktop-dock-minimized-stack-left-gutter": `${minimizedStackLeftGutterPx}px`
|
|
10671
|
-
} : {}
|
|
10672
|
-
} : {}
|
|
10673
|
-
};
|
|
10674
|
-
const popupDiagnosticKey = items.map((item) => item.node.id).join("|");
|
|
10675
|
-
useEffect9(() => {
|
|
10676
|
-
logWorkbenchDockPopupDebug("dock.popup.rendered", debugDiagnostics, {
|
|
10677
|
-
hasCapturePreview: Boolean(capturePreview),
|
|
10678
|
-
itemCount: popupDiagnosticKey ? popupDiagnosticKey.split("|").length : 0,
|
|
10679
|
-
nodeIds: popupDiagnosticKey ? popupDiagnosticKey.split("|") : [],
|
|
10680
|
-
placement,
|
|
10681
|
-
variant: resolvedVariant
|
|
10682
|
-
});
|
|
10683
|
-
}, [
|
|
10684
|
-
capturePreview,
|
|
10685
|
-
debugDiagnostics,
|
|
10686
|
-
placement,
|
|
10687
|
-
popupDiagnosticKey,
|
|
10688
|
-
resolvedVariant
|
|
10689
|
-
]);
|
|
10690
|
-
useLayoutEffect6(() => {
|
|
10691
|
-
const rootElement = popupRootRef.current;
|
|
10692
|
-
const panelElement = rootElement?.querySelector(
|
|
10693
|
-
"[data-desktop-dock-popup-panel]"
|
|
10694
|
-
) ?? null;
|
|
10695
|
-
logWorkbenchDockPopupDebug("dock.popup.layout", debugDiagnostics, {
|
|
10696
|
-
panelRect: panelElement ? rectToDiagnostic(panelElement) : null,
|
|
10697
|
-
rootRect: rootElement ? rectToDiagnostic(rootElement) : null,
|
|
10698
|
-
rootStyle: rootElement ? styleToDiagnostic(rootElement) : null,
|
|
10699
|
-
viewportHeight: window.innerHeight,
|
|
10700
|
-
viewportWidth: window.innerWidth
|
|
10701
|
-
});
|
|
10702
|
-
}, [debugDiagnostics, popupDiagnosticKey]);
|
|
10703
|
-
useLayoutEffect6(() => {
|
|
10704
|
-
if (isMinimizedStack || typeof window === "undefined") {
|
|
10705
|
-
return;
|
|
10706
|
-
}
|
|
10707
|
-
const rootElement = popupRootRef.current;
|
|
10708
|
-
const panelElement = rootElement?.querySelector(
|
|
10709
|
-
"[data-desktop-dock-popup-panel]"
|
|
10710
|
-
);
|
|
10711
|
-
if (!panelElement) {
|
|
10712
|
-
return;
|
|
10713
|
-
}
|
|
10714
|
-
const measureAndClamp = () => {
|
|
10715
|
-
const panelHeightPx = panelElement.offsetHeight;
|
|
10716
|
-
const naturalTopPx = placement === "left" ? popupCenterY - panelHeightPx / 2 : anchorRect.top - dockPopupPlacementGapPx - panelHeightPx;
|
|
10717
|
-
const naturalBottomPx = placement === "left" ? popupCenterY + panelHeightPx / 2 : anchorRect.top - dockPopupPlacementGapPx;
|
|
10718
|
-
const offsetPx = resolveDockPopupVerticalClampOffsetPx({
|
|
10719
|
-
naturalBottomPx,
|
|
10720
|
-
naturalTopPx,
|
|
10721
|
-
viewportHeightPx: window.innerHeight
|
|
10722
|
-
});
|
|
10723
|
-
setVerticalClampOffsetPx(
|
|
10724
|
-
(current) => current === offsetPx ? current : offsetPx
|
|
10725
|
-
);
|
|
10726
|
-
};
|
|
10727
|
-
measureAndClamp();
|
|
10728
|
-
const resizeObserver = new ResizeObserver(measureAndClamp);
|
|
10729
|
-
resizeObserver.observe(panelElement);
|
|
10730
|
-
window.addEventListener("resize", measureAndClamp);
|
|
10731
|
-
return () => {
|
|
10732
|
-
resizeObserver.disconnect();
|
|
10733
|
-
window.removeEventListener("resize", measureAndClamp);
|
|
10734
|
-
};
|
|
10735
|
-
}, [
|
|
10736
|
-
anchorRect.top,
|
|
10737
|
-
isMinimizedStack,
|
|
10738
|
-
placement,
|
|
10739
|
-
popupCenterY,
|
|
10740
|
-
popupDiagnosticKey
|
|
10741
|
-
]);
|
|
10742
|
-
const registerCard = useCallback11((nodeId) => {
|
|
10743
|
-
const existing = cardRefCallbacksRef.current.get(nodeId);
|
|
10744
|
-
if (existing) {
|
|
10745
|
-
return existing;
|
|
10746
|
-
}
|
|
10747
|
-
const callback = (element) => {
|
|
10748
|
-
if (element) {
|
|
10749
|
-
cardElementsRef.current.set(nodeId, element);
|
|
10750
|
-
} else {
|
|
10751
|
-
cardElementsRef.current.delete(nodeId);
|
|
10752
|
-
}
|
|
10753
|
-
};
|
|
10754
|
-
cardRefCallbacksRef.current.set(nodeId, callback);
|
|
10755
|
-
return callback;
|
|
10756
|
-
}, []);
|
|
10757
|
-
useEffect9(() => {
|
|
10758
|
-
if (!isLeftMinimizedStack) {
|
|
10759
|
-
return;
|
|
10678
|
+
}
|
|
10679
|
+
function WorkbenchHostDockContextMenuSeparator() {
|
|
10680
|
+
return /* @__PURE__ */ jsx11(
|
|
10681
|
+
"div",
|
|
10682
|
+
{
|
|
10683
|
+
"aria-hidden": "true",
|
|
10684
|
+
className: "mx-2 my-1 h-px bg-[var(--border-1)]",
|
|
10685
|
+
role: "separator"
|
|
10760
10686
|
}
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
};
|
|
10782
|
-
const handleKeyDown = (event) => {
|
|
10783
|
-
if (event.key === "Escape") {
|
|
10784
|
-
onClose();
|
|
10687
|
+
);
|
|
10688
|
+
}
|
|
10689
|
+
var WorkbenchHostDockPopupCard = forwardRef(function WorkbenchHostDockPopupCard2({
|
|
10690
|
+
closeWindowLabel,
|
|
10691
|
+
item,
|
|
10692
|
+
labelMode,
|
|
10693
|
+
onCloseNode,
|
|
10694
|
+
onSelectNode,
|
|
10695
|
+
previewState,
|
|
10696
|
+
style,
|
|
10697
|
+
variant
|
|
10698
|
+
}, ref) {
|
|
10699
|
+
const title = item.title?.trim() || item.node.title;
|
|
10700
|
+
const isMinimizedStack = variant === "minimized-stack";
|
|
10701
|
+
const [isLaunching, setIsLaunching] = useState7(false);
|
|
10702
|
+
const launchTimerRef = useRef8(null);
|
|
10703
|
+
useEffect9(
|
|
10704
|
+
() => () => {
|
|
10705
|
+
if (launchTimerRef.current !== null) {
|
|
10706
|
+
clearTimeout(launchTimerRef.current);
|
|
10785
10707
|
}
|
|
10786
|
-
}
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
window.removeEventListener("pointerdown", handlePointerDown, true);
|
|
10791
|
-
window.removeEventListener("keydown", handleKeyDown);
|
|
10792
|
-
};
|
|
10793
|
-
}, [onClose]);
|
|
10794
|
-
const previewCaptureKey = items.map((item) => {
|
|
10795
|
-
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10796
|
-
item.node,
|
|
10797
|
-
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
10798
|
-
);
|
|
10799
|
-
return [
|
|
10800
|
-
previewMemoryKey,
|
|
10801
|
-
item.isMinimized ? "minimized" : "visible",
|
|
10802
|
-
previewCacheToken(item.preview),
|
|
10803
|
-
item.previewRevision ?? ""
|
|
10804
|
-
].join(":");
|
|
10805
|
-
}).join("|");
|
|
10806
|
-
useEffect9(() => {
|
|
10807
|
-
if (!isMinimizedStack) {
|
|
10808
|
-
return;
|
|
10809
|
-
}
|
|
10810
|
-
setMinimizedStackScrollOffset(initialMinimizedStackScrollOffset);
|
|
10811
|
-
}, [initialMinimizedStackScrollOffset, isMinimizedStack, items.length]);
|
|
10812
|
-
useEffect9(() => {
|
|
10708
|
+
},
|
|
10709
|
+
[]
|
|
10710
|
+
);
|
|
10711
|
+
const handleSelect = useCallback11(() => {
|
|
10813
10712
|
if (!isMinimizedStack) {
|
|
10713
|
+
onSelectNode(item.node.id);
|
|
10814
10714
|
return;
|
|
10815
10715
|
}
|
|
10816
|
-
|
|
10817
|
-
if (!viewport) {
|
|
10716
|
+
if (launchTimerRef.current !== null) {
|
|
10818
10717
|
return;
|
|
10819
10718
|
}
|
|
10820
|
-
|
|
10719
|
+
setIsLaunching(true);
|
|
10720
|
+
launchTimerRef.current = setTimeout(() => {
|
|
10721
|
+
launchTimerRef.current = null;
|
|
10722
|
+
onSelectNode(item.node.id);
|
|
10723
|
+
}, dockPopupMinimizedStackLaunchDisappearMs);
|
|
10724
|
+
}, [isMinimizedStack, item.node.id, onSelectNode]);
|
|
10725
|
+
const handleSelectKeyDown = useCallback11(
|
|
10726
|
+
(event) => {
|
|
10727
|
+
if (event.key !== "Enter" && event.key !== " ") {
|
|
10728
|
+
return;
|
|
10729
|
+
}
|
|
10821
10730
|
event.preventDefault();
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
|
|
10869
|
-
|
|
10731
|
+
handleSelect();
|
|
10732
|
+
},
|
|
10733
|
+
[handleSelect]
|
|
10734
|
+
);
|
|
10735
|
+
const hasReadyPreview = previewState.status === "ready";
|
|
10736
|
+
return /* @__PURE__ */ jsxs8(
|
|
10737
|
+
"div",
|
|
10738
|
+
{
|
|
10739
|
+
ref,
|
|
10740
|
+
className: cn(
|
|
10741
|
+
"group/dock-popup-card relative flex h-[103px] w-[165px] min-w-0 flex-col overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-background-fronted text-left text-[var(--text-primary)] transition-[border-color,color] duration-150",
|
|
10742
|
+
item.isMinimized && "text-[var(--text-secondary)]"
|
|
10743
|
+
),
|
|
10744
|
+
"data-active": item.isFocused ? "true" : void 0,
|
|
10745
|
+
"data-desktop-dock-popup-card": "true",
|
|
10746
|
+
"data-fan-card": isMinimizedStack ? "true" : void 0,
|
|
10747
|
+
"data-launching": isLaunching ? "true" : void 0,
|
|
10748
|
+
"data-minimized": item.isMinimized ? "true" : void 0,
|
|
10749
|
+
style,
|
|
10750
|
+
children: [
|
|
10751
|
+
/* @__PURE__ */ jsxs8(
|
|
10752
|
+
"div",
|
|
10753
|
+
{
|
|
10754
|
+
"aria-label": title,
|
|
10755
|
+
"data-active": item.isFocused ? "true" : void 0,
|
|
10756
|
+
className: cn(
|
|
10757
|
+
"relative flex min-h-0 min-w-0 flex-1 cursor-pointer flex-col overflow-hidden rounded-md bg-transparent text-inherit",
|
|
10758
|
+
hasReadyPreview ? "p-0" : "p-1"
|
|
10759
|
+
),
|
|
10760
|
+
role: "button",
|
|
10761
|
+
tabIndex: 0,
|
|
10762
|
+
onClick: handleSelect,
|
|
10763
|
+
onKeyDown: handleSelectKeyDown,
|
|
10764
|
+
children: [
|
|
10765
|
+
/* @__PURE__ */ jsx11(WorkbenchHostDockPopupCardPreview, { previewState }),
|
|
10766
|
+
labelMode === "hover-overlay" && item.title?.trim() ? /* @__PURE__ */ jsx11(WorkbenchHostDockPopupCardLabel, { title: item.title }) : null
|
|
10767
|
+
]
|
|
10768
|
+
}
|
|
10769
|
+
),
|
|
10770
|
+
/* @__PURE__ */ jsx11(
|
|
10771
|
+
Button2,
|
|
10772
|
+
{
|
|
10773
|
+
"aria-label": closeWindowLabel(title),
|
|
10774
|
+
className: "absolute top-1.5 right-1.5 z-[2] rounded-full bg-[var(--background-fronted)] opacity-0 transition-[background-color,opacity] duration-150 hover:bg-[var(--background-fronted)] focus-visible:bg-[var(--background-fronted)] group-hover/dock-popup-card:opacity-100 group-focus-within/dock-popup-card:opacity-100 focus-visible:opacity-100",
|
|
10775
|
+
size: "icon-sm",
|
|
10776
|
+
title: closeWindowLabel(title),
|
|
10777
|
+
type: "button",
|
|
10778
|
+
variant: "ghost",
|
|
10779
|
+
onClick: (event) => {
|
|
10780
|
+
event.preventDefault();
|
|
10781
|
+
event.stopPropagation();
|
|
10782
|
+
onCloseNode(item.node.id);
|
|
10783
|
+
},
|
|
10784
|
+
children: /* @__PURE__ */ jsx11(CloseIcon, { className: "size-3.5" })
|
|
10785
|
+
}
|
|
10786
|
+
),
|
|
10787
|
+
item.isFocused ? /* @__PURE__ */ jsx11(
|
|
10788
|
+
"span",
|
|
10789
|
+
{
|
|
10790
|
+
"aria-hidden": "true",
|
|
10791
|
+
className: "pointer-events-none absolute inset-0 z-[3] rounded-md shadow-[inset_0_0_0_2px_var(--border-focus)]",
|
|
10792
|
+
"data-desktop-dock-popup-card-active-overlay": "true"
|
|
10793
|
+
}
|
|
10794
|
+
) : null,
|
|
10795
|
+
isMinimizedStack ? /* @__PURE__ */ jsx11("span", { className: "desktop-dock-popup__fan-title-tip", title, children: title }) : null
|
|
10796
|
+
]
|
|
10797
|
+
}
|
|
10798
|
+
);
|
|
10799
|
+
});
|
|
10800
|
+
function WorkbenchHostDockPopupCardPreview({
|
|
10801
|
+
previewState
|
|
10802
|
+
}) {
|
|
10803
|
+
if (previewState.status === "loading") {
|
|
10804
|
+
return /* @__PURE__ */ jsxs8(
|
|
10805
|
+
"span",
|
|
10806
|
+
{
|
|
10807
|
+
className: "flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-[7px] rounded-md border border-[var(--border-1)] bg-transparency-block px-3 py-[11px]",
|
|
10808
|
+
"aria-hidden": "true",
|
|
10809
|
+
"data-preview-state": previewState.status,
|
|
10810
|
+
children: [
|
|
10811
|
+
/* @__PURE__ */ jsx11("span", { className: "block h-[7px] w-[72%] rounded-full bg-transparency-hover" }),
|
|
10812
|
+
/* @__PURE__ */ jsx11("span", { className: "block h-[7px] w-[58%] rounded-full bg-transparency-hover" }),
|
|
10813
|
+
/* @__PURE__ */ jsx11("span", { className: "block h-[7px] w-[34%] rounded-full bg-transparency-hover" })
|
|
10814
|
+
]
|
|
10815
|
+
}
|
|
10816
|
+
);
|
|
10817
|
+
}
|
|
10818
|
+
if (previewState.status === "fallback") {
|
|
10819
|
+
return /* @__PURE__ */ jsx11(
|
|
10820
|
+
"span",
|
|
10821
|
+
{
|
|
10822
|
+
className: "flex min-h-0 min-w-0 flex-1 rounded-md border border-[var(--border-1)] bg-transparency-block",
|
|
10823
|
+
"aria-hidden": "true",
|
|
10824
|
+
"data-preview-state": previewState.status
|
|
10825
|
+
}
|
|
10826
|
+
);
|
|
10827
|
+
}
|
|
10828
|
+
const preview = previewState.preview;
|
|
10829
|
+
if (preview.kind === "component") {
|
|
10830
|
+
return /* @__PURE__ */ jsx11(
|
|
10831
|
+
"span",
|
|
10832
|
+
{
|
|
10833
|
+
className: "block min-h-0 min-w-0 flex-1 overflow-hidden rounded-md",
|
|
10834
|
+
"aria-hidden": "true",
|
|
10835
|
+
"data-preview-kind": preview.kind,
|
|
10836
|
+
"data-preview-state": previewState.status,
|
|
10837
|
+
children: preview.element
|
|
10838
|
+
}
|
|
10839
|
+
);
|
|
10840
|
+
}
|
|
10841
|
+
return /* @__PURE__ */ jsx11(
|
|
10842
|
+
"span",
|
|
10843
|
+
{
|
|
10844
|
+
className: "block min-h-0 min-w-0 flex-1 overflow-hidden rounded-md",
|
|
10845
|
+
"aria-hidden": "true",
|
|
10846
|
+
"data-preview-kind": preview.kind,
|
|
10847
|
+
"data-preview-state": previewState.status,
|
|
10848
|
+
children: /* @__PURE__ */ jsx11(
|
|
10849
|
+
"img",
|
|
10850
|
+
{
|
|
10851
|
+
alt: "",
|
|
10852
|
+
className: "block h-full max-h-full w-full max-w-full object-contain object-center",
|
|
10853
|
+
draggable: false,
|
|
10854
|
+
src: preview.src
|
|
10855
|
+
}
|
|
10856
|
+
)
|
|
10857
|
+
}
|
|
10858
|
+
);
|
|
10859
|
+
}
|
|
10860
|
+
function WorkbenchHostDockPopupCardLabel({ title }) {
|
|
10861
|
+
return /* @__PURE__ */ jsx11(
|
|
10862
|
+
"span",
|
|
10863
|
+
{
|
|
10864
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 z-[1] flex h-[30px] items-end px-[10px] pb-0.5 text-[var(--white-stationary)] opacity-0 transition-opacity duration-150 [text-shadow:0_1px_2px_rgb(0_0_0_/_20%)] group-hover/dock-popup-card:opacity-100 group-focus-within/dock-popup-card:opacity-100",
|
|
10865
|
+
style: {
|
|
10866
|
+
background: "linear-gradient(180deg, transparent 0%, color-mix(in srgb, hsl(var(--card)) 28%, transparent) 18%, color-mix(in srgb, hsl(var(--card)) 82%, transparent) 56%, color-mix(in srgb, hsl(var(--card)) 98%, transparent) 100%)"
|
|
10867
|
+
},
|
|
10868
|
+
title,
|
|
10869
|
+
children: /* @__PURE__ */ jsx11("span", { className: "desktop-dock-popup__title-viewport block min-w-0 flex-1 overflow-hidden whitespace-nowrap", children: /* @__PURE__ */ jsx11("span", { className: "desktop-dock-popup__title-marquee inline-block max-w-full overflow-hidden text-[12px] font-semibold leading-5 text-ellipsis whitespace-nowrap", children: title }) })
|
|
10870
|
+
}
|
|
10871
|
+
);
|
|
10872
|
+
}
|
|
10873
|
+
|
|
10874
|
+
// src/host/useWorkbenchHostDockPopupPreviewCapture.ts
|
|
10875
|
+
import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect6, useRef as useRef9, useState as useState8 } from "react";
|
|
10876
|
+
var dockPopupPreviewCacheMaxEntries = 64;
|
|
10877
|
+
var dockPopupPreviewByMemoryKey = /* @__PURE__ */ new Map();
|
|
10878
|
+
var pendingDockPopupPreviewCaptureKeys = /* @__PURE__ */ new Set();
|
|
10879
|
+
function useWorkbenchHostDockPopupPreviewCapture(input) {
|
|
10880
|
+
const {
|
|
10881
|
+
capturePreview,
|
|
10882
|
+
debugDiagnostics,
|
|
10883
|
+
dockPreviewCache,
|
|
10884
|
+
isContextMenu,
|
|
10885
|
+
items,
|
|
10886
|
+
resolveDockPreviewCacheKey: resolveDockPreviewCacheKey2
|
|
10887
|
+
} = input;
|
|
10888
|
+
const hasCapturePreview = Boolean(capturePreview);
|
|
10889
|
+
const [capturedPreviewByMemoryKey, setCapturedPreviewByMemoryKey] = useState8({});
|
|
10890
|
+
const capturedPreviewByMemoryKeyRef = useRef9(capturedPreviewByMemoryKey);
|
|
10891
|
+
const capturePreviewRef = useRef9(capturePreview);
|
|
10892
|
+
const debugDiagnosticsRef = useRef9(debugDiagnostics);
|
|
10893
|
+
const dockPreviewCacheRef = useRef9(dockPreviewCache);
|
|
10894
|
+
const resolveDockPreviewCacheKeyRef = useRef9(resolveDockPreviewCacheKey2);
|
|
10895
|
+
const isMountedRef = useRef9(false);
|
|
10896
|
+
const isContextMenuRef = useRef9(isContextMenu);
|
|
10897
|
+
const activePreviewCaptureItemStateKeysRef = useRef9(
|
|
10898
|
+
/* @__PURE__ */ new Set()
|
|
10899
|
+
);
|
|
10900
|
+
capturedPreviewByMemoryKeyRef.current = capturedPreviewByMemoryKey;
|
|
10901
|
+
capturePreviewRef.current = capturePreview;
|
|
10902
|
+
debugDiagnosticsRef.current = debugDiagnostics;
|
|
10903
|
+
dockPreviewCacheRef.current = dockPreviewCache;
|
|
10904
|
+
resolveDockPreviewCacheKeyRef.current = resolveDockPreviewCacheKey2;
|
|
10905
|
+
const previewCaptureItemStateKeys = items.map(
|
|
10906
|
+
(item) => resolveDockPopupPreviewItemStateKey(
|
|
10907
|
+
item,
|
|
10908
|
+
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
10909
|
+
)
|
|
10910
|
+
);
|
|
10911
|
+
const previewCaptureKey = previewCaptureItemStateKeys.join("|");
|
|
10912
|
+
useLayoutEffect6(() => {
|
|
10913
|
+
isContextMenuRef.current = isContextMenu;
|
|
10914
|
+
activePreviewCaptureItemStateKeysRef.current = new Set(
|
|
10915
|
+
previewCaptureItemStateKeys
|
|
10916
|
+
);
|
|
10917
|
+
});
|
|
10918
|
+
useEffect10(() => {
|
|
10919
|
+
isMountedRef.current = true;
|
|
10920
|
+
return () => {
|
|
10921
|
+
isMountedRef.current = false;
|
|
10922
|
+
};
|
|
10923
|
+
}, []);
|
|
10924
|
+
useEffect10(() => {
|
|
10925
|
+
if (!capturePreviewRef.current || isContextMenu) {
|
|
10926
|
+
return;
|
|
10927
|
+
}
|
|
10928
|
+
const captureItemStateIsCurrent = (itemStateKey) => isMountedRef.current && !isContextMenuRef.current && activePreviewCaptureItemStateKeysRef.current.has(itemStateKey);
|
|
10929
|
+
let captureEffectActive = true;
|
|
10930
|
+
const ownedCaptureKeys = /* @__PURE__ */ new Set();
|
|
10931
|
+
const startedCaptureKeys = /* @__PURE__ */ new Set();
|
|
10932
|
+
const missingItems = items.filter((item) => {
|
|
10933
|
+
const revision = item.previewRevision;
|
|
10934
|
+
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10935
|
+
item,
|
|
10936
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
10937
|
+
);
|
|
10938
|
+
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
10939
|
+
previewMemoryKey,
|
|
10940
|
+
revision
|
|
10941
|
+
);
|
|
10942
|
+
const capturedPreview = capturedPreviewByMemoryKeyRef.current[previewMemoryKey] ?? readDockPopupPreviewImage(previewMemoryKey);
|
|
10943
|
+
const hasCapturedPreview = capturedPreview !== void 0 && capturedPreview.revision === revision;
|
|
10944
|
+
return !item.preview && !hasCapturedPreview && !pendingDockPopupPreviewCaptureKeys.has(pendingCaptureKey);
|
|
10945
|
+
});
|
|
10946
|
+
if (missingItems.length === 0) {
|
|
10947
|
+
logWorkbenchDockPopupDebug(
|
|
10948
|
+
"dock.popup.preview_capture.batch",
|
|
10949
|
+
debugDiagnosticsRef.current,
|
|
10950
|
+
{
|
|
10951
|
+
itemCount: items.length,
|
|
10952
|
+
missingNodeIds: []
|
|
10953
|
+
}
|
|
10954
|
+
);
|
|
10955
|
+
return;
|
|
10956
|
+
}
|
|
10957
|
+
logWorkbenchDockPopupDebug(
|
|
10958
|
+
"dock.popup.preview_capture.batch",
|
|
10959
|
+
debugDiagnosticsRef.current,
|
|
10870
10960
|
{
|
|
10871
10961
|
itemCount: items.length,
|
|
10872
10962
|
missingNodeIds: missingItems.map((item) => item.node.id)
|
|
@@ -10874,30 +10964,40 @@ function WorkbenchHostDockPopup({
|
|
|
10874
10964
|
);
|
|
10875
10965
|
for (const item of missingItems) {
|
|
10876
10966
|
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10877
|
-
item
|
|
10967
|
+
item,
|
|
10878
10968
|
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
10879
10969
|
);
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
item.previewRevision
|
|
10884
|
-
)
|
|
10970
|
+
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
10971
|
+
previewMemoryKey,
|
|
10972
|
+
item.previewRevision
|
|
10885
10973
|
);
|
|
10974
|
+
pendingDockPopupPreviewCaptureKeys.add(pendingCaptureKey);
|
|
10975
|
+
ownedCaptureKeys.add(pendingCaptureKey);
|
|
10886
10976
|
}
|
|
10887
10977
|
void (async () => {
|
|
10888
10978
|
for (const item of missingItems) {
|
|
10889
|
-
if (
|
|
10979
|
+
if (!captureEffectActive) {
|
|
10890
10980
|
break;
|
|
10891
10981
|
}
|
|
10892
10982
|
const revision = item.previewRevision;
|
|
10983
|
+
const resolvedCacheKey = resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null;
|
|
10893
10984
|
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
10894
|
-
item
|
|
10895
|
-
|
|
10985
|
+
item,
|
|
10986
|
+
resolvedCacheKey
|
|
10896
10987
|
);
|
|
10897
10988
|
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
10898
10989
|
previewMemoryKey,
|
|
10899
10990
|
revision
|
|
10900
10991
|
);
|
|
10992
|
+
const itemStateKey = resolveDockPopupPreviewItemStateKey(
|
|
10993
|
+
item,
|
|
10994
|
+
resolvedCacheKey
|
|
10995
|
+
);
|
|
10996
|
+
if (!captureItemStateIsCurrent(itemStateKey)) {
|
|
10997
|
+
pendingDockPopupPreviewCaptureKeys.delete(pendingCaptureKey);
|
|
10998
|
+
ownedCaptureKeys.delete(pendingCaptureKey);
|
|
10999
|
+
continue;
|
|
11000
|
+
}
|
|
10901
11001
|
startedCaptureKeys.add(pendingCaptureKey);
|
|
10902
11002
|
try {
|
|
10903
11003
|
logWorkbenchDockPopupDebug(
|
|
@@ -10910,7 +11010,7 @@ function WorkbenchHostDockPopup({
|
|
|
10910
11010
|
}
|
|
10911
11011
|
);
|
|
10912
11012
|
const cacheKey = resolveDockPopupPreviewCacheKey(
|
|
10913
|
-
|
|
11013
|
+
resolvedCacheKey,
|
|
10914
11014
|
revision
|
|
10915
11015
|
);
|
|
10916
11016
|
if (item.isMinimized && cacheKey) {
|
|
@@ -10918,8 +11018,8 @@ function WorkbenchHostDockPopup({
|
|
|
10918
11018
|
dockPreviewCacheRef.current,
|
|
10919
11019
|
cacheKey
|
|
10920
11020
|
);
|
|
10921
|
-
if (
|
|
10922
|
-
|
|
11021
|
+
if (!captureItemStateIsCurrent(itemStateKey)) {
|
|
11022
|
+
continue;
|
|
10923
11023
|
}
|
|
10924
11024
|
if (minimizedPersistedPreview) {
|
|
10925
11025
|
const persistedPreview = {
|
|
@@ -10945,16 +11045,18 @@ function WorkbenchHostDockPopup({
|
|
|
10945
11045
|
continue;
|
|
10946
11046
|
}
|
|
10947
11047
|
}
|
|
11048
|
+
const providedPreview = await Promise.resolve(
|
|
11049
|
+
capturePreviewRef.current?.(item) ?? null
|
|
11050
|
+
).catch(() => null);
|
|
11051
|
+
if (!captureItemStateIsCurrent(itemStateKey)) {
|
|
11052
|
+
continue;
|
|
11053
|
+
}
|
|
10948
11054
|
const preview = normalizeDockPopupPreviewContentResult(
|
|
10949
|
-
|
|
10950
|
-
bypassCache: false
|
|
10951
|
-
}) : await Promise.resolve(
|
|
10952
|
-
capturePreviewRef.current?.(item) ?? null
|
|
10953
|
-
).catch(() => null),
|
|
11055
|
+
providedPreview,
|
|
10954
11056
|
revision
|
|
10955
11057
|
);
|
|
10956
|
-
if (
|
|
10957
|
-
|
|
11058
|
+
if (!captureItemStateIsCurrent(itemStateKey)) {
|
|
11059
|
+
continue;
|
|
10958
11060
|
}
|
|
10959
11061
|
logWorkbenchDockPopupDebug(
|
|
10960
11062
|
"dock.popup.preview_capture.resolved",
|
|
@@ -10987,45 +11089,52 @@ function WorkbenchHostDockPopup({
|
|
|
10987
11089
|
dockPreviewCacheRef.current,
|
|
10988
11090
|
cacheKey
|
|
10989
11091
|
) : null;
|
|
10990
|
-
if (
|
|
10991
|
-
|
|
11092
|
+
if (!captureItemStateIsCurrent(itemStateKey)) {
|
|
11093
|
+
continue;
|
|
10992
11094
|
}
|
|
10993
11095
|
if (fallbackPersistedPreview) {
|
|
10994
11096
|
writeCachedWorkbenchNodePreviewImage(
|
|
10995
11097
|
item.node.id,
|
|
10996
11098
|
fallbackPersistedPreview
|
|
10997
11099
|
);
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11100
|
+
const fallbackPreview2 = {
|
|
11101
|
+
kind: "image",
|
|
11102
|
+
src: fallbackPersistedPreview
|
|
11103
|
+
};
|
|
11001
11104
|
writeDockPopupPreviewImage(
|
|
11002
11105
|
previewMemoryKey,
|
|
11003
|
-
|
|
11106
|
+
fallbackPreview2,
|
|
11004
11107
|
revision
|
|
11005
11108
|
);
|
|
11006
11109
|
}
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
}));
|
|
11013
|
-
}
|
|
11110
|
+
const fallbackPreview = fallbackPersistedPreview ? { kind: "image", src: fallbackPersistedPreview } : null;
|
|
11111
|
+
setCapturedPreviewByMemoryKey((current) => ({
|
|
11112
|
+
...current,
|
|
11113
|
+
[previewMemoryKey]: { preview: fallbackPreview, revision }
|
|
11114
|
+
}));
|
|
11014
11115
|
} finally {
|
|
11015
11116
|
pendingDockPopupPreviewCaptureKeys.delete(pendingCaptureKey);
|
|
11117
|
+
ownedCaptureKeys.delete(pendingCaptureKey);
|
|
11016
11118
|
}
|
|
11017
11119
|
}
|
|
11018
11120
|
})().catch(() => {
|
|
11019
|
-
for (const
|
|
11121
|
+
for (const captureKey of ownedCaptureKeys) {
|
|
11122
|
+
pendingDockPopupPreviewCaptureKeys.delete(captureKey);
|
|
11123
|
+
}
|
|
11124
|
+
ownedCaptureKeys.clear();
|
|
11125
|
+
const currentItems = missingItems.filter(
|
|
11126
|
+
(item) => captureItemStateIsCurrent(
|
|
11127
|
+
resolveDockPopupPreviewItemStateKey(
|
|
11128
|
+
item,
|
|
11129
|
+
resolveDockPreviewCacheKeyRef.current?.(item.node) ?? null
|
|
11130
|
+
)
|
|
11131
|
+
)
|
|
11132
|
+
);
|
|
11133
|
+
for (const item of currentItems) {
|
|
11020
11134
|
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
11021
|
-
item
|
|
11135
|
+
item,
|
|
11022
11136
|
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
11023
11137
|
);
|
|
11024
|
-
writeDockPopupPreviewImage(
|
|
11025
|
-
previewMemoryKey,
|
|
11026
|
-
null,
|
|
11027
|
-
item.previewRevision
|
|
11028
|
-
);
|
|
11029
11138
|
pendingDockPopupPreviewCaptureKeys.delete(
|
|
11030
11139
|
resolveDockPopupPreviewCaptureKey(
|
|
11031
11140
|
previewMemoryKey,
|
|
@@ -11033,13 +11142,13 @@ function WorkbenchHostDockPopup({
|
|
|
11033
11142
|
)
|
|
11034
11143
|
);
|
|
11035
11144
|
}
|
|
11036
|
-
if (
|
|
11145
|
+
if (currentItems.length > 0) {
|
|
11037
11146
|
setCapturedPreviewByMemoryKey((current) => ({
|
|
11038
11147
|
...current,
|
|
11039
11148
|
...Object.fromEntries(
|
|
11040
|
-
|
|
11149
|
+
currentItems.map((item) => {
|
|
11041
11150
|
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
11042
|
-
item
|
|
11151
|
+
item,
|
|
11043
11152
|
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
11044
11153
|
);
|
|
11045
11154
|
return [
|
|
@@ -11052,422 +11161,555 @@ function WorkbenchHostDockPopup({
|
|
|
11052
11161
|
}
|
|
11053
11162
|
});
|
|
11054
11163
|
return () => {
|
|
11055
|
-
|
|
11056
|
-
for (const
|
|
11057
|
-
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
);
|
|
11061
|
-
const pendingCaptureKey = resolveDockPopupPreviewCaptureKey(
|
|
11062
|
-
previewMemoryKey,
|
|
11063
|
-
item.previewRevision
|
|
11064
|
-
);
|
|
11065
|
-
if (!startedCaptureKeys.has(pendingCaptureKey)) {
|
|
11066
|
-
pendingDockPopupPreviewCaptureKeys.delete(pendingCaptureKey);
|
|
11164
|
+
captureEffectActive = false;
|
|
11165
|
+
for (const captureKey of ownedCaptureKeys) {
|
|
11166
|
+
if (!startedCaptureKeys.has(captureKey)) {
|
|
11167
|
+
pendingDockPopupPreviewCaptureKeys.delete(captureKey);
|
|
11168
|
+
ownedCaptureKeys.delete(captureKey);
|
|
11067
11169
|
}
|
|
11068
11170
|
}
|
|
11069
11171
|
};
|
|
11070
11172
|
}, [hasCapturePreview, isContextMenu, previewCaptureKey]);
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11078
|
-
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
"aria-label": label,
|
|
11084
|
-
className: cn(
|
|
11085
|
-
"desktop-dock-popup relative origin-bottom rounded-lg border border-[var(--border-1)] bg-background-fronted text-[var(--text-primary)] shadow-panel motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:slide-in-from-bottom-2 motion-safe:duration-[175ms] motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:animate-none",
|
|
11086
|
-
isContextMenu ? "p-1" : "p-3",
|
|
11087
|
-
isLeftMinimizedStack ? "w-full min-w-0 max-w-none" : "w-[min(var(--desktop-dock-popup-width,366px),calc(100vw-32px))]"
|
|
11088
|
-
),
|
|
11089
|
-
"data-desktop-dock-popup-panel": "true",
|
|
11090
|
-
"data-popup-variant": resolvedVariant,
|
|
11091
|
-
onPointerDown: (event) => event.stopPropagation(),
|
|
11092
|
-
onPointerMove: isMinimizedStack ? (event) => setPointer({ x: event.clientX, y: event.clientY }) : void 0,
|
|
11093
|
-
onPointerLeave: isMinimizedStack ? () => setPointer(null) : void 0,
|
|
11094
|
-
role: "dialog",
|
|
11095
|
-
style: panelStyle,
|
|
11096
|
-
children: isContextMenu ? /* @__PURE__ */ jsx11(
|
|
11097
|
-
WorkbenchHostDockContextMenu,
|
|
11098
|
-
{
|
|
11099
|
-
canCreateNew: resolvedShowCreateNewInContextMenu !== false,
|
|
11100
|
-
canEnterFullscreen: canEnterFullscreen === true,
|
|
11101
|
-
canShowAllWindows: canShowAllWindows === true,
|
|
11102
|
-
dockRetention,
|
|
11103
|
-
fullscreenLabel,
|
|
11104
|
-
hideLabel,
|
|
11105
|
-
items,
|
|
11106
|
-
newWindowLabel,
|
|
11107
|
-
onCreateNew,
|
|
11108
|
-
onEnterFullscreen,
|
|
11109
|
-
onHide,
|
|
11110
|
-
onQuit,
|
|
11111
|
-
onRunDockRetentionAction,
|
|
11112
|
-
onSelectNode,
|
|
11113
|
-
onShowAllWindows,
|
|
11114
|
-
quitLabel,
|
|
11115
|
-
showAllWindowsLabel,
|
|
11116
|
-
showOpen: showOpen === true
|
|
11117
|
-
}
|
|
11118
|
-
) : /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
11119
|
-
/* @__PURE__ */ jsx11("div", { className: "mb-2.5 flex items-center justify-between", children: /* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate text-sm font-semibold", children: label }) }),
|
|
11120
|
-
isMinimizedStack ? /* @__PURE__ */ jsx11(
|
|
11121
|
-
"div",
|
|
11122
|
-
{
|
|
11123
|
-
ref: minimizedStackViewportRef,
|
|
11124
|
-
className: "desktop-dock-popup__minimized-stack-viewport",
|
|
11125
|
-
style: {
|
|
11126
|
-
height: minimizedStackViewportHeightPx,
|
|
11127
|
-
...isLeftMinimizedStack ? { paddingLeft: minimizedStackLeftGutterPx } : {}
|
|
11128
|
-
},
|
|
11129
|
-
children: /* @__PURE__ */ jsx11(
|
|
11130
|
-
"div",
|
|
11131
|
-
{
|
|
11132
|
-
className: "desktop-dock-popup__minimized-stack-track",
|
|
11133
|
-
style: {
|
|
11134
|
-
minHeight: minimizedStackTrackHeightPx,
|
|
11135
|
-
transform: `translate(${minimizedStackTrackTranslateXPx}px, ${-minimizedStackScrollOffset}px)`
|
|
11136
|
-
},
|
|
11137
|
-
children: items.map((item, index) => {
|
|
11138
|
-
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
11139
|
-
item.node,
|
|
11140
|
-
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
11141
|
-
);
|
|
11142
|
-
const capturedPreview = capturedPreviewByMemoryKey[previewMemoryKey] !== void 0 ? capturedPreviewByMemoryKey[previewMemoryKey] : readDockPopupPreviewImage(previewMemoryKey);
|
|
11143
|
-
const previewState = resolveDockPopupItemPreviewState(
|
|
11144
|
-
item,
|
|
11145
|
-
capturedPreview,
|
|
11146
|
-
Boolean(capturePreview)
|
|
11147
|
-
);
|
|
11148
|
-
return /* @__PURE__ */ jsx11(
|
|
11149
|
-
WorkbenchHostDockPopupCard,
|
|
11150
|
-
{
|
|
11151
|
-
ref: registerCard(item.node.id),
|
|
11152
|
-
closeWindowLabel,
|
|
11153
|
-
item,
|
|
11154
|
-
labelMode: resolvedLabelMode,
|
|
11155
|
-
onCloseNode,
|
|
11156
|
-
onSelectNode,
|
|
11157
|
-
previewState,
|
|
11158
|
-
style: {
|
|
11159
|
-
...resolvePopupFanCardStyle(
|
|
11160
|
-
index,
|
|
11161
|
-
items.length,
|
|
11162
|
-
placement
|
|
11163
|
-
),
|
|
11164
|
-
...resolvePopupCardMagnificationStyle(
|
|
11165
|
-
pointer,
|
|
11166
|
-
cardElementsRef.current.get(item.node.id) ?? null
|
|
11167
|
-
)
|
|
11168
|
-
},
|
|
11169
|
-
variant: resolvedVariant
|
|
11170
|
-
},
|
|
11171
|
-
item.node.id
|
|
11172
|
-
);
|
|
11173
|
-
})
|
|
11174
|
-
}
|
|
11175
|
-
)
|
|
11176
|
-
}
|
|
11177
|
-
) : /* @__PURE__ */ jsxs8("div", { className: "grid max-h-[min(52vh,420px)] grid-cols-[repeat(var(--desktop-dock-popup-columns,2),165px)] gap-2 overflow-auto overscroll-contain", children: [
|
|
11178
|
-
items.map((item) => {
|
|
11179
|
-
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
11180
|
-
item.node,
|
|
11181
|
-
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
11182
|
-
);
|
|
11183
|
-
const capturedPreview = capturedPreviewByMemoryKey[previewMemoryKey] !== void 0 ? capturedPreviewByMemoryKey[previewMemoryKey] : readDockPopupPreviewImage(previewMemoryKey);
|
|
11184
|
-
const previewState = resolveDockPopupItemPreviewState(
|
|
11185
|
-
item,
|
|
11186
|
-
capturedPreview,
|
|
11187
|
-
Boolean(capturePreview)
|
|
11188
|
-
);
|
|
11189
|
-
return /* @__PURE__ */ jsx11(
|
|
11190
|
-
WorkbenchHostDockPopupCard,
|
|
11191
|
-
{
|
|
11192
|
-
ref: registerCard(item.node.id),
|
|
11193
|
-
closeWindowLabel,
|
|
11194
|
-
item,
|
|
11195
|
-
labelMode: resolvedLabelMode,
|
|
11196
|
-
onCloseNode,
|
|
11197
|
-
onSelectNode,
|
|
11198
|
-
previewState,
|
|
11199
|
-
variant: resolvedVariant
|
|
11200
|
-
},
|
|
11201
|
-
item.node.id
|
|
11202
|
-
);
|
|
11203
|
-
}),
|
|
11204
|
-
showCreateNew !== false ? /* @__PURE__ */ jsxs8(
|
|
11205
|
-
"button",
|
|
11206
|
-
{
|
|
11207
|
-
className: "flex h-[103px] w-[165px] min-w-0 flex-col items-center justify-center gap-2 rounded-[8px] border border-dashed border-[var(--border-1)] bg-transparency-block text-center text-[var(--text-secondary)] transition-colors hover:bg-transparency-hover hover:text-[var(--text-primary)]",
|
|
11208
|
-
type: "button",
|
|
11209
|
-
onClick: onCreateNew,
|
|
11210
|
-
children: [
|
|
11211
|
-
/* @__PURE__ */ jsx11(
|
|
11212
|
-
FileCreateIcon,
|
|
11213
|
-
{
|
|
11214
|
-
"aria-hidden": "true",
|
|
11215
|
-
className: "text-[var(--text-primary)]",
|
|
11216
|
-
size: 28
|
|
11217
|
-
}
|
|
11218
|
-
),
|
|
11219
|
-
/* @__PURE__ */ jsx11("span", { className: "text-xs font-semibold text-[var(--text-primary)]", children: newWindowLabel })
|
|
11220
|
-
]
|
|
11221
|
-
}
|
|
11222
|
-
) : null
|
|
11223
|
-
] })
|
|
11224
|
-
] })
|
|
11225
|
-
}
|
|
11226
|
-
)
|
|
11173
|
+
return {
|
|
11174
|
+
previewStateFor(item) {
|
|
11175
|
+
const previewMemoryKey = resolveDockPopupPreviewMemoryKey(
|
|
11176
|
+
item,
|
|
11177
|
+
resolveDockPreviewCacheKey2?.(item.node) ?? null
|
|
11178
|
+
);
|
|
11179
|
+
const capturedPreview = capturedPreviewByMemoryKey[previewMemoryKey] ?? readDockPopupPreviewImage(previewMemoryKey);
|
|
11180
|
+
return resolveDockPopupItemPreviewState(
|
|
11181
|
+
item,
|
|
11182
|
+
capturedPreview,
|
|
11183
|
+
hasCapturePreview
|
|
11184
|
+
);
|
|
11227
11185
|
}
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11186
|
+
};
|
|
11187
|
+
}
|
|
11188
|
+
function logWorkbenchDockPopupDebug(event, debugDiagnostics, details) {
|
|
11189
|
+
if (!debugDiagnostics?.log) {
|
|
11190
|
+
return;
|
|
11231
11191
|
}
|
|
11232
|
-
|
|
11192
|
+
void Promise.resolve(
|
|
11193
|
+
debugDiagnostics.log({
|
|
11194
|
+
details,
|
|
11195
|
+
event,
|
|
11196
|
+
level: "info",
|
|
11197
|
+
source: "workbench-dock"
|
|
11198
|
+
})
|
|
11199
|
+
).catch(() => void 0);
|
|
11233
11200
|
}
|
|
11234
|
-
function
|
|
11235
|
-
|
|
11201
|
+
function readDockPopupPreviewImage(memoryKey) {
|
|
11202
|
+
return dockPopupPreviewByMemoryKey.get(memoryKey);
|
|
11203
|
+
}
|
|
11204
|
+
function writeDockPopupPreviewImage(memoryKey, preview, revision) {
|
|
11205
|
+
dockPopupPreviewByMemoryKey.delete(memoryKey);
|
|
11206
|
+
dockPopupPreviewByMemoryKey.set(memoryKey, { preview, revision });
|
|
11207
|
+
while (dockPopupPreviewByMemoryKey.size > dockPopupPreviewCacheMaxEntries) {
|
|
11208
|
+
const oldestMemoryKey = dockPopupPreviewByMemoryKey.keys().next().value;
|
|
11209
|
+
if (typeof oldestMemoryKey !== "string") {
|
|
11210
|
+
break;
|
|
11211
|
+
}
|
|
11212
|
+
dockPopupPreviewByMemoryKey.delete(oldestMemoryKey);
|
|
11213
|
+
}
|
|
11214
|
+
}
|
|
11215
|
+
function readPersistedDockPreview(dockPreviewCache, cacheKey) {
|
|
11216
|
+
if (!cacheKey) {
|
|
11217
|
+
return Promise.resolve(null);
|
|
11218
|
+
}
|
|
11219
|
+
return dockPreviewCache?.read(cacheKey).catch(() => null) ?? Promise.resolve(null);
|
|
11220
|
+
}
|
|
11221
|
+
function resolveDockPopupPreviewCacheKey(cacheKey, revision) {
|
|
11222
|
+
return cacheKey ? { ...cacheKey, revision } : null;
|
|
11223
|
+
}
|
|
11224
|
+
function resolveDockPopupPreviewMemoryKey(item, cacheKey) {
|
|
11225
|
+
if (!cacheKey) {
|
|
11226
|
+
return `node:${item.node.id}`;
|
|
11227
|
+
}
|
|
11228
|
+
return `cache:${JSON.stringify({
|
|
11229
|
+
instanceId: cacheKey.instanceId,
|
|
11230
|
+
instanceKey: cacheKey.instanceKey ?? null,
|
|
11231
|
+
nodeId: cacheKey.nodeId,
|
|
11232
|
+
typeId: cacheKey.typeId,
|
|
11233
|
+
workspaceId: cacheKey.workspaceId
|
|
11234
|
+
})}`;
|
|
11235
|
+
}
|
|
11236
|
+
function resolveDockPopupPreviewCaptureKey(memoryKey, revision) {
|
|
11237
|
+
return `${memoryKey}\0${revision ?? ""}`;
|
|
11238
|
+
}
|
|
11239
|
+
function resolveDockPopupPreviewItemStateKey(item, cacheKey) {
|
|
11240
|
+
return [
|
|
11241
|
+
resolveDockPopupPreviewMemoryKey(item, cacheKey),
|
|
11242
|
+
item.isMinimized ? "minimized" : "visible",
|
|
11243
|
+
previewCacheToken(item.preview),
|
|
11244
|
+
item.previewRevision ?? ""
|
|
11245
|
+
].join(":");
|
|
11246
|
+
}
|
|
11247
|
+
function normalizeDockPopupPreviewContentResult(preview, revision) {
|
|
11248
|
+
if (!preview) {
|
|
11249
|
+
return null;
|
|
11250
|
+
}
|
|
11251
|
+
if (typeof preview === "string") {
|
|
11252
|
+
return { kind: "image", revision: revision ?? void 0, src: preview };
|
|
11253
|
+
}
|
|
11254
|
+
return {
|
|
11255
|
+
...preview,
|
|
11256
|
+
revision: preview.revision ?? revision ?? void 0
|
|
11257
|
+
};
|
|
11258
|
+
}
|
|
11259
|
+
function resolveDockPopupItemPreviewState(item, capturedPreview, hasPreviewProvider) {
|
|
11260
|
+
const revision = item.previewRevision;
|
|
11261
|
+
if (item.preview) {
|
|
11262
|
+
return { preview: item.preview, status: "ready" };
|
|
11263
|
+
}
|
|
11264
|
+
if (capturedPreview && capturedPreview.revision === revision && capturedPreview.preview) {
|
|
11265
|
+
return { preview: capturedPreview.preview, status: "ready" };
|
|
11266
|
+
}
|
|
11267
|
+
if (capturedPreview !== void 0 && capturedPreview.revision === revision || !hasPreviewProvider) {
|
|
11268
|
+
return { status: "fallback" };
|
|
11269
|
+
}
|
|
11270
|
+
return { status: "loading" };
|
|
11271
|
+
}
|
|
11272
|
+
function previewCacheToken(preview) {
|
|
11273
|
+
if (!preview) {
|
|
11274
|
+
return "";
|
|
11275
|
+
}
|
|
11276
|
+
switch (preview.kind) {
|
|
11277
|
+
case "component":
|
|
11278
|
+
return `component:${preview.revision ?? ""}`;
|
|
11279
|
+
case "image":
|
|
11280
|
+
return `image:${preview.revision ?? ""}:${preview.src}`;
|
|
11281
|
+
}
|
|
11282
|
+
}
|
|
11283
|
+
|
|
11284
|
+
// src/host/WorkbenchHostDockPopup.tsx
|
|
11285
|
+
import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
11286
|
+
var dockPopupCardWidthPx = 165;
|
|
11287
|
+
var dockPopupCardHeightPx = 103;
|
|
11288
|
+
var dockPopupPreviewInsetPx = 4;
|
|
11289
|
+
var workbenchHostDockPopupPreviewViewport = Object.freeze({
|
|
11290
|
+
height: dockPopupCardHeightPx - dockPopupPreviewInsetPx * 2,
|
|
11291
|
+
width: dockPopupCardWidthPx - dockPopupPreviewInsetPx * 2
|
|
11292
|
+
});
|
|
11293
|
+
var dockPopupGridGapPx = 8;
|
|
11294
|
+
var dockPopupPanelPaddingInlinePx = 12;
|
|
11295
|
+
var dockPopupPanelBorderInlinePx = 2;
|
|
11296
|
+
var dockPopupPlacementGapPx = 14;
|
|
11297
|
+
var dockPopupMinimizedStackPopupZIndex = 100300;
|
|
11298
|
+
function WorkbenchHostDockPopup({
|
|
11299
|
+
anchorRect,
|
|
11236
11300
|
canEnterFullscreen,
|
|
11237
11301
|
canShowAllWindows,
|
|
11302
|
+
capturePreview,
|
|
11303
|
+
debugDiagnostics,
|
|
11238
11304
|
dockRetention,
|
|
11305
|
+
dockPreviewCache,
|
|
11239
11306
|
fullscreenLabel,
|
|
11240
11307
|
hideLabel,
|
|
11241
11308
|
items,
|
|
11309
|
+
label,
|
|
11310
|
+
labelMode,
|
|
11242
11311
|
newWindowLabel,
|
|
11312
|
+
closeWindowLabel,
|
|
11313
|
+
onClose,
|
|
11314
|
+
onCloseNode,
|
|
11243
11315
|
onCreateNew,
|
|
11244
11316
|
onEnterFullscreen,
|
|
11245
11317
|
onHide,
|
|
11246
|
-
onQuit,
|
|
11247
11318
|
onRunDockRetentionAction,
|
|
11248
11319
|
onSelectNode,
|
|
11249
11320
|
onShowAllWindows,
|
|
11321
|
+
onQuit,
|
|
11322
|
+
placement = "bottom",
|
|
11250
11323
|
quitLabel,
|
|
11324
|
+
resolveDockPreviewCacheKey: resolveDockPreviewCacheKey2,
|
|
11251
11325
|
showAllWindowsLabel,
|
|
11252
|
-
|
|
11326
|
+
showCreateNew,
|
|
11327
|
+
showCreateNewInContextMenu,
|
|
11328
|
+
showOpen,
|
|
11329
|
+
variant
|
|
11253
11330
|
}) {
|
|
11254
|
-
const
|
|
11255
|
-
const
|
|
11256
|
-
const
|
|
11257
|
-
const
|
|
11258
|
-
const
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
"data-desktop-dock-context-menu": "true",
|
|
11264
|
-
role: "menu",
|
|
11265
|
-
children: [
|
|
11266
|
-
hasOpenWindows ? /* @__PURE__ */ jsx11(Fragment4, { children: /* @__PURE__ */ jsx11("div", { className: "max-h-48 min-w-0 overflow-auto overscroll-contain", children: items.map((item) => /* @__PURE__ */ jsx11(
|
|
11267
|
-
WorkbenchHostDockContextMenuItem,
|
|
11268
|
-
{
|
|
11269
|
-
checked: !item.isMinimized,
|
|
11270
|
-
label: item.title?.trim() || item.node.title,
|
|
11271
|
-
onSelect: () => onSelectNode(item.node.id)
|
|
11272
|
-
},
|
|
11273
|
-
item.node.id
|
|
11274
|
-
)) }) }) : null,
|
|
11275
|
-
hasOpenWindows && (hasDockActionGroup || hasWindowActionGroup) ? /* @__PURE__ */ jsx11(WorkbenchHostDockContextMenuSeparator, {}) : null,
|
|
11276
|
-
dockRetention ? /* @__PURE__ */ jsx11(
|
|
11277
|
-
WorkbenchHostDockContextMenuItem,
|
|
11278
|
-
{
|
|
11279
|
-
checked: dockRetention.checked,
|
|
11280
|
-
checkedIcon: /* @__PURE__ */ jsx11(
|
|
11281
|
-
PinFilledIcon,
|
|
11282
|
-
{
|
|
11283
|
-
"aria-hidden": "true",
|
|
11284
|
-
className: "size-4 text-[var(--tutti-purple)]"
|
|
11285
|
-
}
|
|
11286
|
-
),
|
|
11287
|
-
disabled: dockRetention.disabled,
|
|
11288
|
-
icon: /* @__PURE__ */ jsx11(PinIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11289
|
-
label: dockRetention.pendingLabel ?? dockRetention.label,
|
|
11290
|
-
onSelect: onRunDockRetentionAction
|
|
11291
|
-
}
|
|
11292
|
-
) : null,
|
|
11293
|
-
hasNewWindowCommand ? /* @__PURE__ */ jsx11(
|
|
11294
|
-
WorkbenchHostDockContextMenuItem,
|
|
11295
|
-
{
|
|
11296
|
-
icon: /* @__PURE__ */ jsx11(FileCreateIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11297
|
-
label: newWindowLabel,
|
|
11298
|
-
onSelect: onCreateNew
|
|
11299
|
-
}
|
|
11300
|
-
) : null,
|
|
11301
|
-
hasOpenCommand ? /* @__PURE__ */ jsx11(
|
|
11302
|
-
WorkbenchHostDockContextMenuItem,
|
|
11303
|
-
{
|
|
11304
|
-
disabled: !showOpen,
|
|
11305
|
-
icon: /* @__PURE__ */ jsx11(FileCreateIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11306
|
-
label: newWindowLabel,
|
|
11307
|
-
onSelect: onCreateNew
|
|
11308
|
-
}
|
|
11309
|
-
) : null,
|
|
11310
|
-
hasOpenWindows ? /* @__PURE__ */ jsxs8(Fragment4, { children: [
|
|
11311
|
-
hasDockActionGroup ? /* @__PURE__ */ jsx11(WorkbenchHostDockContextMenuSeparator, {}) : null,
|
|
11312
|
-
canShowAllWindows && onShowAllWindows ? /* @__PURE__ */ jsx11(
|
|
11313
|
-
WorkbenchHostDockContextMenuItem,
|
|
11314
|
-
{
|
|
11315
|
-
icon: /* @__PURE__ */ jsx11(OverviewLayoutIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11316
|
-
label: showAllWindowsLabel,
|
|
11317
|
-
onSelect: onShowAllWindows
|
|
11318
|
-
}
|
|
11319
|
-
) : null,
|
|
11320
|
-
/* @__PURE__ */ jsx11(
|
|
11321
|
-
WorkbenchHostDockContextMenuItem,
|
|
11322
|
-
{
|
|
11323
|
-
disabled: !canEnterFullscreen || !onEnterFullscreen,
|
|
11324
|
-
icon: /* @__PURE__ */ jsx11(MaximizeIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11325
|
-
label: fullscreenLabel,
|
|
11326
|
-
onSelect: onEnterFullscreen
|
|
11327
|
-
}
|
|
11328
|
-
),
|
|
11329
|
-
/* @__PURE__ */ jsx11(
|
|
11330
|
-
WorkbenchHostDockContextMenuItem,
|
|
11331
|
-
{
|
|
11332
|
-
disabled: !onHide,
|
|
11333
|
-
icon: /* @__PURE__ */ jsx11(MinimizeIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11334
|
-
label: hideLabel,
|
|
11335
|
-
onSelect: onHide
|
|
11336
|
-
}
|
|
11337
|
-
),
|
|
11338
|
-
/* @__PURE__ */ jsx11(
|
|
11339
|
-
WorkbenchHostDockContextMenuItem,
|
|
11340
|
-
{
|
|
11341
|
-
disabled: !onQuit,
|
|
11342
|
-
icon: /* @__PURE__ */ jsx11(CloseIcon, { "aria-hidden": "true", className: "size-4" }),
|
|
11343
|
-
label: quitLabel,
|
|
11344
|
-
onSelect: onQuit
|
|
11345
|
-
}
|
|
11346
|
-
)
|
|
11347
|
-
] }) : null
|
|
11348
|
-
]
|
|
11349
|
-
}
|
|
11331
|
+
const resolvedShowCreateNewInContextMenu = showCreateNewInContextMenu ?? showCreateNew;
|
|
11332
|
+
const resolvedLabelMode = labelMode ?? "hover-overlay";
|
|
11333
|
+
const resolvedVariant = variant ?? "default";
|
|
11334
|
+
const isMinimizedStack = resolvedVariant === "minimized-stack";
|
|
11335
|
+
const isContextMenu = resolvedVariant === "context-menu";
|
|
11336
|
+
const createCardCount = showCreateNew === false ? 0 : 1;
|
|
11337
|
+
const cardElementsRef = useRef10(/* @__PURE__ */ new Map());
|
|
11338
|
+
const cardRefCallbacksRef = useRef10(
|
|
11339
|
+
/* @__PURE__ */ new Map()
|
|
11350
11340
|
);
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
onClick: () => {
|
|
11371
|
-
if (disabled || !onSelect) {
|
|
11372
|
-
return;
|
|
11373
|
-
}
|
|
11374
|
-
onSelect();
|
|
11375
|
-
},
|
|
11376
|
-
children: [
|
|
11377
|
-
/* @__PURE__ */ jsx11("span", { className: "flex size-4 shrink-0 items-center justify-center text-[var(--text-secondary)]", children: checked && checkedIcon ? checkedIcon : checked ? /* @__PURE__ */ jsx11(
|
|
11378
|
-
CheckIcon,
|
|
11379
|
-
{
|
|
11380
|
-
"aria-hidden": "true",
|
|
11381
|
-
className: "size-4 text-[var(--tutti-purple)]"
|
|
11382
|
-
}
|
|
11383
|
-
) : icon ?? null }),
|
|
11384
|
-
/* @__PURE__ */ jsx11("span", { className: "min-w-0 truncate", children: label })
|
|
11385
|
-
]
|
|
11386
|
-
}
|
|
11341
|
+
const popupRootRef = useRef10(null);
|
|
11342
|
+
const minimizedStackViewportRef = useRef10(null);
|
|
11343
|
+
const [pointer, setPointer] = useState9(null);
|
|
11344
|
+
const [minimizedStackScrollOffset, setMinimizedStackScrollOffset] = useState9(0);
|
|
11345
|
+
const [verticalClampOffsetPx, setVerticalClampOffsetPx] = useState9(0);
|
|
11346
|
+
const { previewStateFor } = useWorkbenchHostDockPopupPreviewCapture({
|
|
11347
|
+
capturePreview,
|
|
11348
|
+
debugDiagnostics,
|
|
11349
|
+
dockPreviewCache,
|
|
11350
|
+
isContextMenu,
|
|
11351
|
+
items,
|
|
11352
|
+
resolveDockPreviewCacheKey: resolveDockPreviewCacheKey2
|
|
11353
|
+
});
|
|
11354
|
+
const columnCount = isContextMenu ? 1 : Math.min(Math.max(items.length + createCardCount, 1), 3);
|
|
11355
|
+
const popupWidthPx = isContextMenu ? 268 : columnCount * dockPopupCardWidthPx + Math.max(0, columnCount - 1) * dockPopupGridGapPx + dockPopupPanelPaddingInlinePx * 2 + dockPopupPanelBorderInlinePx;
|
|
11356
|
+
const popupCenterY = anchorRect.top + anchorRect.height / 2;
|
|
11357
|
+
const isLeftMinimizedStack = placement === "left" && isMinimizedStack;
|
|
11358
|
+
const minimizedStackTrackHeightPx = resolveMinimizedStackTrackHeightPx(
|
|
11359
|
+
items.length
|
|
11387
11360
|
);
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11361
|
+
const minimizedStackViewportHeightPx = isMinimizedStack ? resolveMinimizedStackViewportHeightPx({
|
|
11362
|
+
anchorCenterY: popupCenterY,
|
|
11363
|
+
placement,
|
|
11364
|
+
trackHeightPx: minimizedStackTrackHeightPx
|
|
11365
|
+
}) : minimizedStackTrackHeightPx;
|
|
11366
|
+
const minimizedStackTrackTranslateXPx = isMinimizedStack ? resolveMinimizedStackTrackTranslateXPx({
|
|
11367
|
+
itemCount: items.length,
|
|
11368
|
+
placement,
|
|
11369
|
+
scrollOffset: minimizedStackScrollOffset,
|
|
11370
|
+
trackHeightPx: minimizedStackTrackHeightPx,
|
|
11371
|
+
viewportHeightPx: minimizedStackViewportHeightPx
|
|
11372
|
+
}) : 0;
|
|
11373
|
+
const minimizedStackLeftGutterPx = isLeftMinimizedStack ? resolveMinimizedStackLeftGutterPx({
|
|
11374
|
+
itemCount: items.length,
|
|
11375
|
+
placement,
|
|
11376
|
+
scrollOffset: minimizedStackScrollOffset,
|
|
11377
|
+
trackHeightPx: minimizedStackTrackHeightPx,
|
|
11378
|
+
viewportHeightPx: minimizedStackViewportHeightPx,
|
|
11379
|
+
trackTranslateXPx: minimizedStackTrackTranslateXPx
|
|
11380
|
+
}) : 0;
|
|
11381
|
+
const minimizedStackPanelWidthPx = isLeftMinimizedStack ? resolveMinimizedStackPanelWidthPx(items.length, placement, {
|
|
11382
|
+
leftGutterPx: minimizedStackLeftGutterPx
|
|
11383
|
+
}) : null;
|
|
11384
|
+
const popupStyle = {
|
|
11385
|
+
"--desktop-dock-popup-columns": String(columnCount),
|
|
11386
|
+
"--desktop-dock-popup-width": minimizedStackPanelWidthPx != null ? `${minimizedStackPanelWidthPx}px` : `${popupWidthPx}px`,
|
|
11387
|
+
...minimizedStackPanelWidthPx != null ? {
|
|
11388
|
+
"--desktop-dock-minimized-stack-width": `${minimizedStackPanelWidthPx}px`,
|
|
11389
|
+
minWidth: minimizedStackPanelWidthPx,
|
|
11390
|
+
width: minimizedStackPanelWidthPx
|
|
11391
|
+
} : {},
|
|
11392
|
+
left: isLeftMinimizedStack ? resolveMinimizedStackPopupLeftPx({
|
|
11393
|
+
anchorLeft: anchorRect.left,
|
|
11394
|
+
anchorWidth: anchorRect.width,
|
|
11395
|
+
dockRightPx: anchorRect.dockRight,
|
|
11396
|
+
leftGutterPx: minimizedStackLeftGutterPx
|
|
11397
|
+
}) : placement === "left" ? anchorRect.left + anchorRect.width + dockPopupPlacementGapPx : anchorRect.left + anchorRect.width / 2,
|
|
11398
|
+
top: isLeftMinimizedStack ? resolveMinimizedStackPopupTopPx({ anchorTop: anchorRect.top }) : placement === "left" ? popupCenterY : anchorRect.top - dockPopupPlacementGapPx,
|
|
11399
|
+
...isLeftMinimizedStack ? { zIndex: dockPopupMinimizedStackPopupZIndex } : {},
|
|
11400
|
+
...isMinimizedStack ? {} : { "--desktop-dock-popup-clamp-offset": `${verticalClampOffsetPx}px` }
|
|
11401
|
+
};
|
|
11402
|
+
const minimizedStackMaxScrollOffset = Math.max(
|
|
11403
|
+
0,
|
|
11404
|
+
minimizedStackTrackHeightPx - minimizedStackViewportHeightPx
|
|
11397
11405
|
);
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
instanceId: cacheKey.instanceId,
|
|
11414
|
-
instanceKey: cacheKey.instanceKey ?? null,
|
|
11415
|
-
nodeId: cacheKey.nodeId,
|
|
11416
|
-
typeId: cacheKey.typeId,
|
|
11417
|
-
workspaceId: cacheKey.workspaceId
|
|
11418
|
-
})}`;
|
|
11419
|
-
}
|
|
11420
|
-
function resolveDockPopupPreviewCaptureKey(memoryKey, revision) {
|
|
11421
|
-
return `${memoryKey}\0${revision ?? ""}`;
|
|
11422
|
-
}
|
|
11423
|
-
function normalizeDockPopupPreviewContentResult(preview, revision) {
|
|
11424
|
-
if (!preview) {
|
|
11425
|
-
return null;
|
|
11426
|
-
}
|
|
11427
|
-
if (typeof preview === "string") {
|
|
11428
|
-
return { kind: "image", revision: revision ?? void 0, src: preview };
|
|
11429
|
-
}
|
|
11430
|
-
return {
|
|
11431
|
-
...preview,
|
|
11432
|
-
revision: preview.revision ?? revision ?? void 0
|
|
11406
|
+
const initialMinimizedStackScrollOffset = resolveInitialMinimizedStackScrollOffset({
|
|
11407
|
+
maxScrollOffset: minimizedStackMaxScrollOffset
|
|
11408
|
+
});
|
|
11409
|
+
const panelStyle = {
|
|
11410
|
+
"--desktop-dock-popup-columns": String(columnCount),
|
|
11411
|
+
"--desktop-dock-popup-item-count": String(Math.max(1, items.length)),
|
|
11412
|
+
...isMinimizedStack ? {
|
|
11413
|
+
height: minimizedStackViewportHeightPx,
|
|
11414
|
+
minHeight: minimizedStackViewportHeightPx,
|
|
11415
|
+
...isLeftMinimizedStack && minimizedStackPanelWidthPx != null ? {
|
|
11416
|
+
width: minimizedStackPanelWidthPx,
|
|
11417
|
+
minWidth: minimizedStackPanelWidthPx,
|
|
11418
|
+
"--desktop-dock-minimized-stack-left-gutter": `${minimizedStackLeftGutterPx}px`
|
|
11419
|
+
} : {}
|
|
11420
|
+
} : {}
|
|
11433
11421
|
};
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11422
|
+
const popupDiagnosticKey = items.map((item) => item.node.id).join("|");
|
|
11423
|
+
useEffect11(() => {
|
|
11424
|
+
logWorkbenchDockPopupDebug("dock.popup.rendered", debugDiagnostics, {
|
|
11425
|
+
hasCapturePreview: Boolean(capturePreview),
|
|
11426
|
+
itemCount: popupDiagnosticKey ? popupDiagnosticKey.split("|").length : 0,
|
|
11427
|
+
nodeIds: popupDiagnosticKey ? popupDiagnosticKey.split("|") : [],
|
|
11428
|
+
placement,
|
|
11429
|
+
variant: resolvedVariant
|
|
11430
|
+
});
|
|
11431
|
+
}, [
|
|
11432
|
+
capturePreview,
|
|
11433
|
+
debugDiagnostics,
|
|
11434
|
+
placement,
|
|
11435
|
+
popupDiagnosticKey,
|
|
11436
|
+
resolvedVariant
|
|
11437
|
+
]);
|
|
11438
|
+
useLayoutEffect7(() => {
|
|
11439
|
+
const rootElement = popupRootRef.current;
|
|
11440
|
+
const panelElement = rootElement?.querySelector(
|
|
11441
|
+
"[data-desktop-dock-popup-panel]"
|
|
11442
|
+
) ?? null;
|
|
11443
|
+
logWorkbenchDockPopupDebug("dock.popup.layout", debugDiagnostics, {
|
|
11444
|
+
panelRect: panelElement ? rectToDiagnostic(panelElement) : null,
|
|
11445
|
+
rootRect: rootElement ? rectToDiagnostic(rootElement) : null,
|
|
11446
|
+
rootStyle: rootElement ? styleToDiagnostic(rootElement) : null,
|
|
11447
|
+
viewportHeight: window.innerHeight,
|
|
11448
|
+
viewportWidth: window.innerWidth
|
|
11449
|
+
});
|
|
11450
|
+
}, [debugDiagnostics, popupDiagnosticKey]);
|
|
11451
|
+
useLayoutEffect7(() => {
|
|
11452
|
+
if (isMinimizedStack || typeof window === "undefined") {
|
|
11453
|
+
return;
|
|
11454
|
+
}
|
|
11455
|
+
const rootElement = popupRootRef.current;
|
|
11456
|
+
const panelElement = rootElement?.querySelector(
|
|
11457
|
+
"[data-desktop-dock-popup-panel]"
|
|
11458
|
+
);
|
|
11459
|
+
if (!panelElement) {
|
|
11460
|
+
return;
|
|
11461
|
+
}
|
|
11462
|
+
const measureAndClamp = () => {
|
|
11463
|
+
const panelHeightPx = panelElement.offsetHeight;
|
|
11464
|
+
const naturalTopPx = placement === "left" ? popupCenterY - panelHeightPx / 2 : anchorRect.top - dockPopupPlacementGapPx - panelHeightPx;
|
|
11465
|
+
const naturalBottomPx = placement === "left" ? popupCenterY + panelHeightPx / 2 : anchorRect.top - dockPopupPlacementGapPx;
|
|
11466
|
+
const offsetPx = resolveDockPopupVerticalClampOffsetPx({
|
|
11467
|
+
naturalBottomPx,
|
|
11468
|
+
naturalTopPx,
|
|
11469
|
+
viewportHeightPx: window.innerHeight
|
|
11470
|
+
});
|
|
11471
|
+
setVerticalClampOffsetPx(
|
|
11472
|
+
(current) => current === offsetPx ? current : offsetPx
|
|
11473
|
+
);
|
|
11474
|
+
};
|
|
11475
|
+
measureAndClamp();
|
|
11476
|
+
const resizeObserver = new ResizeObserver(measureAndClamp);
|
|
11477
|
+
resizeObserver.observe(panelElement);
|
|
11478
|
+
window.addEventListener("resize", measureAndClamp);
|
|
11479
|
+
return () => {
|
|
11480
|
+
resizeObserver.disconnect();
|
|
11481
|
+
window.removeEventListener("resize", measureAndClamp);
|
|
11482
|
+
};
|
|
11483
|
+
}, [
|
|
11484
|
+
anchorRect.top,
|
|
11485
|
+
isMinimizedStack,
|
|
11486
|
+
placement,
|
|
11487
|
+
popupCenterY,
|
|
11488
|
+
popupDiagnosticKey
|
|
11489
|
+
]);
|
|
11490
|
+
const registerCard = useCallback12((nodeId) => {
|
|
11491
|
+
const existing = cardRefCallbacksRef.current.get(nodeId);
|
|
11492
|
+
if (existing) {
|
|
11493
|
+
return existing;
|
|
11494
|
+
}
|
|
11495
|
+
const callback = (element) => {
|
|
11496
|
+
if (element) {
|
|
11497
|
+
cardElementsRef.current.set(nodeId, element);
|
|
11498
|
+
} else {
|
|
11499
|
+
cardElementsRef.current.delete(nodeId);
|
|
11500
|
+
}
|
|
11501
|
+
};
|
|
11502
|
+
cardRefCallbacksRef.current.set(nodeId, callback);
|
|
11503
|
+
return callback;
|
|
11504
|
+
}, []);
|
|
11505
|
+
useEffect11(() => {
|
|
11506
|
+
if (!isLeftMinimizedStack) {
|
|
11507
|
+
return;
|
|
11508
|
+
}
|
|
11509
|
+
document.body.setAttribute(
|
|
11510
|
+
"data-desktop-dock-minimized-stack-open",
|
|
11511
|
+
"true"
|
|
11512
|
+
);
|
|
11513
|
+
return () => {
|
|
11514
|
+
document.body.removeAttribute("data-desktop-dock-minimized-stack-open");
|
|
11515
|
+
};
|
|
11516
|
+
}, [isLeftMinimizedStack]);
|
|
11517
|
+
useEffect11(() => {
|
|
11518
|
+
const handlePointerDown = (event) => {
|
|
11519
|
+
if (!(event.target instanceof Element)) {
|
|
11520
|
+
onClose();
|
|
11521
|
+
return;
|
|
11522
|
+
}
|
|
11523
|
+
if (event.target.closest("[data-desktop-dock-slot]") || event.target.closest("[data-desktop-dock-popup-card]") || event.target.closest(
|
|
11524
|
+
'.desktop-dock-popup-root:not([data-popup-variant="minimized-stack"])'
|
|
11525
|
+
)) {
|
|
11526
|
+
return;
|
|
11527
|
+
}
|
|
11528
|
+
onClose();
|
|
11529
|
+
};
|
|
11530
|
+
const handleKeyDown = (event) => {
|
|
11531
|
+
if (event.key === "Escape") {
|
|
11532
|
+
onClose();
|
|
11533
|
+
}
|
|
11534
|
+
};
|
|
11535
|
+
window.addEventListener("pointerdown", handlePointerDown, true);
|
|
11536
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
11537
|
+
return () => {
|
|
11538
|
+
window.removeEventListener("pointerdown", handlePointerDown, true);
|
|
11539
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
11540
|
+
};
|
|
11541
|
+
}, [onClose]);
|
|
11542
|
+
useEffect11(() => {
|
|
11543
|
+
if (!isMinimizedStack) {
|
|
11544
|
+
return;
|
|
11545
|
+
}
|
|
11546
|
+
setMinimizedStackScrollOffset(initialMinimizedStackScrollOffset);
|
|
11547
|
+
}, [initialMinimizedStackScrollOffset, isMinimizedStack, items.length]);
|
|
11548
|
+
useEffect11(() => {
|
|
11549
|
+
if (!isMinimizedStack) {
|
|
11550
|
+
return;
|
|
11551
|
+
}
|
|
11552
|
+
const viewport = minimizedStackViewportRef.current;
|
|
11553
|
+
if (!viewport) {
|
|
11554
|
+
return;
|
|
11555
|
+
}
|
|
11556
|
+
const handleWheel = (event) => {
|
|
11557
|
+
event.preventDefault();
|
|
11558
|
+
event.stopPropagation();
|
|
11559
|
+
setMinimizedStackScrollOffset(
|
|
11560
|
+
(current) => Math.min(
|
|
11561
|
+
minimizedStackMaxScrollOffset,
|
|
11562
|
+
Math.max(0, current + event.deltaY)
|
|
11563
|
+
)
|
|
11564
|
+
);
|
|
11565
|
+
};
|
|
11566
|
+
viewport.addEventListener("wheel", handleWheel, { passive: false });
|
|
11567
|
+
return () => viewport.removeEventListener("wheel", handleWheel);
|
|
11568
|
+
}, [isMinimizedStack, minimizedStackMaxScrollOffset]);
|
|
11569
|
+
const content = /* @__PURE__ */ jsx12(
|
|
11570
|
+
"div",
|
|
11571
|
+
{
|
|
11572
|
+
ref: popupRootRef,
|
|
11573
|
+
className: "desktop-dock-popup-root",
|
|
11574
|
+
"data-dock-placement": placement,
|
|
11575
|
+
"data-desktop-dock-popup-root": "true",
|
|
11576
|
+
"data-popup-variant": resolvedVariant,
|
|
11577
|
+
style: popupStyle,
|
|
11578
|
+
children: /* @__PURE__ */ jsx12(
|
|
11579
|
+
"div",
|
|
11580
|
+
{
|
|
11581
|
+
"aria-label": label,
|
|
11582
|
+
className: cn2(
|
|
11583
|
+
"desktop-dock-popup relative origin-bottom rounded-lg border border-[var(--border-1)] bg-background-fronted text-[var(--text-primary)] shadow-panel motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:slide-in-from-bottom-2 motion-safe:duration-[175ms] motion-safe:ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:animate-none",
|
|
11584
|
+
isContextMenu ? "p-1" : "p-3",
|
|
11585
|
+
isLeftMinimizedStack ? "w-full min-w-0 max-w-none" : "w-[min(var(--desktop-dock-popup-width,366px),calc(100vw-32px))]"
|
|
11586
|
+
),
|
|
11587
|
+
"data-desktop-dock-popup-panel": "true",
|
|
11588
|
+
"data-popup-variant": resolvedVariant,
|
|
11589
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
11590
|
+
onPointerMove: isMinimizedStack ? (event) => setPointer({ x: event.clientX, y: event.clientY }) : void 0,
|
|
11591
|
+
onPointerLeave: isMinimizedStack ? () => setPointer(null) : void 0,
|
|
11592
|
+
role: "dialog",
|
|
11593
|
+
style: panelStyle,
|
|
11594
|
+
children: isContextMenu ? /* @__PURE__ */ jsx12(
|
|
11595
|
+
WorkbenchHostDockContextMenu,
|
|
11596
|
+
{
|
|
11597
|
+
canCreateNew: resolvedShowCreateNewInContextMenu !== false,
|
|
11598
|
+
canEnterFullscreen: canEnterFullscreen === true,
|
|
11599
|
+
canShowAllWindows: canShowAllWindows === true,
|
|
11600
|
+
dockRetention,
|
|
11601
|
+
fullscreenLabel,
|
|
11602
|
+
hideLabel,
|
|
11603
|
+
items,
|
|
11604
|
+
newWindowLabel,
|
|
11605
|
+
onCreateNew,
|
|
11606
|
+
onEnterFullscreen,
|
|
11607
|
+
onHide,
|
|
11608
|
+
onQuit,
|
|
11609
|
+
onRunDockRetentionAction,
|
|
11610
|
+
onSelectNode,
|
|
11611
|
+
onShowAllWindows,
|
|
11612
|
+
quitLabel,
|
|
11613
|
+
showAllWindowsLabel,
|
|
11614
|
+
showOpen: showOpen === true
|
|
11615
|
+
}
|
|
11616
|
+
) : /* @__PURE__ */ jsxs9(Fragment5, { children: [
|
|
11617
|
+
/* @__PURE__ */ jsx12("div", { className: "mb-2.5 flex items-center justify-between", children: /* @__PURE__ */ jsx12("span", { className: "min-w-0 truncate text-sm font-semibold", children: label }) }),
|
|
11618
|
+
isMinimizedStack ? /* @__PURE__ */ jsx12(
|
|
11619
|
+
"div",
|
|
11620
|
+
{
|
|
11621
|
+
ref: minimizedStackViewportRef,
|
|
11622
|
+
className: "desktop-dock-popup__minimized-stack-viewport",
|
|
11623
|
+
style: {
|
|
11624
|
+
height: minimizedStackViewportHeightPx,
|
|
11625
|
+
...isLeftMinimizedStack ? { paddingLeft: minimizedStackLeftGutterPx } : {}
|
|
11626
|
+
},
|
|
11627
|
+
children: /* @__PURE__ */ jsx12(
|
|
11628
|
+
"div",
|
|
11629
|
+
{
|
|
11630
|
+
className: "desktop-dock-popup__minimized-stack-track",
|
|
11631
|
+
style: {
|
|
11632
|
+
minHeight: minimizedStackTrackHeightPx,
|
|
11633
|
+
transform: `translate(${minimizedStackTrackTranslateXPx}px, ${-minimizedStackScrollOffset}px)`
|
|
11634
|
+
},
|
|
11635
|
+
children: items.map((item, index) => {
|
|
11636
|
+
const previewState = previewStateFor(item);
|
|
11637
|
+
return /* @__PURE__ */ jsx12(
|
|
11638
|
+
WorkbenchHostDockPopupCard,
|
|
11639
|
+
{
|
|
11640
|
+
ref: registerCard(item.node.id),
|
|
11641
|
+
closeWindowLabel,
|
|
11642
|
+
item,
|
|
11643
|
+
labelMode: resolvedLabelMode,
|
|
11644
|
+
onCloseNode,
|
|
11645
|
+
onSelectNode,
|
|
11646
|
+
previewState,
|
|
11647
|
+
style: {
|
|
11648
|
+
...resolvePopupFanCardStyle(
|
|
11649
|
+
index,
|
|
11650
|
+
items.length,
|
|
11651
|
+
placement
|
|
11652
|
+
),
|
|
11653
|
+
...resolvePopupCardMagnificationStyle(
|
|
11654
|
+
pointer,
|
|
11655
|
+
cardElementsRef.current.get(item.node.id) ?? null
|
|
11656
|
+
)
|
|
11657
|
+
},
|
|
11658
|
+
variant: resolvedVariant
|
|
11659
|
+
},
|
|
11660
|
+
item.node.id
|
|
11661
|
+
);
|
|
11662
|
+
})
|
|
11663
|
+
}
|
|
11664
|
+
)
|
|
11665
|
+
}
|
|
11666
|
+
) : /* @__PURE__ */ jsxs9("div", { className: "grid max-h-[min(52vh,420px)] grid-cols-[repeat(var(--desktop-dock-popup-columns,2),165px)] gap-2 overflow-auto overscroll-contain", children: [
|
|
11667
|
+
items.map((item) => {
|
|
11668
|
+
const previewState = previewStateFor(item);
|
|
11669
|
+
return /* @__PURE__ */ jsx12(
|
|
11670
|
+
WorkbenchHostDockPopupCard,
|
|
11671
|
+
{
|
|
11672
|
+
ref: registerCard(item.node.id),
|
|
11673
|
+
closeWindowLabel,
|
|
11674
|
+
item,
|
|
11675
|
+
labelMode: resolvedLabelMode,
|
|
11676
|
+
onCloseNode,
|
|
11677
|
+
onSelectNode,
|
|
11678
|
+
previewState,
|
|
11679
|
+
variant: resolvedVariant
|
|
11680
|
+
},
|
|
11681
|
+
item.node.id
|
|
11682
|
+
);
|
|
11683
|
+
}),
|
|
11684
|
+
showCreateNew !== false ? /* @__PURE__ */ jsxs9(
|
|
11685
|
+
"button",
|
|
11686
|
+
{
|
|
11687
|
+
className: "flex h-[103px] w-[165px] min-w-0 flex-col items-center justify-center gap-2 rounded-[8px] border border-dashed border-[var(--border-1)] bg-transparency-block text-center text-[var(--text-secondary)] transition-colors hover:bg-transparency-hover hover:text-[var(--text-primary)]",
|
|
11688
|
+
type: "button",
|
|
11689
|
+
onClick: onCreateNew,
|
|
11690
|
+
children: [
|
|
11691
|
+
/* @__PURE__ */ jsx12(
|
|
11692
|
+
FileCreateIcon2,
|
|
11693
|
+
{
|
|
11694
|
+
"aria-hidden": "true",
|
|
11695
|
+
className: "text-[var(--text-primary)]",
|
|
11696
|
+
size: 28
|
|
11697
|
+
}
|
|
11698
|
+
),
|
|
11699
|
+
/* @__PURE__ */ jsx12("span", { className: "text-xs font-semibold text-[var(--text-primary)]", children: newWindowLabel })
|
|
11700
|
+
]
|
|
11701
|
+
}
|
|
11702
|
+
) : null
|
|
11703
|
+
] })
|
|
11704
|
+
] })
|
|
11705
|
+
}
|
|
11706
|
+
)
|
|
11707
|
+
}
|
|
11708
|
+
);
|
|
11709
|
+
if (typeof document === "undefined" || !document.body) {
|
|
11710
|
+
return content;
|
|
11462
11711
|
}
|
|
11463
|
-
|
|
11464
|
-
debugDiagnostics.log({
|
|
11465
|
-
details,
|
|
11466
|
-
event,
|
|
11467
|
-
level: "info",
|
|
11468
|
-
source: "workbench-dock"
|
|
11469
|
-
})
|
|
11470
|
-
).catch(() => void 0);
|
|
11712
|
+
return createPortal3(content, document.body);
|
|
11471
11713
|
}
|
|
11472
11714
|
function rectToDiagnostic(element) {
|
|
11473
11715
|
const rect = element.getBoundingClientRect();
|
|
@@ -11492,183 +11734,9 @@ function styleToDiagnostic(element) {
|
|
|
11492
11734
|
zIndex: style.zIndex
|
|
11493
11735
|
};
|
|
11494
11736
|
}
|
|
11495
|
-
var WorkbenchHostDockPopupCard = forwardRef(function WorkbenchHostDockPopupCard2({
|
|
11496
|
-
closeWindowLabel,
|
|
11497
|
-
item,
|
|
11498
|
-
labelMode,
|
|
11499
|
-
onCloseNode,
|
|
11500
|
-
onSelectNode,
|
|
11501
|
-
previewState,
|
|
11502
|
-
style,
|
|
11503
|
-
variant
|
|
11504
|
-
}, ref) {
|
|
11505
|
-
const title = item.title?.trim() || item.node.title;
|
|
11506
|
-
const isMinimizedStack = variant === "minimized-stack";
|
|
11507
|
-
const [isLaunching, setIsLaunching] = useState7(false);
|
|
11508
|
-
const launchTimerRef = useRef8(null);
|
|
11509
|
-
useEffect9(
|
|
11510
|
-
() => () => {
|
|
11511
|
-
if (launchTimerRef.current !== null) {
|
|
11512
|
-
clearTimeout(launchTimerRef.current);
|
|
11513
|
-
}
|
|
11514
|
-
},
|
|
11515
|
-
[]
|
|
11516
|
-
);
|
|
11517
|
-
const handleSelect = useCallback11(() => {
|
|
11518
|
-
if (!isMinimizedStack) {
|
|
11519
|
-
onSelectNode(item.node.id);
|
|
11520
|
-
return;
|
|
11521
|
-
}
|
|
11522
|
-
if (launchTimerRef.current !== null) {
|
|
11523
|
-
return;
|
|
11524
|
-
}
|
|
11525
|
-
setIsLaunching(true);
|
|
11526
|
-
launchTimerRef.current = setTimeout(() => {
|
|
11527
|
-
launchTimerRef.current = null;
|
|
11528
|
-
onSelectNode(item.node.id);
|
|
11529
|
-
}, dockPopupMinimizedStackLaunchDisappearMs);
|
|
11530
|
-
}, [isMinimizedStack, item.node.id, onSelectNode]);
|
|
11531
|
-
const handleSelectKeyDown = useCallback11(
|
|
11532
|
-
(event) => {
|
|
11533
|
-
if (event.key !== "Enter" && event.key !== " ") {
|
|
11534
|
-
return;
|
|
11535
|
-
}
|
|
11536
|
-
event.preventDefault();
|
|
11537
|
-
handleSelect();
|
|
11538
|
-
},
|
|
11539
|
-
[handleSelect]
|
|
11540
|
-
);
|
|
11541
|
-
const hasReadyPreview = previewState.status === "ready";
|
|
11542
|
-
return /* @__PURE__ */ jsxs8(
|
|
11543
|
-
"div",
|
|
11544
|
-
{
|
|
11545
|
-
ref,
|
|
11546
|
-
className: cn(
|
|
11547
|
-
"group/dock-popup-card relative flex h-[103px] w-[165px] min-w-0 flex-col overflow-hidden rounded-[8px] border border-[var(--border-1)] bg-background-fronted text-left text-[var(--text-primary)] transition-[border-color,color] duration-150",
|
|
11548
|
-
item.isMinimized && "text-[var(--text-secondary)]"
|
|
11549
|
-
),
|
|
11550
|
-
"data-active": item.isFocused ? "true" : void 0,
|
|
11551
|
-
"data-desktop-dock-popup-card": "true",
|
|
11552
|
-
"data-fan-card": isMinimizedStack ? "true" : void 0,
|
|
11553
|
-
"data-launching": isLaunching ? "true" : void 0,
|
|
11554
|
-
"data-minimized": item.isMinimized ? "true" : void 0,
|
|
11555
|
-
style,
|
|
11556
|
-
children: [
|
|
11557
|
-
/* @__PURE__ */ jsxs8(
|
|
11558
|
-
"div",
|
|
11559
|
-
{
|
|
11560
|
-
"aria-label": title,
|
|
11561
|
-
"data-active": item.isFocused ? "true" : void 0,
|
|
11562
|
-
className: cn(
|
|
11563
|
-
"relative flex min-h-0 min-w-0 flex-1 cursor-pointer flex-col overflow-hidden rounded-md bg-transparent text-inherit",
|
|
11564
|
-
hasReadyPreview ? "p-0" : "p-1"
|
|
11565
|
-
),
|
|
11566
|
-
role: "button",
|
|
11567
|
-
tabIndex: 0,
|
|
11568
|
-
onClick: handleSelect,
|
|
11569
|
-
onKeyDown: handleSelectKeyDown,
|
|
11570
|
-
children: [
|
|
11571
|
-
/* @__PURE__ */ jsx11(WorkbenchHostDockPopupCardPreview, { previewState }),
|
|
11572
|
-
labelMode === "hover-overlay" && item.title?.trim() ? /* @__PURE__ */ jsx11(WorkbenchHostDockPopupCardLabel, { title: item.title }) : null
|
|
11573
|
-
]
|
|
11574
|
-
}
|
|
11575
|
-
),
|
|
11576
|
-
/* @__PURE__ */ jsx11(
|
|
11577
|
-
Button2,
|
|
11578
|
-
{
|
|
11579
|
-
"aria-label": closeWindowLabel(title),
|
|
11580
|
-
className: "absolute top-1.5 right-1.5 z-[2] rounded-full bg-[var(--background-fronted)] opacity-0 transition-[background-color,opacity] duration-150 hover:bg-[var(--background-fronted)] focus-visible:bg-[var(--background-fronted)] group-hover/dock-popup-card:opacity-100 group-focus-within/dock-popup-card:opacity-100 focus-visible:opacity-100",
|
|
11581
|
-
size: "icon-sm",
|
|
11582
|
-
title: closeWindowLabel(title),
|
|
11583
|
-
type: "button",
|
|
11584
|
-
variant: "ghost",
|
|
11585
|
-
onClick: (event) => {
|
|
11586
|
-
event.preventDefault();
|
|
11587
|
-
event.stopPropagation();
|
|
11588
|
-
onCloseNode(item.node.id);
|
|
11589
|
-
},
|
|
11590
|
-
children: /* @__PURE__ */ jsx11(CloseIcon, { className: "size-3.5" })
|
|
11591
|
-
}
|
|
11592
|
-
),
|
|
11593
|
-
item.isFocused ? /* @__PURE__ */ jsx11(
|
|
11594
|
-
"span",
|
|
11595
|
-
{
|
|
11596
|
-
"aria-hidden": "true",
|
|
11597
|
-
className: "pointer-events-none absolute inset-0 z-[3] rounded-md shadow-[inset_0_0_0_2px_var(--border-focus)]",
|
|
11598
|
-
"data-desktop-dock-popup-card-active-overlay": "true"
|
|
11599
|
-
}
|
|
11600
|
-
) : null,
|
|
11601
|
-
isMinimizedStack ? /* @__PURE__ */ jsx11("span", { className: "desktop-dock-popup__fan-title-tip", title, children: title }) : null
|
|
11602
|
-
]
|
|
11603
|
-
}
|
|
11604
|
-
);
|
|
11605
|
-
});
|
|
11606
|
-
function WorkbenchHostDockPopupCardPreview({
|
|
11607
|
-
previewState
|
|
11608
|
-
}) {
|
|
11609
|
-
if (previewState.status !== "ready") {
|
|
11610
|
-
return /* @__PURE__ */ jsxs8(
|
|
11611
|
-
"span",
|
|
11612
|
-
{
|
|
11613
|
-
className: "flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-[7px] rounded-md border border-[var(--border-1)] bg-transparency-block px-3 py-[11px]",
|
|
11614
|
-
"aria-hidden": "true",
|
|
11615
|
-
"data-preview-state": previewState.status,
|
|
11616
|
-
children: [
|
|
11617
|
-
/* @__PURE__ */ jsx11("span", { className: "block h-[7px] w-[72%] rounded-full bg-transparency-hover" }),
|
|
11618
|
-
/* @__PURE__ */ jsx11("span", { className: "block h-[7px] w-[58%] rounded-full bg-transparency-hover" }),
|
|
11619
|
-
/* @__PURE__ */ jsx11("span", { className: "block h-[7px] w-[34%] rounded-full bg-transparency-hover" })
|
|
11620
|
-
]
|
|
11621
|
-
}
|
|
11622
|
-
);
|
|
11623
|
-
}
|
|
11624
|
-
const preview = previewState.preview;
|
|
11625
|
-
if (preview.kind === "component") {
|
|
11626
|
-
return /* @__PURE__ */ jsx11(
|
|
11627
|
-
"span",
|
|
11628
|
-
{
|
|
11629
|
-
className: "block min-h-0 min-w-0 flex-1 overflow-hidden rounded-md",
|
|
11630
|
-
"aria-hidden": "true",
|
|
11631
|
-
"data-preview-kind": preview.kind,
|
|
11632
|
-
"data-preview-state": previewState.status,
|
|
11633
|
-
children: preview.element
|
|
11634
|
-
}
|
|
11635
|
-
);
|
|
11636
|
-
}
|
|
11637
|
-
return /* @__PURE__ */ jsx11(
|
|
11638
|
-
"span",
|
|
11639
|
-
{
|
|
11640
|
-
className: "block min-h-0 min-w-0 flex-1 overflow-hidden rounded-md",
|
|
11641
|
-
"aria-hidden": "true",
|
|
11642
|
-
"data-preview-kind": preview.kind,
|
|
11643
|
-
"data-preview-state": previewState.status,
|
|
11644
|
-
children: /* @__PURE__ */ jsx11(
|
|
11645
|
-
"img",
|
|
11646
|
-
{
|
|
11647
|
-
alt: "",
|
|
11648
|
-
className: "block h-full max-h-full w-full max-w-full object-contain object-center",
|
|
11649
|
-
draggable: false,
|
|
11650
|
-
src: preview.src
|
|
11651
|
-
}
|
|
11652
|
-
)
|
|
11653
|
-
}
|
|
11654
|
-
);
|
|
11655
|
-
}
|
|
11656
|
-
function WorkbenchHostDockPopupCardLabel({ title }) {
|
|
11657
|
-
return /* @__PURE__ */ jsx11(
|
|
11658
|
-
"span",
|
|
11659
|
-
{
|
|
11660
|
-
className: "pointer-events-none absolute inset-x-0 bottom-0 z-[1] flex h-[30px] items-end px-[10px] pb-0.5 text-[var(--white-stationary)] opacity-0 transition-opacity duration-150 [text-shadow:0_1px_2px_rgb(0_0_0_/_20%)] group-hover/dock-popup-card:opacity-100 group-focus-within/dock-popup-card:opacity-100",
|
|
11661
|
-
style: {
|
|
11662
|
-
background: "linear-gradient(180deg, transparent 0%, color-mix(in srgb, hsl(var(--card)) 28%, transparent) 18%, color-mix(in srgb, hsl(var(--card)) 82%, transparent) 56%, color-mix(in srgb, hsl(var(--card)) 98%, transparent) 100%)"
|
|
11663
|
-
},
|
|
11664
|
-
title,
|
|
11665
|
-
children: /* @__PURE__ */ jsx11("span", { className: "desktop-dock-popup__title-viewport block min-w-0 flex-1 overflow-hidden whitespace-nowrap", children: /* @__PURE__ */ jsx11("span", { className: "desktop-dock-popup__title-marquee inline-block max-w-full overflow-hidden text-[12px] font-semibold leading-5 text-ellipsis whitespace-nowrap", children: title }) })
|
|
11666
|
-
}
|
|
11667
|
-
);
|
|
11668
|
-
}
|
|
11669
11737
|
|
|
11670
11738
|
// src/host/WorkbenchHostDock.tsx
|
|
11671
|
-
import { jsx as
|
|
11739
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
11672
11740
|
var minimizedDockPreviewViewport = {
|
|
11673
11741
|
height: 34.2,
|
|
11674
11742
|
width: 46.8
|
|
@@ -11717,69 +11785,69 @@ function WorkbenchHostDock({
|
|
|
11717
11785
|
() => new Set(context.minimizedNodes.map((node) => node.id)),
|
|
11718
11786
|
[context.minimizedNodes]
|
|
11719
11787
|
);
|
|
11720
|
-
const dockPlateRef =
|
|
11721
|
-
const dockMeasureRef =
|
|
11722
|
-
const dockItemsRef =
|
|
11723
|
-
const hoverPanelRef =
|
|
11724
|
-
const hoverPanelCloseTimerRef =
|
|
11788
|
+
const dockPlateRef = useRef11(null);
|
|
11789
|
+
const dockMeasureRef = useRef11(null);
|
|
11790
|
+
const dockItemsRef = useRef11(null);
|
|
11791
|
+
const hoverPanelRef = useRef11(null);
|
|
11792
|
+
const hoverPanelCloseTimerRef = useRef11(
|
|
11725
11793
|
null
|
|
11726
11794
|
);
|
|
11727
|
-
const hoverPanelOpenTimerRef =
|
|
11795
|
+
const hoverPanelOpenTimerRef = useRef11(
|
|
11728
11796
|
null
|
|
11729
11797
|
);
|
|
11730
|
-
const labelTooltipOpenTimerRef =
|
|
11798
|
+
const labelTooltipOpenTimerRef = useRef11(
|
|
11731
11799
|
null
|
|
11732
11800
|
);
|
|
11733
|
-
const hoverPanelScheduledPointRef =
|
|
11734
|
-
const labelTooltipScheduledPointRef =
|
|
11735
|
-
const hoverPanelRestTargetRef =
|
|
11736
|
-
const activeHoverPanelRef =
|
|
11801
|
+
const hoverPanelScheduledPointRef = useRef11(null);
|
|
11802
|
+
const labelTooltipScheduledPointRef = useRef11(null);
|
|
11803
|
+
const hoverPanelRestTargetRef = useRef11(null);
|
|
11804
|
+
const activeHoverPanelRef = useRef11(
|
|
11737
11805
|
null
|
|
11738
11806
|
);
|
|
11739
|
-
const activeLabelTooltipRef =
|
|
11740
|
-
const pendingDockStateRefreshRef =
|
|
11741
|
-
const slotRefs =
|
|
11742
|
-
const wallpaperToneElementRefs =
|
|
11743
|
-
const dockSlotRefCallbacksRef =
|
|
11807
|
+
const activeLabelTooltipRef = useRef11(null);
|
|
11808
|
+
const pendingDockStateRefreshRef = useRef11(false);
|
|
11809
|
+
const slotRefs = useRef11(/* @__PURE__ */ new Map());
|
|
11810
|
+
const wallpaperToneElementRefs = useRef11(/* @__PURE__ */ new Map());
|
|
11811
|
+
const dockSlotRefCallbacksRef = useRef11(
|
|
11744
11812
|
/* @__PURE__ */ new Map()
|
|
11745
11813
|
);
|
|
11746
|
-
const previousAttentionTokenByEntryId =
|
|
11747
|
-
const dockEntryClickThrottleUntilRef =
|
|
11748
|
-
const attentionTimeouts =
|
|
11814
|
+
const previousAttentionTokenByEntryId = useRef11(/* @__PURE__ */ new Map());
|
|
11815
|
+
const dockEntryClickThrottleUntilRef = useRef11(/* @__PURE__ */ new Map());
|
|
11816
|
+
const attentionTimeouts = useRef11(
|
|
11749
11817
|
/* @__PURE__ */ new Map()
|
|
11750
11818
|
);
|
|
11751
|
-
const [activeAttentionEntryIds, setActiveAttentionEntryIds] =
|
|
11752
|
-
const [activePopup, setActivePopup] =
|
|
11753
|
-
const [activeHoverPanel, setActiveHoverPanel] =
|
|
11754
|
-
const [activeLabelTooltip, setActiveLabelTooltip] =
|
|
11755
|
-
const [activeMinimizedStackPopup, setActiveMinimizedStackPopup] =
|
|
11756
|
-
const [pendingActionKeys, setPendingActionKeys] =
|
|
11819
|
+
const [activeAttentionEntryIds, setActiveAttentionEntryIds] = useState10(/* @__PURE__ */ new Set());
|
|
11820
|
+
const [activePopup, setActivePopup] = useState10(null);
|
|
11821
|
+
const [activeHoverPanel, setActiveHoverPanel] = useState10(null);
|
|
11822
|
+
const [activeLabelTooltip, setActiveLabelTooltip] = useState10(null);
|
|
11823
|
+
const [activeMinimizedStackPopup, setActiveMinimizedStackPopup] = useState10(null);
|
|
11824
|
+
const [pendingActionKeys, setPendingActionKeys] = useState10(
|
|
11757
11825
|
() => /* @__PURE__ */ new Set()
|
|
11758
11826
|
);
|
|
11759
|
-
const [dockFrameSize, setDockFrameSize] =
|
|
11827
|
+
const [dockFrameSize, setDockFrameSize] = useState10(null);
|
|
11760
11828
|
const { triggerDockBounce } = useDockBounce(slotRefs);
|
|
11761
|
-
const [dockScrollState, setDockScrollState] =
|
|
11829
|
+
const [dockScrollState, setDockScrollState] = useState10(() => ({
|
|
11762
11830
|
canScrollBackward: false,
|
|
11763
11831
|
canScrollForward: false,
|
|
11764
11832
|
hasOverflow: false
|
|
11765
11833
|
}));
|
|
11766
|
-
const [dockStateRevision, setDockStateRevision] =
|
|
11767
|
-
const [externalStateRevision, setExternalStateRevision] =
|
|
11834
|
+
const [dockStateRevision, setDockStateRevision] = useState10(0);
|
|
11835
|
+
const [externalStateRevision, setExternalStateRevision] = useState10(0);
|
|
11768
11836
|
const [
|
|
11769
11837
|
collapsingMinimizedLaunchAnchorKeys,
|
|
11770
11838
|
setCollapsingMinimizedLaunchAnchorKeys
|
|
11771
|
-
] =
|
|
11772
|
-
const collapsingMinimizedLaunchTimerRef =
|
|
11839
|
+
] = useState10(() => /* @__PURE__ */ new Set());
|
|
11840
|
+
const collapsingMinimizedLaunchTimerRef = useRef11(
|
|
11773
11841
|
/* @__PURE__ */ new Map()
|
|
11774
11842
|
);
|
|
11775
|
-
const clearHoverPanelCloseTimer =
|
|
11843
|
+
const clearHoverPanelCloseTimer = useCallback13(() => {
|
|
11776
11844
|
if (hoverPanelCloseTimerRef.current === null) {
|
|
11777
11845
|
return;
|
|
11778
11846
|
}
|
|
11779
11847
|
clearTimeout(hoverPanelCloseTimerRef.current);
|
|
11780
11848
|
hoverPanelCloseTimerRef.current = null;
|
|
11781
11849
|
}, []);
|
|
11782
|
-
const clearHoverPanelOpenTimer =
|
|
11850
|
+
const clearHoverPanelOpenTimer = useCallback13(() => {
|
|
11783
11851
|
if (hoverPanelOpenTimerRef.current === null) {
|
|
11784
11852
|
return;
|
|
11785
11853
|
}
|
|
@@ -11787,7 +11855,7 @@ function WorkbenchHostDock({
|
|
|
11787
11855
|
hoverPanelOpenTimerRef.current = null;
|
|
11788
11856
|
hoverPanelScheduledPointRef.current = null;
|
|
11789
11857
|
}, []);
|
|
11790
|
-
const clearLabelTooltipOpenTimer =
|
|
11858
|
+
const clearLabelTooltipOpenTimer = useCallback13(() => {
|
|
11791
11859
|
if (labelTooltipOpenTimerRef.current === null) {
|
|
11792
11860
|
return;
|
|
11793
11861
|
}
|
|
@@ -11795,7 +11863,7 @@ function WorkbenchHostDock({
|
|
|
11795
11863
|
labelTooltipOpenTimerRef.current = null;
|
|
11796
11864
|
labelTooltipScheduledPointRef.current = null;
|
|
11797
11865
|
}, []);
|
|
11798
|
-
|
|
11866
|
+
useEffect12(
|
|
11799
11867
|
() => () => {
|
|
11800
11868
|
clearHoverPanelCloseTimer();
|
|
11801
11869
|
clearHoverPanelOpenTimer();
|
|
@@ -11811,7 +11879,7 @@ function WorkbenchHostDock({
|
|
|
11811
11879
|
clearLabelTooltipOpenTimer
|
|
11812
11880
|
]
|
|
11813
11881
|
);
|
|
11814
|
-
const clearCollapsingMinimizedLaunch =
|
|
11882
|
+
const clearCollapsingMinimizedLaunch = useCallback13((anchorKey) => {
|
|
11815
11883
|
const timer = collapsingMinimizedLaunchTimerRef.current.get(anchorKey);
|
|
11816
11884
|
if (timer) {
|
|
11817
11885
|
clearTimeout(timer);
|
|
@@ -11830,7 +11898,7 @@ function WorkbenchHostDock({
|
|
|
11830
11898
|
return next;
|
|
11831
11899
|
});
|
|
11832
11900
|
}, []);
|
|
11833
|
-
const scheduleCollapsingMinimizedLaunchClear =
|
|
11901
|
+
const scheduleCollapsingMinimizedLaunchClear = useCallback13(
|
|
11834
11902
|
(anchorKey) => {
|
|
11835
11903
|
const existing = collapsingMinimizedLaunchTimerRef.current.get(anchorKey);
|
|
11836
11904
|
if (existing) {
|
|
@@ -11845,7 +11913,7 @@ function WorkbenchHostDock({
|
|
|
11845
11913
|
},
|
|
11846
11914
|
[clearCollapsingMinimizedLaunch]
|
|
11847
11915
|
);
|
|
11848
|
-
|
|
11916
|
+
useLayoutEffect8(() => {
|
|
11849
11917
|
const element = dockMeasureRef.current;
|
|
11850
11918
|
if (!element || typeof window === "undefined") {
|
|
11851
11919
|
return void 0;
|
|
@@ -11882,14 +11950,14 @@ function WorkbenchHostDock({
|
|
|
11882
11950
|
window.removeEventListener("resize", scheduleUpdate);
|
|
11883
11951
|
};
|
|
11884
11952
|
}, [dockPlacement]);
|
|
11885
|
-
const flushPendingDockStateRefresh =
|
|
11953
|
+
const flushPendingDockStateRefresh = useCallback13(() => {
|
|
11886
11954
|
if (!pendingDockStateRefreshRef.current) {
|
|
11887
11955
|
return;
|
|
11888
11956
|
}
|
|
11889
11957
|
pendingDockStateRefreshRef.current = false;
|
|
11890
11958
|
setDockStateRevision((revision) => revision + 1);
|
|
11891
11959
|
}, []);
|
|
11892
|
-
|
|
11960
|
+
useEffect12(() => {
|
|
11893
11961
|
if (!dockStateSource) {
|
|
11894
11962
|
return void 0;
|
|
11895
11963
|
}
|
|
@@ -11961,10 +12029,10 @@ function WorkbenchHostDock({
|
|
|
11961
12029
|
dockViewportRef: dockItemsRef,
|
|
11962
12030
|
slotRefs
|
|
11963
12031
|
});
|
|
11964
|
-
const clearSlotMagnificationRef =
|
|
12032
|
+
const clearSlotMagnificationRef = useRef11(() => {
|
|
11965
12033
|
return;
|
|
11966
12034
|
});
|
|
11967
|
-
const registerDockAnchorRef =
|
|
12035
|
+
const registerDockAnchorRef = useRef11(
|
|
11968
12036
|
(anchorKey, element) => {
|
|
11969
12037
|
context.genie.registerDockAnchor(anchorKey, element);
|
|
11970
12038
|
}
|
|
@@ -11975,7 +12043,7 @@ function WorkbenchHostDock({
|
|
|
11975
12043
|
registerDockAnchorRef.current = (anchorKey, element) => {
|
|
11976
12044
|
context.genie.registerDockAnchor(anchorKey, element);
|
|
11977
12045
|
};
|
|
11978
|
-
const registerWallpaperToneElement =
|
|
12046
|
+
const registerWallpaperToneElement = useCallback13(
|
|
11979
12047
|
(key) => (element) => {
|
|
11980
12048
|
if (element) {
|
|
11981
12049
|
wallpaperToneElementRefs.current.set(key, element);
|
|
@@ -11985,7 +12053,7 @@ function WorkbenchHostDock({
|
|
|
11985
12053
|
},
|
|
11986
12054
|
[]
|
|
11987
12055
|
);
|
|
11988
|
-
const setDockHoverPanelOpen =
|
|
12056
|
+
const setDockHoverPanelOpen = useCallback13((open) => {
|
|
11989
12057
|
if (open) {
|
|
11990
12058
|
dockMeasureRef.current?.setAttribute(
|
|
11991
12059
|
"data-dock-hover-panel-open",
|
|
@@ -11995,13 +12063,13 @@ function WorkbenchHostDock({
|
|
|
11995
12063
|
}
|
|
11996
12064
|
dockMeasureRef.current?.removeAttribute("data-dock-hover-panel-open");
|
|
11997
12065
|
}, []);
|
|
11998
|
-
|
|
12066
|
+
useEffect12(() => {
|
|
11999
12067
|
activeHoverPanelRef.current = activeHoverPanel;
|
|
12000
12068
|
}, [activeHoverPanel]);
|
|
12001
|
-
|
|
12069
|
+
useEffect12(() => {
|
|
12002
12070
|
activeLabelTooltipRef.current = activeLabelTooltip;
|
|
12003
12071
|
}, [activeLabelTooltip]);
|
|
12004
|
-
const closeLabelTooltipImmediate =
|
|
12072
|
+
const closeLabelTooltipImmediate = useCallback13(
|
|
12005
12073
|
(targetKey) => {
|
|
12006
12074
|
clearLabelTooltipOpenTimer();
|
|
12007
12075
|
if (targetKey !== void 0 && activeLabelTooltipRef.current?.key !== targetKey) {
|
|
@@ -12015,7 +12083,7 @@ function WorkbenchHostDock({
|
|
|
12015
12083
|
},
|
|
12016
12084
|
[clearLabelTooltipOpenTimer]
|
|
12017
12085
|
);
|
|
12018
|
-
const closeHoverPanelImmediate =
|
|
12086
|
+
const closeHoverPanelImmediate = useCallback13(
|
|
12019
12087
|
(entryId) => {
|
|
12020
12088
|
clearHoverPanelOpenTimer();
|
|
12021
12089
|
clearHoverPanelCloseTimer();
|
|
@@ -12038,7 +12106,7 @@ function WorkbenchHostDock({
|
|
|
12038
12106
|
setDockHoverPanelOpen
|
|
12039
12107
|
]
|
|
12040
12108
|
);
|
|
12041
|
-
const scheduleHoverPanelClose =
|
|
12109
|
+
const scheduleHoverPanelClose = useCallback13(
|
|
12042
12110
|
(entryId) => {
|
|
12043
12111
|
clearHoverPanelOpenTimer();
|
|
12044
12112
|
clearHoverPanelCloseTimer();
|
|
@@ -12055,7 +12123,7 @@ function WorkbenchHostDock({
|
|
|
12055
12123
|
handleDockPointerLeave
|
|
12056
12124
|
]
|
|
12057
12125
|
);
|
|
12058
|
-
const showHoverPanel =
|
|
12126
|
+
const showHoverPanel = useCallback13(
|
|
12059
12127
|
(entryId, anchorKey, anchorElement) => {
|
|
12060
12128
|
const dockElement = dockMeasureRef.current;
|
|
12061
12129
|
if (!dockElement) {
|
|
@@ -12081,7 +12149,7 @@ function WorkbenchHostDock({
|
|
|
12081
12149
|
},
|
|
12082
12150
|
[clearHoverPanelCloseTimer, pauseDockMagnification, setDockHoverPanelOpen]
|
|
12083
12151
|
);
|
|
12084
|
-
const scheduleHoverPanelAfterRest =
|
|
12152
|
+
const scheduleHoverPanelAfterRest = useCallback13(
|
|
12085
12153
|
(entryId, anchorKey) => {
|
|
12086
12154
|
hoverPanelRestTargetRef.current = { anchorKey, entryId };
|
|
12087
12155
|
clearHoverPanelOpenTimer();
|
|
@@ -12102,7 +12170,7 @@ function WorkbenchHostDock({
|
|
|
12102
12170
|
},
|
|
12103
12171
|
[clearHoverPanelOpenTimer, showHoverPanel]
|
|
12104
12172
|
);
|
|
12105
|
-
const showLabelTooltip =
|
|
12173
|
+
const showLabelTooltip = useCallback13(
|
|
12106
12174
|
(target, anchorKey, anchorElement) => {
|
|
12107
12175
|
const dockElement = dockMeasureRef.current;
|
|
12108
12176
|
if (!dockElement) {
|
|
@@ -12127,7 +12195,7 @@ function WorkbenchHostDock({
|
|
|
12127
12195
|
},
|
|
12128
12196
|
[clearLabelTooltipOpenTimer]
|
|
12129
12197
|
);
|
|
12130
|
-
const scheduleLabelTooltipAfterRest =
|
|
12198
|
+
const scheduleLabelTooltipAfterRest = useCallback13(
|
|
12131
12199
|
(target, anchorKey) => {
|
|
12132
12200
|
clearLabelTooltipOpenTimer();
|
|
12133
12201
|
labelTooltipScheduledPointRef.current = null;
|
|
@@ -12143,7 +12211,7 @@ function WorkbenchHostDock({
|
|
|
12143
12211
|
},
|
|
12144
12212
|
[clearLabelTooltipOpenTimer, showLabelTooltip]
|
|
12145
12213
|
);
|
|
12146
|
-
const resolveHoverPanelTargetAtPoint =
|
|
12214
|
+
const resolveHoverPanelTargetAtPoint = useCallback13(
|
|
12147
12215
|
(clientX, clientY) => {
|
|
12148
12216
|
for (const [anchorKey, slotElement] of slotRefs.current) {
|
|
12149
12217
|
const entryId = slotElement.dataset.dockHoverPanelEntryId;
|
|
@@ -12159,7 +12227,7 @@ function WorkbenchHostDock({
|
|
|
12159
12227
|
},
|
|
12160
12228
|
[]
|
|
12161
12229
|
);
|
|
12162
|
-
const resolveLabelTooltipTargetAtPoint =
|
|
12230
|
+
const resolveLabelTooltipTargetAtPoint = useCallback13(
|
|
12163
12231
|
(clientX, clientY) => {
|
|
12164
12232
|
for (const [anchorKey, slotElement] of slotRefs.current) {
|
|
12165
12233
|
if (slotElement.dataset.dockHoverPanelEntryId) {
|
|
@@ -12186,7 +12254,7 @@ function WorkbenchHostDock({
|
|
|
12186
12254
|
},
|
|
12187
12255
|
[]
|
|
12188
12256
|
);
|
|
12189
|
-
const isPointerInsideActiveHoverPanelRegion =
|
|
12257
|
+
const isPointerInsideActiveHoverPanelRegion = useCallback13(
|
|
12190
12258
|
(clientX, clientY) => {
|
|
12191
12259
|
const activeHoverPanel2 = activeHoverPanelRef.current;
|
|
12192
12260
|
if (!activeHoverPanel2) {
|
|
@@ -12218,7 +12286,7 @@ function WorkbenchHostDock({
|
|
|
12218
12286
|
},
|
|
12219
12287
|
[]
|
|
12220
12288
|
);
|
|
12221
|
-
const scheduleHoverPanelAtPointAfterRest =
|
|
12289
|
+
const scheduleHoverPanelAtPointAfterRest = useCallback13(
|
|
12222
12290
|
(clientX, clientY) => {
|
|
12223
12291
|
const scheduledPoint = hoverPanelScheduledPointRef.current;
|
|
12224
12292
|
if (hoverPanelOpenTimerRef.current !== null && scheduledPoint && Math.abs(clientX - scheduledPoint.clientX) <= dockHoverPanelPointerRestTolerancePx && Math.abs(clientY - scheduledPoint.clientY) <= dockHoverPanelPointerRestTolerancePx) {
|
|
@@ -12246,7 +12314,7 @@ function WorkbenchHostDock({
|
|
|
12246
12314
|
},
|
|
12247
12315
|
[clearHoverPanelOpenTimer, resolveHoverPanelTargetAtPoint, showHoverPanel]
|
|
12248
12316
|
);
|
|
12249
|
-
const scheduleLabelTooltipAtPointAfterRest =
|
|
12317
|
+
const scheduleLabelTooltipAtPointAfterRest = useCallback13(
|
|
12250
12318
|
(clientX, clientY) => {
|
|
12251
12319
|
if (activeLabelTooltipRef.current !== null) {
|
|
12252
12320
|
return;
|
|
@@ -12276,7 +12344,7 @@ function WorkbenchHostDock({
|
|
|
12276
12344
|
showLabelTooltip
|
|
12277
12345
|
]
|
|
12278
12346
|
);
|
|
12279
|
-
const beginDockIconInteraction =
|
|
12347
|
+
const beginDockIconInteraction = useCallback13(
|
|
12280
12348
|
(anchorKey) => {
|
|
12281
12349
|
hoverPanelRestTargetRef.current = null;
|
|
12282
12350
|
clearHoverPanelOpenTimer();
|
|
@@ -12291,20 +12359,20 @@ function WorkbenchHostDock({
|
|
|
12291
12359
|
triggerDockBounce
|
|
12292
12360
|
]
|
|
12293
12361
|
);
|
|
12294
|
-
const isDockEntryClickThrottled =
|
|
12362
|
+
const isDockEntryClickThrottled = useCallback13(
|
|
12295
12363
|
(anchorKey) => {
|
|
12296
12364
|
const throttledUntil = dockEntryClickThrottleUntilRef.current.get(anchorKey);
|
|
12297
12365
|
return throttledUntil !== void 0 && Date.now() < throttledUntil;
|
|
12298
12366
|
},
|
|
12299
12367
|
[]
|
|
12300
12368
|
);
|
|
12301
|
-
const claimDockEntryClick =
|
|
12369
|
+
const claimDockEntryClick = useCallback13((anchorKey) => {
|
|
12302
12370
|
dockEntryClickThrottleUntilRef.current.set(
|
|
12303
12371
|
anchorKey,
|
|
12304
12372
|
Date.now() + DOCK_ENTRY_CLICK_THROTTLE_MS
|
|
12305
12373
|
);
|
|
12306
12374
|
}, []);
|
|
12307
|
-
const beginDockMinimizedInteraction =
|
|
12375
|
+
const beginDockMinimizedInteraction = useCallback13(
|
|
12308
12376
|
(anchorKey) => {
|
|
12309
12377
|
hoverPanelRestTargetRef.current = null;
|
|
12310
12378
|
clearHoverPanelOpenTimer();
|
|
@@ -12344,7 +12412,7 @@ function WorkbenchHostDock({
|
|
|
12344
12412
|
pauseDockMagnification
|
|
12345
12413
|
]
|
|
12346
12414
|
);
|
|
12347
|
-
const runDockMinimizedLaunchAfterCollapse =
|
|
12415
|
+
const runDockMinimizedLaunchAfterCollapse = useCallback13(
|
|
12348
12416
|
(intent, launch) => {
|
|
12349
12417
|
const { anchorKey } = intent;
|
|
12350
12418
|
beginDockMinimizedInteraction(anchorKey);
|
|
@@ -12358,14 +12426,14 @@ function WorkbenchHostDock({
|
|
|
12358
12426
|
},
|
|
12359
12427
|
[beginDockMinimizedInteraction, scheduleCollapsingMinimizedLaunchClear]
|
|
12360
12428
|
);
|
|
12361
|
-
const runDockMinimizedStackLaunch =
|
|
12429
|
+
const runDockMinimizedStackLaunch = useCallback13(
|
|
12362
12430
|
(intent, launch) => {
|
|
12363
12431
|
beginDockMinimizedInteraction();
|
|
12364
12432
|
launch(intent);
|
|
12365
12433
|
},
|
|
12366
12434
|
[beginDockMinimizedInteraction]
|
|
12367
12435
|
);
|
|
12368
|
-
const handleDockPointerTravel =
|
|
12436
|
+
const handleDockPointerTravel = useCallback13(
|
|
12369
12437
|
(clientX, clientY) => {
|
|
12370
12438
|
if (activeHoverPanelRef.current !== null) {
|
|
12371
12439
|
closeLabelTooltipImmediate();
|
|
@@ -12400,7 +12468,7 @@ function WorkbenchHostDock({
|
|
|
12400
12468
|
scheduleLabelTooltipAtPointAfterRest
|
|
12401
12469
|
]
|
|
12402
12470
|
);
|
|
12403
|
-
const updateDockScrollState =
|
|
12471
|
+
const updateDockScrollState = useCallback13(() => {
|
|
12404
12472
|
const scrollElement = dockItemsRef.current;
|
|
12405
12473
|
const viewportElement = dockMeasureRef.current;
|
|
12406
12474
|
if (!scrollElement || !viewportElement) {
|
|
@@ -12427,7 +12495,7 @@ function WorkbenchHostDock({
|
|
|
12427
12495
|
(current) => current.canScrollBackward === nextState.canScrollBackward && current.canScrollForward === nextState.canScrollForward && current.hasOverflow === nextState.hasOverflow ? current : nextState
|
|
12428
12496
|
);
|
|
12429
12497
|
}, [dockPlacement, dockWidth]);
|
|
12430
|
-
|
|
12498
|
+
useLayoutEffect8(() => {
|
|
12431
12499
|
const element = dockItemsRef.current;
|
|
12432
12500
|
if (!element || typeof window === "undefined") {
|
|
12433
12501
|
return void 0;
|
|
@@ -12470,7 +12538,7 @@ function WorkbenchHostDock({
|
|
|
12470
12538
|
})()
|
|
12471
12539
|
)
|
|
12472
12540
|
);
|
|
12473
|
-
|
|
12541
|
+
useEffect12(() => {
|
|
12474
12542
|
const shouldSubscribe = activePopup !== null || hasMinimizedPreviewCapture;
|
|
12475
12543
|
if (!shouldSubscribe || !externalStateSource?.subscribeNodeState) {
|
|
12476
12544
|
return void 0;
|
|
@@ -12495,7 +12563,7 @@ function WorkbenchHostDock({
|
|
|
12495
12563
|
hasMinimizedPreviewCapture,
|
|
12496
12564
|
workspaceId
|
|
12497
12565
|
]);
|
|
12498
|
-
|
|
12566
|
+
useEffect12(() => {
|
|
12499
12567
|
const nextAttentionIds = /* @__PURE__ */ new Set();
|
|
12500
12568
|
for (const entry of renderedDockEntries) {
|
|
12501
12569
|
const nextToken = entry.attentionToken ?? null;
|
|
@@ -12536,7 +12604,7 @@ function WorkbenchHostDock({
|
|
|
12536
12604
|
);
|
|
12537
12605
|
}
|
|
12538
12606
|
}, [renderedDockEntries]);
|
|
12539
|
-
|
|
12607
|
+
useEffect12(
|
|
12540
12608
|
() => () => {
|
|
12541
12609
|
for (const timeout of attentionTimeouts.current.values()) {
|
|
12542
12610
|
globalThis.clearTimeout(timeout);
|
|
@@ -12545,7 +12613,7 @@ function WorkbenchHostDock({
|
|
|
12545
12613
|
},
|
|
12546
12614
|
[]
|
|
12547
12615
|
);
|
|
12548
|
-
const captureMinimizedNodePreview =
|
|
12616
|
+
const captureMinimizedNodePreview = useCallback13(
|
|
12549
12617
|
async (node) => {
|
|
12550
12618
|
const minimizedDock = nodeDefinitions.get(node.data.typeId)?.window?.minimizedDock;
|
|
12551
12619
|
const capturePreview = minimizedDock?.kind === "snapshot" ? minimizedDock.capturePreview : void 0;
|
|
@@ -12576,7 +12644,7 @@ function WorkbenchHostDock({
|
|
|
12576
12644
|
workspaceId
|
|
12577
12645
|
]
|
|
12578
12646
|
);
|
|
12579
|
-
const provideMinimizedNodePreview =
|
|
12647
|
+
const provideMinimizedNodePreview = useCallback13(
|
|
12580
12648
|
(node) => {
|
|
12581
12649
|
const minimizedDock = nodeDefinitions.get(node.data.typeId)?.window?.minimizedDock;
|
|
12582
12650
|
if (minimizedDock?.kind !== "component") {
|
|
@@ -12605,7 +12673,7 @@ function WorkbenchHostDock({
|
|
|
12605
12673
|
workspaceId
|
|
12606
12674
|
]
|
|
12607
12675
|
);
|
|
12608
|
-
const provideMinimizedNodePreviewForNode =
|
|
12676
|
+
const provideMinimizedNodePreviewForNode = useCallback13(
|
|
12609
12677
|
(node) => {
|
|
12610
12678
|
const minimizedDock = nodeDefinitions.get(node.data.typeId)?.window?.minimizedDock;
|
|
12611
12679
|
return minimizedDock?.kind === "component" ? provideMinimizedNodePreview : void 0;
|
|
@@ -12641,7 +12709,7 @@ function WorkbenchHostDock({
|
|
|
12641
12709
|
top: isVertical ? delta : 0
|
|
12642
12710
|
});
|
|
12643
12711
|
};
|
|
12644
|
-
const registerDockSlot =
|
|
12712
|
+
const registerDockSlot = useCallback13((anchorKey) => {
|
|
12645
12713
|
const existing = dockSlotRefCallbacksRef.current.get(anchorKey);
|
|
12646
12714
|
if (existing) {
|
|
12647
12715
|
return existing;
|
|
@@ -12662,7 +12730,7 @@ function WorkbenchHostDock({
|
|
|
12662
12730
|
dockSlotRefCallbacksRef.current.set(anchorKey, callback);
|
|
12663
12731
|
return callback;
|
|
12664
12732
|
}, []);
|
|
12665
|
-
const runDockEntryAction =
|
|
12733
|
+
const runDockEntryAction = useCallback13(
|
|
12666
12734
|
(entryId, actionId) => {
|
|
12667
12735
|
const actionKey = dockActionKey(entryId, actionId);
|
|
12668
12736
|
if (pendingActionKeys.has(actionKey)) {
|
|
@@ -12718,13 +12786,13 @@ function WorkbenchHostDock({
|
|
|
12718
12786
|
instanceMode: dockContextMenuInstanceMode,
|
|
12719
12787
|
matchedNodes: popupEntry.matchedNodes
|
|
12720
12788
|
}).kind === "launch";
|
|
12721
|
-
return /* @__PURE__ */
|
|
12789
|
+
return /* @__PURE__ */ jsxs10(
|
|
12722
12790
|
"div",
|
|
12723
12791
|
{
|
|
12724
12792
|
className: "flex justify-center pointer-events-none",
|
|
12725
12793
|
"data-dock-placement": dockPlacement,
|
|
12726
12794
|
children: [
|
|
12727
|
-
/* @__PURE__ */
|
|
12795
|
+
/* @__PURE__ */ jsx13(
|
|
12728
12796
|
"div",
|
|
12729
12797
|
{
|
|
12730
12798
|
ref: dockPlateRef,
|
|
@@ -12733,7 +12801,7 @@ function WorkbenchHostDock({
|
|
|
12733
12801
|
style: dockFrameSize === null ? void 0 : {
|
|
12734
12802
|
"--desktop-dock-frame-size": `${dockFrameSize}px`
|
|
12735
12803
|
},
|
|
12736
|
-
children: /* @__PURE__ */
|
|
12804
|
+
children: /* @__PURE__ */ jsxs10(
|
|
12737
12805
|
"div",
|
|
12738
12806
|
{
|
|
12739
12807
|
ref: dockMeasureRef,
|
|
@@ -12759,7 +12827,7 @@ function WorkbenchHostDock({
|
|
|
12759
12827
|
role: "toolbar",
|
|
12760
12828
|
style: dockPlacement === "left" ? { height: dockWidth } : { width: dockWidth },
|
|
12761
12829
|
children: [
|
|
12762
|
-
/* @__PURE__ */
|
|
12830
|
+
/* @__PURE__ */ jsx13(
|
|
12763
12831
|
"span",
|
|
12764
12832
|
{
|
|
12765
12833
|
className: "desktop-dock__pointer-rail",
|
|
@@ -12767,7 +12835,7 @@ function WorkbenchHostDock({
|
|
|
12767
12835
|
"aria-hidden": true
|
|
12768
12836
|
}
|
|
12769
12837
|
),
|
|
12770
|
-
/* @__PURE__ */
|
|
12838
|
+
/* @__PURE__ */ jsx13(
|
|
12771
12839
|
"button",
|
|
12772
12840
|
{
|
|
12773
12841
|
"aria-label": i18n.t(
|
|
@@ -12778,12 +12846,12 @@ function WorkbenchHostDock({
|
|
|
12778
12846
|
disabled: !dockScrollState.canScrollBackward,
|
|
12779
12847
|
onClick: () => scrollDockItems("backward"),
|
|
12780
12848
|
type: "button",
|
|
12781
|
-
children: dockPlacement === "left" ? /* @__PURE__ */
|
|
12849
|
+
children: dockPlacement === "left" ? /* @__PURE__ */ jsx13(ChevronUpIcon, { size: 16 }) : /* @__PURE__ */ jsx13(ArrowLeftIcon, { size: 16 })
|
|
12782
12850
|
}
|
|
12783
12851
|
),
|
|
12784
|
-
/* @__PURE__ */
|
|
12852
|
+
/* @__PURE__ */ jsx13("div", { ref: dockItemsRef, className: "desktop-dock__items", children: presentDockItems.map((dockItem) => {
|
|
12785
12853
|
if (dockItem.item.kind === "separator") {
|
|
12786
|
-
return /* @__PURE__ */
|
|
12854
|
+
return /* @__PURE__ */ jsx13(
|
|
12787
12855
|
"span",
|
|
12788
12856
|
{
|
|
12789
12857
|
ref: registerWallpaperToneElement(dockItem.key),
|
|
@@ -12810,7 +12878,7 @@ function WorkbenchHostDock({
|
|
|
12810
12878
|
});
|
|
12811
12879
|
const hasHoverPanel = dockEntryHasHoverPanel(entry);
|
|
12812
12880
|
const labelTooltipTarget2 = hasHoverPanel ? null : dockLabelTooltipTarget(`entry:${entry.id}`, entry.label);
|
|
12813
|
-
const dockButton2 = /* @__PURE__ */
|
|
12881
|
+
const dockButton2 = /* @__PURE__ */ jsx13(
|
|
12814
12882
|
"button",
|
|
12815
12883
|
{
|
|
12816
12884
|
"aria-expanded": currentPopup ? true : void 0,
|
|
@@ -12969,7 +13037,7 @@ function WorkbenchHostDock({
|
|
|
12969
13037
|
entryId: entry.id
|
|
12970
13038
|
});
|
|
12971
13039
|
},
|
|
12972
|
-
children: /* @__PURE__ */
|
|
13040
|
+
children: /* @__PURE__ */ jsxs10(
|
|
12973
13041
|
"span",
|
|
12974
13042
|
{
|
|
12975
13043
|
className: "desktop-dock__icon-shell",
|
|
@@ -12977,7 +13045,7 @@ function WorkbenchHostDock({
|
|
|
12977
13045
|
"data-entry-state": entry.state?.kind ?? "enabled",
|
|
12978
13046
|
"aria-hidden": true,
|
|
12979
13047
|
children: [
|
|
12980
|
-
/* @__PURE__ */
|
|
13048
|
+
/* @__PURE__ */ jsx13("span", { className: "desktop-dock__icon-content", children: entry.icon }),
|
|
12981
13049
|
renderDockBadge(
|
|
12982
13050
|
entry,
|
|
12983
13051
|
resolvedEntry.matchedNodes.length
|
|
@@ -12987,7 +13055,7 @@ function WorkbenchHostDock({
|
|
|
12987
13055
|
)
|
|
12988
13056
|
}
|
|
12989
13057
|
);
|
|
12990
|
-
return /* @__PURE__ */
|
|
13058
|
+
return /* @__PURE__ */ jsx13(
|
|
12991
13059
|
"span",
|
|
12992
13060
|
{
|
|
12993
13061
|
ref: registerDockSlot(anchorKey),
|
|
@@ -13088,7 +13156,7 @@ function WorkbenchHostDock({
|
|
|
13088
13156
|
`minimized-stack:${slot.anchorKey}`,
|
|
13089
13157
|
stackLabel
|
|
13090
13158
|
);
|
|
13091
|
-
const stackButton = /* @__PURE__ */
|
|
13159
|
+
const stackButton = /* @__PURE__ */ jsx13(
|
|
13092
13160
|
"span",
|
|
13093
13161
|
{
|
|
13094
13162
|
"aria-expanded": stackPopupActive,
|
|
@@ -13122,7 +13190,7 @@ function WorkbenchHostDock({
|
|
|
13122
13190
|
}
|
|
13123
13191
|
);
|
|
13124
13192
|
},
|
|
13125
|
-
children: /* @__PURE__ */
|
|
13193
|
+
children: /* @__PURE__ */ jsxs10(
|
|
13126
13194
|
"span",
|
|
13127
13195
|
{
|
|
13128
13196
|
className: "desktop-dock__minimized-stack-icon",
|
|
@@ -13137,7 +13205,7 @@ function WorkbenchHostDock({
|
|
|
13137
13205
|
(_, index) => {
|
|
13138
13206
|
const node2 = slot.nodes[index];
|
|
13139
13207
|
if (index === 0 && node2) {
|
|
13140
|
-
return /* @__PURE__ */
|
|
13208
|
+
return /* @__PURE__ */ jsx13(
|
|
13141
13209
|
WorkbenchHostDockMinimizedNodePreview,
|
|
13142
13210
|
{
|
|
13143
13211
|
capturePreview: captureMinimizedNodePreview,
|
|
@@ -13152,7 +13220,7 @@ function WorkbenchHostDock({
|
|
|
13152
13220
|
minimizedDockPreviewFreezeKey(node2)
|
|
13153
13221
|
);
|
|
13154
13222
|
}
|
|
13155
|
-
return /* @__PURE__ */
|
|
13223
|
+
return /* @__PURE__ */ jsx13(
|
|
13156
13224
|
"span",
|
|
13157
13225
|
{
|
|
13158
13226
|
"aria-hidden": "true",
|
|
@@ -13162,13 +13230,13 @@ function WorkbenchHostDock({
|
|
|
13162
13230
|
);
|
|
13163
13231
|
}
|
|
13164
13232
|
),
|
|
13165
|
-
/* @__PURE__ */
|
|
13233
|
+
/* @__PURE__ */ jsx13("span", { className: "desktop-dock__count-badge", children: slot.nodes.length })
|
|
13166
13234
|
]
|
|
13167
13235
|
}
|
|
13168
13236
|
)
|
|
13169
13237
|
}
|
|
13170
13238
|
);
|
|
13171
|
-
return /* @__PURE__ */
|
|
13239
|
+
return /* @__PURE__ */ jsx13(
|
|
13172
13240
|
"span",
|
|
13173
13241
|
{
|
|
13174
13242
|
ref: registerDockSlot(slot.anchorKey),
|
|
@@ -13223,7 +13291,7 @@ function WorkbenchHostDock({
|
|
|
13223
13291
|
`minimized-node:${node.id}`,
|
|
13224
13292
|
node.title
|
|
13225
13293
|
);
|
|
13226
|
-
const dockButton = /* @__PURE__ */
|
|
13294
|
+
const dockButton = /* @__PURE__ */ jsx13(
|
|
13227
13295
|
"span",
|
|
13228
13296
|
{
|
|
13229
13297
|
"aria-label": i18n.t("launch", { title: node.title }),
|
|
@@ -13284,7 +13352,7 @@ function WorkbenchHostDock({
|
|
|
13284
13352
|
}
|
|
13285
13353
|
);
|
|
13286
13354
|
},
|
|
13287
|
-
children: /* @__PURE__ */
|
|
13355
|
+
children: /* @__PURE__ */ jsx13(
|
|
13288
13356
|
WorkbenchHostDockMinimizedNodePreview,
|
|
13289
13357
|
{
|
|
13290
13358
|
capturePreview: isPendingMinimizedNode ? void 0 : captureMinimizedNodePreview,
|
|
@@ -13298,7 +13366,7 @@ function WorkbenchHostDock({
|
|
|
13298
13366
|
)
|
|
13299
13367
|
}
|
|
13300
13368
|
);
|
|
13301
|
-
return /* @__PURE__ */
|
|
13369
|
+
return /* @__PURE__ */ jsx13(
|
|
13302
13370
|
"span",
|
|
13303
13371
|
{
|
|
13304
13372
|
ref: registerDockSlot(slot.anchorKey),
|
|
@@ -13348,7 +13416,7 @@ function WorkbenchHostDock({
|
|
|
13348
13416
|
dockItem.key
|
|
13349
13417
|
);
|
|
13350
13418
|
}) }),
|
|
13351
|
-
/* @__PURE__ */
|
|
13419
|
+
/* @__PURE__ */ jsx13(
|
|
13352
13420
|
"button",
|
|
13353
13421
|
{
|
|
13354
13422
|
"aria-label": i18n.t(
|
|
@@ -13359,10 +13427,10 @@ function WorkbenchHostDock({
|
|
|
13359
13427
|
disabled: !dockScrollState.canScrollForward,
|
|
13360
13428
|
onClick: () => scrollDockItems("forward"),
|
|
13361
13429
|
type: "button",
|
|
13362
|
-
children: dockPlacement === "left" ? /* @__PURE__ */
|
|
13430
|
+
children: dockPlacement === "left" ? /* @__PURE__ */ jsx13(ChevronDownIcon, { size: 16 }) : /* @__PURE__ */ jsx13(ArrowRightIcon, { size: 16 })
|
|
13363
13431
|
}
|
|
13364
13432
|
),
|
|
13365
|
-
activeHoverPanel ? /* @__PURE__ */
|
|
13433
|
+
activeHoverPanel ? /* @__PURE__ */ jsx13(
|
|
13366
13434
|
WorkbenchHostDockHoverPanel,
|
|
13367
13435
|
{
|
|
13368
13436
|
entry: resolvedEntries.find(
|
|
@@ -13395,7 +13463,7 @@ function WorkbenchHostDock({
|
|
|
13395
13463
|
}
|
|
13396
13464
|
}
|
|
13397
13465
|
) : null,
|
|
13398
|
-
activeLabelTooltip ? /* @__PURE__ */
|
|
13466
|
+
activeLabelTooltip ? /* @__PURE__ */ jsx13(
|
|
13399
13467
|
WorkbenchHostDockLabelTooltip,
|
|
13400
13468
|
{
|
|
13401
13469
|
placement: dockPlacement,
|
|
@@ -13407,7 +13475,7 @@ function WorkbenchHostDock({
|
|
|
13407
13475
|
)
|
|
13408
13476
|
}
|
|
13409
13477
|
),
|
|
13410
|
-
popupEntry && activePopup ? /* @__PURE__ */
|
|
13478
|
+
popupEntry && activePopup ? /* @__PURE__ */ jsx13(
|
|
13411
13479
|
WorkbenchHostDockPopup,
|
|
13412
13480
|
{
|
|
13413
13481
|
anchorRect: activePopup.anchorRect,
|
|
@@ -13598,7 +13666,7 @@ function WorkbenchHostDock({
|
|
|
13598
13666
|
variant: activePopup.kind === "context-menu" ? "context-menu" : "default"
|
|
13599
13667
|
}
|
|
13600
13668
|
) : null,
|
|
13601
|
-
activeMinimizedStackSlot && activeMinimizedStackPopup ? /* @__PURE__ */
|
|
13669
|
+
activeMinimizedStackSlot && activeMinimizedStackPopup ? /* @__PURE__ */ jsx13(
|
|
13602
13670
|
WorkbenchHostDockPopup,
|
|
13603
13671
|
{
|
|
13604
13672
|
anchorRect: activeMinimizedStackPopup,
|
|
@@ -13698,11 +13766,11 @@ function WorkbenchHostDockMinimizedNodePreview({
|
|
|
13698
13766
|
providePreview,
|
|
13699
13767
|
workspaceId
|
|
13700
13768
|
}) {
|
|
13701
|
-
const [componentPreview, setComponentPreview] =
|
|
13702
|
-
const [previewImageUrl, setPreviewImageUrl] =
|
|
13769
|
+
const [componentPreview, setComponentPreview] = useState10(void 0);
|
|
13770
|
+
const [previewImageUrl, setPreviewImageUrl] = useState10(
|
|
13703
13771
|
() => deferPreview ? null : readCachedWorkbenchNodePreviewImage(node.id)
|
|
13704
13772
|
);
|
|
13705
|
-
|
|
13773
|
+
useEffect12(() => {
|
|
13706
13774
|
if (deferPreview || !providePreview || componentPreview !== void 0 || previewImageUrl) {
|
|
13707
13775
|
return void 0;
|
|
13708
13776
|
}
|
|
@@ -13752,7 +13820,7 @@ function WorkbenchHostDockMinimizedNodePreview({
|
|
|
13752
13820
|
previewImageUrl,
|
|
13753
13821
|
providePreview
|
|
13754
13822
|
]);
|
|
13755
|
-
|
|
13823
|
+
useEffect12(() => {
|
|
13756
13824
|
if (deferPreview) {
|
|
13757
13825
|
return void 0;
|
|
13758
13826
|
}
|
|
@@ -13811,7 +13879,7 @@ function WorkbenchHostDockMinimizedNodePreview({
|
|
|
13811
13879
|
return renderMinimizedDockPreviewPlaceholder(className);
|
|
13812
13880
|
}
|
|
13813
13881
|
if (previewImageUrl) {
|
|
13814
|
-
return /* @__PURE__ */
|
|
13882
|
+
return /* @__PURE__ */ jsx13(
|
|
13815
13883
|
"span",
|
|
13816
13884
|
{
|
|
13817
13885
|
className: [
|
|
@@ -13820,7 +13888,7 @@ function WorkbenchHostDockMinimizedNodePreview({
|
|
|
13820
13888
|
className
|
|
13821
13889
|
].filter(Boolean).join(" "),
|
|
13822
13890
|
"aria-hidden": "true",
|
|
13823
|
-
children: /* @__PURE__ */
|
|
13891
|
+
children: /* @__PURE__ */ jsx13(
|
|
13824
13892
|
"img",
|
|
13825
13893
|
{
|
|
13826
13894
|
alt: "",
|
|
@@ -13838,22 +13906,22 @@ function WorkbenchHostDockMinimizedNodePreview({
|
|
|
13838
13906
|
return renderMinimizedDockPreviewPlaceholder(className);
|
|
13839
13907
|
}
|
|
13840
13908
|
function renderMinimizedDockPreviewPlaceholder(className) {
|
|
13841
|
-
return /* @__PURE__ */
|
|
13909
|
+
return /* @__PURE__ */ jsxs10(
|
|
13842
13910
|
"span",
|
|
13843
13911
|
{
|
|
13844
13912
|
className: ["desktop-dock__minimized-preview", className].filter(Boolean).join(" "),
|
|
13845
13913
|
"aria-hidden": "true",
|
|
13846
13914
|
children: [
|
|
13847
|
-
/* @__PURE__ */
|
|
13848
|
-
/* @__PURE__ */
|
|
13849
|
-
/* @__PURE__ */
|
|
13915
|
+
/* @__PURE__ */ jsx13("span", { className: "desktop-dock__minimized-preview-line" }),
|
|
13916
|
+
/* @__PURE__ */ jsx13("span", { className: "desktop-dock__minimized-preview-line desktop-dock__minimized-preview-line--short" }),
|
|
13917
|
+
/* @__PURE__ */ jsx13("span", { className: "desktop-dock__minimized-preview-line desktop-dock__minimized-preview-line--accent" })
|
|
13850
13918
|
]
|
|
13851
13919
|
}
|
|
13852
13920
|
);
|
|
13853
13921
|
}
|
|
13854
13922
|
function renderMinimizedDockPreviewContent(preview, className) {
|
|
13855
13923
|
if (preview.kind === "image") {
|
|
13856
|
-
return /* @__PURE__ */
|
|
13924
|
+
return /* @__PURE__ */ jsx13(
|
|
13857
13925
|
"span",
|
|
13858
13926
|
{
|
|
13859
13927
|
className: [
|
|
@@ -13862,7 +13930,7 @@ function renderMinimizedDockPreviewContent(preview, className) {
|
|
|
13862
13930
|
className
|
|
13863
13931
|
].filter(Boolean).join(" "),
|
|
13864
13932
|
"aria-hidden": "true",
|
|
13865
|
-
children: /* @__PURE__ */
|
|
13933
|
+
children: /* @__PURE__ */ jsx13(
|
|
13866
13934
|
"img",
|
|
13867
13935
|
{
|
|
13868
13936
|
alt: "",
|
|
@@ -13874,7 +13942,7 @@ function renderMinimizedDockPreviewContent(preview, className) {
|
|
|
13874
13942
|
}
|
|
13875
13943
|
);
|
|
13876
13944
|
}
|
|
13877
|
-
return /* @__PURE__ */
|
|
13945
|
+
return /* @__PURE__ */ jsx13(
|
|
13878
13946
|
WorkbenchHostDockFrozenComponentPreview,
|
|
13879
13947
|
{
|
|
13880
13948
|
className,
|
|
@@ -13886,15 +13954,15 @@ function WorkbenchHostDockFrozenComponentPreview({
|
|
|
13886
13954
|
className,
|
|
13887
13955
|
preview
|
|
13888
13956
|
}) {
|
|
13889
|
-
const sourceRef =
|
|
13890
|
-
const [frozenMarkup, setFrozenMarkup] =
|
|
13891
|
-
|
|
13957
|
+
const sourceRef = useRef11(null);
|
|
13958
|
+
const [frozenMarkup, setFrozenMarkup] = useState10(null);
|
|
13959
|
+
useLayoutEffect8(() => {
|
|
13892
13960
|
if (frozenMarkup !== null) {
|
|
13893
13961
|
return;
|
|
13894
13962
|
}
|
|
13895
13963
|
setFrozenMarkup(sourceRef.current?.innerHTML ?? "");
|
|
13896
13964
|
}, [frozenMarkup]);
|
|
13897
|
-
return /* @__PURE__ */
|
|
13965
|
+
return /* @__PURE__ */ jsx13(
|
|
13898
13966
|
"span",
|
|
13899
13967
|
{
|
|
13900
13968
|
className: [
|
|
@@ -13903,14 +13971,14 @@ function WorkbenchHostDockFrozenComponentPreview({
|
|
|
13903
13971
|
className
|
|
13904
13972
|
].filter(Boolean).join(" "),
|
|
13905
13973
|
"aria-hidden": "true",
|
|
13906
|
-
children: frozenMarkup === null ? /* @__PURE__ */
|
|
13974
|
+
children: frozenMarkup === null ? /* @__PURE__ */ jsx13(
|
|
13907
13975
|
"span",
|
|
13908
13976
|
{
|
|
13909
13977
|
ref: sourceRef,
|
|
13910
13978
|
className: "desktop-dock__minimized-preview-freeze-source",
|
|
13911
13979
|
children: preview.element
|
|
13912
13980
|
}
|
|
13913
|
-
) : /* @__PURE__ */
|
|
13981
|
+
) : /* @__PURE__ */ jsx13(
|
|
13914
13982
|
"span",
|
|
13915
13983
|
{
|
|
13916
13984
|
className: "desktop-dock__minimized-preview-frozen-content",
|
|
@@ -13958,18 +14026,18 @@ function renderDockBadge(entry, matchedNodeCount) {
|
|
|
13958
14026
|
return null;
|
|
13959
14027
|
}
|
|
13960
14028
|
if (badge.kind === "count") {
|
|
13961
|
-
return /* @__PURE__ */
|
|
14029
|
+
return /* @__PURE__ */ jsx13("span", { className: "desktop-dock__count-badge", children: badge.value });
|
|
13962
14030
|
}
|
|
13963
14031
|
if (badge.kind === "custom") {
|
|
13964
|
-
return /* @__PURE__ */
|
|
14032
|
+
return /* @__PURE__ */ jsx13("span", { className: "desktop-dock__custom-badge", children: badge.content });
|
|
13965
14033
|
}
|
|
13966
|
-
return /* @__PURE__ */
|
|
14034
|
+
return /* @__PURE__ */ jsx13("span", { className: "desktop-dock__status-badge", "data-status": badge.status });
|
|
13967
14035
|
}
|
|
13968
14036
|
function WorkbenchHostDockLabelTooltip({
|
|
13969
14037
|
placement,
|
|
13970
14038
|
state
|
|
13971
14039
|
}) {
|
|
13972
|
-
return /* @__PURE__ */
|
|
14040
|
+
return /* @__PURE__ */ jsx13(
|
|
13973
14041
|
"div",
|
|
13974
14042
|
{
|
|
13975
14043
|
className: "desktop-dock__label-tooltip",
|
|
@@ -13999,7 +14067,7 @@ function WorkbenchHostDockHoverPanel({
|
|
|
13999
14067
|
setPendingActionKeys,
|
|
14000
14068
|
state
|
|
14001
14069
|
}) {
|
|
14002
|
-
const lastPointerActionAtRef =
|
|
14070
|
+
const lastPointerActionAtRef = useRef11(/* @__PURE__ */ new Map());
|
|
14003
14071
|
if (!entry) {
|
|
14004
14072
|
return null;
|
|
14005
14073
|
}
|
|
@@ -14033,7 +14101,7 @@ function WorkbenchHostDockHoverPanel({
|
|
|
14033
14101
|
}
|
|
14034
14102
|
})();
|
|
14035
14103
|
};
|
|
14036
|
-
return /* @__PURE__ */
|
|
14104
|
+
return /* @__PURE__ */ jsxs10(
|
|
14037
14105
|
"div",
|
|
14038
14106
|
{
|
|
14039
14107
|
ref: hoverPanelRef,
|
|
@@ -14052,13 +14120,13 @@ function WorkbenchHostDockHoverPanel({
|
|
|
14052
14120
|
"--desktop-dock-hover-panel-anchor-width": `${state.anchorRect.width}px`
|
|
14053
14121
|
},
|
|
14054
14122
|
children: [
|
|
14055
|
-
/* @__PURE__ */
|
|
14056
|
-
entry.state?.reason ? /* @__PURE__ */
|
|
14057
|
-
entry.hoverActions?.length ? /* @__PURE__ */
|
|
14123
|
+
/* @__PURE__ */ jsx13("div", { className: "desktop-dock__hover-panel-title", children: entry.label }),
|
|
14124
|
+
entry.state?.reason ? /* @__PURE__ */ jsx13("div", { className: "desktop-dock__hover-panel-description", children: stripDockDescriptionTerminalPunctuation(entry.state.reason) }) : null,
|
|
14125
|
+
entry.hoverActions?.length ? /* @__PURE__ */ jsx13("div", { className: "desktop-dock__hover-actions", children: entry.hoverActions.map((action) => {
|
|
14058
14126
|
const actionKey = dockActionKey(entry.id, action.id);
|
|
14059
14127
|
const isLocallyPending = pendingActionKeys.has(actionKey);
|
|
14060
14128
|
const isPending = isLocallyPending || action.disabled === true && action.pendingLabel !== void 0;
|
|
14061
|
-
return /* @__PURE__ */
|
|
14129
|
+
return /* @__PURE__ */ jsx13(
|
|
14062
14130
|
Button3,
|
|
14063
14131
|
{
|
|
14064
14132
|
"aria-busy": isPending ? true : void 0,
|
|
@@ -14280,22 +14348,22 @@ function resolveDockPresenceSettleMs(items) {
|
|
|
14280
14348
|
return dockPresenceAnimationMs;
|
|
14281
14349
|
}
|
|
14282
14350
|
function useDockPresenceItems(items, shouldAnimateMinimizedDockEnter) {
|
|
14283
|
-
const latestItemsByKey =
|
|
14284
|
-
const shouldAnimateMinimizedDockEnterRef =
|
|
14351
|
+
const latestItemsByKey = useRef11(/* @__PURE__ */ new Map());
|
|
14352
|
+
const shouldAnimateMinimizedDockEnterRef = useRef11(
|
|
14285
14353
|
shouldAnimateMinimizedDockEnter
|
|
14286
14354
|
);
|
|
14287
14355
|
latestItemsByKey.current = new Map(items.map((item) => [item.key, item]));
|
|
14288
14356
|
shouldAnimateMinimizedDockEnterRef.current = shouldAnimateMinimizedDockEnter;
|
|
14289
14357
|
const itemKeys = items.map((item) => item.key).join("\0");
|
|
14290
|
-
const [presentItems, setPresentItems] =
|
|
14358
|
+
const [presentItems, setPresentItems] = useState10(
|
|
14291
14359
|
() => items.map((item) => ({
|
|
14292
14360
|
item,
|
|
14293
14361
|
key: item.key,
|
|
14294
14362
|
presence: "present"
|
|
14295
14363
|
}))
|
|
14296
14364
|
);
|
|
14297
|
-
const initialized =
|
|
14298
|
-
|
|
14365
|
+
const initialized = useRef11(false);
|
|
14366
|
+
useEffect12(() => {
|
|
14299
14367
|
let nextSettleMs = dockPresenceAnimationMs;
|
|
14300
14368
|
setPresentItems((current) => {
|
|
14301
14369
|
const filteredItems = resolveDockPresenceItems({
|
|
@@ -14333,10 +14401,10 @@ function useDockWallpaperTones({
|
|
|
14333
14401
|
elementRefs,
|
|
14334
14402
|
itemKeys
|
|
14335
14403
|
}) {
|
|
14336
|
-
const [tones, setTones] =
|
|
14404
|
+
const [tones, setTones] = useState10(
|
|
14337
14405
|
() => /* @__PURE__ */ new Map()
|
|
14338
14406
|
);
|
|
14339
|
-
|
|
14407
|
+
useLayoutEffect8(() => {
|
|
14340
14408
|
if (typeof window === "undefined") {
|
|
14341
14409
|
return void 0;
|
|
14342
14410
|
}
|
|
@@ -14523,8 +14591,8 @@ function dockWallpaperToneMapsEqual(left, right) {
|
|
|
14523
14591
|
var DOCK_BOUNCE_MS = 600;
|
|
14524
14592
|
var DOCK_ENTRY_CLICK_THROTTLE_MS = DOCK_BOUNCE_MS;
|
|
14525
14593
|
function useDockBounce(slotRefs) {
|
|
14526
|
-
const timeoutsRef =
|
|
14527
|
-
const clearDockBounce =
|
|
14594
|
+
const timeoutsRef = useRef11(/* @__PURE__ */ new Map());
|
|
14595
|
+
const clearDockBounce = useCallback13(
|
|
14528
14596
|
(anchorKey) => {
|
|
14529
14597
|
const timeout = timeoutsRef.current.get(anchorKey);
|
|
14530
14598
|
const slotElement = slotRefs.current.get(anchorKey);
|
|
@@ -14538,7 +14606,7 @@ function useDockBounce(slotRefs) {
|
|
|
14538
14606
|
},
|
|
14539
14607
|
[slotRefs]
|
|
14540
14608
|
);
|
|
14541
|
-
|
|
14609
|
+
useEffect12(
|
|
14542
14610
|
() => () => {
|
|
14543
14611
|
for (const anchorKey of timeoutsRef.current.keys()) {
|
|
14544
14612
|
clearDockBounce(anchorKey);
|
|
@@ -14547,7 +14615,7 @@ function useDockBounce(slotRefs) {
|
|
|
14547
14615
|
},
|
|
14548
14616
|
[clearDockBounce]
|
|
14549
14617
|
);
|
|
14550
|
-
const triggerDockBounce =
|
|
14618
|
+
const triggerDockBounce = useCallback13(
|
|
14551
14619
|
(anchorKey) => {
|
|
14552
14620
|
const shouldRestartAnimation = clearDockBounce(anchorKey);
|
|
14553
14621
|
const slotElement = slotRefs.current.get(anchorKey);
|
|
@@ -14756,7 +14824,7 @@ function createWorkbenchHostNodeHeaderContext({
|
|
|
14756
14824
|
}
|
|
14757
14825
|
|
|
14758
14826
|
// src/host/WorkbenchHostWindowActions.tsx
|
|
14759
|
-
import { jsx as
|
|
14827
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
14760
14828
|
function WorkbenchHostWindowActions({
|
|
14761
14829
|
context,
|
|
14762
14830
|
host,
|
|
@@ -14769,7 +14837,7 @@ function WorkbenchHostWindowActions({
|
|
|
14769
14837
|
}
|
|
14770
14838
|
const minimizable = definition.window?.minimizable !== false;
|
|
14771
14839
|
const closable = definition.window?.closable !== false;
|
|
14772
|
-
return /* @__PURE__ */
|
|
14840
|
+
return /* @__PURE__ */ jsx14(
|
|
14773
14841
|
WorkbenchWindowTrafficLights,
|
|
14774
14842
|
{
|
|
14775
14843
|
close: closable ? {
|
|
@@ -14792,11 +14860,11 @@ function WorkbenchHostWindowActions({
|
|
|
14792
14860
|
}
|
|
14793
14861
|
|
|
14794
14862
|
// src/host/useWorkbenchHostSurfaceRenderers.tsx
|
|
14795
|
-
import { jsx as
|
|
14863
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
14796
14864
|
function useWorkbenchHostSurfaceRenderers(input) {
|
|
14797
14865
|
const renderBottomChrome = useMemo11(() => {
|
|
14798
14866
|
const renderChrome = input.renderBottomChrome;
|
|
14799
|
-
return renderChrome ? () => /* @__PURE__ */
|
|
14867
|
+
return renderChrome ? () => /* @__PURE__ */ jsx15(
|
|
14800
14868
|
WorkbenchHostSurfaceRenderErrorBoundary,
|
|
14801
14869
|
{
|
|
14802
14870
|
debugDiagnostics: input.debugDiagnostics,
|
|
@@ -14807,7 +14875,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14807
14875
|
fallbackKind: "bottom-chrome",
|
|
14808
14876
|
resetKey: `${input.workspaceId}:bottom-chrome`,
|
|
14809
14877
|
workspaceId: input.workspaceId,
|
|
14810
|
-
children: /* @__PURE__ */
|
|
14878
|
+
children: /* @__PURE__ */ jsx15(
|
|
14811
14879
|
WorkbenchHostChromeRenderer,
|
|
14812
14880
|
{
|
|
14813
14881
|
context: input.chromeContext,
|
|
@@ -14824,7 +14892,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14824
14892
|
]);
|
|
14825
14893
|
const renderTopChrome = useMemo11(() => {
|
|
14826
14894
|
const renderChrome = input.renderTopChrome;
|
|
14827
|
-
return renderChrome ? () => /* @__PURE__ */
|
|
14895
|
+
return renderChrome ? () => /* @__PURE__ */ jsx15(
|
|
14828
14896
|
WorkbenchHostSurfaceRenderErrorBoundary,
|
|
14829
14897
|
{
|
|
14830
14898
|
debugDiagnostics: input.debugDiagnostics,
|
|
@@ -14835,7 +14903,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14835
14903
|
fallbackKind: "top-chrome",
|
|
14836
14904
|
resetKey: `${input.workspaceId}:top-chrome`,
|
|
14837
14905
|
workspaceId: input.workspaceId,
|
|
14838
|
-
children: /* @__PURE__ */
|
|
14906
|
+
children: /* @__PURE__ */ jsx15(
|
|
14839
14907
|
WorkbenchHostChromeRenderer,
|
|
14840
14908
|
{
|
|
14841
14909
|
context: input.chromeContext,
|
|
@@ -14850,7 +14918,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14850
14918
|
input.renderTopChrome,
|
|
14851
14919
|
input.workspaceId
|
|
14852
14920
|
]);
|
|
14853
|
-
const captureNodeDefinitionPreviewImage =
|
|
14921
|
+
const captureNodeDefinitionPreviewImage = useCallback14(
|
|
14854
14922
|
async (node) => {
|
|
14855
14923
|
const definition = input.nodeDefinitionByType.get(node.data.typeId);
|
|
14856
14924
|
const minimizedDock = definition?.window?.minimizedDock;
|
|
@@ -14879,13 +14947,13 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14879
14947
|
input.workspaceId
|
|
14880
14948
|
]
|
|
14881
14949
|
);
|
|
14882
|
-
const captureNodePreviewImage =
|
|
14950
|
+
const captureNodePreviewImage = useCallback14(
|
|
14883
14951
|
async (node) => await captureNodeDefinitionPreviewImage(node) ?? await Promise.resolve(
|
|
14884
14952
|
input.captureNodePreviewImage?.(node) ?? null
|
|
14885
14953
|
).catch(() => null),
|
|
14886
14954
|
[captureNodeDefinitionPreviewImage, input.captureNodePreviewImage]
|
|
14887
14955
|
);
|
|
14888
|
-
const captureNodePreviewImages =
|
|
14956
|
+
const captureNodePreviewImages = useCallback14(
|
|
14889
14957
|
async (node) => {
|
|
14890
14958
|
const [images, definitionDockPreviewImageUrl] = await Promise.all([
|
|
14891
14959
|
Promise.resolve(input.captureNodePreviewImages?.(node) ?? null).catch(
|
|
@@ -14913,8 +14981,8 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14913
14981
|
input.captureNodePreviewImages
|
|
14914
14982
|
]
|
|
14915
14983
|
);
|
|
14916
|
-
const renderDock =
|
|
14917
|
-
(context) => /* @__PURE__ */
|
|
14984
|
+
const renderDock = useCallback14(
|
|
14985
|
+
(context) => /* @__PURE__ */ jsx15(
|
|
14918
14986
|
WorkbenchHostSurfaceRenderErrorBoundary,
|
|
14919
14987
|
{
|
|
14920
14988
|
debugDiagnostics: input.debugDiagnostics,
|
|
@@ -14926,7 +14994,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14926
14994
|
fallbackKind: "dock",
|
|
14927
14995
|
resetKey: `${input.workspaceId}:dock`,
|
|
14928
14996
|
workspaceId: input.workspaceId,
|
|
14929
|
-
children: /* @__PURE__ */
|
|
14997
|
+
children: /* @__PURE__ */ jsx15(
|
|
14930
14998
|
WorkbenchHostDock,
|
|
14931
14999
|
{
|
|
14932
15000
|
captureNodePreviewImage,
|
|
@@ -14965,7 +15033,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14965
15033
|
input.workspaceId
|
|
14966
15034
|
]
|
|
14967
15035
|
);
|
|
14968
|
-
const renderNode =
|
|
15036
|
+
const renderNode = useCallback14(
|
|
14969
15037
|
(context) => {
|
|
14970
15038
|
const definition = input.nodeDefinitionByType.get(
|
|
14971
15039
|
context.node.data.typeId
|
|
@@ -14973,7 +15041,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14973
15041
|
if (!definition) {
|
|
14974
15042
|
return null;
|
|
14975
15043
|
}
|
|
14976
|
-
return /* @__PURE__ */
|
|
15044
|
+
return /* @__PURE__ */ jsx15(
|
|
14977
15045
|
WorkbenchHostNodeRenderer,
|
|
14978
15046
|
{
|
|
14979
15047
|
debugDiagnostics: input.debugDiagnostics,
|
|
@@ -14993,8 +15061,8 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
14993
15061
|
input.workspaceId
|
|
14994
15062
|
]
|
|
14995
15063
|
);
|
|
14996
|
-
const renderWindowActions =
|
|
14997
|
-
(context) => /* @__PURE__ */
|
|
15064
|
+
const renderWindowActions = useCallback14(
|
|
15065
|
+
(context) => /* @__PURE__ */ jsx15(
|
|
14998
15066
|
WorkbenchHostWindowActions,
|
|
14999
15067
|
{
|
|
15000
15068
|
context,
|
|
@@ -15005,7 +15073,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
15005
15073
|
),
|
|
15006
15074
|
[input.hostI18n, input.hostSession, input.nodeDefinitionByType]
|
|
15007
15075
|
);
|
|
15008
|
-
const renderWindowHeader =
|
|
15076
|
+
const renderWindowHeader = useCallback14(
|
|
15009
15077
|
(context) => {
|
|
15010
15078
|
const definition = input.nodeDefinitionByType.get(
|
|
15011
15079
|
context.node.data.typeId
|
|
@@ -15013,7 +15081,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
15013
15081
|
if (!definition?.renderHeader) {
|
|
15014
15082
|
return null;
|
|
15015
15083
|
}
|
|
15016
|
-
return /* @__PURE__ */
|
|
15084
|
+
return /* @__PURE__ */ jsx15(
|
|
15017
15085
|
MemoizedWorkbenchHostNodeHeaderStateBridge,
|
|
15018
15086
|
{
|
|
15019
15087
|
context,
|
|
@@ -15031,18 +15099,18 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
15031
15099
|
input.workspaceId
|
|
15032
15100
|
]
|
|
15033
15101
|
);
|
|
15034
|
-
const shouldKeepMinimizedNodeMounted =
|
|
15102
|
+
const shouldKeepMinimizedNodeMounted = useCallback14(
|
|
15035
15103
|
(node) => {
|
|
15036
15104
|
const capability = input.nodeDefinitionByType.get(node.data.typeId)?.window?.keepMountedWhenMinimized;
|
|
15037
15105
|
return typeof capability === "function" ? capability(node) : capability === true;
|
|
15038
15106
|
},
|
|
15039
15107
|
[input.nodeDefinitionByType]
|
|
15040
15108
|
);
|
|
15041
|
-
const shouldCaptureNodePreviewImage =
|
|
15109
|
+
const shouldCaptureNodePreviewImage = useCallback14(
|
|
15042
15110
|
(_node) => true,
|
|
15043
15111
|
[]
|
|
15044
15112
|
);
|
|
15045
|
-
const renderNodeGeniePreview =
|
|
15113
|
+
const renderNodeGeniePreview = useCallback14(
|
|
15046
15114
|
(node, {
|
|
15047
15115
|
previewViewport
|
|
15048
15116
|
}) => {
|
|
@@ -15076,7 +15144,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
15076
15144
|
input.workspaceId
|
|
15077
15145
|
]
|
|
15078
15146
|
);
|
|
15079
|
-
const resolveDockAnchorKey =
|
|
15147
|
+
const resolveDockAnchorKey = useCallback14(
|
|
15080
15148
|
(node) => {
|
|
15081
15149
|
if (node.isMinimized && isWorkbenchMinimizedDockEligibleNode({
|
|
15082
15150
|
node,
|
|
@@ -15109,7 +15177,7 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
15109
15177
|
},
|
|
15110
15178
|
[input.dockEntries, input.hostSession, input.nodeDefinitionByType]
|
|
15111
15179
|
);
|
|
15112
|
-
const resolveDockPreviewCacheKey2 =
|
|
15180
|
+
const resolveDockPreviewCacheKey2 = useCallback14(
|
|
15113
15181
|
(node) => ({
|
|
15114
15182
|
instanceId: node.data.instanceId,
|
|
15115
15183
|
instanceKey: node.data.instanceKey ?? null,
|
|
@@ -15119,20 +15187,20 @@ function useWorkbenchHostSurfaceRenderers(input) {
|
|
|
15119
15187
|
}),
|
|
15120
15188
|
[input.workspaceId]
|
|
15121
15189
|
);
|
|
15122
|
-
const windowChromeMode =
|
|
15190
|
+
const windowChromeMode = useCallback14(
|
|
15123
15191
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.renderHeader ? "custom-header" : "system",
|
|
15124
15192
|
[input.nodeDefinitionByType]
|
|
15125
15193
|
);
|
|
15126
|
-
const resolveWindowZIndex =
|
|
15127
|
-
const resolveWindowSurfaceLayer =
|
|
15194
|
+
const resolveWindowZIndex = useCallback14(({ baseZIndex }) => baseZIndex, []);
|
|
15195
|
+
const resolveWindowSurfaceLayer = useCallback14(
|
|
15128
15196
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.window?.surfaceLayer ?? "default",
|
|
15129
15197
|
[input.nodeDefinitionByType]
|
|
15130
15198
|
);
|
|
15131
|
-
const resolveFullscreenHeaderMode =
|
|
15199
|
+
const resolveFullscreenHeaderMode = useCallback14(
|
|
15132
15200
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.window?.fullscreenHeaderMode,
|
|
15133
15201
|
[input.nodeDefinitionByType]
|
|
15134
15202
|
);
|
|
15135
|
-
const resolveWindowHeaderPresentation =
|
|
15203
|
+
const resolveWindowHeaderPresentation = useCallback14(
|
|
15136
15204
|
({ node }) => input.nodeDefinitionByType.get(node.data.typeId)?.window?.header,
|
|
15137
15205
|
[input.nodeDefinitionByType]
|
|
15138
15206
|
);
|
|
@@ -15187,7 +15255,7 @@ function WorkbenchHostNodeRenderer(input) {
|
|
|
15187
15255
|
input.context.node.id
|
|
15188
15256
|
]
|
|
15189
15257
|
);
|
|
15190
|
-
return /* @__PURE__ */
|
|
15258
|
+
return /* @__PURE__ */ jsx15(
|
|
15191
15259
|
WorkbenchHostNodeRenderErrorBoundary,
|
|
15192
15260
|
{
|
|
15193
15261
|
debugDiagnostics: input.debugDiagnostics,
|
|
@@ -15198,7 +15266,7 @@ function WorkbenchHostNodeRenderer(input) {
|
|
|
15198
15266
|
}),
|
|
15199
15267
|
resetKey,
|
|
15200
15268
|
workspaceId: input.workspaceId,
|
|
15201
|
-
children: /* @__PURE__ */
|
|
15269
|
+
children: /* @__PURE__ */ jsx15(
|
|
15202
15270
|
MemoizedWorkbenchHostNodeBodyRenderer,
|
|
15203
15271
|
{
|
|
15204
15272
|
context: bodyContext,
|
|
@@ -15223,7 +15291,7 @@ function WorkbenchHostNodeHeaderStateBridge(input) {
|
|
|
15223
15291
|
workspaceId: input.workspaceId
|
|
15224
15292
|
});
|
|
15225
15293
|
const getFrameRenderKey = input.definition.getHeaderFrameRenderKey;
|
|
15226
|
-
return /* @__PURE__ */
|
|
15294
|
+
return /* @__PURE__ */ jsx15(
|
|
15227
15295
|
MemoizedWorkbenchHostNodeHeaderRenderer,
|
|
15228
15296
|
{
|
|
15229
15297
|
context,
|
|
@@ -15300,7 +15368,7 @@ var WorkbenchHostSurfaceRenderErrorBoundary = class extends Component {
|
|
|
15300
15368
|
}
|
|
15301
15369
|
render() {
|
|
15302
15370
|
if (this.state.hasError) {
|
|
15303
|
-
return /* @__PURE__ */
|
|
15371
|
+
return /* @__PURE__ */ jsx15(
|
|
15304
15372
|
"div",
|
|
15305
15373
|
{
|
|
15306
15374
|
"data-workbench-surface-render-error": this.props.fallbackKind,
|
|
@@ -15359,7 +15427,7 @@ var WorkbenchHostNodeRenderErrorBoundary = class extends Component {
|
|
|
15359
15427
|
}
|
|
15360
15428
|
render() {
|
|
15361
15429
|
if (this.state.hasError) {
|
|
15362
|
-
return /* @__PURE__ */
|
|
15430
|
+
return /* @__PURE__ */ jsxs11(
|
|
15363
15431
|
"div",
|
|
15364
15432
|
{
|
|
15365
15433
|
"data-workbench-node-render-error": "true",
|
|
@@ -15377,7 +15445,7 @@ var WorkbenchHostNodeRenderErrorBoundary = class extends Component {
|
|
|
15377
15445
|
width: "100%"
|
|
15378
15446
|
},
|
|
15379
15447
|
children: [
|
|
15380
|
-
/* @__PURE__ */
|
|
15448
|
+
/* @__PURE__ */ jsx15(
|
|
15381
15449
|
"div",
|
|
15382
15450
|
{
|
|
15383
15451
|
"data-workbench-node-render-error-message": "true",
|
|
@@ -15389,8 +15457,8 @@ var WorkbenchHostNodeRenderErrorBoundary = class extends Component {
|
|
|
15389
15457
|
children: "This workspace view failed to render."
|
|
15390
15458
|
}
|
|
15391
15459
|
),
|
|
15392
|
-
/* @__PURE__ */
|
|
15393
|
-
/* @__PURE__ */
|
|
15460
|
+
/* @__PURE__ */ jsx15("div", { style: { fontSize: 12 }, children: "Try selecting another conversation or reopen the window." }),
|
|
15461
|
+
/* @__PURE__ */ jsx15(
|
|
15394
15462
|
"button",
|
|
15395
15463
|
{
|
|
15396
15464
|
type: "button",
|
|
@@ -15427,7 +15495,7 @@ function WorkbenchHostChromeRenderer({
|
|
|
15427
15495
|
}
|
|
15428
15496
|
|
|
15429
15497
|
// src/host/WorkbenchHost.tsx
|
|
15430
|
-
import { jsx as
|
|
15498
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
15431
15499
|
var noop3 = () => {
|
|
15432
15500
|
};
|
|
15433
15501
|
function WorkbenchHost({
|
|
@@ -15544,7 +15612,7 @@ function WorkbenchHost({
|
|
|
15544
15612
|
});
|
|
15545
15613
|
const missionControlPresence = useWorkbenchMissionControlPresence(missionControlState);
|
|
15546
15614
|
const missionControlRenderedState = missionControlPresence.state;
|
|
15547
|
-
return /* @__PURE__ */
|
|
15615
|
+
return /* @__PURE__ */ jsx16(
|
|
15548
15616
|
WorkbenchSurface,
|
|
15549
15617
|
{
|
|
15550
15618
|
className,
|
|
@@ -15559,7 +15627,7 @@ function WorkbenchHost({
|
|
|
15559
15627
|
missionControlPhase: missionControlPresence.phase,
|
|
15560
15628
|
minimizeAnimation,
|
|
15561
15629
|
presentation: missionControlState?.presentation ?? null,
|
|
15562
|
-
renderBackdrop: missionControlRenderedState ? () => /* @__PURE__ */
|
|
15630
|
+
renderBackdrop: missionControlRenderedState ? () => /* @__PURE__ */ jsx16(
|
|
15563
15631
|
WorkbenchMissionControlBackdrop,
|
|
15564
15632
|
{
|
|
15565
15633
|
onExitTransitionComplete: () => missionControlPresence.completeExitTransition(),
|
|
@@ -15570,7 +15638,7 @@ function WorkbenchHost({
|
|
|
15570
15638
|
renderDock: surfaceRenderers.renderDock,
|
|
15571
15639
|
renderNode: surfaceRenderers.renderNode,
|
|
15572
15640
|
renderNodeGeniePreview: surfaceRenderers.renderNodeGeniePreview,
|
|
15573
|
-
renderOverlay: missionControlRenderedState ? () => /* @__PURE__ */
|
|
15641
|
+
renderOverlay: missionControlRenderedState ? () => /* @__PURE__ */ jsx16(
|
|
15574
15642
|
WorkbenchMissionControlOverlay,
|
|
15575
15643
|
{
|
|
15576
15644
|
i18n: missionControlI18n,
|
|
@@ -15599,7 +15667,7 @@ function WorkbenchHost({
|
|
|
15599
15667
|
}
|
|
15600
15668
|
|
|
15601
15669
|
// src/react/WorkbenchDockComponentPreviewFrame.tsx
|
|
15602
|
-
import { jsx as
|
|
15670
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
15603
15671
|
function WorkbenchDockComponentPreviewFrame({
|
|
15604
15672
|
children,
|
|
15605
15673
|
sourceSize,
|
|
@@ -15635,13 +15703,13 @@ function WorkbenchDockComponentPreviewFrame({
|
|
|
15635
15703
|
transformOrigin: "center",
|
|
15636
15704
|
width: `${sourceWidth}px`
|
|
15637
15705
|
};
|
|
15638
|
-
return /* @__PURE__ */
|
|
15706
|
+
return /* @__PURE__ */ jsx17(
|
|
15639
15707
|
"span",
|
|
15640
15708
|
{
|
|
15641
15709
|
"aria-hidden": "true",
|
|
15642
15710
|
"data-workbench-dock-component-preview-frame": "true",
|
|
15643
15711
|
style: frameStyle,
|
|
15644
|
-
children: /* @__PURE__ */
|
|
15712
|
+
children: /* @__PURE__ */ jsx17(
|
|
15645
15713
|
"span",
|
|
15646
15714
|
{
|
|
15647
15715
|
"data-workbench-dock-component-preview-content": "true",
|