@itwin/appui-react 3.2.0-dev.1 → 3.2.0-dev.14

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 (32) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/lib/cjs/appui-react/UiFramework.d.ts +4 -2
  3. package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
  4. package/lib/cjs/appui-react/UiFramework.js +7 -3
  5. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  6. package/lib/cjs/appui-react/childwindow/ChildWindowManager.js +1 -1
  7. package/lib/cjs/appui-react/childwindow/ChildWindowManager.js.map +1 -1
  8. package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  9. package/lib/cjs/appui-react/frontstage/FrontstageDef.js +1 -2
  10. package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
  11. package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.js +1 -1
  12. package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
  13. package/lib/cjs/appui-react/theme/ThemeManager.js +1 -1
  14. package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
  15. package/lib/cjs/appui-react/toolbar/Toolbar.js +1 -1
  16. package/lib/cjs/appui-react/toolbar/Toolbar.js.map +1 -1
  17. package/lib/esm/appui-react/UiFramework.d.ts +4 -2
  18. package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
  19. package/lib/esm/appui-react/UiFramework.js +7 -3
  20. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  21. package/lib/esm/appui-react/childwindow/ChildWindowManager.js +1 -1
  22. package/lib/esm/appui-react/childwindow/ChildWindowManager.js.map +1 -1
  23. package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
  24. package/lib/esm/appui-react/frontstage/FrontstageDef.js +1 -2
  25. package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
  26. package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.js +1 -1
  27. package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
  28. package/lib/esm/appui-react/theme/ThemeManager.js +1 -1
  29. package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
  30. package/lib/esm/appui-react/toolbar/Toolbar.js +1 -1
  31. package/lib/esm/appui-react/toolbar/Toolbar.js.map +1 -1
  32. package/package.json +32 -32
@@ -62,18 +62,20 @@ export class UiFramework {
62
62
  * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore.
63
63
  * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.
64
64
  * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined "frameworkState" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use "frameworkState".
65
+ * @param startInUi1Mode Used for legacy applications to start up in the deprecated UI 1 mode. This should not set by newer applications.
65
66
  */
66
- static async initialize(store, frameworkStateKey) {
67
- return this.initializeEx(store, frameworkStateKey);
67
+ static async initialize(store, frameworkStateKey, startInUi1Mode) {
68
+ return this.initializeEx(store, frameworkStateKey, startInUi1Mode);
68
69
  }
69
70
  /**
70
71
  * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore.
71
72
  * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.
72
73
  * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined "frameworkState" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use "frameworkState".
74
+ * @param startInUi1Mode Used for legacy applications to start up in the deprecated UI 1 mode. This should not set by newer applications.
73
75
  *
74
76
  * @internal
75
77
  */
76
- static async initializeEx(store, frameworkStateKey) {
78
+ static async initializeEx(store, frameworkStateKey, startInUi1Mode) {
77
79
  var _a;
78
80
  if (UiFramework._initialized) {
79
81
  Logger.logInfo(UiFramework.loggerCategory(UiFramework), `UiFramework.initialize already called`);
@@ -87,6 +89,8 @@ export class UiFramework {
87
89
  // ignore setting _frameworkStateKeyInStore if not using store
88
90
  if (frameworkStateKey && store)
89
91
  UiFramework._frameworkStateKeyInStore = frameworkStateKey;
92
+ if (startInUi1Mode)
93
+ UiFramework.store.dispatch({ type: ConfigurableUiActionId.SetFrameworkVersion, payload: "1" });
90
94
  // set up namespace and register all tools from package
91
95
  const frameworkNamespace = (_a = IModelApp.localization) === null || _a === void 0 ? void 0 : _a.registerNamespace(UiFramework.localizationNamespace);
92
96
  [
@@ -1 +1 @@
1
- {"version":3,"file":"UiFramework.js","sourceRoot":"","sources":["../../../src/appui-react/UiFramework.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAc,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAoB,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAA8C,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD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qCAAyB,GAAW,gBAAgB,CAAC,CAAE,eAAe;AAGtE,sBAAU,GAAuB,GAAG,CAAC;AAEpD,oDAAoD;AACrC,2BAAe,GAAmB,IAAI,iBAAiB,EAAE,CAAC;AAE1D,uCAA2B,GAAsC,IAAI,GAAG,EAAgC,CAAC;AACzG,+BAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAChD,+BAAmB,GAAG,KAAK,CAAC;AAoB1C;;GAEG;AACoB,iCAAqB,GAAG,IAAI,wBAAwB,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n// cSpell:ignore configurableui clientservices\r\n\r\nimport { Store } from \"redux\";\r\nimport { GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport { Localization, RpcActivity } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelConnection, SnapMode, ViewState } from \"@itwin/core-frontend\";\r\nimport { Presentation } from \"@itwin/presentation-frontend\";\r\nimport { TelemetryEvent } from \"@itwin/core-telemetry\";\r\nimport { getClassName, UiAdmin, UiError, UiEvent } from \"@itwin/appui-abstract\";\r\nimport { LocalStateStorage, SettingsManager, UiStateStorage } from \"@itwin/core-react\";\r\nimport { UiIModelComponents } from \"@itwin/imodel-components-react\";\r\nimport { BackstageManager } from \"./backstage/BackstageManager\";\r\nimport { ChildWindowManager } from \"./childwindow/ChildWindowManager\";\r\nimport { ConfigurableUiManager } from \"./configurableui/ConfigurableUiManager\";\r\nimport { ConfigurableUiActionId } from \"./configurableui/state\";\r\nimport { FrameworkState } from \"./redux/FrameworkState\";\r\nimport { CursorMenuData, PresentationSelectionScope, SessionStateActionId } from \"./redux/SessionState\";\r\nimport { StateManager } from \"./redux/StateManager\";\r\nimport { HideIsolateEmphasizeActionHandler, HideIsolateEmphasizeManager } from \"./selection/HideIsolateEmphasizeManager\";\r\nimport { SyncUiEventDispatcher, SyncUiEventId } from \"./syncui/SyncUiEventDispatcher\";\r\nimport { SYSTEM_PREFERRED_COLOR_THEME, WIDGET_OPACITY_DEFAULT } from \"./theme/ThemeManager\";\r\nimport * as keyinPaletteTools from \"./tools/KeyinPaletteTools\";\r\nimport * as openSettingTools from \"./tools/OpenSettingsTool\";\r\nimport * as restoreLayoutTools from \"./tools/RestoreLayoutTool\";\r\nimport * as toolSettingTools from \"./tools/ToolSettingsTools\";\r\nimport { UiShowHideManager, UiShowHideSettingsProvider } from \"./utils/UiShowHideManager\";\r\nimport { WidgetManager } from \"./widgets/WidgetManager\";\r\nimport { FrontstageManager } from \"./frontstage/FrontstageManager\";\r\n\r\n// cSpell:ignore Mobi\r\n\r\n/** Defined that available UI Versions. It is recommended to always use the latest version available.\r\n * @public\r\n */\r\nexport type FrameworkVersionId = \"1\" | \"2\";\r\n\r\n/** Interface to be implemented but any classes that wants to load their user settings when the UiStateEntry storage class is set.\r\n * @public\r\n */\r\nexport interface UserSettingsProvider {\r\n /** Unique provider Id */\r\n providerId: string;\r\n /** Function to load settings from settings storage */\r\n loadUserSettings(storage: UiStateStorage): Promise<void>;\r\n}\r\n\r\n/** UiVisibility Event Args interface.\r\n * @public\r\n */\r\nexport interface UiVisibilityEventArgs {\r\n visible: boolean;\r\n}\r\n\r\n/** UiVisibility Event class.\r\n * @public\r\n */\r\nexport class UiVisibilityChangedEvent extends UiEvent<UiVisibilityEventArgs> { }\r\n\r\n/** FrameworkVersion Changed Event Args interface.\r\n * @internal\r\n */\r\nexport interface FrameworkVersionChangedEventArgs {\r\n oldVersion: FrameworkVersionId;\r\n version: FrameworkVersionId;\r\n}\r\n\r\n/** FrameworkVersion Changed Event class.\r\n * @internal\r\n */\r\nexport class FrameworkVersionChangedEvent extends UiEvent<FrameworkVersionChangedEventArgs> { }\r\n\r\n/** TrackingTime time argument used by our feature tracking manager as an option argument to the TelemetryClient\r\n * @internal\r\n */\r\nexport interface TrackingTime {\r\n startTime: Date;\r\n endTime: Date;\r\n}\r\n\r\n/**\r\n * Manages the Redux store, localization service and iModel, Project and Login services for the ui-framework package.\r\n * @public\r\n */\r\nexport class UiFramework {\r\n private static _initialized = false;\r\n private static _store?: Store<any>;\r\n private static _complaint = \"UiFramework not initialized\";\r\n private static _frameworkStateKeyInStore: string = \"frameworkState\"; // default name\r\n private static _backstageManager?: BackstageManager;\r\n private static _widgetManager?: WidgetManager;\r\n private static _uiVersion: FrameworkVersionId = \"2\";\r\n private static _hideIsolateEmphasizeActionHandler?: HideIsolateEmphasizeActionHandler;\r\n /** this provides a default state storage handler */\r\n private static _uiStateStorage: UiStateStorage = new LocalStateStorage();\r\n private static _settingsManager?: SettingsManager;\r\n private static _uiSettingsProviderRegistry: Map<string, UserSettingsProvider> = new Map<string, UserSettingsProvider>();\r\n private static _PopupWindowManager = new ChildWindowManager();\r\n public static useDefaultPopoutUrl = false;\r\n\r\n /** @public */\r\n public static get childWindowManager(): ChildWindowManager {\r\n return UiFramework._PopupWindowManager;\r\n }\r\n\r\n /** Registers class that will be informed when the UserSettingsStorage location has been set or changed. This allows\r\n * classes to load any previously saved settings from the new storage location. Common storage locations are the browser's\r\n * local storage, or the iTwin Product Settings cloud storage available via the SettingsAdmin see `IModelApp.settingsAdmin`.\r\n * @beta\r\n */\r\n public static registerUserSettingsProvider(entry: UserSettingsProvider) {\r\n if (this._uiSettingsProviderRegistry.has(entry.providerId))\r\n return false;\r\n\r\n this._uiSettingsProviderRegistry.set(entry.providerId, entry);\r\n return true;\r\n }\r\n\r\n /** Get Show Ui event.\r\n * @public\r\n */\r\n public static readonly onUiVisibilityChanged = new UiVisibilityChangedEvent();\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n */\r\n public static async initialize(store: Store<any> | undefined, frameworkStateKey?: string): Promise<void> {\r\n return this.initializeEx(store, frameworkStateKey);\r\n }\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n *\r\n * @internal\r\n */\r\n public static async initializeEx(store: Store<any> | undefined, frameworkStateKey?: string): Promise<void> {\r\n if (UiFramework._initialized) {\r\n Logger.logInfo(UiFramework.loggerCategory(UiFramework), `UiFramework.initialize already called`);\r\n return;\r\n }\r\n\r\n /* if store is undefined then the StateManager class should have been initialized by parent app and the apps default set of reducers registered with it.\r\n If the app has no reducers to add and does not initialize a StateManager then just initialize the StateManager with the default framework reducer now */\r\n if (undefined === store && !StateManager.isInitialized(true))\r\n new StateManager();\r\n\r\n UiFramework._store = store;\r\n // ignore setting _frameworkStateKeyInStore if not using store\r\n if (frameworkStateKey && store)\r\n UiFramework._frameworkStateKeyInStore = frameworkStateKey;\r\n\r\n // set up namespace and register all tools from package\r\n const frameworkNamespace = IModelApp.localization?.registerNamespace(UiFramework.localizationNamespace);\r\n [\r\n restoreLayoutTools,\r\n keyinPaletteTools,\r\n openSettingTools,\r\n toolSettingTools,\r\n ].forEach((tool) => IModelApp.tools.registerModule(tool, this.localizationNamespace));\r\n\r\n UiFramework._backstageManager = new BackstageManager();\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager(); // this allows user to override the default HideIsolateEmphasizeManager implementation.\r\n UiFramework._widgetManager = new WidgetManager();\r\n\r\n // Initialize ui-imodel-components, ui-components, ui-core & ui-abstract\r\n await UiIModelComponents.initialize();\r\n\r\n UiFramework.settingsManager.onSettingsProvidersChanged.addListener(() => {\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.SettingsProvidersChanged);\r\n });\r\n\r\n // Initialize the MessagePresenter interface in UiAdmin for Editor notifications\r\n UiAdmin.messagePresenter = IModelApp.notifications;\r\n\r\n UiFramework._initialized = true;\r\n\r\n // initialize any standalone settings providers that don't need to have defaults set by iModelApp\r\n UiShowHideSettingsProvider.initialize();\r\n\r\n ConfigurableUiManager.initialize();\r\n\r\n return frameworkNamespace;\r\n }\r\n\r\n /** Un-registers the UiFramework internationalization service namespace */\r\n public static terminate() {\r\n UiFramework._store = undefined;\r\n UiFramework._frameworkStateKeyInStore = \"frameworkState\";\r\n if (StateManager.isInitialized(true))\r\n StateManager.clearStore();\r\n // istanbul ignore next\r\n IModelApp.localization?.unregisterNamespace(UiFramework.localizationNamespace);\r\n UiFramework._backstageManager = undefined;\r\n UiFramework._widgetManager = undefined;\r\n UiFramework._hideIsolateEmphasizeActionHandler = undefined;\r\n UiFramework._settingsManager = undefined;\r\n\r\n UiIModelComponents.terminate();\r\n UiShowHideManager.terminate();\r\n UiFramework._initialized = false;\r\n }\r\n\r\n /** Determines if UiFramework has been initialized */\r\n public static get initialized(): boolean { return UiFramework._initialized; }\r\n\r\n /** Property that returns the SettingManager used by AppUI-based applications.\r\n * @public\r\n */\r\n public static get settingsManager() {\r\n if (undefined === UiFramework._settingsManager)\r\n UiFramework._settingsManager = new SettingsManager();\r\n return UiFramework._settingsManager;\r\n }\r\n\r\n /** @public */\r\n public static get frameworkStateKey(): string {\r\n return UiFramework._frameworkStateKeyInStore;\r\n }\r\n\r\n /** The UiFramework state maintained by Redux\r\n * @public\r\n */\r\n public static get frameworkState(): FrameworkState | undefined {\r\n try {\r\n // eslint-disable-next-line dot-notation\r\n return UiFramework.store.getState()[UiFramework.frameworkStateKey];\r\n } catch (_e) {\r\n return undefined;\r\n }\r\n }\r\n\r\n /** The Redux store */\r\n public static get store(): Store<any> {\r\n if (UiFramework._store)\r\n return UiFramework._store;\r\n\r\n // istanbul ignore else\r\n if (!StateManager.isInitialized(true))\r\n throw new UiError(UiFramework.loggerCategory(this), `Error trying to access redux store before either store or StateManager has been initialized.`);\r\n\r\n // istanbul ignore next\r\n return StateManager.store;\r\n }\r\n\r\n /** The internationalization service created by the app.\r\n * @internal\r\n */\r\n public static get localization(): Localization {\r\n // istanbul ignore next\r\n if (!IModelApp.localization)\r\n throw new UiError(UiFramework.loggerCategory(this), `IModelApp.localization has not been defined.`);\r\n return IModelApp.localization;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiFramework\";\r\n }\r\n\r\n /** @public */\r\n public static get backstageManager(): BackstageManager {\r\n // istanbul ignore next\r\n if (!UiFramework._backstageManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._backstageManager;\r\n }\r\n\r\n /** @alpha */\r\n public static get hideIsolateEmphasizeActionHandler(): HideIsolateEmphasizeActionHandler {\r\n // istanbul ignore next\r\n if (!UiFramework._hideIsolateEmphasizeActionHandler)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._hideIsolateEmphasizeActionHandler;\r\n }\r\n\r\n /** @alpha */\r\n public static setHideIsolateEmphasizeActionHandler(handler: HideIsolateEmphasizeActionHandler | undefined) {\r\n // istanbul ignore else\r\n if (handler)\r\n UiFramework._hideIsolateEmphasizeActionHandler = handler;\r\n else\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager();\r\n }\r\n\r\n /** @alpha */\r\n public static get widgetManager(): WidgetManager {\r\n // istanbul ignore next\r\n if (!UiFramework._widgetManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._widgetManager;\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiFramework\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n return IModelApp.localization.getLocalizedStringWithNamespace(UiFramework.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"appui-react\";\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiFramework.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n public static dispatchActionToStore(type: string, payload: any, immediateSync = false) {\r\n UiFramework.store.dispatch({ type, payload });\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(type);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(type);\r\n }\r\n\r\n public static setAccudrawSnapMode(snapMode: SnapMode) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetSnapMode, snapMode, true);\r\n }\r\n\r\n public static getAccudrawSnapMode(): SnapMode {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.snapMode : /* istanbul ignore next */ SnapMode.NearestKeypoint;\r\n }\r\n\r\n public static getActiveSelectionScope(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.activeSelectionScope : /* istanbul ignore next */ \"element\";\r\n }\r\n\r\n public static setActiveSelectionScope(selectionScopeId: string): void {\r\n // istanbul ignore else\r\n if (UiFramework.frameworkState) {\r\n const foundIndex = UiFramework.frameworkState.sessionState.availableSelectionScopes.findIndex((selectionScope: PresentationSelectionScope) => selectionScope.id === selectionScopeId);\r\n if (-1 !== foundIndex) {\r\n const scope = UiFramework.frameworkState.sessionState.availableSelectionScopes[foundIndex];\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetSelectionScope, scope.id);\r\n Presentation.selection.scopes.activeScope = scope.id;\r\n }\r\n }\r\n }\r\n\r\n /** @public */\r\n public static openCursorMenu(menuData: CursorMenuData | undefined): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, menuData);\r\n }\r\n\r\n /** @public */\r\n public static closeCursorMenu(): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, undefined);\r\n }\r\n\r\n /** @public */\r\n public static getCursorMenuData(): CursorMenuData | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.cursorMenuData : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static getActiveIModelId(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelId : /* istanbul ignore next */ \"\";\r\n }\r\n\r\n public static setActiveIModelId(iModelId: string): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetActiveIModelId, iModelId);\r\n }\r\n\r\n public static setIModelConnection(iModelConnection: IModelConnection | undefined, immediateSync = false) {\r\n const oldConnection = UiFramework.getIModelConnection();\r\n if (oldConnection !== iModelConnection) {\r\n if (oldConnection?.iModelId)\r\n FrontstageManager.clearFrontstageDefsForIModelId(oldConnection.iModelId);\r\n oldConnection && undefined === iModelConnection && SyncUiEventDispatcher.clearConnectionEvents(oldConnection);\r\n iModelConnection && SyncUiEventDispatcher.initializeConnectionEvents(iModelConnection);\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetIModelConnection, iModelConnection, immediateSync);\r\n }\r\n UiFramework.setActiveIModelId(iModelConnection?.iModelId ?? \"\");\r\n }\r\n\r\n public static getIModelConnection(): IModelConnection | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelConnection : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** Called by iModelApp to initialize saved UI state from registered UseSettingsProviders\r\n * @public\r\n */\r\n public static async initializeStateFromUserSettingsProviders(immediateSync = false) {\r\n // let any registered providers to load values from the new storage location\r\n const providerKeys = [...this._uiSettingsProviderRegistry.keys()];\r\n for await (const key of providerKeys) {\r\n await this._uiSettingsProviderRegistry.get(key)!.loadUserSettings(UiFramework._uiStateStorage);\r\n }\r\n\r\n // istanbul ignore next\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(SyncUiEventId.UiStateStorageChanged);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.UiStateStorageChanged);\r\n }\r\n\r\n /** @public */\r\n public static async setUiStateStorage(storage: UiStateStorage, immediateSync = false) {\r\n if (UiFramework._uiStateStorage === storage)\r\n return;\r\n\r\n UiFramework._uiStateStorage = storage;\r\n await this.initializeStateFromUserSettingsProviders(immediateSync);\r\n }\r\n\r\n /** The UI Settings Storage is a convenient wrapper around Local Storage to assist in caching state information across user sessions.\r\n * It was previously used to conflate both the state information across session and the information driven directly from user explicit action,\r\n * which are now handled with user preferences.\r\n * @public\r\n */\r\n public static getUiStateStorage(): UiStateStorage {\r\n return UiFramework._uiStateStorage;\r\n }\r\n\r\n public static setDefaultIModelViewportControlId(iModelViewportControlId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultIModelViewportControlId, iModelViewportControlId, immediateSync);\r\n }\r\n\r\n public static getDefaultIModelViewportControlId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultIModelViewportControlId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewId(viewId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewId, viewId, immediateSync);\r\n }\r\n\r\n public static getDefaultViewId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewState(viewState: ViewState, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewState, viewState, immediateSync);\r\n }\r\n public static getDefaultViewState(): ViewState | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewState : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** @public */\r\n public static getAvailableSelectionScopes(): PresentationSelectionScope[] {\r\n return UiFramework.frameworkState ?\r\n UiFramework.frameworkState.sessionState.availableSelectionScopes :\r\n /* istanbul ignore next */\r\n [{ id: \"element\", label: \"Element\" } as PresentationSelectionScope];\r\n }\r\n\r\n public static getIsUiVisible() {\r\n return UiShowHideManager.isUiVisible;\r\n }\r\n\r\n public static setIsUiVisible(visible: boolean) {\r\n if (UiShowHideManager.isUiVisible !== visible) {\r\n UiShowHideManager.isUiVisible = visible;\r\n UiFramework.onUiVisibilityChanged.emit({ visible });\r\n }\r\n }\r\n\r\n public static setColorTheme(theme: string) {\r\n if (UiFramework.getColorTheme() === theme)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetTheme, theme, true);\r\n }\r\n\r\n public static getColorTheme(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.theme : /* istanbul ignore next */ SYSTEM_PREFERRED_COLOR_THEME;\r\n }\r\n\r\n public static setWidgetOpacity(opacity: number) {\r\n if (UiFramework.getWidgetOpacity() === opacity)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetWidgetOpacity, opacity, true);\r\n }\r\n\r\n public static getWidgetOpacity(): number {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.widgetOpacity : /* istanbul ignore next */ WIDGET_OPACITY_DEFAULT;\r\n }\r\n\r\n public static isMobile() { // eslint-disable-line @itwin/prefer-get\r\n return ProcessDetector.isMobileBrowser;\r\n }\r\n\r\n /** Returns the Ui Version.\r\n * @public\r\n */\r\n public static get uiVersion(): FrameworkVersionId {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.frameworkVersion : this._uiVersion;\r\n }\r\n\r\n public static setUiVersion(version: FrameworkVersionId) {\r\n if (UiFramework.uiVersion === version)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetFrameworkVersion, version === \"1\" ? \"1\" : \"2\", true);\r\n }\r\n\r\n public static get showWidgetIcon(): boolean {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.showWidgetIcon : /* istanbul ignore next */ false;\r\n }\r\n\r\n public static setShowWidgetIcon(value: boolean) {\r\n if (UiFramework.showWidgetIcon === value)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetShowWidgetIcon, value, true);\r\n }\r\n\r\n public static get useDragInteraction(): boolean {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.useDragInteraction : false;\r\n }\r\n\r\n public static setUseDragInteraction(useDragInteraction: boolean) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetDragInteraction, useDragInteraction, true);\r\n }\r\n\r\n /** Returns the variable controlling whether the overlay is displayed in a Viewport\r\n * @public\r\n */\r\n public static get viewOverlayDisplay() {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.viewOverlayDisplay : /* istanbul ignore next */ true;\r\n }\r\n /** Set the variable that controls display of the view overlay. Applies to all viewports in the app\r\n * @public\r\n */\r\n public static setViewOverlayDisplay(display: boolean) {\r\n if (UiFramework.viewOverlayDisplay === display)\r\n return;\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetViewOverlayDisplay, display);\r\n }\r\n /** Send logging message to the telemetry system\r\n * @internal\r\n */\r\n // istanbul ignore next\r\n public static async postTelemetry(eventName: string, eventId?: GuidString, iTwinId?: GuidString, iModeId?: GuidString, changeSetId?: string, time?: TrackingTime, additionalProperties?: { [key: string]: any }): Promise<void> {\r\n if (!IModelApp.authorizationClient)\r\n return;\r\n\r\n try {\r\n const activity: RpcActivity = {\r\n sessionId: IModelApp.sessionId,\r\n activityId: \"\",\r\n applicationId: IModelApp.applicationId,\r\n applicationVersion: IModelApp.applicationVersion,\r\n accessToken: (await IModelApp.authorizationClient.getAccessToken()) ?? \"\",\r\n };\r\n const telemetryEvent = new TelemetryEvent(eventName, eventId, iTwinId, iModeId, changeSetId, time, additionalProperties);\r\n await IModelApp.telemetry.postTelemetry(activity, telemetryEvent);\r\n } catch { }\r\n }\r\n /** Determines whether a ContextMenu is open\r\n * @alpha\r\n * */\r\n public static get isContextMenuOpen(): boolean {\r\n const contextMenu = document.querySelector(\"div.core-context-menu-opened\");\r\n return contextMenu !== null && contextMenu !== undefined;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"UiFramework.js","sourceRoot":"","sources":["../../../src/appui-react/UiFramework.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAc,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAoB,QAAQ,EAAa,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,OAAO,EAA8C,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAqC,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACzH,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,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U,GAAG,6BAA6B,CAAC;AAC3C,qCAAyB,GAAW,gBAAgB,CAAC,CAAE,eAAe;AAGtE,sBAAU,GAAuB,GAAG,CAAC;AAEpD,oDAAoD;AACrC,2BAAe,GAAmB,IAAI,iBAAiB,EAAE,CAAC;AAE1D,uCAA2B,GAAsC,IAAI,GAAG,EAAgC,CAAC;AACzG,+BAAmB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAChD,+BAAmB,GAAG,KAAK,CAAC;AAoB1C;;GAEG;AACoB,iCAAqB,GAAG,IAAI,wBAAwB,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Utilities\r\n */\r\n\r\n// cSpell:ignore configurableui clientservices\r\n\r\nimport { Store } from \"redux\";\r\nimport { GuidString, Logger, ProcessDetector } from \"@itwin/core-bentley\";\r\nimport { Localization, RpcActivity } from \"@itwin/core-common\";\r\nimport { IModelApp, IModelConnection, SnapMode, ViewState } from \"@itwin/core-frontend\";\r\nimport { Presentation } from \"@itwin/presentation-frontend\";\r\nimport { TelemetryEvent } from \"@itwin/core-telemetry\";\r\nimport { getClassName, UiAdmin, UiError, UiEvent } from \"@itwin/appui-abstract\";\r\nimport { LocalStateStorage, SettingsManager, UiStateStorage } from \"@itwin/core-react\";\r\nimport { UiIModelComponents } from \"@itwin/imodel-components-react\";\r\nimport { BackstageManager } from \"./backstage/BackstageManager\";\r\nimport { ChildWindowManager } from \"./childwindow/ChildWindowManager\";\r\nimport { ConfigurableUiManager } from \"./configurableui/ConfigurableUiManager\";\r\nimport { ConfigurableUiActionId } from \"./configurableui/state\";\r\nimport { FrameworkState } from \"./redux/FrameworkState\";\r\nimport { CursorMenuData, PresentationSelectionScope, SessionStateActionId } from \"./redux/SessionState\";\r\nimport { StateManager } from \"./redux/StateManager\";\r\nimport { HideIsolateEmphasizeActionHandler, HideIsolateEmphasizeManager } from \"./selection/HideIsolateEmphasizeManager\";\r\nimport { SyncUiEventDispatcher, SyncUiEventId } from \"./syncui/SyncUiEventDispatcher\";\r\nimport { SYSTEM_PREFERRED_COLOR_THEME, WIDGET_OPACITY_DEFAULT } from \"./theme/ThemeManager\";\r\nimport * as keyinPaletteTools from \"./tools/KeyinPaletteTools\";\r\nimport * as openSettingTools from \"./tools/OpenSettingsTool\";\r\nimport * as restoreLayoutTools from \"./tools/RestoreLayoutTool\";\r\nimport * as toolSettingTools from \"./tools/ToolSettingsTools\";\r\nimport { UiShowHideManager, UiShowHideSettingsProvider } from \"./utils/UiShowHideManager\";\r\nimport { WidgetManager } from \"./widgets/WidgetManager\";\r\nimport { FrontstageManager } from \"./frontstage/FrontstageManager\";\r\n\r\n// cSpell:ignore Mobi\r\n\r\n/** Defined that available UI Versions. It is recommended to always use the latest version available.\r\n * @public\r\n */\r\nexport type FrameworkVersionId = \"1\" | \"2\";\r\n\r\n/** Interface to be implemented but any classes that wants to load their user settings when the UiStateEntry storage class is set.\r\n * @public\r\n */\r\nexport interface UserSettingsProvider {\r\n /** Unique provider Id */\r\n providerId: string;\r\n /** Function to load settings from settings storage */\r\n loadUserSettings(storage: UiStateStorage): Promise<void>;\r\n}\r\n\r\n/** UiVisibility Event Args interface.\r\n * @public\r\n */\r\nexport interface UiVisibilityEventArgs {\r\n visible: boolean;\r\n}\r\n\r\n/** UiVisibility Event class.\r\n * @public\r\n */\r\nexport class UiVisibilityChangedEvent extends UiEvent<UiVisibilityEventArgs> { }\r\n\r\n/** FrameworkVersion Changed Event Args interface.\r\n * @internal\r\n */\r\nexport interface FrameworkVersionChangedEventArgs {\r\n oldVersion: FrameworkVersionId;\r\n version: FrameworkVersionId;\r\n}\r\n\r\n/** FrameworkVersion Changed Event class.\r\n * @internal\r\n */\r\nexport class FrameworkVersionChangedEvent extends UiEvent<FrameworkVersionChangedEventArgs> { }\r\n\r\n/** TrackingTime time argument used by our feature tracking manager as an option argument to the TelemetryClient\r\n * @internal\r\n */\r\nexport interface TrackingTime {\r\n startTime: Date;\r\n endTime: Date;\r\n}\r\n\r\n/**\r\n * Manages the Redux store, localization service and iModel, Project and Login services for the ui-framework package.\r\n * @public\r\n */\r\nexport class UiFramework {\r\n private static _initialized = false;\r\n private static _store?: Store<any>;\r\n private static _complaint = \"UiFramework not initialized\";\r\n private static _frameworkStateKeyInStore: string = \"frameworkState\"; // default name\r\n private static _backstageManager?: BackstageManager;\r\n private static _widgetManager?: WidgetManager;\r\n private static _uiVersion: FrameworkVersionId = \"2\";\r\n private static _hideIsolateEmphasizeActionHandler?: HideIsolateEmphasizeActionHandler;\r\n /** this provides a default state storage handler */\r\n private static _uiStateStorage: UiStateStorage = new LocalStateStorage();\r\n private static _settingsManager?: SettingsManager;\r\n private static _uiSettingsProviderRegistry: Map<string, UserSettingsProvider> = new Map<string, UserSettingsProvider>();\r\n private static _PopupWindowManager = new ChildWindowManager();\r\n public static useDefaultPopoutUrl = false;\r\n\r\n /** @public */\r\n public static get childWindowManager(): ChildWindowManager {\r\n return UiFramework._PopupWindowManager;\r\n }\r\n\r\n /** Registers class that will be informed when the UserSettingsStorage location has been set or changed. This allows\r\n * classes to load any previously saved settings from the new storage location. Common storage locations are the browser's\r\n * local storage, or the iTwin Product Settings cloud storage available via the SettingsAdmin see `IModelApp.settingsAdmin`.\r\n * @beta\r\n */\r\n public static registerUserSettingsProvider(entry: UserSettingsProvider) {\r\n if (this._uiSettingsProviderRegistry.has(entry.providerId))\r\n return false;\r\n\r\n this._uiSettingsProviderRegistry.set(entry.providerId, entry);\r\n return true;\r\n }\r\n\r\n /** Get Show Ui event.\r\n * @public\r\n */\r\n public static readonly onUiVisibilityChanged = new UiVisibilityChangedEvent();\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n * @param startInUi1Mode Used for legacy applications to start up in the deprecated UI 1 mode. This should not set by newer applications.\r\n */\r\n public static async initialize(store: Store<any> | undefined, frameworkStateKey?: string, startInUi1Mode?: boolean): Promise<void> {\r\n return this.initializeEx(store, frameworkStateKey, startInUi1Mode);\r\n }\r\n\r\n /**\r\n * Called by the application to initialize the UiFramework. Also initializes UIIModelComponents, UiComponents, UiCore.\r\n * @param store The single Redux store created by the host application. If this is `undefined` then it is assumed that the [[StateManager]] is being used to provide the Redux store.\r\n * @param frameworkStateKey The name of the key used by the app when adding the UiFramework state into the Redux store. If not defined \"frameworkState\" is assumed. This value is ignored if [[StateManager]] is being used. The StateManager use \"frameworkState\".\r\n * @param startInUi1Mode Used for legacy applications to start up in the deprecated UI 1 mode. This should not set by newer applications.\r\n *\r\n * @internal\r\n */\r\n public static async initializeEx(store: Store<any> | undefined, frameworkStateKey?: string, startInUi1Mode?: boolean): Promise<void> {\r\n if (UiFramework._initialized) {\r\n Logger.logInfo(UiFramework.loggerCategory(UiFramework), `UiFramework.initialize already called`);\r\n return;\r\n }\r\n\r\n /* if store is undefined then the StateManager class should have been initialized by parent app and the apps default set of reducers registered with it.\r\n If the app has no reducers to add and does not initialize a StateManager then just initialize the StateManager with the default framework reducer now */\r\n if (undefined === store && !StateManager.isInitialized(true))\r\n new StateManager();\r\n\r\n UiFramework._store = store;\r\n // ignore setting _frameworkStateKeyInStore if not using store\r\n if (frameworkStateKey && store)\r\n UiFramework._frameworkStateKeyInStore = frameworkStateKey;\r\n\r\n if (startInUi1Mode)\r\n UiFramework.store.dispatch({ type: ConfigurableUiActionId.SetFrameworkVersion, payload: \"1\" });\r\n\r\n // set up namespace and register all tools from package\r\n const frameworkNamespace = IModelApp.localization?.registerNamespace(UiFramework.localizationNamespace);\r\n [\r\n restoreLayoutTools,\r\n keyinPaletteTools,\r\n openSettingTools,\r\n toolSettingTools,\r\n ].forEach((tool) => IModelApp.tools.registerModule(tool, this.localizationNamespace));\r\n\r\n UiFramework._backstageManager = new BackstageManager();\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager(); // this allows user to override the default HideIsolateEmphasizeManager implementation.\r\n UiFramework._widgetManager = new WidgetManager();\r\n\r\n // Initialize ui-imodel-components, ui-components, ui-core & ui-abstract\r\n await UiIModelComponents.initialize();\r\n\r\n UiFramework.settingsManager.onSettingsProvidersChanged.addListener(() => {\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.SettingsProvidersChanged);\r\n });\r\n\r\n // Initialize the MessagePresenter interface in UiAdmin for Editor notifications\r\n UiAdmin.messagePresenter = IModelApp.notifications;\r\n\r\n UiFramework._initialized = true;\r\n\r\n // initialize any standalone settings providers that don't need to have defaults set by iModelApp\r\n UiShowHideSettingsProvider.initialize();\r\n\r\n ConfigurableUiManager.initialize();\r\n\r\n return frameworkNamespace;\r\n }\r\n\r\n /** Un-registers the UiFramework internationalization service namespace */\r\n public static terminate() {\r\n UiFramework._store = undefined;\r\n UiFramework._frameworkStateKeyInStore = \"frameworkState\";\r\n if (StateManager.isInitialized(true))\r\n StateManager.clearStore();\r\n // istanbul ignore next\r\n IModelApp.localization?.unregisterNamespace(UiFramework.localizationNamespace);\r\n UiFramework._backstageManager = undefined;\r\n UiFramework._widgetManager = undefined;\r\n UiFramework._hideIsolateEmphasizeActionHandler = undefined;\r\n UiFramework._settingsManager = undefined;\r\n\r\n UiIModelComponents.terminate();\r\n UiShowHideManager.terminate();\r\n UiFramework._initialized = false;\r\n }\r\n\r\n /** Determines if UiFramework has been initialized */\r\n public static get initialized(): boolean { return UiFramework._initialized; }\r\n\r\n /** Property that returns the SettingManager used by AppUI-based applications.\r\n * @public\r\n */\r\n public static get settingsManager() {\r\n if (undefined === UiFramework._settingsManager)\r\n UiFramework._settingsManager = new SettingsManager();\r\n return UiFramework._settingsManager;\r\n }\r\n\r\n /** @public */\r\n public static get frameworkStateKey(): string {\r\n return UiFramework._frameworkStateKeyInStore;\r\n }\r\n\r\n /** The UiFramework state maintained by Redux\r\n * @public\r\n */\r\n public static get frameworkState(): FrameworkState | undefined {\r\n try {\r\n // eslint-disable-next-line dot-notation\r\n return UiFramework.store.getState()[UiFramework.frameworkStateKey];\r\n } catch (_e) {\r\n return undefined;\r\n }\r\n }\r\n\r\n /** The Redux store */\r\n public static get store(): Store<any> {\r\n if (UiFramework._store)\r\n return UiFramework._store;\r\n\r\n // istanbul ignore else\r\n if (!StateManager.isInitialized(true))\r\n throw new UiError(UiFramework.loggerCategory(this), `Error trying to access redux store before either store or StateManager has been initialized.`);\r\n\r\n // istanbul ignore next\r\n return StateManager.store;\r\n }\r\n\r\n /** The internationalization service created by the app.\r\n * @internal\r\n */\r\n public static get localization(): Localization {\r\n // istanbul ignore next\r\n if (!IModelApp.localization)\r\n throw new UiError(UiFramework.loggerCategory(this), `IModelApp.localization has not been defined.`);\r\n return IModelApp.localization;\r\n }\r\n\r\n /** The internationalization service namespace. */\r\n public static get localizationNamespace(): string {\r\n return \"UiFramework\";\r\n }\r\n\r\n /** @public */\r\n public static get backstageManager(): BackstageManager {\r\n // istanbul ignore next\r\n if (!UiFramework._backstageManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._backstageManager;\r\n }\r\n\r\n /** @alpha */\r\n public static get hideIsolateEmphasizeActionHandler(): HideIsolateEmphasizeActionHandler {\r\n // istanbul ignore next\r\n if (!UiFramework._hideIsolateEmphasizeActionHandler)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._hideIsolateEmphasizeActionHandler;\r\n }\r\n\r\n /** @alpha */\r\n public static setHideIsolateEmphasizeActionHandler(handler: HideIsolateEmphasizeActionHandler | undefined) {\r\n // istanbul ignore else\r\n if (handler)\r\n UiFramework._hideIsolateEmphasizeActionHandler = handler;\r\n else\r\n UiFramework._hideIsolateEmphasizeActionHandler = new HideIsolateEmphasizeManager();\r\n }\r\n\r\n /** @alpha */\r\n public static get widgetManager(): WidgetManager {\r\n // istanbul ignore next\r\n if (!UiFramework._widgetManager)\r\n throw new UiError(UiFramework.loggerCategory(this), UiFramework._complaint);\r\n return UiFramework._widgetManager;\r\n }\r\n\r\n /** Calls localization.getLocalizedStringWithNamespace with the \"UiFramework\" namespace. Do NOT include the namespace in the key.\r\n * @internal\r\n */\r\n public static translate(key: string | string[]): string {\r\n return IModelApp.localization.getLocalizedStringWithNamespace(UiFramework.localizationNamespace, key);\r\n }\r\n\r\n /** @internal */\r\n public static get packageName(): string {\r\n return \"appui-react\";\r\n }\r\n\r\n /** @internal */\r\n public static loggerCategory(obj: any): string {\r\n const className = getClassName(obj);\r\n const category = UiFramework.packageName + (className ? `.${className}` : \"\");\r\n return category;\r\n }\r\n\r\n public static dispatchActionToStore(type: string, payload: any, immediateSync = false) {\r\n UiFramework.store.dispatch({ type, payload });\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(type);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(type);\r\n }\r\n\r\n public static setAccudrawSnapMode(snapMode: SnapMode) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetSnapMode, snapMode, true);\r\n }\r\n\r\n public static getAccudrawSnapMode(): SnapMode {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.snapMode : /* istanbul ignore next */ SnapMode.NearestKeypoint;\r\n }\r\n\r\n public static getActiveSelectionScope(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.activeSelectionScope : /* istanbul ignore next */ \"element\";\r\n }\r\n\r\n public static setActiveSelectionScope(selectionScopeId: string): void {\r\n // istanbul ignore else\r\n if (UiFramework.frameworkState) {\r\n const foundIndex = UiFramework.frameworkState.sessionState.availableSelectionScopes.findIndex((selectionScope: PresentationSelectionScope) => selectionScope.id === selectionScopeId);\r\n if (-1 !== foundIndex) {\r\n const scope = UiFramework.frameworkState.sessionState.availableSelectionScopes[foundIndex];\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetSelectionScope, scope.id);\r\n Presentation.selection.scopes.activeScope = scope.id;\r\n }\r\n }\r\n }\r\n\r\n /** @public */\r\n public static openCursorMenu(menuData: CursorMenuData | undefined): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, menuData);\r\n }\r\n\r\n /** @public */\r\n public static closeCursorMenu(): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.UpdateCursorMenu, undefined);\r\n }\r\n\r\n /** @public */\r\n public static getCursorMenuData(): CursorMenuData | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.cursorMenuData : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static getActiveIModelId(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelId : /* istanbul ignore next */ \"\";\r\n }\r\n\r\n public static setActiveIModelId(iModelId: string): void {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetActiveIModelId, iModelId);\r\n }\r\n\r\n public static setIModelConnection(iModelConnection: IModelConnection | undefined, immediateSync = false) {\r\n const oldConnection = UiFramework.getIModelConnection();\r\n if (oldConnection !== iModelConnection) {\r\n if (oldConnection?.iModelId)\r\n FrontstageManager.clearFrontstageDefsForIModelId(oldConnection.iModelId);\r\n oldConnection && undefined === iModelConnection && SyncUiEventDispatcher.clearConnectionEvents(oldConnection);\r\n iModelConnection && SyncUiEventDispatcher.initializeConnectionEvents(iModelConnection);\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetIModelConnection, iModelConnection, immediateSync);\r\n }\r\n UiFramework.setActiveIModelId(iModelConnection?.iModelId ?? \"\");\r\n }\r\n\r\n public static getIModelConnection(): IModelConnection | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.iModelConnection : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** Called by iModelApp to initialize saved UI state from registered UseSettingsProviders\r\n * @public\r\n */\r\n public static async initializeStateFromUserSettingsProviders(immediateSync = false) {\r\n // let any registered providers to load values from the new storage location\r\n const providerKeys = [...this._uiSettingsProviderRegistry.keys()];\r\n for await (const key of providerKeys) {\r\n await this._uiSettingsProviderRegistry.get(key)!.loadUserSettings(UiFramework._uiStateStorage);\r\n }\r\n\r\n // istanbul ignore next\r\n if (immediateSync)\r\n SyncUiEventDispatcher.dispatchImmediateSyncUiEvent(SyncUiEventId.UiStateStorageChanged);\r\n else\r\n SyncUiEventDispatcher.dispatchSyncUiEvent(SyncUiEventId.UiStateStorageChanged);\r\n }\r\n\r\n /** @public */\r\n public static async setUiStateStorage(storage: UiStateStorage, immediateSync = false) {\r\n if (UiFramework._uiStateStorage === storage)\r\n return;\r\n\r\n UiFramework._uiStateStorage = storage;\r\n await this.initializeStateFromUserSettingsProviders(immediateSync);\r\n }\r\n\r\n /** The UI Settings Storage is a convenient wrapper around Local Storage to assist in caching state information across user sessions.\r\n * It was previously used to conflate both the state information across session and the information driven directly from user explicit action,\r\n * which are now handled with user preferences.\r\n * @public\r\n */\r\n public static getUiStateStorage(): UiStateStorage {\r\n return UiFramework._uiStateStorage;\r\n }\r\n\r\n public static setDefaultIModelViewportControlId(iModelViewportControlId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultIModelViewportControlId, iModelViewportControlId, immediateSync);\r\n }\r\n\r\n public static getDefaultIModelViewportControlId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultIModelViewportControlId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewId(viewId: string, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewId, viewId, immediateSync);\r\n }\r\n\r\n public static getDefaultViewId(): string | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewId : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public static setDefaultViewState(viewState: ViewState, immediateSync = false) {\r\n UiFramework.dispatchActionToStore(SessionStateActionId.SetDefaultViewState, viewState, immediateSync);\r\n }\r\n public static getDefaultViewState(): ViewState | undefined {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.sessionState.defaultViewState : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n /** @public */\r\n public static getAvailableSelectionScopes(): PresentationSelectionScope[] {\r\n return UiFramework.frameworkState ?\r\n UiFramework.frameworkState.sessionState.availableSelectionScopes :\r\n /* istanbul ignore next */\r\n [{ id: \"element\", label: \"Element\" } as PresentationSelectionScope];\r\n }\r\n\r\n public static getIsUiVisible() {\r\n return UiShowHideManager.isUiVisible;\r\n }\r\n\r\n public static setIsUiVisible(visible: boolean) {\r\n if (UiShowHideManager.isUiVisible !== visible) {\r\n UiShowHideManager.isUiVisible = visible;\r\n UiFramework.onUiVisibilityChanged.emit({ visible });\r\n }\r\n }\r\n\r\n public static setColorTheme(theme: string) {\r\n if (UiFramework.getColorTheme() === theme)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetTheme, theme, true);\r\n }\r\n\r\n public static getColorTheme(): string {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.theme : /* istanbul ignore next */ SYSTEM_PREFERRED_COLOR_THEME;\r\n }\r\n\r\n public static setWidgetOpacity(opacity: number) {\r\n if (UiFramework.getWidgetOpacity() === opacity)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetWidgetOpacity, opacity, true);\r\n }\r\n\r\n public static getWidgetOpacity(): number {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.widgetOpacity : /* istanbul ignore next */ WIDGET_OPACITY_DEFAULT;\r\n }\r\n\r\n public static isMobile() { // eslint-disable-line @itwin/prefer-get\r\n return ProcessDetector.isMobileBrowser;\r\n }\r\n\r\n /** Returns the Ui Version.\r\n * @public\r\n */\r\n public static get uiVersion(): FrameworkVersionId {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.frameworkVersion : this._uiVersion;\r\n }\r\n\r\n public static setUiVersion(version: FrameworkVersionId) {\r\n if (UiFramework.uiVersion === version)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetFrameworkVersion, version === \"1\" ? \"1\" : \"2\", true);\r\n }\r\n\r\n public static get showWidgetIcon(): boolean {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.showWidgetIcon : /* istanbul ignore next */ false;\r\n }\r\n\r\n public static setShowWidgetIcon(value: boolean) {\r\n if (UiFramework.showWidgetIcon === value)\r\n return;\r\n\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetShowWidgetIcon, value, true);\r\n }\r\n\r\n public static get useDragInteraction(): boolean {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.useDragInteraction : false;\r\n }\r\n\r\n public static setUseDragInteraction(useDragInteraction: boolean) {\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetDragInteraction, useDragInteraction, true);\r\n }\r\n\r\n /** Returns the variable controlling whether the overlay is displayed in a Viewport\r\n * @public\r\n */\r\n public static get viewOverlayDisplay() {\r\n return UiFramework.frameworkState ? UiFramework.frameworkState.configurableUiState.viewOverlayDisplay : /* istanbul ignore next */ true;\r\n }\r\n /** Set the variable that controls display of the view overlay. Applies to all viewports in the app\r\n * @public\r\n */\r\n public static setViewOverlayDisplay(display: boolean) {\r\n if (UiFramework.viewOverlayDisplay === display)\r\n return;\r\n UiFramework.dispatchActionToStore(ConfigurableUiActionId.SetViewOverlayDisplay, display);\r\n }\r\n /** Send logging message to the telemetry system\r\n * @internal\r\n */\r\n // istanbul ignore next\r\n public static async postTelemetry(eventName: string, eventId?: GuidString, iTwinId?: GuidString, iModeId?: GuidString, changeSetId?: string, time?: TrackingTime, additionalProperties?: { [key: string]: any }): Promise<void> {\r\n if (!IModelApp.authorizationClient)\r\n return;\r\n\r\n try {\r\n const activity: RpcActivity = {\r\n sessionId: IModelApp.sessionId,\r\n activityId: \"\",\r\n applicationId: IModelApp.applicationId,\r\n applicationVersion: IModelApp.applicationVersion,\r\n accessToken: (await IModelApp.authorizationClient.getAccessToken()) ?? \"\",\r\n };\r\n const telemetryEvent = new TelemetryEvent(eventName, eventId, iTwinId, iModeId, changeSetId, time, additionalProperties);\r\n await IModelApp.telemetry.postTelemetry(activity, telemetryEvent);\r\n } catch { }\r\n }\r\n /** Determines whether a ContextMenu is open\r\n * @alpha\r\n * */\r\n public static get isContextMenuOpen(): boolean {\r\n const contextMenu = document.querySelector(\"div.core-context-menu-opened\");\r\n return contextMenu !== null && contextMenu !== undefined;\r\n }\r\n}\r\n"]}
@@ -91,7 +91,7 @@ export class ChildWindowManager {
91
91
  });
92
92
  setTimeout(() => {
93
93
  copyStyles(childWindow.document);
94
- setImmediate(() => {
94
+ setTimeout(() => {
95
95
  ReactDOM.render(React.createElement(Provider, { store: StateManager.store },
96
96
  React.createElement(UiStateStorageHandler, null,
97
97
  React.createElement(ThemeManager, null,
@@ -1 +1 @@
1
- {"version":3,"file":"ChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/ChildWindowManager.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,sBAAsB,E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AAC;SACrE;aAAM;YACL,WAAW,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;gBACxC,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnC,IAAI,CAAC,yBAAyB,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;YACtE,CAAC,EAAE,KAAK,CAAC,CAAC;SACX;QAED,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,GAAG,EAAE;YAC3C,MAAM,aAAa,GAAG,iBAAiB,CAAC,mBAAmB,CAAC;YAC5D,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;aAC5C;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module ChildWindowManager\r\n */\r\n\r\nimport \"./ChildWindowManager.scss\";\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { copyStyles } from \"./CopyStyles\";\r\nimport { Provider } from \"react-redux\";\r\nimport { StateManager } from \"../redux/StateManager\";\r\nimport { UiStateStorageHandler } from \"../uistate/useUiStateStorage\";\r\nimport { PopupRenderer } from \"../popup/PopupManager\";\r\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\r\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\r\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\r\nimport { FrameworkVersion } from \"../hooks/useFrameworkVersion\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { ThemeManager } from \"../theme/ThemeManager\";\r\n\r\nconst childHtml = `<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <meta charset=\"utf-8\" />\r\n <style>\r\n html,\r\n body {\r\n height: 100%;\r\n width: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n }\r\n #root {\r\n height: 100%;\r\n }\r\n </style>\r\n</head>\r\n<body>\r\n <noscript>You need to enable JavaScript to run this app.</noscript>\r\n <div id=\"root\"></div>\r\n</body>\r\n</html>`;\r\n\r\n/** @public */\r\nexport interface OpenChildWindowInfo {\r\n childWindowId: string;\r\n window: Window;\r\n parentWindow: Window;\r\n}\r\n\r\n/** @public */\r\nexport interface ChildWindowLocationProps {\r\n width: number;\r\n height: number;\r\n left: number;\r\n top: number;\r\n}\r\n\r\n/** Supports opening a child browser window from the main application window. The child window is managed by the main application\r\n * and is running in the same security context. The application must deliver the html file iTwinPopup.html along side its index.html.\r\n * See also: [Child Window Manager]($docs/learning/ui/appui-react/ChildWindows.md)\r\n * @public */\r\nexport class ChildWindowManager {\r\n private _openChildWindows: OpenChildWindowInfo[] = [];\r\n\r\n public get openChildWindows() {\r\n return this._openChildWindows;\r\n }\r\n\r\n public findChildWindow(childWindowId: string | undefined): OpenChildWindowInfo | undefined {\r\n if (undefined === childWindowId)\r\n return undefined;\r\n\r\n return this.openChildWindows.find((openWindow) => openWindow.childWindowId === childWindowId);\r\n }\r\n\r\n public findChildWindowId(contentWindow: Window | undefined | null): string | undefined {\r\n if (!contentWindow)\r\n return undefined;\r\n\r\n const childWindow = this.openChildWindows.find((openWindow) => openWindow.window === contentWindow);\r\n return childWindow?.childWindowId;\r\n }\r\n\r\n // istanbul ignore next\r\n private renderChildWindowContents(childWindow: Window, childWindowId: string, content: React.ReactNode) {\r\n const reactConnectionDiv = childWindow.document.getElementById(\"root\");\r\n if (reactConnectionDiv) {\r\n // set openChildWindows now so components can use it when they mount\r\n this._openChildWindows.push({\r\n childWindowId,\r\n window: childWindow,\r\n parentWindow: window,\r\n });\r\n\r\n setTimeout(() => {\r\n copyStyles(childWindow.document);\r\n setImmediate(() => {\r\n ReactDOM.render(\r\n <Provider store={StateManager.store} >\r\n <UiStateStorageHandler>\r\n <ThemeManager>\r\n <FrameworkVersion>\r\n <div className=\"uifw-child-window-container-host\">\r\n <PopupRenderer />\r\n <ModalDialogRenderer />\r\n <ModelessDialogRenderer />\r\n <CursorPopupMenu />\r\n <div className=\"uifw-child-window-container nz-widget-widget\">\r\n {content}\r\n </div>\r\n </div>\r\n </FrameworkVersion>\r\n </ThemeManager>\r\n </UiStateStorageHandler>\r\n </Provider>,\r\n reactConnectionDiv\r\n );\r\n });\r\n });\r\n\r\n childWindow.onbeforeunload = () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (frontStageDef) {\r\n void frontStageDef.saveChildWindowSizeAndPosition(childWindowId, childWindow).then(() => {\r\n this.closeChildWindow(childWindowId, false);\r\n });\r\n }\r\n };\r\n }\r\n }\r\n\r\n /** Close all child/pop-out windows. This typically is called when the frontstage is changed. */\r\n public closeAllChildWindows() {\r\n // istanbul ignore next\r\n this.openChildWindows.forEach((openChildWindow) => openChildWindow.window.close());\r\n this._openChildWindows = [];\r\n }\r\n\r\n public closeChildWindow = (childWindowId: string, processWindowClose = true) => {\r\n const windowIndex = this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId);\r\n if (-1 === windowIndex)\r\n return false;\r\n const childWindow = this.openChildWindows[windowIndex];\r\n this.openChildWindows.splice(windowIndex, 1);\r\n if (processWindowClose) {\r\n childWindow.window.close();\r\n } else {\r\n // call the following to convert popout to docked widget\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n frontStageDef && frontStageDef.dockPopoutWidgetContainer(childWindowId);\r\n }\r\n return true;\r\n };\r\n\r\n // istanbul ignore next\r\n private adjustWidowLocation(location: ChildWindowLocationProps, center?: boolean): ChildWindowLocationProps {\r\n const outLocation = { ...location };\r\n if (0 === location.top && 0 === location.left) {\r\n center = center ?? true;\r\n const windowTop = window.top ?? window;\r\n\r\n // Prepare position of the new window to be centered against the 'parent' window.\r\n if (center) {\r\n outLocation.left =\r\n windowTop.outerWidth / 2 + windowTop.screenX - location.width / 2;\r\n outLocation.top =\r\n windowTop.outerHeight / 2 + windowTop.screenY - location.height / 2;\r\n } else {\r\n if (undefined !== window.screenLeft && undefined !== window.screenTop) {\r\n outLocation.top = window.screenTop + location.top;\r\n outLocation.left = window.screenLeft + location.left;\r\n }\r\n }\r\n }\r\n return outLocation;\r\n }\r\n\r\n // istanbul ignore next\r\n public openChildWindow(childWindowId: string, title: string, content: React.ReactNode, location: ChildWindowLocationProps, useDefaultPopoutUrl?: boolean) {\r\n // first check to see if content is already open in child window\r\n if (this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId) >= 0) {\r\n return false;\r\n }\r\n\r\n location = this.adjustWidowLocation(location);\r\n const url = useDefaultPopoutUrl ? \"/iTwinPopup.html\" : \"\";\r\n const childWindow = window.open(url, \"\", `width=${location.width},height=${location.height},left=${location.left},top=${location.top},menubar=no,resizable=yes,scrollbars=no,status=no,location=no`);\r\n if (!childWindow)\r\n return false;\r\n if (0 === url.length) {\r\n childWindow.document.write(childHtml);\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n } else {\r\n childWindow.addEventListener(\"load\", () => {\r\n childWindow.document.title = title;\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n }, false);\r\n }\r\n\r\n window.addEventListener(\"beforeunload\", () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (frontStageDef) {\r\n this.closeChildWindow(childWindowId, true);\r\n }\r\n }, false);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ChildWindowManager.js","sourceRoot":"","sources":["../../../../src/appui-react/childwindow/ChildWindowManager.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;A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IAAI,QAAQ,QAAQ,CAAC,GAAG,+DAA+D,CAAC,CAAC;QACrM,IAAI,CAAC,WAAW;YACd,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,CAAC,MAAM,EAAE;YACpB,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACtC,IAAI,CAAC,yBAAyB,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;SACrE;aAAM;YACL,WAAW,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;gBACxC,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnC,IAAI,CAAC,yBAAyB,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;YACtE,CAAC,EAAE,KAAK,CAAC,CAAC;SACX;QAED,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,GAAG,EAAE;YAC3C,MAAM,aAAa,GAAG,iBAAiB,CAAC,mBAAmB,CAAC;YAC5D,IAAI,aAAa,EAAE;gBACjB,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;aAC5C;QACH,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module ChildWindowManager\r\n */\r\n\r\nimport \"./ChildWindowManager.scss\";\r\nimport * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { copyStyles } from \"./CopyStyles\";\r\nimport { Provider } from \"react-redux\";\r\nimport { StateManager } from \"../redux/StateManager\";\r\nimport { UiStateStorageHandler } from \"../uistate/useUiStateStorage\";\r\nimport { PopupRenderer } from \"../popup/PopupManager\";\r\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\r\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\r\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\r\nimport { FrameworkVersion } from \"../hooks/useFrameworkVersion\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { ThemeManager } from \"../theme/ThemeManager\";\r\n\r\nconst childHtml = `<!DOCTYPE html>\r\n<html>\r\n<head>\r\n <meta charset=\"utf-8\" />\r\n <style>\r\n html,\r\n body {\r\n height: 100%;\r\n width: 100%;\r\n margin: 0;\r\n overflow: hidden;\r\n }\r\n #root {\r\n height: 100%;\r\n }\r\n </style>\r\n</head>\r\n<body>\r\n <noscript>You need to enable JavaScript to run this app.</noscript>\r\n <div id=\"root\"></div>\r\n</body>\r\n</html>`;\r\n\r\n/** @public */\r\nexport interface OpenChildWindowInfo {\r\n childWindowId: string;\r\n window: Window;\r\n parentWindow: Window;\r\n}\r\n\r\n/** @public */\r\nexport interface ChildWindowLocationProps {\r\n width: number;\r\n height: number;\r\n left: number;\r\n top: number;\r\n}\r\n\r\n/** Supports opening a child browser window from the main application window. The child window is managed by the main application\r\n * and is running in the same security context. The application must deliver the html file iTwinPopup.html along side its index.html.\r\n * See also: [Child Window Manager]($docs/learning/ui/appui-react/ChildWindows.md)\r\n * @public */\r\nexport class ChildWindowManager {\r\n private _openChildWindows: OpenChildWindowInfo[] = [];\r\n\r\n public get openChildWindows() {\r\n return this._openChildWindows;\r\n }\r\n\r\n public findChildWindow(childWindowId: string | undefined): OpenChildWindowInfo | undefined {\r\n if (undefined === childWindowId)\r\n return undefined;\r\n\r\n return this.openChildWindows.find((openWindow) => openWindow.childWindowId === childWindowId);\r\n }\r\n\r\n public findChildWindowId(contentWindow: Window | undefined | null): string | undefined {\r\n if (!contentWindow)\r\n return undefined;\r\n\r\n const childWindow = this.openChildWindows.find((openWindow) => openWindow.window === contentWindow);\r\n return childWindow?.childWindowId;\r\n }\r\n\r\n // istanbul ignore next\r\n private renderChildWindowContents(childWindow: Window, childWindowId: string, content: React.ReactNode) {\r\n const reactConnectionDiv = childWindow.document.getElementById(\"root\");\r\n if (reactConnectionDiv) {\r\n // set openChildWindows now so components can use it when they mount\r\n this._openChildWindows.push({\r\n childWindowId,\r\n window: childWindow,\r\n parentWindow: window,\r\n });\r\n\r\n setTimeout(() => {\r\n copyStyles(childWindow.document);\r\n setTimeout(() => {\r\n ReactDOM.render(\r\n <Provider store={StateManager.store} >\r\n <UiStateStorageHandler>\r\n <ThemeManager>\r\n <FrameworkVersion>\r\n <div className=\"uifw-child-window-container-host\">\r\n <PopupRenderer />\r\n <ModalDialogRenderer />\r\n <ModelessDialogRenderer />\r\n <CursorPopupMenu />\r\n <div className=\"uifw-child-window-container nz-widget-widget\">\r\n {content}\r\n </div>\r\n </div>\r\n </FrameworkVersion>\r\n </ThemeManager>\r\n </UiStateStorageHandler>\r\n </Provider>,\r\n reactConnectionDiv\r\n );\r\n });\r\n });\r\n\r\n childWindow.onbeforeunload = () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (frontStageDef) {\r\n void frontStageDef.saveChildWindowSizeAndPosition(childWindowId, childWindow).then(() => {\r\n this.closeChildWindow(childWindowId, false);\r\n });\r\n }\r\n };\r\n }\r\n }\r\n\r\n /** Close all child/pop-out windows. This typically is called when the frontstage is changed. */\r\n public closeAllChildWindows() {\r\n // istanbul ignore next\r\n this.openChildWindows.forEach((openChildWindow) => openChildWindow.window.close());\r\n this._openChildWindows = [];\r\n }\r\n\r\n public closeChildWindow = (childWindowId: string, processWindowClose = true) => {\r\n const windowIndex = this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId);\r\n if (-1 === windowIndex)\r\n return false;\r\n const childWindow = this.openChildWindows[windowIndex];\r\n this.openChildWindows.splice(windowIndex, 1);\r\n if (processWindowClose) {\r\n childWindow.window.close();\r\n } else {\r\n // call the following to convert popout to docked widget\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n frontStageDef && frontStageDef.dockPopoutWidgetContainer(childWindowId);\r\n }\r\n return true;\r\n };\r\n\r\n // istanbul ignore next\r\n private adjustWidowLocation(location: ChildWindowLocationProps, center?: boolean): ChildWindowLocationProps {\r\n const outLocation = { ...location };\r\n if (0 === location.top && 0 === location.left) {\r\n center = center ?? true;\r\n const windowTop = window.top ?? window;\r\n\r\n // Prepare position of the new window to be centered against the 'parent' window.\r\n if (center) {\r\n outLocation.left =\r\n windowTop.outerWidth / 2 + windowTop.screenX - location.width / 2;\r\n outLocation.top =\r\n windowTop.outerHeight / 2 + windowTop.screenY - location.height / 2;\r\n } else {\r\n if (undefined !== window.screenLeft && undefined !== window.screenTop) {\r\n outLocation.top = window.screenTop + location.top;\r\n outLocation.left = window.screenLeft + location.left;\r\n }\r\n }\r\n }\r\n return outLocation;\r\n }\r\n\r\n // istanbul ignore next\r\n public openChildWindow(childWindowId: string, title: string, content: React.ReactNode, location: ChildWindowLocationProps, useDefaultPopoutUrl?: boolean) {\r\n // first check to see if content is already open in child window\r\n if (this.openChildWindows.findIndex((openWindow) => openWindow.childWindowId === childWindowId) >= 0) {\r\n return false;\r\n }\r\n\r\n location = this.adjustWidowLocation(location);\r\n const url = useDefaultPopoutUrl ? \"/iTwinPopup.html\" : \"\";\r\n const childWindow = window.open(url, \"\", `width=${location.width},height=${location.height},left=${location.left},top=${location.top},menubar=no,resizable=yes,scrollbars=no,status=no,location=no`);\r\n if (!childWindow)\r\n return false;\r\n if (0 === url.length) {\r\n childWindow.document.write(childHtml);\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n } else {\r\n childWindow.addEventListener(\"load\", () => {\r\n childWindow.document.title = title;\r\n this.renderChildWindowContents(childWindow, childWindowId, content);\r\n }, false);\r\n }\r\n\r\n window.addEventListener(\"beforeunload\", () => {\r\n const frontStageDef = FrontstageManager.activeFrontstageDef;\r\n if (frontStageDef) {\r\n this.closeChildWindow(childWindowId, true);\r\n }\r\n }, false);\r\n\r\n return true;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FrontstageDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/frontstage/FrontstageDef.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAKH,OAAO,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAuB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAEL,oBAAoB,EAAE,aAAa,EACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAG3F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAQ5D,gBAAgB;AAChB,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,gBAAgB;AAChB,MAAM,WAAW,uCAAwC,SAAQ,mBAAmB;IAClF,KAAK,EAAE,aAAa,GAAG,SAAS,CAAC;CAClC;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,aAAa,CA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eAAe,EAAE,MAAM,CAAC;IAYxE,cAAc,CAAC,QAAQ,EAAE,MAAM;IAY/B,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAYxC;;;;;;;OAOG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS;IAoBzE;;;OAGG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM;IAqBzC;mBACe;IACR,yBAAyB,CAAC,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM;IAqBhF;;;;;;;OAOG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS;IAwC1E,IAAW,cAAc,YAExB;IAED,IAAW,oBAAoB,YAE9B;IAED,IAAW,OAAO,YAEjB;IAED,gBAAgB;IACH,8BAA8B,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAQtF,gBAAgB;IACT,+BAA+B,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,gCAAgC,UAAQ;IAWjI;;;OAGG;IACI,yBAAyB,CAAC,iBAAiB,EAAE,MAAM;IAa1D;;;;;OAKG;IACI,mBAAmB,CAAC,QAAQ,EAAE,MAAM;IAepC,gCAAgC,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc;IAQjF,6BAA6B,IAAI,MAAM,EAAE;IAOzC,sCAAsC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAa5E,gCAAgC,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS;CAgB7E"}
@@ -21,7 +21,6 @@ import { Frontstage } from "./Frontstage";
21
21
  import { FrontstageManager } from "./FrontstageManager";
22
22
  import { TimeTracker } from "../configurableui/TimeTracker";
23
23
  import { PopoutWidget } from "../childwindow/PopoutWidget";
24
- import { setImmediate } from "timers";
25
24
  import { saveFrontstagePopoutWidgetSizeAndPosition } from "../widget-panels/Frontstage";
26
25
  import { BentleyStatus } from "@itwin/core-bentley";
27
26
  import { ContentDialogManager } from "../dialog/ContentDialogManager";
@@ -726,7 +725,7 @@ export class FrontstageDef {
726
725
  const widgetContainerId = location.widgetId;
727
726
  const tab = state.tabs[widgetId];
728
727
  this.nineZoneState = state;
729
- setImmediate(() => {
728
+ setTimeout(() => {
730
729
  const popoutContent = (React.createElement(PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
731
730
  const position = {
732
731
  width: tab.preferredPopoutWidgetSize.width,