@ai-matrx/summon 0.1.4 → 0.1.5
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/CHANGELOG.md +3 -1
- package/README.md +2 -2
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/persistence-data.cjs +9 -0
- package/dist/persistence-data.cjs.map +1 -1
- package/dist/persistence-data.d.cts +2 -1
- package/dist/persistence-data.d.ts +2 -1
- package/dist/persistence-data.js +9 -0
- package/dist/persistence-data.js.map +1 -1
- package/dist/persistence.cjs +6 -4
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +6 -4
- package/dist/persistence.js.map +1 -1
- package/dist/react.cjs +19 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +8 -1
- package/dist/react.d.ts +8 -1
- package/dist/react.js +19 -0
- package/dist/react.js.map +1 -1
- package/dist/url.cjs +32 -50
- package/dist/url.cjs.map +1 -1
- package/dist/url.d.cts +2 -8
- package/dist/url.d.ts +2 -8
- package/dist/url.js +8 -24
- package/dist/url.js.map +1 -1
- package/dist/window-host.cjs +43 -1
- package/dist/window-host.cjs.map +1 -1
- package/dist/window-host.d.cts +45 -1
- package/dist/window-host.d.ts +45 -1
- package/dist/window-host.js +44 -2
- package/dist/window-host.js.map +1 -1
- package/dist/window.cjs +127 -149
- package/dist/window.cjs.map +1 -1
- package/dist/window.d.cts +2 -46
- package/dist/window.d.ts +2 -46
- package/dist/window.js +14 -34
- package/dist/window.js.map +1 -1
- package/package.json +4 -4
package/dist/window.cjs
CHANGED
|
@@ -34,9 +34,9 @@ __export(window_exports, {
|
|
|
34
34
|
AUTO_OPEN_MIN_WIDTH: () => AUTO_OPEN_MIN_WIDTH,
|
|
35
35
|
AUTO_OPEN_NO_ROOM_EVENT: () => AUTO_OPEN_NO_ROOM_EVENT,
|
|
36
36
|
DEFAULT_DRAG_OUT_CONFIG: () => DEFAULT_DRAG_OUT_CONFIG,
|
|
37
|
-
DEFAULT_ESCAPE_YIELD_SELECTOR: () =>
|
|
38
|
-
DEFAULT_MOBILE_TOP_OFFSET: () =>
|
|
39
|
-
DEFAULT_WINDOW_CONFIG: () =>
|
|
37
|
+
DEFAULT_ESCAPE_YIELD_SELECTOR: () => import_window_host6.DEFAULT_ESCAPE_YIELD_SELECTOR,
|
|
38
|
+
DEFAULT_MOBILE_TOP_OFFSET: () => import_window_host6.DEFAULT_MOBILE_TOP_OFFSET,
|
|
39
|
+
DEFAULT_WINDOW_CONFIG: () => import_window_host6.DEFAULT_WINDOW_CONFIG,
|
|
40
40
|
INITIAL_DRAG_OUT_STATE: () => INITIAL_DRAG_OUT_STATE,
|
|
41
41
|
LayoutIcon: () => LayoutIcon,
|
|
42
42
|
LayoutIconButton: () => LayoutIconButton,
|
|
@@ -47,14 +47,14 @@ __export(window_exports, {
|
|
|
47
47
|
MobileWindowActionsRow: () => MobileWindowActionsRow,
|
|
48
48
|
MobileWindowTitle: () => MobileWindowTitle,
|
|
49
49
|
MobileWindowTitleRow: () => MobileWindowTitleRow,
|
|
50
|
-
PopoutContext: () => PopoutContext,
|
|
50
|
+
PopoutContext: () => import_window_host10.PopoutContext,
|
|
51
51
|
TrayChipPreview: () => TrayChipPreview,
|
|
52
52
|
TrayStatusChip: () => TrayStatusChip,
|
|
53
53
|
WindowPanel: () => WindowPanel,
|
|
54
|
-
WindowSelectionSurface: () =>
|
|
54
|
+
WindowSelectionSurface: () => import_window_host6.WindowSelectionSurface,
|
|
55
55
|
WindowSidebar: () => WindowSidebar,
|
|
56
|
-
WindowTraySync: () =>
|
|
57
|
-
WindowsProvider: () =>
|
|
56
|
+
WindowTraySync: () => import_window_host7.WindowTraySync,
|
|
57
|
+
WindowsProvider: () => import_window_host6.WindowsProvider,
|
|
58
58
|
assertLazyLoaded: () => assertLazyLoaded,
|
|
59
59
|
autoOpenHasRoom: () => autoOpenHasRoom,
|
|
60
60
|
buildPopoutOpts: () => buildPopoutOpts,
|
|
@@ -69,7 +69,7 @@ __export(window_exports, {
|
|
|
69
69
|
getPendingPopoutWindowIds: () => getPendingPopoutWindowIds,
|
|
70
70
|
getPopoutOpener: () => getPopoutOpener,
|
|
71
71
|
getPopoutWindow: () => getPopoutWindow,
|
|
72
|
-
getTrayPreviewEntry: () =>
|
|
72
|
+
getTrayPreviewEntry: () => import_window_host9.getTrayPreviewEntry,
|
|
73
73
|
getTraySnapshot: () => getTraySnapshot,
|
|
74
74
|
isAutoOpened: () => isAutoOpened,
|
|
75
75
|
isUnderRoute: () => isUnderRoute,
|
|
@@ -77,9 +77,9 @@ __export(window_exports, {
|
|
|
77
77
|
mayRaiseUnbidden: () => mayRaiseUnbidden,
|
|
78
78
|
measureWorkingColumn: () => measureWorkingColumn,
|
|
79
79
|
mobileWindowTitleClass: () => mobileWindowTitleClass,
|
|
80
|
-
registerTrayPreview: () =>
|
|
80
|
+
registerTrayPreview: () => import_window_host9.registerTrayPreview,
|
|
81
81
|
resetDefaultWindowCascade: () => resetDefaultWindowCascade,
|
|
82
|
-
resetTrayPreviews: () =>
|
|
82
|
+
resetTrayPreviews: () => import_window_host9.resetTrayPreviews,
|
|
83
83
|
resolveAutoOpenPlacement: () => resolveAutoOpenPlacement,
|
|
84
84
|
resolvePosition: () => resolvePosition,
|
|
85
85
|
sanitizeWindowData: () => sanitizeWindowData,
|
|
@@ -88,26 +88,26 @@ __export(window_exports, {
|
|
|
88
88
|
subscribeTraySnapshotMap: () => subscribeTraySnapshotMap,
|
|
89
89
|
supportsAnyPopout: () => supportsAnyPopout,
|
|
90
90
|
supportsDocumentPictureInPicture: () => supportsDocumentPictureInPicture,
|
|
91
|
-
useOverlaySurfaceRenderAck: () => useOverlaySurfaceRenderAck,
|
|
92
|
-
usePopout: () => usePopout,
|
|
93
|
-
usePopoutContainer: () => usePopoutContainer,
|
|
91
|
+
useOverlaySurfaceRenderAck: () => import_window_host8.useOverlaySurfaceRenderAck,
|
|
92
|
+
usePopout: () => import_window_host10.usePopout,
|
|
93
|
+
usePopoutContainer: () => import_window_host11.usePopoutContainer,
|
|
94
94
|
usePopoutControl: () => usePopoutControl,
|
|
95
95
|
usePopoutWindow: () => usePopoutWindow,
|
|
96
96
|
usePopoutWindowRef: () => usePopoutWindowRef,
|
|
97
|
-
useWindowConfig: () =>
|
|
97
|
+
useWindowConfig: () => import_window_host6.useWindowConfig,
|
|
98
98
|
useWindowPanel: () => useWindowPanel
|
|
99
99
|
});
|
|
100
100
|
module.exports = __toCommonJS(window_exports);
|
|
101
101
|
|
|
102
102
|
// src/window/WindowPanel.tsx
|
|
103
|
-
var
|
|
103
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
104
104
|
var import_design_system7 = require("@ai-matrx/design-system");
|
|
105
105
|
var import_design_system8 = require("@ai-matrx/design-system");
|
|
106
106
|
var import_cn9 = require("@ai-matrx/design-system/cn");
|
|
107
107
|
var import_media_query = require("@ai-matrx/kit/media-query");
|
|
108
108
|
var import_react_dom3 = require("react-dom");
|
|
109
109
|
var import_summon10 = require("@ai-matrx/summon");
|
|
110
|
-
var
|
|
110
|
+
var import_react19 = require("@ai-matrx/summon/react");
|
|
111
111
|
|
|
112
112
|
// src/window/icons.tsx
|
|
113
113
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -866,7 +866,7 @@ function useDebugFlag(debug) {
|
|
|
866
866
|
}
|
|
867
867
|
|
|
868
868
|
// src/window/WindowPanel.tsx
|
|
869
|
-
var
|
|
869
|
+
var import_react20 = require("@ai-matrx/summon/react");
|
|
870
870
|
|
|
871
871
|
// src/window/utils/urlSyncIdentity.ts
|
|
872
872
|
function resolveWindowUrlSyncKey(registryKey, explicitKey) {
|
|
@@ -921,7 +921,7 @@ function sanitizeWindowData(value, allowedKeys) {
|
|
|
921
921
|
}
|
|
922
922
|
|
|
923
923
|
// src/window/WindowPanel.tsx
|
|
924
|
-
var
|
|
924
|
+
var import_window_host3 = require("@ai-matrx/summon/window-host");
|
|
925
925
|
|
|
926
926
|
// src/window/mobile/MobileDrawerSurface.tsx
|
|
927
927
|
var import_react5 = require("react");
|
|
@@ -1896,34 +1896,20 @@ function buildPopoutOpts(rect, opts) {
|
|
|
1896
1896
|
|
|
1897
1897
|
// src/window/popout/PopoutPortal.tsx
|
|
1898
1898
|
var import_react_dom2 = require("react-dom");
|
|
1899
|
-
var
|
|
1899
|
+
var import_react15 = require("@ai-matrx/summon/react");
|
|
1900
1900
|
var import_summon7 = require("@ai-matrx/summon");
|
|
1901
1901
|
|
|
1902
1902
|
// src/window/popout/PopoutShell.tsx
|
|
1903
|
-
var import_react15 = require("react");
|
|
1904
|
-
var import_design_system6 = require("@ai-matrx/design-system");
|
|
1905
|
-
|
|
1906
|
-
// src/window/popout/PopoutContext.tsx
|
|
1907
1903
|
var import_react14 = require("react");
|
|
1908
|
-
var
|
|
1909
|
-
|
|
1910
|
-
popoutWindow: null,
|
|
1911
|
-
popoutContainer: null,
|
|
1912
|
-
mode: null
|
|
1913
|
-
};
|
|
1914
|
-
var PopoutContext = (0, import_react14.createContext)(DEFAULT_VALUE);
|
|
1915
|
-
function usePopout() {
|
|
1916
|
-
return (0, import_react14.useContext)(PopoutContext);
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
// src/window/popout/PopoutShell.tsx
|
|
1904
|
+
var import_design_system6 = require("@ai-matrx/design-system");
|
|
1905
|
+
var import_window_host = require("@ai-matrx/summon/window-host");
|
|
1920
1906
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1921
1907
|
function PopoutShell({
|
|
1922
1908
|
popoutWindow,
|
|
1923
1909
|
mode,
|
|
1924
1910
|
children
|
|
1925
1911
|
}) {
|
|
1926
|
-
const value = (0,
|
|
1912
|
+
const value = (0, import_react14.useMemo)(
|
|
1927
1913
|
() => ({
|
|
1928
1914
|
popoutDocument: popoutWindow.document,
|
|
1929
1915
|
popoutWindow,
|
|
@@ -1932,14 +1918,14 @@ function PopoutShell({
|
|
|
1932
1918
|
}),
|
|
1933
1919
|
[popoutWindow, mode]
|
|
1934
1920
|
);
|
|
1935
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoutContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system6.PortalContainerProvider, { container: value.popoutContainer, children }) });
|
|
1921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_window_host.PopoutContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_design_system6.PortalContainerProvider, { container: value.popoutContainer, children }) });
|
|
1936
1922
|
}
|
|
1937
1923
|
|
|
1938
1924
|
// src/window/popout/PopoutPortal.tsx
|
|
1939
1925
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1940
1926
|
function PopoutPortal({ windowId, children }) {
|
|
1941
1927
|
const popoutWin = usePopoutWindowRef(windowId);
|
|
1942
|
-
const popoutMode = (0,
|
|
1928
|
+
const popoutMode = (0, import_react15.useSummonSelector)((0, import_summon7.selectPopoutMode)(windowId));
|
|
1943
1929
|
if (!popoutWin || popoutMode === null) return null;
|
|
1944
1930
|
return (0, import_react_dom2.createPortal)(
|
|
1945
1931
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PopoutShell, { popoutWindow: popoutWin, mode: popoutMode, children }),
|
|
@@ -1947,6 +1933,9 @@ function PopoutPortal({ windowId, children }) {
|
|
|
1947
1933
|
);
|
|
1948
1934
|
}
|
|
1949
1935
|
|
|
1936
|
+
// src/window/WindowPanel.tsx
|
|
1937
|
+
var import_window_host4 = require("@ai-matrx/summon/window-host");
|
|
1938
|
+
|
|
1950
1939
|
// src/window/tray/traySnapshotMap.ts
|
|
1951
1940
|
var import_global_slot5 = require("@ai-matrx/kit/global-slot");
|
|
1952
1941
|
var MAX_SNAPSHOTS = 16;
|
|
@@ -2062,16 +2051,16 @@ async function isFlatImage(blob) {
|
|
|
2062
2051
|
var import_summon9 = require("@ai-matrx/summon");
|
|
2063
2052
|
|
|
2064
2053
|
// src/window/tray/TrayChipPreview.tsx
|
|
2065
|
-
var
|
|
2054
|
+
var import_react16 = require("react");
|
|
2066
2055
|
var import_cn8 = require("@ai-matrx/design-system/cn");
|
|
2067
2056
|
var import_summon8 = require("@ai-matrx/summon");
|
|
2068
|
-
var
|
|
2069
|
-
var
|
|
2057
|
+
var import_react17 = require("@ai-matrx/summon/react");
|
|
2058
|
+
var import_window_host2 = require("@ai-matrx/summon/window-host");
|
|
2070
2059
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2071
2060
|
function isPlainRecord(value) {
|
|
2072
2061
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2073
2062
|
}
|
|
2074
|
-
var TrayChipPreview = (0,
|
|
2063
|
+
var TrayChipPreview = (0, import_react16.memo)(function TrayChipPreview2({
|
|
2075
2064
|
registryKey,
|
|
2076
2065
|
snapshotKey,
|
|
2077
2066
|
overlayInstanceId = import_summon8.DEFAULT_INSTANCE_ID,
|
|
@@ -2079,10 +2068,10 @@ var TrayChipPreview = (0, import_react17.memo)(function TrayChipPreview2({
|
|
|
2079
2068
|
title
|
|
2080
2069
|
}) {
|
|
2081
2070
|
const meta = (0, import_summon8.getOverlayMeta)(registryKey);
|
|
2082
|
-
const { Preview } = (0,
|
|
2083
|
-
const ports = (0,
|
|
2084
|
-
const overlayData = (0,
|
|
2085
|
-
const collectedData = (0,
|
|
2071
|
+
const { Preview } = (0, import_window_host2.getTrayPreviewEntry)(registryKey);
|
|
2072
|
+
const ports = (0, import_react17.useSummonPorts)();
|
|
2073
|
+
const overlayData = (0, import_react17.useSummonSelector)((state2) => meta ? (0, import_summon8.selectOverlayData)(state2, meta.id, overlayInstanceId) : null);
|
|
2074
|
+
const collectedData = (0, import_react17.useSummonSelector)((state2) => state2.windowManager.windows[snapshotKey]?.persistence?.data);
|
|
2086
2075
|
const registryLabel = meta?.label ?? null;
|
|
2087
2076
|
const fallback = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TraySnapshotImage, { snapshotKey, registryLabel, title });
|
|
2088
2077
|
if (Preview) {
|
|
@@ -2103,7 +2092,7 @@ var TrayChipPreview = (0, import_react17.memo)(function TrayChipPreview2({
|
|
|
2103
2092
|
}
|
|
2104
2093
|
return fallback;
|
|
2105
2094
|
});
|
|
2106
|
-
var PreviewBoundary = class extends
|
|
2095
|
+
var PreviewBoundary = class extends import_react16.Component {
|
|
2107
2096
|
state = { failed: false };
|
|
2108
2097
|
static getDerivedStateFromError() {
|
|
2109
2098
|
return { failed: true };
|
|
@@ -2115,7 +2104,7 @@ var PreviewBoundary = class extends import_react17.Component {
|
|
|
2115
2104
|
return this.state.failed ? this.props.fallback : this.props.children;
|
|
2116
2105
|
}
|
|
2117
2106
|
};
|
|
2118
|
-
var DefaultTrayChipBody = (0,
|
|
2107
|
+
var DefaultTrayChipBody = (0, import_react16.memo)(function DefaultTrayChipBody2({ label }) {
|
|
2119
2108
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-1 flex-col justify-between overflow-hidden bg-gradient-to-br from-muted/45 via-background to-primary/5 px-3 py-2.5", children: [
|
|
2120
2109
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
2121
2110
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
@@ -2138,12 +2127,12 @@ var DefaultTrayChipBody = (0, import_react17.memo)(function DefaultTrayChipBody2
|
|
|
2138
2127
|
] })
|
|
2139
2128
|
] });
|
|
2140
2129
|
});
|
|
2141
|
-
var TraySnapshotImage = (0,
|
|
2130
|
+
var TraySnapshotImage = (0, import_react16.memo)(function TraySnapshotImage2({
|
|
2142
2131
|
snapshotKey,
|
|
2143
2132
|
registryLabel,
|
|
2144
2133
|
title
|
|
2145
2134
|
}) {
|
|
2146
|
-
const snapshot = (0,
|
|
2135
|
+
const snapshot = (0, import_react16.useSyncExternalStore)(
|
|
2147
2136
|
subscribeTraySnapshotMap,
|
|
2148
2137
|
() => getTraySnapshot(snapshotKey),
|
|
2149
2138
|
() => null
|
|
@@ -2193,7 +2182,7 @@ function MinimizedWindowContent({
|
|
|
2193
2182
|
}
|
|
2194
2183
|
|
|
2195
2184
|
// src/window/WindowPanel.tsx
|
|
2196
|
-
var
|
|
2185
|
+
var import_window_host5 = require("@ai-matrx/summon/window-host");
|
|
2197
2186
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2198
2187
|
var GLIDE_SETTLE_MS = 800;
|
|
2199
2188
|
var HANDLES = [
|
|
@@ -2315,13 +2304,13 @@ function WindowPanel({
|
|
|
2315
2304
|
hidePopOutButton = false,
|
|
2316
2305
|
...hookOpts
|
|
2317
2306
|
}) {
|
|
2318
|
-
const instance = (0,
|
|
2307
|
+
const instance = (0, import_react19.useOptionalOverlayInstance)();
|
|
2319
2308
|
const instanceMatches = instance !== null && (boundToOverlay === true || instance.overlayId === overlayIdProp);
|
|
2320
2309
|
const overlayId = overlayIdProp ?? (boundToOverlay && instance ? instance.overlayId : void 0);
|
|
2321
2310
|
const overlayInstanceId = overlayInstanceIdProp ?? (instanceMatches ? instance.instanceId : void 0);
|
|
2322
|
-
const ports = (0,
|
|
2323
|
-
const windowConfig = (0,
|
|
2324
|
-
const reactId = (0,
|
|
2311
|
+
const ports = (0, import_react19.useSummonPorts)();
|
|
2312
|
+
const windowConfig = (0, import_window_host3.useWindowConfig)();
|
|
2313
|
+
const reactId = (0, import_react18.useId)();
|
|
2325
2314
|
const id = hookOpts.id ?? reactId;
|
|
2326
2315
|
const trayRegistryKey = overlayId ?? id;
|
|
2327
2316
|
const isMobile = (0, import_media_query.useIsMobile)();
|
|
@@ -2330,10 +2319,10 @@ function WindowPanel({
|
|
|
2330
2319
|
const registryMeta = overlayId ? (0, import_summon10.getOverlayMeta)(overlayId) : void 0;
|
|
2331
2320
|
const registryEntry = registryMeta?.window;
|
|
2332
2321
|
const effectiveInstanceId = overlayInstanceId ?? import_summon10.DEFAULT_INSTANCE_ID;
|
|
2333
|
-
const [autoOpened] = (0,
|
|
2322
|
+
const [autoOpened] = (0, import_react18.useState)(
|
|
2334
2323
|
() => Boolean(overlayId) && isAutoOpened(overlayId, effectiveInstanceId)
|
|
2335
2324
|
);
|
|
2336
|
-
(0,
|
|
2325
|
+
(0, import_react18.useEffect)(() => {
|
|
2337
2326
|
if (!overlayId) return void 0;
|
|
2338
2327
|
let timer;
|
|
2339
2328
|
return () => {
|
|
@@ -2347,16 +2336,16 @@ function WindowPanel({
|
|
|
2347
2336
|
const preservationEnabled = Boolean(
|
|
2348
2337
|
overlayId && registryEntry?.preservation && !registryEntry.ephemeral && (registryMeta?.instance !== "multi" || overlayInstanceId)
|
|
2349
2338
|
);
|
|
2350
|
-
const overlayLaunchData = (0,
|
|
2339
|
+
const overlayLaunchData = (0, import_react19.useSummonSelector)(
|
|
2351
2340
|
(state2) => overlayId ? (0, import_summon10.selectOverlayData)(state2, overlayId, effectiveInstanceId) : null
|
|
2352
2341
|
);
|
|
2353
2342
|
const initialPreservationData = registryEntry?.preservation ? sanitizeWindowData(overlayLaunchData, registryEntry.preservation.dataKeys) : {};
|
|
2354
2343
|
const popoutCapability = isMounted ? detectPopoutCapability() : null;
|
|
2355
2344
|
const popout = usePopoutWindow(id);
|
|
2356
|
-
(0,
|
|
2345
|
+
(0, import_react18.useEffect)(() => {
|
|
2357
2346
|
return registerPopoutOpener(id, popout.openPopout);
|
|
2358
2347
|
}, [id, popout.openPopout]);
|
|
2359
|
-
const handleDragOutPopout = (0,
|
|
2348
|
+
const handleDragOutPopout = (0, import_react18.useCallback)(
|
|
2360
2349
|
(draggedRect) => {
|
|
2361
2350
|
void popout.openPopout({
|
|
2362
2351
|
width: draggedRect.width,
|
|
@@ -2367,7 +2356,7 @@ function WindowPanel({
|
|
|
2367
2356
|
[popout, title]
|
|
2368
2357
|
);
|
|
2369
2358
|
const onTriggerPopout = !isMobile && popoutCapability !== "none" ? handleDragOutPopout : void 0;
|
|
2370
|
-
const autoDispatch = (0,
|
|
2359
|
+
const autoDispatch = (0, import_react19.useSummonDispatch)();
|
|
2371
2360
|
const {
|
|
2372
2361
|
windowState,
|
|
2373
2362
|
rect,
|
|
@@ -2405,10 +2394,10 @@ function WindowPanel({
|
|
|
2405
2394
|
});
|
|
2406
2395
|
const liftedZIndex = (0, import_design_system7.useFloatingLayerZIndex)(managerZIndex);
|
|
2407
2396
|
const zIndex = windowState === "minimized" ? Math.max(liftedZIndex, MINIMIZED_TILE_Z_FLOOR + managerZIndex) : liftedZIndex;
|
|
2408
|
-
const dispatch = (0,
|
|
2409
|
-
const windowsHidden = (0,
|
|
2397
|
+
const dispatch = (0, import_react19.useSummonDispatch)();
|
|
2398
|
+
const windowsHidden = (0, import_react19.useSummonSelector)(import_summon10.selectWindowsHidden);
|
|
2410
2399
|
const isDebugMode = useDebugFlag(ports.debug);
|
|
2411
|
-
(0,
|
|
2400
|
+
(0, import_react18.useEffect)(() => {
|
|
2412
2401
|
(0, import_design_system7.announceLayerFront)(
|
|
2413
2402
|
document.querySelector(`[data-window-id="${CSS.escape(id)}"]`)
|
|
2414
2403
|
);
|
|
@@ -2416,26 +2405,26 @@ function WindowPanel({
|
|
|
2416
2405
|
const claimFront = (event) => {
|
|
2417
2406
|
(0, import_design_system7.announceLayerFront)(event.currentTarget.closest("[data-window-id]") ?? event.currentTarget);
|
|
2418
2407
|
};
|
|
2419
|
-
const allWindows = (0,
|
|
2408
|
+
const allWindows = (0, import_react19.useSummonSelector)(import_summon10.selectAllWindows);
|
|
2420
2409
|
const isTopWindow = !isMobile ? true : allWindows.find((w) => w.state !== "minimized")?.id === id;
|
|
2421
|
-
const [activePaneMobile, setActivePaneMobile] = (0,
|
|
2410
|
+
const [activePaneMobile, setActivePaneMobile] = (0, import_react18.useState)(
|
|
2422
2411
|
"main"
|
|
2423
2412
|
);
|
|
2424
2413
|
const effectiveUrlSyncKey = resolveWindowUrlSyncKey(registryMeta?.link?.key, urlSyncKey);
|
|
2425
2414
|
const effectiveUrlSyncId = urlSyncId ?? (effectiveUrlSyncKey ? overlayId : void 0);
|
|
2426
|
-
(0,
|
|
2415
|
+
(0, import_react20.useOverlayLink)(effectiveUrlSyncKey, effectiveUrlSyncId, urlSyncArgs);
|
|
2427
2416
|
const deprecation = registryEntry?.deprecated;
|
|
2428
2417
|
const isDeprecated = !!deprecation;
|
|
2429
2418
|
const deprecatedRingClass = isDeprecated ? "ring-2 ring-destructive ring-offset-2 ring-offset-background" : "";
|
|
2430
2419
|
const hasSidebar = !!sidebar;
|
|
2431
|
-
const [sidebarOpen, setSidebarOpen] = (0,
|
|
2432
|
-
const [sidebarSize, setSidebarSize] = (0,
|
|
2420
|
+
const [sidebarOpen, setSidebarOpen] = (0, import_react18.useState)(defaultSidebarOpen);
|
|
2421
|
+
const [sidebarSize, setSidebarSize] = (0, import_react18.useState)(
|
|
2433
2422
|
sidebarDefaultSize
|
|
2434
2423
|
);
|
|
2435
|
-
const restoredPersistence = (0,
|
|
2436
|
-
const sidebarPanelRef = (0,
|
|
2437
|
-
const restoredChromeAppliedRef = (0,
|
|
2438
|
-
const handleSaveWindowState = (0,
|
|
2424
|
+
const restoredPersistence = (0, import_react19.useSummonSelector)((0, import_summon10.selectWindowPersistence)(id));
|
|
2425
|
+
const sidebarPanelRef = (0, import_react18.useRef)(null);
|
|
2426
|
+
const restoredChromeAppliedRef = (0, import_react18.useRef)(false);
|
|
2427
|
+
const handleSaveWindowState = (0, import_react18.useCallback)(() => {
|
|
2439
2428
|
if (!overlayId || !preservationEnabled || !registryEntry?.preservation) {
|
|
2440
2429
|
return;
|
|
2441
2430
|
}
|
|
@@ -2467,15 +2456,15 @@ function WindowPanel({
|
|
|
2467
2456
|
ports,
|
|
2468
2457
|
dispatch
|
|
2469
2458
|
]);
|
|
2470
|
-
const saveRef = (0,
|
|
2471
|
-
(0,
|
|
2459
|
+
const saveRef = (0, import_react18.useRef)(handleSaveWindowState);
|
|
2460
|
+
(0, import_react18.useEffect)(() => {
|
|
2472
2461
|
saveRef.current = handleSaveWindowState;
|
|
2473
2462
|
}, [handleSaveWindowState]);
|
|
2474
|
-
(0,
|
|
2463
|
+
(0, import_react18.useEffect)(() => {
|
|
2475
2464
|
if (!preservationEnabled) return;
|
|
2476
2465
|
saveRef.current();
|
|
2477
2466
|
}, [preservationEnabled, overlayLaunchData, onCollectData]);
|
|
2478
|
-
const handleClose = (0,
|
|
2467
|
+
const handleClose = (0, import_react18.useCallback)(() => {
|
|
2479
2468
|
if (instanceMatches && instance && instance.overlayId === overlayId) {
|
|
2480
2469
|
instance.close();
|
|
2481
2470
|
} else if (boundToOverlay) {
|
|
@@ -2490,7 +2479,7 @@ function WindowPanel({
|
|
|
2490
2479
|
}
|
|
2491
2480
|
onClose?.();
|
|
2492
2481
|
}, [boundToOverlay, dispatch, effectiveInstanceId, id, instance, instanceMatches, onClose, overlayId, overlayInstanceId, ports, registryMeta?.instance]);
|
|
2493
|
-
(0,
|
|
2482
|
+
(0, import_react18.useEffect)(() => {
|
|
2494
2483
|
if (!closeOnEscape || isMobile) return void 0;
|
|
2495
2484
|
const onKey = (e) => {
|
|
2496
2485
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
@@ -2517,7 +2506,7 @@ function WindowPanel({
|
|
|
2517
2506
|
document.addEventListener("keydown", onKey);
|
|
2518
2507
|
return () => document.removeEventListener("keydown", onKey);
|
|
2519
2508
|
}, [closeOnEscape, isMobile, id, handleClose, windowConfig.escapeYieldSelector]);
|
|
2520
|
-
(0,
|
|
2509
|
+
(0, import_react18.useEffect)(() => {
|
|
2521
2510
|
if (!restoredPersistence || restoredChromeAppliedRef.current) return;
|
|
2522
2511
|
restoredChromeAppliedRef.current = true;
|
|
2523
2512
|
setSidebarOpen(restoredPersistence.sidebarOpen);
|
|
@@ -2528,20 +2517,20 @@ function WindowPanel({
|
|
|
2528
2517
|
sidebarPanelRef.current?.resize(restoredPersistence.sidebarSize);
|
|
2529
2518
|
}
|
|
2530
2519
|
}, [restoredPersistence]);
|
|
2531
|
-
const [fitContentEl, fitContentRef] = (0,
|
|
2532
|
-
const fitContentStore = (0,
|
|
2533
|
-
const fitPlacedRef = (0,
|
|
2534
|
-
const [glideReady, setGlideReady] = (0,
|
|
2535
|
-
(0,
|
|
2520
|
+
const [fitContentEl, fitContentRef] = (0, import_react18.useState)(null);
|
|
2521
|
+
const fitContentStore = (0, import_react19.useSummonStore)();
|
|
2522
|
+
const fitPlacedRef = (0, import_react18.useRef)(false);
|
|
2523
|
+
const [glideReady, setGlideReady] = (0, import_react18.useState)(false);
|
|
2524
|
+
(0, import_react18.useEffect)(() => {
|
|
2536
2525
|
const timer = window.setTimeout(() => setGlideReady(true), GLIDE_SETTLE_MS);
|
|
2537
2526
|
return () => window.clearTimeout(timer);
|
|
2538
2527
|
}, []);
|
|
2539
|
-
(0,
|
|
2528
|
+
(0, import_react18.useEffect)(() => {
|
|
2540
2529
|
if (isInteracting) fitPlacedRef.current = true;
|
|
2541
2530
|
}, [isInteracting]);
|
|
2542
2531
|
const fitPresetPosition = hookOpts.position;
|
|
2543
2532
|
const fitMayReplace = hookOpts.initialRect?.x === void 0 && hookOpts.initialRect?.y === void 0;
|
|
2544
|
-
(0,
|
|
2533
|
+
(0, import_react18.useEffect)(() => {
|
|
2545
2534
|
if (!fitContent || isMobile || windowState !== "windowed") return void 0;
|
|
2546
2535
|
const el2 = fitContentEl;
|
|
2547
2536
|
if (!el2) return void 0;
|
|
@@ -2573,7 +2562,7 @@ function WindowPanel({
|
|
|
2573
2562
|
ro.disconnect();
|
|
2574
2563
|
};
|
|
2575
2564
|
}, [fitContent, fitContentEl, isMobile, windowState, id, dispatch, fitContentStore, fitPresetPosition, fitMayReplace]);
|
|
2576
|
-
const toggleSidebar = (0,
|
|
2565
|
+
const toggleSidebar = (0, import_react18.useCallback)(() => {
|
|
2577
2566
|
const panel = sidebarPanelRef.current;
|
|
2578
2567
|
if (!panel) return;
|
|
2579
2568
|
if (sidebarOpen) {
|
|
@@ -2609,7 +2598,7 @@ function WindowPanel({
|
|
|
2609
2598
|
id,
|
|
2610
2599
|
rect.width
|
|
2611
2600
|
]);
|
|
2612
|
-
const handleSidebarResize = (0,
|
|
2601
|
+
const handleSidebarResize = (0, import_react18.useCallback)(
|
|
2613
2602
|
(panelSize) => {
|
|
2614
2603
|
setSidebarOpen(panelSize.asPercentage > 0);
|
|
2615
2604
|
if (panelSize.inPixels > 0) setSidebarSize(panelSize.inPixels);
|
|
@@ -2626,20 +2615,20 @@ function WindowPanel({
|
|
|
2626
2615
|
[dispatch, id, preservationEnabled, sidebarSize]
|
|
2627
2616
|
);
|
|
2628
2617
|
const portalTarget = isMounted ? document.body : null;
|
|
2629
|
-
const [bodyHost] = (0,
|
|
2618
|
+
const [bodyHost] = (0, import_react18.useState)(() => {
|
|
2630
2619
|
if (typeof document === "undefined") return null;
|
|
2631
2620
|
const host = document.createElement("div");
|
|
2632
2621
|
host.className = "matrx-window-body-host";
|
|
2633
2622
|
host.setAttribute("data-window-body-host", "");
|
|
2634
2623
|
return host;
|
|
2635
2624
|
});
|
|
2636
|
-
(0,
|
|
2625
|
+
(0, import_react18.useEffect)(() => {
|
|
2637
2626
|
if (!overlayId) return void 0;
|
|
2638
2627
|
(0, import_summon10.ackOverlayRender)(overlayId, id);
|
|
2639
2628
|
return () => (0, import_summon10.clearOverlayRender)(overlayId, id);
|
|
2640
2629
|
}, [overlayId, id]);
|
|
2641
2630
|
const resolvedActionsRight = actionsRight ?? actions ?? null;
|
|
2642
|
-
const snapLeft = (0,
|
|
2631
|
+
const snapLeft = (0, import_react18.useCallback)(() => {
|
|
2643
2632
|
const { vw, vh } = (0, import_summon10.safeViewportDims)();
|
|
2644
2633
|
dispatch(
|
|
2645
2634
|
(0, import_summon10.updateWindowRect)({
|
|
@@ -2648,7 +2637,7 @@ function WindowPanel({
|
|
|
2648
2637
|
})
|
|
2649
2638
|
);
|
|
2650
2639
|
}, [dispatch, id]);
|
|
2651
|
-
const snapRight = (0,
|
|
2640
|
+
const snapRight = (0, import_react18.useCallback)(() => {
|
|
2652
2641
|
const { vw, vh } = (0, import_summon10.safeViewportDims)();
|
|
2653
2642
|
const half = Math.round(vw / 2);
|
|
2654
2643
|
dispatch(
|
|
@@ -2658,7 +2647,7 @@ function WindowPanel({
|
|
|
2658
2647
|
})
|
|
2659
2648
|
);
|
|
2660
2649
|
}, [dispatch, id]);
|
|
2661
|
-
const snapTop = (0,
|
|
2650
|
+
const snapTop = (0, import_react18.useCallback)(() => {
|
|
2662
2651
|
const { vw, vh } = (0, import_summon10.safeViewportDims)();
|
|
2663
2652
|
dispatch(
|
|
2664
2653
|
(0, import_summon10.updateWindowRect)({
|
|
@@ -2667,7 +2656,7 @@ function WindowPanel({
|
|
|
2667
2656
|
})
|
|
2668
2657
|
);
|
|
2669
2658
|
}, [dispatch, id]);
|
|
2670
|
-
const snapBottom = (0,
|
|
2659
|
+
const snapBottom = (0, import_react18.useCallback)(() => {
|
|
2671
2660
|
const { vw, vh } = (0, import_summon10.safeViewportDims)();
|
|
2672
2661
|
const half = Math.round(vh / 2);
|
|
2673
2662
|
dispatch(
|
|
@@ -2677,7 +2666,7 @@ function WindowPanel({
|
|
|
2677
2666
|
})
|
|
2678
2667
|
);
|
|
2679
2668
|
}, [dispatch, id]);
|
|
2680
|
-
const snapCentre = (0,
|
|
2669
|
+
const snapCentre = (0, import_react18.useCallback)(() => {
|
|
2681
2670
|
const { vw, vh } = (0, import_summon10.safeViewportDims)();
|
|
2682
2671
|
const w = Math.min(rect.width, vw);
|
|
2683
2672
|
const h = Math.min(rect.height, vh);
|
|
@@ -2693,7 +2682,7 @@ function WindowPanel({
|
|
|
2693
2682
|
})
|
|
2694
2683
|
);
|
|
2695
2684
|
}, [dispatch, id, rect.width, rect.height]);
|
|
2696
|
-
const arrangeAll = (0,
|
|
2685
|
+
const arrangeAll = (0, import_react18.useCallback)(
|
|
2697
2686
|
(layout) => {
|
|
2698
2687
|
const { vw, vh } = (0, import_summon10.safeViewportDims)();
|
|
2699
2688
|
dispatch(
|
|
@@ -2706,36 +2695,36 @@ function WindowPanel({
|
|
|
2706
2695
|
},
|
|
2707
2696
|
[dispatch]
|
|
2708
2697
|
);
|
|
2709
|
-
const popoutMode = (0,
|
|
2710
|
-
const outerPopout = usePopout();
|
|
2698
|
+
const popoutMode = (0, import_react19.useSummonSelector)((0, import_summon10.selectPopoutMode)(id));
|
|
2699
|
+
const outerPopout = (0, import_window_host4.usePopout)();
|
|
2711
2700
|
const outerPortalContainer = (0, import_design_system7.usePortalContainer)();
|
|
2712
2701
|
const popoutWin = usePopoutWindowRef(id);
|
|
2713
2702
|
const ownPopout = popoutMode !== null && popoutWin !== null;
|
|
2714
|
-
const bodyPopoutValue =
|
|
2703
|
+
const bodyPopoutValue = import_react18.default.useMemo(
|
|
2715
2704
|
() => ownPopout && popoutWin ? { popoutDocument: popoutWin.document, popoutWindow: popoutWin, popoutContainer: popoutWin.document.body, mode: popoutMode } : outerPopout,
|
|
2716
2705
|
[ownPopout, popoutWin, popoutMode, outerPopout]
|
|
2717
2706
|
);
|
|
2718
2707
|
const bodyPortalContainer = ownPopout && popoutWin ? popoutWin.document.body : outerPortalContainer;
|
|
2719
|
-
const popoutCandidateId = (0,
|
|
2708
|
+
const popoutCandidateId = (0, import_react19.useSummonSelector)(import_summon10.selectPopoutCandidateId);
|
|
2720
2709
|
const canShowPopOut = !hidePopOutButton && !isMobile && popoutCapability !== "none" && windowState !== "minimized" && popoutMode === null;
|
|
2721
|
-
const handlePopOut = (0,
|
|
2710
|
+
const handlePopOut = (0, import_react18.useCallback)(() => {
|
|
2722
2711
|
void popout.openPopout({
|
|
2723
2712
|
width: rect.width,
|
|
2724
2713
|
height: rect.height,
|
|
2725
2714
|
title: typeof title === "string" ? title : "Window"
|
|
2726
2715
|
});
|
|
2727
2716
|
}, [popout, rect.width, rect.height, title]);
|
|
2728
|
-
const handleDockBack = (0,
|
|
2717
|
+
const handleDockBack = (0, import_react18.useCallback)(() => {
|
|
2729
2718
|
dispatch((0, import_summon10.dockWindow)((0, import_summon10.buildDockWindowPayload)(id)));
|
|
2730
2719
|
}, [dispatch, id]);
|
|
2731
|
-
const bodyRef = (0,
|
|
2732
|
-
const retainedBodyDimensionsRef = (0,
|
|
2733
|
-
const captureGenerationRef = (0,
|
|
2734
|
-
const trayPreviewEntry = (0,
|
|
2720
|
+
const bodyRef = (0, import_react18.useRef)(null);
|
|
2721
|
+
const retainedBodyDimensionsRef = (0, import_react18.useRef)(null);
|
|
2722
|
+
const captureGenerationRef = (0, import_react18.useRef)(0);
|
|
2723
|
+
const trayPreviewEntry = (0, import_window_host5.getTrayPreviewEntry)(trayRegistryKey);
|
|
2735
2724
|
const effectiveTrayCapture = captureTraySnapshot ?? trayPreviewEntry.captureTraySnapshot ?? (trayPreviewEntry.Preview ? void 0 : defaultTraySnapshotCapture);
|
|
2736
|
-
const [pendingTrayCapture, setPendingTrayCapture] = (0,
|
|
2737
|
-
const [trayPreviewData, setTrayPreviewData] = (0,
|
|
2738
|
-
const handleMinimize = (0,
|
|
2725
|
+
const [pendingTrayCapture, setPendingTrayCapture] = (0, import_react18.useState)(null);
|
|
2726
|
+
const [trayPreviewData, setTrayPreviewData] = (0, import_react18.useState)(void 0);
|
|
2727
|
+
const handleMinimize = (0, import_react18.useCallback)(() => {
|
|
2739
2728
|
let collected;
|
|
2740
2729
|
try {
|
|
2741
2730
|
collected = onCollectData?.();
|
|
@@ -2775,7 +2764,7 @@ function WindowPanel({
|
|
|
2775
2764
|
preservationEnabled,
|
|
2776
2765
|
trayRegistryKey
|
|
2777
2766
|
]);
|
|
2778
|
-
(0,
|
|
2767
|
+
(0, import_react18.useEffect)(() => {
|
|
2779
2768
|
if (windowState !== "minimized" || !pendingTrayCapture) return void 0;
|
|
2780
2769
|
const bodyEl = bodyRef.current;
|
|
2781
2770
|
if (!bodyEl) {
|
|
@@ -2807,20 +2796,20 @@ function WindowPanel({
|
|
|
2807
2796
|
if (timeoutId) clearTimeout(timeoutId);
|
|
2808
2797
|
};
|
|
2809
2798
|
}, [id, pendingTrayCapture, ports, windowState]);
|
|
2810
|
-
const handleRestoreClearingSnapshot = (0,
|
|
2799
|
+
const handleRestoreClearingSnapshot = (0, import_react18.useCallback)(() => {
|
|
2811
2800
|
captureGenerationRef.current += 1;
|
|
2812
2801
|
setPendingTrayCapture(null);
|
|
2813
2802
|
clearTraySnapshot(id);
|
|
2814
2803
|
onRestore();
|
|
2815
2804
|
}, [id, onRestore]);
|
|
2816
|
-
(0,
|
|
2805
|
+
(0, import_react18.useEffect)(() => {
|
|
2817
2806
|
return () => {
|
|
2818
2807
|
captureGenerationRef.current += 1;
|
|
2819
2808
|
clearTraySnapshot(id);
|
|
2820
2809
|
};
|
|
2821
2810
|
}, [id]);
|
|
2822
|
-
const previousTrayStateRef = (0,
|
|
2823
|
-
(0,
|
|
2811
|
+
const previousTrayStateRef = (0, import_react18.useRef)(windowState);
|
|
2812
|
+
(0, import_react18.useEffect)(() => {
|
|
2824
2813
|
const wasMinimized = previousTrayStateRef.current === "minimized";
|
|
2825
2814
|
previousTrayStateRef.current = windowState;
|
|
2826
2815
|
if (!wasMinimized || windowState === "minimized") return;
|
|
@@ -2832,9 +2821,9 @@ function WindowPanel({
|
|
|
2832
2821
|
);
|
|
2833
2822
|
});
|
|
2834
2823
|
}, [id, windowState]);
|
|
2835
|
-
const prevStateRef = (0,
|
|
2836
|
-
const prevPopoutModeRef = (0,
|
|
2837
|
-
(0,
|
|
2824
|
+
const prevStateRef = (0, import_react18.useRef)(windowState);
|
|
2825
|
+
const prevPopoutModeRef = (0, import_react18.useRef)(popoutMode);
|
|
2826
|
+
(0, import_react18.useEffect)(() => {
|
|
2838
2827
|
const wasNonWindowed = prevStateRef.current !== "windowed" || prevPopoutModeRef.current !== null;
|
|
2839
2828
|
const isNowWindowed = windowState === "windowed" && popoutMode === null;
|
|
2840
2829
|
prevStateRef.current = windowState;
|
|
@@ -2848,7 +2837,7 @@ function WindowPanel({
|
|
|
2848
2837
|
const isMinimized = windowState === "minimized";
|
|
2849
2838
|
const isMaximized = windowState === "maximized";
|
|
2850
2839
|
const isPopoutCandidate = popoutCandidateId === id;
|
|
2851
|
-
(0,
|
|
2840
|
+
(0, import_react18.useEffect)(() => {
|
|
2852
2841
|
if (!isMobile || !isMinimized) return;
|
|
2853
2842
|
let cancelled = false;
|
|
2854
2843
|
queueMicrotask(() => {
|
|
@@ -2945,7 +2934,7 @@ function WindowPanel({
|
|
|
2945
2934
|
)
|
|
2946
2935
|
] })
|
|
2947
2936
|
] }) : children;
|
|
2948
|
-
const bodyContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2937
|
+
const bodyContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_window_host3.WindowSelectionSurface, { children: isDeprecated ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "h-full flex flex-col min-h-0", children: [
|
|
2949
2938
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2950
2939
|
DeprecationBanner,
|
|
2951
2940
|
{
|
|
@@ -2978,7 +2967,7 @@ function WindowPanel({
|
|
|
2978
2967
|
}
|
|
2979
2968
|
) : null;
|
|
2980
2969
|
const bodyPortal = isMounted && bodyHost && !isMobile ? (0, import_react_dom3.createPortal)(
|
|
2981
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PopoutContext.Provider, { value: bodyPopoutValue, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system7.PortalContainerProvider, { container: bodyPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "contents", onPointerDown: onFocus, onPointerDownCapture: claimFront, onFocusCapture: claimFront, children: bodyContent }) }) }),
|
|
2970
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_window_host4.PopoutContext.Provider, { value: bodyPopoutValue, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_design_system7.PortalContainerProvider, { container: bodyPortalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "contents", onPointerDown: onFocus, onPointerDownCapture: claimFront, onFocusCapture: claimFront, children: bodyContent }) }) }),
|
|
2982
2971
|
bodyHost
|
|
2983
2972
|
) : null;
|
|
2984
2973
|
if (isMobile) {
|
|
@@ -3008,7 +2997,7 @@ function WindowPanel({
|
|
|
3008
2997
|
surfaceLayer,
|
|
3009
2998
|
sizeToContent: mobileSizeToContent,
|
|
3010
2999
|
hideClose: mobileHideClose,
|
|
3011
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_window_host3.WindowSelectionSurface, { children })
|
|
3012
3001
|
}
|
|
3013
3002
|
);
|
|
3014
3003
|
}
|
|
@@ -3023,7 +3012,7 @@ function WindowPanel({
|
|
|
3023
3012
|
actionsRight: resolvedActionsRight,
|
|
3024
3013
|
bodyClassName,
|
|
3025
3014
|
surfaceLayer,
|
|
3026
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3015
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_window_host3.WindowSelectionSurface, { children })
|
|
3027
3016
|
}
|
|
3028
3017
|
);
|
|
3029
3018
|
}
|
|
@@ -3061,7 +3050,7 @@ function WindowPanel({
|
|
|
3061
3050
|
}
|
|
3062
3051
|
),
|
|
3063
3052
|
isDebugMode && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DebugStrip, { rect, zIndex }),
|
|
3064
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_cn9.cn)("flex-1 overflow-auto min-h-0", bodyClassName), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_cn9.cn)("flex-1 overflow-auto min-h-0", bodyClassName), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_window_host3.WindowSelectionSurface, { children: mobileBody }) }),
|
|
3065
3054
|
footerBar
|
|
3066
3055
|
]
|
|
3067
3056
|
}
|
|
@@ -3200,8 +3189,8 @@ function WindowPanel({
|
|
|
3200
3189
|
] });
|
|
3201
3190
|
}
|
|
3202
3191
|
function BodyMount({ host }) {
|
|
3203
|
-
const slotRef = (0,
|
|
3204
|
-
(0,
|
|
3192
|
+
const slotRef = (0, import_react18.useRef)(null);
|
|
3193
|
+
(0, import_react18.useLayoutEffect)(() => {
|
|
3205
3194
|
const slot2 = slotRef.current;
|
|
3206
3195
|
if (!slot2 || !host) return void 0;
|
|
3207
3196
|
slot2.appendChild(host);
|
|
@@ -3477,9 +3466,9 @@ function GreenTrafficLight({
|
|
|
3477
3466
|
onSaveWindowState,
|
|
3478
3467
|
onPopOut
|
|
3479
3468
|
}) {
|
|
3480
|
-
const [dropdownOpen, setDropdownOpen] = (0,
|
|
3481
|
-
const leaveTimer = (0,
|
|
3482
|
-
const containerRef = (0,
|
|
3469
|
+
const [dropdownOpen, setDropdownOpen] = (0, import_react18.useState)(false);
|
|
3470
|
+
const leaveTimer = (0, import_react18.useRef)(null);
|
|
3471
|
+
const containerRef = (0, import_react18.useRef)(null);
|
|
3483
3472
|
const openDropdown = () => {
|
|
3484
3473
|
if (leaveTimer.current) clearTimeout(leaveTimer.current);
|
|
3485
3474
|
setDropdownOpen(true);
|
|
@@ -3493,7 +3482,7 @@ function GreenTrafficLight({
|
|
|
3493
3482
|
fn();
|
|
3494
3483
|
setDropdownOpen(false);
|
|
3495
3484
|
};
|
|
3496
|
-
(0,
|
|
3485
|
+
(0, import_react18.useEffect)(() => {
|
|
3497
3486
|
if (!dropdownOpen) return void 0;
|
|
3498
3487
|
const onPointerOutside = (e) => {
|
|
3499
3488
|
const target = e.target;
|
|
@@ -3779,8 +3768,8 @@ function GreenTrafficLight({
|
|
|
3779
3768
|
}
|
|
3780
3769
|
|
|
3781
3770
|
// src/window.ts
|
|
3782
|
-
var
|
|
3783
|
-
var
|
|
3771
|
+
var import_window_host6 = require("@ai-matrx/summon/window-host");
|
|
3772
|
+
var import_window_host7 = require("@ai-matrx/summon/window-host");
|
|
3784
3773
|
|
|
3785
3774
|
// src/window/WindowSidebar.tsx
|
|
3786
3775
|
var import_cn10 = require("@ai-matrx/design-system/cn");
|
|
@@ -3814,19 +3803,9 @@ function WindowSidebar({
|
|
|
3814
3803
|
}) }) });
|
|
3815
3804
|
}
|
|
3816
3805
|
|
|
3817
|
-
// src/window/useOverlaySurfaceRenderAck.ts
|
|
3818
|
-
var import_react21 = require("react");
|
|
3819
|
-
var import_summon11 = require("@ai-matrx/summon");
|
|
3820
|
-
function useOverlaySurfaceRenderAck(overlayId, active) {
|
|
3821
|
-
(0, import_react21.useEffect)(() => {
|
|
3822
|
-
if (!active) return void 0;
|
|
3823
|
-
(0, import_summon11.ackOverlaySurfaceRender)(overlayId);
|
|
3824
|
-
return () => (0, import_summon11.clearOverlaySurfaceRender)(overlayId);
|
|
3825
|
-
}, [active, overlayId]);
|
|
3826
|
-
}
|
|
3827
|
-
|
|
3828
3806
|
// src/window.ts
|
|
3829
|
-
var
|
|
3807
|
+
var import_window_host8 = require("@ai-matrx/summon/window-host");
|
|
3808
|
+
var import_window_host9 = require("@ai-matrx/summon/window-host");
|
|
3830
3809
|
|
|
3831
3810
|
// src/window/tray/TrayStatusChip.tsx
|
|
3832
3811
|
var import_cn11 = require("@ai-matrx/design-system/cn");
|
|
@@ -3900,13 +3879,12 @@ function TrayStatusChip({
|
|
|
3900
3879
|
] });
|
|
3901
3880
|
}
|
|
3902
3881
|
|
|
3903
|
-
// src/window
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
}
|
|
3882
|
+
// src/window.ts
|
|
3883
|
+
var import_window_host10 = require("@ai-matrx/summon/window-host");
|
|
3884
|
+
var import_window_host11 = require("@ai-matrx/summon/window-host");
|
|
3907
3885
|
|
|
3908
3886
|
// src/window/utils/mayRaiseUnbidden.ts
|
|
3909
|
-
var
|
|
3887
|
+
var import_summon11 = require("@ai-matrx/summon");
|
|
3910
3888
|
function isUnderRoute(pathname, route) {
|
|
3911
3889
|
if (pathname === route) return true;
|
|
3912
3890
|
const base = route.endsWith("/") ? route.slice(0, -1) : route;
|
|
@@ -3916,7 +3894,7 @@ function describeHome(h) {
|
|
|
3916
3894
|
return typeof h === "string" ? h : `${h.route} (exact)`;
|
|
3917
3895
|
}
|
|
3918
3896
|
function mayRaiseUnbidden(overlayId, pathname) {
|
|
3919
|
-
const entry = (0,
|
|
3897
|
+
const entry = (0, import_summon11.getOverlayMeta)(overlayId);
|
|
3920
3898
|
const declared = entry?.window?.unbiddenHome ?? [];
|
|
3921
3899
|
const home = declared.map(describeHome);
|
|
3922
3900
|
if (home.length === 0) {
|