@linzjs/windows 7.3.0 → 8.0.0
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.
|
@@ -37,25 +37,27 @@ export const PanelInstanceContextProvider = ({
|
|
|
37
37
|
|
|
38
38
|
const undock = useCallback(() => setDockId(undefined), []);
|
|
39
39
|
|
|
40
|
+
const uniqueId = panelInstance.uniqueId;
|
|
41
|
+
|
|
40
42
|
return (
|
|
41
43
|
<PanelInstanceContext.Provider
|
|
42
44
|
value={{
|
|
43
45
|
title,
|
|
44
46
|
setTitle,
|
|
45
|
-
uniqueId
|
|
47
|
+
uniqueId,
|
|
46
48
|
bounds,
|
|
47
|
-
panelName:
|
|
49
|
+
panelName: uniqueId,
|
|
48
50
|
panelClose: () => {
|
|
49
51
|
panelInstance.window?.close();
|
|
50
52
|
panelInstance.window = null;
|
|
51
|
-
closePanel(
|
|
53
|
+
closePanel(uniqueId);
|
|
52
54
|
},
|
|
53
55
|
panelTogglePopout: togglePopOut,
|
|
54
56
|
panelPoppedOut: poppedOut,
|
|
55
57
|
setPanelWindow: (w: Window) => {
|
|
56
58
|
panelInstance.window = w;
|
|
57
59
|
},
|
|
58
|
-
bringPanelToFront: () => bringPanelToFront(
|
|
60
|
+
bringPanelToFront: () => bringPanelToFront(uniqueId),
|
|
59
61
|
zIndex: panelInstance.zIndex,
|
|
60
62
|
docked: !poppedOut && !!dockId && !!dockElements[dockId],
|
|
61
63
|
dockId,
|
|
@@ -24,7 +24,7 @@ export interface PanelsContextType {
|
|
|
24
24
|
// returns unique id of panel that was created/or arleady found, otherwise null on error.
|
|
25
25
|
openPanel: (args: OpenPanelOptions) => string | null;
|
|
26
26
|
closePanel: (uniqueId: string) => void;
|
|
27
|
-
bringPanelToFront: (
|
|
27
|
+
bringPanelToFront: (panelUniqueId: string) => void;
|
|
28
28
|
nextStackPosition: () => PanelPosition;
|
|
29
29
|
dockElements: Record<string, HTMLDivElement>;
|
|
30
30
|
setDockElement: (id: string, element: HTMLDivElement) => void;
|
|
@@ -50,7 +50,12 @@ export const PanelsContextProvider = ({
|
|
|
50
50
|
);
|
|
51
51
|
|
|
52
52
|
const bringPanelToFront = useCallback(
|
|
53
|
-
(
|
|
53
|
+
(panelUniqueId: string) => {
|
|
54
|
+
const panelInstance = panelInstances.find((panelInstance) => panelInstance.uniqueId === panelUniqueId);
|
|
55
|
+
if (!panelInstance) {
|
|
56
|
+
console.warn(`bringPanelToFront cannot find panel with uniqueId: ${panelUniqueId}`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
54
59
|
if (panelInstance.window) {
|
|
55
60
|
panelInstance.window.focus();
|
|
56
61
|
} else {
|
|
@@ -74,7 +79,7 @@ export const PanelsContextProvider = ({
|
|
|
74
79
|
if (existingPanelInstance.window) {
|
|
75
80
|
existingPanelInstance.window?.focus();
|
|
76
81
|
} else {
|
|
77
|
-
bringPanelToFront(
|
|
82
|
+
bringPanelToFront(uniqueId);
|
|
78
83
|
}
|
|
79
84
|
return existingPanelInstance.uniqueId;
|
|
80
85
|
}
|