@itwin/appui-react 5.30.0 → 5.30.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change Log - @itwin/appui-react
2
2
 
3
+ ## 5.30.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4af6f74: Moved the logic that determines whether to use 2d or 3d AccuDraw mode from `FrameworkAccuDraw` class to the root `ConfigurableUiContent` component.
8
+ - @itwin/components-react@5.30.1
9
+ - @itwin/core-react@5.30.1
10
+ - @itwin/imodel-components-react@5.30.1
11
+
3
12
  ## 5.30.0
4
13
 
5
14
  ### Minor Changes
@@ -0,0 +1,7 @@
1
+ /** @packageDocumentation
2
+ * @module AccuDraw
3
+ */
4
+ import * as React from "react";
5
+ /** @internal */
6
+ export declare function AccuDrawStoreProvider(props: React.PropsWithChildren): React.JSX.Element;
7
+ //# sourceMappingURL=AccuDrawStoreProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccuDrawStoreProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-react/accudraw/AccuDrawStoreProvider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,gBAAgB;AAChB,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,qBAanE"}
@@ -0,0 +1,26 @@
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
+ /** @packageDocumentation
6
+ * @module AccuDraw
7
+ */
8
+ import * as React from "react";
9
+ import { useViewports } from "../hooks/useViewports.js";
10
+ import { useListeners } from "../hooks/useListeners.js";
11
+ import { useAccuDrawStore } from "./AccuDrawStore.js";
12
+ /** @internal */
13
+ export function AccuDrawStoreProvider(props) {
14
+ const viewports = useViewports();
15
+ // Updates `is3d` state based on last hovered viewport.
16
+ useListeners(viewports, (viewport) => {
17
+ const handler = () => {
18
+ const is3d = viewport.view.is3d();
19
+ useAccuDrawStore.setState({ is3d });
20
+ };
21
+ viewport.parentDiv.addEventListener("mousemove", handler);
22
+ return () => viewport.parentDiv.removeEventListener("mousemove", handler);
23
+ });
24
+ return React.createElement(React.Fragment, null, props.children);
25
+ }
26
+ //# sourceMappingURL=AccuDrawStoreProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccuDrawStoreProvider.js","sourceRoot":"","sources":["../../../src/appui-react/accudraw/AccuDrawStoreProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,gBAAgB;AAChB,MAAM,UAAU,qBAAqB,CAAC,KAA8B;IAClE,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,uDAAuD;IACvD,YAAY,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,EAAE;QACnC,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAClC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QACtC,CAAC,CAAC;QACF,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC1D,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IACH,OAAO,0CAAG,KAAK,CAAC,QAAQ,CAAI,CAAC;AAC/B,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 AccuDraw\n */\n\nimport * as React from \"react\";\nimport { useViewports } from \"../hooks/useViewports.js\";\nimport { useListeners } from \"../hooks/useListeners.js\";\nimport { useAccuDrawStore } from \"./AccuDrawStore.js\";\n\n/** @internal */\nexport function AccuDrawStoreProvider(props: React.PropsWithChildren) {\n const viewports = useViewports();\n\n // Updates `is3d` state based on last hovered viewport.\n useListeners(viewports, (viewport) => {\n const handler = () => {\n const is3d = viewport.view.is3d();\n useAccuDrawStore.setState({ is3d });\n };\n viewport.parentDiv.addEventListener(\"mousemove\", handler);\n return () => viewport.parentDiv.removeEventListener(\"mousemove\", handler);\n });\n return <>{props.children}</>;\n}\n"]}
@@ -155,7 +155,7 @@ export declare class FrameworkAccuDraw extends AccuDraw implements UserSettingsP
155
155
  * Should also choose active x or y input field in rectangular mode based on cursor position when
156
156
  * axis isn't locked to support "smart lock".
157
157
  */
158
- onMotion(ev: BeButtonEvent): void;
158
+ onMotion(_ev: BeButtonEvent): void;
159
159
  /** Determine if the AccuDraw UI has focus. */
160
160
  get hasInputFocus(): boolean;
161
161
  /** Implement this method to set focus to the AccuDraw UI. */
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkAccuDraw.d.ts","sourceRoot":"","sources":["../../../src/appui-react/accudraw/FrameworkAccuDraw.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,QAAQ,EACR,WAAW,EAEX,SAAS,EAKV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uB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AE,SAAS,GAAG,IAAI;IAU1D,OAAO,CAAC,kBAAkB;IASV,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAIpD;;;OAGG;IACa,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI;IAalD,8CAA8C;IAC9C,IAAoB,aAAa,IAAI,OAAO,CAK3C;IAED,6DAA6D;IAC7C,cAAc,IAAI,IAAI;IAItC,mDAAmD;WACrC,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAmB5D,wCAAwC;WAC1B,mBAAmB,CAC/B,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,MAAM,GAClB,IAAI;IAOP,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,wBAAwB;IAahC,OAAO,CAAC,qBAAqB;CAY9B"}
@@ -12,7 +12,6 @@ import { UiFramework } from "../UiFramework.js";
12
12
  import { SyncUiEventDispatcher } from "../syncui/SyncUiEventDispatcher.js";
13
13
  import { UiStateStorageStatus } from "../uistate/UiStateStorage.js";
14
14
  import { SyncUiEventId } from "../syncui/UiSyncEvent.js";
15
- import { useAccuDrawStore } from "./AccuDrawStore.js";
16
15
  const compassModeToKeyMap = new Map([
17
16
  [CompassMode.Polar, "polar"],
18
17
  [CompassMode.Rectangular, "rectangular"],
@@ -191,11 +190,9 @@ export class FrameworkAccuDraw extends AccuDraw {
191
190
  * Should also choose active x or y input field in rectangular mode based on cursor position when
192
191
  * axis isn't locked to support "smart lock".
193
192
  */
194
- onMotion(ev) {
193
+ onMotion(_ev) {
195
194
  if (!this.isEnabled || this.isDeactivated || UiFramework.isContextMenuOpen)
196
195
  return;
197
- const is3d = ev.viewport?.view.is3d() ?? false;
198
- useAccuDrawStore.setState({ is3d });
199
196
  this.fieldValuesChanged();
200
197
  if (!this.dontMoveFocus && this.compassMode === CompassMode.Rectangular) {
201
198
  // Changes the focus between X and Y axis depending on the cursor location, in rectangular mode.
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkAccuD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CAAC;YACF,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,yBAAyB,EAAE;gBACnE,UAAU;aACX,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAEO,qBAAqB;QAC3B,IAAI,iBAAiB,CAAC,oBAAoB,EAAE,CAAC;YAC3C,MAAM,WAAW,GAAG,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC;YACzE,MAAM,cAAc,GAAG,WAAW,CAAC,SAAS,CAC1C,qBAAqB,WAAW,EAAE,CACnC,CAAC;YACF,MAAM,eAAe,GAAG,WAAW,CAAC,SAAS,CAAC,sBAAsB,EAAE;gBACpE,cAAc;aACf,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAC1C,CAAC;IACH,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 AccuDraw\n */\n\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport type { BeButtonEvent } from \"@itwin/core-frontend\";\nimport {\n AccuDraw,\n CompassMode,\n IModelApp,\n ItemField,\n NotifyMessageDetails,\n OutputMessagePriority,\n QuantityType,\n RotationMode,\n} from \"@itwin/core-frontend\";\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport type { UserSettingsProvider } from \"../UiFramework.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher.js\";\nimport type { AccuDrawUiSettings } from \"./AccuDrawUiSettings.js\";\nimport type { UiStateStorage } from \"../uistate/UiStateStorage.js\";\nimport { UiStateStorageStatus } from \"../uistate/UiStateStorage.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\nimport { useAccuDrawStore } from \"./AccuDrawStore.js\";\n\nconst compassModeToKeyMap = new Map<CompassMode, string>([\n [CompassMode.Polar, \"polar\"],\n [CompassMode.Rectangular, \"rectangular\"],\n]);\n\nconst rotationModeToKeyMap = new Map<RotationMode, string>([\n [RotationMode.Top, \"top\"],\n [RotationMode.Front, \"front\"],\n [RotationMode.Side, \"side\"],\n [RotationMode.View, \"view\"],\n [RotationMode.ACS, \"ACS\"],\n [RotationMode.Context, \"context\"],\n]);\n\n/** Arguments for [[AccuDrawSetFieldFocusEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldFocusEventArgs {\n field: ItemField;\n}\n\n/** AccuDraw Set Field Focus event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldFocusEvent extends BeUiEvent<AccuDrawSetFieldFocusEventArgs> {}\n\n/** Arguments for [[AccuDrawSetFieldValueToUiEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldValueToUiEventArgs {\n field: ItemField;\n value: number;\n formattedValue: string;\n}\n\n/** AccuDraw Set Field Value to Ui event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldValueToUiEvent extends BeUiEvent<AccuDrawSetFieldValueToUiEventArgs> {}\n\n/** Arguments for [[AccuDrawSetFieldValueFromUiEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldValueFromUiEventArgs {\n field: ItemField;\n stringValue: string;\n}\n\n/** AccuDraw Set Field Value from Ui event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldValueFromUiEvent extends BeUiEvent<AccuDrawSetFieldValueFromUiEventArgs> {}\n\n/** Arguments for [[AccuDrawSetFieldLockEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldLockEventArgs {\n field: ItemField;\n lock: boolean;\n}\n\n/** AccuDraw Set Field Lock event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldLockEvent extends BeUiEvent<AccuDrawSetFieldLockEventArgs> {}\n\n/** Arguments for [[AccuDrawSetCompassModeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetCompassModeEventArgs {\n mode: CompassMode;\n}\n\n/** AccuDraw Set Compass Mode event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetCompassModeEvent extends BeUiEvent<AccuDrawSetCompassModeEventArgs> {}\n\n/** AccuDraw Grab Input Focus event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\nexport class AccuDrawGrabInputFocusEvent extends BeUiEvent<object> {}\n\n/** AccuDraw Ui Settings Changed event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\nexport class AccuDrawUiSettingsChangedEvent extends BeUiEvent<object> {}\n\n/** Subclass of `AccuDraw` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * This implementation will generate the required events for the AppUI provided UI to update correctly.\n *\n * ```ts\n * await IModelApp.startup({\n * accuDraw: new FrameworkAccuDraw()\n * });\n * ```\n * @public\n */\nexport class FrameworkAccuDraw\n extends AccuDraw\n implements UserSettingsProvider\n{\n private static _displayNotifications = false;\n private static _uiSettings: AccuDrawUiSettings | undefined;\n private static _settingsNamespace = \"AppUiSettings\";\n private static _notificationsKey = \"AccuDrawNotifications\";\n public readonly providerId = \"FrameworkAccuDraw\";\n\n /** AccuDraw Set Field Focus event. */\n public static readonly onAccuDrawSetFieldFocusEvent =\n new AccuDrawSetFieldFocusEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Field Value to Ui event. */\n public static readonly onAccuDrawSetFieldValueToUiEvent =\n new AccuDrawSetFieldValueToUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Field Value from Ui event. */\n public static readonly onAccuDrawSetFieldValueFromUiEvent =\n new AccuDrawSetFieldValueFromUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Field Lock event. */\n public static readonly onAccuDrawSetFieldLockEvent =\n new AccuDrawSetFieldLockEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Mode event. */\n public static readonly onAccuDrawSetCompassModeEvent =\n new AccuDrawSetCompassModeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Grab Input Focus event. */\n public static readonly onAccuDrawGrabInputFocusEvent =\n new AccuDrawGrabInputFocusEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** Determines if AccuDraw.rotationMode === RotationMode.Top */\n public static readonly isTopRotationConditional = new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Top,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.Front */\n public static readonly isFrontRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Front,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.Side */\n public static readonly isSideRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Side,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.View */\n public static readonly isViewRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.View,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.ACS */\n public static readonly isACSRotationConditional = new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.ACS,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.Context */\n public static readonly isContextRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Context,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.compassMode === CompassMode.Polar */\n public static readonly isPolarModeConditional = new ConditionalBooleanValue(\n () => IModelApp.accuDraw.compassMode === CompassMode.Polar,\n [SyncUiEventId.AccuDrawCompassModeChanged]\n );\n /** Determines if AccuDraw.compassMode === CompassMode.Rectangular */\n public static readonly isRectangularModeConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.compassMode === CompassMode.Rectangular,\n [SyncUiEventId.AccuDrawCompassModeChanged]\n );\n\n /** AccuDraw Grab Input Focus event. */\n public static readonly onAccuDrawUiSettingsChangedEvent =\n new AccuDrawUiSettingsChangedEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** Determines if notifications should be displayed for AccuDraw changes */\n public static get displayNotifications(): boolean {\n return FrameworkAccuDraw._displayNotifications;\n }\n public static set displayNotifications(v: boolean) {\n FrameworkAccuDraw._displayNotifications = v;\n void UiFramework.getUiStateStorage().saveSetting(\n this._settingsNamespace,\n this._notificationsKey,\n v\n );\n }\n\n /* @internal */\n public async loadUserSettings(storage: UiStateStorage): Promise<void> {\n const result = await storage.getSetting(\n FrameworkAccuDraw._settingsNamespace,\n FrameworkAccuDraw._notificationsKey\n );\n if (result.status === UiStateStorageStatus.Success)\n FrameworkAccuDraw._displayNotifications = result.setting;\n }\n\n /** AccuDraw User Interface settings */\n public static get uiStateStorage(): AccuDrawUiSettings | undefined {\n return FrameworkAccuDraw._uiSettings;\n }\n public static set uiStateStorage(v: AccuDrawUiSettings | undefined) {\n FrameworkAccuDraw._uiSettings = v;\n FrameworkAccuDraw.onAccuDrawUiSettingsChangedEvent.emit({});\n }\n\n constructor() {\n super();\n FrameworkAccuDraw.onAccuDrawSetFieldValueFromUiEvent.addListener(\n this.handleSetFieldValueFromUiEvent\n );\n UiFramework.registerUserSettingsProvider(this);\n }\n\n private handleSetFieldValueFromUiEvent = async (\n args: AccuDrawSetFieldValueFromUiEventArgs // eslint-disable-line @typescript-eslint/no-deprecated\n ) => {\n return this.processFieldInput(args.field, args.stringValue, false);\n };\n\n public override onCompassModeChange(): void {\n FrameworkAccuDraw.onAccuDrawSetCompassModeEvent.emit({\n mode: this.compassMode,\n });\n SyncUiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.AccuDrawCompassModeChanged\n );\n\n this.outputCompassModeMessage();\n }\n\n public override onRotationModeChange(): void {\n SyncUiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.AccuDrawRotationChanged\n );\n\n this.outputRotationMessage();\n }\n\n public override onFieldLockChange(index: ItemField): void {\n FrameworkAccuDraw.onAccuDrawSetFieldLockEvent.emit({\n field: index,\n lock: this.getFieldLock(index),\n });\n }\n\n public override onFieldValueChange(index: ItemField): void {\n const value = this.getValueByIndex(index);\n const formattedValue = FrameworkAccuDraw.getFieldDisplayValue(index);\n FrameworkAccuDraw.onAccuDrawSetFieldValueToUiEvent.emit({\n field: index,\n value,\n formattedValue,\n });\n }\n\n private fieldValuesChanged(): void {\n // Only change the value when in Dynamic mode. Other mode are \"DontUpdate\" when the input is locked and \"Partial\" when the user is typing.\n this.onFieldValueChange(ItemField.X_Item);\n this.onFieldValueChange(ItemField.Y_Item);\n this.onFieldValueChange(ItemField.Z_Item);\n this.onFieldValueChange(ItemField.ANGLE_Item);\n this.onFieldValueChange(ItemField.DIST_Item);\n }\n\n public override setFocusItem(index: ItemField): void {\n FrameworkAccuDraw.onAccuDrawSetFieldFocusEvent.emit({ field: index });\n }\n\n /** Implemented by sub-classes to update ui fields to show current deltas or coordinates when inactive.\n * Should also choose active x or y input field in rectangular mode based on cursor position when\n * axis isn't locked to support \"smart lock\".\n */\n public override onMotion(ev: BeButtonEvent): void {\n if (!this.isEnabled || this.isDeactivated || UiFramework.isContextMenuOpen)\n return;\n\n const is3d = ev.viewport?.view.is3d() ?? false;\n useAccuDrawStore.setState({ is3d });\n\n this.fieldValuesChanged();\n\n if (!this.dontMoveFocus && this.compassMode === CompassMode.Rectangular) {\n // Changes the focus between X and Y axis depending on the cursor location, in rectangular mode.\n // Example : this.newFocus is Y when the cursor is closer to the Y axis.\n this.setFocusItem(this.newFocus);\n }\n }\n\n /** Determine if the AccuDraw UI has focus. */\n public override get hasInputFocus(): boolean {\n let hasFocus = false;\n const el = document.querySelector(\"div.uifw-accudraw-field-container\");\n if (el) hasFocus = el.contains(document.activeElement);\n return hasFocus;\n }\n\n /** Implement this method to set focus to the AccuDraw UI. */\n public override grabInputFocus(): void {\n FrameworkAccuDraw.onAccuDrawGrabInputFocusEvent.emit({});\n }\n\n /** Gets the display value for an AccuDraw field */\n public static getFieldDisplayValue(index: ItemField): string {\n const value = IModelApp.accuDraw.getValueByIndex(index);\n let formattedValue = value.toString();\n\n const formatterSpec =\n IModelApp.quantityFormatter.findFormatterSpecByQuantityType(\n ItemField.ANGLE_Item === index\n ? QuantityType.Angle\n : QuantityType.Length\n );\n if (formatterSpec)\n formattedValue = IModelApp.quantityFormatter.formatQuantity(\n value,\n formatterSpec\n );\n\n return formattedValue;\n }\n\n /** AccuDraw Set Field Value from Ui. */\n public static setFieldValueFromUi(\n field: ItemField,\n stringValue: string\n ): void {\n FrameworkAccuDraw.onAccuDrawSetFieldValueFromUiEvent.emit({\n field,\n stringValue,\n });\n }\n\n private outputInfoMessage(message: string): void {\n if (FrameworkAccuDraw.displayNotifications)\n IModelApp.notifications.outputMessage(\n new NotifyMessageDetails(OutputMessagePriority.Info, message)\n );\n }\n\n private outputCompassModeMessage(): void {\n if (FrameworkAccuDraw.displayNotifications) {\n const modeKey = compassModeToKeyMap.get(this.compassMode) ?? \"polar\";\n const modeString = UiFramework.translate(\n `accuDraw.compassMode.${modeKey}`\n );\n const modeMessage = UiFramework.translate(\"accuDraw.compassModeSet\", {\n modeString,\n });\n this.outputInfoMessage(modeMessage);\n }\n }\n\n private outputRotationMessage(): void {\n if (FrameworkAccuDraw.displayNotifications) {\n const rotationKey = rotationModeToKeyMap.get(this.rotationMode) ?? \"top\";\n const rotationString = UiFramework.translate(\n `accuDraw.rotation.${rotationKey}`\n );\n const rotationMessage = UiFramework.translate(\"accuDraw.rotationSet\", {\n rotationString,\n });\n this.outputInfoMessage(rotationMessage);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"FrameworkAccuDraw.js","sourceRoot":"","sources":["../../../src/appui-react/accudraw/FrameworkAccuDraw.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAsB;IACvD,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC;IAC5B,CAAC,WAAW,CAAC,WAAW,EAAE,aAAa,C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AAC,aAAa,CACnC,IAAI,oBAAoB,CAAC,qBAAqB,CAAC,IAAI,EAAE,OAAO,CAAC,CAC9D,CAAC;IACN,CAAC;IAEO,wBAAwB;QAC9B,IAAI,iBAAiB,CAAC,oBAAoB,EAAE,CAAC;YAC3C,MAAM,OAAO,GAAG,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC;YACrE,MAAM,UAAU,GAAG,WAAW,CAAC,SAAS,CACtC,wBAAwB,OAAO,EAAE,CAClC,CAAC;YACF,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS,CAAC,yBAAyB,EAAE;gBACnE,UAAU;aACX,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAEO,qBAAqB;QAC3B,IAAI,iBAAiB,CAAC,oBAAoB,EAAE,CAAC;YAC3C,MAAM,WAAW,GAAG,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC;YACzE,MAAM,cAAc,GAAG,WAAW,CAAC,SAAS,CAC1C,qBAAqB,WAAW,EAAE,CACnC,CAAC;YACF,MAAM,eAAe,GAAG,WAAW,CAAC,SAAS,CAAC,sBAAsB,EAAE;gBACpE,cAAc;aACf,CAAC,CAAC;YACH,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAC1C,CAAC;IACH,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 AccuDraw\n */\n\nimport { BeUiEvent } from \"@itwin/core-bentley\";\nimport type { BeButtonEvent } from \"@itwin/core-frontend\";\nimport {\n AccuDraw,\n CompassMode,\n IModelApp,\n ItemField,\n NotifyMessageDetails,\n OutputMessagePriority,\n QuantityType,\n RotationMode,\n} from \"@itwin/core-frontend\";\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport type { UserSettingsProvider } from \"../UiFramework.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher.js\";\nimport type { AccuDrawUiSettings } from \"./AccuDrawUiSettings.js\";\nimport type { UiStateStorage } from \"../uistate/UiStateStorage.js\";\nimport { UiStateStorageStatus } from \"../uistate/UiStateStorage.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\n\nconst compassModeToKeyMap = new Map<CompassMode, string>([\n [CompassMode.Polar, \"polar\"],\n [CompassMode.Rectangular, \"rectangular\"],\n]);\n\nconst rotationModeToKeyMap = new Map<RotationMode, string>([\n [RotationMode.Top, \"top\"],\n [RotationMode.Front, \"front\"],\n [RotationMode.Side, \"side\"],\n [RotationMode.View, \"view\"],\n [RotationMode.ACS, \"ACS\"],\n [RotationMode.Context, \"context\"],\n]);\n\n/** Arguments for [[AccuDrawSetFieldFocusEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldFocusEventArgs {\n field: ItemField;\n}\n\n/** AccuDraw Set Field Focus event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldFocusEvent extends BeUiEvent<AccuDrawSetFieldFocusEventArgs> {}\n\n/** Arguments for [[AccuDrawSetFieldValueToUiEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldValueToUiEventArgs {\n field: ItemField;\n value: number;\n formattedValue: string;\n}\n\n/** AccuDraw Set Field Value to Ui event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldValueToUiEvent extends BeUiEvent<AccuDrawSetFieldValueToUiEventArgs> {}\n\n/** Arguments for [[AccuDrawSetFieldValueFromUiEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldValueFromUiEventArgs {\n field: ItemField;\n stringValue: string;\n}\n\n/** AccuDraw Set Field Value from Ui event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldValueFromUiEvent extends BeUiEvent<AccuDrawSetFieldValueFromUiEventArgs> {}\n\n/** Arguments for [[AccuDrawSetFieldLockEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetFieldLockEventArgs {\n field: ItemField;\n lock: boolean;\n}\n\n/** AccuDraw Set Field Lock event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetFieldLockEvent extends BeUiEvent<AccuDrawSetFieldLockEventArgs> {}\n\n/** Arguments for [[AccuDrawSetCompassModeEvent]]\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface AccuDrawSetCompassModeEventArgs {\n mode: CompassMode;\n}\n\n/** AccuDraw Set Compass Mode event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class AccuDrawSetCompassModeEvent extends BeUiEvent<AccuDrawSetCompassModeEventArgs> {}\n\n/** AccuDraw Grab Input Focus event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\nexport class AccuDrawGrabInputFocusEvent extends BeUiEvent<object> {}\n\n/** AccuDraw Ui Settings Changed event\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\nexport class AccuDrawUiSettingsChangedEvent extends BeUiEvent<object> {}\n\n/** Subclass of `AccuDraw` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * This implementation will generate the required events for the AppUI provided UI to update correctly.\n *\n * ```ts\n * await IModelApp.startup({\n * accuDraw: new FrameworkAccuDraw()\n * });\n * ```\n * @public\n */\nexport class FrameworkAccuDraw\n extends AccuDraw\n implements UserSettingsProvider\n{\n private static _displayNotifications = false;\n private static _uiSettings: AccuDrawUiSettings | undefined;\n private static _settingsNamespace = \"AppUiSettings\";\n private static _notificationsKey = \"AccuDrawNotifications\";\n public readonly providerId = \"FrameworkAccuDraw\";\n\n /** AccuDraw Set Field Focus event. */\n public static readonly onAccuDrawSetFieldFocusEvent =\n new AccuDrawSetFieldFocusEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Field Value to Ui event. */\n public static readonly onAccuDrawSetFieldValueToUiEvent =\n new AccuDrawSetFieldValueToUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Field Value from Ui event. */\n public static readonly onAccuDrawSetFieldValueFromUiEvent =\n new AccuDrawSetFieldValueFromUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Field Lock event. */\n public static readonly onAccuDrawSetFieldLockEvent =\n new AccuDrawSetFieldLockEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Set Mode event. */\n public static readonly onAccuDrawSetCompassModeEvent =\n new AccuDrawSetCompassModeEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n /** AccuDraw Grab Input Focus event. */\n public static readonly onAccuDrawGrabInputFocusEvent =\n new AccuDrawGrabInputFocusEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** Determines if AccuDraw.rotationMode === RotationMode.Top */\n public static readonly isTopRotationConditional = new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Top,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.Front */\n public static readonly isFrontRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Front,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.Side */\n public static readonly isSideRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Side,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.View */\n public static readonly isViewRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.View,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.ACS */\n public static readonly isACSRotationConditional = new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.ACS,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.rotationMode === RotationMode.Context */\n public static readonly isContextRotationConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.rotationMode === RotationMode.Context,\n [SyncUiEventId.AccuDrawRotationChanged]\n );\n /** Determines if AccuDraw.compassMode === CompassMode.Polar */\n public static readonly isPolarModeConditional = new ConditionalBooleanValue(\n () => IModelApp.accuDraw.compassMode === CompassMode.Polar,\n [SyncUiEventId.AccuDrawCompassModeChanged]\n );\n /** Determines if AccuDraw.compassMode === CompassMode.Rectangular */\n public static readonly isRectangularModeConditional =\n new ConditionalBooleanValue(\n () => IModelApp.accuDraw.compassMode === CompassMode.Rectangular,\n [SyncUiEventId.AccuDrawCompassModeChanged]\n );\n\n /** AccuDraw Grab Input Focus event. */\n public static readonly onAccuDrawUiSettingsChangedEvent =\n new AccuDrawUiSettingsChangedEvent(); // eslint-disable-line @typescript-eslint/no-deprecated\n\n /** Determines if notifications should be displayed for AccuDraw changes */\n public static get displayNotifications(): boolean {\n return FrameworkAccuDraw._displayNotifications;\n }\n public static set displayNotifications(v: boolean) {\n FrameworkAccuDraw._displayNotifications = v;\n void UiFramework.getUiStateStorage().saveSetting(\n this._settingsNamespace,\n this._notificationsKey,\n v\n );\n }\n\n /* @internal */\n public async loadUserSettings(storage: UiStateStorage): Promise<void> {\n const result = await storage.getSetting(\n FrameworkAccuDraw._settingsNamespace,\n FrameworkAccuDraw._notificationsKey\n );\n if (result.status === UiStateStorageStatus.Success)\n FrameworkAccuDraw._displayNotifications = result.setting;\n }\n\n /** AccuDraw User Interface settings */\n public static get uiStateStorage(): AccuDrawUiSettings | undefined {\n return FrameworkAccuDraw._uiSettings;\n }\n public static set uiStateStorage(v: AccuDrawUiSettings | undefined) {\n FrameworkAccuDraw._uiSettings = v;\n FrameworkAccuDraw.onAccuDrawUiSettingsChangedEvent.emit({});\n }\n\n constructor() {\n super();\n FrameworkAccuDraw.onAccuDrawSetFieldValueFromUiEvent.addListener(\n this.handleSetFieldValueFromUiEvent\n );\n UiFramework.registerUserSettingsProvider(this);\n }\n\n private handleSetFieldValueFromUiEvent = async (\n args: AccuDrawSetFieldValueFromUiEventArgs // eslint-disable-line @typescript-eslint/no-deprecated\n ) => {\n return this.processFieldInput(args.field, args.stringValue, false);\n };\n\n public override onCompassModeChange(): void {\n FrameworkAccuDraw.onAccuDrawSetCompassModeEvent.emit({\n mode: this.compassMode,\n });\n SyncUiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.AccuDrawCompassModeChanged\n );\n\n this.outputCompassModeMessage();\n }\n\n public override onRotationModeChange(): void {\n SyncUiEventDispatcher.dispatchSyncUiEvent(\n SyncUiEventId.AccuDrawRotationChanged\n );\n\n this.outputRotationMessage();\n }\n\n public override onFieldLockChange(index: ItemField): void {\n FrameworkAccuDraw.onAccuDrawSetFieldLockEvent.emit({\n field: index,\n lock: this.getFieldLock(index),\n });\n }\n\n public override onFieldValueChange(index: ItemField): void {\n const value = this.getValueByIndex(index);\n const formattedValue = FrameworkAccuDraw.getFieldDisplayValue(index);\n FrameworkAccuDraw.onAccuDrawSetFieldValueToUiEvent.emit({\n field: index,\n value,\n formattedValue,\n });\n }\n\n private fieldValuesChanged(): void {\n // Only change the value when in Dynamic mode. Other mode are \"DontUpdate\" when the input is locked and \"Partial\" when the user is typing.\n this.onFieldValueChange(ItemField.X_Item);\n this.onFieldValueChange(ItemField.Y_Item);\n this.onFieldValueChange(ItemField.Z_Item);\n this.onFieldValueChange(ItemField.ANGLE_Item);\n this.onFieldValueChange(ItemField.DIST_Item);\n }\n\n public override setFocusItem(index: ItemField): void {\n FrameworkAccuDraw.onAccuDrawSetFieldFocusEvent.emit({ field: index });\n }\n\n /** Implemented by sub-classes to update ui fields to show current deltas or coordinates when inactive.\n * Should also choose active x or y input field in rectangular mode based on cursor position when\n * axis isn't locked to support \"smart lock\".\n */\n public override onMotion(_ev: BeButtonEvent): void {\n if (!this.isEnabled || this.isDeactivated || UiFramework.isContextMenuOpen)\n return;\n\n this.fieldValuesChanged();\n\n if (!this.dontMoveFocus && this.compassMode === CompassMode.Rectangular) {\n // Changes the focus between X and Y axis depending on the cursor location, in rectangular mode.\n // Example : this.newFocus is Y when the cursor is closer to the Y axis.\n this.setFocusItem(this.newFocus);\n }\n }\n\n /** Determine if the AccuDraw UI has focus. */\n public override get hasInputFocus(): boolean {\n let hasFocus = false;\n const el = document.querySelector(\"div.uifw-accudraw-field-container\");\n if (el) hasFocus = el.contains(document.activeElement);\n return hasFocus;\n }\n\n /** Implement this method to set focus to the AccuDraw UI. */\n public override grabInputFocus(): void {\n FrameworkAccuDraw.onAccuDrawGrabInputFocusEvent.emit({});\n }\n\n /** Gets the display value for an AccuDraw field */\n public static getFieldDisplayValue(index: ItemField): string {\n const value = IModelApp.accuDraw.getValueByIndex(index);\n let formattedValue = value.toString();\n\n const formatterSpec =\n IModelApp.quantityFormatter.findFormatterSpecByQuantityType(\n ItemField.ANGLE_Item === index\n ? QuantityType.Angle\n : QuantityType.Length\n );\n if (formatterSpec)\n formattedValue = IModelApp.quantityFormatter.formatQuantity(\n value,\n formatterSpec\n );\n\n return formattedValue;\n }\n\n /** AccuDraw Set Field Value from Ui. */\n public static setFieldValueFromUi(\n field: ItemField,\n stringValue: string\n ): void {\n FrameworkAccuDraw.onAccuDrawSetFieldValueFromUiEvent.emit({\n field,\n stringValue,\n });\n }\n\n private outputInfoMessage(message: string): void {\n if (FrameworkAccuDraw.displayNotifications)\n IModelApp.notifications.outputMessage(\n new NotifyMessageDetails(OutputMessagePriority.Info, message)\n );\n }\n\n private outputCompassModeMessage(): void {\n if (FrameworkAccuDraw.displayNotifications) {\n const modeKey = compassModeToKeyMap.get(this.compassMode) ?? \"polar\";\n const modeString = UiFramework.translate(\n `accuDraw.compassMode.${modeKey}`\n );\n const modeMessage = UiFramework.translate(\"accuDraw.compassModeSet\", {\n modeString,\n });\n this.outputInfoMessage(modeMessage);\n }\n }\n\n private outputRotationMessage(): void {\n if (FrameworkAccuDraw.displayNotifications) {\n const rotationKey = rotationModeToKeyMap.get(this.rotationMode) ?? \"top\";\n const rotationString = UiFramework.translate(\n `accuDraw.rotation.${rotationKey}`\n );\n const rotationMessage = UiFramework.translate(\"accuDraw.rotationSet\", {\n rotationString,\n });\n this.outputInfoMessage(rotationMessage);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgCrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E,gBAAgB;AAChB,eAAO,MAAM,qBAAqB;wBAGV,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;oBACvC,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CACH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA0FxD"}
1
+ {"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgCrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAO/E,gBAAgB;AAChB,eAAO,MAAM,qBAAqB;wBAGV,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;oBACvC,mBAAmB,CAAC,eAAe,CAAC;mBACrC,mBAAmB,CAAC,cAAc,CAAC;EAEjD,CAAC;AAEN;;;GAGG;AAEH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,kCAAkC;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oHAAoH;IACpH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6FAA6F;IAC7F,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,8HAA8H;IAC9H,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sIAAsI;IACtI,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sHAAsH;IACtH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gHAAgH;IAChH,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAElC,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,4BAAkD,CAAC;AAE9E;;GAEG;AAEH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBAatE;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,UAAU,mBAAmB;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE;QACb;;;;WAIG;QACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;KACxC,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA0FxD"}
@@ -31,6 +31,7 @@ import { ChildWindowRenderer } from "../childwindow/ChildWindowRenderer.js";
31
31
  import { useActiveFrontstageDef } from "../frontstage/FrontstageDef.js";
32
32
  import { useActiveIModelConnection } from "../hooks/useActiveIModelConnection.js";
33
33
  import { EditorsRegistryProvider } from "@itwin/components-react";
34
+ import { AccuDrawStoreProvider } from "../accudraw/AccuDrawStoreProvider.js";
34
35
  /** @internal */
35
36
  export const ConfigurableUiContext = React.createContext({});
36
37
  /**
@@ -49,7 +50,8 @@ export function ConfigurableUiContent(props) {
49
50
  // eslint-disable-next-line react-hooks/exhaustive-deps
50
51
  , {
51
52
  // eslint-disable-next-line react-hooks/exhaustive-deps
52
- value: React.useMemo(() => props, [...Object.values(props)]) }, layout ?? React.createElement(StandardLayout, null)));
53
+ value: React.useMemo(() => props, [...Object.values(props)]) },
54
+ React.createElement(AccuDrawStoreProvider, null, layout ?? React.createElement(StandardLayout, null))));
53
55
  }
54
56
  /** The standard widget based layout used as a default layout for all frontstages.
55
57
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,uBAAuB,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,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;QAC1E,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAgB;IAC9C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,OAAO,WAAW,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,GAAG,EAAE;YACxE,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;YAC/D,MAAM,YAAY,GAAG,UAAU,EAAE,YAAY,CAAC;YAC9C,IAAI,CAAC,YAAY;gBAAE,OAAO;YAC1B,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAmC;IACnE,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,oBAAC,wBAAwB,IAAC,gBAAgB,EAAE,MAAM,IAC/C,QAAQ,CACgB,CAC5B,CAAC;AACJ,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 ConfigurableUi\n */\n\nimport \"./ConfigurableUiContent.scss\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react/internal\";\nimport {\n IModelConnectionProvider,\n QuantityEditorSpec,\n WeightEditorSpec,\n} from \"@itwin/imodel-components-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport { CursorInformation } from \"../cursor/CursorInformation.js\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu.js\";\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager.js\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager.js\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager.js\";\nimport { ElementTooltip } from \"../feedback/ElementTooltip.js\";\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu.js\";\nimport { InputFieldMessage } from \"../messages/InputField.js\";\nimport { PointerMessage } from \"../messages/Pointer.js\";\nimport { PopupRenderer } from \"../popup/PopupManager.js\";\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage.js\";\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager.js\";\nimport { appUi, UiFramework } from \"../UiFramework.js\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager.js\";\nimport { MessageRenderer } from \"../messages/MessageRenderer.js\";\nimport {\n TOOLBAR_OPACITY_DEFAULT,\n WIDGET_OPACITY_DEFAULT,\n} from \"../theme/ThemeId.js\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport type { ContentProps } from \"../content/ContentGroup.js\";\nimport { ChildWindowRenderer } from \"../childwindow/ChildWindowRenderer.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport type { WidgetActions } from \"../layout/widget/WidgetActions.js\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection.js\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation.js\";\nimport type { Widget } from \"../widgets/Widget.js\";\nimport type { WidgetState } from \"../widgets/WidgetState.js\";\nimport { useActiveIModelConnection } from \"../hooks/useActiveIModelConnection.js\";\nimport { EditorsRegistryProvider } from \"@itwin/components-react\";\n\n/** @internal */\nexport const ConfigurableUiContext = React.createContext<\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n ConfigurableUiContentProps & {\n contentElementRef?: React.RefObject<HTMLElement | null>;\n widgetActions?: StandardLayoutProps[\"widgetActions\"];\n toolSettings?: StandardLayoutProps[\"toolSettings\"];\n }\n>({});\n\n/** Properties for [[ConfigurableUiContent]]\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof ConfigurableUiContent>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ConfigurableUiContentProps extends CommonProps {\n /** React node of the Backstage */\n appBackstage?: React.ReactNode;\n /** Controls if the view overlay should be displayed. Uses redux store as a fallback. Defaults to `true`.\n * @note Only used by configurable control APIs. See {@link ContentProps.classId}.\n * @deprecated in 4.16.0. View overlay visibility should be controlled by the components used in {@link ContentProps.content}.\n */\n viewOverlay?: boolean;\n /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */\n widgetOpacity?: number;\n /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n widgetIcon?: boolean;\n /** Controls if the active widget's label should always be displayed. Defaults to `false`. */\n showActiveWidgetLabel?: boolean;\n /** Controls if the unpinned panels should be collapsed automatically. Uses redux store as a fallback. Defaults to `false`. */\n collapsePanels?: boolean;\n /** Controls if the tool settings should be animated. Uses redux store as a fallback. Defaults to `false`. */\n animateToolSettings?: boolean;\n /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */\n toolAsToolSettingsLabel?: boolean;\n /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */\n toolbarOpacity?: number;\n /** Component to wrap all popout widgets and other child windows opened via {@link UiFramework.childWindows}. */\n childWindow?: React.ComponentType;\n\n /** @internal */\n idleTimeout?: number;\n /** @internal */\n intervalTimeout?: number;\n}\n\n/**\n * Allows children to get the bounds or other properties of the wrapper element.\n * @internal\n */\nexport const WrapperContext = React.createContext<HTMLElement>(document.body);\n\n/** The main component of `AppUI` that sets up the configurable UI.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\n const frontstageDef = useActiveFrontstageDef();\n const layout = frontstageDef?.initialConfig?.layout;\n return (\n <ConfigurableUiContext.Provider\n // eslint-disable-next-line react-hooks/exhaustive-deps\n value={React.useMemo(() => props, [...Object.values(props)])}\n >\n {layout ?? <StandardLayout />}\n </ConfigurableUiContext.Provider>\n );\n}\n\ninterface ToolSettingsLocation {\n section: StagePanelSection;\n location: StagePanelLocation;\n}\n\ninterface StandardLayoutProps {\n /** Overrides widget specific actions displayed in the title bar area.\n * Use {@link WidgetActions} component to customize widget actions.\n * @alpha\n */\n widgetActions?: React.ReactNode;\n /** When enabled keeps the tool settings visible to the end user.\n * This is especially useful when the tool settings is undocked as a regular widget.\n * @alpha\n */\n visibleToolSettings?: boolean;\n /** Tool settings related configuration.\n * @alpha\n */\n toolSettings?: {\n /** The default location of the tool settings. Only used when initializing the layout and ignored when restoring a saved layout.\n * When this is specified, the tool settings will be initialized as a widget, instead of the default docked state.\n * @note Use {@link Widget} for further configuration. I.e. set {@link Widget.defaultState} to {@link WidgetState.Floating} to initialize the tool settings as a floating widget.\n * @alpha\n */\n defaultLocation?: ToolSettingsLocation;\n };\n}\n\n/** The standard widget based layout used as a default layout for all frontstages.\n * @alpha\n */\nexport function StandardLayout(props: StandardLayoutProps) {\n const { widgetActions, visibleToolSettings = false, toolSettings } = props;\n const context = React.useContext(ConfigurableUiContext);\n const {\n appBackstage,\n widgetOpacity,\n toolbarOpacity,\n idleTimeout,\n intervalTimeout,\n } = context;\n\n const contentElementRef = React.useRef<HTMLElement>(null);\n useWidgetOpacity(widgetOpacity);\n useToolbarOpacity(toolbarOpacity);\n const [mainElement, setMainElement] = React.useState<HTMLElement>();\n const [portalContainer, setPortalContainer] = React.useState<HTMLElement>();\n React.useEffect(() => {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }, []);\n\n React.useEffect(() => {\n InternalConfigurableUiManager.activityTracker.initialize({\n idleTimeout,\n intervalTimeout,\n });\n return () => {\n InternalConfigurableUiManager.activityTracker.terminate();\n };\n }, [idleTimeout, intervalTimeout]);\n useVisibleToolSettings(visibleToolSettings);\n\n return (\n <ConfigurableUiContext.Provider\n value={React.useMemo(\n () => ({\n ...context,\n contentElementRef,\n widgetActions,\n toolSettings,\n }),\n [context, widgetActions, toolSettings]\n )}\n >\n <main\n role=\"main\"\n id=\"uifw-configurableui-wrapper\"\n className={context.className}\n style={context.style}\n onMouseMove={(e) => {\n const point = new Point(e.pageX, e.pageY);\n CursorInformation.handleMouseMove(point, e.view.document);\n }}\n ref={(el) => setMainElement(el ?? undefined)}\n >\n <WrapperContext.Provider value={mainElement ?? document.body}>\n <ThemeProvider\n style={{ height: \"100%\" }}\n portalContainer={portalContainer}\n >\n <IModelProvider>\n <EditorsRegistryProvider editors={defaultEditors}>\n {appBackstage}\n <WidgetPanelsFrontstage />\n\n <PointerMessage />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <KeyboardShortcutMenu />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <InputFieldMessage />\n <CursorPopupMenu />\n <CursorPopupRenderer />\n <PopupRenderer />\n <ElementTooltip />\n <MessageRenderer />\n <ChildWindowRenderer windowManager={appUi.windowManager} />\n <div\n className=\"uifw-configurableui-portalContainer\"\n ref={(instance) => setPortalContainer(instance ?? undefined)}\n >\n <ContentDialogRenderer />\n <ModelessDialogRenderer />\n <ModalDialogRenderer />\n </div>\n </EditorsRegistryProvider>\n </IModelProvider>\n </ThemeProvider>\n </WrapperContext.Provider>\n </main>\n </ConfigurableUiContext.Provider>\n );\n}\n\nconst defaultEditors = [QuantityEditorSpec, WeightEditorSpec];\n\nfunction useWidgetOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n widgetOpacity: ConfigurableUiContentProps[\"widgetOpacity\"]\n) {\n const reduxWidgetOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.widgetOpacity;\n });\n const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-widget-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useToolbarOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n toolbarOpacity: ConfigurableUiContentProps[\"toolbarOpacity\"]\n) {\n const reduxToolbarOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.toolbarOpacity;\n });\n\n const opacity =\n toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-toolbar-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useVisibleToolSettings(enabled: boolean) {\n React.useEffect(() => {\n if (!enabled) return;\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const frontstage = UiFramework.frontstages.activeFrontstageDef;\n const toolSettings = frontstage?.toolSettings;\n if (!toolSettings) return;\n toolSettings.show();\n });\n }, [enabled]);\n}\n\nfunction IModelProvider({ children }: React.PropsWithChildren<object>) {\n const imodel = useActiveIModelConnection();\n\n return (\n <IModelConnectionProvider iModelConnection={imodel}>\n {children}\n </IModelConnectionProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","s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,EACxB,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAC;QACF,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC;QAC1E,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAgB;IAC9C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,OAAO,WAAW,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,GAAG,EAAE;YACxE,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;YAC/D,MAAM,YAAY,GAAG,UAAU,EAAE,YAAY,CAAC;YAC9C,IAAI,CAAC,YAAY;gBAAE,OAAO;YAC1B,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAmC;IACnE,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,oBAAC,wBAAwB,IAAC,gBAAgB,EAAE,MAAM,IAC/C,QAAQ,CACgB,CAC5B,CAAC;AACJ,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 ConfigurableUi\n */\n\nimport \"./ConfigurableUiContent.scss\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react/internal\";\nimport {\n IModelConnectionProvider,\n QuantityEditorSpec,\n WeightEditorSpec,\n} from \"@itwin/imodel-components-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport { CursorInformation } from \"../cursor/CursorInformation.js\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu.js\";\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager.js\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager.js\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager.js\";\nimport { ElementTooltip } from \"../feedback/ElementTooltip.js\";\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu.js\";\nimport { InputFieldMessage } from \"../messages/InputField.js\";\nimport { PointerMessage } from \"../messages/Pointer.js\";\nimport { PopupRenderer } from \"../popup/PopupManager.js\";\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage.js\";\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager.js\";\nimport { appUi, UiFramework } from \"../UiFramework.js\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager.js\";\nimport { MessageRenderer } from \"../messages/MessageRenderer.js\";\nimport {\n TOOLBAR_OPACITY_DEFAULT,\n WIDGET_OPACITY_DEFAULT,\n} from \"../theme/ThemeId.js\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport type { ContentProps } from \"../content/ContentGroup.js\";\nimport { ChildWindowRenderer } from \"../childwindow/ChildWindowRenderer.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport type { WidgetActions } from \"../layout/widget/WidgetActions.js\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection.js\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation.js\";\nimport type { Widget } from \"../widgets/Widget.js\";\nimport type { WidgetState } from \"../widgets/WidgetState.js\";\nimport { useActiveIModelConnection } from \"../hooks/useActiveIModelConnection.js\";\nimport { EditorsRegistryProvider } from \"@itwin/components-react\";\nimport { AccuDrawStoreProvider } from \"../accudraw/AccuDrawStoreProvider.js\";\n\n/** @internal */\nexport const ConfigurableUiContext = React.createContext<\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n ConfigurableUiContentProps & {\n contentElementRef?: React.RefObject<HTMLElement | null>;\n widgetActions?: StandardLayoutProps[\"widgetActions\"];\n toolSettings?: StandardLayoutProps[\"toolSettings\"];\n }\n>({});\n\n/** Properties for [[ConfigurableUiContent]]\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof ConfigurableUiContent>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ConfigurableUiContentProps extends CommonProps {\n /** React node of the Backstage */\n appBackstage?: React.ReactNode;\n /** Controls if the view overlay should be displayed. Uses redux store as a fallback. Defaults to `true`.\n * @note Only used by configurable control APIs. See {@link ContentProps.classId}.\n * @deprecated in 4.16.0. View overlay visibility should be controlled by the components used in {@link ContentProps.content}.\n */\n viewOverlay?: boolean;\n /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */\n widgetOpacity?: number;\n /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n widgetIcon?: boolean;\n /** Controls if the active widget's label should always be displayed. Defaults to `false`. */\n showActiveWidgetLabel?: boolean;\n /** Controls if the unpinned panels should be collapsed automatically. Uses redux store as a fallback. Defaults to `false`. */\n collapsePanels?: boolean;\n /** Controls if the tool settings should be animated. Uses redux store as a fallback. Defaults to `false`. */\n animateToolSettings?: boolean;\n /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */\n toolAsToolSettingsLabel?: boolean;\n /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */\n toolbarOpacity?: number;\n /** Component to wrap all popout widgets and other child windows opened via {@link UiFramework.childWindows}. */\n childWindow?: React.ComponentType;\n\n /** @internal */\n idleTimeout?: number;\n /** @internal */\n intervalTimeout?: number;\n}\n\n/**\n * Allows children to get the bounds or other properties of the wrapper element.\n * @internal\n */\nexport const WrapperContext = React.createContext<HTMLElement>(document.body);\n\n/** The main component of `AppUI` that sets up the configurable UI.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\n const frontstageDef = useActiveFrontstageDef();\n const layout = frontstageDef?.initialConfig?.layout;\n return (\n <ConfigurableUiContext.Provider\n // eslint-disable-next-line react-hooks/exhaustive-deps\n value={React.useMemo(() => props, [...Object.values(props)])}\n >\n <AccuDrawStoreProvider>\n {layout ?? <StandardLayout />}\n </AccuDrawStoreProvider>\n </ConfigurableUiContext.Provider>\n );\n}\n\ninterface ToolSettingsLocation {\n section: StagePanelSection;\n location: StagePanelLocation;\n}\n\ninterface StandardLayoutProps {\n /** Overrides widget specific actions displayed in the title bar area.\n * Use {@link WidgetActions} component to customize widget actions.\n * @alpha\n */\n widgetActions?: React.ReactNode;\n /** When enabled keeps the tool settings visible to the end user.\n * This is especially useful when the tool settings is undocked as a regular widget.\n * @alpha\n */\n visibleToolSettings?: boolean;\n /** Tool settings related configuration.\n * @alpha\n */\n toolSettings?: {\n /** The default location of the tool settings. Only used when initializing the layout and ignored when restoring a saved layout.\n * When this is specified, the tool settings will be initialized as a widget, instead of the default docked state.\n * @note Use {@link Widget} for further configuration. I.e. set {@link Widget.defaultState} to {@link WidgetState.Floating} to initialize the tool settings as a floating widget.\n * @alpha\n */\n defaultLocation?: ToolSettingsLocation;\n };\n}\n\n/** The standard widget based layout used as a default layout for all frontstages.\n * @alpha\n */\nexport function StandardLayout(props: StandardLayoutProps) {\n const { widgetActions, visibleToolSettings = false, toolSettings } = props;\n const context = React.useContext(ConfigurableUiContext);\n const {\n appBackstage,\n widgetOpacity,\n toolbarOpacity,\n idleTimeout,\n intervalTimeout,\n } = context;\n\n const contentElementRef = React.useRef<HTMLElement>(null);\n useWidgetOpacity(widgetOpacity);\n useToolbarOpacity(toolbarOpacity);\n const [mainElement, setMainElement] = React.useState<HTMLElement>();\n const [portalContainer, setPortalContainer] = React.useState<HTMLElement>();\n React.useEffect(() => {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }, []);\n\n React.useEffect(() => {\n InternalConfigurableUiManager.activityTracker.initialize({\n idleTimeout,\n intervalTimeout,\n });\n return () => {\n InternalConfigurableUiManager.activityTracker.terminate();\n };\n }, [idleTimeout, intervalTimeout]);\n useVisibleToolSettings(visibleToolSettings);\n\n return (\n <ConfigurableUiContext.Provider\n value={React.useMemo(\n () => ({\n ...context,\n contentElementRef,\n widgetActions,\n toolSettings,\n }),\n [context, widgetActions, toolSettings]\n )}\n >\n <main\n role=\"main\"\n id=\"uifw-configurableui-wrapper\"\n className={context.className}\n style={context.style}\n onMouseMove={(e) => {\n const point = new Point(e.pageX, e.pageY);\n CursorInformation.handleMouseMove(point, e.view.document);\n }}\n ref={(el) => setMainElement(el ?? undefined)}\n >\n <WrapperContext.Provider value={mainElement ?? document.body}>\n <ThemeProvider\n style={{ height: \"100%\" }}\n portalContainer={portalContainer}\n >\n <IModelProvider>\n <EditorsRegistryProvider editors={defaultEditors}>\n {appBackstage}\n <WidgetPanelsFrontstage />\n\n <PointerMessage />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <KeyboardShortcutMenu />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <InputFieldMessage />\n <CursorPopupMenu />\n <CursorPopupRenderer />\n <PopupRenderer />\n <ElementTooltip />\n <MessageRenderer />\n <ChildWindowRenderer windowManager={appUi.windowManager} />\n <div\n className=\"uifw-configurableui-portalContainer\"\n ref={(instance) => setPortalContainer(instance ?? undefined)}\n >\n <ContentDialogRenderer />\n <ModelessDialogRenderer />\n <ModalDialogRenderer />\n </div>\n </EditorsRegistryProvider>\n </IModelProvider>\n </ThemeProvider>\n </WrapperContext.Provider>\n </main>\n </ConfigurableUiContext.Provider>\n );\n}\n\nconst defaultEditors = [QuantityEditorSpec, WeightEditorSpec];\n\nfunction useWidgetOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n widgetOpacity: ConfigurableUiContentProps[\"widgetOpacity\"]\n) {\n const reduxWidgetOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.widgetOpacity;\n });\n const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-widget-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useToolbarOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n toolbarOpacity: ConfigurableUiContentProps[\"toolbarOpacity\"]\n) {\n const reduxToolbarOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.toolbarOpacity;\n });\n\n const opacity =\n toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-toolbar-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useVisibleToolSettings(enabled: boolean) {\n React.useEffect(() => {\n if (!enabled) return;\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const frontstage = UiFramework.frontstages.activeFrontstageDef;\n const toolSettings = frontstage?.toolSettings;\n if (!toolSettings) return;\n toolSettings.show();\n });\n }, [enabled]);\n}\n\nfunction IModelProvider({ children }: React.PropsWithChildren<object>) {\n const imodel = useActiveIModelConnection();\n\n return (\n <IModelConnectionProvider iModelConnection={imodel}>\n {children}\n </IModelConnectionProvider>\n );\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /** @packageDocumentation
2
+ * @module Hooks
3
+ */
4
+ /** Utility to add/remove listeners to multiple items.
5
+ * @internal
6
+ */
7
+ export declare function useListeners<T>(items: T[], addListener: (item: T) => () => void): void;
8
+ //# sourceMappingURL=useListeners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListeners.d.ts","sourceRoot":"","sources":["../../../src/appui-react/hooks/useListeners.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAKH;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EAAE,EACV,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,IAAI,QAYrC"}
@@ -0,0 +1,25 @@
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
+ /** @packageDocumentation
6
+ * @module Hooks
7
+ */
8
+ import * as React from "react";
9
+ import { useLatestRef } from "./useLatestRef.js";
10
+ /** Utility to add/remove listeners to multiple items.
11
+ * @internal
12
+ */
13
+ export function useListeners(items, addListener) {
14
+ const addListenerRef = useLatestRef(addListener);
15
+ React.useEffect(() => {
16
+ const removeListeners = items.reduce((acc, item) => {
17
+ acc.push(addListenerRef.current(item));
18
+ return acc;
19
+ }, []);
20
+ return () => {
21
+ removeListeners.forEach((remove) => remove());
22
+ };
23
+ }, [items, addListenerRef]);
24
+ }
25
+ //# sourceMappingURL=useListeners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useListeners.js","sourceRoot":"","sources":["../../../src/appui-react/hooks/useListeners.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAU,EACV,WAAoC;IAEpC,MAAM,cAAc,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACjD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACpE,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACvC,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,OAAO,GAAG,EAAE;YACV,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;AAC9B,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 Hooks\n */\n\nimport * as React from \"react\";\nimport { useLatestRef } from \"./useLatestRef.js\";\n\n/** Utility to add/remove listeners to multiple items.\n * @internal\n */\nexport function useListeners<T>(\n items: T[],\n addListener: (item: T) => () => void\n) {\n const addListenerRef = useLatestRef(addListener);\n React.useEffect(() => {\n const removeListeners = items.reduce<Array<() => void>>((acc, item) => {\n acc.push(addListenerRef.current(item));\n return acc;\n }, []);\n return () => {\n removeListeners.forEach((remove) => remove());\n };\n }, [items, addListenerRef]);\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /** @packageDocumentation
2
+ * @module Hooks
3
+ */
4
+ import type { ScreenViewport } from "@itwin/core-frontend";
5
+ /** Returns all viewports of the `IModelApp.viewManager`.
6
+ * @internal
7
+ */
8
+ export declare function useViewports(): ScreenViewport[];
9
+ //# sourceMappingURL=useViewports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewports.d.ts","sourceRoot":"","sources":["../../../src/appui-react/hooks/useViewports.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0B3D;;GAEG;AACH,wBAAgB,YAAY,IAAI,cAAc,EAAE,CAG/C"}
@@ -0,0 +1,35 @@
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
+ /** @packageDocumentation
6
+ * @module Hooks
7
+ */
8
+ import { useSyncExternalStore } from "react";
9
+ import { IModelApp } from "@itwin/core-frontend";
10
+ const subscribe = (onStoreChange) => {
11
+ const removeListeners = [
12
+ IModelApp.viewManager.onViewOpen.addListener(onStoreChange),
13
+ IModelApp.viewManager.onViewClose.addListener(onStoreChange),
14
+ ];
15
+ return () => {
16
+ removeListeners.forEach((remove) => remove());
17
+ };
18
+ };
19
+ let lastViewports = [];
20
+ const getSnapshot = () => {
21
+ const viewports = Array.from(IModelApp.viewManager);
22
+ if (viewports.length === lastViewports.length &&
23
+ viewports.every((vp, i) => vp === lastViewports[i]))
24
+ return lastViewports;
25
+ lastViewports = viewports;
26
+ return viewports;
27
+ };
28
+ /** Returns all viewports of the `IModelApp.viewManager`.
29
+ * @internal
30
+ */
31
+ export function useViewports() {
32
+ const viewports = useSyncExternalStore(subscribe, getSnapshot);
33
+ return viewports;
34
+ }
35
+ //# sourceMappingURL=useViewports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useViewports.js","sourceRoot":"","sources":["../../../src/appui-react/hooks/useViewports.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,SAAS,GAAG,CAAC,aAAyB,EAAE,EAAE;IAC9C,MAAM,eAAe,GAAG;QACtB,SAAS,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC;QAC3D,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC;KAC7D,CAAC;IACF,OAAO,GAAG,EAAE;QACV,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,IAAI,aAAa,GAAqB,EAAE,CAAC;AACzC,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACpD,IACE,SAAS,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM;QACzC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC;QAEnD,OAAO,aAAa,CAAC;IAEvB,aAAa,GAAG,SAAS,CAAC;IAC1B,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,SAAS,GAAG,oBAAoB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC;AACnB,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 Hooks\n */\n\nimport { useSyncExternalStore } from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\n\nconst subscribe = (onStoreChange: () => void) => {\n const removeListeners = [\n IModelApp.viewManager.onViewOpen.addListener(onStoreChange),\n IModelApp.viewManager.onViewClose.addListener(onStoreChange),\n ];\n return () => {\n removeListeners.forEach((remove) => remove());\n };\n};\n\nlet lastViewports: ScreenViewport[] = [];\nconst getSnapshot = () => {\n const viewports = Array.from(IModelApp.viewManager);\n if (\n viewports.length === lastViewports.length &&\n viewports.every((vp, i) => vp === lastViewports[i])\n )\n return lastViewports;\n\n lastViewports = viewports;\n return viewports;\n};\n\n/** Returns all viewports of the `IModelApp.viewManager`.\n * @internal\n */\nexport function useViewports(): ScreenViewport[] {\n const viewports = useSyncExternalStore(subscribe, getSnapshot);\n return viewports;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/appui-react",
3
- "version": "5.30.0",
3
+ "version": "5.30.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 || ^19.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.30.0",
49
- "@itwin/core-react": "5.30.0",
50
- "@itwin/imodel-components-react": "5.30.0"
48
+ "@itwin/components-react": "5.30.1",
49
+ "@itwin/core-react": "5.30.1",
50
+ "@itwin/imodel-components-react": "5.30.1"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@itwin/appui-abstract": "^5.8.1",
@@ -89,9 +89,9 @@
89
89
  "typescript": "~5.6.3",
90
90
  "upath": "^2.0.1",
91
91
  "vitest": "^3.2.4",
92
- "@itwin/components-react": "5.30.0",
93
- "@itwin/core-react": "5.30.0",
94
- "@itwin/imodel-components-react": "5.30.0"
92
+ "@itwin/components-react": "5.30.1",
93
+ "@itwin/core-react": "5.30.1",
94
+ "@itwin/imodel-components-react": "5.30.1"
95
95
  },
96
96
  "dependencies": {
97
97
  "@itwin/itwinui-icons-react": "^2.11.0",