@itwin/appui-react 4.15.3 → 4.15.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
  3. package/lib/cjs/appui-react/UiFramework.js +1 -4
  4. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  5. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.d.ts +4 -0
  6. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.d.ts.map +1 -1
  7. package/lib/cjs/appui-react/childwindow/ChildWindowConfig.js.map +1 -1
  8. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  9. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +8 -2
  10. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  11. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  12. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +8 -8
  13. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  14. package/lib/cjs/appui-react/dialog/DialogManagerBase.d.ts +3 -2
  15. package/lib/cjs/appui-react/dialog/DialogManagerBase.d.ts.map +1 -1
  16. package/lib/cjs/appui-react/dialog/DialogManagerBase.js +16 -9
  17. package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
  18. package/lib/cjs/appui-react/dialog/DialogManagerBase.scss +11 -0
  19. package/lib/cjs/appui-react/framework/FrameworkVisibility.d.ts +2 -4
  20. package/lib/cjs/appui-react/framework/FrameworkVisibility.d.ts.map +1 -1
  21. package/lib/cjs/appui-react/framework/FrameworkVisibility.js.map +1 -1
  22. package/lib/cjs/appui-react/statusbar/popup/StatusBarPopover.d.ts +2 -2
  23. package/lib/cjs/appui-react/statusbar/popup/StatusBarPopover.d.ts.map +1 -1
  24. package/lib/cjs/appui-react/statusbar/popup/StatusBarPopover.js +6 -2
  25. package/lib/cjs/appui-react/statusbar/popup/StatusBarPopover.js.map +1 -1
  26. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.d.ts +0 -12
  27. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
  28. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +23 -38
  29. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  30. package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
  31. package/lib/esm/appui-react/UiFramework.js +1 -4
  32. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  33. package/lib/esm/appui-react/childwindow/ChildWindowConfig.d.ts +4 -0
  34. package/lib/esm/appui-react/childwindow/ChildWindowConfig.d.ts.map +1 -1
  35. package/lib/esm/appui-react/childwindow/ChildWindowConfig.js.map +1 -1
  36. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.d.ts.map +1 -1
  37. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +8 -2
  38. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  39. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  40. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +8 -8
  41. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  42. package/lib/esm/appui-react/dialog/DialogManagerBase.d.ts +3 -2
  43. package/lib/esm/appui-react/dialog/DialogManagerBase.d.ts.map +1 -1
  44. package/lib/esm/appui-react/dialog/DialogManagerBase.js +16 -9
  45. package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
  46. package/lib/esm/appui-react/dialog/DialogManagerBase.scss +11 -0
  47. package/lib/esm/appui-react/framework/FrameworkVisibility.d.ts +2 -4
  48. package/lib/esm/appui-react/framework/FrameworkVisibility.d.ts.map +1 -1
  49. package/lib/esm/appui-react/framework/FrameworkVisibility.js.map +1 -1
  50. package/lib/esm/appui-react/statusbar/popup/StatusBarPopover.d.ts +2 -2
  51. package/lib/esm/appui-react/statusbar/popup/StatusBarPopover.d.ts.map +1 -1
  52. package/lib/esm/appui-react/statusbar/popup/StatusBarPopover.js +6 -2
  53. package/lib/esm/appui-react/statusbar/popup/StatusBarPopover.js.map +1 -1
  54. package/lib/esm/appui-react/utils/InternalUiShowHideManager.d.ts +0 -12
  55. package/lib/esm/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
  56. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +23 -38
  57. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  58. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG;;GAEG;AAEH,+BAA+B;AAC/B,sCAAsC;AACtC,6CAAuC;AACvC,gDAA6C;AAC7C,gEAAkE;AAClE,qEAAmE;AACnE,2EAAyE;AAMzE,sEAAgE;AAChE,wDAAsD;AACtD,wDAAqD;AACrD,oEAAqE;AAErE,6CAA0C;AAC1C,6CAA2C;AAC3C,wFAAqF;AAGrF,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;QAqBV,CAAC;AAST;;;;KAIK;AACL,MAAa,0BAA0B;IAAvC;QACU,sBAAiB,GAA0B,EAAE,CAAC;QAE9C,WAAM,GAAqC,EAAE,CAAC;QA8JtD;;;;;WAKG;QACI,UAAK,GAAG,CAAC,aAAqB,EAAE,kBAAkB,GAAG,IAAI,EAAE,EAAE;YAClE,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACjD,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa,KAAK,aAAa,CAC3D,CAAC;YACF,IAAI,WAAW,KAAK,CAAC,CAAC;gBAAE,OAAO,KAAK,CAAC;YACrC,MAAM,EAAE,mBAAmB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C;CACF;AA9QD,gEA8QC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ChildWindowManager\n */\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Provider } from \"react-redux\";\nimport { UiFramework } from \"../UiFramework\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\nimport type {\n ChildWindowLocationProps,\n FrameworkChildWindows,\n OpenChildWindowInfo,\n} from \"../framework/FrameworkChildWindows\";\nimport { TabIdContext } from \"../layout/widget/ContentRenderer\";\nimport { PopupRenderer } from \"../popup/PopupManager\";\nimport { ThemeManager } from \"../theme/ThemeManager\";\nimport { UiStateStorageHandler } from \"../uistate/useUiStateStorage\";\nimport type { ChildWindow } from \"./ChildWindowConfig\";\nimport { copyStyles } from \"./CopyStyles\";\nimport \"./InternalChildWindowManager.scss\";\nimport { usePopoutsStore } from \"../preview/reparent-popout-widgets/usePopoutsStore\";\nimport type { WidgetDef } from \"../widgets/WidgetDef\";\n\nconst childHtml = `<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\" />\n <style>\n html,\n body {\n height: 100%;\n width: 100%;\n margin: 0;\n overflow: hidden;\n }\n #root {\n height: 100%;\n }\n </style>\n</head>\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div id=\"root\"></div>\n</body>\n</html>`;\n\n/**\n * Simplification of non exported CreateRoot parameter, only to be used\n * in InternalChildWindowManager and ChildWindowManager\n * @internal\n */\nexport type CreateRoot = Parameters<FrameworkChildWindows[\"useCreateRoot\"]>[0];\n\n/** Supports opening a child browser window from the main application window. The child window is managed by the main application\n * and is running in the same security context. The application must deliver the html file iTwinPopup.html along side its index.html.\n * See also: [Child Window Manager]($docs/learning/ui/appui-react/ChildWindows.md)\n * @internal\n * */\nexport class InternalChildWindowManager implements FrameworkChildWindows {\n private _openChildWindows: OpenChildWindowInfo[] = [];\n private _createRoot?: CreateRoot;\n private _roots: { [childwindowId: string]: any } = {};\n\n public get openChildWindows() {\n return this._openChildWindows;\n }\n\n /**\n * When using React 18, the `createRoot` function must be provided in order to render Popout content with React 18.\n * Do not call if using React 17 or before.\n *\n * Note: The type of the function is intentionally simplified here.\n *\n * @param createRootFn Function imported from `import { createRoot } from \"react-dom/client\";`\n * @beta Will be removed once the transition to React 18 is complete.\n */\n public useCreateRoot(createRootFn: CreateRoot): void {\n this._createRoot = createRootFn;\n }\n\n /**\n * Abstracts ReactDOM.render to use either the _createRoot method or the default ReactDOM.render.\n * @param element Element to render.\n * @param container Container to render to.\n */\n private render(\n element: React.FunctionComponentElement<any>,\n container: Element | DocumentFragment\n ) {\n // If createRoot is passed in for React 18 we have to render differently\n // than without it. React 17 vs React 18. We need to save the root to\n // unmount it.\n if (this._createRoot) {\n const childWindowId = UiFramework.childWindows.findId(\n container.ownerDocument.defaultView\n );\n if (childWindowId) {\n this._roots[childWindowId] = this._createRoot(container);\n this._roots[childWindowId].render(element);\n }\n } else {\n // eslint-disable-next-line react/no-deprecated, deprecation/deprecation\n ReactDOM.render(element, container);\n }\n }\n\n /**\n * Returns the OpenChildWindowInfo for the related id.\n * @param childWindowId Id of the window to retrieve.\n * @returns undefined if not found.\n */\n public find(\n childWindowId: string | undefined\n ): OpenChildWindowInfo | undefined {\n if (undefined === childWindowId) return undefined;\n\n return this.openChildWindows.find(\n (openWindow) => openWindow.childWindowId === childWindowId\n );\n }\n\n /**\n * Return the childWindowId of the provided window.\n * @param contentWindow Window element to identify\n * @returns undefined if not found\n */\n public findId(contentWindow: Window | undefined | null): string | undefined {\n if (!contentWindow) return undefined;\n\n const childWindow = this.openChildWindows.find(\n (openWindow) => openWindow.window === contentWindow\n );\n return childWindow?.childWindowId;\n }\n\n private renderChildWindowContents(\n childWindow: ChildWindow,\n childWindowId: string,\n content: React.ReactNode,\n title: string\n ) {\n childWindow.document.title = title;\n\n const reactConnectionDiv = childWindow.document.getElementById(\"root\");\n if (reactConnectionDiv && content && React.isValidElement(content)) {\n // set openChildWindows now so components can use it when they mount\n this._openChildWindows.push({\n childWindowId,\n window: childWindow,\n parentWindow: window,\n });\n const widgetDef = content.props.widgetDef as WidgetDef | undefined;\n const tabId = widgetDef?.id;\n const element = (\n // eslint-disable-next-line deprecation/deprecation\n <Provider store={UiFramework.store}>\n <TabIdContext.Provider value={tabId}>\n <UiStateStorageHandler>\n <ThemeManager>\n <div className=\"uifw-child-window-container-host\">\n <PopupRenderer />\n <ModalDialogRenderer />\n <ModelessDialogRenderer />\n <CursorPopupMenu />\n <div className=\"uifw-child-window-container nz-widget-widget\">\n {content}\n </div>\n </div>\n <div className=\"uifw-childwindow-internalChildWindowManager_portalContainer\" />\n </ThemeManager>\n </UiStateStorageHandler>\n </TabIdContext.Provider>\n </Provider>\n );\n\n setTimeout(() => {\n copyStyles(childWindow.document);\n setTimeout(() => {\n this.render(element, reactConnectionDiv);\n\n if (childWindow.expectedHeight && childWindow.expectedWidth) {\n childWindow.deltaWidth =\n childWindow.expectedWidth - childWindow.innerWidth;\n childWindow.deltaHeight =\n childWindow.expectedHeight - childWindow.innerHeight;\n }\n });\n });\n\n childWindow.addEventListener(\"pagehide\", () => {\n const frontStageDef = UiFramework.frontstages.activeFrontstageDef;\n if (!frontStageDef) return;\n frontStageDef.saveChildWindowSizeAndPosition(\n childWindowId,\n childWindow\n );\n\n // Trigger first so popout can be converted back to main window widget\n this.close(childWindowId, false);\n\n // UnmountComponentAtNode is deprecated in React 18, so if they are\n // using React 18 and passing in a createRoot function, unmount()\n // will be used\n if (this._roots[childWindowId]) {\n this._roots[childWindowId].unmount();\n // eslint-disable-next-line react/no-deprecated, deprecation/deprecation\n } else ReactDOM.unmountComponentAtNode(reactConnectionDiv);\n });\n }\n }\n\n /** Close all child/pop-out windows. This typically is called when the frontstage is changed. */\n public closeAll() {\n this.openChildWindows.forEach((openChildWindow) =>\n openChildWindow.window.close()\n );\n this._openChildWindows = [];\n }\n\n /**\n * Close a specific child window.\n * @param childWindowId Id of the window to close.\n * @param processWindowClose should the `close` method be called on the closing window. (defaults to true).\n * @returns false if the window could not be found.\n */\n public close = (childWindowId: string, processWindowClose = true) => {\n const windowIndex = this.openChildWindows.findIndex(\n (openWindow) => openWindow.childWindowId === childWindowId\n );\n if (windowIndex === -1) return false;\n const { onClosePopoutWidget } = usePopoutsStore.getState();\n onClosePopoutWidget.raiseEvent({ windowId: childWindowId });\n\n const childWindow = this.openChildWindows[windowIndex];\n this.openChildWindows.splice(windowIndex, 1);\n if (processWindowClose) {\n childWindow.window.close();\n } else {\n // call the following to convert popout to docked widget\n const frontStageDef = UiFramework.frontstages.activeFrontstageDef;\n frontStageDef?.dockWidgetContainerByContainerId(childWindowId);\n }\n return true;\n };\n\n private adjustWindowLocation(location: ChildWindowLocationProps) {\n // If no location is provided, child window will open in the center of the current window.\n if (location.top === 0 && location.left === 0) {\n location.left =\n window.outerWidth / 2 + window.screenX - location.width / 2;\n location.top =\n window.outerHeight / 2 + window.screenY - location.height / 2;\n }\n }\n\n /**\n * Open a new child window.\n * @param childWindowId Id to assign to the newly created window.\n * @param title Title to display on the window.\n * @param content ReactNode to be rendered in the window.\n * @param location Position and size information\n * @param useDefaultPopoutUrl use \"/iTwinPopup.html\" as the window Url, \"\" otherwise.\n * @returns true if the window is opened successfully.\n */\n public open(\n childWindowId: string,\n title: string,\n content: React.ReactNode,\n location: ChildWindowLocationProps,\n useDefaultPopoutUrl?: boolean\n ) {\n if (\n this.openChildWindows.some(\n (openWindow) => openWindow.childWindowId === childWindowId\n )\n ) {\n return false;\n }\n\n this.adjustWindowLocation(location);\n const url = useDefaultPopoutUrl ? \"/iTwinPopup.html\" : \"\";\n const childWindow: ChildWindow | null = window.open(\n url,\n \"\",\n `width=${location.width},height=${location.height},left=${location.left},top=${location.top},menubar=no,resizable=yes,scrollbars=no,status=no,location=no`\n );\n if (!childWindow) return false;\n childWindow.expectedHeight = location.height;\n childWindow.expectedWidth = location.width;\n childWindow.deltaLeft = location.left - childWindow.screenLeft;\n childWindow.deltaTop = location.top - childWindow.screenTop;\n\n if (url.length === 0) {\n childWindow.document.write(childHtml);\n this.renderChildWindowContents(\n childWindow,\n childWindowId,\n content,\n title\n );\n } else {\n childWindow.addEventListener(\n \"DOMContentLoaded\",\n () => {\n this.renderChildWindowContents(\n childWindow,\n childWindowId,\n content,\n title\n );\n },\n false\n );\n }\n\n window.addEventListener(\n \"unload\",\n () => {\n const frontStageDef = UiFramework.frontstages.activeFrontstageDef;\n if (frontStageDef) {\n this.close(childWindowId, true);\n }\n },\n false\n );\n\n return true;\n }\n}\n"]}
1
+ {"version":3,"file":"InternalChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG;;GAEG;AAEH,+BAA+B;AAC/B,sCAAsC;AACtC,6CAAuC;AACvC,gDAA6C;AAC7C,gEAAkE;AAClE,qEAAmE;AACnE,2EAAyE;AAMzE,sEAAgE;AAChE,wDAAsD;AACtD,wDAAqD;AACrD,oEAAqE;AAErE,6CAA0C;AAC1C,6CAA2C;AAC3C,wFAAqF;AAGrF,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;QAqBV,CAAC;AAST;;;;KAIK;AACL,MAAa,0BAA0B;IAAvC;QACU,sBAAiB,GAA0B,EAAE,CAAC;QAE9C,WAAM,GAAqC,EAAE,CAAC;QAqKtD;;;;;WAKG;QACI,UAAK,GAAG,CAAC,aAAqB,EAAE,kBAAkB,GAAG,IAAI,EAAE,EAAE;YAClE,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CACjD,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,aAAa,KAAK,a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,CAAC;QAED,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EACR,GAAG,EAAE;YACH,MAAM,aAAa,GAAG,yBAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;YAClE,IAAI,aAAa,EAAE,CAAC;gBAClB,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,EACD,KAAK,CACN,CAAC;QAEF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AArRD,gEAqRC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module ChildWindowManager\n */\n\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Provider } from \"react-redux\";\nimport { UiFramework } from \"../UiFramework\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\nimport type {\n ChildWindowLocationProps,\n FrameworkChildWindows,\n OpenChildWindowInfo,\n} from \"../framework/FrameworkChildWindows\";\nimport { TabIdContext } from \"../layout/widget/ContentRenderer\";\nimport { PopupRenderer } from \"../popup/PopupManager\";\nimport { ThemeManager } from \"../theme/ThemeManager\";\nimport { UiStateStorageHandler } from \"../uistate/useUiStateStorage\";\nimport type { ChildWindow } from \"./ChildWindowConfig\";\nimport { copyStyles } from \"./CopyStyles\";\nimport \"./InternalChildWindowManager.scss\";\nimport { usePopoutsStore } from \"../preview/reparent-popout-widgets/usePopoutsStore\";\nimport type { WidgetDef } from \"../widgets/WidgetDef\";\n\nconst childHtml = `<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\" />\n <style>\n html,\n body {\n height: 100%;\n width: 100%;\n margin: 0;\n overflow: hidden;\n }\n #root {\n height: 100%;\n }\n </style>\n</head>\n<body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div id=\"root\"></div>\n</body>\n</html>`;\n\n/**\n * Simplification of non exported CreateRoot parameter, only to be used\n * in InternalChildWindowManager and ChildWindowManager\n * @internal\n */\nexport type CreateRoot = Parameters<FrameworkChildWindows[\"useCreateRoot\"]>[0];\n\n/** Supports opening a child browser window from the main application window. The child window is managed by the main application\n * and is running in the same security context. The application must deliver the html file iTwinPopup.html along side its index.html.\n * See also: [Child Window Manager]($docs/learning/ui/appui-react/ChildWindows.md)\n * @internal\n * */\nexport class InternalChildWindowManager implements FrameworkChildWindows {\n private _openChildWindows: OpenChildWindowInfo[] = [];\n private _createRoot?: CreateRoot;\n private _roots: { [childwindowId: string]: any } = {};\n\n public get openChildWindows() {\n return this._openChildWindows;\n }\n\n /**\n * When using React 18, the `createRoot` function must be provided in order to render Popout content with React 18.\n * Do not call if using React 17 or before.\n *\n * Note: The type of the function is intentionally simplified here.\n *\n * @param createRootFn Function imported from `import { createRoot } from \"react-dom/client\";`\n * @beta Will be removed once the transition to React 18 is complete.\n */\n public useCreateRoot(createRootFn: CreateRoot): void {\n this._createRoot = createRootFn;\n }\n\n /**\n * Abstracts ReactDOM.render to use either the _createRoot method or the default ReactDOM.render.\n * @param element Element to render.\n * @param container Container to render to.\n */\n private render(\n element: React.FunctionComponentElement<any>,\n container: Element | DocumentFragment\n ) {\n // If createRoot is passed in for React 18 we have to render differently\n // than without it. React 17 vs React 18. We need to save the root to\n // unmount it.\n if (this._createRoot) {\n const childWindowId = UiFramework.childWindows.findId(\n container.ownerDocument.defaultView\n );\n if (childWindowId) {\n this._roots[childWindowId] = this._createRoot(container);\n this._roots[childWindowId].render(element);\n }\n } else {\n // eslint-disable-next-line react/no-deprecated, deprecation/deprecation\n ReactDOM.render(element, container);\n }\n }\n\n /**\n * Returns the OpenChildWindowInfo for the related id.\n * @param childWindowId Id of the window to retrieve.\n * @returns undefined if not found.\n */\n public find(\n childWindowId: string | undefined\n ): OpenChildWindowInfo | undefined {\n if (undefined === childWindowId) return undefined;\n\n return this.openChildWindows.find(\n (openWindow) => openWindow.childWindowId === childWindowId\n );\n }\n\n /**\n * Return the childWindowId of the provided window.\n * @param contentWindow Window element to identify\n * @returns undefined if not found\n */\n public findId(contentWindow: Window | undefined | null): string | undefined {\n if (!contentWindow) return undefined;\n\n const childWindow = this.openChildWindows.find(\n (openWindow) => openWindow.window === contentWindow\n );\n return childWindow?.childWindowId;\n }\n\n private renderChildWindowContents(\n childWindow: ChildWindow,\n childWindowId: string,\n content: React.ReactNode,\n title: string\n ) {\n childWindow.document.title = title;\n\n const reactConnectionDiv = childWindow.document.getElementById(\"root\");\n if (reactConnectionDiv && content && React.isValidElement(content)) {\n // set openChildWindows now so components can use it when they mount\n this._openChildWindows.push({\n childWindowId,\n window: childWindow,\n parentWindow: window,\n });\n const widgetDef = content.props.widgetDef as WidgetDef | undefined;\n const tabId = widgetDef?.id;\n const element = (\n // eslint-disable-next-line deprecation/deprecation\n <Provider store={UiFramework.store}>\n <TabIdContext.Provider value={tabId}>\n <UiStateStorageHandler>\n <ThemeManager>\n <div className=\"uifw-child-window-container-host\">\n <PopupRenderer />\n <ModalDialogRenderer />\n <ModelessDialogRenderer />\n <CursorPopupMenu />\n <div className=\"uifw-child-window-container nz-widget-widget\">\n {content}\n </div>\n </div>\n <div className=\"uifw-childwindow-internalChildWindowManager_portalContainer\" />\n </ThemeManager>\n </UiStateStorageHandler>\n </TabIdContext.Provider>\n </Provider>\n );\n\n setTimeout(() => {\n copyStyles(childWindow.document);\n setTimeout(() => {\n this.render(element, reactConnectionDiv);\n\n if (childWindow.expectedHeight && childWindow.expectedWidth) {\n childWindow.deltaWidth =\n childWindow.expectedWidth - childWindow.innerWidth;\n childWindow.deltaHeight =\n childWindow.expectedHeight - childWindow.innerHeight;\n }\n\n if (childWindow.expectedLeft && childWindow.expectedTop) {\n childWindow.deltaLeft =\n childWindow.expectedLeft - childWindow.screenLeft;\n childWindow.deltaTop =\n childWindow.expectedTop - childWindow.screenTop;\n }\n });\n });\n\n childWindow.addEventListener(\"pagehide\", () => {\n const frontStageDef = UiFramework.frontstages.activeFrontstageDef;\n if (!frontStageDef) return;\n frontStageDef.saveChildWindowSizeAndPosition(\n childWindowId,\n childWindow\n );\n\n // Trigger first so popout can be converted back to main window widget\n this.close(childWindowId, false);\n\n // UnmountComponentAtNode is deprecated in React 18, so if they are\n // using React 18 and passing in a createRoot function, unmount()\n // will be used\n if (this._roots[childWindowId]) {\n this._roots[childWindowId].unmount();\n // eslint-disable-next-line react/no-deprecated, deprecation/deprecation\n } else ReactDOM.unmountComponentAtNode(reactConnectionDiv);\n });\n }\n }\n\n /** Close all child/pop-out windows. This typically is called when the frontstage is changed. */\n public closeAll() {\n this.openChildWindows.forEach((openChildWindow) =>\n openChildWindow.window.close()\n );\n this._openChildWindows = [];\n }\n\n /**\n * Close a specific child window.\n * @param childWindowId Id of the window to close.\n * @param processWindowClose should the `close` method be called on the closing window. (defaults to true).\n * @returns false if the window could not be found.\n */\n public close = (childWindowId: string, processWindowClose = true) => {\n const windowIndex = this.openChildWindows.findIndex(\n (openWindow) => openWindow.childWindowId === childWindowId\n );\n if (windowIndex === -1) return false;\n const { onClosePopoutWidget } = usePopoutsStore.getState();\n onClosePopoutWidget.raiseEvent({ windowId: childWindowId });\n\n const childWindow = this.openChildWindows[windowIndex];\n this.openChildWindows.splice(windowIndex, 1);\n if (processWindowClose) {\n childWindow.window.close();\n } else {\n // call the following to convert popout to docked widget\n const frontStageDef = UiFramework.frontstages.activeFrontstageDef;\n frontStageDef?.dockWidgetContainerByContainerId(childWindowId);\n }\n return true;\n };\n\n private adjustWindowLocation(location: ChildWindowLocationProps) {\n // If no location is provided, child window will open in the center of the current window.\n if (location.top === 0 && location.left === 0) {\n location.left =\n window.outerWidth / 2 + window.screenX - location.width / 2;\n location.top =\n window.outerHeight / 2 + window.screenY - location.height / 2;\n }\n }\n\n /**\n * Open a new child window.\n * @param childWindowId Id to assign to the newly created window.\n * @param title Title to display on the window.\n * @param content ReactNode to be rendered in the window.\n * @param location Position and size information\n * @param useDefaultPopoutUrl use \"/iTwinPopup.html\" as the window Url, \"\" otherwise.\n * @returns true if the window is opened successfully.\n */\n public open(\n childWindowId: string,\n title: string,\n content: React.ReactNode,\n location: ChildWindowLocationProps,\n useDefaultPopoutUrl?: boolean\n ) {\n if (\n this.openChildWindows.some(\n (openWindow) => openWindow.childWindowId === childWindowId\n )\n ) {\n return false;\n }\n\n this.adjustWindowLocation(location);\n const url = useDefaultPopoutUrl ? \"/iTwinPopup.html\" : \"\";\n const childWindow: ChildWindow | null = window.open(\n url,\n \"\",\n `width=${location.width},height=${location.height},left=${location.left},top=${location.top},menubar=no,resizable=yes,scrollbars=no,status=no,location=no`\n );\n if (!childWindow) return false;\n childWindow.expectedHeight = location.height;\n childWindow.expectedWidth = location.width;\n childWindow.expectedLeft = location.left;\n childWindow.expectedTop = location.top;\n\n if (url.length === 0) {\n childWindow.document.write(childHtml);\n this.renderChildWindowContents(\n childWindow,\n childWindowId,\n content,\n title\n );\n } else {\n childWindow.addEventListener(\n \"DOMContentLoaded\",\n () => {\n this.renderChildWindowContents(\n childWindow,\n childWindowId,\n content,\n title\n );\n },\n false\n );\n }\n\n window.addEventListener(\n \"unload\",\n () => {\n const frontStageDef = UiFramework.frontstages.activeFrontstageDef;\n if (frontStageDef) {\n this.close(childWindowId, true);\n }\n },\n false\n );\n\n return true;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBrD,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,wKAU7B,CAAC;AAEN;;GAEG;AAEH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,kCAAkC;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,4GAA4G;IAC5G,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oHAAoH;IACpH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8HAA8H;IAC9H,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sIAAsI;IACtI,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sHAAsH;IACtH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,4BAAkD,CAAC;AAE9E;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBA2EtE"}
1
+ {"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAwBrD,gBAAgB;AAChB,eAAO,MAAM,qBAAqB,wKAU7B,CAAC;AAEN;;GAEG;AAEH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,kCAAkC;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,4GAA4G;IAC5G,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oHAAoH;IACpH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8HAA8H;IAC9H,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sIAAsI;IACtI,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sHAAsH;IACtH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,4BAAkD,CAAC;AAE9E;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBAyEtE"}
@@ -42,7 +42,7 @@ exports.WrapperContext = React.createContext(document.body);
42
42
  function ConfigurableUiContent(props) {
43
43
  useWidgetOpacity(props.widgetOpacity);
44
44
  useToolbarOpacity(props.toolbarOpacity);
45
- const [mainElement, setMainElement] = React.useState(null);
45
+ const [mainElement, setMainElement] = React.useState();
46
46
  const [portalContainer, setPortalContainer] = React.useState();
47
47
  React.useEffect(() => {
48
48
  UiFramework_1.UiFramework.keyboardShortcuts.setFocusToHome();
@@ -68,14 +68,11 @@ function ConfigurableUiContent(props) {
68
68
  animateToolSettings: props.animateToolSettings,
69
69
  toolAsToolSettingsLabel: props.toolAsToolSettingsLabel,
70
70
  } },
71
- React.createElement("main", { role: "main", id: "uifw-configurableui-wrapper", className: props.className, style: props.style, onMouseMove: handleMouseMove, ref: setMainElement },
72
- React.createElement(exports.WrapperContext.Provider, { value: mainElement },
71
+ React.createElement("main", { role: "main", id: "uifw-configurableui-wrapper", className: props.className, style: props.style, onMouseMove: handleMouseMove, ref: (el) => setMainElement(el ?? undefined) },
72
+ React.createElement(exports.WrapperContext.Provider, { value: mainElement ?? document.body },
73
73
  React.createElement(itwinui_react_1.ThemeProvider, { style: { height: "100%" }, portalContainer: portalContainer },
74
74
  props.appBackstage,
75
75
  React.createElement(Frontstage_1.WidgetPanelsFrontstage, null),
76
- React.createElement(ContentDialogManager_1.ContentDialogRenderer, null),
77
- React.createElement(ModelessDialogManager_1.ModelessDialogRenderer, null),
78
- React.createElement(ModalDialogManager_1.ModalDialogRenderer, null),
79
76
  React.createElement(ElementTooltip_1.ElementTooltip, null),
80
77
  React.createElement(Pointer_1.PointerMessage, null),
81
78
  React.createElement(KeyboardShortcutMenu_1.KeyboardShortcutMenu, null),
@@ -83,8 +80,11 @@ function ConfigurableUiContent(props) {
83
80
  React.createElement(CursorMenu_1.CursorPopupMenu, null),
84
81
  React.createElement(CursorPopupManager_1.CursorPopupRenderer, null),
85
82
  React.createElement(PopupManager_1.PopupRenderer, null),
86
- React.createElement(MessageRenderer_1.MessageRenderer, null))),
87
- React.createElement("div", { className: "uifw-configurableui-portalContainer", ref: (instance) => setPortalContainer(instance ?? undefined) }))));
83
+ React.createElement(MessageRenderer_1.MessageRenderer, null),
84
+ React.createElement("div", { className: "uifw-configurableui-portalContainer", ref: (instance) => setPortalContainer(instance ?? undefined) },
85
+ React.createElement(ContentDialogManager_1.ContentDialogRenderer, null),
86
+ React.createElement(ModelessDialogManager_1.ModelessDialogRenderer, null),
87
+ React.createElement(ModalDialogManager_1.ModalDialogRenderer, null)))))));
88
88
  }
89
89
  exports.ConfigurableUiContent = ConfigurableUiContent;
90
90
  function useWidgetOpacity(widgetOpacity) {
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wCAAsC;AACtC,+BAA+B;AAE/B,kDAA0C;AAC1C,wDAAqD;AACrD,mEAAgE;AAChE,gEAAkE;AAClE,iFAA+E;AAC/E,qEAAmE;AACnE,2EAAyE;AACzE,+DAA4D;AAC5D,mFAAgF;AAChF,uDAA2D;AAC3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BAAwB,CAAC,CAAC;QAC5E,IAAI,qBAAqB,KAAK,OAAO,CAAC,QAAQ,EAAE;YAAE,OAAO;QACzD,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CACxC,wBAAwB,EACxB,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;QAC1E,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ConfigurableUi\n */\n\nimport \"./ConfigurableUiContent.scss\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\nimport { ElementTooltip } from \"../feedback/ElementTooltip\";\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu\";\nimport { InputFieldMessage } from \"../messages/InputField\";\nimport { PointerMessage } from \"../messages/Pointer\";\nimport { PopupRenderer } from \"../popup/PopupManager\";\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage\";\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager\";\nimport { UiFramework } from \"../UiFramework\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager\";\nimport { MessageRenderer } from \"../messages/MessageRenderer\";\nimport {\n TOOLBAR_OPACITY_DEFAULT,\n WIDGET_OPACITY_DEFAULT,\n} from \"../theme/ThemeId\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState\";\n\n/** @internal */\nexport const ConfigurableUiContext = React.createContext<\n Pick<\n ConfigurableUiContentProps,\n | \"viewOverlay\"\n | \"widgetOpacity\"\n | \"widgetIcon\"\n | \"collapsePanels\"\n | \"animateToolSettings\"\n | \"toolAsToolSettingsLabel\"\n >\n>({});\n\n/** Properties for [[ConfigurableUiContent]]\n * @public\n */\n// eslint-disable-next-line deprecation/deprecation\nexport interface ConfigurableUiContentProps extends CommonProps {\n /** React node of the Backstage */\n appBackstage?: React.ReactNode;\n /** Controls if the view overlay should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n viewOverlay?: boolean;\n /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */\n widgetOpacity?: number;\n /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n widgetIcon?: boolean;\n /** Controls if the unpinned panels should be collapsed automatically. Uses redux store as a fallback. Defaults to `false`. */\n collapsePanels?: boolean;\n /** Controls if the tool settings should be animated. Uses redux store as a fallback. Defaults to `false`. */\n animateToolSettings?: boolean;\n /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */\n toolAsToolSettingsLabel?: boolean;\n /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */\n toolbarOpacity?: number;\n\n /** @internal */\n idleTimeout?: number;\n /** @internal */\n intervalTimeout?: number;\n}\n\n/**\n * Allows children to get the bounds or other properties of the wrapper element.\n * @internal\n */\nexport const WrapperContext = React.createContext<HTMLElement>(document.body);\n\n/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi\n * @public\n */\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\n useWidgetOpacity(props.widgetOpacity);\n useToolbarOpacity(props.toolbarOpacity);\n const [mainElement, setMainElement] = React.useState<HTMLElement | null>(\n null\n );\n const [portalContainer, setPortalContainer] = React.useState<\n HTMLElement | undefined\n >();\n React.useEffect(() => {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }, []);\n\n React.useEffect(() => {\n InternalConfigurableUiManager.activityTracker.initialize({\n idleTimeout: props.idleTimeout,\n intervalTimeout: props.intervalTimeout,\n });\n return () => {\n InternalConfigurableUiManager.activityTracker.terminate();\n };\n }, [props.idleTimeout, props.intervalTimeout]);\n\n const handleMouseMove = React.useCallback((e: React.MouseEvent) => {\n const point = new Point(e.pageX, e.pageY);\n CursorInformation.handleMouseMove(point);\n }, []);\n\n return (\n <ConfigurableUiContext.Provider\n value={{\n viewOverlay: props.viewOverlay,\n widgetOpacity: props.widgetOpacity,\n widgetIcon: props.widgetIcon,\n collapsePanels: props.collapsePanels,\n animateToolSettings: props.animateToolSettings,\n toolAsToolSettingsLabel: props.toolAsToolSettingsLabel,\n }}\n >\n <main\n role=\"main\"\n id=\"uifw-configurableui-wrapper\"\n className={props.className}\n style={props.style}\n onMouseMove={handleMouseMove}\n ref={setMainElement}\n >\n <WrapperContext.Provider value={mainElement!}>\n <ThemeProvider\n style={{ height: \"100%\" }}\n portalContainer={portalContainer}\n >\n {props.appBackstage}\n <WidgetPanelsFrontstage />\n <ContentDialogRenderer />\n <ModelessDialogRenderer />\n <ModalDialogRenderer />\n <ElementTooltip />\n <PointerMessage />\n {/* eslint-disable-next-line deprecation/deprecation */}\n <KeyboardShortcutMenu />\n <InputFieldMessage />\n <CursorPopupMenu />\n <CursorPopupRenderer />\n <PopupRenderer />\n <MessageRenderer />\n </ThemeProvider>\n </WrapperContext.Provider>\n <div\n className=\"uifw-configurableui-portalContainer\"\n ref={(instance) => setPortalContainer(instance ?? undefined)}\n />\n </main>\n </ConfigurableUiContext.Provider>\n );\n}\n\nfunction useWidgetOpacity(\n widgetOpacity: ConfigurableUiContentProps[\"widgetOpacity\"]\n) {\n const reduxWidgetOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line deprecation/deprecation\n return state?.configurableUiState.widgetOpacity;\n });\n const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-widget-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useToolbarOpacity(\n toolbarOpacity: ConfigurableUiContentProps[\"toolbarOpacity\"]\n) {\n const reduxToolbarOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line deprecation/deprecation\n return state?.configurableUiState.toolbarOpacity;\n });\n\n const opacity =\n toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-toolbar-opacity\");\n };\n }, [opacity]);\n}\n"]}
1
+ {"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wCAAsC;AACtC,+BAA+B;AAE/B,kDAA0C;AAC1C,wDAAqD;AACrD,mEAAgE;AAChE,gEAAkE;AAClE,iFAA+E;AAC/E,qEAAmE;AACnE,2EAAyE;AACzE,+DAA4D;AAC5D,mFAAgF;AAChF,uDAA2D;AAC3D,iDAAqD;AACrD,wDAAsD;AACtD,4DAAqE;AACrE,yEAAuE;AACvE,gDAA6C;AAC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AC,wBAAwB,CAAC,CAAC;QAC5E,IAAI,qBAAqB,KAAK,OAAO,CAAC,QAAQ,EAAE;YAAE,OAAO;QACzD,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,WAAW,CACxC,wBAAwB,EACxB,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;QAC1E,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ConfigurableUi\n */\n\nimport \"./ConfigurableUiContent.scss\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\nimport { ElementTooltip } from \"../feedback/ElementTooltip\";\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu\";\nimport { InputFieldMessage } from \"../messages/InputField\";\nimport { PointerMessage } from \"../messages/Pointer\";\nimport { PopupRenderer } from \"../popup/PopupManager\";\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage\";\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager\";\nimport { UiFramework } from \"../UiFramework\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager\";\nimport { MessageRenderer } from \"../messages/MessageRenderer\";\nimport {\n TOOLBAR_OPACITY_DEFAULT,\n WIDGET_OPACITY_DEFAULT,\n} from \"../theme/ThemeId\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState\";\n\n/** @internal */\nexport const ConfigurableUiContext = React.createContext<\n Pick<\n ConfigurableUiContentProps,\n | \"viewOverlay\"\n | \"widgetOpacity\"\n | \"widgetIcon\"\n | \"collapsePanels\"\n | \"animateToolSettings\"\n | \"toolAsToolSettingsLabel\"\n >\n>({});\n\n/** Properties for [[ConfigurableUiContent]]\n * @public\n */\n// eslint-disable-next-line deprecation/deprecation\nexport interface ConfigurableUiContentProps extends CommonProps {\n /** React node of the Backstage */\n appBackstage?: React.ReactNode;\n /** Controls if the view overlay should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n viewOverlay?: boolean;\n /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */\n widgetOpacity?: number;\n /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n widgetIcon?: boolean;\n /** Controls if the unpinned panels should be collapsed automatically. Uses redux store as a fallback. Defaults to `false`. */\n collapsePanels?: boolean;\n /** Controls if the tool settings should be animated. Uses redux store as a fallback. Defaults to `false`. */\n animateToolSettings?: boolean;\n /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */\n toolAsToolSettingsLabel?: boolean;\n /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */\n toolbarOpacity?: number;\n\n /** @internal */\n idleTimeout?: number;\n /** @internal */\n intervalTimeout?: number;\n}\n\n/**\n * Allows children to get the bounds or other properties of the wrapper element.\n * @internal\n */\nexport const WrapperContext = React.createContext<HTMLElement>(document.body);\n\n/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi\n * @public\n */\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\n useWidgetOpacity(props.widgetOpacity);\n useToolbarOpacity(props.toolbarOpacity);\n const [mainElement, setMainElement] = React.useState<HTMLElement>();\n const [portalContainer, setPortalContainer] = React.useState<HTMLElement>();\n React.useEffect(() => {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }, []);\n\n React.useEffect(() => {\n InternalConfigurableUiManager.activityTracker.initialize({\n idleTimeout: props.idleTimeout,\n intervalTimeout: props.intervalTimeout,\n });\n return () => {\n InternalConfigurableUiManager.activityTracker.terminate();\n };\n }, [props.idleTimeout, props.intervalTimeout]);\n\n const handleMouseMove = React.useCallback((e: React.MouseEvent) => {\n const point = new Point(e.pageX, e.pageY);\n CursorInformation.handleMouseMove(point);\n }, []);\n\n return (\n <ConfigurableUiContext.Provider\n value={{\n viewOverlay: props.viewOverlay,\n widgetOpacity: props.widgetOpacity,\n widgetIcon: props.widgetIcon,\n collapsePanels: props.collapsePanels,\n animateToolSettings: props.animateToolSettings,\n toolAsToolSettingsLabel: props.toolAsToolSettingsLabel,\n }}\n >\n <main\n role=\"main\"\n id=\"uifw-configurableui-wrapper\"\n className={props.className}\n style={props.style}\n onMouseMove={handleMouseMove}\n ref={(el) => setMainElement(el ?? undefined)}\n >\n <WrapperContext.Provider value={mainElement ?? document.body}>\n <ThemeProvider\n style={{ height: \"100%\" }}\n portalContainer={portalContainer}\n >\n {props.appBackstage}\n <WidgetPanelsFrontstage />\n\n <ElementTooltip />\n <PointerMessage />\n {/* eslint-disable-next-line deprecation/deprecation */}\n <KeyboardShortcutMenu />\n <InputFieldMessage />\n <CursorPopupMenu />\n <CursorPopupRenderer />\n <PopupRenderer />\n <MessageRenderer />\n <div\n className=\"uifw-configurableui-portalContainer\"\n ref={(instance) => setPortalContainer(instance ?? undefined)}\n >\n <ContentDialogRenderer />\n <ModelessDialogRenderer />\n <ModalDialogRenderer />\n </div>\n </ThemeProvider>\n </WrapperContext.Provider>\n </main>\n </ConfigurableUiContext.Provider>\n );\n}\n\nfunction useWidgetOpacity(\n widgetOpacity: ConfigurableUiContentProps[\"widgetOpacity\"]\n) {\n const reduxWidgetOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line deprecation/deprecation\n return state?.configurableUiState.widgetOpacity;\n });\n const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-widget-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useToolbarOpacity(\n toolbarOpacity: ConfigurableUiContentProps[\"toolbarOpacity\"]\n) {\n const reduxToolbarOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line deprecation/deprecation\n return state?.configurableUiState.toolbarOpacity;\n });\n\n const opacity =\n toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-toolbar-opacity\");\n };\n }, [opacity]);\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Dialog
3
3
  */
4
+ import "./DialogManagerBase.scss";
4
5
  import * as React from "react";
5
6
  import type { BeUiEvent } from "@itwin/core-bentley";
6
7
  import { UiEvent } from "@itwin/appui-abstract";
@@ -68,9 +69,9 @@ export interface DialogRendererProps {
68
69
  dialogManager: DialogManagerBase;
69
70
  style?: React.CSSProperties;
70
71
  }
71
- /** @internal */
72
72
  interface DialogRendererState {
73
- parentDocument: Document | null;
73
+ parentDocument: Document | undefined;
74
+ renderer: HTMLElement | undefined;
74
75
  }
75
76
  /** DialogRenderer React component.
76
77
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"DialogManagerBase.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/dialog/DialogManagerBase.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIhD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;CAC3C;AAED;;;GAGG;AAEH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,sBAAsB,CAAC;CAAG;AAE1E;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,QAAQ,CAAC;CAC1B;AAKD;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAK;IACxB,OAAO,CAAC,QAAQ,CAAyC;IAEzD,OAAO,CAAC,qBAAqB,CAAoC;IACjE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAkB;gBAG/B,oBAAoB,EAAE,SAAS,CAAC,sBAAsB,CAAC;IAInE,6CAA6C;WAC/B,UAAU,IAAI,IAAI;IAIhC,WAAkB,SAAS,IAAI,MAAM,CAEpC;IAED,WAAkB,SAAS,CAAC,MAAM,EAAE,MAAM,EAEzC;IACD,IAAW,OAAO,iBAEjB;IAGD,IAAW,oBAAoB,IAAI,SAAS,CAAC,sBAAsB,CAAC,CAEnE;WAEa,sBAAsB,IAAI,MAAM;IAc9C;;;;;OAKG;IACI,UAAU,CACf,MAAM,EAAE,KAAK,CAAC,SAAS,EACvB,EAAE,CAAC,EAAE,MAAM,EAC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3C,sBAAsB,IAAI,IAAI;IAO9B,MAAM,IAAI,IAAI;IAIrB,IAAW,YAAY,IAAI,KAAK,CAAC,SAAS,GAAG,SAAS,CAKrD;IAED,IAAW,WAAW,IAAI,MAAM,CAE/B;CACF;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,iBAAiB,CAAC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,UAAU,mBAAmB;IAC3B,cAAc,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;CACnC;AACD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK,CAAC,aAAa,CACzD,mBAAmB,EACnB,mBAAmB,CACpB;IACC,gBAAgB;IAChB,SAAyB,KAAK,EAAE,mBAAmB,CAGjD;IAEF,OAAO,CAAC,aAAa,CAKnB;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;IA0BzB,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAO5C,OAAO,CAAC,yBAAyB,CAE/B;CACH"}
@@ -8,11 +8,13 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.DialogRendererBase = exports.DialogManagerBase = exports.DialogChangedEvent = void 0;
11
+ require("./DialogManagerBase.scss");
11
12
  const React = require("react");
12
13
  const core_bentley_1 = require("@itwin/core-bentley");
13
14
  const appui_abstract_1 = require("@itwin/appui-abstract");
14
15
  const UiFramework_1 = require("../UiFramework");
15
16
  const core_react_1 = require("@itwin/core-react");
17
+ const itwinui_react_1 = require("@itwin/itwinui-react");
16
18
  /** Dialog Changed Event class.
17
19
  * @public
18
20
  * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
@@ -126,10 +128,14 @@ class DialogRendererBase extends React.PureComponent {
126
128
  super(...arguments);
127
129
  /** @internal */
128
130
  this.state = {
129
- parentDocument: null,
131
+ parentDocument: undefined,
132
+ renderer: undefined,
130
133
  };
131
- this._handleRefSet = (popupDiv) => {
132
- this.setState({ parentDocument: popupDiv?.ownerDocument ?? null });
134
+ this._handleRefSet = (el) => {
135
+ this.setState({
136
+ parentDocument: el?.ownerDocument ?? undefined,
137
+ renderer: el ?? undefined,
138
+ });
133
139
  };
134
140
  // eslint-disable-next-line deprecation/deprecation
135
141
  this._handleDialogChangedEvent = (_args) => {
@@ -139,12 +145,13 @@ class DialogRendererBase extends React.PureComponent {
139
145
  render() {
140
146
  if (this.props.dialogManager.dialogCount <= 0)
141
147
  return null;
142
- return (React.createElement("div", { className: "appui-react-dialog-render-container", ref: this._handleRefSet }, this.state.parentDocument &&
143
- this.props.dialogManager.dialogs
144
- .filter((info) => info.parentDocument === this.state.parentDocument)
145
- .map((dialogInfo) => {
146
- return (React.createElement(React.Fragment, { key: dialogInfo.id }, dialogInfo.reactNode));
147
- })));
148
+ return (React.createElement("div", { className: "uifw-dialog-dialogManagerBase_renderer", ref: this._handleRefSet },
149
+ React.createElement(itwinui_react_1.ThemeProvider, { portalContainer: this.state.renderer }, this.state.parentDocument &&
150
+ this.props.dialogManager.dialogs
151
+ .filter((info) => info.parentDocument === this.state.parentDocument)
152
+ .map((info) => {
153
+ return (React.createElement(React.Fragment, { key: info.id }, info.reactNode));
154
+ }))));
148
155
  }
149
156
  componentDidMount() {
150
157
  this.props.dialogManager.onDialogChangedEvent.addListener(this._handleDialogChangedEvent);
@@ -1 +1 @@
1
- {"version":3,"file":"DialogManagerBase.js","sourceRoot":"","sources":["../../../../src/appui-react/dialog/DialogManagerBase.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,sDAA6C;AAC7C,0DAAgD;AAChD,gDAA6C;AAC7C,kDAA2D;AAW3D;;;GAGG;AACH,mDAAmD;AACnD,MAAa,kBAAmB,SAAQ,wBAA+B;CAAG;AAA1E,gDAA0E;AAW1E,+DAA+D;AAC/D,MAAM,cAAc,GAAG,K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,EAAE,EAAE;gBAC9B,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,UAAU,CAAC,EAAE,IAC/B,UAAU,CAAC,SAAS,CACN,CAClB,CAAC;YACJ,CAAC,CAAC,CACF,CACP,CAAC;IACJ,CAAC;IAEe,iBAAiB;QAC/B,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,WAAW,CACvD,IAAI,CAAC,yBAAyB,CAC/B,CAAC;IACJ,CAAC;IAEe,oBAAoB;QAClC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,cAAc,CAC1D,IAAI,CAAC,yBAAyB,CAC/B,CAAC;IACJ,CAAC;CAMF;AAnDD,gDAmDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Dialog\n */\n\nimport * as React from \"react\";\nimport type { BeUiEvent } from \"@itwin/core-bentley\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { UiFramework } from \"../UiFramework\";\nimport { getCssVariableAsNumber } from \"@itwin/core-react\";\n\n/** Dialog Stack Changed Event Args class.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface DialogChangedEventArgs {\n dialogCount: number;\n activeDialog: React.ReactNode | undefined;\n}\n\n/** Dialog Changed Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class DialogChangedEvent extends UiEvent<DialogChangedEventArgs> {}\n\n/** Information maintained by a Dialog Manager about a dialog\n * @public\n */\nexport interface DialogInfo {\n reactNode: React.ReactNode;\n id: string;\n parentDocument: Document;\n}\n\n/** Used if the 'dialog' z-index CSS variable cannot be read */\nconst ZINDEX_DEFAULT = 12000;\n\n/** Dialog Manager class.\n * @internal\n */\nexport class DialogManagerBase {\n private static _sId = 0;\n private _dialogs: DialogInfo[] = new Array<DialogInfo>();\n // eslint-disable-next-line deprecation/deprecation\n private _onDialogChangedEvent: BeUiEvent<DialogChangedEventArgs>;\n private static _topZIndex = ZINDEX_DEFAULT;\n\n // eslint-disable-next-line deprecation/deprecation\n constructor(onDialogChangedEvent: BeUiEvent<DialogChangedEventArgs>) {\n this._onDialogChangedEvent = onDialogChangedEvent;\n }\n\n /** Initialize the modeless dialog manager */\n public static initialize(): void {\n DialogManagerBase._topZIndex = DialogManagerBase.getDialogZIndexDefault();\n }\n\n public static get topZIndex(): number {\n return DialogManagerBase._topZIndex;\n }\n\n public static set topZIndex(zIndex: number) {\n DialogManagerBase._topZIndex = zIndex;\n }\n public get dialogs() {\n return this._dialogs;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n public get onDialogChangedEvent(): BeUiEvent<DialogChangedEventArgs> {\n return this._onDialogChangedEvent;\n }\n\n public static getDialogZIndexDefault(): number {\n const variable = \"--uicore-z-index-dialog\";\n // eslint-disable-next-line deprecation/deprecation\n const value = getCssVariableAsNumber(variable);\n\n if (!isNaN(value)) return value;\n\n Logger.logError(\n UiFramework.loggerCategory(this),\n `'${variable}' CSS variable not found`\n );\n return ZINDEX_DEFAULT;\n }\n\n /**\n * Triggers opening a dialog.\n * @param dialog Dialog React component.\n * @param id The unique Id the identifies the dialog.\n * @param parentDocument Optional document required when displaying a dialog in a child popup window.\n */\n public openDialog(\n dialog: React.ReactNode,\n id?: string,\n parentDocument?: Document\n ): void {\n if (!id) id = `Dialog-${++DialogManagerBase._sId}`;\n\n const owningDoc = parentDocument ?? document;\n this.pushDialog({ reactNode: dialog, id, parentDocument: owningDoc });\n }\n\n /** @internal */\n public pushDialog(dialogInfo: DialogInfo): void {\n this._dialogs.push(dialogInfo);\n this.emitDialogChangedEvent();\n }\n\n public closeDialog(dialog?: React.ReactNode): void {\n let targetDialog = dialog;\n if (!dialog) targetDialog = this.activeDialog;\n\n this.removeDialog(targetDialog);\n this.emitDialogChangedEvent();\n }\n\n /** @internal */\n public closeAll(): void {\n this._dialogs = [];\n this.emitDialogChangedEvent();\n }\n\n /** @internal */\n public removeDialog(dialog: React.ReactNode): void {\n const index = this._dialogs.findIndex((dialogInfo: DialogInfo) => {\n return dialog === dialogInfo.reactNode;\n });\n if (index >= 0) this._dialogs.splice(index, 1);\n if (this._dialogs.length < 1)\n DialogManagerBase.topZIndex = DialogManagerBase.getDialogZIndexDefault();\n }\n\n public emitDialogChangedEvent(): void {\n this._onDialogChangedEvent.emit({\n dialogCount: this.dialogCount,\n activeDialog: this.activeDialog,\n });\n }\n\n public update(): void {\n this.emitDialogChangedEvent();\n }\n\n public get activeDialog(): React.ReactNode | undefined {\n if (this._dialogs.length > 0)\n return this._dialogs[this._dialogs.length - 1].reactNode;\n\n return undefined;\n }\n\n public get dialogCount(): number {\n return this._dialogs.length;\n }\n}\n\n/** Properties for the [[DialogRendererBase]] component\n * @internal\n */\nexport interface DialogRendererProps {\n dialogManager: DialogManagerBase;\n style?: React.CSSProperties;\n}\n\n/** @internal */\ninterface DialogRendererState {\n parentDocument: Document | null;\n}\n/** DialogRenderer React component.\n * @internal\n */\nexport class DialogRendererBase extends React.PureComponent<\n DialogRendererProps,\n DialogRendererState\n> {\n /** @internal */\n public override readonly state: DialogRendererState = {\n parentDocument: null,\n };\n\n private _handleRefSet = (popupDiv: HTMLElement | null) => {\n this.setState({ parentDocument: popupDiv?.ownerDocument ?? null });\n };\n\n public override render(): React.ReactNode {\n if (this.props.dialogManager.dialogCount <= 0) return null;\n\n return (\n <div\n className=\"appui-react-dialog-render-container\"\n ref={this._handleRefSet}\n >\n {this.state.parentDocument &&\n this.props.dialogManager.dialogs\n .filter((info) => info.parentDocument === this.state.parentDocument)\n .map((dialogInfo: DialogInfo) => {\n return (\n <React.Fragment key={dialogInfo.id}>\n {dialogInfo.reactNode}\n </React.Fragment>\n );\n })}\n </div>\n );\n }\n\n public override componentDidMount(): void {\n this.props.dialogManager.onDialogChangedEvent.addListener(\n this._handleDialogChangedEvent\n );\n }\n\n public override componentWillUnmount(): void {\n this.props.dialogManager.onDialogChangedEvent.removeListener(\n this._handleDialogChangedEvent\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n private _handleDialogChangedEvent = (_args: DialogChangedEventArgs) => {\n this.forceUpdate();\n };\n}\n"]}
1
+ {"version":3,"file":"DialogManagerBase.js","sourceRoot":"","sources":["../../../../src/appui-react/dialog/DialogManagerBase.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,oCAAkC;AAClC,+BAA+B;AAE/B,sDAA6C;AAC7C,0DAAgD;AAChD,gDAA6C;AAC7C,kDAA2D;AAC3D,wDAAqD;AAWrD;;;GAGG;AACH,mDAAmD;AACnD,MAAa,kBAAmB,SAAQ,wBAA+B;CAAG;AAA1E,gDAA0E;AAW1E,+DAA+D;AAC/D,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B;;GAEG;AACH,MAAa,iBAAiB;IAO5B,mDAAmD;IACnD,YAAY,oBAAuD;QAN3D,aAAQ,GAAiB,IAAI,KAAK,EAAc,CAAC;QAOvD,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;IACpD,CAAC;IAED,6CAA6C;IACtC,MAAM,CAAC,UAAU;QACtB,iBAAiB,CAAC,UAAU,GAAG,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;IAC5E,CAAC;IAEM,MAAM,KAAK,SAAS;QACzB,OAAO,iBAAiB,CAAC,UAAU,CAAC;IACtC,CAAC;IAEM,MAAM,KAAK,SAAS,CAAC,MAAc;QACxC,iBAAiB,CAAC,UAAU,GAAG,MAAM,CAAC;IACxC,CAAC;IACD,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,mDAAmD;IACnD,IAAW,oBAAoB;QAC7B,OAAO,IAAI,CAAC,qBAAq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sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Dialog\n */\n\nimport \"./DialogManagerBase.scss\";\nimport * as React from \"react\";\nimport type { BeUiEvent } from \"@itwin/core-bentley\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { UiFramework } from \"../UiFramework\";\nimport { getCssVariableAsNumber } from \"@itwin/core-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\n\n/** Dialog Stack Changed Event Args class.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface DialogChangedEventArgs {\n dialogCount: number;\n activeDialog: React.ReactNode | undefined;\n}\n\n/** Dialog Changed Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport class DialogChangedEvent extends UiEvent<DialogChangedEventArgs> {}\n\n/** Information maintained by a Dialog Manager about a dialog\n * @public\n */\nexport interface DialogInfo {\n reactNode: React.ReactNode;\n id: string;\n parentDocument: Document;\n}\n\n/** Used if the 'dialog' z-index CSS variable cannot be read */\nconst ZINDEX_DEFAULT = 12000;\n\n/** Dialog Manager class.\n * @internal\n */\nexport class DialogManagerBase {\n private static _sId = 0;\n private _dialogs: DialogInfo[] = new Array<DialogInfo>();\n // eslint-disable-next-line deprecation/deprecation\n private _onDialogChangedEvent: BeUiEvent<DialogChangedEventArgs>;\n private static _topZIndex = ZINDEX_DEFAULT;\n\n // eslint-disable-next-line deprecation/deprecation\n constructor(onDialogChangedEvent: BeUiEvent<DialogChangedEventArgs>) {\n this._onDialogChangedEvent = onDialogChangedEvent;\n }\n\n /** Initialize the modeless dialog manager */\n public static initialize(): void {\n DialogManagerBase._topZIndex = DialogManagerBase.getDialogZIndexDefault();\n }\n\n public static get topZIndex(): number {\n return DialogManagerBase._topZIndex;\n }\n\n public static set topZIndex(zIndex: number) {\n DialogManagerBase._topZIndex = zIndex;\n }\n public get dialogs() {\n return this._dialogs;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n public get onDialogChangedEvent(): BeUiEvent<DialogChangedEventArgs> {\n return this._onDialogChangedEvent;\n }\n\n public static getDialogZIndexDefault(): number {\n const variable = \"--uicore-z-index-dialog\";\n // eslint-disable-next-line deprecation/deprecation\n const value = getCssVariableAsNumber(variable);\n\n if (!isNaN(value)) return value;\n\n Logger.logError(\n UiFramework.loggerCategory(this),\n `'${variable}' CSS variable not found`\n );\n return ZINDEX_DEFAULT;\n }\n\n /**\n * Triggers opening a dialog.\n * @param dialog Dialog React component.\n * @param id The unique Id the identifies the dialog.\n * @param parentDocument Optional document required when displaying a dialog in a child popup window.\n */\n public openDialog(\n dialog: React.ReactNode,\n id?: string,\n parentDocument?: Document\n ): void {\n if (!id) id = `Dialog-${++DialogManagerBase._sId}`;\n\n const owningDoc = parentDocument ?? document;\n this.pushDialog({ reactNode: dialog, id, parentDocument: owningDoc });\n }\n\n /** @internal */\n public pushDialog(dialogInfo: DialogInfo): void {\n this._dialogs.push(dialogInfo);\n this.emitDialogChangedEvent();\n }\n\n public closeDialog(dialog?: React.ReactNode): void {\n let targetDialog = dialog;\n if (!dialog) targetDialog = this.activeDialog;\n\n this.removeDialog(targetDialog);\n this.emitDialogChangedEvent();\n }\n\n /** @internal */\n public closeAll(): void {\n this._dialogs = [];\n this.emitDialogChangedEvent();\n }\n\n /** @internal */\n public removeDialog(dialog: React.ReactNode): void {\n const index = this._dialogs.findIndex((dialogInfo: DialogInfo) => {\n return dialog === dialogInfo.reactNode;\n });\n if (index >= 0) this._dialogs.splice(index, 1);\n if (this._dialogs.length < 1)\n DialogManagerBase.topZIndex = DialogManagerBase.getDialogZIndexDefault();\n }\n\n public emitDialogChangedEvent(): void {\n this._onDialogChangedEvent.emit({\n dialogCount: this.dialogCount,\n activeDialog: this.activeDialog,\n });\n }\n\n public update(): void {\n this.emitDialogChangedEvent();\n }\n\n public get activeDialog(): React.ReactNode | undefined {\n if (this._dialogs.length > 0)\n return this._dialogs[this._dialogs.length - 1].reactNode;\n\n return undefined;\n }\n\n public get dialogCount(): number {\n return this._dialogs.length;\n }\n}\n\n/** Properties for the [[DialogRendererBase]] component\n * @internal\n */\nexport interface DialogRendererProps {\n dialogManager: DialogManagerBase;\n style?: React.CSSProperties;\n}\n\ninterface DialogRendererState {\n parentDocument: Document | undefined;\n renderer: HTMLElement | undefined;\n}\n/** DialogRenderer React component.\n * @internal\n */\nexport class DialogRendererBase extends React.PureComponent<\n DialogRendererProps,\n DialogRendererState\n> {\n /** @internal */\n public override readonly state: DialogRendererState = {\n parentDocument: undefined,\n renderer: undefined,\n };\n\n private _handleRefSet = (el: HTMLElement | null) => {\n this.setState({\n parentDocument: el?.ownerDocument ?? undefined,\n renderer: el ?? undefined,\n });\n };\n\n public override render(): React.ReactNode {\n if (this.props.dialogManager.dialogCount <= 0) return null;\n\n return (\n <div\n className=\"uifw-dialog-dialogManagerBase_renderer\"\n ref={this._handleRefSet}\n >\n <ThemeProvider portalContainer={this.state.renderer}>\n {this.state.parentDocument &&\n this.props.dialogManager.dialogs\n .filter(\n (info) => info.parentDocument === this.state.parentDocument\n )\n .map((info) => {\n return (\n <React.Fragment key={info.id}>\n {info.reactNode}\n </React.Fragment>\n );\n })}\n </ThemeProvider>\n </div>\n );\n }\n\n public override componentDidMount(): void {\n this.props.dialogManager.onDialogChangedEvent.addListener(\n this._handleDialogChangedEvent\n );\n }\n\n public override componentWillUnmount(): void {\n this.props.dialogManager.onDialogChangedEvent.removeListener(\n this._handleDialogChangedEvent\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n private _handleDialogChangedEvent = (_args: DialogChangedEventArgs) => {\n this.forceUpdate();\n };\n}\n"]}
@@ -0,0 +1,11 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ @import "~@itwin/core-react/lib/cjs/core-react/z-index";
6
+
7
+ .uifw-dialog-dialogManagerBase_renderer {
8
+ position: relative;
9
+
10
+ @include uicore-z-index(dialog);
11
+ }
@@ -9,15 +9,13 @@
9
9
  export interface FrameworkVisibility {
10
10
  /** Determines if the Ui is visible */
11
11
  isUiVisible: boolean;
12
- /** Determines whether the `auto-hide Ui` feature is on. Defaults to false.
13
- * When true, the Ui automatically hides after a few seconds of inactivity.
14
- */
12
+ /** When true, the UI automatically hides after a specified period of inactivity, defined by {@link FrameworkVisibility.inactivityTime}. Defaults to `true`. */
15
13
  autoHideUi: boolean;
16
14
  /** Determines whether the widget panels are shown and hidden. Defaults to false. */
17
15
  showHidePanels: boolean;
18
16
  /** Determines whether the status bar is shown and hidden. Defaults to false. */
19
17
  showHideFooter: boolean;
20
- /** Determines the amount of inactivity time before the Ui is hidden. Defaults to 3.5 seconds. */
18
+ /** Determines the amount of inactivity time in `ms` before the UI is hidden if {@link FrameworkVisibility.autoHideUi} is enabled. Defaults to `3.5` seconds. */
21
19
  inactivityTime: number;
22
20
  /** Determines whether the proximity of the mouse should alter the opacity of a toolbar. Defaults to `true`.
23
21
  * @deprecated in 4.11.0. The preferred mode is to change opacity in a snappy way (use {@link FrameworkVisibility.snapWidgetOpacity}).
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkVisibility.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/framework/FrameworkVisibility.ts"],"names":[],"mappings":";AAIA;;GAEG;AACH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB,oFAAoF;IACpF,cAAc,EAAE,OAAO,CAAC;IAExB,gFAAgF;IAChF,cAAc,EAAE,OAAO,CAAC;IAExB,iGAAiG;IACjG,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B,4HAA4H;IAC5H,iBAAiB,EAAE,OAAO,CAAC;IAE3B,6CAA6C;IAC7C,qBAAqB,IAAI,IAAI,CAAC;IAE9B,6DAA6D;IAC7D,sBAAsB,CACpB,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,GACjD,IAAI,CAAC;IAER,iDAAiD;IACjD,sBAAsB,CACpB,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,GACjD,IAAI,CAAC;IAER,mDAAmD;IACnD,mBAAmB,IAAI,IAAI,CAAC;IAE5B,oDAAoD;IACpD,oBAAoB,IAAI,IAAI,CAAC;CAC9B"}
1
+ {"version":3,"file":"FrameworkVisibility.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/framework/FrameworkVisibility.ts"],"names":[],"mappings":";AAIA;;GAEG;AACH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,WAAW,EAAE,OAAO,CAAC;IAErB,+JAA+J;IAC/J,UAAU,EAAE,OAAO,CAAC;IAEpB,oFAAoF;IACpF,cAAc,EAAE,OAAO,CAAC;IAExB,gFAAgF;IAChF,cAAc,EAAE,OAAO,CAAC;IAExB,gKAAgK;IAChK,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAE7B,4HAA4H;IAC5H,iBAAiB,EAAE,OAAO,CAAC;IAE3B,6CAA6C;IAC7C,qBAAqB,IAAI,IAAI,CAAC;IAE9B,6DAA6D;IAC7D,sBAAsB,CACpB,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,GACjD,IAAI,CAAC;IAER,iDAAiD;IACjD,sBAAsB,CACpB,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,GACjD,IAAI,CAAC;IAER,mDAAmD;IACnD,mBAAmB,IAAI,IAAI,CAAC;IAE5B,oDAAoD;IACpD,oBAAoB,IAAI,IAAI,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkVisibility.js","sourceRoot":"","sources":["../../../../src/appui-react/framework/FrameworkVisibility.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n/**\n * [[UiFramework.visibility]] interface\n * @public\n */\nexport interface FrameworkVisibility {\n /** Determines if the Ui is visible */\n isUiVisible: boolean;\n\n /** Determines whether the `auto-hide Ui` feature is on. Defaults to false.\n * When true, the Ui automatically hides after a few seconds of inactivity.\n */\n autoHideUi: boolean;\n\n /** Determines whether the widget panels are shown and hidden. Defaults to false. */\n showHidePanels: boolean;\n\n /** Determines whether the status bar is shown and hidden. Defaults to false. */\n showHideFooter: boolean;\n\n /** Determines the amount of inactivity time before the Ui is hidden. Defaults to 3.5 seconds. */\n inactivityTime: number;\n\n /** Determines whether the proximity of the mouse should alter the opacity of a toolbar. Defaults to `true`.\n * @deprecated in 4.11.0. The preferred mode is to change opacity in a snappy way (use {@link FrameworkVisibility.snapWidgetOpacity}).\n */\n useProximityOpacity: boolean;\n\n /** Determines whether the opacity of a toolbar should change immediately when the mouse gets close. Defaults to `false`. */\n snapWidgetOpacity: boolean;\n\n /** Handler for when a Frontstage is ready */\n handleFrontstageReady(): void;\n\n /** Handler for when the mouse moves over the content area */\n handleContentMouseMove(\n _event?: React.MouseEvent<HTMLElement, MouseEvent>\n ): void;\n\n /** Handler for when the mouse enters a widget */\n handleWidgetMouseEnter(\n _event?: React.MouseEvent<HTMLElement, MouseEvent>\n ): void;\n\n /** Shows the Ui and resets the inactivity timer */\n showUiAndResetTimer(): void;\n\n /** Shows the Ui and cancels the inactivity timer */\n showUiAndCancelTimer(): void;\n}\n"]}
1
+ {"version":3,"file":"FrameworkVisibility.js","sourceRoot":"","sources":["../../../../src/appui-react/framework/FrameworkVisibility.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n/**\n * [[UiFramework.visibility]] interface\n * @public\n */\nexport interface FrameworkVisibility {\n /** Determines if the Ui is visible */\n isUiVisible: boolean;\n\n /** When true, the UI automatically hides after a specified period of inactivity, defined by {@link FrameworkVisibility.inactivityTime}. Defaults to `true`. */\n autoHideUi: boolean;\n\n /** Determines whether the widget panels are shown and hidden. Defaults to false. */\n showHidePanels: boolean;\n\n /** Determines whether the status bar is shown and hidden. Defaults to false. */\n showHideFooter: boolean;\n\n /** Determines the amount of inactivity time in `ms` before the UI is hidden if {@link FrameworkVisibility.autoHideUi} is enabled. Defaults to `3.5` seconds. */\n inactivityTime: number;\n\n /** Determines whether the proximity of the mouse should alter the opacity of a toolbar. Defaults to `true`.\n * @deprecated in 4.11.0. The preferred mode is to change opacity in a snappy way (use {@link FrameworkVisibility.snapWidgetOpacity}).\n */\n useProximityOpacity: boolean;\n\n /** Determines whether the opacity of a toolbar should change immediately when the mouse gets close. Defaults to `false`. */\n snapWidgetOpacity: boolean;\n\n /** Handler for when a Frontstage is ready */\n handleFrontstageReady(): void;\n\n /** Handler for when the mouse moves over the content area */\n handleContentMouseMove(\n _event?: React.MouseEvent<HTMLElement, MouseEvent>\n ): void;\n\n /** Handler for when the mouse enters a widget */\n handleWidgetMouseEnter(\n _event?: React.MouseEvent<HTMLElement, MouseEvent>\n ): void;\n\n /** Shows the Ui and resets the inactivity timer */\n showUiAndResetTimer(): void;\n\n /** Shows the Ui and cancels the inactivity timer */\n showUiAndCancelTimer(): void;\n}\n"]}
@@ -4,14 +4,14 @@
4
4
  import * as React from "react";
5
5
  import { Popover } from "@itwin/itwinui-react";
6
6
  import { ButtonExpandIndicator } from "./ExpandIndicator";
7
- import type { CommonProps } from "@itwin/core-react";
7
+ import { type CommonProps } from "@itwin/core-react";
8
8
  type StatusBarPopoverProps = CommonProps & Pick<React.ComponentProps<typeof Popover>, "content" | "children" | "visible" | "onVisibleChange" | "closeOnOutsideClick">;
9
9
  /** Popover component used in `StatusBar` component.
10
10
  * This component should wrap the element that triggers the popover.
11
11
  * @note Add the `StatusBarPopover.ExpandIndicator` to popover trigger buttons.
12
12
  * @public
13
13
  */
14
- export declare function StatusBarPopover(props: StatusBarPopoverProps): React.JSX.Element;
14
+ export declare function StatusBarPopover({ content, ...props }: StatusBarPopoverProps): React.JSX.Element;
15
15
  /** Components used in `StatusBarPopover`.
16
16
  * @public
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBarPopover.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/statusbar/popup/StatusBarPopover.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,KAAK,qBAAqB,GAAG,WAAW,GACtC,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAClC,SAAS,GACT,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,qBAAqB,CACxB,CAAC;AAEJ;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAW5D;AAED;;GAEG;AACH,yBAAiB,gBAAgB,CAAC;IAChC;;OAEG;IACI,MAAM,eAAe,8BAAwB,CAAC;CACtD"}
1
+ {"version":3,"file":"StatusBarPopover.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/statusbar/popup/StatusBarPopover.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAGnE,KAAK,qBAAqB,GAAG,WAAW,GACtC,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAClC,SAAS,GACT,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,qBAAqB,CACxB,CAAC;AAEJ;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,qBAsB5E;AAED;;GAEG;AACH,yBAAiB,gBAAgB,CAAC;IAChC;;OAEG;IACI,MAAM,eAAe,8BAAwB,CAAC;CACtD"}
@@ -11,14 +11,18 @@ exports.StatusBarPopover = void 0;
11
11
  const React = require("react");
12
12
  const itwinui_react_1 = require("@itwin/itwinui-react");
13
13
  const ExpandIndicator_1 = require("./ExpandIndicator");
14
+ const core_react_1 = require("@itwin/core-react");
14
15
  /** Popover component used in `StatusBar` component.
15
16
  * This component should wrap the element that triggers the popover.
16
17
  * @note Add the `StatusBarPopover.ExpandIndicator` to popover trigger buttons.
17
18
  * @public
18
19
  */
19
- function StatusBarPopover(props) {
20
- return (React.createElement(itwinui_react_1.Popover, { ...props, placement: "top", applyBackground: true, middleware: {
20
+ function StatusBarPopover({ content, ...props }) {
21
+ const [portalTarget, setPortalTarget] = React.useState(undefined);
22
+ return (React.createElement(itwinui_react_1.Popover, { ...props, content: React.createElement(core_react_1.PopupContext.Provider, { value: portalTarget }, content), placement: "top", applyBackground: true, middleware: {
21
23
  offset: 4,
24
+ }, ref: (el) => {
25
+ setPortalTarget(el ?? undefined);
22
26
  } }));
23
27
  }
24
28
  exports.StatusBarPopover = StatusBarPopover;
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBarPopover.js","sourceRoot":"","sources":["../../../../../src/appui-react/statusbar/popup/StatusBarPopover.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAA+C;AAC/C,uDAA0D;AAc1D;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,KAA4B;IAC3D,OAAO,CACL,oBAAC,uBAAO,OACF,KAAK,EACT,SAAS,EAAC,KAAK,EACf,eAAe,QACf,UAAU,EAAE;YACV,MAAM,EAAE,CAAC;SACV,GACD,CACH,CAAC;AACJ,CAAC;AAXD,4CAWC;AAED;;GAEG;AACH,WAAiB,gBAAgB;IAC/B;;OAEG;IACU,gCAAe,GAAG,uCAAqB,CAAC;AACvD,CAAC,EALgB,gBAAgB,gCAAhB,gBAAgB,QAKhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module StatusBar\n */\n\nimport * as React from \"react\";\nimport { Popover } from \"@itwin/itwinui-react\";\nimport { ButtonExpandIndicator } from \"./ExpandIndicator\";\nimport type { CommonProps } from \"@itwin/core-react\";\n\n// eslint-disable-next-line deprecation/deprecation\ntype StatusBarPopoverProps = CommonProps &\n Pick<\n React.ComponentProps<typeof Popover>,\n | \"content\"\n | \"children\"\n | \"visible\"\n | \"onVisibleChange\"\n | \"closeOnOutsideClick\"\n >;\n\n/** Popover component used in `StatusBar` component.\n * This component should wrap the element that triggers the popover.\n * @note Add the `StatusBarPopover.ExpandIndicator` to popover trigger buttons.\n * @public\n */\nexport function StatusBarPopover(props: StatusBarPopoverProps) {\n return (\n <Popover\n {...props}\n placement=\"top\"\n applyBackground\n middleware={{\n offset: 4,\n }}\n />\n );\n}\n\n/** Components used in `StatusBarPopover`.\n * @public\n */\nexport namespace StatusBarPopover {\n /** Indicator to be used in popover trigger buttons to show expandable content.\n * @public\n */\n export const ExpandIndicator = ButtonExpandIndicator;\n}\n"]}
1
+ {"version":3,"file":"StatusBarPopover.js","sourceRoot":"","sources":["../../../../../src/appui-react/statusbar/popup/StatusBarPopover.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAA+C;AAC/C,uDAA0D;AAC1D,kDAAmE;AAanE;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,GAAG,KAAK,EAAyB;IAC3E,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAEpD,SAAS,CAAC,CAAC;IACb,OAAO,CACL,oBAAC,uBAAO,OACF,KAAK,EACT,OAAO,EACL,oBAAC,yBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IACvC,OAAO,CACc,EAE1B,SAAS,EAAC,KAAK,EACf,eAAe,QACf,UAAU,EAAE;YACV,MAAM,EAAE,CAAC;SACV,EACD,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE;YACV,eAAe,CAAC,EAAE,IAAI,SAAS,CAAC,CAAC;QACnC,CAAC,GACD,CACH,CAAC;AACJ,CAAC;AAtBD,4CAsBC;AAED;;GAEG;AACH,WAAiB,gBAAgB;IAC/B;;OAEG;IACU,gCAAe,GAAG,uCAAqB,CAAC;AACvD,CAAC,EALgB,gBAAgB,gCAAhB,gBAAgB,QAKhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module StatusBar\n */\n\nimport * as React from \"react\";\nimport { Popover } from \"@itwin/itwinui-react\";\nimport { ButtonExpandIndicator } from \"./ExpandIndicator\";\nimport { type CommonProps, PopupContext } from \"@itwin/core-react\";\n\n// eslint-disable-next-line deprecation/deprecation\ntype StatusBarPopoverProps = CommonProps &\n Pick<\n React.ComponentProps<typeof Popover>,\n | \"content\"\n | \"children\"\n | \"visible\"\n | \"onVisibleChange\"\n | \"closeOnOutsideClick\"\n >;\n\n/** Popover component used in `StatusBar` component.\n * This component should wrap the element that triggers the popover.\n * @note Add the `StatusBarPopover.ExpandIndicator` to popover trigger buttons.\n * @public\n */\nexport function StatusBarPopover({ content, ...props }: StatusBarPopoverProps) {\n const [portalTarget, setPortalTarget] = React.useState<\n HTMLElement | undefined\n >(undefined);\n return (\n <Popover\n {...props}\n content={\n <PopupContext.Provider value={portalTarget}>\n {content}\n </PopupContext.Provider>\n }\n placement=\"top\"\n applyBackground\n middleware={{\n offset: 4,\n }}\n ref={(el) => {\n setPortalTarget(el ?? undefined);\n }}\n />\n );\n}\n\n/** Components used in `StatusBarPopover`.\n * @public\n */\nexport namespace StatusBarPopover {\n /** Indicator to be used in popover trigger buttons to show expandable content.\n * @public\n */\n export const ExpandIndicator = ButtonExpandIndicator;\n}\n"]}
@@ -33,21 +33,14 @@ export declare class InternalUiShowHideManager {
33
33
  private static _showHideFooter;
34
34
  private static _inactivityTime;
35
35
  private static _timeout;
36
- private static _showUiTimeout;
37
36
  private static _useProximityOpacity;
38
37
  private static _snapWidgetOpacity;
39
38
  /** Determines if the Ui is visible */
40
39
  static get isUiVisible(): boolean;
41
40
  static set isUiVisible(visible: boolean);
42
- /** @public */
43
41
  static setAutoHideUi(value: boolean): void;
44
- /** @internal */
45
42
  static setUseProximityOpacity(value: boolean): void;
46
- /** @internal */
47
43
  static setSnapWidgetOpacity(value: boolean): void;
48
- /** Determines whether the `auto-hide Ui` feature is on. Defaults to false.
49
- * When true, the Ui automatically hides after a few seconds of inactivity.
50
- */
51
44
  static get autoHideUi(): boolean;
52
45
  static set autoHideUi(autoHide: boolean);
53
46
  /** Determines whether the widget panels are shown and hidden. Defaults to false. */
@@ -75,11 +68,6 @@ export declare class InternalUiShowHideManager {
75
68
  static showUiAndResetTimer(): void;
76
69
  /** Shows the Ui and cancels the inactivity timer */
77
70
  static showUiAndCancelTimer(): void;
78
- private static cancelTimer;
79
- private static resetTimer;
80
- private static showUi;
81
- private static hideUi;
82
- /** @internal */
83
71
  static terminate(): void;
84
72
  }
85
73
  //# sourceMappingURL=InternalUiShowHideManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InternalUiShowHideManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/utils/InternalUiShowHideManager.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAMxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAG3D;;GAEG;AACH,qBAAa,0BAA2B,YAAW,oBAAoB;IACrE,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAmB;IACpD,OAAO,CAAC,MAAM,CAAC,cAAc,CAAgB;IAC7C,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAAyB;IAC/D,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAuB;IAC3D,SAAgB,UAAU,gCAAgC;WAE5C,UAAU;IAIX,gBAAgB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;WAuBjD,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc;WAQpD,wBAAwB,CAC1C,CAAC,EAAE,OAAO,EACV,OAAO,CAAC,EAAE,cAAc;WASN,sBAAsB,CACxC,CAAC,EAAE,OAAO,EACV,OAAO,CAAC,EAAE,cAAc;CAQ3B;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC,CAAC,uBAAuB;AAEpE;;GAEG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,MAAM,CAAC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