@itwin/appui-react 3.0.0-dev.122 → 3.0.0-dev.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/appui-react/backstage/BackstageComposer.d.ts +2 -0
- package/lib/cjs/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposer.js +25 -7
- package/lib/cjs/appui-react/backstage/BackstageComposer.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts +3 -3
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/appui-react/shared/ToolItemDef.d.ts +1 -1
- package/lib/cjs/appui-react/shared/ToolItemDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/shared/ToolItemDef.js +2 -2
- package/lib/cjs/appui-react/shared/ToolItemDef.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js +17 -5
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +1 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +1 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposer.d.ts +2 -0
- package/lib/esm/appui-react/backstage/BackstageComposer.d.ts.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposer.js +26 -8
- package/lib/esm/appui-react/backstage/BackstageComposer.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts +3 -3
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/appui-react/shared/ToolItemDef.d.ts +1 -1
- package/lib/esm/appui-react/shared/ToolItemDef.d.ts.map +1 -1
- package/lib/esm/appui-react/shared/ToolItemDef.js +2 -2
- package/lib/esm/appui-react/shared/ToolItemDef.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.d.ts.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js +17 -5
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/esm/appui-react.d.ts +1 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +1 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/package.json +37 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appui-react.js","sourceRoot":"","sources":["../../src/appui-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,yIAAyI;AAEzI,4DAA0C,CAAE,+DAA+D;AAE3G,8EAA4D;AAC5D,wEAAsD;AACtD,mFAAiE;AACjE,8EAA4D;AAC5D,4EAA0D;AAC1D,wEAAsD;AACtD,oEAAkD;AAClD,0EAAwD;AACxD,yEAAuD;AACvD,2EAAyD;AACzD,oEAAkD;AAClD,yEAAuD;AAEvD,oEAAkD;AAClD,4EAA0D;AAC1D,gFAA8D;AAC9D,6EAA2D;AAC3D,iFAA+D;AAC/D,2EAAyD;AACzD,wEAAsD;AACtD,2EAAyD;AACzD,oEAAkD;AAClD,mFAAiE;AACjE,qEAAmD;AACnD,2FAAyE;AAEzE,qFAAmE;AACnE,qFAAmE;AACnE,qFAAmE;AACnE,qEAAmD;AAEnD,uEAAqD;AACrD,qEAAmD;AACnD,sEAAoD;AACpD,6EAA2D;AAC3D,2EAAyD;AACzD,wEAAsD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AACpE,wEAAsD;AACtD,kEAAgD;AAChD,uEAAqD;AACrD,2EAAyD;AACzD,iFAA+D;AAE/D,2EAAyD;AACzD,8EAA4D;AAC5D,wEAAsD;AACtD,gFAA8D;AAC9D,yEAAuD;AACvD,iFAA+D;AAC/D,yEAAuD;AACvD,+EAA6D;AAC7D,uFAAqE;AACrE,kFAAgE;AAChE,wEAAsD;AACtD,0EAAwD;AACxD,mEAAiD;AACjD,2EAAyD;AACzD,+DAA6C;AAC7C,sEAAoD;AACpD,kEAAgD;AAChD,mEAAiD;AACjD,sEAAoD;AACpD,oEAAkD;AAClD,oEAAkD;AAElD,8DAA4C;AAC5C,kEAAgD;AAEhD,oEAAkD;AAClD,oEAAkD;AAClD,oFAAkE;AAClE,mFAAiE;AACjE,uFAAqE;AACrE,kFAAgE;AAChE,+FAA6E;AAC7E,2DAAyC;AACzC,8DAA4C;AAE5C;;;;GAIG;AACH;;;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;AACH;;;GAGG;AACH;;;GAGG;AAEH;;;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;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\n// cSpell:ignore safearea cursormenu clientservices oidc Textbox Modeless configurableui stagepanels dragdrop uiadmin itemsarbiter Popout\r\n\r\nexport * from \"./appui-react/UiFramework\"; // Please ensure that this line comes before all other exports.\r\n\r\nexport * from \"./appui-react/accudraw/AccuDrawCommandItems\";\r\nexport * from \"./appui-react/accudraw/AccuDrawDialog\";\r\nexport * from \"./appui-react/accudraw/AccuDrawKeyboardShortcuts\";\r\nexport * from \"./appui-react/accudraw/AccuDrawPopupManager\";\r\nexport * from \"./appui-react/accudraw/AccuDrawUiSettings\";\r\nexport * from \"./appui-react/accudraw/AccuDrawWidget\";\r\nexport * from \"./appui-react/accudraw/Calculator\";\r\nexport * from \"./appui-react/accudraw/CalculatorEngine\";\r\nexport * from \"./appui-react/accudraw/CalculatorPopup\";\r\nexport * from \"./appui-react/accudraw/FrameworkAccuDraw\";\r\nexport * from \"./appui-react/accudraw/MenuButton\";\r\nexport * from \"./appui-react/accudraw/MenuButtonPopup\";\r\n\r\nexport * from \"./appui-react/backstage/Backstage\";\r\nexport * from \"./appui-react/backstage/BackstageComposer\";\r\nexport * from \"./appui-react/backstage/BackstageComposerItem\";\r\nexport * from \"./appui-react/backstage/BackstageItemProps\";\r\nexport * from \"./appui-react/backstage/BackstageItemUtilities\";\r\nexport * from \"./appui-react/backstage/BackstageManager\";\r\nexport * from \"./appui-react/backstage/CommandLaunch\";\r\nexport * from \"./appui-react/backstage/FrontstageLaunch\";\r\nexport * from \"./appui-react/backstage/Separator\";\r\nexport * from \"./appui-react/backstage/useDefaultBackstageItems\";\r\nexport * from \"./appui-react/backstage/TaskLaunch\";\r\nexport * from \"./appui-react/backstage/useUiItemsProviderBackstageItems\";\r\n\r\nexport * from \"./appui-react/configurableui/ConfigurableUiContent\";\r\nexport * from \"./appui-react/configurableui/ConfigurableUiControl\";\r\nexport * from \"./appui-react/configurableui/ConfigurableUiManager\";\r\nexport * from \"./appui-react/configurableui/state\";\r\n\r\nexport * from \"./appui-react/content/ContentControl\";\r\nexport * from \"./appui-react/content/ContentGroup\";\r\nexport * from \"./appui-react/content/ContentLayout\";\r\nexport * from \"./appui-react/content/ContentLayoutManager\";\r\nexport * from \"./appui-react/content/ContentViewManager\";\r\nexport * from \"./appui-react/content/ViewStateHelper\";\r\nexport * from \"./appui-react/content/StageContentLayout\";\r\nexport * from \"./appui-react/content/ViewportContentControl\";\r\nexport * from \"./appui-react/content/IModelViewport\";\r\nexport * from \"./appui-react/content/DefaultViewOverlay\";\r\n\r\nexport * from \"./appui-react/cursor/CursorInformation\";\r\nexport * from \"./appui-react/cursor/cursorprompt/CursorPrompt\";\r\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopup\";\r\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopupManager\";\r\nexport * from \"./appui-react/cursor/cursormenu/CursorMenu\";\r\n\r\nexport * from \"./appui-react/dialog/DialogManagerBase\";\r\nexport * from \"./appui-react/dialog/ModalDialogManager\";\r\nexport * from \"./appui-react/dialog/ModelessDialog\";\r\nexport * from \"./appui-react/dialog/ModelessDialogManager\";\r\nexport * from \"./appui-react/dialog/StandardMessageBox\";\r\nexport * from \"./appui-react/dialog/UiDataProvidedDialog\";\r\n\r\nexport * from \"./appui-react/feedback/ValidationTextbox\";\r\nexport * from \"./appui-react/feedback/ElementTooltip\";\r\n\r\nexport * from \"./appui-react/frontstage/Frontstage\";\r\nexport * from \"./appui-react/frontstage/FrontstageComposer\";\r\nexport * from \"./appui-react/frontstage/FrontstageDef\";\r\nexport * from \"./appui-react/frontstage/FrontstageManager\";\r\nexport * from \"./appui-react/frontstage/FrontstageProvider\";\r\nexport * from \"./appui-react/frontstage/NestedFrontstage\";\r\nexport * from \"./appui-react/frontstage/ModalFrontstage\";\r\nexport * from \"./appui-react/frontstage/ModalSettingsStage\";\r\nexport * from \"./appui-react/frontstage/StandardFrontstageProvider\";\r\n\r\nexport * from \"./appui-react/hooks/useActiveIModelConnection\";\r\nexport * from \"./appui-react/hooks/useActiveStageId\";\r\nexport * from \"./appui-react/hooks/useActiveViewport\";\r\nexport * from \"./appui-react/hooks/useAvailableUiItemsProviders\";\r\nexport * from \"./appui-react/hooks/useAnalysisAnimationDataProvider\";\r\nexport * from \"./appui-react/hooks/useFrameworkVersion\";\r\nexport * from \"./appui-react/hooks/useScheduleAnimationDataProvider\";\r\nexport * from \"./appui-react/hooks/useSolarDataProvider\";\r\n\r\nexport * from \"./appui-react/imodel-components/spatial-tree/SpatialContainmentTree\";\r\nexport * from \"./appui-react/imodel-components/category-tree/CategoriesTree\";\r\nexport * from \"./appui-react/imodel-components/models-tree/ModelsTree\";\r\nexport * from \"./appui-react/imodel-components/models-tree/ModelsVisibilityHandler\";\r\nexport * from \"./appui-react/imodel-components/Common\";\r\nexport * from \"./appui-react/imodel-components/VisibilityTreeEventHandler\";\r\nexport * from \"./appui-react/imodel-components/VisibilityTreeRenderer\";\r\n\r\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcut\";\r\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcutMenu\";\r\nexport * from \"./appui-react/keyinbrowser/KeyinBrowser\";\r\n\r\nexport * from \"./appui-react/messages/ActivityMessage\";\r\nexport * from \"./appui-react/messages/ActivityMessagePopup\";\r\nexport * from \"./appui-react/messages/AppNotificationManager\";\r\nexport * from \"./appui-react/messages/InputField\";\r\nexport * from \"./appui-react/messages/MessageManager\";\r\nexport * from \"./appui-react/messages/StatusMessageRenderer\";\r\nexport * from \"./appui-react/messages/Pointer\";\r\nexport * from \"./appui-react/messages/ReactNotifyMessageDetails\";\r\nexport * from \"./appui-react/messages/StickyMessage\";\r\nexport * from \"./appui-react/messages/ToastMessage\";\r\n\r\nexport * from \"./appui-react/navigationaids/CubeNavigationAidControl\";\r\nexport * from \"./appui-react/navigationaids/DrawingNavigationAidControl\";\r\nexport * from \"./appui-react/navigationaids/NavigationAidControl\";\r\nexport * from \"./appui-react/navigationaids/SheetNavigationAid\";\r\nexport * from \"./appui-react/navigationaids/SheetsModalFrontstage\";\r\nexport * from \"./appui-react/navigationaids/StandardRotationNavigationAid\";\r\n\r\nexport * from \"./appui-react/pickers/ListPicker\";\r\nexport * from \"./appui-react/pickers/ViewSelector\";\r\n\r\nexport * from \"./appui-react/childwindow/ChildWindowManager\";\r\n\r\nexport * from \"./appui-react/popup/KeyinPalettePanel\";\r\nexport * from \"./appui-react/popup/KeyinPalettePopup\";\r\nexport * from \"./appui-react/popup/HTMLElementPopup\";\r\nexport * from \"./appui-react/popup/InputEditorPopup\";\r\nexport * from \"./appui-react/popup/PopupManager\";\r\nexport * from \"./appui-react/popup/PositionPopup\";\r\nexport * from \"./appui-react/popup/ToolbarPopup\";\r\n\r\nexport * from \"./appui-react/redux/SessionState\";\r\nexport * from \"./appui-react/redux/StateManager\";\r\nexport * from \"./appui-react/redux/FrameworkState\";\r\nexport * from \"./appui-react/redux/connectIModel\";\r\nexport * from \"./appui-react/redux/ReducerRegistry\";\r\nexport * from \"./appui-react/redux/redux-ts\";\r\n\r\nexport * from \"./appui-react/safearea/SafeAreaContext\";\r\n\r\nexport * from \"./appui-react/selection/SelectionContextItemDef\";\r\nexport * from \"./appui-react/selection/HideIsolateEmphasizeManager\";\r\nexport * from \"./appui-react/selection/ClearEmphasisStatusField\";\r\n\r\nexport * from \"./appui-react/settings/ui/UiSettingsPage\";\r\nexport * from \"./appui-react/settings/quantityformatting/QuantityFormat\";\r\nexport * from \"./appui-react/settings/quantityformatting/UnitSystemSelector\";\r\n\r\nexport * from \"./appui-react/shared/ActionButtonItemDef\";\r\nexport * from \"./appui-react/shared/AnyItemDef\";\r\nexport * from \"./appui-react/shared/AnyToolbarItemDef\";\r\nexport * from \"./appui-react/shared/CommandItemDef\";\r\nexport * from \"./appui-react/shared/CustomItemDef\";\r\nexport * from \"./appui-react/shared/CustomItemProps\";\r\nexport * from \"./appui-react/shared/GroupItemProps\";\r\nexport * from \"./appui-react/shared/ItemDefBase\";\r\nexport * from \"./appui-react/shared/ItemMap\";\r\nexport * from \"./appui-react/shared/ItemProps\";\r\nexport * from \"./appui-react/shared/MenuItem\";\r\nexport * from \"./appui-react/shared/SelectionScope\";\r\nexport * from \"./appui-react/shared/ToolItemDef\";\r\n\r\nexport * from \"./appui-react/stagepanels/FrameworkStagePanel\";\r\nexport * from \"./appui-react/stagepanels/StagePanel\";\r\nexport * from \"./appui-react/stagepanels/StagePanelDef\";\r\nexport * from \"./appui-react/stagepanels/StagePanelHeader\";\r\n\r\nexport * from \"./appui-react/statusbar/StatusBar\";\r\nexport * from \"./appui-react/statusbar/StatusBarWidgetControl\";\r\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\r\nexport * from \"./appui-react/statusbar/StatusBarItem\";\r\nexport * from \"./appui-react/statusbar/StatusBarItemsManager\";\r\nexport * from \"./appui-react/statusbar/StatusBarItemUtilities\";\r\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\r\nexport * from \"./appui-react/statusbar/withMessageCenterFieldProps\";\r\nexport * from \"./appui-react/statusbar/useUiItemsProviderStatusBarItems\";\r\nexport * from \"./appui-react/statusbar/useDefaultStatusBarItems\";\r\nexport * from \"./appui-react/statusbar/withStatusFieldProps\";\r\n\r\nexport * from \"./appui-react/statusfields/tileloading/TileLoadingIndicator\";\r\nexport * from \"./appui-react/statusfields/ActivityCenter\";\r\nexport * from \"./appui-react/statusfields/ConditionalField\";\r\nexport * from \"./appui-react/statusfields/FooterModeField\";\r\nexport * from \"./appui-react/statusfields/Indicator\";\r\nexport * from \"./appui-react/statusfields/MessageCenter\";\r\nexport * from \"./appui-react/statusfields/PromptField\";\r\nexport * from \"./appui-react/statusfields/SectionsField\";\r\nexport * from \"./appui-react/statusfields/SelectionInfo\";\r\nexport * from \"./appui-react/statusfields/SelectionScope\";\r\nexport * from \"./appui-react/statusfields/SnapMode\";\r\nexport * from \"./appui-react/statusfields/StatusFieldProps\";\r\nexport * from \"./appui-react/statusfields/ViewAttributes\";\r\nexport * from \"./appui-react/statusfields/toolassistance/ToolAssistanceField\";\r\n\r\nexport * from \"./appui-react/syncui/SyncUiEventDispatcher\";\r\nexport * from \"./appui-react/syncui/BooleanListener\";\r\n\r\nexport * from \"./appui-react/theme/ThemeManager\";\r\n\r\nexport * from \"./appui-react/timeline/ScheduleAnimationProvider\";\r\nexport * from \"./appui-react/timeline/AnalysisAnimationProvider\";\r\nexport * from \"./appui-react/timeline/SolarTimelineDataProvider\";\r\n\r\nexport * from \"./appui-react/toolbar/ActionButtonItem\";\r\nexport * from \"./appui-react/toolbar/ActionItemButton\";\r\nexport * from \"./appui-react/toolbar/DragInteraction\";\r\nexport * from \"./appui-react/toolbar/ToolbarComposer\";\r\nexport * from \"./appui-react/toolbar/GroupButtonItem\";\r\nexport * from \"./appui-react/toolbar/GroupItem\";\r\nexport * from \"./appui-react/toolbar/PopupButton\";\r\nexport * from \"./appui-react/toolbar/Toolbar\";\r\nexport * from \"./appui-react/toolbar/ToolbarHelper\";\r\nexport * from \"./appui-react/toolbar/ToolButton\";\r\nexport * from \"./appui-react/toolbar/useUiItemsProviderToolbarItems\";\r\nexport * from \"./appui-react/toolbar/useDefaultToolbarItems\";\r\n\r\nexport * from \"./appui-react/tools/CoreToolDefinitions\";\r\nexport * from \"./appui-react/tools/FrameworkToolAdmin\";\r\nexport * from \"./appui-react/tools/MarkupToolDefinitions\";\r\nexport * from \"./appui-react/tools/RestoreLayoutTool\";\r\nexport * from \"./appui-react/tools/ToolSettingsTools\";\r\n\r\nexport * from \"./appui-react/uiadmin/FrameworkUiAdmin\";\r\n\r\nexport * from \"./appui-react/ui-items-provider/StandardContentToolsProvider\";\r\nexport * from \"./appui-react/ui-items-provider/StandardNavigationToolsProvider\";\r\nexport * from \"./appui-react/ui-items-provider/StandardStatusbarItemsProvider\";\r\nexport * from \"./appui-react/uiprovider/DefaultDialogGridContainer\";\r\n\r\nexport * from \"./appui-react/uisettings/AppUiSettings\";\r\nexport * from \"./appui-react/uisettings/UserSettingsStorage\";\r\nexport * from \"./appui-react/uisettings/useUiSettings\";\r\n\r\nexport * from \"./appui-react/UserInfo\";\r\n\r\nexport * from \"./appui-react/utils/ViewUtilities\";\r\nexport * from \"./appui-react/utils/PropsHelper\";\r\nexport * from \"./appui-react/utils/UiShowHideManager\";\r\nexport * from \"./appui-react/utils/ToolbarButtonHelper\";\r\n\r\nexport * from \"./appui-react/widget-panels/Content\";\r\nexport * from \"./appui-react/widget-panels/Frontstage\";\r\nexport * from \"./appui-react/widget-panels/FrontstageContent\";\r\nexport * from \"./appui-react/widget-panels/ModalFrontstageComposer\";\r\nexport * from \"./appui-react/widget-panels/StatusBar\";\r\nexport * from \"./appui-react/widget-panels/Tab\";\r\nexport * from \"./appui-react/widget-panels/Toolbars\";\r\nexport * from \"./appui-react/widget-panels/ToolSettings\";\r\nexport * from \"./appui-react/widget-panels/useWidgetDirection\";\r\n\r\nexport * from \"./appui-react/widgets/BackstageAppButton\";\r\nexport * from \"./appui-react/widgets/BasicNavigationWidget\";\r\nexport * from \"./appui-react/widgets/BasicToolWidget\";\r\nexport * from \"./appui-react/widgets/DefaultNavigationWidget\";\r\nexport * from \"./appui-react/widgets/NavigationWidget\";\r\nexport * from \"./appui-react/widgets/NavigationWidgetComposer\";\r\nexport * from \"./appui-react/widgets/ReviewToolWidget\";\r\nexport * from \"./appui-react/widgets/ViewToolWidgetComposer\";\r\nexport * from \"./appui-react/widgets/StatusBarWidgetComposerControl\";\r\nexport * from \"./appui-react/widgets/ContentToolWidgetComposer\";\r\nexport * from \"./appui-react/widgets/StableWidgetDef\";\r\nexport * from \"./appui-react/widgets/ToolbarWidgetBase\";\r\nexport * from \"./appui-react/widgets/ToolWidget\";\r\nexport * from \"./appui-react/widgets/ToolWidgetComposer\";\r\nexport * from \"./appui-react/widgets/Widget\";\r\nexport * from \"./appui-react/widgets/WidgetControl\";\r\nexport * from \"./appui-react/widgets/WidgetDef\";\r\nexport * from \"./appui-react/widgets/WidgetHost\";\r\nexport * from \"./appui-react/widgets/WidgetManager\";\r\nexport * from \"./appui-react/widgets/WidgetProps\";\r\nexport * from \"./appui-react/widgets/WidgetStack\";\r\n\r\nexport * from \"./appui-react/workflow/Task\";\r\nexport * from \"./appui-react/workflow/Workflow\";\r\n\r\nexport * from \"./appui-react/zones/FrameworkZone\";\r\nexport * from \"./appui-react/zones/StatusBarZone\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolSettingsZone\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolInformation\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolSettingsManager\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolUiProvider\";\r\nexport * from \"./appui-react/zones/toolsettings/DefaultToolSettingsProvider\";\r\nexport * from \"./appui-react/zones/Zone\";\r\nexport * from \"./appui-react/zones/ZoneDef\";\r\n\r\n/** @docs-package-description\r\n * The ui-framework package contains classes and components for specifying the application UI consisting of the\r\n * Backstage, Frontstages, Content Views, Tool Bars, Status Bars, Widgets and Panels.\r\n * For more information, see [learning about ui-framework]($docs/learning/ui/framework/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * Classes and components providing a UI for AccuDraw, an aide for entering coordinate data.\r\n */\r\n/**\r\n * @docs-group-description Admin\r\n * APIs for various UI components, such as toolbars, buttons and menus.\r\n */\r\n/**\r\n * @docs-group-description Backstage\r\n * Classes for working with a Backstage\r\n */\r\n/**\r\n * @docs-group-description ConfigurableUi\r\n * Classes for working with the Application UI Configuration\r\n */\r\n/**\r\n * @docs-group-description ContentView\r\n * Classes for working with a Content View, Group, Layout or Control\r\n */\r\n/**\r\n * @docs-group-description Cursor\r\n * Cursor related information, components and events\r\n */\r\n/**\r\n * @docs-group-description Dialog\r\n * Classes for working with a dialog\r\n */\r\n/**\r\n * @docs-group-description DragDrop\r\n * Classes for managing DragDrop API drag layers\r\n */\r\n/**\r\n * @docs-group-description Frontstage\r\n * Classes for working with a Frontstage\r\n */\r\n/**\r\n * @docs-group-description Hooks\r\n * Hook functions for use in Functional React Components.\r\n */\r\n/**\r\n * @docs-group-description IModelComponents\r\n * Classes for displaying information about an iModel\r\n */\r\n/**\r\n * @docs-group-description Item\r\n * Classes for working with an Item in a Tool Widget, Navigation Widget or Backstage\r\n */\r\n/**\r\n * @docs-group-description KeyboardShortcut\r\n * Classes for working with Keyboard Shortcuts\r\n */\r\n/**\r\n * @docs-group-description NavigationAids\r\n * Classes for working with Navigation Aids\r\n */\r\n/**\r\n * @docs-group-description Notification\r\n * Classes for working with a Notification or Message\r\n */\r\n\r\n/**\r\n * @docs-group-description ChildWindow\r\n * Classes for working with child windows.\r\n */\r\n/**\r\n * @docs-group-description ChildWindowManager\r\n * Classes for working with child windows.\r\n */\r\n/**\r\n * @docs-group-description Picker\r\n * Classes for working with various pickers\r\n */\r\n/**\r\n * @docs-group-description Popup\r\n * Classes for working with popup components\r\n */\r\n/**\r\n * @docs-group-description State\r\n * Classes for maintaining state\r\n */\r\n/**\r\n * @docs-group-description Settings\r\n * Classes and components used by settings pages displayed in the modal settings stage\r\n */\r\n/**\r\n * @docs-group-description StandardUiItemsProvider\r\n * Standard UiItemsProvider classes.\r\n */\r\n/**\r\n * @docs-group-description StatusBar\r\n * Classes for defining a StatusBar\r\n */\r\n/**\r\n * @docs-group-description SyncUi\r\n * Classes for informing UI components to sync/refresh their display\r\n */\r\n/**\r\n * @docs-group-description Timeline\r\n * Classes for working with a TimelineComponent\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Classes used to construct a Toolbar\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Core Tool definitions\r\n */\r\n/**\r\n * @docs-group-description ToolSettings\r\n * Classes for working Tool Settings. See learning documentation [Tool Settings]($docs/learning/ui/framework/toolsettings.md).\r\n */\r\n/**\r\n * @docs-group-description UiProvider\r\n * Interfaces and classes for specifying UI items to be inserted at runtime.\r\n */\r\n/**\r\n * @docs-group-description UiSettings\r\n * Interfaces and classes for persisting UI settings.\r\n */\r\n/**\r\n * @docs-group-description Utilities\r\n * Various utility classes for working with a UI and Redux.\r\n */\r\n/**\r\n * @docs-group-description Widget\r\n * Classes for working with a Widget\r\n */\r\n/**\r\n * @docs-group-description Zone\r\n * Classes for working with a Zone\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"appui-react.js","sourceRoot":"","sources":["../../src/appui-react.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,yIAAyI;AAEzI,4DAA0C,CAAE,+DAA+D;AAE3G,8EAA4D;AAC5D,wEAAsD;AACtD,mFAAiE;AACjE,8EAA4D;AAC5D,4EAA0D;AAC1D,wEAAsD;AACtD,oEAAkD;AAClD,0EAAwD;AACxD,yEAAuD;AACvD,2EAAyD;AACzD,oEAAkD;AAClD,yEAAuD;AAEvD,oEAAkD;AAClD,4EAA0D;AAC1D,gFAA8D;AAC9D,6EAA2D;AAC3D,iFAA+D;AAC/D,2EAAyD;AACzD,wEAAsD;AACtD,2EAAyD;AACzD,oEAAkD;AAClD,mFAAiE;AACjE,qEAAmD;AACnD,2FAAyE;AAEzE,qFAAmE;AACnE,qFAAmE;AACnE,qFAAmE;AACnE,qEAAmD;AAEnD,uEAAqD;AACrD,qEAAmD;AACnD,sEAAoD;AACpD,6EAA2D;AAC3D,2EAAyD;AACzD,wEAAsD;AACtD,2EAAyD;AACzD,+EAA6D;AAC7D,uEAAqD;AACrD,2EAAyD;AAEzD,yEAAuD;AACvD,iFAA+D;AAC/D,+EAA6D;AAC7D,sFAAoE;AACpE,6EAA2D;AAE3D,yEAAuD;AACvD,0EAAwD;AACxD,sEAAoD;AACpD,6EAA2D;AAC3D,0EAAwD;AACxD,4EAA0D;AAE1D,2EAAyD;AACzD,wEAAsD;AAEtD,sEAAoD;AACpD,8EAA4D;AAC5D,yEAAuD;AACvD,6EAA2D;AAC3D,8EAA4D;AAC5D,4EAA0D;AAC1D,2EAAyD;AACzD,8EAA4D;AAC5D,sFAAoE;AAEpE,gFAA8D;AAC9D,uEAAqD;AACrD,wEAAsD;AACtD,mFAAiE;AACjE,uFAAqE;AACrE,0EAAwD;AACxD,uFAAqE;AACrE,2EAAyD;AAEzD,sGAAoF;AACpF,+FAA6E;AAC7E,0GAAwF;AACxF,yFAAuE;AACvE,sGAAoF;AACpF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AACH;;;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;AACH;;;GAGG;AAEH;;;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;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\n// cSpell:ignore safearea cursormenu clientservices oidc Textbox Modeless configurableui stagepanels dragdrop uiadmin itemsarbiter Popout\r\n\r\nexport * from \"./appui-react/UiFramework\"; // Please ensure that this line comes before all other exports.\r\n\r\nexport * from \"./appui-react/accudraw/AccuDrawCommandItems\";\r\nexport * from \"./appui-react/accudraw/AccuDrawDialog\";\r\nexport * from \"./appui-react/accudraw/AccuDrawKeyboardShortcuts\";\r\nexport * from \"./appui-react/accudraw/AccuDrawPopupManager\";\r\nexport * from \"./appui-react/accudraw/AccuDrawUiSettings\";\r\nexport * from \"./appui-react/accudraw/AccuDrawWidget\";\r\nexport * from \"./appui-react/accudraw/Calculator\";\r\nexport * from \"./appui-react/accudraw/CalculatorEngine\";\r\nexport * from \"./appui-react/accudraw/CalculatorPopup\";\r\nexport * from \"./appui-react/accudraw/FrameworkAccuDraw\";\r\nexport * from \"./appui-react/accudraw/MenuButton\";\r\nexport * from \"./appui-react/accudraw/MenuButtonPopup\";\r\n\r\nexport * from \"./appui-react/backstage/Backstage\";\r\nexport * from \"./appui-react/backstage/BackstageComposer\";\r\nexport * from \"./appui-react/backstage/BackstageComposerItem\";\r\nexport * from \"./appui-react/backstage/BackstageItemProps\";\r\nexport * from \"./appui-react/backstage/BackstageItemUtilities\";\r\nexport * from \"./appui-react/backstage/BackstageManager\";\r\nexport * from \"./appui-react/backstage/CommandLaunch\";\r\nexport * from \"./appui-react/backstage/FrontstageLaunch\";\r\nexport * from \"./appui-react/backstage/Separator\";\r\nexport * from \"./appui-react/backstage/useDefaultBackstageItems\";\r\nexport * from \"./appui-react/backstage/TaskLaunch\";\r\nexport * from \"./appui-react/backstage/useUiItemsProviderBackstageItems\";\r\n\r\nexport * from \"./appui-react/configurableui/ConfigurableUiContent\";\r\nexport * from \"./appui-react/configurableui/ConfigurableUiControl\";\r\nexport * from \"./appui-react/configurableui/ConfigurableUiManager\";\r\nexport * from \"./appui-react/configurableui/state\";\r\n\r\nexport * from \"./appui-react/content/ContentControl\";\r\nexport * from \"./appui-react/content/ContentGroup\";\r\nexport * from \"./appui-react/content/ContentLayout\";\r\nexport * from \"./appui-react/content/ContentLayoutManager\";\r\nexport * from \"./appui-react/content/ContentViewManager\";\r\nexport * from \"./appui-react/content/ViewStateHelper\";\r\nexport * from \"./appui-react/content/StageContentLayout\";\r\nexport * from \"./appui-react/content/ViewportContentControl\";\r\nexport * from \"./appui-react/content/IModelViewport\";\r\nexport * from \"./appui-react/content/DefaultViewOverlay\";\r\n\r\nexport * from \"./appui-react/cursor/CursorInformation\";\r\nexport * from \"./appui-react/cursor/cursorprompt/CursorPrompt\";\r\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopup\";\r\nexport * from \"./appui-react/cursor/cursorpopup/CursorPopupManager\";\r\nexport * from \"./appui-react/cursor/cursormenu/CursorMenu\";\r\n\r\nexport * from \"./appui-react/dialog/DialogManagerBase\";\r\nexport * from \"./appui-react/dialog/ModalDialogManager\";\r\nexport * from \"./appui-react/dialog/ModelessDialog\";\r\nexport * from \"./appui-react/dialog/ModelessDialogManager\";\r\nexport * from \"./appui-react/dialog/StandardMessageBox\";\r\nexport * from \"./appui-react/dialog/UiDataProvidedDialog\";\r\n\r\nexport * from \"./appui-react/feedback/ValidationTextbox\";\r\nexport * from \"./appui-react/feedback/ElementTooltip\";\r\n\r\nexport * from \"./appui-react/frontstage/Frontstage\";\r\nexport * from \"./appui-react/frontstage/FrontstageComposer\";\r\nexport * from \"./appui-react/frontstage/FrontstageDef\";\r\nexport * from \"./appui-react/frontstage/FrontstageManager\";\r\nexport * from \"./appui-react/frontstage/FrontstageProvider\";\r\nexport * from \"./appui-react/frontstage/NestedFrontstage\";\r\nexport * from \"./appui-react/frontstage/ModalFrontstage\";\r\nexport * from \"./appui-react/frontstage/ModalSettingsStage\";\r\nexport * from \"./appui-react/frontstage/StandardFrontstageProvider\";\r\n\r\nexport * from \"./appui-react/hooks/useActiveIModelConnection\";\r\nexport * from \"./appui-react/hooks/useActiveStageId\";\r\nexport * from \"./appui-react/hooks/useActiveViewport\";\r\nexport * from \"./appui-react/hooks/useAvailableUiItemsProviders\";\r\nexport * from \"./appui-react/hooks/useAnalysisAnimationDataProvider\";\r\nexport * from \"./appui-react/hooks/useFrameworkVersion\";\r\nexport * from \"./appui-react/hooks/useScheduleAnimationDataProvider\";\r\nexport * from \"./appui-react/hooks/useSolarDataProvider\";\r\n\r\nexport * from \"./appui-react/imodel-components/spatial-tree/SpatialContainmentTree\";\r\nexport * from \"./appui-react/imodel-components/category-tree/CategoriesTree\";\r\nexport * from \"./appui-react/imodel-components/category-tree/CategoryVisibilityHandler\";\r\nexport * from \"./appui-react/imodel-components/models-tree/ModelsTree\";\r\nexport * from \"./appui-react/imodel-components/models-tree/ModelsVisibilityHandler\";\r\nexport * from \"./appui-react/imodel-components/Common\";\r\nexport * from \"./appui-react/imodel-components/VisibilityTreeEventHandler\";\r\nexport * from \"./appui-react/imodel-components/VisibilityTreeRenderer\";\r\n\r\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcut\";\r\nexport * from \"./appui-react/keyboardshortcut/KeyboardShortcutMenu\";\r\nexport * from \"./appui-react/keyinbrowser/KeyinBrowser\";\r\n\r\nexport * from \"./appui-react/messages/ActivityMessage\";\r\nexport * from \"./appui-react/messages/ActivityMessagePopup\";\r\nexport * from \"./appui-react/messages/AppNotificationManager\";\r\nexport * from \"./appui-react/messages/InputField\";\r\nexport * from \"./appui-react/messages/MessageManager\";\r\nexport * from \"./appui-react/messages/StatusMessageRenderer\";\r\nexport * from \"./appui-react/messages/Pointer\";\r\nexport * from \"./appui-react/messages/ReactNotifyMessageDetails\";\r\nexport * from \"./appui-react/messages/StickyMessage\";\r\nexport * from \"./appui-react/messages/ToastMessage\";\r\n\r\nexport * from \"./appui-react/navigationaids/CubeNavigationAidControl\";\r\nexport * from \"./appui-react/navigationaids/DrawingNavigationAidControl\";\r\nexport * from \"./appui-react/navigationaids/NavigationAidControl\";\r\nexport * from \"./appui-react/navigationaids/SheetNavigationAid\";\r\nexport * from \"./appui-react/navigationaids/SheetsModalFrontstage\";\r\nexport * from \"./appui-react/navigationaids/StandardRotationNavigationAid\";\r\n\r\nexport * from \"./appui-react/pickers/ListPicker\";\r\nexport * from \"./appui-react/pickers/ViewSelector\";\r\n\r\nexport * from \"./appui-react/childwindow/ChildWindowManager\";\r\n\r\nexport * from \"./appui-react/popup/KeyinPalettePanel\";\r\nexport * from \"./appui-react/popup/KeyinPalettePopup\";\r\nexport * from \"./appui-react/popup/HTMLElementPopup\";\r\nexport * from \"./appui-react/popup/InputEditorPopup\";\r\nexport * from \"./appui-react/popup/PopupManager\";\r\nexport * from \"./appui-react/popup/PositionPopup\";\r\nexport * from \"./appui-react/popup/ToolbarPopup\";\r\n\r\nexport * from \"./appui-react/redux/SessionState\";\r\nexport * from \"./appui-react/redux/StateManager\";\r\nexport * from \"./appui-react/redux/FrameworkState\";\r\nexport * from \"./appui-react/redux/connectIModel\";\r\nexport * from \"./appui-react/redux/ReducerRegistry\";\r\nexport * from \"./appui-react/redux/redux-ts\";\r\n\r\nexport * from \"./appui-react/safearea/SafeAreaContext\";\r\n\r\nexport * from \"./appui-react/selection/SelectionContextItemDef\";\r\nexport * from \"./appui-react/selection/HideIsolateEmphasizeManager\";\r\nexport * from \"./appui-react/selection/ClearEmphasisStatusField\";\r\n\r\nexport * from \"./appui-react/settings/ui/UiSettingsPage\";\r\nexport * from \"./appui-react/settings/quantityformatting/QuantityFormat\";\r\nexport * from \"./appui-react/settings/quantityformatting/UnitSystemSelector\";\r\n\r\nexport * from \"./appui-react/shared/ActionButtonItemDef\";\r\nexport * from \"./appui-react/shared/AnyItemDef\";\r\nexport * from \"./appui-react/shared/AnyToolbarItemDef\";\r\nexport * from \"./appui-react/shared/CommandItemDef\";\r\nexport * from \"./appui-react/shared/CustomItemDef\";\r\nexport * from \"./appui-react/shared/CustomItemProps\";\r\nexport * from \"./appui-react/shared/GroupItemProps\";\r\nexport * from \"./appui-react/shared/ItemDefBase\";\r\nexport * from \"./appui-react/shared/ItemMap\";\r\nexport * from \"./appui-react/shared/ItemProps\";\r\nexport * from \"./appui-react/shared/MenuItem\";\r\nexport * from \"./appui-react/shared/SelectionScope\";\r\nexport * from \"./appui-react/shared/ToolItemDef\";\r\n\r\nexport * from \"./appui-react/stagepanels/FrameworkStagePanel\";\r\nexport * from \"./appui-react/stagepanels/StagePanel\";\r\nexport * from \"./appui-react/stagepanels/StagePanelDef\";\r\nexport * from \"./appui-react/stagepanels/StagePanelHeader\";\r\n\r\nexport * from \"./appui-react/statusbar/StatusBar\";\r\nexport * from \"./appui-react/statusbar/StatusBarWidgetControl\";\r\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\r\nexport * from \"./appui-react/statusbar/StatusBarItem\";\r\nexport * from \"./appui-react/statusbar/StatusBarItemsManager\";\r\nexport * from \"./appui-react/statusbar/StatusBarItemUtilities\";\r\nexport * from \"./appui-react/statusbar/StatusBarComposer\";\r\nexport * from \"./appui-react/statusbar/withMessageCenterFieldProps\";\r\nexport * from \"./appui-react/statusbar/useUiItemsProviderStatusBarItems\";\r\nexport * from \"./appui-react/statusbar/useDefaultStatusBarItems\";\r\nexport * from \"./appui-react/statusbar/withStatusFieldProps\";\r\n\r\nexport * from \"./appui-react/statusfields/tileloading/TileLoadingIndicator\";\r\nexport * from \"./appui-react/statusfields/ActivityCenter\";\r\nexport * from \"./appui-react/statusfields/ConditionalField\";\r\nexport * from \"./appui-react/statusfields/FooterModeField\";\r\nexport * from \"./appui-react/statusfields/Indicator\";\r\nexport * from \"./appui-react/statusfields/MessageCenter\";\r\nexport * from \"./appui-react/statusfields/PromptField\";\r\nexport * from \"./appui-react/statusfields/SectionsField\";\r\nexport * from \"./appui-react/statusfields/SelectionInfo\";\r\nexport * from \"./appui-react/statusfields/SelectionScope\";\r\nexport * from \"./appui-react/statusfields/SnapMode\";\r\nexport * from \"./appui-react/statusfields/StatusFieldProps\";\r\nexport * from \"./appui-react/statusfields/ViewAttributes\";\r\nexport * from \"./appui-react/statusfields/toolassistance/ToolAssistanceField\";\r\n\r\nexport * from \"./appui-react/syncui/SyncUiEventDispatcher\";\r\nexport * from \"./appui-react/syncui/BooleanListener\";\r\n\r\nexport * from \"./appui-react/theme/ThemeManager\";\r\n\r\nexport * from \"./appui-react/timeline/ScheduleAnimationProvider\";\r\nexport * from \"./appui-react/timeline/AnalysisAnimationProvider\";\r\nexport * from \"./appui-react/timeline/SolarTimelineDataProvider\";\r\n\r\nexport * from \"./appui-react/toolbar/ActionButtonItem\";\r\nexport * from \"./appui-react/toolbar/ActionItemButton\";\r\nexport * from \"./appui-react/toolbar/DragInteraction\";\r\nexport * from \"./appui-react/toolbar/ToolbarComposer\";\r\nexport * from \"./appui-react/toolbar/GroupButtonItem\";\r\nexport * from \"./appui-react/toolbar/GroupItem\";\r\nexport * from \"./appui-react/toolbar/PopupButton\";\r\nexport * from \"./appui-react/toolbar/Toolbar\";\r\nexport * from \"./appui-react/toolbar/ToolbarHelper\";\r\nexport * from \"./appui-react/toolbar/ToolButton\";\r\nexport * from \"./appui-react/toolbar/useUiItemsProviderToolbarItems\";\r\nexport * from \"./appui-react/toolbar/useDefaultToolbarItems\";\r\n\r\nexport * from \"./appui-react/tools/CoreToolDefinitions\";\r\nexport * from \"./appui-react/tools/FrameworkToolAdmin\";\r\nexport * from \"./appui-react/tools/MarkupToolDefinitions\";\r\nexport * from \"./appui-react/tools/RestoreLayoutTool\";\r\nexport * from \"./appui-react/tools/ToolSettingsTools\";\r\n\r\nexport * from \"./appui-react/uiadmin/FrameworkUiAdmin\";\r\n\r\nexport * from \"./appui-react/ui-items-provider/StandardContentToolsProvider\";\r\nexport * from \"./appui-react/ui-items-provider/StandardNavigationToolsProvider\";\r\nexport * from \"./appui-react/ui-items-provider/StandardStatusbarItemsProvider\";\r\nexport * from \"./appui-react/uiprovider/DefaultDialogGridContainer\";\r\n\r\nexport * from \"./appui-react/uisettings/AppUiSettings\";\r\nexport * from \"./appui-react/uisettings/UserSettingsStorage\";\r\nexport * from \"./appui-react/uisettings/useUiSettings\";\r\n\r\nexport * from \"./appui-react/UserInfo\";\r\n\r\nexport * from \"./appui-react/utils/ViewUtilities\";\r\nexport * from \"./appui-react/utils/PropsHelper\";\r\nexport * from \"./appui-react/utils/UiShowHideManager\";\r\nexport * from \"./appui-react/utils/ToolbarButtonHelper\";\r\n\r\nexport * from \"./appui-react/widget-panels/Content\";\r\nexport * from \"./appui-react/widget-panels/Frontstage\";\r\nexport * from \"./appui-react/widget-panels/FrontstageContent\";\r\nexport * from \"./appui-react/widget-panels/ModalFrontstageComposer\";\r\nexport * from \"./appui-react/widget-panels/StatusBar\";\r\nexport * from \"./appui-react/widget-panels/Tab\";\r\nexport * from \"./appui-react/widget-panels/Toolbars\";\r\nexport * from \"./appui-react/widget-panels/ToolSettings\";\r\nexport * from \"./appui-react/widget-panels/useWidgetDirection\";\r\n\r\nexport * from \"./appui-react/widgets/BackstageAppButton\";\r\nexport * from \"./appui-react/widgets/BasicNavigationWidget\";\r\nexport * from \"./appui-react/widgets/BasicToolWidget\";\r\nexport * from \"./appui-react/widgets/DefaultNavigationWidget\";\r\nexport * from \"./appui-react/widgets/NavigationWidget\";\r\nexport * from \"./appui-react/widgets/NavigationWidgetComposer\";\r\nexport * from \"./appui-react/widgets/ReviewToolWidget\";\r\nexport * from \"./appui-react/widgets/ViewToolWidgetComposer\";\r\nexport * from \"./appui-react/widgets/StatusBarWidgetComposerControl\";\r\nexport * from \"./appui-react/widgets/ContentToolWidgetComposer\";\r\nexport * from \"./appui-react/widgets/StableWidgetDef\";\r\nexport * from \"./appui-react/widgets/ToolbarWidgetBase\";\r\nexport * from \"./appui-react/widgets/ToolWidget\";\r\nexport * from \"./appui-react/widgets/ToolWidgetComposer\";\r\nexport * from \"./appui-react/widgets/Widget\";\r\nexport * from \"./appui-react/widgets/WidgetControl\";\r\nexport * from \"./appui-react/widgets/WidgetDef\";\r\nexport * from \"./appui-react/widgets/WidgetHost\";\r\nexport * from \"./appui-react/widgets/WidgetManager\";\r\nexport * from \"./appui-react/widgets/WidgetProps\";\r\nexport * from \"./appui-react/widgets/WidgetStack\";\r\n\r\nexport * from \"./appui-react/workflow/Task\";\r\nexport * from \"./appui-react/workflow/Workflow\";\r\n\r\nexport * from \"./appui-react/zones/FrameworkZone\";\r\nexport * from \"./appui-react/zones/StatusBarZone\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolSettingsZone\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolInformation\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolSettingsManager\";\r\nexport * from \"./appui-react/zones/toolsettings/ToolUiProvider\";\r\nexport * from \"./appui-react/zones/toolsettings/DefaultToolSettingsProvider\";\r\nexport * from \"./appui-react/zones/Zone\";\r\nexport * from \"./appui-react/zones/ZoneDef\";\r\n\r\n/** @docs-package-description\r\n * The ui-framework package contains classes and components for specifying the application UI consisting of the\r\n * Backstage, Frontstages, Content Views, Tool Bars, Status Bars, Widgets and Panels.\r\n * For more information, see [learning about ui-framework]($docs/learning/ui/framework/index.md).\r\n */\r\n/**\r\n * @docs-group-description AccuDraw\r\n * Classes and components providing a UI for AccuDraw, an aide for entering coordinate data.\r\n */\r\n/**\r\n * @docs-group-description Admin\r\n * APIs for various UI components, such as toolbars, buttons and menus.\r\n */\r\n/**\r\n * @docs-group-description Backstage\r\n * Classes for working with a Backstage\r\n */\r\n/**\r\n * @docs-group-description ConfigurableUi\r\n * Classes for working with the Application UI Configuration\r\n */\r\n/**\r\n * @docs-group-description ContentView\r\n * Classes for working with a Content View, Group, Layout or Control\r\n */\r\n/**\r\n * @docs-group-description Cursor\r\n * Cursor related information, components and events\r\n */\r\n/**\r\n * @docs-group-description Dialog\r\n * Classes for working with a dialog\r\n */\r\n/**\r\n * @docs-group-description DragDrop\r\n * Classes for managing DragDrop API drag layers\r\n */\r\n/**\r\n * @docs-group-description Frontstage\r\n * Classes for working with a Frontstage\r\n */\r\n/**\r\n * @docs-group-description Hooks\r\n * Hook functions for use in Functional React Components.\r\n */\r\n/**\r\n * @docs-group-description IModelComponents\r\n * Classes for displaying information about an iModel\r\n */\r\n/**\r\n * @docs-group-description Item\r\n * Classes for working with an Item in a Tool Widget, Navigation Widget or Backstage\r\n */\r\n/**\r\n * @docs-group-description KeyboardShortcut\r\n * Classes for working with Keyboard Shortcuts\r\n */\r\n/**\r\n * @docs-group-description NavigationAids\r\n * Classes for working with Navigation Aids\r\n */\r\n/**\r\n * @docs-group-description Notification\r\n * Classes for working with a Notification or Message\r\n */\r\n\r\n/**\r\n * @docs-group-description ChildWindow\r\n * Classes for working with child windows.\r\n */\r\n/**\r\n * @docs-group-description ChildWindowManager\r\n * Classes for working with child windows.\r\n */\r\n/**\r\n * @docs-group-description Picker\r\n * Classes for working with various pickers\r\n */\r\n/**\r\n * @docs-group-description Popup\r\n * Classes for working with popup components\r\n */\r\n/**\r\n * @docs-group-description State\r\n * Classes for maintaining state\r\n */\r\n/**\r\n * @docs-group-description Settings\r\n * Classes and components used by settings pages displayed in the modal settings stage\r\n */\r\n/**\r\n * @docs-group-description StandardUiItemsProvider\r\n * Standard UiItemsProvider classes.\r\n */\r\n/**\r\n * @docs-group-description StatusBar\r\n * Classes for defining a StatusBar\r\n */\r\n/**\r\n * @docs-group-description SyncUi\r\n * Classes for informing UI components to sync/refresh their display\r\n */\r\n/**\r\n * @docs-group-description Timeline\r\n * Classes for working with a TimelineComponent\r\n */\r\n/**\r\n * @docs-group-description Toolbar\r\n * Classes used to construct a Toolbar\r\n */\r\n/**\r\n * @docs-group-description Tools\r\n * Core Tool definitions\r\n */\r\n/**\r\n * @docs-group-description ToolSettings\r\n * Classes for working Tool Settings. See learning documentation [Tool Settings]($docs/learning/ui/framework/toolsettings.md).\r\n */\r\n/**\r\n * @docs-group-description UiProvider\r\n * Interfaces and classes for specifying UI items to be inserted at runtime.\r\n */\r\n/**\r\n * @docs-group-description UiSettings\r\n * Interfaces and classes for persisting UI settings.\r\n */\r\n/**\r\n * @docs-group-description Utilities\r\n * Various utility classes for working with a UI and Redux.\r\n */\r\n/**\r\n * @docs-group-description Widget\r\n * Classes for working with a Widget\r\n */\r\n/**\r\n * @docs-group-description Zone\r\n * Classes for working with a Zone\r\n */\r\n"]}
|
|
@@ -18,6 +18,8 @@ export interface BackstageComposerProps extends CommonProps {
|
|
|
18
18
|
readonly showOverlay?: boolean;
|
|
19
19
|
/** List of backstage items to show */
|
|
20
20
|
readonly items: BackstageItem[];
|
|
21
|
+
/** If true and only one stage launcher item is found, do not show entry in backstage */
|
|
22
|
+
readonly hideSoloStageEntry?: boolean;
|
|
21
23
|
}
|
|
22
24
|
/** Backstage component composed from [[BackstageManager]] items.
|
|
23
25
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackstageComposer.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"BackstageComposer.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAmE,MAAM,uBAAuB,CAAC;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAsEhD,gBAAgB;AAChB,oBAAY,YAAY,GAAG,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvE,gBAAgB;AAChB,eAAO,MAAM,eAAe,UAAW,cAAc,aAAa,CAAC,iBA+BlE,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,gGAAgG;IAChG,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAChC,wFAAwF;IACxF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eA0D9D"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module Backstage
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { BackstageItemsManager, ConditionalBooleanValue } from "@itwin/appui-abstract";
|
|
9
|
+
import { BackstageItemsManager, ConditionalBooleanValue, isStageLauncher } from "@itwin/appui-abstract";
|
|
10
10
|
import { BackstageSeparator, Backstage as NZ_Backstage } from "@itwin/appui-layout-react";
|
|
11
11
|
import { SafeAreaContext } from "../safearea/SafeAreaContext";
|
|
12
12
|
import { SyncUiEventDispatcher } from "../syncui/SyncUiEventDispatcher";
|
|
@@ -40,12 +40,30 @@ function useBackstageItemSyncEffect(itemsManager, syncIdsOfInterest) {
|
|
|
40
40
|
}, [itemsManager, itemsManager.items, syncIdsOfInterest]);
|
|
41
41
|
}
|
|
42
42
|
/** local function to combine items from Stage and from Extensions */
|
|
43
|
-
function combineItems(stageItems, addonItems) {
|
|
44
|
-
|
|
45
|
-
if (stageItems.length)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
function combineItems(stageItems, addonItems, hideSoloStageEntry) {
|
|
44
|
+
let items = [];
|
|
45
|
+
if (stageItems.length) {
|
|
46
|
+
// Walk through each and ensure no duplicate ids are added.
|
|
47
|
+
stageItems.forEach((srcItem) => {
|
|
48
|
+
if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
|
|
49
|
+
items.push(srcItem);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (addonItems.length) {
|
|
54
|
+
// Walk through each and ensure no duplicate ids are added.
|
|
55
|
+
addonItems.forEach((srcItem) => {
|
|
56
|
+
if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
|
|
57
|
+
items.push(srcItem);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (hideSoloStageEntry) {
|
|
62
|
+
// per user request don't show stage launcher if only one stage is available
|
|
63
|
+
const numberOfFrontstageItems = items.reduce((accumulator, item) => accumulator + (isStageLauncher(item) ? 1 : 0), 0);
|
|
64
|
+
if (1 === numberOfFrontstageItems)
|
|
65
|
+
items = items.filter((item) => !isStageLauncher(item));
|
|
66
|
+
}
|
|
49
67
|
return items;
|
|
50
68
|
}
|
|
51
69
|
/** @internal */
|
|
@@ -106,7 +124,7 @@ export function BackstageComposer(props) {
|
|
|
106
124
|
const addonItems = useUiItemsProviderBackstageItems(addonItemsManager);
|
|
107
125
|
const addonSyncIdsOfInterest = React.useMemo(() => BackstageItemsManager.getSyncIdsOfInterest(addonItems), [addonItems]);
|
|
108
126
|
useBackstageItemSyncEffect(addonItemsManager, addonSyncIdsOfInterest);
|
|
109
|
-
const combinedBackstageItems = React.useMemo(() => combineItems(defaultItems, addonItems), [defaultItems, addonItems]);
|
|
127
|
+
const combinedBackstageItems = React.useMemo(() => combineItems(defaultItems, addonItems, !!props.hideSoloStageEntry), [defaultItems, addonItems, props.hideSoloStageEntry]);
|
|
110
128
|
const groups = useGroupedItems(combinedBackstageItems);
|
|
111
129
|
return (React.createElement(NZ_Backstage, { className: props.className, header: props.header, isOpen: isOpen, onClose: handleClose, safeAreaInsets: safeAreaInsets, showOverlay: props.showOverlay, style: props.style }, groups.map((group, groupIndex) => (group.map((item, itemIndex) => {
|
|
112
130
|
const composerItem = (React.createElement(BackstageComposerItem, { item: item, key: item.id }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackstageComposer.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEtG,OAAO,EAAE,kBAAkB,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAmB,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,yBAAyB;AAEzB,0EAA0E;AAC1E,SAAS,0BAA0B,CAAC,YAAmC,EAAE,iBAA2B;IAClG,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE1C,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Y,CACE,CAClB,CAAC,CAAC,CAAC,YAAY,CAAC;IACnB,CAAC,CAAC,CACH,CAAC,CACW,CAChB,CAAC;AACJ,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 Backstage\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { BackstageItem, BackstageItemsManager, ConditionalBooleanValue } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { BackstageSeparator, Backstage as NZ_Backstage } from \"@itwin/appui-layout-react\";\r\nimport { SafeAreaContext } from \"../safearea/SafeAreaContext\";\r\nimport { SyncUiEventArgs, SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\r\nimport { BackstageComposerItem } from \"./BackstageComposerItem\";\r\nimport { useBackstageManager, useIsBackstageOpen } from \"./BackstageManager\";\r\nimport { useDefaultBackstageItems } from \"./useDefaultBackstageItems\";\r\nimport { useUiItemsProviderBackstageItems } from \"./useUiItemsProviderBackstageItems\";\r\n\r\n// cSpell:ignore safearea\r\n\r\n/** Private function to set up sync event monitoring of backstage items */\r\nfunction useBackstageItemSyncEffect(itemsManager: BackstageItemsManager, syncIdsOfInterest: string[]) {\r\n const isInitialMount = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n const handleSyncUiEvent = (args: SyncUiEventArgs) => {\r\n if (0 === syncIdsOfInterest.length)\r\n return;\r\n\r\n // istanbul ignore else\r\n if (syncIdsOfInterest.some((value: string): boolean => args.eventIds.has(value.toLowerCase()))) {\r\n // process each item that has interest\r\n itemsManager.refreshAffectedItems(args.eventIds);\r\n }\r\n };\r\n\r\n if (isInitialMount.current) {\r\n isInitialMount.current = false;\r\n // initialize the display state of any items with syncIds/condition defined\r\n itemsManager.refreshAffectedItems(new Set(syncIdsOfInterest));\r\n }\r\n\r\n SyncUiEventDispatcher.onSyncUiEvent.addListener(handleSyncUiEvent);\r\n return () => {\r\n SyncUiEventDispatcher.onSyncUiEvent.removeListener(handleSyncUiEvent);\r\n };\r\n }, [itemsManager, itemsManager.items, syncIdsOfInterest]);\r\n}\r\n\r\n/** local function to combine items from Stage and from Extensions */\r\nfunction combineItems(stageItems: ReadonlyArray<BackstageItem>, addonItems: ReadonlyArray<BackstageItem>) {\r\n const items: BackstageItem[] = [];\r\n if (stageItems.length)\r\n items.push(...stageItems);\r\n if (addonItems.length)\r\n items.push(...addonItems);\r\n return items;\r\n}\r\n\r\n/** @internal */\r\nexport type GroupedItems = ReadonlyArray<ReadonlyArray<BackstageItem>>;\r\n\r\n/** @internal */\r\nexport const useGroupedItems = (items: ReadonlyArray<BackstageItem>): GroupedItems => {\r\n return React.useMemo(() => {\r\n const grouped = items.reduce<GroupedItems>((acc, item) => {\r\n if (ConditionalBooleanValue.getValue(item.isHidden))\r\n return acc;\r\n const groupIndex = acc.findIndex((group) => group[0].groupPriority === item.groupPriority);\r\n if (groupIndex >= 0)\r\n return [\r\n ...acc.slice(0, groupIndex),\r\n [\r\n ...acc[groupIndex],\r\n item,\r\n ],\r\n ...acc.slice(groupIndex + 1),\r\n ];\r\n return [\r\n ...acc,\r\n [\r\n item,\r\n ],\r\n ];\r\n }, []);\r\n const sortedGroups = grouped.reduce<GroupedItems>((acc, group) => {\r\n const sortedGroup = [...group].sort((a, b) => a.itemPriority - b.itemPriority);\r\n return [\r\n ...acc,\r\n sortedGroup,\r\n ];\r\n }, []);\r\n return [...sortedGroups].sort((a, b) => a[0].groupPriority - b[0].groupPriority);\r\n }, [items]);\r\n};\r\n\r\n/** Props of [[BackstageComposer]] component.\r\n * @public\r\n */\r\nexport interface BackstageComposerProps extends CommonProps {\r\n /** React node for an optional header item */\r\n readonly header?: React.ReactNode;\r\n /** Indicates whether to place an overlay over the frontstage when the backstage is displayed */\r\n readonly showOverlay?: boolean;\r\n /** List of backstage items to show */\r\n readonly items: BackstageItem[];\r\n}\r\n\r\n/** Backstage component composed from [[BackstageManager]] items.\r\n * @public\r\n */\r\nexport function BackstageComposer(props: BackstageComposerProps) {\r\n const [defaultItemsManager, setDefaultItemsManager] = React.useState(new BackstageItemsManager(props.items));\r\n const initialItems = React.useRef(props.items);\r\n\r\n React.useEffect(() => {\r\n if (initialItems.current !== props.items) {\r\n initialItems.current = props.items;\r\n setDefaultItemsManager(new BackstageItemsManager(props.items));\r\n }\r\n }, [props.items]);\r\n\r\n const manager = useBackstageManager();\r\n const isOpen = useIsBackstageOpen(manager);\r\n const safeAreaInsets = React.useContext(SafeAreaContext);\r\n const handleClose = React.useCallback(() => {\r\n manager.close();\r\n }, [manager]);\r\n\r\n const defaultItems = useDefaultBackstageItems(defaultItemsManager);\r\n const syncIdsOfInterest = React.useMemo(() => BackstageItemsManager.getSyncIdsOfInterest(defaultItems), [defaultItems]);\r\n useBackstageItemSyncEffect(defaultItemsManager, syncIdsOfInterest);\r\n\r\n const [addonItemsManager] = React.useState(new BackstageItemsManager());\r\n const addonItems = useUiItemsProviderBackstageItems(addonItemsManager);\r\n const addonSyncIdsOfInterest = React.useMemo(() => BackstageItemsManager.getSyncIdsOfInterest(addonItems), [addonItems]);\r\n useBackstageItemSyncEffect(addonItemsManager, addonSyncIdsOfInterest);\r\n\r\n const combinedBackstageItems = React.useMemo(() => combineItems(defaultItems, addonItems), [defaultItems, addonItems]);\r\n const groups = useGroupedItems(combinedBackstageItems);\r\n\r\n return (\r\n <NZ_Backstage\r\n className={props.className}\r\n header={props.header}\r\n isOpen={isOpen}\r\n onClose={handleClose}\r\n safeAreaInsets={safeAreaInsets}\r\n showOverlay={props.showOverlay}\r\n style={props.style}\r\n >\r\n {groups.map((group, groupIndex) => (\r\n group.map((item, itemIndex) => {\r\n const composerItem = (\r\n <BackstageComposerItem\r\n item={item}\r\n key={item.id}\r\n />\r\n );\r\n return itemIndex === 0 && groupIndex > 0 ? (\r\n <React.Fragment key={groupIndex}>\r\n <BackstageSeparator />\r\n {composerItem}\r\n </React.Fragment>\r\n ) : composerItem;\r\n })\r\n ))}\r\n </NZ_Backstage>\r\n );\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BackstageComposer.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposer.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,qBAAqB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEvH,OAAO,EAAE,kBAAkB,EAAE,SAAS,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAmB,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,yBAAyB;AAEzB,0EAA0E;AAC1E,SAAS,0BAA0B,CAAC,YAAmC,EAAE,iBAA2B;IAClG,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE1C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,iBAAiB,GAAG,CAAC,IAAqB,EAAE,EAAE;YAClD,IAAI,CAAC,KAAK,iBAAiB,CAAC,MAAM;gBAChC,OAAO;YAET,uBAAuB;YACvB,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE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vD,OAAO,CACL,oBAAC,YAAY,IACX,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,KAAK,EAAE,KAAK,CAAC,KAAK,IAEjB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC,CACjC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE;QAC5B,MAAM,YAAY,GAAG,CACnB,oBAAC,qBAAqB,IACpB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,IAAI,CAAC,EAAE,GACZ,CACH,CAAC;QACF,OAAO,SAAS,KAAK,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CACzC,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,UAAU;YAC7B,oBAAC,kBAAkB,OAAG;YACrB,YAAY,CACE,CAClB,CAAC,CAAC,CAAC,YAAY,CAAC;IACnB,CAAC,CAAC,CACH,CAAC,CACW,CAChB,CAAC;AACJ,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 Backstage\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { BackstageItem, BackstageItemsManager, ConditionalBooleanValue, isStageLauncher } from \"@itwin/appui-abstract\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { BackstageSeparator, Backstage as NZ_Backstage } from \"@itwin/appui-layout-react\";\r\nimport { SafeAreaContext } from \"../safearea/SafeAreaContext\";\r\nimport { SyncUiEventArgs, SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\r\nimport { BackstageComposerItem } from \"./BackstageComposerItem\";\r\nimport { useBackstageManager, useIsBackstageOpen } from \"./BackstageManager\";\r\nimport { useDefaultBackstageItems } from \"./useDefaultBackstageItems\";\r\nimport { useUiItemsProviderBackstageItems } from \"./useUiItemsProviderBackstageItems\";\r\n\r\n// cSpell:ignore safearea\r\n\r\n/** Private function to set up sync event monitoring of backstage items */\r\nfunction useBackstageItemSyncEffect(itemsManager: BackstageItemsManager, syncIdsOfInterest: string[]) {\r\n const isInitialMount = React.useRef(true);\r\n\r\n React.useEffect(() => {\r\n const handleSyncUiEvent = (args: SyncUiEventArgs) => {\r\n if (0 === syncIdsOfInterest.length)\r\n return;\r\n\r\n // istanbul ignore else\r\n if (syncIdsOfInterest.some((value: string): boolean => args.eventIds.has(value.toLowerCase()))) {\r\n // process each item that has interest\r\n itemsManager.refreshAffectedItems(args.eventIds);\r\n }\r\n };\r\n\r\n if (isInitialMount.current) {\r\n isInitialMount.current = false;\r\n // initialize the display state of any items with syncIds/condition defined\r\n itemsManager.refreshAffectedItems(new Set(syncIdsOfInterest));\r\n }\r\n\r\n SyncUiEventDispatcher.onSyncUiEvent.addListener(handleSyncUiEvent);\r\n return () => {\r\n SyncUiEventDispatcher.onSyncUiEvent.removeListener(handleSyncUiEvent);\r\n };\r\n }, [itemsManager, itemsManager.items, syncIdsOfInterest]);\r\n}\r\n\r\n/** local function to combine items from Stage and from Extensions */\r\nfunction combineItems(stageItems: ReadonlyArray<BackstageItem>, addonItems: ReadonlyArray<BackstageItem>, hideSoloStageEntry: boolean) {\r\n let items: BackstageItem[] = [];\r\n if (stageItems.length) {\r\n // Walk through each and ensure no duplicate ids are added.\r\n stageItems.forEach((srcItem) => {\r\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\r\n items.push(srcItem);\r\n }\r\n });\r\n }\r\n if (addonItems.length) {\r\n // Walk through each and ensure no duplicate ids are added.\r\n addonItems.forEach((srcItem) => {\r\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\r\n items.push(srcItem);\r\n }\r\n });\r\n }\r\n\r\n if (hideSoloStageEntry) {\r\n // per user request don't show stage launcher if only one stage is available\r\n const numberOfFrontstageItems = items.reduce((accumulator, item) => accumulator + (isStageLauncher(item) ? 1 : 0), 0);\r\n if (1 === numberOfFrontstageItems)\r\n items = items.filter((item) => !isStageLauncher(item));\r\n }\r\n\r\n return items;\r\n}\r\n\r\n/** @internal */\r\nexport type GroupedItems = ReadonlyArray<ReadonlyArray<BackstageItem>>;\r\n\r\n/** @internal */\r\nexport const useGroupedItems = (items: ReadonlyArray<BackstageItem>): GroupedItems => {\r\n return React.useMemo(() => {\r\n const grouped = items.reduce<GroupedItems>((acc, item) => {\r\n if (ConditionalBooleanValue.getValue(item.isHidden))\r\n return acc;\r\n const groupIndex = acc.findIndex((group) => group[0].groupPriority === item.groupPriority);\r\n if (groupIndex >= 0)\r\n return [\r\n ...acc.slice(0, groupIndex),\r\n [\r\n ...acc[groupIndex],\r\n item,\r\n ],\r\n ...acc.slice(groupIndex + 1),\r\n ];\r\n return [\r\n ...acc,\r\n [\r\n item,\r\n ],\r\n ];\r\n }, []);\r\n const sortedGroups = grouped.reduce<GroupedItems>((acc, group) => {\r\n const sortedGroup = [...group].sort((a, b) => a.itemPriority - b.itemPriority);\r\n return [\r\n ...acc,\r\n sortedGroup,\r\n ];\r\n }, []);\r\n return [...sortedGroups].sort((a, b) => a[0].groupPriority - b[0].groupPriority);\r\n }, [items]);\r\n};\r\n\r\n/** Props of [[BackstageComposer]] component.\r\n * @public\r\n */\r\nexport interface BackstageComposerProps extends CommonProps {\r\n /** React node for an optional header item */\r\n readonly header?: React.ReactNode;\r\n /** Indicates whether to place an overlay over the frontstage when the backstage is displayed */\r\n readonly showOverlay?: boolean;\r\n /** List of backstage items to show */\r\n readonly items: BackstageItem[];\r\n /** If true and only one stage launcher item is found, do not show entry in backstage */\r\n readonly hideSoloStageEntry?: boolean;\r\n}\r\n\r\n/** Backstage component composed from [[BackstageManager]] items.\r\n * @public\r\n */\r\nexport function BackstageComposer(props: BackstageComposerProps) {\r\n const [defaultItemsManager, setDefaultItemsManager] = React.useState(new BackstageItemsManager(props.items));\r\n const initialItems = React.useRef(props.items);\r\n\r\n React.useEffect(() => {\r\n if (initialItems.current !== props.items) {\r\n initialItems.current = props.items;\r\n setDefaultItemsManager(new BackstageItemsManager(props.items));\r\n }\r\n }, [props.items]);\r\n\r\n const manager = useBackstageManager();\r\n const isOpen = useIsBackstageOpen(manager);\r\n const safeAreaInsets = React.useContext(SafeAreaContext);\r\n const handleClose = React.useCallback(() => {\r\n manager.close();\r\n }, [manager]);\r\n\r\n const defaultItems = useDefaultBackstageItems(defaultItemsManager);\r\n const syncIdsOfInterest = React.useMemo(() => BackstageItemsManager.getSyncIdsOfInterest(defaultItems), [defaultItems]);\r\n useBackstageItemSyncEffect(defaultItemsManager, syncIdsOfInterest);\r\n\r\n const [addonItemsManager] = React.useState(new BackstageItemsManager());\r\n const addonItems = useUiItemsProviderBackstageItems(addonItemsManager);\r\n const addonSyncIdsOfInterest = React.useMemo(() => BackstageItemsManager.getSyncIdsOfInterest(addonItems), [addonItems]);\r\n useBackstageItemSyncEffect(addonItemsManager, addonSyncIdsOfInterest);\r\n\r\n const combinedBackstageItems = React.useMemo(() => combineItems(defaultItems, addonItems, !!props.hideSoloStageEntry), [defaultItems, addonItems, props.hideSoloStageEntry]);\r\n const groups = useGroupedItems(combinedBackstageItems);\r\n\r\n return (\r\n <NZ_Backstage\r\n className={props.className}\r\n header={props.header}\r\n isOpen={isOpen}\r\n onClose={handleClose}\r\n safeAreaInsets={safeAreaInsets}\r\n showOverlay={props.showOverlay}\r\n style={props.style}\r\n >\r\n {groups.map((group, groupIndex) => (\r\n group.map((item, itemIndex) => {\r\n const composerItem = (\r\n <BackstageComposerItem\r\n item={item}\r\n key={item.id}\r\n />\r\n );\r\n return itemIndex === 0 && groupIndex > 0 ? (\r\n <React.Fragment key={groupIndex}>\r\n <BackstageSeparator />\r\n {composerItem}\r\n </React.Fragment>\r\n ) : composerItem;\r\n })\r\n ))}\r\n </NZ_Backstage>\r\n );\r\n}\r\n"]}
|
|
@@ -15,13 +15,13 @@ export declare function useCategories(viewManager: ViewManager, imodel: IModelCo
|
|
|
15
15
|
export declare function loadCategoriesFromViewport(iModel?: IModelConnection, vp?: Viewport): Promise<Category[]>;
|
|
16
16
|
/**
|
|
17
17
|
* Data structure that describes category.
|
|
18
|
-
* @
|
|
18
|
+
* @alpha
|
|
19
19
|
*/
|
|
20
20
|
export interface Category {
|
|
21
21
|
key: string;
|
|
22
22
|
children?: string[];
|
|
23
23
|
}
|
|
24
|
-
/** @
|
|
24
|
+
/** @alpha */
|
|
25
25
|
export interface CategoryVisibilityHandlerParams {
|
|
26
26
|
viewManager: ViewManager;
|
|
27
27
|
imodel: IModelConnection;
|
|
@@ -29,7 +29,7 @@ export interface CategoryVisibilityHandlerParams {
|
|
|
29
29
|
activeView?: Viewport;
|
|
30
30
|
allViewports?: boolean;
|
|
31
31
|
}
|
|
32
|
-
/** @
|
|
32
|
+
/** @alpha */
|
|
33
33
|
export declare class CategoryVisibilityHandler implements IVisibilityHandler {
|
|
34
34
|
private _viewManager;
|
|
35
35
|
private _imodel;
|
package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryVisibilityHandler.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAA8B,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAI/G;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,QAAQ,cAIhG;AAED,gBAAgB;AAChB,wBAAsB,0BAA0B,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,EAAE,CAAC,EAAE,QAAQ,uBAuBxF;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,
|
|
1
|
+
{"version":3,"file":"CategoryVisibilityHandler.d.ts","sourceRoot":"","sources":["../../../../../src/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAA8B,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAI/G;;;GAGG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,QAAQ,cAIhG;AAED,gBAAgB;AAChB,wBAAsB,0BAA0B,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,EAAE,CAAC,EAAE,QAAQ,uBAuBxF;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,aAAa;AACb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AM,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO;CAqBnH"}
|
package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CategoryVisibilityHandler.js","sourceRoot":"","sources":["../../../../../src/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAoB,0BAA0B,EAAyB,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAgB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGtE,MAAM,sBAAsB,GAAe,EAAE,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,WAAwB,EAAE,MAAwB,EAAE,IAAe;;IAC/F,MAAM,WAAW,GAAG,IAAI,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC;IAC3D,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,0BAA0B,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5H,OAAO,MAAA,aAAa,CAAC,iBAAiB,CAAC,mCAAI,sBAAsB,CAAC;AACpE,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,MAAyB,EAAE,EAAa;IACvF,IAAI,CAAC,EAAE;QACL,OAAO,sBAAsB,CAAC;IAEhC,yCAAyC;IACzC,MAAM,4BAA4B,GAAG,2IAA2I,CAAC;IACjL,MAAM,4BAA4B,GAAG,0JAA0J,CAAC;IAChM,MAAM,KAAK,GAAG,EA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WAAwB,EAAE,GAAW,EAAE,OAAgB,EAAE,eAAyB;QAChH,IAAI,CAAC,WAAW,CAAC,YAAY;YAC3B,OAAO;QAET,MAAM,cAAc,GAAG,CAAC,EAAY,EAAE,EAAE;YACtC,2GAA2G;YAC3G,oCAAoC;YACpC,IAAI,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;gBACvF,EAAE,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC;QAEF,iGAAiG;QACjG,IAAI,eAAe,EAAE;YACnB,KAAK,MAAM,QAAQ,IAAI,WAAW,EAAE;gBAClC,cAAc,CAAC,QAAQ,CAAC,CAAC;aAC1B;SACF;aAAM;YACL,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;SAC1C;IACH,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/** @packageDocumentation\r\n * @module IModelComponents\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelConnection, PerModelCategoryVisibility, ViewManager, Viewport } from \"@itwin/core-frontend\";\r\nimport { NodeKey } from \"@itwin/presentation-common\";\r\nimport { TreeNodeItem, useAsyncValue } from \"@itwin/components-react\";\r\nimport { IVisibilityHandler, VisibilityChangeListener, VisibilityStatus } from \"../VisibilityTreeEventHandler\";\r\n\r\nconst EMPTY_CATEGORIES_ARRAY: Category[] = [];\r\n\r\n/**\r\n * Loads categories from viewport or uses provided list of categories.\r\n * @internal\r\n */\r\nexport function useCategories(viewManager: ViewManager, imodel: IModelConnection, view?: Viewport) {\r\n const currentView = view || viewManager.getFirstOpenView();\r\n const categoriesPromise = React.useMemo(async () => loadCategoriesFromViewport(imodel, currentView), [imodel, currentView]);\r\n return useAsyncValue(categoriesPromise) ?? EMPTY_CATEGORIES_ARRAY;\r\n}\r\n\r\n/** @internal */\r\nexport async function loadCategoriesFromViewport(iModel?: IModelConnection, vp?: Viewport) {\r\n if (!vp)\r\n return EMPTY_CATEGORIES_ARRAY;\r\n\r\n // Query categories and add them to state\r\n const selectUsedSpatialCategoryIds = \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId from BisCore.SpatialCategory)\";\r\n const selectUsedDrawingCategoryIds = \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement2d WHERE Model.Id=? AND Category.Id IN (SELECT ECInstanceId from BisCore.DrawingCategory)\";\r\n const ecsql = vp.view.is3d() ? selectUsedSpatialCategoryIds : selectUsedDrawingCategoryIds;\r\n const ecsql2 = `SELECT ECInstanceId as id, UserLabel as label, CodeValue as code FROM ${vp.view.is3d() ? \"BisCore.SpatialCategory\" : \"BisCore.DrawingCategory\"} WHERE ECInstanceId IN (${ecsql})`;\r\n\r\n const categories: Category[] = [];\r\n\r\n // istanbul ignore else\r\n if (iModel) {\r\n const rowIterator = iModel.query(ecsql2);\r\n // istanbul ignore next\r\n for await (const row of rowIterator) {\r\n const subCategoryIds = iModel.subcategories.getSubCategories(row.id);\r\n categories.push({ key: row.id, children: (subCategoryIds) ? [...subCategoryIds] : undefined });\r\n }\r\n }\r\n\r\n return categories;\r\n}\r\n\r\n/**\r\n * Data structure that describes category.\r\n * @internal\r\n */\r\nexport interface Category {\r\n key: string;\r\n children?: string[];\r\n}\r\n\r\n/** @internal */\r\nexport interface CategoryVisibilityHandlerParams {\r\n viewManager: ViewManager;\r\n imodel: IModelConnection;\r\n categories: Category[];\r\n activeView?: Viewport;\r\n allViewports?: boolean;\r\n}\r\n\r\n/** @internal */\r\nexport class CategoryVisibilityHandler implements IVisibilityHandler {\r\n private _viewManager: ViewManager;\r\n private _imodel: IModelConnection;\r\n private _pendingVisibilityChange: any | undefined;\r\n private _activeView?: Viewport;\r\n private _useAllViewports: boolean;\r\n private _categories: Category[];\r\n\r\n constructor(params: CategoryVisibilityHandlerParams) {\r\n this._viewManager = params.viewManager;\r\n this._imodel = params.imodel;\r\n this._activeView = params.activeView;\r\n // istanbul ignore next\r\n this._useAllViewports = params.allViewports ?? false;\r\n this._categories = params.categories;\r\n if (this._activeView) {\r\n this._activeView.onDisplayStyleChanged.addListener(this.onDisplayStyleChanged);\r\n this._activeView.onViewedCategoriesChanged.addListener(this.onViewedCategoriesChanged);\r\n }\r\n }\r\n\r\n public dispose() {\r\n if (this._activeView) {\r\n this._activeView.onDisplayStyleChanged.removeListener(this.onDisplayStyleChanged);\r\n this._activeView.onViewedCategoriesChanged.removeListener(this.onViewedCategoriesChanged);\r\n }\r\n clearTimeout(this._pendingVisibilityChange);\r\n }\r\n\r\n public onVisibilityChange = new BeEvent<VisibilityChangeListener>();\r\n\r\n public getVisibilityStatus(node: TreeNodeItem, nodeKey: NodeKey): VisibilityStatus {\r\n const instanceId = CategoryVisibilityHandler.getInstanceIdFromTreeNodeKey(nodeKey);\r\n return { state: node.parentId ? this.getSubCategoryVisibility(instanceId) : this.getCategoryVisibility(instanceId) };\r\n }\r\n\r\n public async changeVisibility(node: TreeNodeItem, nodeKey: NodeKey, shouldDisplay: boolean): Promise<void> {\r\n // handle subcategory visibility change\r\n if (node.parentId) {\r\n const childId = CategoryVisibilityHandler.getInstanceIdFromTreeNodeKey(nodeKey);\r\n // istanbul ignore next\r\n const parentId = this.getParent(childId)?.key;\r\n\r\n // make sure parent category is enabled\r\n if (shouldDisplay && parentId)\r\n CategoryVisibilityHandler.enableCategory(this._viewManager, this._imodel, [parentId], true, this._useAllViewports, false);\r\n\r\n CategoryVisibilityHandler.enableSubCategory(this._viewManager, childId, shouldDisplay, this._useAllViewports);\r\n return;\r\n }\r\n\r\n const instanceId = CategoryVisibilityHandler.getInstanceIdFromTreeNodeKey(nodeKey);\r\n CategoryVisibilityHandler.enableCategory(this._viewManager, this._imodel, [instanceId], shouldDisplay, true);\r\n }\r\n\r\n public getSubCategoryVisibility(id: string) {\r\n const parentItem = this.getParent(id);\r\n if (!parentItem || !this._activeView)\r\n return \"hidden\";\r\n\r\n const isVisible = this._activeView.view.viewsCategory(parentItem.key) && this._activeView.isSubCategoryVisible(id);\r\n return isVisible ? \"visible\" : \"hidden\";\r\n }\r\n\r\n public getCategoryVisibility(id: string) {\r\n if (!this._activeView)\r\n return \"hidden\";\r\n return this._activeView.view.viewsCategory(id) ? \"visible\" : \"hidden\";\r\n }\r\n\r\n public getParent(key: string): Category | undefined {\r\n for (const category of this._categories) {\r\n // istanbul ignore else\r\n if (category.children) {\r\n if (category.children.indexOf(key) !== -1)\r\n return category;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private onDisplayStyleChanged = () => {\r\n this.onVisibilityChangeInternal();\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private onViewedCategoriesChanged = () => {\r\n this.onVisibilityChangeInternal();\r\n };\r\n\r\n private onVisibilityChangeInternal() {\r\n if (this._pendingVisibilityChange)\r\n return;\r\n\r\n this._pendingVisibilityChange = setTimeout(() => {\r\n this.onVisibilityChange.raiseEvent();\r\n this._pendingVisibilityChange = undefined;\r\n }, 0);\r\n }\r\n\r\n public static getInstanceIdFromTreeNodeKey(nodeKey: NodeKey) {\r\n return (NodeKey.isInstancesNodeKey(nodeKey) && nodeKey.instanceKeys.length > 0) ? nodeKey.instanceKeys[0].id : /* istanbul ignore next */ \"\";\r\n }\r\n\r\n /** Changes category display in the viewport */\r\n public static enableCategory(viewManager: ViewManager, imodel: IModelConnection, ids: string[], enabled: boolean, forAllViewports: boolean, enableAllSubCategories = true) {\r\n if (!viewManager.selectedView)\r\n return;\r\n\r\n const updateViewport = (vp: Viewport) => {\r\n // Only act on viewports that are both 3D or both 2D. Important if we have multiple viewports opened and we\r\n // are using 'allViewports' property\r\n if (viewManager.selectedView && viewManager.selectedView.view.is3d() === vp.view.is3d()) {\r\n vp.changeCategoryDisplay(ids, enabled, enableAllSubCategories);\r\n\r\n // remove category overrides per model\r\n const modelsContainingOverrides: string[] = [];\r\n for (const ovr of vp.perModelCategoryVisibility) {\r\n // istanbul ignore else\r\n if (ids.findIndex((id) => id === ovr.categoryId) !== -1)\r\n modelsContainingOverrides.push(ovr.modelId);\r\n }\r\n vp.perModelCategoryVisibility.setOverride(modelsContainingOverrides, ids, PerModelCategoryVisibility.Override.None);\r\n\r\n // changeCategoryDisplay only enables subcategories, it does not disabled them. So we must do that ourselves.\r\n if (false === enabled) {\r\n ids.forEach((id) => {\r\n const subCategoryIds = imodel.subcategories.getSubCategories(id);\r\n // istanbul ignore else\r\n if (subCategoryIds) {\r\n subCategoryIds.forEach((subCategoryId) => CategoryVisibilityHandler.enableSubCategory(viewManager, subCategoryId, false, forAllViewports));\r\n }\r\n });\r\n }\r\n }\r\n };\r\n\r\n // This property let us act on all viewports or just on the selected one, configurable by the app\r\n if (forAllViewports) {\r\n for (const viewport of viewManager) {\r\n updateViewport(viewport);\r\n }\r\n } else {\r\n updateViewport(viewManager.selectedView);\r\n }\r\n }\r\n\r\n /** Changes subcategory display in the viewport */\r\n public static enableSubCategory(viewManager: ViewManager, key: string, enabled: boolean, forAllViewports?: boolean) {\r\n if (!viewManager.selectedView)\r\n return;\r\n\r\n const updateViewport = (vp: Viewport) => {\r\n // Only act on viewports that are both 3D or both 2D. Important if we have multiple viewports opened and we\r\n // are using 'allViewports' property\r\n if (viewManager.selectedView && viewManager.selectedView.view.is3d() === vp.view.is3d()) {\r\n vp.changeSubCategoryDisplay(key, enabled);\r\n }\r\n };\r\n\r\n // This property let us act on all viewports or just on the selected one, configurable by the app\r\n if (forAllViewports) {\r\n for (const viewport of viewManager) {\r\n updateViewport(viewport);\r\n }\r\n } else {\r\n updateViewport(viewManager.selectedView);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"CategoryVisibilityHandler.js","sourceRoot":"","sources":["../../../../../src/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAoB,0BAA0B,EAAyB,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAgB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGtE,MAAM,sBAAsB,GAAe,EAAE,CAAC;AAE9C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,WAAwB,EAAE,MAAwB,EAAE,IAAe;;IAC/F,MAAM,WAAW,GAAG,IAAI,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC;IAC3D,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,0BAA0B,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5H,OAAO,MAAA,aAAa,CAAC,iBAAiB,CAAC,mCAAI,sBAAsB,CAAC;AACpE,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,MAAyB,EAAE,EAAa;IACvF,IAAI,CAAC,EAAE;QACL,OAAO,sBAAsB,CAAC;IAEhC,yCAAyC;IACzC,MAAM,4BAA4B,GAAG,2IAA2I,CAAC;IACjL,MAAM,4BAA4B,GAAG,0JAA0J,CAAC;IAChM,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,4BAA4B,CAAC;IAC3F,MAAM,MAAM,GAAG,yEAAyE,EAAE,C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AAE;YACtC,2GAA2G;YAC3G,oCAAoC;YACpC,IAAI,WAAW,CAAC,YAAY,IAAI,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;gBACvF,EAAE,CAAC,wBAAwB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aAC3C;QACH,CAAC,CAAC;QAEF,iGAAiG;QACjG,IAAI,eAAe,EAAE;YACnB,KAAK,MAAM,QAAQ,IAAI,WAAW,EAAE;gBAClC,cAAc,CAAC,QAAQ,CAAC,CAAC;aAC1B;SACF;aAAM;YACL,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;SAC1C;IACH,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/** @packageDocumentation\r\n * @module IModelComponents\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelConnection, PerModelCategoryVisibility, ViewManager, Viewport } from \"@itwin/core-frontend\";\r\nimport { NodeKey } from \"@itwin/presentation-common\";\r\nimport { TreeNodeItem, useAsyncValue } from \"@itwin/components-react\";\r\nimport { IVisibilityHandler, VisibilityChangeListener, VisibilityStatus } from \"../VisibilityTreeEventHandler\";\r\n\r\nconst EMPTY_CATEGORIES_ARRAY: Category[] = [];\r\n\r\n/**\r\n * Loads categories from viewport or uses provided list of categories.\r\n * @internal\r\n */\r\nexport function useCategories(viewManager: ViewManager, imodel: IModelConnection, view?: Viewport) {\r\n const currentView = view || viewManager.getFirstOpenView();\r\n const categoriesPromise = React.useMemo(async () => loadCategoriesFromViewport(imodel, currentView), [imodel, currentView]);\r\n return useAsyncValue(categoriesPromise) ?? EMPTY_CATEGORIES_ARRAY;\r\n}\r\n\r\n/** @internal */\r\nexport async function loadCategoriesFromViewport(iModel?: IModelConnection, vp?: Viewport) {\r\n if (!vp)\r\n return EMPTY_CATEGORIES_ARRAY;\r\n\r\n // Query categories and add them to state\r\n const selectUsedSpatialCategoryIds = \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement3d WHERE Category.Id IN (SELECT ECInstanceId from BisCore.SpatialCategory)\";\r\n const selectUsedDrawingCategoryIds = \"SELECT DISTINCT Category.Id as id from BisCore.GeometricElement2d WHERE Model.Id=? AND Category.Id IN (SELECT ECInstanceId from BisCore.DrawingCategory)\";\r\n const ecsql = vp.view.is3d() ? selectUsedSpatialCategoryIds : selectUsedDrawingCategoryIds;\r\n const ecsql2 = `SELECT ECInstanceId as id, UserLabel as label, CodeValue as code FROM ${vp.view.is3d() ? \"BisCore.SpatialCategory\" : \"BisCore.DrawingCategory\"} WHERE ECInstanceId IN (${ecsql})`;\r\n\r\n const categories: Category[] = [];\r\n\r\n // istanbul ignore else\r\n if (iModel) {\r\n const rowIterator = iModel.query(ecsql2);\r\n // istanbul ignore next\r\n for await (const row of rowIterator) {\r\n const subCategoryIds = iModel.subcategories.getSubCategories(row.id);\r\n categories.push({ key: row.id, children: (subCategoryIds) ? [...subCategoryIds] : undefined });\r\n }\r\n }\r\n\r\n return categories;\r\n}\r\n\r\n/**\r\n * Data structure that describes category.\r\n * @alpha\r\n */\r\nexport interface Category {\r\n key: string;\r\n children?: string[];\r\n}\r\n\r\n/** @alpha */\r\nexport interface CategoryVisibilityHandlerParams {\r\n viewManager: ViewManager;\r\n imodel: IModelConnection;\r\n categories: Category[];\r\n activeView?: Viewport;\r\n allViewports?: boolean;\r\n}\r\n\r\n/** @alpha */\r\nexport class CategoryVisibilityHandler implements IVisibilityHandler {\r\n private _viewManager: ViewManager;\r\n private _imodel: IModelConnection;\r\n private _pendingVisibilityChange: any | undefined;\r\n private _activeView?: Viewport;\r\n private _useAllViewports: boolean;\r\n private _categories: Category[];\r\n\r\n constructor(params: CategoryVisibilityHandlerParams) {\r\n this._viewManager = params.viewManager;\r\n this._imodel = params.imodel;\r\n this._activeView = params.activeView;\r\n // istanbul ignore next\r\n this._useAllViewports = params.allViewports ?? false;\r\n this._categories = params.categories;\r\n if (this._activeView) {\r\n this._activeView.onDisplayStyleChanged.addListener(this.onDisplayStyleChanged);\r\n this._activeView.onViewedCategoriesChanged.addListener(this.onViewedCategoriesChanged);\r\n }\r\n }\r\n\r\n public dispose() {\r\n if (this._activeView) {\r\n this._activeView.onDisplayStyleChanged.removeListener(this.onDisplayStyleChanged);\r\n this._activeView.onViewedCategoriesChanged.removeListener(this.onViewedCategoriesChanged);\r\n }\r\n clearTimeout(this._pendingVisibilityChange);\r\n }\r\n\r\n public onVisibilityChange = new BeEvent<VisibilityChangeListener>();\r\n\r\n public getVisibilityStatus(node: TreeNodeItem, nodeKey: NodeKey): VisibilityStatus {\r\n const instanceId = CategoryVisibilityHandler.getInstanceIdFromTreeNodeKey(nodeKey);\r\n return { state: node.parentId ? this.getSubCategoryVisibility(instanceId) : this.getCategoryVisibility(instanceId) };\r\n }\r\n\r\n public async changeVisibility(node: TreeNodeItem, nodeKey: NodeKey, shouldDisplay: boolean): Promise<void> {\r\n // handle subcategory visibility change\r\n if (node.parentId) {\r\n const childId = CategoryVisibilityHandler.getInstanceIdFromTreeNodeKey(nodeKey);\r\n // istanbul ignore next\r\n const parentId = this.getParent(childId)?.key;\r\n\r\n // make sure parent category is enabled\r\n if (shouldDisplay && parentId)\r\n CategoryVisibilityHandler.enableCategory(this._viewManager, this._imodel, [parentId], true, this._useAllViewports, false);\r\n\r\n CategoryVisibilityHandler.enableSubCategory(this._viewManager, childId, shouldDisplay, this._useAllViewports);\r\n return;\r\n }\r\n\r\n const instanceId = CategoryVisibilityHandler.getInstanceIdFromTreeNodeKey(nodeKey);\r\n CategoryVisibilityHandler.enableCategory(this._viewManager, this._imodel, [instanceId], shouldDisplay, true);\r\n }\r\n\r\n public getSubCategoryVisibility(id: string) {\r\n const parentItem = this.getParent(id);\r\n if (!parentItem || !this._activeView)\r\n return \"hidden\";\r\n\r\n const isVisible = this._activeView.view.viewsCategory(parentItem.key) && this._activeView.isSubCategoryVisible(id);\r\n return isVisible ? \"visible\" : \"hidden\";\r\n }\r\n\r\n public getCategoryVisibility(id: string) {\r\n if (!this._activeView)\r\n return \"hidden\";\r\n return this._activeView.view.viewsCategory(id) ? \"visible\" : \"hidden\";\r\n }\r\n\r\n public getParent(key: string): Category | undefined {\r\n for (const category of this._categories) {\r\n // istanbul ignore else\r\n if (category.children) {\r\n if (category.children.indexOf(key) !== -1)\r\n return category;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private onDisplayStyleChanged = () => {\r\n this.onVisibilityChangeInternal();\r\n };\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private onViewedCategoriesChanged = () => {\r\n this.onVisibilityChangeInternal();\r\n };\r\n\r\n private onVisibilityChangeInternal() {\r\n if (this._pendingVisibilityChange)\r\n return;\r\n\r\n this._pendingVisibilityChange = setTimeout(() => {\r\n this.onVisibilityChange.raiseEvent();\r\n this._pendingVisibilityChange = undefined;\r\n }, 0);\r\n }\r\n\r\n public static getInstanceIdFromTreeNodeKey(nodeKey: NodeKey) {\r\n return (NodeKey.isInstancesNodeKey(nodeKey) && nodeKey.instanceKeys.length > 0) ? nodeKey.instanceKeys[0].id : /* istanbul ignore next */ \"\";\r\n }\r\n\r\n /** Changes category display in the viewport */\r\n public static enableCategory(viewManager: ViewManager, imodel: IModelConnection, ids: string[], enabled: boolean, forAllViewports: boolean, enableAllSubCategories = true) {\r\n if (!viewManager.selectedView)\r\n return;\r\n\r\n const updateViewport = (vp: Viewport) => {\r\n // Only act on viewports that are both 3D or both 2D. Important if we have multiple viewports opened and we\r\n // are using 'allViewports' property\r\n if (viewManager.selectedView && viewManager.selectedView.view.is3d() === vp.view.is3d()) {\r\n vp.changeCategoryDisplay(ids, enabled, enableAllSubCategories);\r\n\r\n // remove category overrides per model\r\n const modelsContainingOverrides: string[] = [];\r\n for (const ovr of vp.perModelCategoryVisibility) {\r\n // istanbul ignore else\r\n if (ids.findIndex((id) => id === ovr.categoryId) !== -1)\r\n modelsContainingOverrides.push(ovr.modelId);\r\n }\r\n vp.perModelCategoryVisibility.setOverride(modelsContainingOverrides, ids, PerModelCategoryVisibility.Override.None);\r\n\r\n // changeCategoryDisplay only enables subcategories, it does not disabled them. So we must do that ourselves.\r\n if (false === enabled) {\r\n ids.forEach((id) => {\r\n const subCategoryIds = imodel.subcategories.getSubCategories(id);\r\n // istanbul ignore else\r\n if (subCategoryIds) {\r\n subCategoryIds.forEach((subCategoryId) => CategoryVisibilityHandler.enableSubCategory(viewManager, subCategoryId, false, forAllViewports));\r\n }\r\n });\r\n }\r\n }\r\n };\r\n\r\n // This property let us act on all viewports or just on the selected one, configurable by the app\r\n if (forAllViewports) {\r\n for (const viewport of viewManager) {\r\n updateViewport(viewport);\r\n }\r\n } else {\r\n updateViewport(viewManager.selectedView);\r\n }\r\n }\r\n\r\n /** Changes subcategory display in the viewport */\r\n public static enableSubCategory(viewManager: ViewManager, key: string, enabled: boolean, forAllViewports?: boolean) {\r\n if (!viewManager.selectedView)\r\n return;\r\n\r\n const updateViewport = (vp: Viewport) => {\r\n // Only act on viewports that are both 3D or both 2D. Important if we have multiple viewports opened and we\r\n // are using 'allViewports' property\r\n if (viewManager.selectedView && viewManager.selectedView.view.is3d() === vp.view.is3d()) {\r\n vp.changeSubCategoryDisplay(key, enabled);\r\n }\r\n };\r\n\r\n // This property let us act on all viewports or just on the selected one, configurable by the app\r\n if (forAllViewports) {\r\n for (const viewport of viewManager) {\r\n updateViewport(viewport);\r\n }\r\n } else {\r\n updateViewport(viewManager.selectedView);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -13,6 +13,6 @@ export declare class ToolItemDef extends ActionButtonItemDef {
|
|
|
13
13
|
constructor(toolItemProps: ToolItemProps, onItemExecuted?: OnItemExecutedFunc);
|
|
14
14
|
get id(): string;
|
|
15
15
|
/** Create a ToolItemDef that will run a registered tool. */
|
|
16
|
-
static getItemDefForTool(tool: typeof Tool, iconSpec?: string, args
|
|
16
|
+
static getItemDefForTool(tool: typeof Tool, iconSpec?: string, ...args: any[]): ToolItemDef;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=ToolItemDef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolItemDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/shared/ToolItemDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAa,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,qBAAa,WAAY,SAAQ,mBAAmB;IAC3C,MAAM,EAAE,MAAM,CAAM;gBAEf,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,EAAE,kBAAkB;IAU7E,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,4DAA4D;WAC9C,iBAAiB,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"ToolItemDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/shared/ToolItemDef.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAa,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,qBAAa,WAAY,SAAQ,mBAAmB;IAC3C,MAAM,EAAE,MAAM,CAAM;gBAEf,aAAa,EAAE,aAAa,EAAE,cAAc,CAAC,EAAE,kBAAkB;IAU7E,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,4DAA4D;WAC9C,iBAAiB,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW;CASnG"}
|
|
@@ -23,13 +23,13 @@ export class ToolItemDef extends ActionButtonItemDef {
|
|
|
23
23
|
return this.toolId;
|
|
24
24
|
}
|
|
25
25
|
/** Create a ToolItemDef that will run a registered tool. */
|
|
26
|
-
static getItemDefForTool(tool, iconSpec, args) {
|
|
26
|
+
static getItemDefForTool(tool, iconSpec, ...args) {
|
|
27
27
|
return new ToolItemDef({
|
|
28
28
|
toolId: tool.toolId,
|
|
29
29
|
iconSpec: iconSpec ? iconSpec : (tool.iconSpec && tool.iconSpec.length > 0) ? tool.iconSpec : undefined,
|
|
30
30
|
label: () => tool.flyover,
|
|
31
31
|
description: () => tool.description,
|
|
32
|
-
execute: async () => IModelApp.tools.run(tool.toolId, args),
|
|
32
|
+
execute: async () => IModelApp.tools.run(tool.toolId, ...args),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolItemDef.js","sourceRoot":"","sources":["../../../../src/appui-react/shared/ToolItemDef.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAQ,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,mBAAmB;IAGlD,YAAY,aAA4B,EAAE,cAAmC;QAC3E,KAAK,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAHhC,WAAM,GAAW,EAAE,CAAC;QAKzB,IAAI,a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,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;YACvG,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO;YACzB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW;YACnC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC;SAC/D,CAAC,CAAC;IACL,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/** @packageDocumentation\r\n * @module Item\r\n */\r\n\r\nimport { IModelApp, Tool } from \"@itwin/core-frontend\";\r\nimport { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\r\nimport { ActionButtonItemDef } from \"./ActionButtonItemDef\";\r\nimport { ToolItemProps } from \"./ItemProps\";\r\n\r\n/** An Item that starts the execution of a Tool.\r\n * @public\r\n */\r\nexport class ToolItemDef extends ActionButtonItemDef {\r\n public toolId: string = \"\";\r\n\r\n constructor(toolItemProps: ToolItemProps, onItemExecuted?: OnItemExecutedFunc) {\r\n super(toolItemProps, onItemExecuted);\r\n\r\n if (toolItemProps.execute) {\r\n this._commandHandler = { execute: toolItemProps.execute, parameters: toolItemProps.parameters, getCommandArgs: toolItemProps.getCommandArgs };\r\n }\r\n\r\n this.toolId = toolItemProps.toolId;\r\n }\r\n\r\n public get id(): string {\r\n return this.toolId;\r\n }\r\n\r\n /** Create a ToolItemDef that will run a registered tool. */\r\n public static getItemDefForTool(tool: typeof Tool, iconSpec?: string, ...args: any[]): ToolItemDef {\r\n return new ToolItemDef({\r\n toolId: tool.toolId,\r\n iconSpec: iconSpec ? iconSpec : (tool.iconSpec && tool.iconSpec.length > 0) ? tool.iconSpec : undefined,\r\n label: () => tool.flyover,\r\n description: () => tool.description,\r\n execute: async () => IModelApp.tools.run(tool.toolId, ...args),\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBarComposer.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusbar/StatusBarComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACoD,mBAAmB,EAE7E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAoC,MAAM,mBAAmB,CAAC;AAuBlF,UAAU,8BAA8B;IACtC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAMD,gBAAgB;AAChB,wBAAgB,iBAAiB,mCAEhC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,eAkB5D;
|
|
1
|
+
{"version":3,"file":"StatusBarComposer.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/statusbar/StatusBarComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACoD,mBAAmB,EAE7E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAoC,MAAM,mBAAmB,CAAC;AAuBlF,UAAU,8BAA8B;IACtC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAMD,gBAAgB;AAChB,wBAAgB,iBAAiB,mCAEhC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,eAkB5D;AAmID;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,uBAAuB;IACvB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAE7B,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAiL9D"}
|
|
@@ -88,10 +88,22 @@ function generateActionStatusBarItem(item, isInFooterMode) {
|
|
|
88
88
|
/** local function to combine items from Stage and from Extensions */
|
|
89
89
|
function combineItems(stageItems, addonItems) {
|
|
90
90
|
const items = [];
|
|
91
|
-
if (stageItems.length)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
if (stageItems.length) {
|
|
92
|
+
// Walk through each and ensure no duplicate ids are added.
|
|
93
|
+
stageItems.forEach((srcItem) => {
|
|
94
|
+
if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
|
|
95
|
+
items.push(srcItem);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (addonItems.length) {
|
|
100
|
+
// Walk through each and ensure no duplicate ids are added.
|
|
101
|
+
addonItems.forEach((srcItem) => {
|
|
102
|
+
if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
|
|
103
|
+
items.push(srcItem);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
95
107
|
return items;
|
|
96
108
|
}
|
|
97
109
|
/** local function to ensure a width value is defined for a status bar entries. */
|
|
@@ -154,7 +166,7 @@ export function StatusBarComposer(props) {
|
|
|
154
166
|
const syncIdsOfInterest = React.useMemo(() => StatusBarItemsManager.getSyncIdsOfInterest(defaultItems), [defaultItems]);
|
|
155
167
|
useStatusBarItemSyncEffect(defaultItemsManager, syncIdsOfInterest);
|
|
156
168
|
const statusBarContext = React.useContext(StatusBarContext);
|
|
157
|
-
const [addonItemsManager] = React.useState(new StatusBarItemsManager());
|
|
169
|
+
const [addonItemsManager] = React.useState(() => new StatusBarItemsManager());
|
|
158
170
|
const addonItems = useUiItemsProviderStatusBarItems(addonItemsManager);
|
|
159
171
|
const addonSyncIdsOfInterest = React.useMemo(() => StatusBarItemsManager.getSyncIdsOfInterest(addonItems), [addonItems]);
|
|
160
172
|
useStatusBarItemSyncEffect(addonItemsManager, addonSyncIdsOfInterest);
|