@itwin/appui-abstract 3.2.0-dev.37 → 3.2.0-dev.38

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 (33) hide show
  1. package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +31 -0
  2. package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -0
  3. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +80 -0
  4. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -0
  5. package/lib/cjs/appui-abstract/UiItemsManager.d.ts +30 -42
  6. package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +1 -1
  7. package/lib/cjs/appui-abstract/UiItemsManager.js +60 -87
  8. package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
  9. package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +28 -0
  10. package/lib/cjs/appui-abstract/UiItemsProvider.d.ts.map +1 -0
  11. package/lib/cjs/appui-abstract/UiItemsProvider.js +11 -0
  12. package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -0
  13. package/lib/cjs/appui-abstract.d.ts +2 -0
  14. package/lib/cjs/appui-abstract.d.ts.map +1 -1
  15. package/lib/cjs/appui-abstract.js +2 -0
  16. package/lib/cjs/appui-abstract.js.map +1 -1
  17. package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +31 -0
  18. package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -0
  19. package/lib/esm/appui-abstract/BaseUiItemsProvider.js +76 -0
  20. package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -0
  21. package/lib/esm/appui-abstract/UiItemsManager.d.ts +30 -42
  22. package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +1 -1
  23. package/lib/esm/appui-abstract/UiItemsManager.js +59 -85
  24. package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
  25. package/lib/esm/appui-abstract/UiItemsProvider.d.ts +28 -0
  26. package/lib/esm/appui-abstract/UiItemsProvider.d.ts.map +1 -0
  27. package/lib/esm/appui-abstract/UiItemsProvider.js +10 -0
  28. package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -0
  29. package/lib/esm/appui-abstract.d.ts +2 -0
  30. package/lib/esm/appui-abstract.d.ts.map +1 -1
  31. package/lib/esm/appui-abstract.js +2 -0
  32. package/lib/esm/appui-abstract.js.map +1 -1
  33. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG","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/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\n\r\n/** Describes interface of objects that want to provide UI component to the running IModelApp.\r\n * @public\r\n */\r\nexport interface UiItemsProvider {\r\n /** id of provider */\r\n readonly id: string;\r\n\r\n /** UiItemsManager calls following method to get items to populate specific toolbars */\r\n provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any) => CommonToolbarItem[];\r\n /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */\r\n provideStatusBarItems?: (stageId: string, stageUsage: string, stageAppData?: any) => CommonStatusBarItem[];\r\n /** UiItemsManager calls following method to augment backstage items. */\r\n provideBackstageItems?: () => BackstageItem[];\r\n /** UiItemsManager calls following method to augment Widget lists.\r\n * @note Returned widgets must provide unique `AbstractWidgetProps[\"id\"]` to correctly save/restore App layout.\r\n */\r\n provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection,\r\n zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>;\r\n /** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */\r\n onUnregister?: () => void;\r\n}\r\n"]}
@@ -1,5 +1,7 @@
1
+ export * from "./appui-abstract/BaseUiItemsProvider";
1
2
  export * from "./appui-abstract/UiAdmin";
2
3
  export * from "./appui-abstract/UiItemsManager";
4
+ export * from "./appui-abstract/UiItemsProvider";
3
5
  export * from "./appui-abstract/backstage/BackstageItem";
4
6
  export * from "./appui-abstract/backstage/BackstageItemsManager";
5
7
  export * from "./appui-abstract/common/KeyboardKey";
@@ -1 +1 @@
1
- {"version":3,"file":"appui-abstract.d.ts","sourceRoot":"","sources":["../../src/appui-abstract.ts"],"names":[],"mappings":"AAKA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAEhD,cAAc,0CAA0C,CAAC;AACzD,cAAc,kDAAkD,CAAC;AAEjE,cAAc,qCAAqC,CAAC;AAEpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,iDAAiD,CAAC;AAEhE,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AAExD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kCAAkC,CAAC;AAEjD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC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C,CAAC;AAEtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AAEpD;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG"}
@@ -14,8 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./appui-abstract/BaseUiItemsProvider"), exports);
17
18
  __exportStar(require("./appui-abstract/UiAdmin"), exports);
18
19
  __exportStar(require("./appui-abstract/UiItemsManager"), exports);
20
+ __exportStar(require("./appui-abstract/UiItemsProvider"), exports);
19
21
  __exportStar(require("./appui-abstract/backstage/BackstageItem"), exports);
20
22
  __exportStar(require("./appui-abstract/backstage/BackstageItemsManager"), exports);
21
23
  __exportStar(require("./appui-abstract/common/KeyboardKey"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"appui-abstract.js","sourceRoot":"","sources":["../../src/appui-abstract.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,2DAAyC;AACzC,kEAAgD;AAEhD,2EAAyD;AACzD,mFAAiE;AAEjE,sEAAoD;AAEpD,8EAA4D;AAC5D,kFAAgE;AAEhE,sEAAoD;AACpD,gFAA8D;AAC9D,0EAAwD;AAExD,2EAAyD;AACzD,+EAA6D;AAC7D,sEAAoD;AACpD,8EAA4D;AAC5D,mEAAiD;AAEjD,iFAA+D;AAC/D,gFAA8D;AAC9D,0EAAwD;AACxD,sEAAoD;AACpD,0EAAwD;AACxD,oEAAkD;AAElD,iFAA+D;AAC/D,gFAA8D;AAE9D,0EAAwD;AACxD,2EAAyD;AACzD,6EAA2D;AAC3D,qEAAmD;AACnD,kFAAgE;AAChE,gFAA8D;AAC9D,oEAAkD;AAElD,oFAAkE;AAClE,2EAAyD;AACzD,mFAAiE;AAEjE,wEAAsD;AACtD,gFAA8D;AAE9D,2EAAyD;AACzD,mFAAiE;AAEjE,mEAAiD;AACjD,8DAA4C;AAC5C,kEAAgD;AAChD,2EAAyD;AACzD,oEAAkD;AAClD,iEAA+C;AAC/C,2EAAyD;AACzD,iEAA+C;AAC/C,yEAAuD;AACvD,wEAAsD;AACtD,wEAAsD;AAEtD,8EAA4D;AAC5D,qEAAmD;AACnD,sEAAoD;AAEpD;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\nexport * from \"./appui-abstract/UiAdmin\";\r\nexport * from \"./appui-abstract/UiItemsManager\";\r\n\r\nexport * from \"./appui-abstract/backstage/BackstageItem\";\r\nexport * from \"./appui-abstract/backstage/BackstageItemsManager\";\r\n\r\nexport * from \"./appui-abstract/common/KeyboardKey\";\r\n\r\nexport * from \"./appui-abstract/content/ContentLayoutProps\";\r\nexport * from \"./appui-abstract/content/StandardContentLayouts\";\r\n\r\nexport * from \"./appui-abstract/dialogs/DialogItem\";\r\nexport * from \"./appui-abstract/dialogs/UiLayoutDataProvider\";\r\nexport * from \"./appui-abstract/dialogs/UiDataProvider\";\r\n\r\nexport * from \"./appui-abstract/items/AbstractItemProps\";\r\nexport * from \"./appui-abstract/items/AbstractMenuItemProps\";\r\nexport * from \"./appui-abstract/items/ProvidedItem\";\r\nexport * from \"./appui-abstract/items/AbstractToolbarProps\";\r\nexport * from \"./appui-abstract/items/BadgeType\";\r\n\r\nexport * from \"./appui-abstract/items/ConditionalBooleanValue\";\r\nexport * from \"./appui-abstract/items/ConditionalStringValue\";\r\nexport * from \"./appui-abstract/items/RelativePosition\";\r\nexport * from \"./appui-abstract/items/ProvidedItem\";\r\nexport * from \"./appui-abstract/items/RelativePosition\";\r\nexport * from \"./appui-abstract/items/StageUsage\";\r\n\r\nexport * from \"./appui-abstract/notification/MessagePresenter\";\r\nexport * from \"./appui-abstract/notification/MessageSeverity\";\r\n\r\nexport * from \"./appui-abstract/properties/Description\";\r\nexport * from \"./appui-abstract/properties/EditorParams\";\r\nexport * from \"./appui-abstract/properties/PrimitiveTypes\";\r\nexport * from \"./appui-abstract/properties/Record\";\r\nexport * from \"./appui-abstract/properties/StandardEditorNames\";\r\nexport * from \"./appui-abstract/properties/StandardTypeNames\";\r\nexport * from \"./appui-abstract/properties/Value\";\r\n\r\nexport * from \"./appui-abstract/quantity/BaseQuantityDescription\";\r\nexport * from \"./appui-abstract/statusbar/StatusBarItem\";\r\nexport * from \"./appui-abstract/statusbar/StatusBarItemsManager\";\r\n\r\nexport * from \"./appui-abstract/toolbars/ToolbarItem\";\r\nexport * from \"./appui-abstract/toolbars/ToolbarItemsManager\";\r\n\r\nexport * from \"./appui-abstract/statusbar/StatusBarItem\";\r\nexport * from \"./appui-abstract/statusbar/StatusBarItemsManager\";\r\n\r\nexport * from \"./appui-abstract/utils/callbacks\";\r\nexport * from \"./appui-abstract/utils/misc\";\r\nexport * from \"./appui-abstract/utils/isLetter\";\r\nexport * from \"./appui-abstract/utils/IconSpecUtilities\";\r\nexport * from \"./appui-abstract/utils/PointProps\";\r\nexport * from \"./appui-abstract/utils/UiError\";\r\nexport * from \"./appui-abstract/utils/UiEventDispatcher\";\r\nexport * from \"./appui-abstract/utils/UiEvent\";\r\nexport * from \"./appui-abstract/utils/filter/charCode\";\r\nexport * from \"./appui-abstract/utils/filter/filters\";\r\nexport * from \"./appui-abstract/utils/filter/strings\";\r\n\r\nexport * from \"./appui-abstract/widget/AbstractWidgetProps\";\r\nexport * from \"./appui-abstract/widget/StagePanel\";\r\nexport * from \"./appui-abstract/widget/WidgetState\";\r\n\r\n/** @docs-package-description\r\n * The appui-abstract package contains abstractions for UI controls, such as toolbars, buttons and menus.\r\n * For more information, see [learning about appui-abstract]($docs/learning/ui/abstract/index.md).\r\n */\r\n/**\r\n * @docs-group-description Backstage\r\n * Abstractions used by appui-react package to create and manage the display Backstage menu items.\r\n */\r\n/**\r\n * @docs-group-description ContentView\r\n * Classes and interfaces used with Content Layouts.\r\n */\r\n/**\r\n * @docs-group-description Dialog\r\n * Interfaces and classes for generating UI items for Dialogs.\r\n */\r\n/**\r\n * @docs-group-description Item\r\n * Classes for working with an Item in a Toolbar, Widget, Backstage or Context Menu\r\n */\r\n/**\r\n * @docs-group-description Notification\r\n * Interfaces and enums for working with a message\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Properties system for data input and formatting.\r\n */\r\n/**\r\n * @docs-group-description StatusBar\r\n * Classes for creating and managing items in the status bar.\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Classes for creating and managing items in a toolbar.\r\n */\r\n/**\r\n * @docs-group-description UiAdmin\r\n * Abstractions for UI controls, such as toolbars, buttons and menus and are callable from IModelApp.uiAdmin in core-frontend.\r\n */\r\n/**\r\n * @docs-group-description UiItemsProvider\r\n * Interface for specifying UI items to be inserted at runtime.\r\n */\r\n/**\r\n * @docs-group-description Utilities\r\n * Various utility classes for working with a UI.\r\n */\r\n/**\r\n * @docs-group-description Widget\r\n * Classes for creating and providing Widgets.\r\n */\r\n"]}
1
+ {"version":3,"file":"appui-abstract.js","sourceRoot":"","sources":["../../src/appui-abstract.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,uEAAqD;AACrD,2DAAyC;AACzC,kEAAgD;AAChD,mEAAiD;AAEjD,2EAAyD;AACzD,mFAAiE;AAEjE,sEAAoD;AAEpD,8EAA4D;AAC5D,kFAAgE;AAEhE,sEAAoD;AACpD,gFAA8D;AAC9D,0EAAwD;AAExD,2EAAyD;AACzD,+EAA6D;AAC7D,sEAAoD;AACpD,8EAA4D;AAC5D,mEAAiD;AAEjD,iFAA+D;AAC/D,gFAA8D;AAC9D,0EAAwD;AACxD,sEAAoD;AACpD,0EAAwD;AACxD,oEAAkD;AAElD,iFAA+D;AAC/D,gFAA8D;AAE9D,0EAAwD;AACxD,2EAAyD;AACzD,6EAA2D;AAC3D,qEAAmD;AACnD,kFAAgE;AAChE,gFAA8D;AAC9D,oEAAkD;AAElD,oFAAkE;AAClE,2EAAyD;AACzD,mFAAiE;AAEjE,wEAAsD;AACtD,gFAA8D;AAE9D,2EAAyD;AACzD,mFAAiE;AAEjE,mEAAiD;AACjD,8DAA4C;AAC5C,kEAAgD;AAChD,2EAAyD;AACzD,oEAAkD;AAClD,iEAA+C;AAC/C,2EAAyD;AACzD,iEAA+C;AAC/C,yEAAuD;AACvD,wEAAsD;AACtD,wEAAsD;AAEtD,8EAA4D;AAC5D,qEAAmD;AACnD,sEAAoD;AAEpD;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG;AACH;;;GAGG","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\nexport * from \"./appui-abstract/BaseUiItemsProvider\";\r\nexport * from \"./appui-abstract/UiAdmin\";\r\nexport * from \"./appui-abstract/UiItemsManager\";\r\nexport * from \"./appui-abstract/UiItemsProvider\";\r\n\r\nexport * from \"./appui-abstract/backstage/BackstageItem\";\r\nexport * from \"./appui-abstract/backstage/BackstageItemsManager\";\r\n\r\nexport * from \"./appui-abstract/common/KeyboardKey\";\r\n\r\nexport * from \"./appui-abstract/content/ContentLayoutProps\";\r\nexport * from \"./appui-abstract/content/StandardContentLayouts\";\r\n\r\nexport * from \"./appui-abstract/dialogs/DialogItem\";\r\nexport * from \"./appui-abstract/dialogs/UiLayoutDataProvider\";\r\nexport * from \"./appui-abstract/dialogs/UiDataProvider\";\r\n\r\nexport * from \"./appui-abstract/items/AbstractItemProps\";\r\nexport * from \"./appui-abstract/items/AbstractMenuItemProps\";\r\nexport * from \"./appui-abstract/items/ProvidedItem\";\r\nexport * from \"./appui-abstract/items/AbstractToolbarProps\";\r\nexport * from \"./appui-abstract/items/BadgeType\";\r\n\r\nexport * from \"./appui-abstract/items/ConditionalBooleanValue\";\r\nexport * from \"./appui-abstract/items/ConditionalStringValue\";\r\nexport * from \"./appui-abstract/items/RelativePosition\";\r\nexport * from \"./appui-abstract/items/ProvidedItem\";\r\nexport * from \"./appui-abstract/items/RelativePosition\";\r\nexport * from \"./appui-abstract/items/StageUsage\";\r\n\r\nexport * from \"./appui-abstract/notification/MessagePresenter\";\r\nexport * from \"./appui-abstract/notification/MessageSeverity\";\r\n\r\nexport * from \"./appui-abstract/properties/Description\";\r\nexport * from \"./appui-abstract/properties/EditorParams\";\r\nexport * from \"./appui-abstract/properties/PrimitiveTypes\";\r\nexport * from \"./appui-abstract/properties/Record\";\r\nexport * from \"./appui-abstract/properties/StandardEditorNames\";\r\nexport * from \"./appui-abstract/properties/StandardTypeNames\";\r\nexport * from \"./appui-abstract/properties/Value\";\r\n\r\nexport * from \"./appui-abstract/quantity/BaseQuantityDescription\";\r\nexport * from \"./appui-abstract/statusbar/StatusBarItem\";\r\nexport * from \"./appui-abstract/statusbar/StatusBarItemsManager\";\r\n\r\nexport * from \"./appui-abstract/toolbars/ToolbarItem\";\r\nexport * from \"./appui-abstract/toolbars/ToolbarItemsManager\";\r\n\r\nexport * from \"./appui-abstract/statusbar/StatusBarItem\";\r\nexport * from \"./appui-abstract/statusbar/StatusBarItemsManager\";\r\n\r\nexport * from \"./appui-abstract/utils/callbacks\";\r\nexport * from \"./appui-abstract/utils/misc\";\r\nexport * from \"./appui-abstract/utils/isLetter\";\r\nexport * from \"./appui-abstract/utils/IconSpecUtilities\";\r\nexport * from \"./appui-abstract/utils/PointProps\";\r\nexport * from \"./appui-abstract/utils/UiError\";\r\nexport * from \"./appui-abstract/utils/UiEventDispatcher\";\r\nexport * from \"./appui-abstract/utils/UiEvent\";\r\nexport * from \"./appui-abstract/utils/filter/charCode\";\r\nexport * from \"./appui-abstract/utils/filter/filters\";\r\nexport * from \"./appui-abstract/utils/filter/strings\";\r\n\r\nexport * from \"./appui-abstract/widget/AbstractWidgetProps\";\r\nexport * from \"./appui-abstract/widget/StagePanel\";\r\nexport * from \"./appui-abstract/widget/WidgetState\";\r\n\r\n/** @docs-package-description\r\n * The appui-abstract package contains abstractions for UI controls, such as toolbars, buttons and menus.\r\n * For more information, see [learning about appui-abstract]($docs/learning/ui/abstract/index.md).\r\n */\r\n/**\r\n * @docs-group-description Backstage\r\n * Abstractions used by appui-react package to create and manage the display Backstage menu items.\r\n */\r\n/**\r\n * @docs-group-description ContentView\r\n * Classes and interfaces used with Content Layouts.\r\n */\r\n/**\r\n * @docs-group-description Dialog\r\n * Interfaces and classes for generating UI items for Dialogs.\r\n */\r\n/**\r\n * @docs-group-description Item\r\n * Classes for working with an Item in a Toolbar, Widget, Backstage or Context Menu\r\n */\r\n/**\r\n * @docs-group-description Notification\r\n * Interfaces and enums for working with a message\r\n */\r\n/**\r\n * @docs-group-description Properties\r\n * Properties system for data input and formatting.\r\n */\r\n/**\r\n * @docs-group-description StatusBar\r\n * Classes for creating and managing items in the status bar.\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Classes for creating and managing items in a toolbar.\r\n */\r\n/**\r\n * @docs-group-description UiAdmin\r\n * Abstractions for UI controls, such as toolbars, buttons and menus and are callable from IModelApp.uiAdmin in core-frontend.\r\n */\r\n/**\r\n * @docs-group-description UiItemsProvider\r\n * Interface for specifying UI items to be inserted at runtime.\r\n */\r\n/**\r\n * @docs-group-description Utilities\r\n * Various utility classes for working with a UI.\r\n */\r\n/**\r\n * @docs-group-description Widget\r\n * Classes for creating and providing Widgets.\r\n */\r\n"]}
@@ -0,0 +1,31 @@
1
+ /** @packageDocumentation
2
+ * @module UiItemsProvider
3
+ */
4
+ import { BackstageItem } from "./backstage/BackstageItem";
5
+ import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
6
+ import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
7
+ import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
8
+ import { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
9
+ import { UiItemsProvider } from "./UiItemsProvider";
10
+ /**
11
+ * Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
12
+ * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
13
+ * @public
14
+ */
15
+ export declare class BaseUiItemsProvider implements UiItemsProvider {
16
+ protected _providerId: string;
17
+ isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider | undefined) => boolean) | undefined;
18
+ constructor(_providerId: string, isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider | undefined) => boolean) | undefined);
19
+ get id(): string;
20
+ onUnregister(): void;
21
+ unregister(): void;
22
+ /** Backstage items are not stage specific so no callback is used */
23
+ provideBackstageItems(): BackstageItem[];
24
+ provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[];
25
+ provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[];
26
+ provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[];
27
+ provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[];
28
+ provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, _stageAppData?: any): AbstractWidgetProps[];
29
+ provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps>;
30
+ }
31
+ //# sourceMappingURL=BaseUiItemsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseUiItemsProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAElG,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,eAAe;IAO7C,SAAS,CAAC,WAAW,EAAE,MAAM;IAAS,gBAAgB,CAAC,aAAY,MAAM,cAAc,MAAM,iBAAiB,GAAG,6CAAiC,OAAO;gBAA/I,WAAW,EAAE,MAAM,EAAS,gBAAgB,CAAC,aAAY,MAAM,cAAc,MAAM,iBAAiB,GAAG,6CAAiC,OAAO,aAAA;IAErK,IAAW,EAAE,IAAI,MAAM,CAA6B;IAC7C,YAAY,IAAI,IAAI;IAEpB,UAAU;IAIjB,oEAAoE;IAC7D,qBAAqB,IAAI,aAAa,EAAE;IAIxC,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE;IAGxL,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE;IAY3K,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAGhH,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAYrG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,QAAQ,CAAC,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,oBAAoB,EAAE,aAAa,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAI5M,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAClH,aAAa,CAAC,EAAE,oBAAoB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAWhG"}
@@ -0,0 +1,76 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /* eslint-disable deprecation/deprecation */
6
+ /** @packageDocumentation
7
+ * @module UiItemsProvider
8
+ */
9
+ import { StageUsage } from "./items/StageUsage";
10
+ import { UiItemsManager } from "./UiItemsManager";
11
+ /**
12
+ * Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
13
+ * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
14
+ * @public
15
+ */
16
+ export class BaseUiItemsProvider {
17
+ /*
18
+ * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want
19
+ * to set up custom stage with their own subset of standard tools.
20
+ * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and
21
+ * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.
22
+ */
23
+ constructor(_providerId, isSupportedStage) {
24
+ this._providerId = _providerId;
25
+ this.isSupportedStage = isSupportedStage;
26
+ }
27
+ get id() { return this._providerId; }
28
+ onUnregister() { }
29
+ unregister() {
30
+ UiItemsManager.unregister(this._providerId);
31
+ }
32
+ /** Backstage items are not stage specific so no callback is used */
33
+ provideBackstageItems() {
34
+ return [];
35
+ }
36
+ provideToolbarButtonItemsInternal(_stageId, _stageUsage, _toolbarUsage, _toolbarOrientation, _stageAppData) {
37
+ return [];
38
+ }
39
+ provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) {
40
+ let provideToStage = false;
41
+ if (this.isSupportedStage) {
42
+ provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
43
+ }
44
+ else {
45
+ provideToStage = (stageUsage === StageUsage.General);
46
+ }
47
+ return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];
48
+ }
49
+ provideStatusBarItemsInternal(_stageId, _stageUsage, _stageAppData) {
50
+ return [];
51
+ }
52
+ provideStatusBarItems(stageId, stageUsage, stageAppData) {
53
+ let provideToStage = false;
54
+ if (this.isSupportedStage) {
55
+ provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
56
+ }
57
+ else {
58
+ provideToStage = (stageUsage === StageUsage.General);
59
+ }
60
+ return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];
61
+ }
62
+ provideWidgetsInternal(_stageId, _stageUsage, _location, _section, _zoneLocation, _stageAppData) {
63
+ return [];
64
+ }
65
+ provideWidgets(stageId, stageUsage, location, section, _zoneLocation, stageAppData) {
66
+ let provideToStage = false;
67
+ if (this.isSupportedStage) {
68
+ provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
69
+ }
70
+ else {
71
+ provideToStage = (stageUsage === StageUsage.General);
72
+ }
73
+ return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, _zoneLocation, stageAppData) : [];
74
+ }
75
+ }
76
+ //# sourceMappingURL=BaseUiItemsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseUiItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-abstract/BaseUiItemsProvider.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,4CAA4C;AAC5C;;GAEG;AAOH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAC9B;;;;;OAKG;IACH,YAAsB,WAAmB,EAAS,gBAAmH;QAA/I,gBAAW,GAAX,WAAW,CAAQ;QAAS,qBAAgB,GAAhB,gBAAgB,CAAmG;IAAI,CAAC;IAE1K,IAAW,EAAE,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,YAAY,KAAW,CAAC;IAExB,UAAU;QACf,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;IAED,oEAAoE;IAC7D,qBAAqB;QAC1B,OAAO,EAAE,CAAC;IACZ,CAAC;IAEM,iCAAiC,CAAC,QAAgB,EAAE,WAAmB,EAAE,aAA2B,EAAE,mBAAuC,EAAE,aAAm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OAAe,EAAE,UAAkB,EAAE,QAA4B,EAAE,OAA2B,EAClH,aAAoC,EAAE,YAAkB;QACxD,IAAI,cAAc,GAAG,KAAK,CAAC;QAE3B,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAC;SACjF;aAAM;YACL,cAAc,GAAG,CAAC,UAAU,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChI,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/* eslint-disable deprecation/deprecation */\r\n/** @packageDocumentation\r\n * @module UiItemsProvider\r\n */\r\n\r\nimport { BackstageItem } from \"./backstage/BackstageItem\";\r\nimport { CommonStatusBarItem } from \"./statusbar/StatusBarItem\";\r\nimport { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from \"./toolbars/ToolbarItem\";\r\nimport { AbstractWidgetProps } from \"./widget/AbstractWidgetProps\";\r\nimport { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from \"./widget/StagePanel\";\r\nimport { StageUsage } from \"./items/StageUsage\";\r\nimport { UiItemsProvider } from \"./UiItemsProvider\";\r\nimport { UiItemsManager } from \"./UiItemsManager\";\r\n\r\n/**\r\n * Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the\r\n * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.\r\n * @public\r\n */\r\nexport class BaseUiItemsProvider implements UiItemsProvider {\r\n /*\r\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\r\n * to set up custom stage with their own subset of standard tools.\r\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\r\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\r\n */\r\n constructor(protected _providerId: string, public isSupportedStage?: (stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider) => boolean) { }\r\n\r\n public get id(): string { return this._providerId; }\r\n public onUnregister(): void { }\r\n\r\n public unregister() {\r\n UiItemsManager.unregister(this._providerId);\r\n }\r\n\r\n /** Backstage items are not stage specific so no callback is used */\r\n public provideBackstageItems(): BackstageItem[] {\r\n return [];\r\n }\r\n\r\n public provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[] {\r\n return [];\r\n }\r\n public provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[] {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];\r\n }\r\n\r\n public provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[] {\r\n return [];\r\n }\r\n public provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[] {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];\r\n }\r\n\r\n public provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, _stageAppData?: any): AbstractWidgetProps[] {\r\n return [];\r\n }\r\n\r\n public provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection,\r\n _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps> {\r\n let provideToStage = false;\r\n\r\n if (this.isSupportedStage) {\r\n provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);\r\n } else {\r\n provideToStage = (stageUsage === StageUsage.General);\r\n }\r\n\r\n return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, _zoneLocation, stageAppData) : [];\r\n }\r\n}\r\n"]}
@@ -1,12 +1,13 @@
1
1
  /** @packageDocumentation
2
2
  * @module UiItemsProvider
3
3
  */
4
- import { BeEvent } from "@itwin/core-bentley";
4
+ import { BeEvent, MarkRequired } from "@itwin/core-bentley";
5
5
  import { BackstageItem } from "./backstage/BackstageItem";
6
6
  import { CommonStatusBarItem } from "./statusbar/StatusBarItem";
7
7
  import { CommonToolbarItem, ToolbarOrientation, ToolbarUsage } from "./toolbars/ToolbarItem";
8
8
  import { AbstractWidgetProps } from "./widget/AbstractWidgetProps";
9
9
  import { AbstractZoneLocation, StagePanelLocation, StagePanelSection } from "./widget/StagePanel";
10
+ import { UiItemsProvider } from "./UiItemsProvider";
10
11
  /** Action taken by the application on item provided by a UiItemsProvider
11
12
  * @public @deprecated this was only used by the previously removed UiItemsArbiter.
12
13
  */
@@ -18,52 +19,38 @@ export declare enum UiItemsApplicationAction {
18
19
  /** Update the item during the change */
19
20
  Update = 2
20
21
  }
21
- /** Describes interface of objects that want to provide UI component to the running IModelApp.
22
- * @public
23
- */
24
- export interface UiItemsProvider {
25
- /** id of provider */
26
- readonly id: string;
27
- /** UiItemsManager calls following method to get items to populate specific toolbars */
28
- provideToolbarButtonItems?: (stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any) => CommonToolbarItem[];
29
- /** UiItemsManager calls following method to augment base statusbar for stages that allow it. */
30
- provideStatusBarItems?: (stageId: string, stageUsage: string, stageAppData?: any) => CommonStatusBarItem[];
31
- /** UiItemsManager calls following method to augment backstage items. */
32
- provideBackstageItems?: () => BackstageItem[];
33
- /** UiItemsManager calls following method to augment Widget lists.
34
- * @note Returned widgets must provide unique `AbstractWidgetProps["id"]` to correctly save/restore App layout.
35
- */
36
- provideWidgets?: (stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, zoneLocation?: AbstractZoneLocation, stageAppData?: any) => ReadonlyArray<AbstractWidgetProps>;
37
- /** Function called when the provider is unregistered via `ItemsManager.unregister` to allow provider to do cleanup. */
38
- onUnregister?: () => void;
39
- }
40
- /**
41
- * Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
42
- * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
43
- * @public
44
- */
45
- export declare class BaseUiItemsProvider implements UiItemsProvider {
46
- protected _providerId: string;
47
- isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider | undefined) => boolean) | undefined;
48
- constructor(_providerId: string, isSupportedStage?: ((stageId: string, stageUsage: string, stageAppData?: any, provider?: UiItemsProvider | undefined) => boolean) | undefined);
49
- get id(): string;
50
- onUnregister(): void;
51
- unregister(): void;
52
- /** Backstage items are not stage specific so no callback is used */
53
- provideBackstageItems(): BackstageItem[];
54
- provideToolbarButtonItemsInternal(_stageId: string, _stageUsage: string, _toolbarUsage: ToolbarUsage, _toolbarOrientation: ToolbarOrientation, _stageAppData?: any): CommonToolbarItem[];
55
- provideToolbarButtonItems(stageId: string, stageUsage: string, toolbarUsage: ToolbarUsage, toolbarOrientation: ToolbarOrientation, stageAppData?: any): CommonToolbarItem[];
56
- provideStatusBarItemsInternal(_stageId: string, _stageUsage: string, _stageAppData?: any): CommonStatusBarItem[];
57
- provideStatusBarItems(stageId: string, stageUsage: string, stageAppData?: any): CommonStatusBarItem[];
58
- provideWidgetsInternal(_stageId: string, _stageUsage: string, _location: StagePanelLocation, _section?: StagePanelSection, _stageAppData?: any): AbstractWidgetProps[];
59
- provideWidgets(stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection, _zoneLocation?: AbstractZoneLocation, stageAppData?: any): ReadonlyArray<AbstractWidgetProps>;
60
- }
61
22
  /** UIProvider Registered Event Args interface.
62
23
  * @public
63
24
  */
64
25
  export interface UiItemProviderRegisteredEventArgs {
65
26
  providerId: string;
66
27
  }
28
+ /** UiItemProviderOverrides allows the application that registers a provider to limit when it is allowed to provide items
29
+ * @public
30
+ */
31
+ export interface AllowedUiItemProviderOverrides {
32
+ /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages
33
+ * @beta
34
+ */
35
+ providerId?: string;
36
+ /** if specified then the current stage's Usage will be compared before allowing any items to be provided
37
+ * @beta
38
+ */
39
+ stageUsages?: string[];
40
+ /** if specified then the current stage's Id will be compared before allowing any items to be provided
41
+ * @beta
42
+ */
43
+ stageIds?: string[];
44
+ }
45
+ /** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.
46
+ * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's
47
+ * items are allowed.
48
+ * @public
49
+ */
50
+ export declare type UiItemProviderOverrides = MarkRequired<AllowedUiItemProviderOverrides, "providerId" | "stageUsages"> | MarkRequired<AllowedUiItemProviderOverrides, "providerId" | "stageIds"> | // eslint-disable-line @typescript-eslint/indent
51
+ MarkRequired<AllowedUiItemProviderOverrides, "stageIds"> | // eslint-disable-line @typescript-eslint/indent
52
+ MarkRequired<AllowedUiItemProviderOverrides, "stageUsages"> | // eslint-disable-line @typescript-eslint/indent
53
+ MarkRequired<AllowedUiItemProviderOverrides, "providerId" | "stageUsages" | "stageIds">;
67
54
  /**
68
55
  * Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.
69
56
  * @public
@@ -89,9 +76,10 @@ export declare class UiItemsManager {
89
76
  * Registers a UiItemsProvider with the UiItemsManager.
90
77
  * @param uiProvider the UI items provider to register.
91
78
  */
92
- static register(uiProvider: UiItemsProvider): void;
79
+ static register(uiProvider: UiItemsProvider, overrides?: UiItemProviderOverrides): void;
93
80
  /** Remove a specific UiItemsProvider from the list of available providers. */
94
81
  static unregister(uiProviderId: string): void;
82
+ private static allowItemsFromProvider;
95
83
  /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute
96
84
  * an action or specify a registered ToolId into toolbar.
97
85
  * @param stageId a string identifier the active stage.
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsManager.d.ts","sourceRoot":"","sources":["../../../src/appui-abstract/UiItemsManager.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAU,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIlG;;GAEG;AACH,oBAAY,wBAAwB;IAClC,mCAAmC;IACnC,KAAK,IAAA;IACL,sCAAsC;IACtC,QAAQ,IAAA;IACR,wCAAwC;IACxC,MAAM,IAAA;CACP;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,uFAAuF;IACvF,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,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,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,EAAE,uBAAuB,GAAG,IAAI;IAa9F,8EAA8E;WAChE,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAcpD,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAUrC;;;;;;;OAOG;WACW,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EACjG,kBAAkB,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE;IAsBlF;;;;OAIG;WACW,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,mBAAmB,EAAE;IAwB/G;;OAEG;WACW,iBAAiB,IAAI,aAAa,EAAE;IAuBlD;;;;;;OAMG;WACW,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,oBAAoB,EAAE,YAAY,CAAC,EAAE,GAAG,GAAG,aAAa,CAAC,mBAAmB,CAAC;CAuBtN"}
@@ -8,7 +8,6 @@
8
8
  */
9
9
  import { BeEvent, Logger } from "@itwin/core-bentley";
10
10
  import { loggerCategory } from "./utils/misc";
11
- import { StageUsage } from "./items/StageUsage";
12
11
  /** Action taken by the application on item provided by a UiItemsProvider
13
12
  * @public @deprecated this was only used by the previously removed UiItemsArbiter.
14
13
  */
@@ -21,71 +20,6 @@ export var UiItemsApplicationAction;
21
20
  /** Update the item during the change */
22
21
  UiItemsApplicationAction[UiItemsApplicationAction["Update"] = 2] = "Update";
23
22
  })(UiItemsApplicationAction || (UiItemsApplicationAction = {}));
24
- /**
25
- * Base implementation of a UiItemsProvider. The base class allows the user to pass in a function that is used to determine if the
26
- * active stage should be provided items. Derived provider classes should override the `xxxInternal` methods to provide items.
27
- * @public
28
- */
29
- export class BaseUiItemsProvider {
30
- /*
31
- * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want
32
- * to set up custom stage with their own subset of standard tools.
33
- * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and
34
- * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.
35
- */
36
- constructor(_providerId, isSupportedStage) {
37
- this._providerId = _providerId;
38
- this.isSupportedStage = isSupportedStage;
39
- }
40
- get id() { return this._providerId; }
41
- onUnregister() { }
42
- unregister() {
43
- UiItemsManager.unregister(this._providerId);
44
- }
45
- /** Backstage items are not stage specific so no callback is used */
46
- provideBackstageItems() {
47
- return [];
48
- }
49
- provideToolbarButtonItemsInternal(_stageId, _stageUsage, _toolbarUsage, _toolbarOrientation, _stageAppData) {
50
- return [];
51
- }
52
- provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) {
53
- let provideToStage = false;
54
- if (this.isSupportedStage) {
55
- provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
56
- }
57
- else {
58
- provideToStage = (stageUsage === StageUsage.General);
59
- }
60
- return provideToStage ? this.provideToolbarButtonItemsInternal(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData) : [];
61
- }
62
- provideStatusBarItemsInternal(_stageId, _stageUsage, _stageAppData) {
63
- return [];
64
- }
65
- provideStatusBarItems(stageId, stageUsage, stageAppData) {
66
- let provideToStage = false;
67
- if (this.isSupportedStage) {
68
- provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
69
- }
70
- else {
71
- provideToStage = (stageUsage === StageUsage.General);
72
- }
73
- return provideToStage ? this.provideStatusBarItemsInternal(stageId, stageUsage, stageAppData) : [];
74
- }
75
- provideWidgetsInternal(_stageId, _stageUsage, _location, _section, _stageAppData) {
76
- return [];
77
- }
78
- provideWidgets(stageId, stageUsage, location, section, _zoneLocation, stageAppData) {
79
- let provideToStage = false;
80
- if (this.isSupportedStage) {
81
- provideToStage = this.isSupportedStage(stageId, stageUsage, stageAppData, this);
82
- }
83
- else {
84
- provideToStage = (stageUsage === StageUsage.General);
85
- }
86
- return provideToStage ? this.provideWidgetsInternal(stageId, stageUsage, location, section, stageAppData) : [];
87
- }
88
- }
89
23
  /**
90
24
  * Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.
91
25
  * @public
@@ -110,7 +44,8 @@ export class UiItemsManager {
110
44
  * @param providerId id of the UiItemsProvider to get
111
45
  */
112
46
  static getUiItemsProvider(providerId) {
113
- return UiItemsManager._registeredUiItemsProviders.get(providerId);
47
+ var _a;
48
+ return (_a = UiItemsManager._registeredUiItemsProviders.get(providerId)) === null || _a === void 0 ? void 0 : _a.provider;
114
49
  }
115
50
  static sendRegisteredEvent(ev) {
116
51
  UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(ev);
@@ -119,14 +54,16 @@ export class UiItemsManager {
119
54
  * Registers a UiItemsProvider with the UiItemsManager.
120
55
  * @param uiProvider the UI items provider to register.
121
56
  */
122
- static register(uiProvider) {
123
- if (UiItemsManager.getUiItemsProvider(uiProvider.id)) {
124
- Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProvider.id}) is already loaded`);
57
+ static register(uiProvider, overrides) {
58
+ var _a;
59
+ const providerId = (_a = overrides === null || overrides === void 0 ? void 0 : overrides.providerId) !== null && _a !== void 0 ? _a : uiProvider.id;
60
+ if (UiItemsManager.getUiItemsProvider(providerId)) {
61
+ Logger.logInfo(loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);
125
62
  }
126
63
  else {
127
- UiItemsManager._registeredUiItemsProviders.set(uiProvider.id, uiProvider);
128
- Logger.logInfo(loggerCategory(this), `UiItemsProvider (${uiProvider.id}) loaded`);
129
- UiItemsManager.sendRegisteredEvent({ providerId: uiProvider.id });
64
+ UiItemsManager._registeredUiItemsProviders.set(providerId, { provider: uiProvider, overrides });
65
+ Logger.logInfo(loggerCategory(this), `UiItemsProvider ${uiProvider.id} registered as ${providerId} `);
66
+ UiItemsManager.sendRegisteredEvent({ providerId });
130
67
  }
131
68
  }
132
69
  /** Remove a specific UiItemsProvider from the list of available providers. */
@@ -140,6 +77,15 @@ export class UiItemsManager {
140
77
  // trigger a refresh of the ui
141
78
  UiItemsManager.sendRegisteredEvent({ providerId: uiProviderId });
142
79
  }
80
+ static allowItemsFromProvider(entry, stageId, stageUsage) {
81
+ // istanbul ignore else
82
+ const overrides = entry.overrides;
83
+ if (undefined !== stageId && (overrides === null || overrides === void 0 ? void 0 : overrides.stageIds) && !(overrides.stageIds.some((value) => value === stageId)))
84
+ return false;
85
+ if (undefined !== stageUsage && (overrides === null || overrides === void 0 ? void 0 : overrides.stageUsages) && !(overrides.stageUsages.some((value) => value === stageUsage)))
86
+ return false;
87
+ return true;
88
+ }
143
89
  /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute
144
90
  * an action or specify a registered ToolId into toolbar.
145
91
  * @param stageId a string identifier the active stage.
@@ -152,11 +98,18 @@ export class UiItemsManager {
152
98
  const buttonItems = [];
153
99
  if (0 === UiItemsManager._registeredUiItemsProviders.size)
154
100
  return buttonItems;
155
- UiItemsManager._registeredUiItemsProviders.forEach((uiProvider) => {
101
+ UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
102
+ var _a, _b;
103
+ const uiProvider = entry.provider;
104
+ const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
156
105
  // istanbul ignore else
157
- if (uiProvider.provideToolbarButtonItems) {
106
+ if (uiProvider.provideToolbarButtonItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
158
107
  uiProvider.provideToolbarButtonItems(stageId, stageUsage, toolbarUsage, toolbarOrientation, stageAppData)
159
- .forEach((spec) => buttonItems.push({ ...spec, providerId: uiProvider.id }));
108
+ .forEach((spec) => {
109
+ // ignore duplicate ids
110
+ if (-1 === buttonItems.findIndex((existingItem) => spec.id === existingItem.id))
111
+ buttonItems.push({ ...spec, providerId });
112
+ });
160
113
  }
161
114
  });
162
115
  return buttonItems;
@@ -170,11 +123,18 @@ export class UiItemsManager {
170
123
  const statusBarItems = [];
171
124
  if (0 === UiItemsManager._registeredUiItemsProviders.size)
172
125
  return statusBarItems;
173
- UiItemsManager._registeredUiItemsProviders.forEach((uiProvider) => {
126
+ UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
127
+ var _a, _b;
128
+ const uiProvider = entry.provider;
129
+ const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
174
130
  // istanbul ignore else
175
- if (uiProvider.provideStatusBarItems) {
131
+ if (uiProvider.provideStatusBarItems && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
176
132
  uiProvider.provideStatusBarItems(stageId, stageUsage, stageAppData)
177
- .forEach((item) => statusBarItems.push({ ...item, providerId: uiProvider.id }));
133
+ .forEach((item) => {
134
+ // ignore duplicate ids
135
+ if (-1 === statusBarItems.findIndex((existingItem) => item.id === existingItem.id))
136
+ statusBarItems.push({ ...item, providerId });
137
+ });
178
138
  }
179
139
  });
180
140
  return statusBarItems;
@@ -186,11 +146,18 @@ export class UiItemsManager {
186
146
  const backstageItems = [];
187
147
  if (0 === UiItemsManager._registeredUiItemsProviders.size)
188
148
  return backstageItems;
189
- UiItemsManager._registeredUiItemsProviders.forEach((uiProvider) => {
149
+ UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
150
+ var _a, _b;
151
+ const uiProvider = entry.provider;
152
+ const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
190
153
  // istanbul ignore else
191
- if (uiProvider.provideBackstageItems) {
154
+ if (uiProvider.provideBackstageItems && this.allowItemsFromProvider(entry)) {
192
155
  uiProvider.provideBackstageItems()
193
- .forEach((item) => backstageItems.push({ ...item, providerId: uiProvider.id }));
156
+ .forEach((item) => {
157
+ // ignore duplicate ids
158
+ if (-1 === backstageItems.findIndex((existingItem) => item.id === existingItem.id))
159
+ backstageItems.push({ ...item, providerId });
160
+ });
194
161
  }
195
162
  });
196
163
  return backstageItems;
@@ -206,11 +173,18 @@ export class UiItemsManager {
206
173
  const widgets = [];
207
174
  if (0 === UiItemsManager._registeredUiItemsProviders.size)
208
175
  return widgets;
209
- UiItemsManager._registeredUiItemsProviders.forEach((uiProvider) => {
176
+ UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
177
+ var _a, _b;
178
+ const uiProvider = entry.provider;
179
+ const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
210
180
  // istanbul ignore else
211
- if (uiProvider.provideWidgets) {
181
+ if (uiProvider.provideWidgets && this.allowItemsFromProvider(entry, stageId, stageUsage)) {
212
182
  uiProvider.provideWidgets(stageId, stageUsage, location, section, zoneLocation, stageAppData)
213
- .forEach((widget) => widgets.push({ ...widget, providerId: uiProvider.id }));
183
+ .forEach((widget) => {
184
+ // ignore duplicate ids
185
+ if (-1 === widgets.findIndex((existingItem) => widget.id === existingItem.id))
186
+ widgets.push({ ...widget, providerId });
187
+ });
214
188
  }
215
189
  });
216
190
  return widgets;