@tutti-os/workbench-surface 0.0.246 → 0.0.248

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 CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  workbenchHostI18nResources,
6
6
  workbenchWindowChromeI18nNamespace,
7
7
  workbenchWindowChromeI18nResources
8
- } from "./chunk-VBUKEMJO.js";
8
+ } from "./chunk-TIMYSQM7.js";
9
9
 
10
10
  // src/store/commands.ts
11
11
  function createWorkbenchCommands(store) {
@@ -707,16 +707,26 @@ function reduceWorkbenchState(state, action) {
707
707
  }
708
708
  return openedState;
709
709
  }
710
- case "closeNode":
710
+ case "closeNode": {
711
711
  if (!state.nodes.some((node) => node.id === action.nodeID)) {
712
712
  return state;
713
713
  }
714
- return {
714
+ const closedState = {
715
715
  ...state,
716
716
  nodes: state.nodes.filter((node) => node.id !== action.nodeID),
717
717
  nodeStack: removeFromWorkbenchStack(state.nodeStack, action.nodeID),
718
718
  lockedLayout: pruneLockedLayout(state.lockedLayout, action.nodeID)
719
719
  };
720
+ if (closedState.lockedLayout !== null && closedState.lockedLayout !== state.lockedLayout) {
721
+ return applyLayoutPresetToNodes(
722
+ closedState,
723
+ closedState.lockedLayout.nodeIDs,
724
+ closedState.lockedLayout.preset,
725
+ { lock: true, reorderStack: false }
726
+ );
727
+ }
728
+ return closedState;
729
+ }
720
730
  case "focusNode": {
721
731
  const targetNode = state.nodes.find((node) => node.id === action.nodeID);
722
732
  if (!targetNode) {
@@ -1577,7 +1587,6 @@ import { useMemo as useMemo12 } from "react";
1577
1587
  // src/mission-control/WorkbenchMissionControlOverlay.tsx
1578
1588
  import {
1579
1589
  useEffect,
1580
- useLayoutEffect,
1581
1590
  useRef,
1582
1591
  useState
1583
1592
  } from "react";
@@ -1636,8 +1645,6 @@ function WorkbenchMissionControlOverlay({
1636
1645
  phase,
1637
1646
  state
1638
1647
  }) {
1639
- const layoutDockContentRef = useRef(null);
1640
- const [layoutDockWidth, setLayoutDockWidth] = useState(null);
1641
1648
  const [openLayoutKey, setOpenLayoutKey] = useState(null);
1642
1649
  const hoverOpenTimeoutRef = useRef(null);
1643
1650
  const clearHoverOpenTimeout = () => {
@@ -1697,89 +1704,38 @@ function WorkbenchMissionControlOverlay({
1697
1704
  state.selectedCount,
1698
1705
  hasUsableLayoutPreset
1699
1706
  );
1700
- useLayoutEffect(() => {
1701
- const element = layoutDockContentRef.current;
1702
- if (!element) {
1703
- return;
1704
- }
1705
- const computedStyle = window.getComputedStyle(element.parentElement);
1706
- const horizontalChrome = Number.parseFloat(computedStyle.paddingLeft) + Number.parseFloat(computedStyle.paddingRight) + Number.parseFloat(computedStyle.borderLeftWidth) + Number.parseFloat(computedStyle.borderRightWidth);
1707
- setLayoutDockWidth(element.scrollWidth + horizontalChrome);
1708
- }, [
1709
- i18n,
1710
- layoutPresets.length,
1711
- showLayoutSelectionHint,
1712
- showNoAvailableLayoutMessage,
1713
- state.selectedCount
1714
- ]);
1715
- return /* @__PURE__ */ jsxs(
1707
+ return /* @__PURE__ */ jsx(
1716
1708
  "div",
1717
1709
  {
1718
1710
  className: "workbench-mission-control pointer-events-none absolute inset-0 overflow-hidden",
1719
1711
  "data-phase": phase,
1720
- children: [
1721
- state.mode === "activate" ? /* @__PURE__ */ jsx("div", { className: "workbench-mission-control__footer-shell pointer-events-none absolute inset-x-0 bottom-0 flex justify-center px-6 pb-6", children: /* @__PURE__ */ jsx(
1722
- "div",
1723
- {
1724
- className: "workbench-mission-control__layout-dock desktop-dock-plate pointer-events-auto",
1725
- onClick: (event) => event.stopPropagation(),
1726
- children: /* @__PURE__ */ jsx("div", { className: "workbench-mission-control__layout-dock-content", children: /* @__PURE__ */ jsxs(
1727
- Button,
1728
- {
1729
- className: "workbench-mission-control__layout-mode-button",
1730
- type: "button",
1731
- variant: "ghost",
1732
- onClick: () => state.requestMode("layout"),
1733
- children: [
1734
- /* @__PURE__ */ jsx(
1735
- AppWindowIcon,
1736
- {
1737
- "aria-hidden": true,
1738
- className: "workbench-mission-control__layout-glyph"
1739
- }
1740
- ),
1741
- i18n.t("layoutModeTrigger")
1742
- ]
1743
- }
1744
- ) })
1745
- }
1746
- ) }) : null,
1747
- state.mode === "layout" ? /* @__PURE__ */ jsx("div", { className: "workbench-mission-control__footer-shell pointer-events-none absolute inset-x-0 bottom-0 flex justify-center px-6 pb-6", children: /* @__PURE__ */ jsx(
1748
- "div",
1749
- {
1750
- className: "workbench-mission-control__layout-dock desktop-dock-plate pointer-events-auto",
1751
- style: layoutDockWidth === null ? void 0 : { width: layoutDockWidth },
1752
- onClick: (event) => event.stopPropagation(),
1753
- children: /* @__PURE__ */ jsx(
1754
- "div",
1755
- {
1756
- ref: layoutDockContentRef,
1757
- className: "workbench-mission-control__layout-dock-content",
1758
- children: showLayoutSelectionHint ? /* @__PURE__ */ jsx("span", { className: "workbench-mission-control__layout-hint", children: i18n.t("layoutSelectionHint") }) : showNoAvailableLayoutMessage ? /* @__PURE__ */ jsx("span", { className: "workbench-mission-control__layout-hint", children: i18n.t("noAvailableLayout") }) : /* @__PURE__ */ jsx("div", { className: "flex items-end gap-2", children: layoutPresets.map((option) => /* @__PURE__ */ jsx(
1759
- WorkbenchMissionControlLayoutPresetButton,
1760
- {
1761
- arrangeOnceLabel: i18n.t("presetActions.arrangeOnce"),
1762
- canApply: state.canApplyPreset(option.preset),
1763
- icon: option.icon,
1764
- layoutKey: option.key,
1765
- lockLayoutLabel: i18n.t("presetActions.lockLayout"),
1766
- open: openLayoutKey === option.key,
1767
- onApply: (lock) => {
1768
- closeLayoutMenu(option.key);
1769
- state.applyPreset(option.preset, { lock });
1770
- },
1771
- onHoverOpen: () => requestHoverOpen(option.key),
1772
- onHoverCancel: clearHoverOpenTimeout,
1773
- onRequestClose: () => closeLayoutMenu(option.key),
1774
- presetLabel: option.label
1775
- },
1776
- option.key
1777
- )) })
1778
- }
1779
- )
1780
- }
1781
- ) }) : null
1782
- ]
1712
+ children: /* @__PURE__ */ jsx("div", { className: "workbench-mission-control__footer-shell pointer-events-none absolute inset-x-0 bottom-0 flex justify-center px-6 pb-6", children: /* @__PURE__ */ jsx(
1713
+ "div",
1714
+ {
1715
+ className: "workbench-mission-control__layout-dock desktop-dock-plate pointer-events-auto",
1716
+ onClick: (event) => event.stopPropagation(),
1717
+ children: /* @__PURE__ */ jsx("div", { className: "workbench-mission-control__layout-dock-content", children: showLayoutSelectionHint ? /* @__PURE__ */ jsx("span", { className: "workbench-mission-control__layout-hint", children: i18n.t("layoutSelectionHint") }) : showNoAvailableLayoutMessage ? /* @__PURE__ */ jsx("span", { className: "workbench-mission-control__layout-hint", children: i18n.t("noAvailableLayout") }) : /* @__PURE__ */ jsx("div", { className: "flex items-end gap-2", children: layoutPresets.map((option) => /* @__PURE__ */ jsx(
1718
+ WorkbenchMissionControlLayoutPresetButton,
1719
+ {
1720
+ arrangeOnceLabel: i18n.t("presetActions.arrangeOnce"),
1721
+ canApply: state.canApplyPreset(option.preset),
1722
+ icon: option.icon,
1723
+ layoutKey: option.key,
1724
+ lockLayoutLabel: i18n.t("presetActions.lockLayout"),
1725
+ open: openLayoutKey === option.key,
1726
+ onApply: (lock) => {
1727
+ closeLayoutMenu(option.key);
1728
+ state.applyPreset(option.preset, { lock });
1729
+ },
1730
+ onHoverOpen: () => requestHoverOpen(option.key),
1731
+ onHoverCancel: clearHoverOpenTimeout,
1732
+ onRequestClose: () => closeLayoutMenu(option.key),
1733
+ presetLabel: option.label
1734
+ },
1735
+ option.key
1736
+ )) }) })
1737
+ }
1738
+ ) })
1783
1739
  }
1784
1740
  );
1785
1741
  }
@@ -1865,7 +1821,7 @@ function WorkbenchMissionControlLayoutPresetButton({
1865
1821
  }
1866
1822
 
1867
1823
  // src/mission-control/useWorkbenchMissionControlPresence.ts
1868
- import { useCallback, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState2 } from "react";
1824
+ import { useCallback, useLayoutEffect, useRef as useRef2, useState as useState2 } from "react";
1869
1825
  function useWorkbenchMissionControlPresence(state) {
1870
1826
  const [renderedState, setRenderedState] = useState2(state);
1871
1827
  const [phase, setPhase] = useState2(
@@ -1892,7 +1848,7 @@ function useWorkbenchMissionControlPresence(state) {
1892
1848
  setRenderedState(null);
1893
1849
  setPresencePhase("closed");
1894
1850
  }, [setPresencePhase]);
1895
- useLayoutEffect2(() => {
1851
+ useLayoutEffect(() => {
1896
1852
  if (enterFrameRef.current !== null) {
1897
1853
  window.cancelAnimationFrame(enterFrameRef.current);
1898
1854
  enterFrameRef.current = null;
@@ -2085,13 +2041,12 @@ var inactiveMissionControlSnapshotSource = {
2085
2041
  }
2086
2042
  };
2087
2043
  function useWorkbenchMissionControlState({
2044
+ active,
2088
2045
  adapter,
2089
- mode,
2090
2046
  nodeIds,
2091
- onRequestClose,
2092
- onRequestMode
2047
+ onRequestClose
2093
2048
  }) {
2094
- const isActive = mode !== null && adapter !== null;
2049
+ const isActive = active && adapter !== null;
2095
2050
  const snapshot = useExternalStoreSnapshot(
2096
2051
  isActive ? {
2097
2052
  getSnapshot() {
@@ -2117,16 +2072,16 @@ function useWorkbenchMissionControlState({
2117
2072
  }, [scopedNodeIdSet, snapshot?.visibleNodes]);
2118
2073
  const [selectedNodeIds, setSelectedNodeIds] = useState3([]);
2119
2074
  useEffect2(() => {
2120
- if (mode === null) {
2075
+ if (!active) {
2121
2076
  return;
2122
2077
  }
2123
2078
  setSelectedNodeIds([]);
2124
- }, [mode]);
2079
+ }, [active]);
2125
2080
  useEffect2(() => {
2126
- if (mode !== null && visibleNodes.length === 0) {
2081
+ if (active && visibleNodes.length === 0) {
2127
2082
  onRequestClose();
2128
2083
  }
2129
- }, [mode, onRequestClose, visibleNodes.length]);
2084
+ }, [active, onRequestClose, visibleNodes.length]);
2130
2085
  const orderedNodes = useMemo(
2131
2086
  () => isActive ? orderWorkbenchNodesForMissionControl(visibleNodes) : [],
2132
2087
  [isActive, visibleNodes]
@@ -2172,25 +2127,8 @@ function useWorkbenchMissionControlState({
2172
2127
  [layoutConstraints, orderedSelectedNodeIds.length, surfaceSize]
2173
2128
  );
2174
2129
  const canApplyPreset = useCallback2(
2175
- (nextPreset) => mode === "layout" && orderedSelectedNodeIds.length >= 2 && canUsePreset(nextPreset),
2176
- [canUsePreset, mode, orderedSelectedNodeIds.length]
2177
- );
2178
- const applyActivationAndClose = useCallback2(
2179
- (nodeId) => {
2180
- const nextAdapter = adapter;
2181
- if (!nextAdapter) {
2182
- return;
2183
- }
2184
- const nextSnapshot = nextAdapter.getSnapshot();
2185
- if (!nextSnapshot.visibleNodes.some((node) => node.id === nodeId)) {
2186
- return;
2187
- }
2188
- onRequestClose();
2189
- window.requestAnimationFrame(() => {
2190
- nextAdapter.focusNode(nodeId);
2191
- });
2192
- },
2193
- [adapter, onRequestClose]
2130
+ (nextPreset) => orderedSelectedNodeIds.length >= 2 && canUsePreset(nextPreset),
2131
+ [canUsePreset, orderedSelectedNodeIds.length]
2194
2132
  );
2195
2133
  const applyLayoutAndClose = useCallback2(
2196
2134
  (nodeIds2, nextPreset, lock) => {
@@ -2204,21 +2142,11 @@ function useWorkbenchMissionControlState({
2204
2142
  },
2205
2143
  [adapter, onRequestClose]
2206
2144
  );
2207
- const onPreviewPress = useCallback2(
2208
- (nodeId) => {
2209
- if (mode === null) {
2210
- return;
2211
- }
2212
- if (mode === "activate") {
2213
- applyActivationAndClose(nodeId);
2214
- return;
2215
- }
2216
- setSelectedNodeIds(
2217
- (current) => current.includes(nodeId) ? current.filter((entry) => entry !== nodeId) : [...current, nodeId]
2218
- );
2219
- },
2220
- [applyActivationAndClose, mode]
2221
- );
2145
+ const onPreviewPress = useCallback2((nodeId) => {
2146
+ setSelectedNodeIds(
2147
+ (current) => current.includes(nodeId) ? current.filter((entry) => entry !== nodeId) : [...current, nodeId]
2148
+ );
2149
+ }, []);
2222
2150
  const selectedNodeIdSet = useMemo(
2223
2151
  () => new Set(selectedNodeIds),
2224
2152
  [selectedNodeIds]
@@ -2236,22 +2164,12 @@ function useWorkbenchMissionControlState({
2236
2164
  },
2237
2165
  [applyLayoutAndClose, canApplyPreset, orderedSelectedNodeIds]
2238
2166
  );
2239
- const requestMode = useCallback2(
2240
- (nextMode) => {
2241
- if (nextMode === mode) {
2242
- return;
2243
- }
2244
- onRequestMode?.(nextMode);
2245
- },
2246
- [mode, onRequestMode]
2247
- );
2248
2167
  const presentation = useMemo(
2249
- () => mode === null ? null : {
2168
+ () => !active ? null : {
2250
2169
  frameByNodeId: new Map(
2251
2170
  previewItems.map((item) => [item.node.id, item.frame])
2252
2171
  ),
2253
2172
  interaction: {
2254
- mode,
2255
2173
  onBackdropPress: onRequestClose,
2256
2174
  onNodePress: onPreviewPress,
2257
2175
  selectedNodeIds: selectedNodeIdSet
@@ -2260,7 +2178,7 @@ function useWorkbenchMissionControlState({
2260
2178
  visibleNodeIds: new Set(orderedNodes.map((node) => node.id))
2261
2179
  },
2262
2180
  [
2263
- mode,
2181
+ active,
2264
2182
  onPreviewPress,
2265
2183
  onRequestClose,
2266
2184
  orderedNodes,
@@ -2269,7 +2187,7 @@ function useWorkbenchMissionControlState({
2269
2187
  ]
2270
2188
  );
2271
2189
  useEffect2(() => {
2272
- if (mode === null) {
2190
+ if (!active) {
2273
2191
  return void 0;
2274
2192
  }
2275
2193
  const onKeyDown = (event) => {
@@ -2282,25 +2200,22 @@ function useWorkbenchMissionControlState({
2282
2200
  return () => {
2283
2201
  window.removeEventListener("keydown", onKeyDown, true);
2284
2202
  };
2285
- }, [mode, onRequestClose]);
2203
+ }, [active, onRequestClose]);
2286
2204
  return useMemo(
2287
- () => mode === null || presentation === null ? null : {
2205
+ () => !active || presentation === null ? null : {
2288
2206
  applyPreset,
2289
2207
  canApplyPreset,
2290
2208
  canUsePreset,
2291
- mode,
2292
2209
  presentation,
2293
- requestMode,
2294
2210
  selectedCount: orderedSelectedNodeIds.length
2295
2211
  },
2296
2212
  [
2213
+ active,
2297
2214
  applyPreset,
2298
2215
  canApplyPreset,
2299
2216
  canUsePreset,
2300
- mode,
2301
2217
  orderedSelectedNodeIds.length,
2302
- presentation,
2303
- requestMode
2218
+ presentation
2304
2219
  ]
2305
2220
  );
2306
2221
  }
@@ -2550,7 +2465,7 @@ import {
2550
2465
  createContext as createContext2,
2551
2466
  useCallback as useCallback6,
2552
2467
  useContext as useContext2,
2553
- useLayoutEffect as useLayoutEffect3,
2468
+ useLayoutEffect as useLayoutEffect2,
2554
2469
  useMemo as useMemo4,
2555
2470
  useRef as useRef3,
2556
2471
  useSyncExternalStore
@@ -3025,7 +2940,7 @@ function WorkbenchWindowFrame({
3025
2940
  const launchSource = resolveWorkbenchNodeLaunchSource(node.data);
3026
2941
  const presentationMode = presentation?.mode ?? null;
3027
2942
  const previousFrameRef = useRef3(node.frame);
3028
- useLayoutEffect3(() => {
2943
+ useLayoutEffect2(() => {
3029
2944
  const previousFrame = previousFrameRef.current;
3030
2945
  previousFrameRef.current = node.frame;
3031
2946
  if (workbenchFramesEqual(previousFrame, node.frame)) {
@@ -3049,7 +2964,7 @@ function WorkbenchWindowFrame({
3049
2964
  nodePresentationTransitions,
3050
2965
  presentationMode
3051
2966
  ]);
3052
- useLayoutEffect3(() => {
2967
+ useLayoutEffect2(() => {
3053
2968
  const shell = shellRef.current;
3054
2969
  if (!shell) {
3055
2970
  return;
@@ -3103,7 +3018,7 @@ function WorkbenchWindowFrame({
3103
3018
  };
3104
3019
  }, [launchSource, node.id, nodePresentationTransitions]);
3105
3020
  const minimizeNodeToAnchorRef = useRef3(minimizeNodeToAnchorProp);
3106
- useLayoutEffect3(() => {
3021
+ useLayoutEffect2(() => {
3107
3022
  minimizeNodeToAnchorRef.current = minimizeNodeToAnchorProp;
3108
3023
  }, [minimizeNodeToAnchorProp]);
3109
3024
  const minimizeNodeToAnchor = useCallback6(
@@ -3270,17 +3185,17 @@ function WorkbenchWindowFrame({
3270
3185
  "button",
3271
3186
  {
3272
3187
  "aria-label": node.title,
3273
- "aria-pressed": presentationInteraction.mode === "layout" ? isMissionControlSelected : void 0,
3188
+ "aria-pressed": isMissionControlSelected,
3274
3189
  className: "absolute inset-0 z-10 block appearance-none rounded-lg border-0 bg-transparent p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/60",
3275
3190
  type: "button",
3276
3191
  onClick: (event) => {
3277
3192
  event.stopPropagation();
3278
3193
  presentationInteraction.onNodePress(node.id);
3279
3194
  },
3280
- children: presentationInteraction.mode === "layout" && isMissionControlSelected ? /* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute inset-0 rounded-lg border-2 border-[var(--tutti-purple)] transition-[border-color,transform] duration-150 ease-out" }) : null
3195
+ children: isMissionControlSelected ? /* @__PURE__ */ jsx7("div", { className: "pointer-events-none absolute inset-0 rounded-lg border-2 border-[var(--tutti-purple)] transition-[border-color,transform] duration-150 ease-out" }) : null
3281
3196
  }
3282
3197
  ) : null,
3283
- presentationInteraction?.mode === "layout" && isMissionControlSelected ? /* @__PURE__ */ jsx7(
3198
+ presentationInteraction && isMissionControlSelected ? /* @__PURE__ */ jsx7(
3284
3199
  Checkbox,
3285
3200
  {
3286
3201
  "aria-hidden": "true",
@@ -3793,10 +3708,10 @@ function resolveLockedMoveDirection(target) {
3793
3708
  }
3794
3709
 
3795
3710
  // src/react/hooks/useWorkbenchSurfaceSize.ts
3796
- import { useLayoutEffect as useLayoutEffect4, useRef as useRef4 } from "react";
3711
+ import { useLayoutEffect as useLayoutEffect3, useRef as useRef4 } from "react";
3797
3712
  function useWorkbenchSurfaceSize(onSizeChange) {
3798
3713
  const ref = useRef4(null);
3799
- useLayoutEffect4(() => {
3714
+ useLayoutEffect3(() => {
3800
3715
  const element = ref.current;
3801
3716
  if (!element) {
3802
3717
  return;
@@ -3828,7 +3743,7 @@ function useWorkbenchSurfaceSize(onSizeChange) {
3828
3743
  import {
3829
3744
  useCallback as useCallback7,
3830
3745
  useEffect as useEffect4,
3831
- useLayoutEffect as useLayoutEffect5,
3746
+ useLayoutEffect as useLayoutEffect4,
3832
3747
  useMemo as useMemo6,
3833
3748
  useRef as useRef5,
3834
3749
  useState as useState4
@@ -6247,7 +6162,7 @@ function useWorkbenchGenieAnimation({
6247
6162
  };
6248
6163
  }, [nodeVisibility]);
6249
6164
  const minimizeNodeToAnchorRef = useRef5(minimizeNodeToAnchor);
6250
- useLayoutEffect5(() => {
6165
+ useLayoutEffect4(() => {
6251
6166
  minimizeNodeToAnchorRef.current = minimizeNodeToAnchor;
6252
6167
  }, [minimizeNodeToAnchor]);
6253
6168
  const stableMinimizeNodeToAnchor = useCallback7(
@@ -6790,14 +6705,12 @@ function createDerivedSnapshotGetter(input) {
6790
6705
  };
6791
6706
  }
6792
6707
 
6793
- // src/host/activations.ts
6794
- var workbenchFocusInputActivationType = "focus-input";
6795
-
6796
6708
  // src/host/missionControlAdapter.ts
6797
6709
  function createWorkbenchHostMissionControlAdapter(input) {
6798
6710
  const getSnapshot = createDerivedSnapshotGetter({
6799
6711
  deriveSnapshot(controllerSnapshot) {
6800
6712
  return {
6713
+ isLayoutLocked: controllerSnapshot.lockedLayout !== null,
6801
6714
  layoutConstraints: controllerSnapshot.layoutConstraints,
6802
6715
  surfaceSize: controllerSnapshot.surfaceSize,
6803
6716
  visibleNodes: selectVisibleWorkbenchNodes(controllerSnapshot)
@@ -6811,17 +6724,10 @@ function createWorkbenchHostMissionControlAdapter(input) {
6811
6724
  applyLayoutPreset(nodeIds, preset, lock) {
6812
6725
  input.controller.commands.applyLayoutPreset(nodeIds, preset, lock);
6813
6726
  },
6814
- focusNode(nodeId) {
6815
- if (input.activateNode) {
6816
- input.activateNode(
6817
- { nodeId },
6818
- { type: workbenchFocusInputActivationType }
6819
- );
6820
- return;
6821
- }
6822
- input.controller.commands.focusNode(nodeId);
6823
- },
6824
6727
  getSnapshot,
6728
+ releaseLockedLayout() {
6729
+ input.controller.commands.releaseLockedLayout();
6730
+ },
6825
6731
  subscribe(listener) {
6826
6732
  return input.controller.subscribe(listener);
6827
6733
  }
@@ -8965,7 +8871,6 @@ function useWorkbenchHostRuntime({
8965
8871
  const isHydrating = hostSession.isHydrating?.() ?? false;
8966
8872
  const missionControlAdapter = useMemo9(
8967
8873
  () => missionControlEnabled && !isHydrating ? createWorkbenchHostMissionControlAdapter({
8968
- activateNode: hostSession.activateNode.bind(hostSession),
8969
8874
  controller: hostSession.controller
8970
8875
  }) : null,
8971
8876
  [hostSession.controller, isHydrating, missionControlEnabled]
@@ -9069,7 +8974,7 @@ import { Component, memo as memo3, useCallback as useCallback14, useMemo as useM
9069
8974
  import {
9070
8975
  useCallback as useCallback13,
9071
8976
  useEffect as useEffect12,
9072
- useLayoutEffect as useLayoutEffect8,
8977
+ useLayoutEffect as useLayoutEffect7,
9073
8978
  useMemo as useMemo10,
9074
8979
  useRef as useRef11,
9075
8980
  useState as useState10
@@ -10309,7 +10214,7 @@ function resolveWorkbenchMinimizedDockRestoreIntent(input) {
10309
10214
  import {
10310
10215
  useCallback as useCallback12,
10311
10216
  useEffect as useEffect11,
10312
- useLayoutEffect as useLayoutEffect7,
10217
+ useLayoutEffect as useLayoutEffect6,
10313
10218
  useRef as useRef10,
10314
10219
  useState as useState9
10315
10220
  } from "react";
@@ -10872,7 +10777,7 @@ function WorkbenchHostDockPopupCardLabel({ title }) {
10872
10777
  }
10873
10778
 
10874
10779
  // src/host/useWorkbenchHostDockPopupPreviewCapture.ts
10875
- import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect6, useRef as useRef9, useState as useState8 } from "react";
10780
+ import { useEffect as useEffect10, useLayoutEffect as useLayoutEffect5, useRef as useRef9, useState as useState8 } from "react";
10876
10781
  var dockPopupPreviewCacheMaxEntries = 64;
10877
10782
  var dockPopupPreviewByMemoryKey = /* @__PURE__ */ new Map();
10878
10783
  var pendingDockPopupPreviewCaptureKeys = /* @__PURE__ */ new Set();
@@ -10909,7 +10814,7 @@ function useWorkbenchHostDockPopupPreviewCapture(input) {
10909
10814
  )
10910
10815
  );
10911
10816
  const previewCaptureKey = previewCaptureItemStateKeys.join("|");
10912
- useLayoutEffect6(() => {
10817
+ useLayoutEffect5(() => {
10913
10818
  isContextMenuRef.current = isContextMenu;
10914
10819
  activePreviewCaptureItemStateKeysRef.current = new Set(
10915
10820
  previewCaptureItemStateKeys
@@ -11435,7 +11340,7 @@ function WorkbenchHostDockPopup({
11435
11340
  popupDiagnosticKey,
11436
11341
  resolvedVariant
11437
11342
  ]);
11438
- useLayoutEffect7(() => {
11343
+ useLayoutEffect6(() => {
11439
11344
  const rootElement = popupRootRef.current;
11440
11345
  const panelElement = rootElement?.querySelector(
11441
11346
  "[data-desktop-dock-popup-panel]"
@@ -11448,7 +11353,7 @@ function WorkbenchHostDockPopup({
11448
11353
  viewportWidth: window.innerWidth
11449
11354
  });
11450
11355
  }, [debugDiagnostics, popupDiagnosticKey]);
11451
- useLayoutEffect7(() => {
11356
+ useLayoutEffect6(() => {
11452
11357
  if (isMinimizedStack || typeof window === "undefined") {
11453
11358
  return;
11454
11359
  }
@@ -11913,7 +11818,7 @@ function WorkbenchHostDock({
11913
11818
  },
11914
11819
  [clearCollapsingMinimizedLaunch]
11915
11820
  );
11916
- useLayoutEffect8(() => {
11821
+ useLayoutEffect7(() => {
11917
11822
  const element = dockMeasureRef.current;
11918
11823
  if (!element || typeof window === "undefined") {
11919
11824
  return void 0;
@@ -12495,7 +12400,7 @@ function WorkbenchHostDock({
12495
12400
  (current) => current.canScrollBackward === nextState.canScrollBackward && current.canScrollForward === nextState.canScrollForward && current.hasOverflow === nextState.hasOverflow ? current : nextState
12496
12401
  );
12497
12402
  }, [dockPlacement, dockWidth]);
12498
- useLayoutEffect8(() => {
12403
+ useLayoutEffect7(() => {
12499
12404
  const element = dockItemsRef.current;
12500
12405
  if (!element || typeof window === "undefined") {
12501
12406
  return void 0;
@@ -13639,7 +13544,7 @@ function WorkbenchHostDock({
13639
13544
  }
13640
13545
  }
13641
13546
  window.requestAnimationFrame(() => {
13642
- onMissionControlRequestOpen?.("activate", {
13547
+ onMissionControlRequestOpen?.({
13643
13548
  nodeIds: openDockContextMenuNodeIds,
13644
13549
  trigger: "dock-context-menu"
13645
13550
  });
@@ -13956,7 +13861,7 @@ function WorkbenchHostDockFrozenComponentPreview({
13956
13861
  }) {
13957
13862
  const sourceRef = useRef11(null);
13958
13863
  const [frozenMarkup, setFrozenMarkup] = useState10(null);
13959
- useLayoutEffect8(() => {
13864
+ useLayoutEffect7(() => {
13960
13865
  if (frozenMarkup !== null) {
13961
13866
  return;
13962
13867
  }
@@ -14404,7 +14309,7 @@ function useDockWallpaperTones({
14404
14309
  const [tones, setTones] = useState10(
14405
14310
  () => /* @__PURE__ */ new Map()
14406
14311
  );
14407
- useLayoutEffect8(() => {
14312
+ useLayoutEffect7(() => {
14408
14313
  if (typeof window === "undefined") {
14409
14314
  return void 0;
14410
14315
  }
@@ -15555,11 +15460,10 @@ function WorkbenchHost({
15555
15460
  }),
15556
15461
  [contributions, dockEntries, dockEntryPresentationOverrides]
15557
15462
  );
15558
- const missionControlMode = missionControl?.mode ?? null;
15463
+ const missionControlActive = missionControl?.active ?? false;
15559
15464
  const missionControlNodeIds = missionControl?.nodeIds;
15560
15465
  const missionControlClose = missionControl?.onRequestClose ?? noop3;
15561
- const missionControlRequestMode = missionControl?.onRequestMode;
15562
- const missionControlEnabled = missionControlMode !== null || onMissionControlAdapterReady !== void 0;
15466
+ const missionControlEnabled = missionControlActive || onMissionControlAdapterReady !== void 0;
15563
15467
  const {
15564
15468
  chromeContext,
15565
15469
  hostI18n,
@@ -15604,11 +15508,10 @@ function WorkbenchHost({
15604
15508
  workspaceId
15605
15509
  });
15606
15510
  const missionControlState = useWorkbenchMissionControlState({
15511
+ active: missionControlActive,
15607
15512
  adapter: missionControlAdapter,
15608
- mode: missionControlMode,
15609
15513
  nodeIds: missionControlNodeIds,
15610
- onRequestClose: missionControlClose,
15611
- onRequestMode: missionControlRequestMode
15514
+ onRequestClose: missionControlClose
15612
15515
  });
15613
15516
  const missionControlPresence = useWorkbenchMissionControlPresence(missionControlState);
15614
15517
  const missionControlRenderedState = missionControlPresence.state;
@@ -15666,6 +15569,9 @@ function WorkbenchHost({
15666
15569
  );
15667
15570
  }
15668
15571
 
15572
+ // src/host/activations.ts
15573
+ var workbenchFocusInputActivationType = "focus-input";
15574
+
15669
15575
  // src/react/WorkbenchDockComponentPreviewFrame.tsx
15670
15576
  import { jsx as jsx17 } from "react/jsx-runtime";
15671
15577
  function WorkbenchDockComponentPreviewFrame({