@itwin/appui-react 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +12 -4
  2. package/lib/cjs/appui-react/UiFramework.d.ts.map +1 -1
  3. package/lib/cjs/appui-react/UiFramework.js +11 -10
  4. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  5. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.d.ts +1 -1
  6. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
  7. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +4 -3
  8. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  9. package/lib/cjs/appui-react/selection/HideIsolateEmphasizeManager.d.ts.map +1 -1
  10. package/lib/cjs/appui-react/selection/HideIsolateEmphasizeManager.js +3 -0
  11. package/lib/cjs/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
  12. package/lib/cjs/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
  13. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +12 -8
  14. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  15. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts +6 -4
  16. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
  17. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js +49 -78
  18. package/lib/cjs/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  19. package/lib/cjs/appui-react/toolbar/Toolbar.d.ts +10 -0
  20. package/lib/cjs/appui-react/toolbar/Toolbar.d.ts.map +1 -1
  21. package/lib/cjs/appui-react/toolbar/Toolbar.js +3 -2
  22. package/lib/cjs/appui-react/toolbar/Toolbar.js.map +1 -1
  23. package/lib/cjs/appui-react/toolbar/ToolbarComposer.d.ts +2 -1
  24. package/lib/cjs/appui-react/toolbar/ToolbarComposer.d.ts.map +1 -1
  25. package/lib/cjs/appui-react/toolbar/ToolbarComposer.js +45 -129
  26. package/lib/cjs/appui-react/toolbar/ToolbarComposer.js.map +1 -1
  27. package/lib/cjs/appui-react/toolbar/ToolbarItem.d.ts +2 -2
  28. package/lib/cjs/appui-react/toolbar/ToolbarItem.d.ts.map +1 -1
  29. package/lib/cjs/appui-react/toolbar/ToolbarItem.js +2 -2
  30. package/lib/cjs/appui-react/toolbar/ToolbarItem.js.map +1 -1
  31. package/lib/cjs/appui-react/toolbar/ToolbarItemsManager.d.ts +1 -0
  32. package/lib/cjs/appui-react/toolbar/ToolbarItemsManager.d.ts.map +1 -1
  33. package/lib/cjs/appui-react/toolbar/ToolbarItemsManager.js +12 -2
  34. package/lib/cjs/appui-react/toolbar/ToolbarItemsManager.js.map +1 -1
  35. package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.d.ts +2 -1
  36. package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  37. package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.js +5 -9
  38. package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  39. package/lib/cjs/appui-react/toolbar/useActiveStageProvidedToolbarItems.d.ts +11 -0
  40. package/lib/cjs/appui-react/toolbar/useActiveStageProvidedToolbarItems.d.ts.map +1 -0
  41. package/lib/cjs/appui-react/toolbar/useActiveStageProvidedToolbarItems.js +46 -0
  42. package/lib/cjs/appui-react/toolbar/useActiveStageProvidedToolbarItems.js.map +1 -0
  43. package/lib/cjs/appui-react/toolbar/useActiveToolIdSynchedItems.d.ts +25 -0
  44. package/lib/cjs/appui-react/toolbar/useActiveToolIdSynchedItems.d.ts.map +1 -0
  45. package/lib/cjs/appui-react/toolbar/useActiveToolIdSynchedItems.js +63 -0
  46. package/lib/cjs/appui-react/toolbar/useActiveToolIdSynchedItems.js.map +1 -0
  47. package/lib/cjs/appui-react/toolbar/useDefaultToolbarItems.d.ts +1 -0
  48. package/lib/cjs/appui-react/toolbar/useDefaultToolbarItems.d.ts.map +1 -1
  49. package/lib/cjs/appui-react/toolbar/useDefaultToolbarItems.js +4 -1
  50. package/lib/cjs/appui-react/toolbar/useDefaultToolbarItems.js.map +1 -1
  51. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.d.ts +2 -1
  52. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.d.ts.map +1 -1
  53. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js +13 -30
  54. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  55. package/lib/esm/appui-react/UiFramework.d.ts.map +1 -1
  56. package/lib/esm/appui-react/UiFramework.js +11 -10
  57. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  58. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.d.ts +1 -1
  59. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.d.ts.map +1 -1
  60. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +4 -3
  61. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  62. package/lib/esm/appui-react/selection/HideIsolateEmphasizeManager.d.ts.map +1 -1
  63. package/lib/esm/appui-react/selection/HideIsolateEmphasizeManager.js +3 -0
  64. package/lib/esm/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
  65. package/lib/esm/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
  66. package/lib/esm/appui-react/selection/SelectionContextItemDef.js +12 -8
  67. package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  68. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts +6 -4
  69. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
  70. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js +49 -78
  71. package/lib/esm/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  72. package/lib/esm/appui-react/toolbar/Toolbar.d.ts +10 -0
  73. package/lib/esm/appui-react/toolbar/Toolbar.d.ts.map +1 -1
  74. package/lib/esm/appui-react/toolbar/Toolbar.js +3 -2
  75. package/lib/esm/appui-react/toolbar/Toolbar.js.map +1 -1
  76. package/lib/esm/appui-react/toolbar/ToolbarComposer.d.ts +2 -1
  77. package/lib/esm/appui-react/toolbar/ToolbarComposer.d.ts.map +1 -1
  78. package/lib/esm/appui-react/toolbar/ToolbarComposer.js +45 -129
  79. package/lib/esm/appui-react/toolbar/ToolbarComposer.js.map +1 -1
  80. package/lib/esm/appui-react/toolbar/ToolbarItem.d.ts +2 -2
  81. package/lib/esm/appui-react/toolbar/ToolbarItem.d.ts.map +1 -1
  82. package/lib/esm/appui-react/toolbar/ToolbarItem.js +2 -2
  83. package/lib/esm/appui-react/toolbar/ToolbarItem.js.map +1 -1
  84. package/lib/esm/appui-react/toolbar/ToolbarItemsManager.d.ts +1 -0
  85. package/lib/esm/appui-react/toolbar/ToolbarItemsManager.d.ts.map +1 -1
  86. package/lib/esm/appui-react/toolbar/ToolbarItemsManager.js +12 -2
  87. package/lib/esm/appui-react/toolbar/ToolbarItemsManager.js.map +1 -1
  88. package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.d.ts +2 -1
  89. package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  90. package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.js +5 -9
  91. package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  92. package/lib/esm/appui-react/toolbar/useActiveStageProvidedToolbarItems.d.ts +11 -0
  93. package/lib/esm/appui-react/toolbar/useActiveStageProvidedToolbarItems.d.ts.map +1 -0
  94. package/lib/esm/appui-react/toolbar/useActiveStageProvidedToolbarItems.js +42 -0
  95. package/lib/esm/appui-react/toolbar/useActiveStageProvidedToolbarItems.js.map +1 -0
  96. package/lib/esm/appui-react/toolbar/useActiveToolIdSynchedItems.d.ts +25 -0
  97. package/lib/esm/appui-react/toolbar/useActiveToolIdSynchedItems.d.ts.map +1 -0
  98. package/lib/esm/appui-react/toolbar/useActiveToolIdSynchedItems.js +59 -0
  99. package/lib/esm/appui-react/toolbar/useActiveToolIdSynchedItems.js.map +1 -0
  100. package/lib/esm/appui-react/toolbar/useDefaultToolbarItems.d.ts +1 -0
  101. package/lib/esm/appui-react/toolbar/useDefaultToolbarItems.d.ts.map +1 -1
  102. package/lib/esm/appui-react/toolbar/useDefaultToolbarItems.js +4 -1
  103. package/lib/esm/appui-react/toolbar/useDefaultToolbarItems.js.map +1 -1
  104. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.d.ts +2 -1
  105. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.d.ts.map +1 -1
  106. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js +13 -30
  107. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  108. package/package.json +13 -14
@@ -1 +1 @@
1
- {"version":3,"file":"SyncUiEventDispatcher.js","sourceRoot":"","sources":["../../../../src/appui-react/syncui/SyncUiEventDispatcher.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,0DAA0D;AAC1D,sDAA6C;AAM7C,wDAAiD;AACjD,wDAA6D;AAC7D,gDAA6C;AAE7C,yJAAyJ;AACzJ,yJAAyJ;AACzJ,2JAA2J;AAC3J,wHAAwH;AACxH,6HAA6H;AAE7H;;GAEG;AACH,IAAY,aAwCX;AAxCD,WAAY,aAAa;IACvB,yCAAyC;IACzC,0EAAyD,CAAA;IACzD,qCAAqC;IACrC,oEAAmD,CAAA;IACnD,8EAA8E;IAC9E,8DAA6C,CAAA;IAC7C,iEAAiE;IACjE,gEAA+C,CAAA;IAC/C,kCAAkC;IAClC,kDAAiC,CAAA;IACjC,4CAA4C;IAC5C,kEAAiD,CAAA;IACjD,kFAAkF;IAClF,oEAAmD,CAAA;IACnD,kCAAkC;IAClC,8D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F,qBAAqB,CAAC,uBAAuB;YAC3C,qBAAqB,CAAC,uBAAuB,EAAE,CAAC;IACpD,CAAC;IAED,0FAA0F;IACnF,MAAM,CAAC,0BAA0B,CAAC,gBAAkC;QACzE,IAAI,qBAAqB,CAAC,uBAAuB;YAC/C,qBAAqB,CAAC,uBAAuB,EAAE,CAAC;QAElD,IAAI,gBAAgB,CAAC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YACpE,yBAAW,CAAC,qBAAqB,CAC/B,mCAAoB,CAAC,mBAAmB,EACxC,CAAC,CACF,CAAC;YACF,OAAO;SACR;QAED,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,cAAc,CACpD,qBAAqB,CAAC,uBAAuB,CAC9C,CAAC;QACF,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,WAAW,CACjD,qBAAqB,CAAC,uBAAuB,CAC9C,CAAC;QACF,gBAAgB,CAAC,QAAQ;YACvB,yBAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAE3D,qBAAqB,CAAC,uBAAuB;YAC3C,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE;gBACzD,MAAM,WAAW,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACzC,yBAAW,CAAC,qBAAqB,CAC/B,mCAAoB,CAAC,mBAAmB,EACxC,WAAW,CACZ,CAAC;YACJ,CAAC,CAAC,CAAC;IACP,CAAC;;AA5Qc,wCAAkB,GAAG,IAAI,kCAAiB,EAAE,CAAC;AAE7C,8CAAwB,GAAsB,EAAE,CAAC;AAHrD,sDAAqB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module SyncUi\n */\n\nimport type { UiSyncEvent } from \"@itwin/appui-abstract\";\nimport { UiEventDispatcher } from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n SelectedViewportChangedArgs,\n SelectionSetEvent,\n} from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { SessionStateActionId } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\n\n// cSpell:ignore activecontentchanged, activitymessageupdated, activitymessagecancelled, backstageevent, contentlayoutactivated, contentcontrolactivated,\n// cSpell:ignore elementtooltipchanged, frontstageactivated, inputfieldmessageadded, inputfieldmessageremoved, modalfrontstagechanged, modaldialogchanged\n// cSpell:ignore navigationaidactivated, notificationmessageadded, toolactivated, taskactivated, widgetstatechanged, workflowactivated frontstageactivating\n// cSpell:ignore frontstageready activeviewportchanged selectionsetchanged presentationselectionchanged viewstatechanged\n// cSpell:ignore accudrawcompassmodechanged accudrawfieldlockchanged accudrawrotationchanged uisettingschanged configurableui\n\n/** Event Id used to sync UI components. Used to refresh visibility or enable state of control.\n * @public\n */\nexport enum SyncUiEventId {\n /** AccuDraw compass mode has changed. */\n AccuDrawCompassModeChanged = \"accudrawcompassmodechanged\",\n /** AccuDraw rotation has changed. */\n AccuDrawRotationChanged = \"accudrawrotationchanged\",\n /** The active content as maintained by the ContentViewManager has changed. */\n ActiveContentChanged = \"activecontentchanged\",\n /** The active view maintained by the ViewManager has changed. */\n ActiveViewportChanged = \"activeviewportchanged\",\n /** Backstage has been toggled. */\n BackstageEvent = \"backstageevent\",\n /** A Content Layout has been activated. */\n ContentLayoutActivated = \"contentlayoutactivated\",\n /** A Content Control maintained by UiFramework.frontstages has been activated. */\n ContentControlActivated = \"contentcontrolactivated\",\n /** A Frontstage is activating. */\n FrontstageActivating = \"frontstageactivating\",\n /** A Frontstage has been activated and the content has been assigned. */\n FrontstageReady = \"frontstageready\",\n /** A Modal Frontstage has been opened or closed. */\n ModalFrontstageChanged = \"modalfrontstagechanged\",\n /** A Modal Dialog has been opened or closed. */\n ModalDialogChanged = \"modaldialogchanged\",\n /** A NavigationAid has been activated. */\n NavigationAidActivated = \"navigationaidactivated\",\n /** An InteractiveTool has been activated via the ToolAdmin. */\n ToolActivated = \"toolactivated\",\n /** The state of a Widget has changed. */\n WidgetStateChanged = \"widgetstatechanged\",\n /** The SelectionSet for the active IModelConnection has changed. */\n SelectionSetChanged = \"selectionsetchanged\",\n /** The list of settings providers registered with SettingsManager has changed. */\n SettingsProvidersChanged = \"settingsproviderschanged\",\n /** The current view state has changed (used by view undo/redo toolbar buttons). */\n ViewStateChanged = \"viewstatechanged\",\n /** The current object the reads and write UI State has changed. */\n UiStateStorageChanged = \"uistatestoragechanged\",\n ShowHideManagerSettingChange = \"show-hide-setting-change\",\n /** The list of feature overrides applied has been changed */\n FeatureOverridesChanged = \"featureoverrideschanged\",\n}\n\n/** This class is used to send eventIds to interested UI components so the component can determine if it needs\n * to refresh its display by calling setState on itself.\n * @public\n */\nexport class SyncUiEventDispatcher {\n private static _uiEventDispatcher = new UiEventDispatcher();\n private static _unregisterListenerFunc?: () => void;\n private static _unregisterListenerFuncs: Array<() => void> = [];\n\n /** @internal - used for testing only */\n /* istanbul ignore next */\n public static setTimeoutPeriod(period: number): void {\n SyncUiEventDispatcher._uiEventDispatcher.setTimeoutPeriod(period);\n }\n\n /** Return set of event ids that will be sent to listeners/. */\n public static get syncEventIds(): Set<string> {\n return SyncUiEventDispatcher._uiEventDispatcher.syncEventIds;\n }\n\n /** Return SyncUiEvent so callers can register an event callback. */\n public static get onSyncUiEvent(): UiSyncEvent {\n return SyncUiEventDispatcher._uiEventDispatcher.onSyncUiEvent;\n }\n\n /** Immediately trigger sync event processing. */\n public static dispatchImmediateSyncUiEvent(eventId: string): void {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchImmediateSyncUiEvent(\n eventId\n );\n }\n\n /** Save eventId in Set for processing. */\n public static dispatchSyncUiEvent(eventId: string): void {\n if (0 === SyncUiEventDispatcher._uiEventDispatcher.timeoutPeriod) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `[dispatchSyncUiEvent] not processed because timeoutPeriod=0`\n );\n return;\n }\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(eventId);\n }\n\n /** Save multiple eventIds in Set for processing. */\n public static dispatchSyncUiEvents(eventIds: string[]): void {\n // istanbul ignore if\n if (0 === SyncUiEventDispatcher._uiEventDispatcher.timeoutPeriod) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `[dispatchSyncUiEvents] not processed because _timeoutPeriod=0`\n );\n }\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvents(eventIds);\n }\n\n /** Checks to see if an eventId of interest is contained in the set of eventIds */\n public static hasEventOfInterest(\n eventIds: Set<string>,\n idsOfInterest: string[]\n ) {\n return SyncUiEventDispatcher._uiEventDispatcher.hasEventOfInterest(\n eventIds,\n idsOfInterest\n );\n }\n\n // istanbul ignore next\n private static _dispatchViewChange() {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ViewStateChanged\n );\n }\n\n // istanbul ignore next\n private static _dispatchFeatureOverridesChange() {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.FeatureOverridesChanged\n );\n }\n\n /** Initializes the Monitoring of Events that trigger dispatching sync events */\n public static initialize() {\n // clear any registered listeners - this should only be encountered in unit test scenarios\n this._unregisterListenerFuncs.forEach((unregisterListenerFunc) =>\n unregisterListenerFunc()\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onContentControlActivatedEvent.addListener(() => {\n SyncUiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ContentControlActivated\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ContentLayoutActivated\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onFrontstageActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.FrontstageActivating\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onFrontstageReadyEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.FrontstageReady\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onModalFrontstageChangedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ModalFrontstageChanged\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onNavigationAidActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.NavigationAidActivated\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onToolActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ToolActivated\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.frontstages.onWidgetStateChangedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.WidgetStateChanged\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.backstage.onToggled.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.BackstageEvent\n );\n })\n );\n\n this._unregisterListenerFuncs.push(\n UiFramework.content.onActiveContentChangedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ActiveContentChanged\n );\n })\n );\n\n // istanbul ignore else\n if (IModelApp && IModelApp.viewManager) {\n this._unregisterListenerFuncs.push(\n IModelApp.viewManager.onSelectedViewportChanged.addListener(\n (args: SelectedViewportChangedArgs) => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ActiveViewportChanged\n );\n\n // if this is the first view being opened up start the default tool so tool admin is happy.\n if (undefined === args.previous) {\n void IModelApp.toolAdmin.startDefaultTool();\n } else {\n // istanbul ignore next\n if (\n args.previous.onViewChanged &&\n typeof args.previous.onViewChanged.removeListener === \"function\"\n )\n // not set during unit test\n args.previous.onViewChanged.removeListener(\n SyncUiEventDispatcher._dispatchViewChange\n );\n // istanbul ignore next\n if (\n args.previous.onFeatureOverridesChanged &&\n typeof args.previous.onFeatureOverridesChanged\n .removeListener === \"function\"\n )\n // not set during unit test\n args.previous.onFeatureOverridesChanged.removeListener(\n SyncUiEventDispatcher._dispatchFeatureOverridesChange\n );\n }\n // istanbul ignore next\n if (args.current) {\n if (\n args.current.onViewChanged &&\n typeof args.current.onViewChanged.addListener === \"function\"\n )\n // not set during unit test\n args.current.onViewChanged.addListener(\n SyncUiEventDispatcher._dispatchViewChange\n );\n // istanbul ignore next\n if (\n args.current.onFeatureOverridesChanged &&\n typeof args.current.onFeatureOverridesChanged.addListener ===\n \"function\"\n )\n // not set during unit test\n args.current.onFeatureOverridesChanged.addListener(\n SyncUiEventDispatcher._dispatchFeatureOverridesChange\n );\n }\n }\n )\n );\n }\n }\n\n private static selectionChangedHandler(_ev: SelectionSetEvent) {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.SelectionSetChanged\n );\n }\n\n /** This should be called by IModelApp when the active IModelConnection is closed. */\n public static clearConnectionEvents(iModelConnection: IModelConnection) {\n iModelConnection.selectionSet.onChanged.removeListener(\n SyncUiEventDispatcher.selectionChangedHandler\n );\n SyncUiEventDispatcher._unregisterListenerFunc &&\n SyncUiEventDispatcher._unregisterListenerFunc();\n }\n\n /** This should be called by IModelApp when the active IModelConnection is established. */\n public static initializeConnectionEvents(iModelConnection: IModelConnection) {\n if (SyncUiEventDispatcher._unregisterListenerFunc)\n SyncUiEventDispatcher._unregisterListenerFunc();\n\n if (iModelConnection.isBlankConnection() || !iModelConnection.isOpen) {\n UiFramework.dispatchActionToStore(\n SessionStateActionId.SetNumItemsSelected,\n 0\n );\n return;\n }\n\n iModelConnection.selectionSet.onChanged.removeListener(\n SyncUiEventDispatcher.selectionChangedHandler\n );\n iModelConnection.selectionSet.onChanged.addListener(\n SyncUiEventDispatcher.selectionChangedHandler\n );\n iModelConnection.iModelId &&\n UiFramework.setActiveIModelId(iModelConnection.iModelId);\n\n SyncUiEventDispatcher._unregisterListenerFunc =\n iModelConnection.selectionSet.onChanged.addListener((ev) => {\n const numSelected = ev.set.elements.size;\n UiFramework.dispatchActionToStore(\n SessionStateActionId.SetNumItemsSelected,\n numSelected\n );\n });\n }\n}\n"]}
1
+ {"version":3,"file":"SyncUiEventDispatcher.js","sourceRoot":"","sources":["../../../../src/appui-react/syncui/SyncUiEventDispatcher.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,0DAA0D;AAC1D,sDAA6C;AAE7C,wDAAiD;AACjD,wDAA6D;AAC7D,gDAA6C;AAE7C,yJAAyJ;AACzJ,yJAAyJ;AACzJ,2JAA2J;AAC3J,wHAAwH;AACxH,6HAA6H;AAE7H;;GAEG;AACH,IAAY,aAyCX;AAzCD,WAAY,aAAa;IACvB,yCAAyC;IACzC,0EAAyD,CAAA;IACzD,qCAAqC;IACrC,oEAAmD,CAAA;IACnD,8EAA8E;IAC9E,8DAA6C,CAAA;IAC7C,iEAAiE;IACjE,gEAA+C,CAAA;IAC/C,kCAAkC;IAClC,kDAAiC,CAAA;IACjC,4CAA4C;IAC5C,kEAAiD,CAAA;IACjD,kFAAkF;IAClF,oEAAmD,CAAA;IACnD,kCAAkC;IAClC,8DAA6C,CAAA;IAC7C,yEAAyE;IACzE,oDAAmC,CAAA;IACnC,oDAAoD;IACpD,kEAAiD,CAAA;IACjD,gDAAgD;IAChD,0DA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CACnD,CAAC;aACH;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,qFAAqF;IAC9E,MAAM,CAAC,qBAAqB,CAAC,gBAAkC;QACpE,IAAI,IAAI,CAAC,iBAAiB,KAAK,gBAAgB;YAAE,OAAO;QACxD,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;IACvC,CAAC;IAED,0FAA0F;IACnF,MAAM,CAAC,0BAA0B,CAAC,gBAAkC;QACzE,IAAI,CAAC,iBAAiB;YACpB,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACrD,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAE1C,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAClC,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE;YACvD,qBAAqB,CAAC,kBAAkB,CAAC,mBAAmB,CAC1D,aAAa,CAAC,mBAAmB,CAClC,CAAC;QACJ,CAAC,CAAC,EACF,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE;YACzD,MAAM,WAAW,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;YACzC,yBAAW,CAAC,qBAAqB,CAC/B,mCAAoB,CAAC,mBAAmB,EACxC,WAAW,CACZ,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;;AA3Mc,wCAAkB,GAAG,IAAI,kCAAiB,EAAE,CAAC;AAC7C,sCAAgB,GAAG,IAAI,KAAK,EAAc,CAAC;AAC3C,gDAA0B,GAAG,IAAI,KAAK,EAAc,CAAC;AAHzD,sDAAqB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module SyncUi\n */\n\nimport type { UiSyncEvent } from \"@itwin/appui-abstract\";\nimport { UiEventDispatcher } from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { IModelConnection } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { SessionStateActionId } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\n\n// cSpell:ignore activecontentchanged, activitymessageupdated, activitymessagecancelled, backstageevent, contentlayoutactivated, contentcontrolactivated,\n// cSpell:ignore elementtooltipchanged, frontstageactivated, inputfieldmessageadded, inputfieldmessageremoved, modalfrontstagechanged, modaldialogchanged\n// cSpell:ignore navigationaidactivated, notificationmessageadded, toolactivated, taskactivated, widgetstatechanged, workflowactivated frontstageactivating\n// cSpell:ignore frontstageready activeviewportchanged selectionsetchanged presentationselectionchanged viewstatechanged\n// cSpell:ignore accudrawcompassmodechanged accudrawfieldlockchanged accudrawrotationchanged uisettingschanged configurableui\n\n/** Event Id used to sync UI components. Used to refresh visibility or enable state of control.\n * @public\n */\nexport enum SyncUiEventId {\n /** AccuDraw compass mode has changed. */\n AccuDrawCompassModeChanged = \"accudrawcompassmodechanged\",\n /** AccuDraw rotation has changed. */\n AccuDrawRotationChanged = \"accudrawrotationchanged\",\n /** The active content as maintained by the ContentViewManager has changed. */\n ActiveContentChanged = \"activecontentchanged\",\n /** The active view maintained by the ViewManager has changed. */\n ActiveViewportChanged = \"activeviewportchanged\",\n /** Backstage has been toggled. */\n BackstageEvent = \"backstageevent\",\n /** A Content Layout has been activated. */\n ContentLayoutActivated = \"contentlayoutactivated\",\n /** A Content Control maintained by UiFramework.frontstages has been activated. */\n ContentControlActivated = \"contentcontrolactivated\",\n /** A Frontstage is activating. */\n FrontstageActivating = \"frontstageactivating\",\n /** A Frontstage has been activated and the content has been assigned. */\n FrontstageReady = \"frontstageready\",\n /** A Modal Frontstage has been opened or closed. */\n ModalFrontstageChanged = \"modalfrontstagechanged\",\n /** A Modal Dialog has been opened or closed. */\n ModalDialogChanged = \"modaldialogchanged\",\n /** A NavigationAid has been activated. */\n NavigationAidActivated = \"navigationaidactivated\",\n /** An InteractiveTool has been activated via the ToolAdmin. */\n ToolActivated = \"toolactivated\",\n /** The state of a Widget has changed. */\n WidgetStateChanged = \"widgetstatechanged\",\n /** The SelectionSet for the active IModelConnection has changed. */\n SelectionSetChanged = \"selectionsetchanged\",\n /** The list of settings providers registered with SettingsManager has changed. */\n SettingsProvidersChanged = \"settingsproviderschanged\",\n /** The current view state has changed (used by view undo/redo toolbar buttons). */\n ViewStateChanged = \"viewstatechanged\",\n /** The current object the reads and write UI State has changed. */\n UiStateStorageChanged = \"uistatestoragechanged\",\n ShowHideManagerSettingChange = \"show-hide-setting-change\",\n /** The list of feature overrides applied has been changed */\n FeatureOverridesChanged = \"featureoverrideschanged\",\n ViewedModelsChanged = \"viewedmodelschanged\",\n}\n\n/** This class is used to send eventIds to interested UI components so the component can determine if it needs\n * to refresh its display by calling setState on itself.\n * @public\n */\nexport class SyncUiEventDispatcher {\n private static _uiEventDispatcher = new UiEventDispatcher();\n private static _unregisterFuncs = new Array<() => void>();\n private static _connectionUnregisterFuncs = new Array<() => void>();\n private static _iModelConnection?: IModelConnection;\n\n /** @internal - used for testing only */\n /* istanbul ignore next */\n public static setTimeoutPeriod(period: number): void {\n SyncUiEventDispatcher._uiEventDispatcher.setTimeoutPeriod(period);\n }\n\n /** Return set of event ids that will be sent to listeners/. */\n public static get syncEventIds(): Set<string> {\n return SyncUiEventDispatcher._uiEventDispatcher.syncEventIds;\n }\n\n /** Return SyncUiEvent so callers can register an event callback. */\n public static get onSyncUiEvent(): UiSyncEvent {\n return SyncUiEventDispatcher._uiEventDispatcher.onSyncUiEvent;\n }\n\n /** Immediately trigger sync event processing. */\n public static dispatchImmediateSyncUiEvent(eventId: string): void {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchImmediateSyncUiEvent(\n eventId\n );\n }\n\n /** Save eventId in Set for processing. */\n public static dispatchSyncUiEvent(eventId: string): void {\n if (0 === SyncUiEventDispatcher._uiEventDispatcher.timeoutPeriod) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `[dispatchSyncUiEvent] not processed because timeoutPeriod=0`\n );\n return;\n }\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(eventId);\n }\n\n /** Save multiple eventIds in Set for processing. */\n public static dispatchSyncUiEvents(eventIds: string[]): void {\n // istanbul ignore if\n if (0 === SyncUiEventDispatcher._uiEventDispatcher.timeoutPeriod) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `[dispatchSyncUiEvents] not processed because _timeoutPeriod=0`\n );\n }\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvents(eventIds);\n }\n\n /** Checks to see if an eventId of interest is contained in the set of eventIds */\n public static hasEventOfInterest(\n eventIds: Set<string>,\n idsOfInterest: string[]\n ) {\n return SyncUiEventDispatcher._uiEventDispatcher.hasEventOfInterest(\n eventIds,\n idsOfInterest\n );\n }\n\n // istanbul ignore next\n private static _dispatchViewChange() {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ViewStateChanged\n );\n }\n\n // istanbul ignore next\n private static _dispatchFeatureOverridesChange() {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.FeatureOverridesChanged\n );\n }\n\n // istanbul ignore next\n private static _dispatchViewedModelsChanged() {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ViewedModelsChanged\n );\n }\n\n /** Initializes the Monitoring of Events that trigger dispatching sync events */\n public static initialize() {\n // clear any registered listeners - this should only be encountered in unit test scenarios\n this._unregisterFuncs.forEach((unregister) => unregister());\n this._unregisterFuncs = [];\n\n this._unregisterFuncs.push(\n UiFramework.frontstages.onContentControlActivatedEvent.addListener(() => {\n SyncUiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ContentControlActivated\n );\n }),\n UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ContentLayoutActivated\n );\n }),\n UiFramework.frontstages.onFrontstageActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.FrontstageActivating\n );\n }),\n UiFramework.frontstages.onFrontstageReadyEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.FrontstageReady\n );\n }),\n UiFramework.frontstages.onModalFrontstageChangedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ModalFrontstageChanged\n );\n }),\n UiFramework.frontstages.onNavigationAidActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.NavigationAidActivated\n );\n }),\n UiFramework.frontstages.onToolActivatedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ToolActivated\n );\n }),\n UiFramework.frontstages.onWidgetStateChangedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.WidgetStateChanged\n );\n }),\n UiFramework.backstage.onToggled.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.BackstageEvent\n );\n }),\n UiFramework.content.onActiveContentChangedEvent.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ActiveContentChanged\n );\n }),\n IModelApp.viewManager.onSelectedViewportChanged.addListener((args) => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.ActiveViewportChanged\n );\n\n // if this is the first view being opened up start the default tool so tool admin is happy.\n if (undefined === args.previous) {\n void IModelApp.toolAdmin.startDefaultTool();\n } else {\n args.previous.onViewChanged.removeListener(\n SyncUiEventDispatcher._dispatchViewChange\n );\n args.previous.onFeatureOverridesChanged.removeListener(\n SyncUiEventDispatcher._dispatchFeatureOverridesChange\n );\n args.previous.onViewedModelsChanged.removeListener(\n SyncUiEventDispatcher._dispatchViewedModelsChanged\n );\n }\n // istanbul ignore next\n if (args.current) {\n args.current.onViewChanged.addListener(\n SyncUiEventDispatcher._dispatchViewChange\n );\n args.current.onFeatureOverridesChanged.addListener(\n SyncUiEventDispatcher._dispatchFeatureOverridesChange\n );\n args.current.onViewedModelsChanged.addListener(\n SyncUiEventDispatcher._dispatchViewedModelsChanged\n );\n }\n })\n );\n }\n\n /** This should be called by IModelApp when the active IModelConnection is closed. */\n public static clearConnectionEvents(iModelConnection: IModelConnection) {\n if (this._iModelConnection !== iModelConnection) return;\n this._connectionUnregisterFuncs.forEach((unregister) => unregister());\n this._connectionUnregisterFuncs = [];\n }\n\n /** This should be called by IModelApp when the active IModelConnection is established. */\n public static initializeConnectionEvents(iModelConnection: IModelConnection) {\n this._iModelConnection &&\n this.clearConnectionEvents(this._iModelConnection);\n this._iModelConnection = iModelConnection;\n\n this._connectionUnregisterFuncs.push(\n iModelConnection.selectionSet.onChanged.addListener(() => {\n SyncUiEventDispatcher._uiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.SelectionSetChanged\n );\n }),\n iModelConnection.selectionSet.onChanged.addListener((ev) => {\n const numSelected = ev.set.elements.size;\n UiFramework.dispatchActionToStore(\n SessionStateActionId.SetNumItemsSelected,\n numSelected\n );\n })\n );\n }\n}\n"]}
@@ -6,12 +6,22 @@ import type { OnItemExecutedFunc } from "@itwin/appui-abstract";
6
6
  import type { CommonProps, NoChildrenProps } from "@itwin/core-react";
7
7
  import type { Direction, ToolbarOpacitySetting, ToolbarPanelAlignment } from "@itwin/components-react";
8
8
  import type { ToolbarItem } from "./ToolbarItem";
9
+ /**
10
+ * Properties of [[Toolbar.enableOverflow]] component.
11
+ * @beta
12
+ */
13
+ export interface OverflowToolbarOptions {
14
+ /** Describes to which direction the overflow popup panels are expanded if overflow is enabled. Defaults to: [[Direction.Right]] */
15
+ overflowExpandsTo?: Direction;
16
+ }
9
17
  /** Properties of [[Toolbar]] component.
10
18
  * @beta
11
19
  */
12
20
  export interface ToolbarProps extends CommonProps, NoChildrenProps {
13
21
  /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */
14
22
  expandsTo?: Direction;
23
+ /** Describes if items that do not fit available space should move to an expandable panel. Defaults to: false */
24
+ enableOverflow?: boolean | OverflowToolbarOptions;
15
25
  /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */
16
26
  items: ToolbarItem[];
17
27
  /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE,oGAAoG;IACpG,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uGAAuG;IACvG,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,mEAAmE;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sD;IACtD,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,eAY1C"}
@@ -11,6 +11,7 @@ exports.Toolbar = void 0;
11
11
  const React = require("react");
12
12
  const components_react_1 = require("@itwin/components-react");
13
13
  const toUIAToolbarItem_1 = require("./toUIAToolbarItem");
14
+ const SyncUiEventDispatcher_1 = require("../syncui/SyncUiEventDispatcher");
14
15
  /** Component that displays toolbar items.
15
16
  * @beta
16
17
  */
@@ -19,8 +20,8 @@ function Toolbar(props) {
19
20
  const uiaItems = React.useMemo(() => {
20
21
  return items.map((item) => (0, toUIAToolbarItem_1.toUIAToolbarItem)(item));
21
22
  }, [items]);
22
- return (React.createElement(components_react_1.Toolbar // eslint-disable-line deprecation/deprecation
23
- , { items: uiaItems, ...other }));
23
+ return (React.createElement(components_react_1.InternalToolbarComponent // eslint-disable-line deprecation/deprecation
24
+ , { items: uiaItems, syncUiEvent: SyncUiEventDispatcher_1.SyncUiEventDispatcher.onSyncUiEvent, ...other }));
24
25
  }
25
26
  exports.Toolbar = Toolbar;
26
27
  //# sourceMappingURL=Toolbar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAQ/B,8DAAgE;AAEhE,yDAAsD;AAsBtD;;GAEG;AACH,SAAgB,OAAO,CAAC,KAAmB;IACzC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,CACL,oBAAC,0BAAU,CAAC,8CAA8C;QACxD,KAAK,EAAE,QAAQ,KACX,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAXD,0BAWC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { Toolbar as CR_Toolbar } from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem\";\nimport { toUIAToolbarItem } from \"./toUIAToolbarItem\";\n\n/** Properties of [[Toolbar]] component.\n * @beta\n */\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items.\n * @beta\n */\nexport function Toolbar(props: ToolbarProps) {\n const { items, ...other } = props;\n const uiaItems = React.useMemo(() => {\n return items.map((item) => toUIAToolbarItem(item));\n }, [items]);\n return (\n <CR_Toolbar // eslint-disable-line deprecation/deprecation\n items={uiaItems}\n {...other}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/Toolbar.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAQ/B,8DAAiF;AAEjF,yDAAsD;AACtD,2EAAwE;AAiCxE;;GAEG;AACH,SAAgB,OAAO,CAAC,KAAmB;IACzC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAClC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,mCAAgB,EAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IACZ,OAAO,CACL,oBAAC,2CAAU,CAAC,8CAA8C;QACxD,KAAK,EAAE,QAAQ,EACf,WAAW,EAAE,6CAAqB,CAAC,aAAa,KAC5C,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAZD,0BAYC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { InternalToolbarComponent as CR_Toolbar } from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem\";\nimport { toUIAToolbarItem } from \"./toUIAToolbarItem\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\n\n/**\n * Properties of [[Toolbar.enableOverflow]] component.\n * @beta\n */\nexport interface OverflowToolbarOptions {\n /** Describes to which direction the overflow popup panels are expanded if overflow is enabled. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n}\n\n/** Properties of [[Toolbar]] component.\n * @beta\n */\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes if items that do not fit available space should move to an expandable panel. Defaults to: false */\n enableOverflow?: boolean | OverflowToolbarOptions;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items.\n * @beta\n */\nexport function Toolbar(props: ToolbarProps) {\n const { items, ...other } = props;\n const uiaItems = React.useMemo(() => {\n return items.map((item) => toUIAToolbarItem(item));\n }, [items]);\n return (\n <CR_Toolbar // eslint-disable-line deprecation/deprecation\n items={uiaItems}\n syncUiEvent={SyncUiEventDispatcher.onSyncUiEvent}\n {...other}\n />\n );\n}\n"]}
@@ -14,7 +14,8 @@ export interface ExtensibleToolbarProps {
14
14
  orientation: ToolbarOrientation;
15
15
  }
16
16
  /**
17
- * Toolbar that is populated and maintained by item managers.
17
+ * Toolbar that is populated and maintained by item managers, will override
18
+ * isActive property based on the active tool id.
18
19
  * @public
19
20
  */
20
21
  export declare function ToolbarComposer(props: ExtensibleToolbarProps): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarComposer.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAgBH,OAAO,KAAK,EAGV,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,kBAAkB,EAClB,YAAY,EACb,MAAM,eAAe,CAAC;AAoPvB;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;IACpB,2BAA2B;IAC3B,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,eAkE5D"}
1
+ {"version":3,"file":"ToolbarComposer.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAYH,OAAO,KAAK,EAGV,WAAW,EACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,kBAAkB,EAClB,YAAY,EACb,MAAM,eAAe,CAAC;AA0JvB;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;IACpB,2BAA2B;IAC3B,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,eA4C5D"}
@@ -9,68 +9,15 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.ToolbarComposer = void 0;
11
11
  const React = require("react");
12
- const appui_abstract_1 = require("@itwin/appui-abstract");
13
12
  const components_react_1 = require("@itwin/components-react");
14
13
  const core_bentley_1 = require("@itwin/core-bentley");
15
14
  const core_react_1 = require("@itwin/core-react");
16
- const SyncUiEventDispatcher_1 = require("../syncui/SyncUiEventDispatcher");
17
15
  const UiFramework_1 = require("../UiFramework");
18
16
  const DragInteraction_1 = require("./DragInteraction");
19
- const useDefaultToolbarItems_1 = require("./useDefaultToolbarItems");
20
- const useUiItemsProviderToolbarItems_1 = require("./useUiItemsProviderToolbarItems");
21
17
  const ToolbarItem_1 = require("./ToolbarItem");
22
- const ToolbarItemsManager_1 = require("./ToolbarItemsManager");
23
- const ToolbarWithOverflow_1 = require("./ToolbarWithOverflow");
24
- /** Private function to set up sync event monitoring of toolbar items */
25
- function useToolbarItemSyncEffect(uiDataProvider, syncIdsOfInterest) {
26
- React.useEffect(() => {
27
- return SyncUiEventDispatcher_1.SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {
28
- if (0 === syncIdsOfInterest.length)
29
- return;
30
- // istanbul ignore else
31
- if (syncIdsOfInterest.some((value) => args.eventIds.has(value.toLowerCase()))) {
32
- // process each item that has interest
33
- uiDataProvider.refreshAffectedItems(args.eventIds);
34
- }
35
- });
36
- }, [uiDataProvider, syncIdsOfInterest, uiDataProvider.items]);
37
- React.useEffect(() => {
38
- return UiFramework_1.UiFramework.frontstages.onToolActivatedEvent.addListener(({ toolId }) => {
39
- uiDataProvider.setActiveToolId(toolId);
40
- });
41
- }, [uiDataProvider, uiDataProvider.items]);
42
- }
43
- function nestedAddItemToSpecifiedParentGroup(items, groupChildren) {
44
- const outItems = [];
45
- for (const toolbarItem of items) {
46
- if (!(0, ToolbarItem_1.isToolbarGroupItem)(toolbarItem)) {
47
- outItems.push(toolbarItem);
48
- continue;
49
- }
50
- const newChildren = nestedAddItemToSpecifiedParentGroup(toolbarItem.items, groupChildren);
51
- const foundIndices = [];
52
- groupChildren.forEach((entry, index) => {
53
- if (entry.parentGroupItemId === toolbarItem.id) {
54
- foundIndices.push(index);
55
- }
56
- });
57
- // istanbul ignore else
58
- if (foundIndices.length) {
59
- // process in reverse order so groupChildren can be reduced as we find matches
60
- foundIndices
61
- .sort(
62
- // istanbul ignore next
63
- (a, b) => a - b)
64
- .reverse()
65
- .forEach((foundIndex) => {
66
- newChildren.push(groupChildren[foundIndex]);
67
- groupChildren.splice(foundIndex);
68
- });
69
- }
70
- outItems.push({ ...toolbarItem, items: newChildren });
71
- }
72
- return outItems;
73
- }
18
+ const Toolbar_1 = require("./Toolbar");
19
+ const useActiveToolIdSynchedItems_1 = require("./useActiveToolIdSynchedItems");
20
+ const useActiveStageProvidedToolbarItems_1 = require("./useActiveStageProvidedToolbarItems");
74
21
  function addItemToSpecifiedParentGroup(items, groupChildren) {
75
22
  const outItems = [];
76
23
  for (const toolbarItem of items) {
@@ -78,7 +25,7 @@ function addItemToSpecifiedParentGroup(items, groupChildren) {
78
25
  outItems.push(toolbarItem);
79
26
  continue;
80
27
  }
81
- const newChildren = nestedAddItemToSpecifiedParentGroup(toolbarItem.items, groupChildren);
28
+ const newChildren = addItemToSpecifiedParentGroup(toolbarItem.items, groupChildren);
82
29
  const foundIndices = [];
83
30
  groupChildren.forEach((entry, index) => {
84
31
  if (entry.parentGroupItemId === toolbarItem.id) {
@@ -119,76 +66,54 @@ function getItemSortValue(item) {
119
66
  : /* istanbul ignore next */ item.groupPriority;
120
67
  return groupValue * 10000 + item.itemPriority;
121
68
  }
122
- function getSortedChildren(group) {
123
- const sortedChildren = group.items
124
- .filter((item) => !appui_abstract_1.ConditionalBooleanValue.getValue(item.isHidden))
69
+ function sortItems(items) {
70
+ return [...items]
125
71
  .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))
126
72
  .map((i) => {
127
73
  if ((0, ToolbarItem_1.isToolbarGroupItem)(i)) {
128
- return { ...i, items: getSortedChildren(i) };
74
+ return { ...i, items: sortItems(i.items) };
129
75
  }
130
76
  return i;
131
77
  });
132
- return sortedChildren;
78
+ }
79
+ /**
80
+ * Create a forEach handler that will add every element of an array of ToolbarItems
81
+ * to a list of items that can then be replaced in its proper place, ensuring that
82
+ * the same item, from different list, is not added multiple times.
83
+ * @param items Output list of items
84
+ * @param groupChildren Output list of group children to redistribute.
85
+ * @returns Array<ToolbarItem>.forEach handler.
86
+ */
87
+ function addIfNotDuplicate(items, groupChildren) {
88
+ return (srcItem) => {
89
+ if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
90
+ // if the default item is a group that an addon may insert into copy it so we don't mess with original
91
+ const toolbarItem = (0, ToolbarItem_1.isToolbarGroupItem)(srcItem)
92
+ ? cloneGroup(srcItem)
93
+ : srcItem;
94
+ if (((0, ToolbarItem_1.isToolbarGroupItem)(toolbarItem) || (0, ToolbarItem_1.isToolbarActionItem)(toolbarItem)) &&
95
+ toolbarItem.parentGroupItemId)
96
+ groupChildren.push(toolbarItem);
97
+ else
98
+ items.push(toolbarItem);
99
+ }
100
+ };
133
101
  }
134
102
  /** local function to combine items from Stage and from Extensions */
135
103
  function combineItems(defaultItems, addonItems) {
136
104
  let items = [];
137
105
  const groupChildren = [];
138
- // istanbul ignore else
139
- if (defaultItems.length) {
140
- defaultItems.forEach((srcItem) => {
141
- if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
142
- // if the default item is a group that an addon may insert into copy it so we don't mess with original
143
- const toolbarItem = (0, ToolbarItem_1.isToolbarGroupItem)(srcItem)
144
- ? cloneGroup(srcItem)
145
- : srcItem;
146
- if (((0, ToolbarItem_1.isToolbarGroupItem)(toolbarItem) ||
147
- (0, ToolbarItem_1.isToolbarActionItem)(toolbarItem)) &&
148
- toolbarItem.parentGroupItemId)
149
- groupChildren.push(toolbarItem);
150
- else
151
- items.push(toolbarItem);
152
- }
153
- });
154
- }
155
- // istanbul ignore else
156
- if (addonItems.length) {
157
- addonItems.forEach((srcItem) => {
158
- if (-1 === items.findIndex((item) => item.id === srcItem.id)) {
159
- // if the default item is a group that an addon may insert into copy it so we don't mess with original
160
- const toolbarItem = (0, ToolbarItem_1.isToolbarGroupItem)(srcItem)
161
- ? cloneGroup(srcItem)
162
- : srcItem;
163
- if (((0, ToolbarItem_1.isToolbarGroupItem)(toolbarItem) ||
164
- (0, ToolbarItem_1.isToolbarActionItem)(toolbarItem)) &&
165
- toolbarItem.parentGroupItemId)
166
- groupChildren.push(toolbarItem);
167
- else
168
- items.push(toolbarItem);
169
- }
170
- });
171
- }
106
+ defaultItems.forEach(addIfNotDuplicate(items, groupChildren));
107
+ addonItems.forEach(addIfNotDuplicate(items, groupChildren));
172
108
  // if an item from an addon has specified a parent group then try to find it and insert it. If no parent is found, add item at root level.
173
109
  if (groupChildren.length) {
174
110
  items = addItemToSpecifiedParentGroup(items, groupChildren);
175
- if (groupChildren.length) {
176
- groupChildren.forEach((toolbarItem) => {
177
- core_bentley_1.Logger.logWarning("ToolbarComposer", `Requested Parent Group [${toolbarItem.parentGroupItemId}] not found, so item [${toolbarItem.id}] is added directly to toolbar.`);
178
- items.push(toolbarItem);
179
- });
180
- }
111
+ groupChildren.forEach((toolbarItem) => {
112
+ core_bentley_1.Logger.logWarning("ToolbarComposer", `Requested Parent Group [${toolbarItem.parentGroupItemId}] not found, so item [${toolbarItem.id}] is added directly to toolbar.`);
113
+ items.push(toolbarItem);
114
+ });
181
115
  }
182
- const availableItems = items
183
- .filter((item) => !appui_abstract_1.ConditionalBooleanValue.getValue(item.isHidden))
184
- .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))
185
- .map((i) => {
186
- if ((0, ToolbarItem_1.isToolbarGroupItem)(i)) {
187
- return { ...i, items: getSortedChildren(i) };
188
- }
189
- return i;
190
- });
191
- return availableItems;
116
+ return sortItems(items);
192
117
  }
193
118
  const useProximityOpacitySetting = () => {
194
119
  const [proximityOpacity, setProximityOpacity] = React.useState(UiFramework_1.UiFramework.visibility.useProximityOpacity);
@@ -205,27 +130,18 @@ const useProximityOpacitySetting = () => {
205
130
  return proximityOpacity;
206
131
  };
207
132
  /**
208
- * Toolbar that is populated and maintained by item managers.
133
+ * Toolbar that is populated and maintained by item managers, will override
134
+ * isActive property based on the active tool id.
209
135
  * @public
210
136
  */
211
137
  function ToolbarComposer(props) {
212
138
  const { usage, orientation } = props;
213
- const [defaultItemsManager, setDefaultItemsManager] = React.useState(() => new ToolbarItemsManager_1.ToolbarItemsManager(props.items));
214
- React.useEffect(() => {
215
- setDefaultItemsManager(new ToolbarItemsManager_1.ToolbarItemsManager(props.items));
216
- }, [props.items]);
217
- // process default items
218
- const defaultItems = (0, useDefaultToolbarItems_1.useDefaultToolbarItems)(defaultItemsManager);
219
- const syncIdsOfInterest = React.useMemo(() => ToolbarItemsManager_1.ToolbarItemsManager.getSyncIdsOfInterest(defaultItems), [defaultItems]);
220
- useToolbarItemSyncEffect(defaultItemsManager, syncIdsOfInterest);
221
139
  // process items from addon UI providers
222
- const [addonItemsManager] = React.useState(() => new ToolbarItemsManager_1.ToolbarItemsManager());
223
- const addonItems = (0, useUiItemsProviderToolbarItems_1.useUiItemsProviderToolbarItems)(addonItemsManager, usage, orientation);
224
- const addonSyncIdsOfInterest = React.useMemo(() => ToolbarItemsManager_1.ToolbarItemsManager.getSyncIdsOfInterest(addonItems), [addonItems]);
225
- useToolbarItemSyncEffect(addonItemsManager, addonSyncIdsOfInterest);
226
- const items = React.useMemo(() => {
227
- return combineItems(defaultItems, addonItems);
228
- }, [defaultItems, addonItems]);
140
+ const addonItems = (0, useActiveStageProvidedToolbarItems_1.useActiveStageProvidedToolbarItems)(usage, orientation);
141
+ const allItems = React.useMemo(() => {
142
+ return combineItems(props.items, addonItems);
143
+ }, [props.items, addonItems]);
144
+ const items = (0, useActiveToolIdSynchedItems_1.useActiveToolIdSynchedItems)(allItems, UiFramework_1.UiFramework.frontstages);
229
145
  const toolbarOrientation = orientation === ToolbarItem_1.ToolbarOrientation.Horizontal
230
146
  ? core_react_1.Orientation.Horizontal
231
147
  : core_react_1.Orientation.Vertical;
@@ -240,7 +156,7 @@ function ToolbarComposer(props) {
240
156
  : components_react_1.ToolbarPanelAlignment.Start;
241
157
  const isDragEnabled = React.useContext(DragInteraction_1.ToolbarDragInteractionContext);
242
158
  const useProximityOpacity = useProximityOpacitySetting();
243
- return (React.createElement(ToolbarWithOverflow_1.ToolbarWithOverflow, { expandsTo: expandsTo, panelAlignment: panelAlignment, items: items, useDragInteraction: isDragEnabled, toolbarOpacitySetting: useProximityOpacity && !UiFramework_1.UiFramework.isMobile()
159
+ return (React.createElement(Toolbar_1.Toolbar, { enableOverflow: true, expandsTo: expandsTo, panelAlignment: panelAlignment, items: items, useDragInteraction: isDragEnabled, toolbarOpacitySetting: useProximityOpacity && !UiFramework_1.UiFramework.isMobile()
244
160
  ? components_react_1.ToolbarOpacitySetting.Proximity
245
161
  : /* istanbul ignore next */ components_react_1.ToolbarOpacitySetting.Defaults }));
246
162
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarComposer.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,0DAAgE;AAChE,8DAIiC;AACjC,sDAA6C;AAC7C,kDAAgD;AAChD,2EAAwE;AACxE,gDAA6C;AAC7C,uDAAkE;AAClE,qEAAkE;AAClE,qFAAkF;AAMlF,+CAKuB;AACvB,+DAA4D;AAC5D,+DAA4D;AAE5D,wEAAwE;AACxE,SAAS,wBAAwB,CAC/B,cAAmC,EACnC,iBAA2B;IAE3B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,6CAAqB,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9D,IAAI,CAAC,KAAK,iBAAiB,CAAC,MAAM;gBAAE,OAAO;YAE3C,uBAAuB;YACvB,IACE,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAa,EAAW,EAAE,CAChD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CACvC,EACD;gBACA,sCAAsC;gBACtC,cAAc,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACpD;QACH,CAAC,CAAC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C,wCAAqB,CAAC,GAAG;QAC3B,CAAC,CAAC,wCAAqB,CAAC,KAAK,CAAC;IAClC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAAC,+CAA6B,CAAC,CAAC;IACtE,MAAM,mBAAmB,GAAG,0BAA0B,EAAE,CAAC;IAEzD,OAAO,CACL,oBAAC,yCAAmB,IAClB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,aAAa,EACjC,qBAAqB,EACnB,mBAAmB,IAAI,CAAC,yBAAW,CAAC,QAAQ,EAAE;YAC5C,CAAC,CAAC,wCAAqB,CAAC,SAAS;YACjC,CAAC,CAAC,0BAA0B,CAAC,wCAAqB,CAAC,QAAQ,GAE/D,CACH,CAAC;AACJ,CAAC;AAlED,0CAkEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\nimport { UiFramework } from \"../UiFramework\";\nimport { ToolbarDragInteractionContext } from \"./DragInteraction\";\nimport { useDefaultToolbarItems } from \"./useDefaultToolbarItems\";\nimport { useUiItemsProviderToolbarItems } from \"./useUiItemsProviderToolbarItems\";\nimport type {\n ToolbarActionItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem\";\nimport {\n isToolbarActionItem,\n isToolbarGroupItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem\";\nimport { ToolbarItemsManager } from \"./ToolbarItemsManager\";\nimport { ToolbarWithOverflow } from \"./ToolbarWithOverflow\";\n\n/** Private function to set up sync event monitoring of toolbar items */\nfunction useToolbarItemSyncEffect(\n uiDataProvider: ToolbarItemsManager,\n syncIdsOfInterest: string[]\n) {\n React.useEffect(() => {\n return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {\n if (0 === syncIdsOfInterest.length) return;\n\n // istanbul ignore else\n if (\n syncIdsOfInterest.some((value: string): boolean =>\n args.eventIds.has(value.toLowerCase())\n )\n ) {\n // process each item that has interest\n uiDataProvider.refreshAffectedItems(args.eventIds);\n }\n });\n }, [uiDataProvider, syncIdsOfInterest, uiDataProvider.items]);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onToolActivatedEvent.addListener(\n ({ toolId }) => {\n uiDataProvider.setActiveToolId(toolId);\n }\n );\n }, [uiDataProvider, uiDataProvider.items]);\n}\n\nfunction nestedAddItemToSpecifiedParentGroup(\n items: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>,\n groupChildren: Array<ToolbarActionItem | ToolbarGroupItem>\n): Array<ToolbarActionItem | ToolbarGroupItem> {\n const outItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n for (const toolbarItem of items) {\n if (!isToolbarGroupItem(toolbarItem)) {\n outItems.push(toolbarItem);\n continue;\n }\n\n const newChildren: Array<ToolbarActionItem | ToolbarGroupItem> =\n nestedAddItemToSpecifiedParentGroup(toolbarItem.items, groupChildren);\n const foundIndices: number[] = [];\n\n groupChildren.forEach((entry, index) => {\n if (entry.parentGroupItemId === toolbarItem.id) {\n foundIndices.push(index);\n }\n });\n\n // istanbul ignore else\n if (foundIndices.length) {\n // process in reverse order so groupChildren can be reduced as we find matches\n foundIndices\n .sort(\n // istanbul ignore next\n (a, b) => a - b\n )\n .reverse()\n .forEach((foundIndex) => {\n newChildren.push(groupChildren[foundIndex]);\n groupChildren.splice(foundIndex);\n });\n }\n\n outItems.push({ ...toolbarItem, items: newChildren });\n }\n return outItems;\n}\n\nfunction addItemToSpecifiedParentGroup(\n items: readonly ToolbarItem[],\n groupChildren: Array<ToolbarActionItem | ToolbarGroupItem>\n): ToolbarItem[] {\n const outItems: ToolbarItem[] = [];\n for (const toolbarItem of items) {\n if (!isToolbarGroupItem(toolbarItem)) {\n outItems.push(toolbarItem);\n continue;\n }\n\n const newChildren: Array<ToolbarActionItem | ToolbarGroupItem> =\n nestedAddItemToSpecifiedParentGroup(toolbarItem.items, groupChildren);\n const foundIndices: number[] = [];\n\n groupChildren.forEach((entry, index) => {\n if (entry.parentGroupItemId === toolbarItem.id) {\n foundIndices.push(index);\n }\n });\n\n // istanbul ignore else\n if (foundIndices.length) {\n // process in reverse order so groupChildren can be reduced as we find matches\n foundIndices\n .sort(\n // istanbul ignore next\n (a, b) => a - b\n )\n .reverse()\n .forEach((foundIndex) => {\n newChildren.push(groupChildren[foundIndex]);\n groupChildren.splice(foundIndex);\n });\n }\n\n outItems.push({ ...toolbarItem, items: newChildren });\n }\n return outItems;\n}\n\nfunction cloneGroup(inGroup: ToolbarGroupItem): ToolbarGroupItem {\n const childItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n inGroup.items.forEach((item) => {\n if (isToolbarGroupItem(item)) childItems.push(cloneGroup(item));\n else childItems.push(item);\n });\n\n const clonedGroup = { ...inGroup, items: childItems };\n return clonedGroup;\n}\n\nfunction getItemSortValue(item: ToolbarItem) {\n const groupValue =\n undefined === item.groupPriority\n ? 0\n : /* istanbul ignore next */ item.groupPriority;\n return groupValue * 10000 + item.itemPriority;\n}\n\nfunction getSortedChildren(\n group: ToolbarGroupItem\n): ReadonlyArray<ToolbarActionItem | ToolbarGroupItem> {\n const sortedChildren = group.items\n .filter((item) => !ConditionalBooleanValue.getValue(item.isHidden))\n .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))\n .map((i) => {\n if (isToolbarGroupItem(i)) {\n return { ...i, items: getSortedChildren(i) };\n }\n return i;\n });\n return sortedChildren;\n}\n\n/** local function to combine items from Stage and from Extensions */\nfunction combineItems(\n defaultItems: ReadonlyArray<ToolbarItem>,\n addonItems: ReadonlyArray<ToolbarItem>\n): ToolbarItem[] {\n let items: ToolbarItem[] = [];\n const groupChildren: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n\n // istanbul ignore else\n if (defaultItems.length) {\n defaultItems.forEach((srcItem: ToolbarItem) => {\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\n // if the default item is a group that an addon may insert into copy it so we don't mess with original\n const toolbarItem = isToolbarGroupItem(srcItem)\n ? cloneGroup(srcItem)\n : srcItem;\n if (\n (isToolbarGroupItem(toolbarItem) ||\n isToolbarActionItem(toolbarItem)) &&\n toolbarItem.parentGroupItemId\n )\n groupChildren.push(toolbarItem);\n else items.push(toolbarItem);\n }\n });\n }\n // istanbul ignore else\n if (addonItems.length) {\n addonItems.forEach((srcItem: ToolbarItem) => {\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\n // if the default item is a group that an addon may insert into copy it so we don't mess with original\n const toolbarItem = isToolbarGroupItem(srcItem)\n ? cloneGroup(srcItem)\n : srcItem;\n if (\n (isToolbarGroupItem(toolbarItem) ||\n isToolbarActionItem(toolbarItem)) &&\n toolbarItem.parentGroupItemId\n )\n groupChildren.push(toolbarItem);\n else items.push(toolbarItem);\n }\n });\n }\n\n // if an item from an addon has specified a parent group then try to find it and insert it. If no parent is found, add item at root level.\n if (groupChildren.length) {\n items = addItemToSpecifiedParentGroup(items, groupChildren);\n\n if (groupChildren.length) {\n groupChildren.forEach((toolbarItem) => {\n Logger.logWarning(\n \"ToolbarComposer\",\n `Requested Parent Group [${toolbarItem.parentGroupItemId!}] not found, so item [${\n toolbarItem.id\n }] is added directly to toolbar.`\n );\n items.push(toolbarItem);\n });\n }\n }\n\n const availableItems = items\n .filter((item) => !ConditionalBooleanValue.getValue(item.isHidden))\n .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))\n .map((i) => {\n if (isToolbarGroupItem(i)) {\n return { ...i, items: getSortedChildren(i) };\n }\n return i;\n });\n\n return availableItems;\n}\n\nconst useProximityOpacitySetting = () => {\n const [proximityOpacity, setProximityOpacity] = React.useState(\n UiFramework.visibility.useProximityOpacity\n );\n React.useEffect(() => {\n // istanbul ignore next\n const handleUiVisibilityChanged = () => {\n setProximityOpacity(UiFramework.visibility.useProximityOpacity);\n };\n UiFramework.onUiVisibilityChanged.addListener(handleUiVisibilityChanged);\n return () => {\n UiFramework.onUiVisibilityChanged.removeListener(\n handleUiVisibilityChanged\n );\n };\n }, []);\n return proximityOpacity;\n};\n\n/** Properties for the [[ToolbarComposer]] React components\n * @public\n */\nexport interface ExtensibleToolbarProps {\n items: ToolbarItem[];\n usage: ToolbarUsage;\n /** Toolbar orientation. */\n orientation: ToolbarOrientation;\n}\n\n/**\n * Toolbar that is populated and maintained by item managers.\n * @public\n */\nexport function ToolbarComposer(props: ExtensibleToolbarProps) {\n const { usage, orientation } = props;\n\n const [defaultItemsManager, setDefaultItemsManager] = React.useState(\n () => new ToolbarItemsManager(props.items)\n );\n React.useEffect(() => {\n setDefaultItemsManager(new ToolbarItemsManager(props.items));\n }, [props.items]);\n\n // process default items\n const defaultItems = useDefaultToolbarItems(defaultItemsManager);\n const syncIdsOfInterest = React.useMemo(\n () => ToolbarItemsManager.getSyncIdsOfInterest(defaultItems),\n [defaultItems]\n );\n useToolbarItemSyncEffect(defaultItemsManager, syncIdsOfInterest);\n\n // process items from addon UI providers\n const [addonItemsManager] = React.useState(() => new ToolbarItemsManager());\n const addonItems = useUiItemsProviderToolbarItems(\n addonItemsManager,\n usage,\n orientation\n );\n const addonSyncIdsOfInterest = React.useMemo(\n () => ToolbarItemsManager.getSyncIdsOfInterest(addonItems),\n [addonItems]\n );\n useToolbarItemSyncEffect(addonItemsManager, addonSyncIdsOfInterest);\n\n const items = React.useMemo(() => {\n return combineItems(defaultItems, addonItems);\n }, [defaultItems, addonItems]);\n\n const toolbarOrientation =\n orientation === ToolbarOrientation.Horizontal\n ? Orientation.Horizontal\n : Orientation.Vertical;\n const expandsTo =\n toolbarOrientation === Orientation.Horizontal\n ? Direction.Bottom\n : usage === ToolbarUsage.ViewNavigation\n ? Direction.Left\n : Direction.Right;\n const panelAlignment =\n toolbarOrientation === Orientation.Horizontal &&\n usage === ToolbarUsage.ViewNavigation\n ? ToolbarPanelAlignment.End\n : ToolbarPanelAlignment.Start;\n const isDragEnabled = React.useContext(ToolbarDragInteractionContext);\n const useProximityOpacity = useProximityOpacitySetting();\n\n return (\n <ToolbarWithOverflow\n expandsTo={expandsTo}\n panelAlignment={panelAlignment}\n items={items}\n useDragInteraction={isDragEnabled}\n toolbarOpacitySetting={\n useProximityOpacity && !UiFramework.isMobile()\n ? ToolbarOpacitySetting.Proximity\n : /* istanbul ignore next */ ToolbarOpacitySetting.Defaults\n }\n />\n );\n}\n"]}
1
+ {"version":3,"file":"ToolbarComposer.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,8DAIiC;AACjC,sDAA6C;AAC7C,kDAAgD;AAChD,gDAA6C;AAC7C,uDAAkE;AAMlE,+CAKuB;AACvB,uCAAoC;AACpC,+EAA4E;AAC5E,6FAA0F;AAE1F,SAAS,6BAA6B,CACpC,KAAmB,EACnB,aAA0D;IAE1D,MAAM,QAAQ,GAAQ,EAAE,CAAC;IACzB,KAAK,MAAM,WAAW,IAAI,KAAK,EAAE;QAC/B,IAAI,CAAC,IAAA,gCAAkB,EAAC,WAAW,CAAC,EAAE;YACpC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC3B,SAAS;SACV;QAED,MAAM,WAAW,GAAG,6BAA6B,CAC/C,WAAW,CAAC,KAAK,EACjB,aAAa,CACd,CAAC;QACF,MAAM,YAAY,GAAa,EAAE,CAAC;QAElC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;Y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ACN,cAAc,EAAE,IAAI,EACpB,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,kBAAkB,EAAE,aAAa,EACjC,qBAAqB,EACnB,mBAAmB,IAAI,CAAC,yBAAW,CAAC,QAAQ,EAAE;YAC5C,CAAC,CAAC,wCAAqB,CAAC,SAAS;YACjC,CAAC,CAAC,0BAA0B,CAAC,wCAAqB,CAAC,QAAQ,GAE/D,CACH,CAAC;AACJ,CAAC;AA5CD,0CA4CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Orientation } from \"@itwin/core-react\";\nimport { UiFramework } from \"../UiFramework\";\nimport { ToolbarDragInteractionContext } from \"./DragInteraction\";\nimport type {\n ToolbarActionItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem\";\nimport {\n isToolbarActionItem,\n isToolbarGroupItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem\";\nimport { Toolbar } from \"./Toolbar\";\nimport { useActiveToolIdSynchedItems } from \"./useActiveToolIdSynchedItems\";\nimport { useActiveStageProvidedToolbarItems } from \"./useActiveStageProvidedToolbarItems\";\n\nfunction addItemToSpecifiedParentGroup<T extends ToolbarItem>(\n items: readonly T[],\n groupChildren: Array<ToolbarActionItem | ToolbarGroupItem>\n): T[] {\n const outItems: T[] = [];\n for (const toolbarItem of items) {\n if (!isToolbarGroupItem(toolbarItem)) {\n outItems.push(toolbarItem);\n continue;\n }\n\n const newChildren = addItemToSpecifiedParentGroup(\n toolbarItem.items,\n groupChildren\n );\n const foundIndices: number[] = [];\n\n groupChildren.forEach((entry, index) => {\n if (entry.parentGroupItemId === toolbarItem.id) {\n foundIndices.push(index);\n }\n });\n\n // istanbul ignore else\n if (foundIndices.length) {\n // process in reverse order so groupChildren can be reduced as we find matches\n foundIndices\n .sort(\n // istanbul ignore next\n (a, b) => a - b\n )\n .reverse()\n .forEach((foundIndex) => {\n newChildren.push(groupChildren[foundIndex]);\n groupChildren.splice(foundIndex);\n });\n }\n\n outItems.push({ ...toolbarItem, items: newChildren });\n }\n return outItems;\n}\n\nfunction cloneGroup(inGroup: ToolbarGroupItem): ToolbarGroupItem {\n const childItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n inGroup.items.forEach((item) => {\n if (isToolbarGroupItem(item)) childItems.push(cloneGroup(item));\n else childItems.push(item);\n });\n\n const clonedGroup = { ...inGroup, items: childItems };\n return clonedGroup;\n}\n\nfunction getItemSortValue(item: ToolbarItem) {\n const groupValue =\n undefined === item.groupPriority\n ? 0\n : /* istanbul ignore next */ item.groupPriority;\n return groupValue * 10000 + item.itemPriority;\n}\n\nfunction sortItems(items: ReadonlyArray<ToolbarItem>): ToolbarItem[] {\n return [...items]\n .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))\n .map((i) => {\n if (isToolbarGroupItem(i)) {\n return { ...i, items: sortItems(i.items) };\n }\n return i;\n });\n}\n\n/**\n * Create a forEach handler that will add every element of an array of ToolbarItems\n * to a list of items that can then be replaced in its proper place, ensuring that\n * the same item, from different list, is not added multiple times.\n * @param items Output list of items\n * @param groupChildren Output list of group children to redistribute.\n * @returns Array<ToolbarItem>.forEach handler.\n */\nfunction addIfNotDuplicate(\n items: ToolbarItem[],\n groupChildren: (ToolbarActionItem | ToolbarGroupItem)[]\n): (value: ToolbarItem) => void {\n return (srcItem: ToolbarItem) => {\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\n // if the default item is a group that an addon may insert into copy it so we don't mess with original\n const toolbarItem = isToolbarGroupItem(srcItem)\n ? cloneGroup(srcItem)\n : srcItem;\n if (\n (isToolbarGroupItem(toolbarItem) || isToolbarActionItem(toolbarItem)) &&\n toolbarItem.parentGroupItemId\n )\n groupChildren.push(toolbarItem);\n else items.push(toolbarItem);\n }\n };\n}\n\n/** local function to combine items from Stage and from Extensions */\nfunction combineItems(\n defaultItems: ReadonlyArray<ToolbarItem>,\n addonItems: ReadonlyArray<ToolbarItem>\n): ToolbarItem[] {\n let items: ToolbarItem[] = [];\n const groupChildren: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n\n defaultItems.forEach(addIfNotDuplicate(items, groupChildren));\n addonItems.forEach(addIfNotDuplicate(items, groupChildren));\n\n // if an item from an addon has specified a parent group then try to find it and insert it. If no parent is found, add item at root level.\n if (groupChildren.length) {\n items = addItemToSpecifiedParentGroup(items, groupChildren);\n\n groupChildren.forEach((toolbarItem) => {\n Logger.logWarning(\n \"ToolbarComposer\",\n `Requested Parent Group [${toolbarItem.parentGroupItemId!}] not found, so item [${\n toolbarItem.id\n }] is added directly to toolbar.`\n );\n items.push(toolbarItem);\n });\n }\n\n return sortItems(items);\n}\n\nconst useProximityOpacitySetting = () => {\n const [proximityOpacity, setProximityOpacity] = React.useState(\n UiFramework.visibility.useProximityOpacity\n );\n React.useEffect(() => {\n // istanbul ignore next\n const handleUiVisibilityChanged = () => {\n setProximityOpacity(UiFramework.visibility.useProximityOpacity);\n };\n UiFramework.onUiVisibilityChanged.addListener(handleUiVisibilityChanged);\n return () => {\n UiFramework.onUiVisibilityChanged.removeListener(\n handleUiVisibilityChanged\n );\n };\n }, []);\n return proximityOpacity;\n};\n\n/** Properties for the [[ToolbarComposer]] React components\n * @public\n */\nexport interface ExtensibleToolbarProps {\n items: ToolbarItem[];\n usage: ToolbarUsage;\n /** Toolbar orientation. */\n orientation: ToolbarOrientation;\n}\n\n/**\n * Toolbar that is populated and maintained by item managers, will override\n * isActive property based on the active tool id.\n * @public\n */\nexport function ToolbarComposer(props: ExtensibleToolbarProps) {\n const { usage, orientation } = props;\n\n // process items from addon UI providers\n const addonItems = useActiveStageProvidedToolbarItems(usage, orientation);\n\n const allItems = React.useMemo(() => {\n return combineItems(props.items, addonItems);\n }, [props.items, addonItems]);\n\n const items = useActiveToolIdSynchedItems(allItems, UiFramework.frontstages);\n\n const toolbarOrientation =\n orientation === ToolbarOrientation.Horizontal\n ? Orientation.Horizontal\n : Orientation.Vertical;\n const expandsTo =\n toolbarOrientation === Orientation.Horizontal\n ? Direction.Bottom\n : usage === ToolbarUsage.ViewNavigation\n ? Direction.Left\n : Direction.Right;\n const panelAlignment =\n toolbarOrientation === Orientation.Horizontal &&\n usage === ToolbarUsage.ViewNavigation\n ? ToolbarPanelAlignment.End\n : ToolbarPanelAlignment.Start;\n const isDragEnabled = React.useContext(ToolbarDragInteractionContext);\n const useProximityOpacity = useProximityOpacitySetting();\n\n return (\n <Toolbar\n enableOverflow={true}\n expandsTo={expandsTo}\n panelAlignment={panelAlignment}\n items={items}\n useDragInteraction={isDragEnabled}\n toolbarOpacitySetting={\n useProximityOpacity && !UiFramework.isMobile()\n ? ToolbarOpacitySetting.Proximity\n : /* istanbul ignore next */ ToolbarOpacitySetting.Defaults\n }\n />\n );\n}\n"]}
@@ -8,9 +8,9 @@ import type { IconSpec } from "@itwin/core-react";
8
8
  * @public
9
9
  */
10
10
  export declare enum ToolbarUsage {
11
- /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */
11
+ /** Contains tools to Create Update and Delete content - in AppUI this is in top left of content area. */
12
12
  ContentManipulation = 0,
13
- /** Manipulate view/camera - in ninezone this is in top right of content area. */
13
+ /** Manipulate view/camera - in AppUI this is in top right of content area. */
14
14
  ViewNavigation = 1
15
15
  }
16
16
  /** Used to specify the orientation of the toolbar.
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarItem.ts"],"names":[],"mappings":"AAIA;;GAEG;;AAEH,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB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,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,qHAAqH;IACrH,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,sBAAsB,CAAC;IAChD,yDAAyD;IACzD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAAC;IACtD,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAAC;IACpE,qDAAqD;IACrD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,qHAAqH;IACrH,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IACzB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAAC;IACjD,oDAAoD;IACpD,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,CAAC;AAEtB;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAChB,IAAI,IAAI,iBAAiB,CAE3B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,WAAW,GAChB,IAAI,IAAI,gBAAgB,CAE1B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAChB,IAAI,IAAI,iBAAiB,CAE3B"}
@@ -13,9 +13,9 @@ exports.isToolbarCustomItem = exports.isToolbarGroupItem = exports.isToolbarActi
13
13
  */
14
14
  var ToolbarUsage;
15
15
  (function (ToolbarUsage) {
16
- /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */
16
+ /** Contains tools to Create Update and Delete content - in AppUI this is in top left of content area. */
17
17
  ToolbarUsage[ToolbarUsage["ContentManipulation"] = 0] = "ContentManipulation";
18
- /** Manipulate view/camera - in ninezone this is in top right of content area. */
18
+ /** Manipulate view/camera - in AppUI this is in top right of content area. */
19
19
  ToolbarUsage[ToolbarUsage["ViewNavigation"] = 1] = "ViewNavigation";
20
20
  })(ToolbarUsage = exports.ToolbarUsage || (exports.ToolbarUsage = {}));
21
21
  /** Used to specify the orientation of the toolbar.
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarItem.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AASH;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,4GAA4G;IAC5G,6EAAuB,CAAA;IACvB,iFAAiF;IACjF,mEAAkB,CAAA;AACpB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAED;;GAEG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,uEAAc,CAAA;IACd,wBAAwB;IACxB,mEAAY,CAAA;AACd,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AA6ED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,IAAiB;IAEjB,OAAO,SAAS,IAAI,IAAI,CAAC;AAC3B,CAAC;AAJD,kDAIC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,IAAiB;IAEjB,OAAO,OAAO,IAAI,IAAI,CAAC;AACzB,CAAC;AAJD,gDAIC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,IAAiB;IAEjB,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAJD,kDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport type {\n BadgeType,\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport type { IconSpec } from \"@itwin/core-react\";\n\n/** Used to specify the usage of the toolbar which determine the toolbar position.\n * @public\n */\nexport enum ToolbarUsage {\n /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */\n ContentManipulation = 0,\n /** Manipulate view/camera - in ninezone this is in top right of content area. */\n ViewNavigation = 1,\n}\n\n/** Used to specify the orientation of the toolbar.\n * @public\n */\nexport enum ToolbarOrientation {\n /** Horizontal toolbar. */\n Horizontal = 0,\n /** Vertical toolbar. */\n Vertical = 1,\n}\n\n/** Describes the data needed to insert a UI items into an existing set of UI items.\n * @public\n */\nexport interface CommonToolbarItem {\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** Describes badge. Renders no badge if not specified. */\n readonly badge?: BadgeType;\n /** Optional description */\n readonly description?: string | ConditionalStringValue;\n /** Defines if the item is active (shown with an active stripe/bar). */\n readonly isActive?: boolean;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\n */\n readonly groupPriority?: number;\n /** Priority within a toolbar or group. */\n readonly itemPriority: number;\n}\n\n/** Describes the data needed to insert an action button into a toolbar.\n * @public\n */\nexport interface ToolbarActionItem extends CommonToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: IconSpec;\n /** label, shown as tool tip on a button or an item label in a group. */\n readonly label: string | ConditionalStringValue;\n /** function to run when the button is pressed. */\n readonly execute: () => void;\n /** Optional parent tool group to add the tool to. */\n readonly parentGroupItemId?: string;\n}\n\n/** Describes the data needed to insert a group button into a toolbar.\n * @public\n */\nexport interface ToolbarGroupItem extends CommonToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: IconSpec;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label: string | ConditionalStringValue;\n /** label shown as the title in at top of group panel. */\n readonly panelLabel?: string | ConditionalStringValue;\n /** children of the group */\n readonly items: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>;\n /** Optional parent tool group to add the tool to. */\n readonly parentGroupItemId?: string;\n}\n\n/** Describes the data needed to insert a custom button into a toolbar.\n * @public\n */\nexport interface ToolbarCustomItem extends CommonToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: IconSpec;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label?: string | ConditionalStringValue;\n /** defines the content to display in popup panel */\n readonly panelContent?: React.ReactNode;\n}\n\n/** Any Button Type that can be inserted into a toolbar.\n * @public\n */\nexport type ToolbarItem =\n | ToolbarActionItem\n | ToolbarGroupItem\n | ToolbarCustomItem;\n\n/** ToolbarActionItem type guard.\n * @public\n */\nexport function isToolbarActionItem(\n item: ToolbarItem\n): item is ToolbarActionItem {\n return \"execute\" in item;\n}\n\n/** ToolbarGroupItem type guard.\n * @public\n */\nexport function isToolbarGroupItem(\n item: ToolbarItem\n): item is ToolbarGroupItem {\n return \"items\" in item;\n}\n\n/** ToolbarCustomItem type guard.\n * @public\n */\nexport function isToolbarCustomItem(\n item: ToolbarItem\n): item is ToolbarCustomItem {\n return !isToolbarActionItem(item) && !isToolbarGroupItem(item);\n}\n"]}
1
+ {"version":3,"file":"ToolbarItem.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarItem.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AASH;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,yGAAyG;IACzG,6EAAuB,CAAA;IACvB,8EAA8E;IAC9E,mEAAkB,CAAA;AACpB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAED;;GAEG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,uEAAc,CAAA;IACd,wBAAwB;IACxB,mEAAY,CAAA;AACd,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AA6ED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,IAAiB;IAEjB,OAAO,SAAS,IAAI,IAAI,CAAC;AAC3B,CAAC;AAJD,kDAIC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,IAAiB;IAEjB,OAAO,OAAO,IAAI,IAAI,CAAC;AACzB,CAAC;AAJD,gDAIC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CACjC,IAAiB;IAEjB,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC;AAJD,kDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport type {\n BadgeType,\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport type { IconSpec } from \"@itwin/core-react\";\n\n/** Used to specify the usage of the toolbar which determine the toolbar position.\n * @public\n */\nexport enum ToolbarUsage {\n /** Contains tools to Create Update and Delete content - in AppUI this is in top left of content area. */\n ContentManipulation = 0,\n /** Manipulate view/camera - in AppUI this is in top right of content area. */\n ViewNavigation = 1,\n}\n\n/** Used to specify the orientation of the toolbar.\n * @public\n */\nexport enum ToolbarOrientation {\n /** Horizontal toolbar. */\n Horizontal = 0,\n /** Vertical toolbar. */\n Vertical = 1,\n}\n\n/** Describes the data needed to insert a UI items into an existing set of UI items.\n * @public\n */\nexport interface CommonToolbarItem {\n /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */\n readonly id: string;\n /** Describes badge. Renders no badge if not specified. */\n readonly badge?: BadgeType;\n /** Optional description */\n readonly description?: string | ConditionalStringValue;\n /** Defines if the item is active (shown with an active stripe/bar). */\n readonly isActive?: boolean;\n /** Describes if the item is visible or hidden. The default is for the item to be visible. */\n readonly isHidden?: boolean | ConditionalBooleanValue;\n /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */\n readonly isDisabled?: boolean | ConditionalBooleanValue;\n /** Specifies the item's grouping value. Items are sorted by group and then item priority. When\n * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This\n * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.\n */\n readonly groupPriority?: number;\n /** Priority within a toolbar or group. */\n readonly itemPriority: number;\n}\n\n/** Describes the data needed to insert an action button into a toolbar.\n * @public\n */\nexport interface ToolbarActionItem extends CommonToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: IconSpec;\n /** label, shown as tool tip on a button or an item label in a group. */\n readonly label: string | ConditionalStringValue;\n /** function to run when the button is pressed. */\n readonly execute: () => void;\n /** Optional parent tool group to add the tool to. */\n readonly parentGroupItemId?: string;\n}\n\n/** Describes the data needed to insert a group button into a toolbar.\n * @public\n */\nexport interface ToolbarGroupItem extends CommonToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon: IconSpec;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label: string | ConditionalStringValue;\n /** label shown as the title in at top of group panel. */\n readonly panelLabel?: string | ConditionalStringValue;\n /** children of the group */\n readonly items: ReadonlyArray<ToolbarActionItem | ToolbarGroupItem>;\n /** Optional parent tool group to add the tool to. */\n readonly parentGroupItemId?: string;\n}\n\n/** Describes the data needed to insert a custom button into a toolbar.\n * @public\n */\nexport interface ToolbarCustomItem extends CommonToolbarItem {\n /** Name of icon WebFont entry or if specifying an imported SVG symbol use \"webSvg:\" prefix to imported symbol Id. */\n readonly icon?: IconSpec;\n /** label, shown as tool tip on group button or a group button label in a group panel. */\n readonly label?: string | ConditionalStringValue;\n /** defines the content to display in popup panel */\n readonly panelContent?: React.ReactNode;\n}\n\n/** Any Button Type that can be inserted into a toolbar.\n * @public\n */\nexport type ToolbarItem =\n | ToolbarActionItem\n | ToolbarGroupItem\n | ToolbarCustomItem;\n\n/** ToolbarActionItem type guard.\n * @public\n */\nexport function isToolbarActionItem(\n item: ToolbarItem\n): item is ToolbarActionItem {\n return \"execute\" in item;\n}\n\n/** ToolbarGroupItem type guard.\n * @public\n */\nexport function isToolbarGroupItem(\n item: ToolbarItem\n): item is ToolbarGroupItem {\n return \"items\" in item;\n}\n\n/** ToolbarCustomItem type guard.\n * @public\n */\nexport function isToolbarCustomItem(\n item: ToolbarItem\n): item is ToolbarCustomItem {\n return !isToolbarActionItem(item) && !isToolbarGroupItem(item);\n}\n"]}
@@ -12,6 +12,7 @@ export interface ToolbarItemsChangedArgs {
12
12
  /**
13
13
  * Controls status bar items.
14
14
  * @internal
15
+ * @deprecated in 4.4.0. This is no longer used internally, left because of an erroneous public dependency that is also deprecated.
15
16
  */
16
17
  export declare class ToolbarItemsManager {
17
18
  protected _items: ReadonlyArray<ToolbarItem>;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItemsManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarItemsManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAOH,OAAO,EAAE,OAAO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