@itwin/appui-react 4.5.1 → 4.6.1
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 +20 -1
- package/lib/cjs/appui-react/accudraw/MenuButton.d.ts +2 -2
- package/lib/cjs/appui-react/accudraw/MenuButton.d.ts.map +1 -1
- package/lib/cjs/appui-react/accudraw/MenuButton.js.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposer.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/CopyStyles.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/CopyStyles.js +3 -1
- package/lib/cjs/appui-react/childwindow/CopyStyles.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +2 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/cursor/CursorInformation.d.ts +6 -6
- package/lib/cjs/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.d.ts +4 -4
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +5 -5
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +2 -2
- package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
- package/lib/cjs/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
- package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts +1 -2
- package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
- package/lib/cjs/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +22 -26
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +185 -254
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts +1 -7
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js +0 -6
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveIModelConnection.d.ts.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveIModelConnection.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveViewport.d.ts.map +1 -1
- package/lib/cjs/appui-react/hooks/useActiveViewport.js.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/InternalKeyboardShortcut.d.ts.map +1 -1
- package/lib/cjs/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts +0 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.js +1 -2
- package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/cjs/appui-react/messages/Pointer.d.ts +1 -2
- package/lib/cjs/appui-react/messages/Pointer.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/Pointer.js +1 -1
- package/lib/cjs/appui-react/messages/Pointer.js.map +1 -1
- package/lib/cjs/appui-react/popup/PositionPopup.d.ts +2 -2
- package/lib/cjs/appui-react/popup/PositionPopup.d.ts.map +1 -1
- package/lib/cjs/appui-react/popup/PositionPopup.js.map +1 -1
- package/lib/cjs/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +16 -20
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +80 -115
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusfields/MessageCenter.js +1 -2
- package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts +36 -0
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts.map +1 -0
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.js +134 -0
- package/lib/cjs/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -0
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts +1 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js +2 -2
- package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/cjs/appui-react/syncui/UiSyncEvent.d.ts +16 -0
- package/lib/cjs/appui-react/syncui/UiSyncEvent.d.ts.map +1 -0
- package/lib/cjs/appui-react/syncui/UiSyncEvent.js +18 -0
- package/lib/cjs/appui-react/syncui/UiSyncEvent.js.map +1 -0
- package/lib/cjs/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
- package/lib/cjs/appui-react/uistate/useUiStateStorage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +7 -29
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +101 -434
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js +16 -3
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.d.ts +10 -4
- package/lib/cjs/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/Widget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +9 -29
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +89 -46
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +1 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +1 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/accudraw/MenuButton.d.ts +2 -2
- package/lib/esm/appui-react/accudraw/MenuButton.d.ts.map +1 -1
- package/lib/esm/appui-react/accudraw/MenuButton.js.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposer.js.map +1 -1
- package/lib/esm/appui-react/childwindow/CopyStyles.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/CopyStyles.js +3 -1
- package/lib/esm/appui-react/childwindow/CopyStyles.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +2 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/cursor/CursorInformation.d.ts +6 -6
- package/lib/esm/appui-react/cursor/CursorInformation.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.d.ts +4 -4
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts +5 -5
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.d.ts +2 -2
- package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
- package/lib/esm/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
- package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/esm/appui-react/feedback/ElementTooltip.d.ts +1 -2
- package/lib/esm/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
- package/lib/esm/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +22 -26
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +189 -258
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts +1 -7
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js +0 -6
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveIModelConnection.d.ts.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveIModelConnection.js.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveViewport.d.ts.map +1 -1
- package/lib/esm/appui-react/hooks/useActiveViewport.js.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/InternalKeyboardShortcut.d.ts.map +1 -1
- package/lib/esm/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts +0 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.js +1 -2
- package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/esm/appui-react/messages/Pointer.d.ts +1 -2
- package/lib/esm/appui-react/messages/Pointer.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/Pointer.js +1 -1
- package/lib/esm/appui-react/messages/Pointer.js.map +1 -1
- package/lib/esm/appui-react/popup/PositionPopup.d.ts +2 -2
- package/lib/esm/appui-react/popup/PositionPopup.d.ts.map +1 -1
- package/lib/esm/appui-react/popup/PositionPopup.js.map +1 -1
- package/lib/esm/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +16 -20
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +78 -114
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
- package/lib/esm/appui-react/statusfields/MessageCenter.js +1 -2
- package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts +36 -0
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.d.ts.map +1 -0
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.js +130 -0
- package/lib/esm/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -0
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts +1 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js +2 -2
- package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/esm/appui-react/syncui/UiSyncEvent.d.ts +16 -0
- package/lib/esm/appui-react/syncui/UiSyncEvent.d.ts.map +1 -0
- package/lib/esm/appui-react/syncui/UiSyncEvent.js +14 -0
- package/lib/esm/appui-react/syncui/UiSyncEvent.js.map +1 -0
- package/lib/esm/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.d.ts.map +1 -1
- package/lib/esm/appui-react/uistate/useUiStateStorage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +7 -29
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +104 -433
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.js +16 -3
- package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.d.ts +10 -4
- package/lib/esm/appui-react/widgets/Widget.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/Widget.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts +9 -29
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +89 -46
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react.d.ts +1 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +1 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/package.json +10 -10
|
@@ -20,7 +20,6 @@ const UiFramework_1 = require("../UiFramework");
|
|
|
20
20
|
const WidgetDef_1 = require("../widgets/WidgetDef");
|
|
21
21
|
const TimeTracker_1 = require("../configurableui/TimeTracker");
|
|
22
22
|
const PopoutWidget_1 = require("../childwindow/PopoutWidget");
|
|
23
|
-
const Frontstage_1 = require("../widget-panels/Frontstage");
|
|
24
23
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
25
24
|
const StageUsage_1 = require("./StageUsage");
|
|
26
25
|
const StagePanelLocation_1 = require("../stagepanels/StagePanelLocation");
|
|
@@ -104,101 +103,90 @@ class FrontstageDef {
|
|
|
104
103
|
const panel = nineZone.panels[panelSide];
|
|
105
104
|
const location = this.toStagePanelLocation(panelSide);
|
|
106
105
|
const panelDef = this.getStagePanelDef(location);
|
|
107
|
-
if (panelDef)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
for (const widgetId of panel.widgets) {
|
|
114
|
-
const widget = nineZone.widgets[widgetId];
|
|
115
|
-
// istanbul ignore else
|
|
116
|
-
if (widget) {
|
|
117
|
-
for (const tabId of widget.tabs) {
|
|
118
|
-
const widgetDef = this.findWidgetDef(tabId);
|
|
119
|
-
if (widgetDef) {
|
|
120
|
-
let widgetState = WidgetState_1.WidgetState.Open;
|
|
121
|
-
if (widget.minimized || tabId !== widget.activeTabId)
|
|
122
|
-
widgetState = WidgetState_1.WidgetState.Closed;
|
|
123
|
-
widgetMap.set(widgetDef, widgetState);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
106
|
+
if (!panelDef)
|
|
107
|
+
continue;
|
|
108
|
+
const panelState = panel.collapsed
|
|
109
|
+
? StagePanelDef_1.StagePanelState.Minimized
|
|
110
|
+
: StagePanelDef_1.StagePanelState.Open;
|
|
111
|
+
panelMap.set(panelDef, panelState);
|
|
128
112
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
widgetMap.set(widgetDef, widgetState);
|
|
140
|
-
}
|
|
113
|
+
for (const widgetDef of this.widgetDefs) {
|
|
114
|
+
const widgetId = widgetDef.id;
|
|
115
|
+
if (widgetDef === this.toolSettings) {
|
|
116
|
+
if (!nineZone.toolSettings) {
|
|
117
|
+
widgetMap.set(widgetDef, WidgetState_1.WidgetState.Hidden);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
else if (nineZone.toolSettings.type === "docked") {
|
|
121
|
+
widgetMap.set(widgetDef, WidgetState_1.WidgetState.Open);
|
|
122
|
+
continue;
|
|
141
123
|
}
|
|
142
124
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
widgetMap.set(toolSettingsDef, WidgetState_1.WidgetState.Hidden);
|
|
148
|
-
}
|
|
149
|
-
else if (nineZone.toolSettings.type === "docked") {
|
|
150
|
-
widgetMap.set(toolSettingsDef, WidgetState_1.WidgetState.Open);
|
|
125
|
+
const tabLocation = (0, appui_layout_react_1.getTabLocation)(nineZone, widgetId);
|
|
126
|
+
if (!tabLocation) {
|
|
127
|
+
widgetMap.set(widgetDef, WidgetState_1.WidgetState.Hidden);
|
|
128
|
+
continue;
|
|
151
129
|
}
|
|
130
|
+
const widget = nineZone.widgets[tabLocation.widgetId];
|
|
131
|
+
let widgetState = WidgetState_1.WidgetState.Open;
|
|
132
|
+
if (widget.minimized || widgetId !== widget.activeTabId)
|
|
133
|
+
widgetState = WidgetState_1.WidgetState.Closed;
|
|
134
|
+
widgetMap.set(widgetDef, widgetState);
|
|
152
135
|
}
|
|
153
136
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (!
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const panel = state.panels[panelSide];
|
|
189
|
-
const location = this.toStagePanelLocation(panelSide);
|
|
190
|
-
const panelDef = this.getStagePanelDef(location);
|
|
191
|
-
if (panelDef) {
|
|
192
|
-
panelDef.size = panel.size;
|
|
193
|
-
panelDef.pinned = panel.pinned;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
137
|
+
triggerStateChangeEvents(oldState) {
|
|
138
|
+
const newState = this.nineZoneState;
|
|
139
|
+
if (!newState)
|
|
140
|
+
return;
|
|
141
|
+
if (this._isStageClosing || this._isApplicationClosing)
|
|
142
|
+
return;
|
|
143
|
+
const originalPanelStateMap = new Map();
|
|
144
|
+
const originalWidgetStateMap = new Map();
|
|
145
|
+
const newPanelStateMap = new Map();
|
|
146
|
+
const newWidgetStateMap = new Map();
|
|
147
|
+
this.populateStateMaps(oldState, originalPanelStateMap, originalWidgetStateMap);
|
|
148
|
+
this.populateStateMaps(newState, newPanelStateMap, newWidgetStateMap);
|
|
149
|
+
// Now walk and trigger set state events
|
|
150
|
+
newWidgetStateMap.forEach((newWidgetState, widgetDef) => {
|
|
151
|
+
const originalState = originalWidgetStateMap.get(widgetDef);
|
|
152
|
+
if (originalState === newWidgetState)
|
|
153
|
+
return;
|
|
154
|
+
widgetDef.handleWidgetStateChanged(newWidgetState);
|
|
155
|
+
});
|
|
156
|
+
newPanelStateMap.forEach((newPanelState, panelDef) => {
|
|
157
|
+
const originalState = originalPanelStateMap.get(panelDef);
|
|
158
|
+
if (originalState === newPanelState)
|
|
159
|
+
return;
|
|
160
|
+
panelDef.handlePanelStateChanged(newPanelState);
|
|
161
|
+
});
|
|
162
|
+
for (const panelSide of appui_layout_react_1.panelSides) {
|
|
163
|
+
const panel = newState.panels[panelSide];
|
|
164
|
+
const oldPanel = oldState.panels[panelSide];
|
|
165
|
+
const location = this.toStagePanelLocation(panelSide);
|
|
166
|
+
const panelDef = this.getStagePanelDef(location);
|
|
167
|
+
if (!panelDef)
|
|
168
|
+
continue;
|
|
169
|
+
if (panel.size !== oldPanel.size) {
|
|
170
|
+
panelDef.handleSizeChanged(panel.size);
|
|
196
171
|
}
|
|
197
|
-
|
|
198
|
-
|
|
172
|
+
if (panel.pinned !== oldPanel.pinned) {
|
|
173
|
+
panelDef.handlePinnedChanged(panel.pinned);
|
|
199
174
|
}
|
|
200
175
|
}
|
|
201
176
|
}
|
|
177
|
+
handlePopouts(oldState) {
|
|
178
|
+
const newState = this.nineZoneState;
|
|
179
|
+
const oldPopouts = oldState?.popoutWidgets.allIds || [];
|
|
180
|
+
const newPopouts = newState?.popoutWidgets.allIds || [];
|
|
181
|
+
const popoutsToClose = oldPopouts.filter((p) => !newPopouts.includes(p));
|
|
182
|
+
const popoutsToOpen = newPopouts.filter((p) => !oldPopouts.includes(p));
|
|
183
|
+
for (const popoutId of popoutsToClose) {
|
|
184
|
+
UiFramework_1.UiFramework.childWindows.close(popoutId, true);
|
|
185
|
+
}
|
|
186
|
+
for (const popoutId of popoutsToOpen) {
|
|
187
|
+
this.openPopoutWidgetContainer(popoutId);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
202
190
|
/** @internal */
|
|
203
191
|
get nineZoneState() {
|
|
204
192
|
return this._nineZoneState;
|
|
@@ -206,26 +194,31 @@ class FrontstageDef {
|
|
|
206
194
|
set nineZoneState(state) {
|
|
207
195
|
if (this._nineZoneState === state)
|
|
208
196
|
return;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
197
|
+
const oldState = this._nineZoneState;
|
|
198
|
+
this._nineZoneState = state;
|
|
199
|
+
this.handlePopouts(oldState);
|
|
200
|
+
if (oldState) {
|
|
201
|
+
this.triggerStateChangeEvents(oldState);
|
|
202
|
+
}
|
|
203
|
+
const isClosing = this._isStageClosing || this._isApplicationClosing;
|
|
204
|
+
if (isClosing && !this.isReady)
|
|
205
|
+
return;
|
|
206
|
+
InternalFrontstageManager_1.InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.emit({
|
|
207
|
+
frontstageDef: this,
|
|
208
|
+
state,
|
|
209
|
+
});
|
|
222
210
|
}
|
|
223
211
|
/** @internal */
|
|
224
|
-
get
|
|
225
|
-
return this.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
212
|
+
get dispatch() {
|
|
213
|
+
return (this._dispatch ??= (action) => {
|
|
214
|
+
if (action.type === "RESIZE") {
|
|
215
|
+
InternalFrontstageManager_1.InternalFrontstageManager.nineZoneSize = core_react_1.Size.create(action.size);
|
|
216
|
+
}
|
|
217
|
+
const state = this.nineZoneState;
|
|
218
|
+
if (!state)
|
|
219
|
+
return;
|
|
220
|
+
this.nineZoneState = (0, appui_layout_react_1.NineZoneStateReducer)(state, action);
|
|
221
|
+
});
|
|
229
222
|
}
|
|
230
223
|
/** @internal */
|
|
231
224
|
get timeTracker() {
|
|
@@ -515,7 +508,9 @@ class FrontstageDef {
|
|
|
515
508
|
frontstageDef: this,
|
|
516
509
|
});
|
|
517
510
|
}
|
|
518
|
-
/**
|
|
511
|
+
/** Restores frontstage layout to initial configuration.
|
|
512
|
+
* @beta
|
|
513
|
+
*/
|
|
519
514
|
restoreLayout() {
|
|
520
515
|
for (const panelDef of this.panelDefs) {
|
|
521
516
|
panelDef.size = panelDef.defaultSize;
|
|
@@ -545,11 +540,7 @@ class FrontstageDef {
|
|
|
545
540
|
if (!location)
|
|
546
541
|
return WidgetState_1.WidgetState.Hidden;
|
|
547
542
|
if ((0, appui_layout_react_1.isFloatingTabLocation)(location)) {
|
|
548
|
-
|
|
549
|
-
if (floatingWidget && floatingWidget.hidden)
|
|
550
|
-
return WidgetState_1.WidgetState.Hidden;
|
|
551
|
-
else
|
|
552
|
-
return WidgetState_1.WidgetState.Floating;
|
|
543
|
+
return WidgetState_1.WidgetState.Floating;
|
|
553
544
|
}
|
|
554
545
|
let collapsedPanel = false;
|
|
555
546
|
// istanbul ignore else
|
|
@@ -566,24 +557,6 @@ class FrontstageDef {
|
|
|
566
557
|
}
|
|
567
558
|
return widgetDef.defaultState;
|
|
568
559
|
}
|
|
569
|
-
/** Used only in UI 2.0 to determine StagePanelState and size from NinezoneState
|
|
570
|
-
* @internal
|
|
571
|
-
*/
|
|
572
|
-
getPanelCurrentState(panelDef) {
|
|
573
|
-
// istanbul ignore next
|
|
574
|
-
if (this.nineZoneState) {
|
|
575
|
-
const side = (0, StagePanelDef_1.toPanelSide)(panelDef.location);
|
|
576
|
-
const panel = this.nineZoneState.panels[side];
|
|
577
|
-
if (panel)
|
|
578
|
-
return [
|
|
579
|
-
panel.collapsed ? StagePanelDef_1.StagePanelState.Minimized : StagePanelDef_1.StagePanelState.Open,
|
|
580
|
-
panel.size ?? 0,
|
|
581
|
-
panel.pinned,
|
|
582
|
-
];
|
|
583
|
-
return [StagePanelDef_1.StagePanelState.Off, 0, false];
|
|
584
|
-
}
|
|
585
|
-
return [panelDef.defaultState, panelDef.defaultSize ?? 0, true];
|
|
586
|
-
}
|
|
587
560
|
isPopoutWidget(widgetId) {
|
|
588
561
|
// istanbul ignore else
|
|
589
562
|
if (this.nineZoneState) {
|
|
@@ -607,89 +580,65 @@ class FrontstageDef {
|
|
|
607
580
|
/** Create a new floating panel that contains the widget specified by its Id. Supported only when in
|
|
608
581
|
* UI 2.0 or higher.
|
|
609
582
|
* @param widgetId case sensitive Widget Id
|
|
610
|
-
* @param
|
|
583
|
+
* @param position Position of top left corner of floating panel in pixels. If undefined {x:50, y:100} is used.
|
|
611
584
|
* @param size defines the width and height of the floating panel. If undefined and widget has been floated before
|
|
612
585
|
* the previous size is used, else {height:400, width:400} is used.
|
|
613
586
|
* @beta
|
|
614
587
|
*/
|
|
615
|
-
floatWidget(widgetId,
|
|
616
|
-
|
|
617
|
-
if (
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
setTimeout(() => {
|
|
629
|
-
popoutWidgetContainerId &&
|
|
630
|
-
UiFramework_1.UiFramework.childWindows.close(popoutWidgetContainerId, true);
|
|
631
|
-
}, 600);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
}
|
|
588
|
+
floatWidget(widgetId, position, size) {
|
|
589
|
+
const state = this.nineZoneState;
|
|
590
|
+
if (!state)
|
|
591
|
+
return;
|
|
592
|
+
const widgetDef = this.findWidgetDef(widgetId);
|
|
593
|
+
if (!widgetDef)
|
|
594
|
+
return;
|
|
595
|
+
this.dispatch({
|
|
596
|
+
type: "WIDGET_TAB_FLOAT",
|
|
597
|
+
id: widgetId,
|
|
598
|
+
position,
|
|
599
|
+
size,
|
|
600
|
+
});
|
|
635
601
|
}
|
|
636
602
|
/** Check widget and panel state to determine whether the widget is currently displayed
|
|
637
603
|
* @param widgetId case-sensitive Widget Id
|
|
638
604
|
* @public
|
|
639
605
|
*/
|
|
640
606
|
isWidgetDisplayed(widgetId) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
widgetIsVisible = true;
|
|
652
|
-
}
|
|
653
|
-
else if ((0, appui_layout_react_1.isPopoutTabLocation)(tabLocation)) {
|
|
654
|
-
widgetIsVisible = true;
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
// istanbul ignore else
|
|
658
|
-
if ((0, appui_layout_react_1.isPanelTabLocation)(tabLocation)) {
|
|
659
|
-
const panel = this.nineZoneState.panels[tabLocation.side];
|
|
660
|
-
const widgetDef = this.findWidgetDef(widgetId);
|
|
661
|
-
if (widgetDef &&
|
|
662
|
-
widgetDef.state === WidgetState_1.WidgetState.Open &&
|
|
663
|
-
!panel.collapsed)
|
|
664
|
-
widgetIsVisible = true;
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
}
|
|
607
|
+
if (!this.nineZoneState)
|
|
608
|
+
return false;
|
|
609
|
+
const tabLocation = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
610
|
+
if (!tabLocation)
|
|
611
|
+
return false;
|
|
612
|
+
if ((0, appui_layout_react_1.isPanelTabLocation)(tabLocation)) {
|
|
613
|
+
const panel = this.nineZoneState.panels[tabLocation.side];
|
|
614
|
+
const widgetDef = this.findWidgetDef(widgetId);
|
|
615
|
+
const isVisible = !!widgetDef && widgetDef.state === WidgetState_1.WidgetState.Open && !panel.collapsed;
|
|
616
|
+
return isVisible;
|
|
668
617
|
}
|
|
669
|
-
return
|
|
618
|
+
return true;
|
|
670
619
|
}
|
|
671
620
|
/** Opens window for specified PopoutWidget container. Used to reopen popout when running in Electron.
|
|
672
|
-
* @internal
|
|
673
|
-
|
|
621
|
+
* @internal
|
|
622
|
+
*/
|
|
623
|
+
openPopoutWidgetContainer(widgetContainerId) {
|
|
624
|
+
const state = this.nineZoneState;
|
|
625
|
+
if (!state)
|
|
626
|
+
return;
|
|
674
627
|
const location = (0, appui_layout_react_1.getWidgetLocation)(state, widgetContainerId);
|
|
675
|
-
// istanbul ignore next
|
|
676
628
|
if (!location)
|
|
677
629
|
return;
|
|
678
|
-
// istanbul ignore next
|
|
679
630
|
if (!(0, appui_layout_react_1.isPopoutWidgetLocation)(location))
|
|
680
631
|
return;
|
|
681
632
|
const widget = state.widgets[widgetContainerId];
|
|
682
|
-
const popoutWidget = state.popoutWidgets.byId[location.popoutWidgetId];
|
|
683
633
|
// Popout widget should only contain a single tab.
|
|
684
|
-
// istanbul ignore next
|
|
685
634
|
if (widget.tabs.length !== 1)
|
|
686
635
|
return;
|
|
687
636
|
const tabId = widget.tabs[0];
|
|
688
637
|
const widgetDef = this.findWidgetDef(tabId);
|
|
689
|
-
// istanbul ignore next
|
|
690
638
|
if (!widgetDef)
|
|
691
639
|
return;
|
|
692
640
|
const popoutContent = (React.createElement(PopoutWidget_1.PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
|
|
641
|
+
const popoutWidget = state.popoutWidgets.byId[location.popoutWidgetId];
|
|
693
642
|
const bounds = core_react_1.Rectangle.create(popoutWidget.bounds);
|
|
694
643
|
const position = {
|
|
695
644
|
width: bounds.getWidth(),
|
|
@@ -702,48 +651,23 @@ class FrontstageDef {
|
|
|
702
651
|
/** Create a new popout/child window that contains the widget specified by its Id. Supported only when in
|
|
703
652
|
* UI 2.0 or higher.
|
|
704
653
|
* @param widgetId case sensitive Widget Id
|
|
705
|
-
* @param
|
|
654
|
+
* @param position Position of top left corner of floating panel in pixels. If undefined {x:0, y:0} is used.
|
|
706
655
|
* @param size defines the width and height of the floating panel. If undefined and widget has been floated before
|
|
707
656
|
* the previous size is used, else {height:800, width:600} is used.
|
|
708
657
|
* @beta
|
|
709
658
|
*/
|
|
710
|
-
popoutWidget(widgetId,
|
|
711
|
-
|
|
712
|
-
if (!
|
|
713
|
-
return;
|
|
714
|
-
let location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
715
|
-
if (!location || (0, appui_layout_react_1.isPopoutTabLocation)(location))
|
|
659
|
+
popoutWidget(widgetId, position, size) {
|
|
660
|
+
const state = this.nineZoneState;
|
|
661
|
+
if (!state)
|
|
716
662
|
return;
|
|
717
663
|
const widgetDef = this.findWidgetDef(widgetId);
|
|
718
|
-
// istanbul ignore next
|
|
719
664
|
if (!widgetDef)
|
|
720
665
|
return;
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
if (size)
|
|
727
|
-
preferredBounds = preferredBounds.setSize(size);
|
|
728
|
-
if (point)
|
|
729
|
-
preferredBounds = preferredBounds.setPosition(point);
|
|
730
|
-
const state = (0, appui_layout_react_1.popoutWidgetToChildWindow)(this.nineZoneState, widgetId, preferredBounds);
|
|
731
|
-
this.nineZoneState = state;
|
|
732
|
-
// now that the state is updated get the id of the container that houses the widgetTab/widgetId
|
|
733
|
-
location = (0, appui_layout_react_1.getTabLocation)(state, widgetId);
|
|
734
|
-
(0, core_bentley_1.assert)(!!location && (0, appui_layout_react_1.isPopoutTabLocation)(location));
|
|
735
|
-
const widgetContainerId = location.widgetId;
|
|
736
|
-
const popoutWidget = state.popoutWidgets.byId[widgetContainerId];
|
|
737
|
-
const bounds = core_react_1.Rectangle.create(popoutWidget.bounds);
|
|
738
|
-
setTimeout(() => {
|
|
739
|
-
const popoutContent = (React.createElement(PopoutWidget_1.PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
|
|
740
|
-
const position = {
|
|
741
|
-
width: bounds.getWidth(),
|
|
742
|
-
height: bounds.getHeight(),
|
|
743
|
-
left: bounds.left,
|
|
744
|
-
top: bounds.top,
|
|
745
|
-
};
|
|
746
|
-
UiFramework_1.UiFramework.childWindows.open(widgetContainerId, widgetDef.label, popoutContent, position, UiFramework_1.UiFramework.useDefaultPopoutUrl);
|
|
666
|
+
this.dispatch({
|
|
667
|
+
type: "WIDGET_TAB_POPOUT",
|
|
668
|
+
id: widgetId,
|
|
669
|
+
position,
|
|
670
|
+
size,
|
|
747
671
|
});
|
|
748
672
|
}
|
|
749
673
|
get isStageClosing() {
|
|
@@ -757,12 +681,13 @@ class FrontstageDef {
|
|
|
757
681
|
}
|
|
758
682
|
/** @internal */
|
|
759
683
|
saveChildWindowSizeAndPosition(childWindowId, childWindow) {
|
|
760
|
-
|
|
684
|
+
const state = this.nineZoneState;
|
|
685
|
+
if (!state)
|
|
761
686
|
return;
|
|
762
|
-
const location = (0, appui_layout_react_1.getWidgetLocation)(
|
|
687
|
+
const location = (0, appui_layout_react_1.getWidgetLocation)(state, childWindowId);
|
|
763
688
|
if (!location || !(0, appui_layout_react_1.isPopoutWidgetLocation)(location))
|
|
764
689
|
return;
|
|
765
|
-
const widget =
|
|
690
|
+
const widget = state.widgets[location.popoutWidgetId];
|
|
766
691
|
const tabId = widget.tabs[0];
|
|
767
692
|
const widgetDef = this.findWidgetDef(tabId);
|
|
768
693
|
if (!widgetDef)
|
|
@@ -775,23 +700,34 @@ class FrontstageDef {
|
|
|
775
700
|
x: childWindow.screenX,
|
|
776
701
|
y: childWindow.screenY,
|
|
777
702
|
});
|
|
778
|
-
|
|
703
|
+
this.dispatch({
|
|
704
|
+
type: "WIDGET_TAB_SET_POPOUT_BOUNDS",
|
|
705
|
+
id: tabId,
|
|
706
|
+
bounds,
|
|
707
|
+
});
|
|
779
708
|
}
|
|
780
|
-
/**
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
dockPopoutWidgetContainer(widgetContainerId) {
|
|
785
|
-
if (!this.nineZoneState)
|
|
709
|
+
/** @internal */
|
|
710
|
+
dockWidgetContainerByContainerId(widgetContainerId) {
|
|
711
|
+
const state = this.nineZoneState;
|
|
712
|
+
if (!state)
|
|
786
713
|
return;
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
714
|
+
const location = (0, appui_layout_react_1.getWidgetLocation)(state, widgetContainerId);
|
|
715
|
+
if (!location)
|
|
716
|
+
return;
|
|
717
|
+
if ((0, appui_layout_react_1.isFloatingWidgetLocation)(location)) {
|
|
718
|
+
this.dispatch({
|
|
719
|
+
type: "FLOATING_WIDGET_SEND_BACK",
|
|
720
|
+
id: location.floatingWidgetId,
|
|
721
|
+
});
|
|
722
|
+
return;
|
|
723
|
+
}
|
|
724
|
+
if ((0, appui_layout_react_1.isPopoutWidgetLocation)(location)) {
|
|
725
|
+
this.dispatch({
|
|
726
|
+
type: "POPOUT_WIDGET_SEND_BACK",
|
|
727
|
+
id: location.popoutWidgetId,
|
|
728
|
+
});
|
|
792
729
|
return;
|
|
793
|
-
|
|
794
|
-
this.nineZoneState = state;
|
|
730
|
+
}
|
|
795
731
|
}
|
|
796
732
|
/** Finds the container with the specified widget and re-docks all widgets
|
|
797
733
|
* back to the panel zone location that was used when the floating container
|
|
@@ -800,34 +736,28 @@ class FrontstageDef {
|
|
|
800
736
|
* @beta
|
|
801
737
|
*/
|
|
802
738
|
dockWidgetContainer(widgetId) {
|
|
803
|
-
|
|
804
|
-
if (
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
if ((0, appui_layout_react_1.isPopoutTabLocation)(location)) {
|
|
811
|
-
UiFramework_1.UiFramework.childWindows.close(location.widgetId, true);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
}
|
|
739
|
+
const state = this.nineZoneState;
|
|
740
|
+
if (!state)
|
|
741
|
+
return;
|
|
742
|
+
const location = (0, appui_layout_react_1.getTabLocation)(state, widgetId);
|
|
743
|
+
if (!location)
|
|
744
|
+
return;
|
|
745
|
+
this.dockWidgetContainerByContainerId(location.widgetId);
|
|
815
746
|
}
|
|
816
747
|
setFloatingWidgetContainerBounds(floatingWidgetId, bounds) {
|
|
817
748
|
if (!this.nineZoneState ||
|
|
818
749
|
!(floatingWidgetId in this.nineZoneState.floatingWidgets.byId))
|
|
819
750
|
return false;
|
|
820
|
-
|
|
751
|
+
this.dispatch({
|
|
821
752
|
type: "FLOATING_WIDGET_SET_BOUNDS",
|
|
822
753
|
id: floatingWidgetId,
|
|
823
754
|
bounds,
|
|
824
|
-
}
|
|
825
|
-
|
|
755
|
+
});
|
|
756
|
+
this.dispatch({
|
|
826
757
|
type: "FLOATING_WIDGET_SET_USER_SIZED",
|
|
827
758
|
id: floatingWidgetId,
|
|
828
759
|
userSized: true,
|
|
829
|
-
}
|
|
830
|
-
this.nineZoneState = state;
|
|
760
|
+
});
|
|
831
761
|
return true;
|
|
832
762
|
}
|
|
833
763
|
getFloatingWidgetContainerIds() {
|
|
@@ -925,8 +855,9 @@ const useActiveFrontstageId = () => {
|
|
|
925
855
|
return id;
|
|
926
856
|
};
|
|
927
857
|
exports.useActiveFrontstageId = useActiveFrontstageId;
|
|
928
|
-
/** Hook to return the active Frontstage def
|
|
929
|
-
|
|
858
|
+
/** Hook to return the active Frontstage def.
|
|
859
|
+
* @public
|
|
860
|
+
*/
|
|
930
861
|
function useActiveFrontstageDef() {
|
|
931
862
|
const [def, setDef] = React.useState(UiFramework_1.UiFramework.frontstages.activeFrontstageDef);
|
|
932
863
|
React.useEffect(() => {
|