@itwin/appui-react 5.30.0 → 5.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/lib/appui-react/accudraw/AccuDrawStoreProvider.d.ts +7 -0
  3. package/lib/appui-react/accudraw/AccuDrawStoreProvider.d.ts.map +1 -0
  4. package/lib/appui-react/accudraw/AccuDrawStoreProvider.js +26 -0
  5. package/lib/appui-react/accudraw/AccuDrawStoreProvider.js.map +1 -0
  6. package/lib/appui-react/accudraw/FrameworkAccuDraw.d.ts +1 -1
  7. package/lib/appui-react/accudraw/FrameworkAccuDraw.d.ts.map +1 -1
  8. package/lib/appui-react/accudraw/FrameworkAccuDraw.js +1 -4
  9. package/lib/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
  10. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts +12 -0
  11. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  12. package/lib/appui-react/configurableui/ConfigurableUiContent.js +3 -1
  13. package/lib/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  14. package/lib/appui-react/frontstage/ModalFrontstage.d.ts +27 -15
  15. package/lib/appui-react/frontstage/ModalFrontstage.d.ts.map +1 -1
  16. package/lib/appui-react/frontstage/ModalFrontstage.js +16 -20
  17. package/lib/appui-react/frontstage/ModalFrontstage.js.map +1 -1
  18. package/lib/appui-react/frontstage/ModalFrontstage.scss +11 -17
  19. package/lib/appui-react/hooks/useActiveModalFrontstage.d.ts +8 -0
  20. package/lib/appui-react/hooks/useActiveModalFrontstage.d.ts.map +1 -0
  21. package/lib/appui-react/hooks/useActiveModalFrontstage.js +23 -0
  22. package/lib/appui-react/hooks/useActiveModalFrontstage.js.map +1 -0
  23. package/lib/appui-react/hooks/useListeners.d.ts +8 -0
  24. package/lib/appui-react/hooks/useListeners.d.ts.map +1 -0
  25. package/lib/appui-react/hooks/useListeners.js +25 -0
  26. package/lib/appui-react/hooks/useListeners.js.map +1 -0
  27. package/lib/appui-react/hooks/useViewports.d.ts +9 -0
  28. package/lib/appui-react/hooks/useViewports.d.ts.map +1 -0
  29. package/lib/appui-react/hooks/useViewports.js +35 -0
  30. package/lib/appui-react/hooks/useViewports.js.map +1 -0
  31. package/lib/appui-react/layout/StandardLayout.d.ts +1 -2
  32. package/lib/appui-react/layout/StandardLayout.d.ts.map +1 -1
  33. package/lib/appui-react/layout/StandardLayout.js +9 -9
  34. package/lib/appui-react/layout/StandardLayout.js.map +1 -1
  35. package/lib/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
  36. package/lib/appui-react/widget-panels/Frontstage.js +9 -4
  37. package/lib/appui-react/widget-panels/Frontstage.js.map +1 -1
  38. package/lib/appui-react/widget-panels/ModalFrontstageComposer.d.ts +1 -6
  39. package/lib/appui-react/widget-panels/ModalFrontstageComposer.d.ts.map +1 -1
  40. package/lib/appui-react/widget-panels/ModalFrontstageComposer.js +7 -16
  41. package/lib/appui-react/widget-panels/ModalFrontstageComposer.js.map +1 -1
  42. package/lib/cjs/appui-react/frontstage/ModalFrontstage.scss +11 -17
  43. package/lib/esm/appui-react/frontstage/ModalFrontstage.scss +11 -17
  44. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Change Log - @itwin/appui-react
2
2
 
3
+ ## 5.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 43196cd: Added [`inert`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/inert) attribute to the active frontstage when a modal frontstage is open. This prevents interaction and hides content of the underlying frontstage from assistive technologies.
8
+ - 4961d98: Added `hideHeader` prop to `ModalFrontstage` component to allow hiding the header of the modal frontstage. This is useful when implementing custom layouts.
9
+ - 2442634: Added `renderModalFrontstage` prop to `ConfigurableUiContent` component. This prop allows you to override the default modal frontstage with a custom implementation. Use the `ModalFrontstage` component to customize the default layout and behavior of the modal frontstage.
10
+ - 2442634: Deprecated `closeModal` prop of `ModalFrontstage` component. Use `navigateBack` prop instead to close the modal frontstage. This prop is now optional when using the `ModalFrontstage` component.
11
+ - 2442634: Deprecated `ModalFrontstageProps` interface. Use `React.ComponentProps<typeof ModalFrontstage>` instead.
12
+
13
+ ### Patch Changes
14
+
15
+ - @itwin/components-react@5.31.0
16
+ - @itwin/core-react@5.31.0
17
+ - @itwin/imodel-components-react@5.31.0
18
+
19
+ ## 5.30.1
20
+
21
+ ### Patch Changes
22
+
23
+ - 4af6f74: Moved the logic that determines whether to use 2d or 3d AccuDraw mode from `FrameworkAccuDraw` class to the root `ConfigurableUiContent` component.
24
+ - @itwin/components-react@5.30.1
25
+ - @itwin/core-react@5.30.1
26
+ - @itwin/imodel-components-react@5.30.1
27
+
3
28
  ## 5.30.0
4
29
 
5
30
  ### 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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AQ5B,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAOzC,kBAAkB,CAAC,KAAK,EAAE,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":"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;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAsB;IACvD,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC;IAC5B,CAAC,WAAW,CAAC,WAAW,EAAE,aAAa,CAAC;CACzC,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAuB;IACzD,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;IACzB,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC;IAC7B,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;IAC3B,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC;IAC3B,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC;IACzB,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC;CAClC,CAAC,CAAC;AAUH;;;GAGG;AACH,4DAA4D;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,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\";\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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,iBAAiB,CAAC,OAAe;QACvC,IAAI,iBAAiB,CAAC,oBAAoB;YACxC,SAAS,CAAC,aAAa,CAAC,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"]}
@@ -6,6 +6,7 @@ import * as React from "react";
6
6
  import type { CommonProps } from "@itwin/core-react";
7
7
  import type { StagePanelSection } from "../stagepanels/StagePanelSection.js";
8
8
  import type { StagePanelLocation } from "../stagepanels/StagePanelLocation.js";
9
+ import type { ModalFrontstageInfo } from "../framework/FrameworkFrontstages.js";
9
10
  /** @internal */
10
11
  export declare const ConfigurableUiContext: React.Context<ConfigurableUiContentProps & {
11
12
  contentElementRef?: React.RefObject<HTMLElement | null>;
@@ -40,6 +41,17 @@ export interface ConfigurableUiContentProps extends CommonProps {
40
41
  toolbarOpacity?: number;
41
42
  /** Component to wrap all popout widgets and other child windows opened via {@link UiFramework.childWindows}. */
42
43
  childWindow?: React.ComponentType;
44
+ /**
45
+ * Overrides the default modal frontstage.
46
+ * Use the {@link ModalFrontstage} component to customize the default layout and behavior.
47
+ * @alpha
48
+ */
49
+ renderModalFrontstage?: (args: {
50
+ /** Information about the modal frontstage to be rendered. */
51
+ info: ModalFrontstageInfo;
52
+ /** Might be used for open/close animations in the future. */
53
+ isOpen: boolean;
54
+ }) => React.ReactNode;
43
55
  /** @internal */
44
56
  idleTimeout?: number;
45
57
  /** @internal */
@@ -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,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,qBAWtE;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"}
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,sCAA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B,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,8BAA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AC,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":"","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,KAA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AE,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\";\nimport type { ModalFrontstageInfo } from \"../framework/FrameworkFrontstages.js\";\nimport type { ModalFrontstage } from \"../frontstage/ModalFrontstage.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 * Overrides the default modal frontstage.\n * Use the {@link ModalFrontstage} component to customize the default layout and behavior.\n * @alpha\n */\n renderModalFrontstage?: (args: {\n /** Information about the modal frontstage to be rendered. */\n info: ModalFrontstageInfo;\n /** Might be used for open/close animations in the future. */\n isOpen: boolean;\n }) => React.ReactNode;\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"]}
@@ -6,29 +6,41 @@ import * as React from "react";
6
6
  import type { CommonProps } from "@itwin/core-react";
7
7
  /** Properties for the [[ModalFrontstage]] React component
8
8
  * @public
9
+ * @deprecated in 5.31.0. Use `React.ComponentProps<typeof ModalFrontstage>` instead.
9
10
  */
10
11
  export interface ModalFrontstageProps extends CommonProps {
11
- /** Title displayed at the top of the modal Frontstage */
12
+ /** Title displayed at the top of the modal frontstage. */
12
13
  title: string;
13
- /** Indicates whether the modal Frontstage is open */
14
+ /** Indicates whether the modal frontstage is open. */
14
15
  isOpen?: boolean;
15
- /** Callback for navigating back from the modal Frontstage. */
16
- navigateBack?: () => any;
17
- /** Callback for closing the modal Frontstage. */
18
- closeModal: () => any;
19
- /** An optional React node displayed in the upper right of the modal Frontstage. */
16
+ /** Callback for navigating back from the modal frontstage. */
17
+ navigateBack?: () => void;
18
+ /** Callback for closing the modal frontstage. */
19
+ closeModal: () => void;
20
+ /** Optional content displayed in the upper right of the modal frontstage. */
20
21
  appBarRight?: React.ReactNode;
21
- /** If specified overrides the default back button. */
22
+ /** If specified overrides the default {@link ModalFrontstageButton}. */
22
23
  backButton?: React.ReactNode;
23
- /** Content */
24
+ /** Content of the modal frontstage. */
24
25
  children?: React.ReactNode;
26
+ /**
27
+ * If `true`, hides the header of the modal frontstage and renders the `children` prop in the root element.
28
+ * @note When set to `true`, the `title`, `navigateBack`, `closeModal`, `appBarRight`, and `backButton` props are ignored.
29
+ */
30
+ hideHeader?: boolean;
25
31
  }
26
- /** ModalFrontstage React component
32
+ interface Props extends Omit<ModalFrontstageProps, "closeModal"> {
33
+ /**
34
+ * Callback for closing the modal Frontstage.
35
+ * @deprecated in 5.31.0. Use {@link navigateBack} instead.
36
+ */
37
+ closeModal?: () => void;
38
+ }
39
+ /**
40
+ * The default layout used for modal frontstages.
41
+ * Use `renderModalFrontstage` prop of {@link ConfigurableUiContent} to override the modal frontstage layout.
27
42
  * @public
28
43
  */
29
- export declare class ModalFrontstage extends React.Component<ModalFrontstageProps> {
30
- constructor(props: ModalFrontstageProps);
31
- private _onGoBack;
32
- render(): React.JSX.Element;
33
- }
44
+ export declare function ModalFrontstage(props: Props): React.JSX.Element;
45
+ export {};
34
46
  //# sourceMappingURL=ModalFrontstage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFrontstage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD;;GAEG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC;IACzB,iDAAiD;IACjD,UAAU,EAAE,MAAM,GAAG,CAAC;IACtB,mFAAmF;IACnF,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,sDAAsD;IACtD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC;gBAC5D,KAAK,EAAE,oBAAoB;IAIvC,OAAO,CAAC,SAAS,CAGf;IAEc,MAAM;CA+BvB"}
1
+ {"version":3,"file":"ModalFrontstage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD;;;GAGG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,iDAAiD;IACjD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,6EAA6E;IAC7E,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wEAAwE;IACxE,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,UAAU,KAAM,SAAQ,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC;IAC9D;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,qBAkD3C"}
@@ -10,28 +10,24 @@ import * as React from "react";
10
10
  import classnames from "classnames";
11
11
  import { Text } from "@itwin/itwinui-react";
12
12
  import { ModalFrontstageButton } from "./ModalFrontstageButton.js";
13
- /** ModalFrontstage React component
13
+ /**
14
+ * The default layout used for modal frontstages.
15
+ * Use `renderModalFrontstage` prop of {@link ConfigurableUiContent} to override the modal frontstage layout.
14
16
  * @public
15
17
  */
16
- export class ModalFrontstage extends React.Component {
17
- constructor(props) {
18
- super(props);
19
- }
20
- _onGoBack = () => {
21
- if (this.props.navigateBack)
22
- this.props.navigateBack();
23
- this.props.closeModal();
18
+ export function ModalFrontstage(props) {
19
+ const { isOpen, navigateBack,
20
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
21
+ closeModal, backButton, title, appBarRight, hideHeader, ...rest } = props;
22
+ const handleBack = () => {
23
+ navigateBack?.();
24
+ closeModal?.();
24
25
  };
25
- render() {
26
- const classNames = classnames("uifw-modal-frontstage", this.props.isOpen && "uifw-modal-open", this.props.className);
27
- return (React.createElement(React.Fragment, null,
28
- React.createElement("div", { className: classNames, style: this.props.style },
29
- React.createElement("div", { className: "uifw-modal-app-bar" },
30
- this.props.backButton ? (this.props.backButton) : (React.createElement(ModalFrontstageButton, { onClick: this._onGoBack })),
31
- React.createElement(Text, { variant: "headline", className: "uifw-headline" }, this.props.title),
32
- this.props.appBarRight && (React.createElement("span", { className: "uifw-modal-app-bar-right" }, this.props.appBarRight))),
33
- React.createElement("div", { className: "uifw-modal-stage-content" }, this.props.children)),
34
- React.createElement("div", { className: "uifw-modal-frontstage-overlay" })));
35
- }
26
+ return (React.createElement("div", { ...rest, className: classnames("uifw-modal-frontstage", isOpen && "uifw-modal-open", hideHeader && "uifw-no-header", props.className) }, hideHeader ? (props.children) : (React.createElement(React.Fragment, null,
27
+ React.createElement("div", { className: "uifw-modal-app-bar" },
28
+ backButton ? (backButton) : (React.createElement(ModalFrontstageButton, { onClick: handleBack })),
29
+ React.createElement(Text, { variant: "headline", className: "uifw-headline" }, title),
30
+ appBarRight && (React.createElement("span", { className: "uifw-modal-app-bar-right" }, appBarRight))),
31
+ React.createElement("div", { className: "uifw-modal-stage-content" }, props.children)))));
36
32
  }
37
33
  //# sourceMappingURL=ModalFrontstage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFrontstage.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstage.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OA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,KAAK,CAAC,QAAQ,CAAO,CACjE;YACN,6BAAK,SAAS,EAAC,+BAA+B,GAAG,CAChD,CACJ,CAAC;IACJ,CAAC;CACF","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 Frontstage\n */\n\nimport \"./ModalFrontstage.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport { ModalFrontstageButton } from \"./ModalFrontstageButton.js\";\n\n/** Properties for the [[ModalFrontstage]] React component\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ModalFrontstageProps extends CommonProps {\n /** Title displayed at the top of the modal Frontstage */\n title: string;\n /** Indicates whether the modal Frontstage is open */\n isOpen?: boolean;\n /** Callback for navigating back from the modal Frontstage. */\n navigateBack?: () => any;\n /** Callback for closing the modal Frontstage. */\n closeModal: () => any;\n /** An optional React node displayed in the upper right of the modal Frontstage. */\n appBarRight?: React.ReactNode;\n /** If specified overrides the default back button. */\n backButton?: React.ReactNode;\n /** Content */\n children?: React.ReactNode;\n}\n\n/** ModalFrontstage React component\n * @public\n */\nexport class ModalFrontstage extends React.Component<ModalFrontstageProps> {\n constructor(props: ModalFrontstageProps) {\n super(props);\n }\n\n private _onGoBack = () => {\n if (this.props.navigateBack) this.props.navigateBack();\n this.props.closeModal();\n };\n\n public override render() {\n const classNames = classnames(\n \"uifw-modal-frontstage\",\n this.props.isOpen && \"uifw-modal-open\",\n this.props.className\n );\n\n return (\n <>\n <div className={classNames} style={this.props.style}>\n <div className=\"uifw-modal-app-bar\">\n {this.props.backButton ? (\n this.props.backButton\n ) : (\n <ModalFrontstageButton onClick={this._onGoBack} />\n )}\n <Text variant=\"headline\" className=\"uifw-headline\">\n {this.props.title}\n </Text>\n {this.props.appBarRight && (\n <span className=\"uifw-modal-app-bar-right\">\n {this.props.appBarRight}\n </span>\n )}\n </div>\n <div className=\"uifw-modal-stage-content\">{this.props.children}</div>\n </div>\n <div className=\"uifw-modal-frontstage-overlay\" />\n </>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ModalFrontstage.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstage.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,wBAAwB,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAuCnE;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,MAAM,EACJ,MAAM,EACN,YAAY;IACZ,4DAA4D;IAC5D,UAAU,EACV,UAAU,EACV,KAAK,EACL,WAAW,EACX,UAAU,EACV,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,YAAY,EAAE,EAAE,CAAC;QACjB,UAAU,EAAE,EAAE,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,CACL,gCACM,IAAI,EACR,SAAS,EAAE,UAAU,CACnB,uBAAuB,EACvB,MAAM,IAAI,iBAAiB,EAC3B,UAAU,IAAI,gBAAgB,EAC9B,KAAK,CAAC,SAAS,CAChB,IAEA,UAAU,CAAC,CAAC,CAAC,CACZ,KAAK,CAAC,QAAQ,CACf,CAAC,CAAC,CAAC,CACF;QACE,6BAAK,SAAS,EAAC,oBAAoB;YAChC,UAAU,CAAC,CAAC,CAAC,CACZ,UAAU,CACX,CAAC,CAAC,CAAC,CACF,oBAAC,qBAAqB,IAAC,OAAO,EAAE,UAAU,GAAI,CAC/C;YACD,oBAAC,IAAI,IAAC,OAAO,EAAC,UAAU,EAAC,SAAS,EAAC,eAAe,IAC/C,KAAK,CACD;YACN,WAAW,IAAI,CACd,8BAAM,SAAS,EAAC,0BAA0B,IAAE,WAAW,CAAQ,CAChE,CACG;QACN,6BAAK,SAAS,EAAC,0BAA0B,IAAE,KAAK,CAAC,QAAQ,CAAO,CAC/D,CACJ,CACG,CACP,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 Frontstage\n */\n\nimport \"./ModalFrontstage.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport { ModalFrontstageButton } from \"./ModalFrontstageButton.js\";\nimport type { ConfigurableUiContent } from \"../configurableui/ConfigurableUiContent.js\";\n\n/** Properties for the [[ModalFrontstage]] React component\n * @public\n * @deprecated in 5.31.0. Use `React.ComponentProps<typeof ModalFrontstage>` instead.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ModalFrontstageProps extends CommonProps {\n /** Title displayed at the top of the modal frontstage. */\n title: string;\n /** Indicates whether the modal frontstage is open. */\n isOpen?: boolean;\n /** Callback for navigating back from the modal frontstage. */\n navigateBack?: () => void;\n /** Callback for closing the modal frontstage. */\n closeModal: () => void;\n /** Optional content displayed in the upper right of the modal frontstage. */\n appBarRight?: React.ReactNode;\n /** If specified overrides the default {@link ModalFrontstageButton}. */\n backButton?: React.ReactNode;\n /** Content of the modal frontstage. */\n children?: React.ReactNode;\n /**\n * If `true`, hides the header of the modal frontstage and renders the `children` prop in the root element.\n * @note When set to `true`, the `title`, `navigateBack`, `closeModal`, `appBarRight`, and `backButton` props are ignored.\n */\n hideHeader?: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface Props extends Omit<ModalFrontstageProps, \"closeModal\"> {\n /**\n * Callback for closing the modal Frontstage.\n * @deprecated in 5.31.0. Use {@link navigateBack} instead.\n */\n closeModal?: () => void;\n}\n\n/**\n * The default layout used for modal frontstages.\n * Use `renderModalFrontstage` prop of {@link ConfigurableUiContent} to override the modal frontstage layout.\n * @public\n */\nexport function ModalFrontstage(props: Props) {\n const {\n isOpen,\n navigateBack,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n closeModal,\n backButton,\n title,\n appBarRight,\n hideHeader,\n ...rest\n } = props;\n\n const handleBack = () => {\n navigateBack?.();\n closeModal?.();\n };\n\n return (\n <div\n {...rest}\n className={classnames(\n \"uifw-modal-frontstage\",\n isOpen && \"uifw-modal-open\",\n hideHeader && \"uifw-no-header\",\n props.className\n )}\n >\n {hideHeader ? (\n props.children\n ) : (\n <>\n <div className=\"uifw-modal-app-bar\">\n {backButton ? (\n backButton\n ) : (\n <ModalFrontstageButton onClick={handleBack} />\n )}\n <Text variant=\"headline\" className=\"uifw-headline\">\n {title}\n </Text>\n {appBarRight && (\n <span className=\"uifw-modal-app-bar-right\">{appBarRight}</span>\n )}\n </div>\n <div className=\"uifw-modal-stage-content\">{props.children}</div>\n </>\n )}\n </div>\n );\n}\n"]}
@@ -13,15 +13,21 @@
13
13
  pointer-events: none;
14
14
  visibility: hidden;
15
15
  overflow: hidden;
16
- background: transparent;
16
+ background: color-mix(
17
+ in srgb,
18
+ var(--iui-color-background-backdrop),
19
+ transparent 5%
20
+ );
17
21
  transition: background 0.25s ease, visibility 0s ease 0.275s;
18
22
 
19
- display: flex;
20
- flex-direction: column;
21
- align-items: stretch;
22
-
23
23
  @include uicore-z-index(modal-frontstage);
24
24
 
25
+ &:not(.uifw-no-header) {
26
+ display: flex;
27
+ flex-direction: column;
28
+ align-items: stretch;
29
+ }
30
+
25
31
  .uifw-modal-app-bar {
26
32
  transition: transform 0.125s;
27
33
  padding: 10px;
@@ -62,15 +68,3 @@
62
68
  }
63
69
  }
64
70
  }
65
-
66
- .uifw-modal-frontstage-overlay {
67
- position: absolute;
68
- left: 0px;
69
- width: 100%;
70
- top: 0px;
71
- height: 100%;
72
- opacity: 0.95;
73
- background: var(--iui-color-background-backdrop);
74
-
75
- @include uicore-z-index(modal-frontstage-overlay);
76
- }
@@ -0,0 +1,8 @@
1
+ /** @packageDocumentation
2
+ * @module Hooks
3
+ */
4
+ /** React hook that returns the active modal frontstage.
5
+ * @internal
6
+ */
7
+ export declare function useActiveModalFrontstage(): import("../framework/FrameworkFrontstages.js").ModalFrontstageInfo | undefined;
8
+ //# sourceMappingURL=useActiveModalFrontstage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActiveModalFrontstage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/hooks/useActiveModalFrontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAeH;;GAEG;AACH,wBAAgB,wBAAwB,mFAGvC"}