@itwin/appui-react 5.8.0 → 5.9.1

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 (59) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/lib/appui-react/content/ContentLayout.d.ts.map +1 -1
  3. package/lib/appui-react/content/ContentLayout.js +3 -2
  4. package/lib/appui-react/content/ContentLayout.js.map +1 -1
  5. package/lib/appui-react/hooks/useSafeContext.d.ts +7 -0
  6. package/lib/appui-react/hooks/useSafeContext.d.ts.map +1 -0
  7. package/lib/appui-react/hooks/useSafeContext.js +17 -0
  8. package/lib/appui-react/hooks/useSafeContext.js.map +1 -0
  9. package/lib/appui-react/toolbar/new-toolbars/ActionItem.d.ts +2 -2
  10. package/lib/appui-react/toolbar/new-toolbars/ActionItem.d.ts.map +1 -1
  11. package/lib/appui-react/toolbar/new-toolbars/ActionItem.js +2 -1
  12. package/lib/appui-react/toolbar/new-toolbars/ActionItem.js.map +1 -1
  13. package/lib/appui-react/toolbar/new-toolbars/CustomItem.d.ts +2 -2
  14. package/lib/appui-react/toolbar/new-toolbars/CustomItem.d.ts.map +1 -1
  15. package/lib/appui-react/toolbar/new-toolbars/CustomItem.js +3 -2
  16. package/lib/appui-react/toolbar/new-toolbars/CustomItem.js.map +1 -1
  17. package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts +2 -3
  18. package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
  19. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +6 -7
  20. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
  21. package/lib/appui-react/toolbar/new-toolbars/Item.d.ts +3 -5
  22. package/lib/appui-react/toolbar/new-toolbars/Item.d.ts.map +1 -1
  23. package/lib/appui-react/toolbar/new-toolbars/Item.js +15 -19
  24. package/lib/appui-react/toolbar/new-toolbars/Item.js.map +1 -1
  25. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.d.ts +0 -1
  26. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.d.ts.map +1 -1
  27. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.js +3 -2
  28. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.js.map +1 -1
  29. package/lib/appui-react/toolbar/new-toolbars/Separator.d.ts +8 -0
  30. package/lib/appui-react/toolbar/new-toolbars/Separator.d.ts.map +1 -0
  31. package/lib/appui-react/toolbar/new-toolbars/Separator.js +19 -0
  32. package/lib/appui-react/toolbar/new-toolbars/Separator.js.map +1 -0
  33. package/lib/appui-react/toolbar/new-toolbars/Separator.scss +32 -0
  34. package/lib/appui-react/toolbar/new-toolbars/Surface.d.ts +5 -3
  35. package/lib/appui-react/toolbar/new-toolbars/Surface.d.ts.map +1 -1
  36. package/lib/appui-react/toolbar/new-toolbars/Surface.js.map +1 -1
  37. package/lib/appui-react/toolbar/new-toolbars/Surface.scss +4 -2
  38. package/lib/appui-react/toolbar/new-toolbars/ToolGroup.d.ts +0 -5
  39. package/lib/appui-react/toolbar/new-toolbars/ToolGroup.d.ts.map +1 -1
  40. package/lib/appui-react/toolbar/new-toolbars/ToolGroup.js +50 -19
  41. package/lib/appui-react/toolbar/new-toolbars/ToolGroup.js.map +1 -1
  42. package/lib/appui-react/toolbar/new-toolbars/Toolbar.d.ts +5 -0
  43. package/lib/appui-react/toolbar/new-toolbars/Toolbar.d.ts.map +1 -1
  44. package/lib/appui-react/toolbar/new-toolbars/Toolbar.js +45 -12
  45. package/lib/appui-react/toolbar/new-toolbars/Toolbar.js.map +1 -1
  46. package/lib/appui-react/toolbar/new-toolbars/useOverflow.js +2 -2
  47. package/lib/appui-react/toolbar/new-toolbars/useOverflow.js.map +1 -1
  48. package/lib/appui-react/widget-panels/useWidgetDirection.d.ts +1 -1
  49. package/lib/appui-react/widget-panels/useWidgetDirection.js +1 -1
  50. package/lib/appui-react/widget-panels/useWidgetDirection.js.map +1 -1
  51. package/lib/appui-react/widgets/useWidget.d.ts +5 -1
  52. package/lib/appui-react/widgets/useWidget.d.ts.map +1 -1
  53. package/lib/appui-react/widgets/useWidget.js +5 -1
  54. package/lib/appui-react/widgets/useWidget.js.map +1 -1
  55. package/lib/cjs/appui-react/toolbar/new-toolbars/Separator.scss +32 -0
  56. package/lib/cjs/appui-react/toolbar/new-toolbars/Surface.scss +4 -2
  57. package/lib/esm/appui-react/toolbar/new-toolbars/Separator.scss +32 -0
  58. package/lib/esm/appui-react/toolbar/new-toolbars/Surface.scss +4 -2
  59. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"useWidgetDirection.js","sourceRoot":"","sources":["../../../src/appui-react/widget-panels/useWidgetDirection.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChB,OAAO,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QACzB,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACjD,IACE,WAAW;YACX,MAAM,IAAI,WAAW;YACrB,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,EACvC,CAAC;YACD,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Widget\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { useLayout } from \"../layout/base/LayoutStore.js\";\nimport { getTabLocation } from \"../layout/state/TabLocation.js\";\nimport { isHorizontalPanelSide } from \"../layout/widget-panels/Panel.js\";\nimport { TabIdContext } from \"../layout/widget/ContentRenderer.js\";\n\n/** Returns widget direction.\n * I.e. \"horizontal\" when widget is in bottom/top stage panel.\n * @alpha\n */\nexport function useWidgetDirection(): \"horizontal\" | \"vertical\" {\n const tabId = React.useContext(TabIdContext);\n assert(!!tabId);\n return useLayout((state) => {\n const tabLocation = getTabLocation(state, tabId);\n if (\n tabLocation &&\n \"side\" in tabLocation &&\n isHorizontalPanelSide(tabLocation.side)\n ) {\n return \"horizontal\";\n }\n return \"vertical\";\n });\n}\n"]}
1
+ {"version":3,"file":"useWidgetDirection.js","sourceRoot":"","sources":["../../../src/appui-react/widget-panels/useWidgetDirection.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChB,OAAO,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;QACzB,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACjD,IACE,WAAW;YACX,MAAM,IAAI,WAAW;YACrB,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,EACvC,CAAC;YACD,OAAO,YAAY,CAAC;QACtB,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Widget\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport { useLayout } from \"../layout/base/LayoutStore.js\";\nimport { getTabLocation } from \"../layout/state/TabLocation.js\";\nimport { isHorizontalPanelSide } from \"../layout/widget-panels/Panel.js\";\nimport { TabIdContext } from \"../layout/widget/ContentRenderer.js\";\n\n/** Returns widget direction.\n * I.e. \"horizontal\" when widget is in bottom/top stage panel.\n * @public\n */\nexport function useWidgetDirection(): \"horizontal\" | \"vertical\" {\n const tabId = React.useContext(TabIdContext);\n assert(!!tabId);\n return useLayout((state) => {\n const tabLocation = getTabLocation(state, tabId);\n if (\n tabLocation &&\n \"side\" in tabLocation &&\n isHorizontalPanelSide(tabLocation.side)\n ) {\n return \"horizontal\";\n }\n return \"vertical\";\n });\n}\n"]}
@@ -1,8 +1,12 @@
1
+ /** @packageDocumentation
2
+ * @module Widget
3
+ */
1
4
  import type { WidgetState } from "./WidgetState.js";
2
5
  /** Hook that returns information about the Widget in the current context.
6
+ * @note This hook must be used within a widget.
3
7
  * @returns object that contains the WidgetLocation, WidgetState, and
4
8
  * the ability to set the state of the widget.
5
- * @alpha
9
+ * @public
6
10
  */
7
11
  export declare function useWidget(): {
8
12
  /** State of the Widget */
@@ -1 +1 @@
1
- {"version":3,"file":"useWidget.d.ts","sourceRoot":"","sources":["../../../src/appui-react/widgets/useWidget.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,SAAS;IA0CrB,0BAA0B;;IAE1B,sEAAsE;;IAEtE;;OAEG;4BAbW,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC;EAgBxD"}
1
+ {"version":3,"file":"useWidget.d.ts","sourceRoot":"","sources":["../../../src/appui-react/widgets/useWidget.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAeH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,SAAS;IA0CrB,0BAA0B;;IAE1B,sEAAsE;;IAEtE;;OAEG;4BAbW,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC;EAgBxD"}
@@ -2,6 +2,9 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Widget
7
+ */
5
8
  import { assert } from "@itwin/core-bentley";
6
9
  import * as React from "react";
7
10
  import { useActiveFrontstageDef } from "../frontstage/FrontstageDef.js";
@@ -10,9 +13,10 @@ import { getTabLocation, isFloatingTabLocation, isPanelTabLocation, isPopoutTabL
10
13
  import { TabIdContext } from "../layout/widget/ContentRenderer.js";
11
14
  import { useWidgetDef } from "../widget-panels/Content.js";
12
15
  /** Hook that returns information about the Widget in the current context.
16
+ * @note This hook must be used within a widget.
13
17
  * @returns object that contains the WidgetLocation, WidgetState, and
14
18
  * the ability to set the state of the widget.
15
- * @alpha
19
+ * @public
16
20
  */
17
21
  export function useWidget() {
18
22
  const tabId = React.useContext(TabIdContext);
@@ -1 +1 @@
1
- {"version":3,"file":"useWidget.js","sourceRoot":"","sources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;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IAE5B,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,yBAAyB,CAAC,qCAAqC,CAAC,WAAW,CAChF,GAAG,EAAE;YACH,iBAAiB,CAAC,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;QACrD,CAAC,CACF,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;IAExB,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CACtC,CAAC,WAAoD,EAAE,EAAE;QACvD,SAAS,EAAE,cAAc,CAAC,WAA0B,CAAC,CAAC;IACxD,CAAC,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;IAEF,OAAO;QACL,0BAA0B;QAC1B,KAAK;QACL,sEAAsE;QACtE,cAAc;QACd;;WAEG;QACH,QAAQ,EAAE,cAAc;KACzB,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,aAAqB,EAAE,UAAyB;IACpE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACnC,MAAM,WAAW,GAAG,cAAc,CAAC,UAAU,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAE5E,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,qBAAqB,CAAC,WAAW,CAAC,EAAE,CAAC;YACvC,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,IAAI,mBAAmB,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { assert } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport type { FrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager.js\";\nimport {\n getTabLocation,\n isFloatingTabLocation,\n isPanelTabLocation,\n isPopoutTabLocation,\n} from \"../layout/state/TabLocation.js\";\nimport { TabIdContext } from \"../layout/widget/ContentRenderer.js\";\nimport { useWidgetDef } from \"../widget-panels/Content.js\";\nimport type { WidgetState } from \"./WidgetState.js\";\n\n/** Hook that returns information about the Widget in the current context.\n * @returns object that contains the WidgetLocation, WidgetState, and\n * the ability to set the state of the widget.\n * @alpha\n */\nexport function useWidget() {\n const tabId = React.useContext(TabIdContext);\n assert(!!tabId);\n\n const frontstage = useActiveFrontstageDef();\n\n assert(!!frontstage);\n\n const widgetDef = useWidgetDef();\n\n assert(!!widgetDef);\n\n const [widgetLocation, setWidgetLocation] = React.useState<\n \"docked\" | \"floating\" | \"popout\"\n >(findLocation(tabId, frontstage));\n\n const [state, setState] = React.useState(widgetDef.state);\n\n React.useEffect(() => {\n return InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.addListener(\n () => {\n if (widgetDef) return setState(widgetDef.state);\n }\n );\n }, [frontstage, widgetDef]);\n\n React.useEffect(() => {\n return InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.addListener(\n () => {\n setWidgetLocation(findLocation(tabId, frontstage));\n }\n );\n }, [frontstage, tabId]);\n\n const setWidgetState = React.useCallback(\n (widgetState: Omit<WidgetState, WidgetState.Floating>) => {\n widgetDef?.setWidgetState(widgetState as WidgetState);\n },\n [widgetDef]\n );\n\n return {\n /** State of the Widget */\n state,\n /** Where the widget is located (\"docked\" | \"popout\" | \"floating\"). */\n widgetLocation,\n /** Set widget to different state\n * @param WidgetState that you want to set the widget to.\n */\n setState: setWidgetState,\n };\n}\n\nfunction findLocation(locationTabId: string, frontstage: FrontstageDef) {\n assert(!!frontstage.nineZoneState);\n const tabLocation = getTabLocation(frontstage.nineZoneState, locationTabId);\n\n if (tabLocation) {\n if (isFloatingTabLocation(tabLocation)) {\n return \"floating\";\n }\n\n if (isPopoutTabLocation(tabLocation)) {\n return \"popout\";\n }\n\n if (isPanelTabLocation(tabLocation)) {\n return \"docked\";\n }\n }\n\n return \"floating\";\n}\n"]}
1
+ {"version":3,"file":"useWidget.js","sourceRoot":"","sources":["../../../src/appui-react/widgets/useWidget.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D;;;;;GAKG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAEhB,MAAM,UAAU,GAAG,sBAAsB,EAAE,CAAC;IAE5C,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAErB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEpB,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAExD,YAAY,CAAC,KAAK,EAAE,UAAU,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B,CAAC;QAED,IAAI,mBAAmB,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,IAAI,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Widget\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport * as React from \"react\";\nimport type { FrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager.js\";\nimport {\n getTabLocation,\n isFloatingTabLocation,\n isPanelTabLocation,\n isPopoutTabLocation,\n} from \"../layout/state/TabLocation.js\";\nimport { TabIdContext } from \"../layout/widget/ContentRenderer.js\";\nimport { useWidgetDef } from \"../widget-panels/Content.js\";\nimport type { WidgetState } from \"./WidgetState.js\";\n\n/** Hook that returns information about the Widget in the current context.\n * @note This hook must be used within a widget.\n * @returns object that contains the WidgetLocation, WidgetState, and\n * the ability to set the state of the widget.\n * @public\n */\nexport function useWidget() {\n const tabId = React.useContext(TabIdContext);\n assert(!!tabId);\n\n const frontstage = useActiveFrontstageDef();\n\n assert(!!frontstage);\n\n const widgetDef = useWidgetDef();\n\n assert(!!widgetDef);\n\n const [widgetLocation, setWidgetLocation] = React.useState<\n \"docked\" | \"floating\" | \"popout\"\n >(findLocation(tabId, frontstage));\n\n const [state, setState] = React.useState(widgetDef.state);\n\n React.useEffect(() => {\n return InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.addListener(\n () => {\n if (widgetDef) return setState(widgetDef.state);\n }\n );\n }, [frontstage, widgetDef]);\n\n React.useEffect(() => {\n return InternalFrontstageManager.onFrontstageNineZoneStateChangedEvent.addListener(\n () => {\n setWidgetLocation(findLocation(tabId, frontstage));\n }\n );\n }, [frontstage, tabId]);\n\n const setWidgetState = React.useCallback(\n (widgetState: Omit<WidgetState, WidgetState.Floating>) => {\n widgetDef?.setWidgetState(widgetState as WidgetState);\n },\n [widgetDef]\n );\n\n return {\n /** State of the Widget */\n state,\n /** Where the widget is located (\"docked\" | \"popout\" | \"floating\"). */\n widgetLocation,\n /** Set widget to different state\n * @param WidgetState that you want to set the widget to.\n */\n setState: setWidgetState,\n };\n}\n\nfunction findLocation(locationTabId: string, frontstage: FrontstageDef) {\n assert(!!frontstage.nineZoneState);\n const tabLocation = getTabLocation(frontstage.nineZoneState, locationTabId);\n\n if (tabLocation) {\n if (isFloatingTabLocation(tabLocation)) {\n return \"floating\";\n }\n\n if (isPopoutTabLocation(tabLocation)) {\n return \"popout\";\n }\n\n if (isPanelTabLocation(tabLocation)) {\n return \"docked\";\n }\n }\n\n return \"floating\";\n}\n"]}
@@ -0,0 +1,32 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ .uifw-toolbar-newToolbars-separator {
6
+ display: none;
7
+
8
+ &.uifw-horizontal {
9
+ border-right: var(--iui-surface-border);
10
+ border-color: var(--_uifw-toolbar-border-color);
11
+ }
12
+
13
+ &.uifw-vertical {
14
+ border-bottom: var(--iui-surface-border);
15
+ border-color: var(--_uifw-toolbar-border-color);
16
+ }
17
+
18
+ &:has(~ button) {
19
+ button + & {
20
+ display: block;
21
+ }
22
+ }
23
+
24
+ @supports not selector(:has(~ *)) {
25
+ button + & {
26
+ // This will display the last separator if there are multiple separators at the end of the toolbar.
27
+ &:not(:last-child) {
28
+ display: block;
29
+ }
30
+ }
31
+ }
32
+ }
@@ -3,10 +3,12 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  .uifw-toolbar-group-surface {
6
+ --_uifw-toolbar-border-color: var(--iui-color-border-foreground);
7
+
6
8
  display: flex;
7
9
  width: fit-content;
8
10
  height: fit-content;
9
- border-color: var(--iui-color-border-foreground);
11
+ border-color: var(--_uifw-toolbar-border-color);
10
12
  transition: border-color var(--iui-duration-1) ease;
11
13
  // TODO: needed due to opacity on toolbar container (since pointer events are disabled for center content).
12
14
  pointer-events: all;
@@ -26,7 +28,7 @@
26
28
 
27
29
  &:hover,
28
30
  &:focus-within {
29
- border-color: var(--iui-color-border-foreground-hover);
31
+ --_uifw-toolbar-border-color: var(--iui-color-border-foreground-hover);
30
32
  }
31
33
 
32
34
  &:empty {
@@ -0,0 +1,32 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ .uifw-toolbar-newToolbars-separator {
6
+ display: none;
7
+
8
+ &.uifw-horizontal {
9
+ border-right: var(--iui-surface-border);
10
+ border-color: var(--_uifw-toolbar-border-color);
11
+ }
12
+
13
+ &.uifw-vertical {
14
+ border-bottom: var(--iui-surface-border);
15
+ border-color: var(--_uifw-toolbar-border-color);
16
+ }
17
+
18
+ &:has(~ button) {
19
+ button + & {
20
+ display: block;
21
+ }
22
+ }
23
+
24
+ @supports not selector(:has(~ *)) {
25
+ button + & {
26
+ // This will display the last separator if there are multiple separators at the end of the toolbar.
27
+ &:not(:last-child) {
28
+ display: block;
29
+ }
30
+ }
31
+ }
32
+ }
@@ -3,10 +3,12 @@
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
5
  .uifw-toolbar-group-surface {
6
+ --_uifw-toolbar-border-color: var(--iui-color-border-foreground);
7
+
6
8
  display: flex;
7
9
  width: fit-content;
8
10
  height: fit-content;
9
- border-color: var(--iui-color-border-foreground);
11
+ border-color: var(--_uifw-toolbar-border-color);
10
12
  transition: border-color var(--iui-duration-1) ease;
11
13
  // TODO: needed due to opacity on toolbar container (since pointer events are disabled for center content).
12
14
  pointer-events: all;
@@ -26,7 +28,7 @@
26
28
 
27
29
  &:hover,
28
30
  &:focus-within {
29
- border-color: var(--iui-color-border-foreground-hover);
31
+ --_uifw-toolbar-border-color: var(--iui-color-border-foreground-hover);
30
32
  }
31
33
 
32
34
  &:empty {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/appui-react",
3
- "version": "5.8.0",
3
+ "version": "5.9.1",
4
4
  "description": "A react component library for AppUI framework",
5
5
  "type": "module",
6
6
  "types": "./lib/appui-react.d.ts",
@@ -45,9 +45,9 @@
45
45
  "react-dom": "^18.0.0",
46
46
  "react-redux": "^7.2.2 || ^8.0.0 || ^9.0.0",
47
47
  "redux": "^4.1.0 || ^5.0.0",
48
- "@itwin/components-react": "5.8.0",
49
- "@itwin/core-react": "5.8.0",
50
- "@itwin/imodel-components-react": "5.8.0"
48
+ "@itwin/components-react": "5.9.1",
49
+ "@itwin/core-react": "5.9.1",
50
+ "@itwin/imodel-components-react": "5.9.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@itwin/appui-abstract": "rc",
@@ -60,7 +60,7 @@
60
60
  "@itwin/core-quantity": "rc",
61
61
  "@itwin/ecschema-metadata": "rc",
62
62
  "@itwin/eslint-plugin": "5.1.0",
63
- "@itwin/itwinui-react": "^3.17.0",
63
+ "@itwin/itwinui-react": "^3.18.3",
64
64
  "@itwin/webgl-compatibility": "rc",
65
65
  "@testing-library/dom": "^10.1.0",
66
66
  "@testing-library/react": "^15.0.7",
@@ -91,9 +91,9 @@
91
91
  "typescript": "~5.6.2",
92
92
  "upath": "^2.0.1",
93
93
  "vitest": "^3.0.6",
94
- "@itwin/core-react": "5.8.0",
95
- "@itwin/components-react": "5.8.0",
96
- "@itwin/imodel-components-react": "5.8.0"
94
+ "@itwin/imodel-components-react": "5.9.1",
95
+ "@itwin/core-react": "5.9.1",
96
+ "@itwin/components-react": "5.9.1"
97
97
  },
98
98
  "dependencies": {
99
99
  "@itwin/itwinui-icons-react": "^2.8.0",