@itwin/appui-react 4.16.3 → 4.16.4

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 CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @itwin/appui-react
2
2
 
3
- This log was last generated on Tue, 03 Sep 2024 14:32:22 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 04 Sep 2024 08:10:19 GMT and should not be manually modified.
4
+
5
+ ## 4.16.4
6
+ Wed, 04 Sep 2024 08:10:19 GMT
7
+
8
+ ### Updates
9
+
10
+ - Fix link style load timing issue in window popups.
4
11
 
5
12
  ## 4.16.3
6
13
  Tue, 03 Sep 2024 14:32:22 GMT
@@ -1,5 +1,5 @@
1
1
  /** Copies the CSS style sheets from source document into the target document.
2
2
  * @internal
3
3
  */
4
- export declare function copyStyles(targetDoc: Document, sourceDoc?: Document): void;
4
+ export declare function copyStyles(targetDoc: Document, sourceDoc?: Document): Promise<void[]>;
5
5
  //# sourceMappingURL=CopyStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyStyles.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,QAAQ,EACnB,SAAS,GAAE,QAAmB,QA2B/B"}
1
+ {"version":3,"file":"CopyStyles.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,QAAQ,EACnB,SAAS,GAAE,QAAmB,mBA6C/B"}
@@ -8,13 +8,26 @@ exports.copyStyles = void 0;
8
8
  /** Copies the CSS style sheets from source document into the target document.
9
9
  * @internal
10
10
  */
11
- function copyStyles(targetDoc, sourceDoc = document) {
11
+ async function copyStyles(targetDoc, sourceDoc = document) {
12
+ const promises = [];
12
13
  const styleSheets = Array.from(sourceDoc.styleSheets);
13
14
  styleSheets.forEach(({ ownerNode }) => {
14
15
  // Copy `link` and `style` elements.
15
16
  if (!ownerNode)
16
17
  return;
17
18
  const clonedNode = targetDoc.importNode(ownerNode, true);
19
+ if (clonedNode instanceof
20
+ (targetDoc.defaultView?.HTMLLinkElement ?? HTMLLinkElement) &&
21
+ clonedNode.href) {
22
+ promises.push(new Promise((resolve, reject) => {
23
+ clonedNode.onload = () => {
24
+ resolve();
25
+ };
26
+ clonedNode.onerror = (error) => {
27
+ reject(error);
28
+ };
29
+ }));
30
+ }
18
31
  targetDoc.head.appendChild(clonedNode);
19
32
  });
20
33
  const adoptedStyleSheets = Array.from(sourceDoc.adoptedStyleSheets ?? []);
@@ -23,10 +36,7 @@ function copyStyles(targetDoc, sourceDoc = document) {
23
36
  if (!targetDoc.defaultView)
24
37
  return;
25
38
  const newStyleSheet = new targetDoc.defaultView.CSSStyleSheet();
26
- Array.from(styleSheet.cssRules).forEach((rule, index) => {
27
- // `cssText` might not serialize complex shorthand properties correctly: https://github.com/iTwin/appui/issues/893
28
- newStyleSheet.insertRule(rule.cssText, index);
29
- });
39
+ promises.push(newStyleSheet.replace(stringifyStyleSheet(styleSheet)).then(() => { }));
30
40
  targetDoc.adoptedStyleSheets.push(newStyleSheet);
31
41
  });
32
42
  // Copy sprites.
@@ -34,6 +44,12 @@ function copyStyles(targetDoc, sourceDoc = document) {
34
44
  if (svgSymbolParent) {
35
45
  targetDoc.body.appendChild(svgSymbolParent.cloneNode(true));
36
46
  }
47
+ return Promise.all(promises);
37
48
  }
38
49
  exports.copyStyles = copyStyles;
50
+ function stringifyStyleSheet(stylesheet) {
51
+ return Array.from(stylesheet.cssRules)
52
+ .map((rule) => rule.cssText)
53
+ .join("\n");
54
+ }
39
55
  //# sourceMappingURL=CopyStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyStyles.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":";AAAA;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C;IAC9D,CAAC;AACH,CAAC;AA7BD,gCA6BC","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/** Copies the CSS style sheets from source document into the target document.\n * @internal\n */\nexport function copyStyles(\n targetDoc: Document,\n sourceDoc: Document = document\n) {\n const styleSheets = Array.from(sourceDoc.styleSheets);\n styleSheets.forEach(({ ownerNode }) => {\n // Copy `link` and `style` elements.\n if (!ownerNode) return;\n const clonedNode = targetDoc.importNode(ownerNode, true);\n targetDoc.head.appendChild(clonedNode);\n });\n\n const adoptedStyleSheets = Array.from(sourceDoc.adoptedStyleSheets ?? []);\n adoptedStyleSheets.forEach((styleSheet) => {\n // Adopted stylesheet have no ownerNode and can't be shared between multiple documents.\n if (!targetDoc.defaultView) return;\n const newStyleSheet = new targetDoc.defaultView.CSSStyleSheet();\n Array.from(styleSheet.cssRules).forEach((rule, index) => {\n // `cssText` might not serialize complex shorthand properties correctly: https://github.com/iTwin/appui/issues/893\n newStyleSheet.insertRule(rule.cssText, index);\n });\n targetDoc.adoptedStyleSheets.push(newStyleSheet);\n });\n\n // Copy sprites.\n const svgSymbolParent = sourceDoc.getElementById(\"__SVG_SPRITE_NODE__\");\n if (svgSymbolParent) {\n targetDoc.body.appendChild(svgSymbolParent.cloneNode(true));\n }\n}\n"]}
1
+ {"version":3,"file":"CopyStyles.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG;;GAEG;AACI,KAAK,UAAU,UAAU,CAC9B,SAAmB,EACnB,YAAsB,QAAQ;IAE9B,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACtD,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,SA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S,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;IACxE,IAAI,eAAe,EAAE,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AA/CD,gCA+CC;AAED,SAAS,mBAAmB,CAAC,UAAyB;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;SACnC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;SAC3B,IAAI,CAAC,IAAI,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\n/** Copies the CSS style sheets from source document into the target document.\n * @internal\n */\nexport async function copyStyles(\n targetDoc: Document,\n sourceDoc: Document = document\n) {\n const promises: Array<Promise<void>> = [];\n const styleSheets = Array.from(sourceDoc.styleSheets);\n styleSheets.forEach(({ ownerNode }) => {\n // Copy `link` and `style` elements.\n if (!ownerNode) return;\n const clonedNode = targetDoc.importNode(ownerNode, true);\n if (\n clonedNode instanceof\n (targetDoc.defaultView?.HTMLLinkElement ?? HTMLLinkElement) &&\n clonedNode.href\n ) {\n promises.push(\n new Promise((resolve, reject) => {\n clonedNode.onload = () => {\n resolve();\n };\n clonedNode.onerror = (error) => {\n reject(error);\n };\n })\n );\n }\n targetDoc.head.appendChild(clonedNode);\n });\n\n const adoptedStyleSheets = Array.from(sourceDoc.adoptedStyleSheets ?? []);\n adoptedStyleSheets.forEach((styleSheet) => {\n // Adopted stylesheet have no ownerNode and can't be shared between multiple documents.\n if (!targetDoc.defaultView) return;\n const newStyleSheet = new targetDoc.defaultView.CSSStyleSheet();\n promises.push(\n newStyleSheet.replace(stringifyStyleSheet(styleSheet)).then(() => {})\n );\n targetDoc.adoptedStyleSheets.push(newStyleSheet);\n });\n\n // Copy sprites.\n const svgSymbolParent = sourceDoc.getElementById(\"__SVG_SPRITE_NODE__\");\n if (svgSymbolParent) {\n targetDoc.body.appendChild(svgSymbolParent.cloneNode(true));\n }\n\n return Promise.all(promises);\n}\n\nfunction stringifyStyleSheet(stylesheet: CSSStyleSheet) {\n return Array.from(stylesheet.cssRules)\n .map((rule) => rule.cssText)\n .join(\"\\n\");\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  /** @packageDocumentation
2
2
  * @module ChildWindowManager
3
3
  */
4
+ import "./InternalChildWindowManager.scss";
4
5
  import * as React from "react";
5
6
  import type { ChildWindowLocationProps, FrameworkChildWindows, OpenChildWindowInfo } from "../framework/FrameworkChildWindows";
6
- import "./InternalChildWindowManager.scss";
7
7
  /**
8
8
  * Simplification of non exported CreateRoot parameter, only to be used
9
9
  * in InternalChildWindowManager and ChildWindowManager
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChildWindowManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAO5C,OAAO,mCAAmC,CAAC;AA2B3C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;KAIK;AACL,qBAAa,0BAA2B,YAAW,qBAAqB;IACtE,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,MAAM,CAAwC;IAEtD,IAAW,gBAAgB,0BAE1B;IAED;;;;;;;;OAQG;IACI,aAAa,CAAC,YAAY,EAAE,UAAU,GAAG,IAAI;IAIpD;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAqBd;;;;OAIG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,mBAAmB,GAAG,SAAS;IAQlC;;;;OAIG;IACI,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS;IAS3E,OAAO,CAAC,yBAAyB;IAmFjC,gGAAgG;IACzF,QAAQ;IAOf;;;;;OAKG;IACI,KAAK,kBAAmB,MAAM,2CAkBnC;IAEF,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;OAQG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,QAAQ,EAAE,wBAAwB,EAClC,mBAAmB,CAAC,EAAE,OAAO;CA2DhC"}
1
+ {"version":3,"file":"InternalChildWindowManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAiC5C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;KAIK;AACL,qBAAa,0BAA2B,YAAW,qBAAqB;IACtE,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,MAAM,CAAwC;IAEtD,IAAW,gBAAgB,0BAE1B;IAED;;;;;;;;OAQG;IACI,aAAa,CAAC,YAAY,EAAE,UAAU,GAAG,IAAI;IAIpD;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAqBd;;;;OAIG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,mBAAmB,GAAG,SAAS;IAQlC;;;;OAIG;IACI,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS;IAS3E,OAAO,CAAC,yBAAyB;IAmFjC,gGAAgG;IACzF,QAAQ;IAOf;;;;;OAKG;IACI,KAAK,kBAAmB,MAAM,2CAkBnC;IAEF,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;OAQG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,QAAQ,EAAE,wBAAwB,EAClC,mBAAmB,CAAC,EAAE,OAAO;CA2DhC"}
@@ -8,6 +8,7 @@ exports.InternalChildWindowManager = void 0;
8
8
  /** @packageDocumentation
9
9
  * @module ChildWindowManager
10
10
  */
11
+ require("./InternalChildWindowManager.scss");
11
12
  const React = require("react");
12
13
  const ReactDOM = require("react-dom");
13
14
  const react_redux_1 = require("react-redux");
@@ -20,7 +21,6 @@ const PopupManager_1 = require("../popup/PopupManager");
20
21
  const ThemeManager_1 = require("../theme/ThemeManager");
21
22
  const useUiStateStorage_1 = require("../uistate/useUiStateStorage");
22
23
  const CopyStyles_1 = require("./CopyStyles");
23
- require("./InternalChildWindowManager.scss");
24
24
  const usePopoutsStore_1 = require("../preview/reparent-popout-widgets/usePopoutsStore");
25
25
  const childHtml = `<!DOCTYPE html>
26
26
  <html>
@@ -160,8 +160,8 @@ class InternalChildWindowManager {
160
160
  React.createElement(CursorMenu_1.CursorPopupMenu, null),
161
161
  React.createElement("div", { className: "uifw-child-window-container nz-widget-widget" }, content)),
162
162
  React.createElement("div", { className: "uifw-childwindow-internalChildWindowManager_portalContainer" }))))));
163
- setTimeout(() => {
164
- (0, CopyStyles_1.copyStyles)(childWindow.document);
163
+ setTimeout(async () => {
164
+ await (0, CopyStyles_1.copyStyles)(childWindow.document);
165
165
  setTimeout(() => {
166
166
  this.render(element, reactConnectionDiv);
167
167
  if (childWindow.expectedHeight && childWindow.expectedWidth) {
@@ -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;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,aAAa,CAC3D,CAAC;YACF,IAAI,WAAW,KAAK,CAAC,CAAC;gBAAE,OAAO,KAAK,CAAC;YACrC,MAAM,EAAE,mBAAmB,EAAE,GAAG,iCAAe,CAAC,QAAQ,EAAE,CAAC;YAC3D,mBAAmB,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC,CAAC;YAE5D,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;YACvD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,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------------------------------------\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
+ {"version":3,"file":"InternalChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG;;GAEG;AAEH,6CAA2C;AAC3C,+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,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,CACj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,EACb,OAAO,EACP,KAAK,CACN,CAAC;YACJ,CAAC,EACD,KAAK,CACN,CAAC;QACJ,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 \"./InternalChildWindowManager.scss\";\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 { 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(async () => {\n await 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,5 +1,5 @@
1
1
  /** Copies the CSS style sheets from source document into the target document.
2
2
  * @internal
3
3
  */
4
- export declare function copyStyles(targetDoc: Document, sourceDoc?: Document): void;
4
+ export declare function copyStyles(targetDoc: Document, sourceDoc?: Document): Promise<void[]>;
5
5
  //# sourceMappingURL=CopyStyles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyStyles.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,QAAQ,EACnB,SAAS,GAAE,QAAmB,QA2B/B"}
1
+ {"version":3,"file":"CopyStyles.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,QAAQ,EACnB,SAAS,GAAE,QAAmB,mBA6C/B"}
@@ -5,13 +5,26 @@
5
5
  /** Copies the CSS style sheets from source document into the target document.
6
6
  * @internal
7
7
  */
8
- export function copyStyles(targetDoc, sourceDoc = document) {
8
+ export async function copyStyles(targetDoc, sourceDoc = document) {
9
+ const promises = [];
9
10
  const styleSheets = Array.from(sourceDoc.styleSheets);
10
11
  styleSheets.forEach(({ ownerNode }) => {
11
12
  // Copy `link` and `style` elements.
12
13
  if (!ownerNode)
13
14
  return;
14
15
  const clonedNode = targetDoc.importNode(ownerNode, true);
16
+ if (clonedNode instanceof
17
+ (targetDoc.defaultView?.HTMLLinkElement ?? HTMLLinkElement) &&
18
+ clonedNode.href) {
19
+ promises.push(new Promise((resolve, reject) => {
20
+ clonedNode.onload = () => {
21
+ resolve();
22
+ };
23
+ clonedNode.onerror = (error) => {
24
+ reject(error);
25
+ };
26
+ }));
27
+ }
15
28
  targetDoc.head.appendChild(clonedNode);
16
29
  });
17
30
  const adoptedStyleSheets = Array.from(sourceDoc.adoptedStyleSheets ?? []);
@@ -20,10 +33,7 @@ export function copyStyles(targetDoc, sourceDoc = document) {
20
33
  if (!targetDoc.defaultView)
21
34
  return;
22
35
  const newStyleSheet = new targetDoc.defaultView.CSSStyleSheet();
23
- Array.from(styleSheet.cssRules).forEach((rule, index) => {
24
- // `cssText` might not serialize complex shorthand properties correctly: https://github.com/iTwin/appui/issues/893
25
- newStyleSheet.insertRule(rule.cssText, index);
26
- });
36
+ promises.push(newStyleSheet.replace(stringifyStyleSheet(styleSheet)).then(() => { }));
27
37
  targetDoc.adoptedStyleSheets.push(newStyleSheet);
28
38
  });
29
39
  // Copy sprites.
@@ -31,5 +41,11 @@ export function copyStyles(targetDoc, sourceDoc = document) {
31
41
  if (svgSymbolParent) {
32
42
  targetDoc.body.appendChild(svgSymbolParent.cloneNode(true));
33
43
  }
44
+ return Promise.all(promises);
45
+ }
46
+ function stringifyStyleSheet(stylesheet) {
47
+ return Array.from(stylesheet.cssRules)
48
+ .map((rule) => rule.cssText)
49
+ .join("\n");
34
50
  }
35
51
  //# sourceMappingURL=CopyStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CopyStyles.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,SAAmB,EACnB,YAAsB,QAAQ;IAE9B,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACtD,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,oCAAoC;QACpC,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACzD,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IAC1E,kBAAkB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACxC,uFAAuF;QACvF,IAAI,CAAC,SAAS,CAAC,WAAW;YAAE,OAAO;QACnC,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;QAChE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACtD,kHAAkH;YAClH,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,gBAAgB;IAChB,MAAM,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;IACxE,IAAI,eAAe,EAAE,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;AACH,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\n/** Copies the CSS style sheets from source document into the target document.\n * @internal\n */\nexport function copyStyles(\n targetDoc: Document,\n sourceDoc: Document = document\n) {\n const styleSheets = Array.from(sourceDoc.styleSheets);\n styleSheets.forEach(({ ownerNode }) => {\n // Copy `link` and `style` elements.\n if (!ownerNode) return;\n const clonedNode = targetDoc.importNode(ownerNode, true);\n targetDoc.head.appendChild(clonedNode);\n });\n\n const adoptedStyleSheets = Array.from(sourceDoc.adoptedStyleSheets ?? []);\n adoptedStyleSheets.forEach((styleSheet) => {\n // Adopted stylesheet have no ownerNode and can't be shared between multiple documents.\n if (!targetDoc.defaultView) return;\n const newStyleSheet = new targetDoc.defaultView.CSSStyleSheet();\n Array.from(styleSheet.cssRules).forEach((rule, index) => {\n // `cssText` might not serialize complex shorthand properties correctly: https://github.com/iTwin/appui/issues/893\n newStyleSheet.insertRule(rule.cssText, index);\n });\n targetDoc.adoptedStyleSheets.push(newStyleSheet);\n });\n\n // Copy sprites.\n const svgSymbolParent = sourceDoc.getElementById(\"__SVG_SPRITE_NODE__\");\n if (svgSymbolParent) {\n targetDoc.body.appendChild(svgSymbolParent.cloneNode(true));\n }\n}\n"]}
1
+ {"version":3,"file":"CopyStyles.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/CopyStyles.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,SAAmB,EACnB,YAAsB,QAAQ;IAE9B,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACtD,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACpC,oCAAoC;QACpC,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACzD,IACE,UAAU;YACR,CAAC,SAAS,CAAC,WAAW,EAAE,eAAe,IAAI,eAAe,CAAC;YAC7D,UAAU,CAAC,IAAI,EACf,CAAC;YACD,QAAQ,CAAC,IAAI,CACX,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC9B,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE;oBACvB,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC;gBACF,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE;oBAC7B,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC,CAAC;YACJ,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IAC1E,kBAAkB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACxC,uFAAuF;QACvF,IAAI,CAAC,SAAS,CAAC,WAAW;YAAE,OAAO;QACnC,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;QAChE,QAAQ,CAAC,IAAI,CACX,aAAa,CAAC,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CACtE,CAAC;QACF,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,gBAAgB;IAChB,MAAM,eAAe,GAAG,SAAS,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;IACxE,IAAI,eAAe,EAAE,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,mBAAmB,CAAC,UAAyB;IACpD,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;SACnC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;SAC3B,IAAI,CAAC,IAAI,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\n/** Copies the CSS style sheets from source document into the target document.\n * @internal\n */\nexport async function copyStyles(\n targetDoc: Document,\n sourceDoc: Document = document\n) {\n const promises: Array<Promise<void>> = [];\n const styleSheets = Array.from(sourceDoc.styleSheets);\n styleSheets.forEach(({ ownerNode }) => {\n // Copy `link` and `style` elements.\n if (!ownerNode) return;\n const clonedNode = targetDoc.importNode(ownerNode, true);\n if (\n clonedNode instanceof\n (targetDoc.defaultView?.HTMLLinkElement ?? HTMLLinkElement) &&\n clonedNode.href\n ) {\n promises.push(\n new Promise((resolve, reject) => {\n clonedNode.onload = () => {\n resolve();\n };\n clonedNode.onerror = (error) => {\n reject(error);\n };\n })\n );\n }\n targetDoc.head.appendChild(clonedNode);\n });\n\n const adoptedStyleSheets = Array.from(sourceDoc.adoptedStyleSheets ?? []);\n adoptedStyleSheets.forEach((styleSheet) => {\n // Adopted stylesheet have no ownerNode and can't be shared between multiple documents.\n if (!targetDoc.defaultView) return;\n const newStyleSheet = new targetDoc.defaultView.CSSStyleSheet();\n promises.push(\n newStyleSheet.replace(stringifyStyleSheet(styleSheet)).then(() => {})\n );\n targetDoc.adoptedStyleSheets.push(newStyleSheet);\n });\n\n // Copy sprites.\n const svgSymbolParent = sourceDoc.getElementById(\"__SVG_SPRITE_NODE__\");\n if (svgSymbolParent) {\n targetDoc.body.appendChild(svgSymbolParent.cloneNode(true));\n }\n\n return Promise.all(promises);\n}\n\nfunction stringifyStyleSheet(stylesheet: CSSStyleSheet) {\n return Array.from(stylesheet.cssRules)\n .map((rule) => rule.cssText)\n .join(\"\\n\");\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  /** @packageDocumentation
2
2
  * @module ChildWindowManager
3
3
  */
4
+ import "./InternalChildWindowManager.scss";
4
5
  import * as React from "react";
5
6
  import type { ChildWindowLocationProps, FrameworkChildWindows, OpenChildWindowInfo } from "../framework/FrameworkChildWindows";
6
- import "./InternalChildWindowManager.scss";
7
7
  /**
8
8
  * Simplification of non exported CreateRoot parameter, only to be used
9
9
  * in InternalChildWindowManager and ChildWindowManager
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChildWindowManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAO5C,OAAO,mCAAmC,CAAC;AA2B3C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;KAIK;AACL,qBAAa,0BAA2B,YAAW,qBAAqB;IACtE,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,MAAM,CAAwC;IAEtD,IAAW,gBAAgB,0BAE1B;IAED;;;;;;;;OAQG;IACI,aAAa,CAAC,YAAY,EAAE,UAAU,GAAG,IAAI;IAIpD;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAqBd;;;;OAIG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,mBAAmB,GAAG,SAAS;IAQlC;;;;OAIG;IACI,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS;IAS3E,OAAO,CAAC,yBAAyB;IAmFjC,gGAAgG;IACzF,QAAQ;IAOf;;;;;OAKG;IACI,KAAK,kBAAmB,MAAM,2CAkBnC;IAEF,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;OAQG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,QAAQ,EAAE,wBAAwB,EAClC,mBAAmB,CAAC,EAAE,OAAO;CA2DhC"}
1
+ {"version":3,"file":"InternalChildWindowManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,oCAAoC,CAAC;AAiC5C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E;;;;KAIK;AACL,qBAAa,0BAA2B,YAAW,qBAAqB;IACtE,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,OAAO,CAAC,MAAM,CAAwC;IAEtD,IAAW,gBAAgB,0BAE1B;IAED;;;;;;;;OAQG;IACI,aAAa,CAAC,YAAY,EAAE,UAAU,GAAG,IAAI;IAIpD;;;;OAIG;IACH,OAAO,CAAC,MAAM;IAqBd;;;;OAIG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,mBAAmB,GAAG,SAAS;IAQlC;;;;OAIG;IACI,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS;IAS3E,OAAO,CAAC,yBAAyB;IAmFjC,gGAAgG;IACzF,QAAQ;IAOf;;;;;OAKG;IACI,KAAK,kBAAmB,MAAM,2CAkBnC;IAEF,OAAO,CAAC,oBAAoB;IAU5B;;;;;;;;OAQG;IACI,IAAI,CACT,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,QAAQ,EAAE,wBAAwB,EAClC,mBAAmB,CAAC,EAAE,OAAO;CA2DhC"}
@@ -5,6 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module ChildWindowManager
7
7
  */
8
+ import "./InternalChildWindowManager.scss";
8
9
  import * as React from "react";
9
10
  import * as ReactDOM from "react-dom";
10
11
  import { Provider } from "react-redux";
@@ -17,7 +18,6 @@ import { PopupRenderer } from "../popup/PopupManager";
17
18
  import { ThemeManager } from "../theme/ThemeManager";
18
19
  import { UiStateStorageHandler } from "../uistate/useUiStateStorage";
19
20
  import { copyStyles } from "./CopyStyles";
20
- import "./InternalChildWindowManager.scss";
21
21
  import { usePopoutsStore } from "../preview/reparent-popout-widgets/usePopoutsStore";
22
22
  const childHtml = `<!DOCTYPE html>
23
23
  <html>
@@ -157,8 +157,8 @@ export class InternalChildWindowManager {
157
157
  React.createElement(CursorPopupMenu, null),
158
158
  React.createElement("div", { className: "uifw-child-window-container nz-widget-widget" }, content)),
159
159
  React.createElement("div", { className: "uifw-childwindow-internalChildWindowManager_portalContainer" }))))));
160
- setTimeout(() => {
161
- copyStyles(childWindow.document);
160
+ setTimeout(async () => {
161
+ await copyStyles(childWindow.document);
162
162
  setTimeout(() => {
163
163
  this.render(element, reactConnectionDiv);
164
164
  if (childWindow.expectedHeight && childWindow.expectedWidth) {
@@ -1 +1 @@
1
- {"version":3,"file":"InternalChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAMzE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,q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,CAAC;QAC3C,WAAW,CAAC,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC;QACzC,WAAW,CAAC,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC;QAEvC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI,CAAC,yBAAyB,CAC5B,WAAW,EACX,aAAa,EACb,OAAO,EACP,KAAK,CACN,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,WAAW,CAAC,gBAAgB,CAC1B,kBAAkB,EAClB,GAAG,EAAE;gBACH,IAAI,CAAC,yBAAyB,CAC5B,WAAW,EACX,aAAa,EACb,OAAO,EACP,KAAK,CACN,CAAC;YACJ,CAAC,EACD,KAAK,CACN,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EACR,GAAG,EAAE;YACH,MAAM,aAAa,GAAG,WAAW,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","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
+ {"version":3,"file":"InternalChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/InternalChildWindowManager.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAMzE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAGrF,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;QAqBV,CAAC;AAST;;;;KAIK;AACL,MAAM,OAAO,0BAA0B;IAAvC;QACU,sBAAiB,GAA0B,EAAE,CAAC;QAE9C,WAAM,GAAqC,EAAE,CAAC;QAqKtD;;;;;WAKG;QACI,UAAK,GAAG,CAAC,aAAqB,EAAE,kBAA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,EAClB,GAAG,EAAE;gBACH,IAAI,CAAC,yBAAyB,CAC5B,WAAW,EACX,aAAa,EACb,OAAO,EACP,KAAK,CACN,CAAC;YACJ,CAAC,EACD,KAAK,CACN,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,gBAAgB,CACrB,QAAQ,EACR,GAAG,EAAE;YACH,MAAM,aAAa,GAAG,WAAW,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","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 \"./InternalChildWindowManager.scss\";\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 { 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(async () => {\n await 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/appui-react",
3
- "version": "4.16.3",
3
+ "version": "4.16.4",
4
4
  "description": "UI framework",
5
5
  "main": "lib/cjs/appui-react.js",
6
6
  "module": "lib/esm/appui-react.js",
@@ -23,15 +23,15 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@itwin/appui-abstract": "^3.7.0 || ^4.0.0",
26
- "@itwin/components-react": "^4.16.3",
26
+ "@itwin/components-react": "^4.16.4",
27
27
  "@itwin/core-bentley": "^3.7.0 || ^4.0.0",
28
28
  "@itwin/core-common": "^3.7.0 || ^4.0.0",
29
29
  "@itwin/core-frontend": "^3.7.0 || ^4.0.0",
30
30
  "@itwin/core-geometry": "^3.7.0 || ^4.0.0",
31
31
  "@itwin/core-quantity": "^3.7.0 || ^4.0.0",
32
- "@itwin/core-react": "^4.16.3",
32
+ "@itwin/core-react": "^4.16.4",
33
33
  "@itwin/core-telemetry": "^3.7.0 || ^4.0.0",
34
- "@itwin/imodel-components-react": "^4.16.3",
34
+ "@itwin/imodel-components-react": "^4.16.4",
35
35
  "react": "^17.0.0 || ^18.0.0",
36
36
  "react-dom": "^17.0.0 || ^18.0.0",
37
37
  "react-redux": "^7.2.2",
@@ -85,9 +85,9 @@
85
85
  "typescript": "~5.3.3",
86
86
  "upath": "^2.0.1",
87
87
  "vitest": "^1.6.0",
88
- "@itwin/components-react": "4.16.3",
89
- "@itwin/core-react": "4.16.3",
90
- "@itwin/imodel-components-react": "4.16.3"
88
+ "@itwin/components-react": "4.16.4",
89
+ "@itwin/core-react": "4.16.4",
90
+ "@itwin/imodel-components-react": "4.16.4"
91
91
  },
92
92
  "//dependencies": [
93
93
  "NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",