@itwin/appui-react 5.35.1 → 5.36.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 (205) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/lib/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
  3. package/lib/appui-react/accudraw/AccuDrawFieldContainer.js +8 -2
  4. package/lib/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  5. package/lib/appui-react/accudraw/AccuDrawInputField.d.ts.map +1 -1
  6. package/lib/appui-react/accudraw/AccuDrawInputField.js +3 -3
  7. package/lib/appui-react/accudraw/AccuDrawInputField.js.map +1 -1
  8. package/lib/appui-react/accudraw/Calculator.d.ts.map +1 -1
  9. package/lib/appui-react/accudraw/Calculator.js +3 -2
  10. package/lib/appui-react/accudraw/Calculator.js.map +1 -1
  11. package/lib/appui-react/accudraw/CalculatorPopup.d.ts.map +1 -1
  12. package/lib/appui-react/accudraw/CalculatorPopup.js +3 -4
  13. package/lib/appui-react/accudraw/CalculatorPopup.js.map +1 -1
  14. package/lib/appui-react/accudraw/MenuButton.d.ts.map +1 -1
  15. package/lib/appui-react/accudraw/MenuButton.js +3 -2
  16. package/lib/appui-react/accudraw/MenuButton.js.map +1 -1
  17. package/lib/appui-react/backstage/Backstage.d.ts.map +1 -1
  18. package/lib/appui-react/backstage/Backstage.js +2 -3
  19. package/lib/appui-react/backstage/Backstage.js.map +1 -1
  20. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.d.ts.map +1 -1
  21. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js +3 -2
  22. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
  23. package/lib/appui-react/editors/LockEditor.d.ts.map +1 -1
  24. package/lib/appui-react/editors/LockEditor.js +2 -1
  25. package/lib/appui-react/editors/LockEditor.js.map +1 -1
  26. package/lib/appui-react/editors/LockProvider.d.ts.map +1 -1
  27. package/lib/appui-react/editors/LockProvider.js +2 -1
  28. package/lib/appui-react/editors/LockProvider.js.map +1 -1
  29. package/lib/appui-react/frontstage/ModalFrontstageButton.d.ts.map +1 -1
  30. package/lib/appui-react/frontstage/ModalFrontstageButton.js +2 -1
  31. package/lib/appui-react/frontstage/ModalFrontstageButton.js.map +1 -1
  32. package/lib/appui-react/frontstage/ModalSettingsStage.d.ts.map +1 -1
  33. package/lib/appui-react/frontstage/ModalSettingsStage.js +2 -1
  34. package/lib/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  35. package/lib/appui-react/frontstage/NestedFrontstage.d.ts.map +1 -1
  36. package/lib/appui-react/frontstage/NestedFrontstage.js +2 -1
  37. package/lib/appui-react/frontstage/NestedFrontstage.js.map +1 -1
  38. package/lib/appui-react/frontstage/NestedFrontstageAppButton.d.ts.map +1 -1
  39. package/lib/appui-react/frontstage/NestedFrontstageAppButton.js +3 -1
  40. package/lib/appui-react/frontstage/NestedFrontstageAppButton.js.map +1 -1
  41. package/lib/appui-react/layout/tool-settings/Docked.d.ts.map +1 -1
  42. package/lib/appui-react/layout/tool-settings/Docked.js +14 -8
  43. package/lib/appui-react/layout/tool-settings/Docked.js.map +1 -1
  44. package/lib/appui-react/layout/tool-settings/Handle.d.ts.map +1 -1
  45. package/lib/appui-react/layout/tool-settings/Handle.js +4 -2
  46. package/lib/appui-react/layout/tool-settings/Handle.js.map +1 -1
  47. package/lib/appui-react/layout/tool-settings/Overflow.d.ts.map +1 -1
  48. package/lib/appui-react/layout/tool-settings/Overflow.js +2 -1
  49. package/lib/appui-react/layout/tool-settings/Overflow.js.map +1 -1
  50. package/lib/appui-react/layout/widget/Dock.d.ts.map +1 -1
  51. package/lib/appui-react/layout/widget/Dock.js +2 -1
  52. package/lib/appui-react/layout/widget/Dock.js.map +1 -1
  53. package/lib/appui-react/layout/widget/MenuTab.d.ts.map +1 -1
  54. package/lib/appui-react/layout/widget/MenuTab.js +2 -1
  55. package/lib/appui-react/layout/widget/MenuTab.js.map +1 -1
  56. package/lib/appui-react/layout/widget/Overflow.d.ts.map +1 -1
  57. package/lib/appui-react/layout/widget/Overflow.js +2 -1
  58. package/lib/appui-react/layout/widget/Overflow.js.map +1 -1
  59. package/lib/appui-react/layout/widget/PinToggle.d.ts.map +1 -1
  60. package/lib/appui-react/layout/widget/PinToggle.js +2 -1
  61. package/lib/appui-react/layout/widget/PinToggle.js.map +1 -1
  62. package/lib/appui-react/layout/widget/PopoutToggle.d.ts.map +1 -1
  63. package/lib/appui-react/layout/widget/PopoutToggle.js +2 -1
  64. package/lib/appui-react/layout/widget/PopoutToggle.js.map +1 -1
  65. package/lib/appui-react/layout/widget/SendBack.d.ts.map +1 -1
  66. package/lib/appui-react/layout/widget/SendBack.js +2 -1
  67. package/lib/appui-react/layout/widget/SendBack.js.map +1 -1
  68. package/lib/appui-react/layout/widget/Tab.scss +9 -2
  69. package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.d.ts.map +1 -1
  70. package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.js +4 -2
  71. package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.js.map +1 -1
  72. package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.d.ts.map +1 -1
  73. package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.js +4 -3
  74. package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.js.map +1 -1
  75. package/lib/appui-react/messages/InputField.d.ts.map +1 -1
  76. package/lib/appui-react/messages/InputField.js +11 -10
  77. package/lib/appui-react/messages/InputField.js.map +1 -1
  78. package/lib/appui-react/navigationaids/SheetNavigationAid.d.ts.map +1 -1
  79. package/lib/appui-react/navigationaids/SheetNavigationAid.js +4 -2
  80. package/lib/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
  81. package/lib/appui-react/navigationaids/SheetsModalFrontstage.d.ts.map +1 -1
  82. package/lib/appui-react/navigationaids/SheetsModalFrontstage.js +4 -3
  83. package/lib/appui-react/navigationaids/SheetsModalFrontstage.js.map +1 -1
  84. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.d.ts +2 -2
  85. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.d.ts.map +1 -1
  86. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js +11 -14
  87. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
  88. package/lib/appui-react/new-editors/LockEditor.d.ts.map +1 -1
  89. package/lib/appui-react/new-editors/LockEditor.js +2 -3
  90. package/lib/appui-react/new-editors/LockEditor.js.map +1 -1
  91. package/lib/appui-react/pickers/ListPicker.d.ts.map +1 -1
  92. package/lib/appui-react/pickers/ListPicker.js +9 -17
  93. package/lib/appui-react/pickers/ListPicker.js.map +1 -1
  94. package/lib/appui-react/pickers/ViewSelector.d.ts.map +1 -1
  95. package/lib/appui-react/pickers/ViewSelector.js +2 -4
  96. package/lib/appui-react/pickers/ViewSelector.js.map +1 -1
  97. package/lib/appui-react/preview/PreviewFeatures.d.ts +9 -0
  98. package/lib/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
  99. package/lib/appui-react/preview/PreviewFeatures.js +6 -1
  100. package/lib/appui-react/preview/PreviewFeatures.js.map +1 -1
  101. package/lib/appui-react/preview/control-widget-visibility/AddWidgetButton.d.ts.map +1 -1
  102. package/lib/appui-react/preview/control-widget-visibility/AddWidgetButton.js +2 -1
  103. package/lib/appui-react/preview/control-widget-visibility/AddWidgetButton.js.map +1 -1
  104. package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.d.ts.map +1 -1
  105. package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.js +2 -1
  106. package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.js.map +1 -1
  107. package/lib/appui-react/preview/control-widget-visibility/NavigationWidget.d.ts.map +1 -1
  108. package/lib/appui-react/preview/control-widget-visibility/NavigationWidget.js +2 -1
  109. package/lib/appui-react/preview/control-widget-visibility/NavigationWidget.js.map +1 -1
  110. package/lib/appui-react/preview/enable-maximized-widget/MaximizeToggle.d.ts.map +1 -1
  111. package/lib/appui-react/preview/enable-maximized-widget/MaximizeToggle.js +3 -2
  112. package/lib/appui-react/preview/enable-maximized-widget/MaximizeToggle.js.map +1 -1
  113. package/lib/appui-react/preview/use-stratakit/StrataKitIcon.d.ts +26 -0
  114. package/lib/appui-react/preview/use-stratakit/StrataKitIcon.d.ts.map +1 -0
  115. package/lib/appui-react/preview/use-stratakit/StrataKitIcon.js +61 -0
  116. package/lib/appui-react/preview/use-stratakit/StrataKitIcon.js.map +1 -0
  117. package/lib/appui-react/preview/use-stratakit/StrataKitIconModules.d.ts +8 -0
  118. package/lib/appui-react/preview/use-stratakit/StrataKitIconModules.d.ts.map +1 -0
  119. package/lib/appui-react/preview/use-stratakit/StrataKitIconModules.js +6 -0
  120. package/lib/appui-react/preview/use-stratakit/StrataKitIconModules.js.map +1 -0
  121. package/lib/appui-react/preview/use-stratakit/webFontToStrataKitIcon.d.ts +12 -0
  122. package/lib/appui-react/preview/use-stratakit/webFontToStrataKitIcon.d.ts.map +1 -0
  123. package/lib/appui-react/preview/use-stratakit/webFontToStrataKitIcon.js +603 -0
  124. package/lib/appui-react/preview/use-stratakit/webFontToStrataKitIcon.js.map +1 -0
  125. package/lib/appui-react/preview/widget-action-dropdown/MoreButton.d.ts.map +1 -1
  126. package/lib/appui-react/preview/widget-action-dropdown/MoreButton.js +2 -1
  127. package/lib/appui-react/preview/widget-action-dropdown/MoreButton.js.map +1 -1
  128. package/lib/appui-react/preview/widget-tab-actions/Widget.d.ts.map +1 -1
  129. package/lib/appui-react/preview/widget-tab-actions/Widget.js +5 -6
  130. package/lib/appui-react/preview/widget-tab-actions/Widget.js.map +1 -1
  131. package/lib/appui-react/selection/SelectionContextItemDef.d.ts.map +1 -1
  132. package/lib/appui-react/selection/SelectionContextItemDef.js +7 -8
  133. package/lib/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  134. package/lib/appui-react/settings/quantityformatting/QuantityFormat.d.ts.map +1 -1
  135. package/lib/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
  136. package/lib/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  137. package/lib/appui-react/settings/ui/UiSettingsPage.d.ts.map +1 -1
  138. package/lib/appui-react/settings/ui/UiSettingsPage.js +2 -1
  139. package/lib/appui-react/settings/ui/UiSettingsPage.js.map +1 -1
  140. package/lib/appui-react/statusbar/LabelIndicator.d.ts.map +1 -1
  141. package/lib/appui-react/statusbar/LabelIndicator.js +2 -2
  142. package/lib/appui-react/statusbar/LabelIndicator.js.map +1 -1
  143. package/lib/appui-react/statusbar/Overflow.d.ts +1 -1
  144. package/lib/appui-react/statusbar/Overflow.d.ts.map +1 -1
  145. package/lib/appui-react/statusbar/Overflow.js +3 -2
  146. package/lib/appui-react/statusbar/Overflow.js.map +1 -1
  147. package/lib/appui-react/statusfields/SelectionCount.d.ts +1 -1
  148. package/lib/appui-react/statusfields/SelectionCount.d.ts.map +1 -1
  149. package/lib/appui-react/statusfields/SelectionCount.js +3 -3
  150. package/lib/appui-react/statusfields/SelectionCount.js.map +1 -1
  151. package/lib/appui-react/statusfields/SnapMode.d.ts.map +1 -1
  152. package/lib/appui-react/statusfields/SnapMode.js +12 -10
  153. package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
  154. package/lib/appui-react/statusfields/ViewAttributes.d.ts.map +1 -1
  155. package/lib/appui-react/statusfields/ViewAttributes.js +2 -1
  156. package/lib/appui-react/statusfields/ViewAttributes.js.map +1 -1
  157. package/lib/appui-react/statusfields/message-center/MessageCenterField.d.ts.map +1 -1
  158. package/lib/appui-react/statusfields/message-center/MessageCenterField.js +11 -10
  159. package/lib/appui-react/statusfields/message-center/MessageCenterField.js.map +1 -1
  160. package/lib/appui-react/statusfields/message-center/MessageCenterField.scss +16 -0
  161. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  162. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +107 -109
  163. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  164. package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
  165. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +2 -4
  166. package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
  167. package/lib/appui-react/toolbar/new-toolbars/Item.d.ts.map +1 -1
  168. package/lib/appui-react/toolbar/new-toolbars/Item.js +2 -4
  169. package/lib/appui-react/toolbar/new-toolbars/Item.js.map +1 -1
  170. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.d.ts.map +1 -1
  171. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.js +2 -1
  172. package/lib/appui-react/toolbar/new-toolbars/OverflowButton.js.map +1 -1
  173. package/lib/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  174. package/lib/appui-react/tools/CoreToolDefinitions.js +5 -5
  175. package/lib/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  176. package/lib/appui-react/tools/KeyinPaletteTools.d.ts.map +1 -1
  177. package/lib/appui-react/tools/KeyinPaletteTools.js +2 -1
  178. package/lib/appui-react/tools/KeyinPaletteTools.js.map +1 -1
  179. package/lib/appui-react/tools/OpenSettingsTool.d.ts.map +1 -1
  180. package/lib/appui-react/tools/OpenSettingsTool.js +2 -1
  181. package/lib/appui-react/tools/OpenSettingsTool.js.map +1 -1
  182. package/lib/appui-react/tools/defineToolIcons.js +13 -2
  183. package/lib/appui-react/tools/defineToolIcons.js.map +1 -1
  184. package/lib/appui-react/utils/PropsHelper.d.ts.map +1 -1
  185. package/lib/appui-react/utils/PropsHelper.js +2 -2
  186. package/lib/appui-react/utils/PropsHelper.js.map +1 -1
  187. package/lib/appui-react/widget-panels/Tab.d.ts.map +1 -1
  188. package/lib/appui-react/widget-panels/Tab.js +4 -6
  189. package/lib/appui-react/widget-panels/Tab.js.map +1 -1
  190. package/lib/appui-react/widgets/BackstageAppButton.d.ts.map +1 -1
  191. package/lib/appui-react/widgets/BackstageAppButton.js +3 -5
  192. package/lib/appui-react/widgets/BackstageAppButton.js.map +1 -1
  193. package/lib/cjs/appui-react/layout/widget/Tab.scss +9 -2
  194. package/lib/cjs/appui-react/statusfields/message-center/MessageCenterField.scss +16 -0
  195. package/lib/esm/appui-react/layout/widget/Tab.scss +9 -2
  196. package/lib/esm/appui-react/statusfields/message-center/MessageCenterField.scss +16 -0
  197. package/lib/useStrataKit.d.ts +1005 -0
  198. package/lib/useStrataKit.d.ts.map +1 -0
  199. package/lib/useStrataKit.js +699 -0
  200. package/lib/useStrataKit.js.map +1 -0
  201. package/package.json +22 -7
  202. package/lib/appui-react/icons/SvgSelectionClear.d.ts +0 -7
  203. package/lib/appui-react/icons/SvgSelectionClear.d.ts.map +0 -1
  204. package/lib/appui-react/icons/SvgSelectionClear.js +0 -14
  205. package/lib/appui-react/icons/SvgSelectionClear.js.map +0 -1
@@ -10,7 +10,6 @@ import * as React from "react";
10
10
  import classnames from "classnames";
11
11
  import { ConditionalBooleanValue, ConditionalStringValue, } from "@itwin/appui-abstract";
12
12
  import { Logger } from "@itwin/core-bentley";
13
- import { Icon as CoreIcon } from "@itwin/core-react";
14
13
  import { Badge } from "@itwin/core-react/internal";
15
14
  import { Dialog, Divider, Icon, List, ListItem } from "@itwin/itwinui-react";
16
15
  import { UiFramework } from "../UiFramework.js";
@@ -18,6 +17,7 @@ import { useActiveFrontstageId } from "../frontstage/FrontstageDef.js";
18
17
  import { isProviderItem } from "../ui-items-provider/isProviderItem.js";
19
18
  import { useBackstageManager } from "./BackstageManager.js";
20
19
  import { useTranslation } from "../hooks/useTranslation.js";
20
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
21
21
  /** @internal */
22
22
  export function Backstage(props) {
23
23
  const { isOpen, onClose, showOverlay, ...rest } = props;
@@ -41,8 +41,7 @@ function ItemIcon({ icon, iconNode, }) {
41
41
  if (iconNode) {
42
42
  return React.createElement(Icon, { "aria-hidden": "true" }, iconNode);
43
43
  }
44
- // eslint-disable-next-line @typescript-eslint/no-deprecated
45
- return React.createElement(CoreIcon, { iconSpec: icon });
44
+ return React.createElement(StrataKitIcon, { iconSpec: icon });
46
45
  }
47
46
  function BackstageItem(props) {
48
47
  const { item, active, onClick, autoFocus, ...rest } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"Backstage.js","sourceRoot":"","sources":["../../../src/appui-react/backstage/Backstage.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAe5D,gBAAgB;AAChB,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAExD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IAEvC,OAAO,CACL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AAQ,CAC/C,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,kBAAkB,CACrD,CAAC;IACF,OAAO,CACL,oBAAC,aAAa,IACZ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,WAAW,KAChB,IAAI,GACR,CACH,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 Backstage\n */\n\nimport \"./Backstage.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Icon as CoreIcon } from \"@itwin/core-react\";\nimport { Badge } from \"@itwin/core-react/internal\";\nimport { Dialog, Divider, Icon, List, ListItem } from \"@itwin/itwinui-react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useActiveFrontstageId } from \"../frontstage/FrontstageDef.js\";\nimport { isProviderItem } from \"../ui-items-provider/isProviderItem.js\";\nimport { useBackstageManager } from \"./BackstageManager.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\n\nimport type {\n BackstageActionItem as BackstageActionItemDef,\n BackstageItem as BackstageItemDef,\n BackstageStageLauncher as BackstageStageLauncherDef,\n CommonBackstageItem,\n} from \"./BackstageItem.js\";\n\ninterface BackstageProps extends React.ComponentProps<\"div\"> {\n isOpen: boolean;\n onClose: () => void;\n showOverlay: boolean;\n}\n\n/** @internal */\nexport function Backstage(props: BackstageProps) {\n const { isOpen, onClose, showOverlay, ...rest } = props;\n\n const { translate } = useTranslation();\n\n return (\n <Dialog\n className=\"uifw-backstage-backstage_wrapper\"\n placement=\"top-left\"\n isOpen={isOpen}\n onClose={onClose}\n closeOnExternalClick\n preventDocumentScroll\n trapFocus\n setFocus={false}\n >\n <Dialog.Backdrop\n className={classnames(\n \"uifw-backstage-backstage_backdrop\",\n !showOverlay && \"uifw-transparent\"\n )}\n />\n <Dialog.Main\n aria-label={translate(\"backstage.label\")}\n {...rest}\n className={classnames(\"uifw-backstage-backstage\", props.className)}\n >\n <Dialog.Content className=\"uifw-backstage-backstage_content\">\n {props.children}\n </Dialog.Content>\n </Dialog.Main>\n </Dialog>\n );\n}\n\nfunction BackstageDivider() {\n return <Divider className=\"uifw-backstage-backstage_divider\" />;\n}\n\ninterface BackstageGroupProps {\n children?: React.ReactNode;\n index: number;\n}\n\n/** @internal */\nexport function BackstageGroup(props: BackstageGroupProps) {\n const { index, ...rest } = props;\n return (\n <>\n {index > 0 ? <BackstageDivider /> : null}\n <List {...rest}>{props.children}</List>\n </>\n );\n}\n\nfunction ItemIcon({\n icon,\n iconNode,\n}: {\n icon: CommonBackstageItem[\"icon\"];\n iconNode: CommonBackstageItem[\"iconNode\"];\n}) {\n if (iconNode) {\n return <Icon aria-hidden=\"true\">{iconNode}</Icon>;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return <CoreIcon iconSpec={icon} />;\n}\n\ntype ListItemProps = React.ComponentProps<typeof ListItem>;\n\ninterface BackstageItemProps\n extends Pick<ListItemProps, \"active\" | \"onClick\" | \"autoFocus\"> {\n item: BackstageItemDef;\n onClick?: () => void;\n}\n\nfunction BackstageItem(props: BackstageItemProps) {\n const { item, active, onClick, autoFocus, ...rest } = props;\n\n const descriptionId = React.useId();\n\n const description = ConditionalStringValue.getValue(item.subtitle);\n const label = ConditionalStringValue.getValue(item.label);\n const disabled = ConditionalBooleanValue.getValue(item.isDisabled);\n return (\n <ListItem\n data-item-id={item.id}\n data-item-type=\"backstage-item\"\n data-item-group-priority={item.groupPriority}\n data-item-priority={item.itemPriority}\n data-item-provider-id={isProviderItem(item) ? item.providerId : undefined}\n disabled={disabled}\n size=\"large\"\n active={active}\n actionable\n {...rest}\n >\n <div className=\"uifw-backstage-backstage_badge\">\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Badge type={item.badgeKind || item.badge} />\n </div>\n <ListItem.Icon>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <ItemIcon iconNode={item.iconNode} icon={item.icon} />\n </ListItem.Icon>\n <ListItem.Content>\n <ListItem.Action\n onClick={onClick}\n aria-describedby={descriptionId}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n aria-current={active ? \"true\" : undefined}\n >\n {label}\n </ListItem.Action>\n <ListItem.Description id={descriptionId}>\n {description}\n </ListItem.Description>\n </ListItem.Content>\n </ListItem>\n );\n}\n\ninterface BackstageActionItemProps extends Pick<ListItemProps, \"autoFocus\"> {\n readonly item: BackstageActionItemDef;\n}\n\n/** @internal */\nexport function BackstageActionItem(props: BackstageActionItemProps) {\n const { item, ...rest } = props;\n\n const manager = useBackstageManager();\n const handleClick = React.useCallback(() => {\n manager.close();\n item.execute();\n }, [manager, item]);\n return <BackstageItem item={item} onClick={handleClick} {...rest} />;\n}\n\ninterface BackstageStageLauncherProps extends Pick<ListItemProps, \"autoFocus\"> {\n readonly item: BackstageStageLauncherDef;\n}\n\n/** @internal */\nexport function BackstageStageLauncher(props: BackstageStageLauncherProps) {\n const { item, ...rest } = props;\n\n const manager = useBackstageManager();\n const handleClick = React.useCallback(() => {\n manager.close();\n if (!UiFramework.frontstages.hasFrontstage(item.stageId))\n return Logger.logError(\n \"BackstageStageLauncher\",\n `Frontstage with id '${item.stageId}' not found`\n );\n void UiFramework.frontstages.setActiveFrontstage(item.stageId);\n }, [manager, item.stageId]);\n const activeFrontstageId = useActiveFrontstageId();\n const isActive = ConditionalBooleanValue.getValue(\n item.isActive ?? item.stageId === activeFrontstageId\n );\n return (\n <BackstageItem\n item={item}\n active={isActive}\n onClick={handleClick}\n {...rest}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"Backstage.js","sourceRoot":"","sources":["../../../src/appui-react/backstage/Backstage.tsx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,GAAG,EAAE;QACzC,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACpB,OAAO,oBAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,KAAM,IAAI,GAAI,CAAC;AACvE,CAAC;AAMD,gBAAgB;AAChB,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAEhC,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACzC,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC;YACtD,OAAO,MAAM,CAAC,QAAQ,CACpB,wBAAwB,EACxB,uBAAuB,IAAI,CAAC,OAAO,aAAa,CACjD,CAAC;QACJ,KAAK,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5B,MAAM,kBAAkB,GAAG,qBAAqB,EAAE,CAAC;IACnD,MAAM,QAAQ,GAAG,uBAAuB,CAAC,QAAQ,CAC/C,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,kBAAkB,CACrD,CAAC;IACF,OAAO,CACL,oBAAC,aAAa,IACZ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,WAAW,KAChB,IAAI,GACR,CACH,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 Backstage\n */\n\nimport \"./Backstage.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n} from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Badge } from \"@itwin/core-react/internal\";\nimport { Dialog, Divider, Icon, List, ListItem } from \"@itwin/itwinui-react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useActiveFrontstageId } from \"../frontstage/FrontstageDef.js\";\nimport { isProviderItem } from \"../ui-items-provider/isProviderItem.js\";\nimport { useBackstageManager } from \"./BackstageManager.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\nimport type {\n BackstageActionItem as BackstageActionItemDef,\n BackstageItem as BackstageItemDef,\n BackstageStageLauncher as BackstageStageLauncherDef,\n CommonBackstageItem,\n} from \"./BackstageItem.js\";\n\ninterface BackstageProps extends React.ComponentProps<\"div\"> {\n isOpen: boolean;\n onClose: () => void;\n showOverlay: boolean;\n}\n\n/** @internal */\nexport function Backstage(props: BackstageProps) {\n const { isOpen, onClose, showOverlay, ...rest } = props;\n\n const { translate } = useTranslation();\n\n return (\n <Dialog\n className=\"uifw-backstage-backstage_wrapper\"\n placement=\"top-left\"\n isOpen={isOpen}\n onClose={onClose}\n closeOnExternalClick\n preventDocumentScroll\n trapFocus\n setFocus={false}\n >\n <Dialog.Backdrop\n className={classnames(\n \"uifw-backstage-backstage_backdrop\",\n !showOverlay && \"uifw-transparent\"\n )}\n />\n <Dialog.Main\n aria-label={translate(\"backstage.label\")}\n {...rest}\n className={classnames(\"uifw-backstage-backstage\", props.className)}\n >\n <Dialog.Content className=\"uifw-backstage-backstage_content\">\n {props.children}\n </Dialog.Content>\n </Dialog.Main>\n </Dialog>\n );\n}\n\nfunction BackstageDivider() {\n return <Divider className=\"uifw-backstage-backstage_divider\" />;\n}\n\ninterface BackstageGroupProps {\n children?: React.ReactNode;\n index: number;\n}\n\n/** @internal */\nexport function BackstageGroup(props: BackstageGroupProps) {\n const { index, ...rest } = props;\n return (\n <>\n {index > 0 ? <BackstageDivider /> : null}\n <List {...rest}>{props.children}</List>\n </>\n );\n}\n\nfunction ItemIcon({\n icon,\n iconNode,\n}: {\n icon: CommonBackstageItem[\"icon\"];\n iconNode: CommonBackstageItem[\"iconNode\"];\n}) {\n if (iconNode) {\n return <Icon aria-hidden=\"true\">{iconNode}</Icon>;\n }\n\n return <StrataKitIcon iconSpec={icon} />;\n}\n\ntype ListItemProps = React.ComponentProps<typeof ListItem>;\n\ninterface BackstageItemProps\n extends Pick<ListItemProps, \"active\" | \"onClick\" | \"autoFocus\"> {\n item: BackstageItemDef;\n onClick?: () => void;\n}\n\nfunction BackstageItem(props: BackstageItemProps) {\n const { item, active, onClick, autoFocus, ...rest } = props;\n\n const descriptionId = React.useId();\n\n const description = ConditionalStringValue.getValue(item.subtitle);\n const label = ConditionalStringValue.getValue(item.label);\n const disabled = ConditionalBooleanValue.getValue(item.isDisabled);\n return (\n <ListItem\n data-item-id={item.id}\n data-item-type=\"backstage-item\"\n data-item-group-priority={item.groupPriority}\n data-item-priority={item.itemPriority}\n data-item-provider-id={isProviderItem(item) ? item.providerId : undefined}\n disabled={disabled}\n size=\"large\"\n active={active}\n actionable\n {...rest}\n >\n <div className=\"uifw-backstage-backstage_badge\">\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Badge type={item.badgeKind || item.badge} />\n </div>\n <ListItem.Icon>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <ItemIcon iconNode={item.iconNode} icon={item.icon} />\n </ListItem.Icon>\n <ListItem.Content>\n <ListItem.Action\n onClick={onClick}\n aria-describedby={descriptionId}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n aria-current={active ? \"true\" : undefined}\n >\n {label}\n </ListItem.Action>\n <ListItem.Description id={descriptionId}>\n {description}\n </ListItem.Description>\n </ListItem.Content>\n </ListItem>\n );\n}\n\ninterface BackstageActionItemProps extends Pick<ListItemProps, \"autoFocus\"> {\n readonly item: BackstageActionItemDef;\n}\n\n/** @internal */\nexport function BackstageActionItem(props: BackstageActionItemProps) {\n const { item, ...rest } = props;\n\n const manager = useBackstageManager();\n const handleClick = React.useCallback(() => {\n manager.close();\n item.execute();\n }, [manager, item]);\n return <BackstageItem item={item} onClick={handleClick} {...rest} />;\n}\n\ninterface BackstageStageLauncherProps extends Pick<ListItemProps, \"autoFocus\"> {\n readonly item: BackstageStageLauncherDef;\n}\n\n/** @internal */\nexport function BackstageStageLauncher(props: BackstageStageLauncherProps) {\n const { item, ...rest } = props;\n\n const manager = useBackstageManager();\n const handleClick = React.useCallback(() => {\n manager.close();\n if (!UiFramework.frontstages.hasFrontstage(item.stageId))\n return Logger.logError(\n \"BackstageStageLauncher\",\n `Frontstage with id '${item.stageId}' not found`\n );\n void UiFramework.frontstages.setActiveFrontstage(item.stageId);\n }, [manager, item.stageId]);\n const activeFrontstageId = useActiveFrontstageId();\n const isActive = ConditionalBooleanValue.getValue(\n item.isActive ?? item.stageId === activeFrontstageId\n );\n return (\n <BackstageItem\n item={item}\n active={isActive}\n onClick={handleClick}\n {...rest}\n />\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CursorPrompt.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursorprompt/CursorPrompt.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAe7B,UAAU,mBAAmB;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAKD,gBAAgB;AAChB,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB;;EA+FxD"}
1
+ {"version":3,"file":"CursorPrompt.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursorprompt/CursorPrompt.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAgB7B,UAAU,mBAAmB;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAKD,gBAAgB;AAChB,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB;;EA+FxD"}
@@ -9,13 +9,14 @@ import "./CursorPrompt.scss";
9
9
  import * as React from "react";
10
10
  import { RelativePosition } from "@itwin/appui-abstract";
11
11
  import { Logger } from "@itwin/core-bentley";
12
- import { Icon, Timer } from "@itwin/core-react";
12
+ import { Timer } from "@itwin/core-react";
13
13
  import { Point } from "@itwin/core-react/internal";
14
14
  import { Text } from "@itwin/itwinui-react";
15
15
  import { CursorInformation, useCursorInformationStore, } from "../CursorInformation.js";
16
16
  import { CursorPopupManager } from "../cursorpopup/CursorPopupManager.js";
17
17
  import { UiFramework } from "../../UiFramework.js";
18
18
  import { useDraggedItem } from "../../layout/base/DragManager.js";
19
+ import { StrataKitIcon } from "../../preview/use-stratakit/StrataKitIcon.js";
19
20
  const popupId = "cursor-prompt";
20
21
  const getCategory = () => UiFramework.loggerCategory("useCursorPrompt");
21
22
  /** @internal */
@@ -102,7 +103,7 @@ export function useCursorPrompt(args) {
102
103
  function CursorPrompt({ iconSpec, instruction, }) {
103
104
  return (React.createElement("div", { className: "uifw-cursor-prompt" },
104
105
  iconSpec && (React.createElement("span", { className: "uifw-cursor-prompt-icon" },
105
- React.createElement(Icon, { iconSpec: iconSpec }))),
106
+ React.createElement(StrataKitIcon, { iconSpec: iconSpec }))),
106
107
  React.createElement(Text, { variant: "body", className: "uifw-cursor-prompt-text" }, instruction)));
107
108
  }
108
109
  //# sourceMappingURL=CursorPrompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CursorPrompt.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursorprompt/CursorPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAWlE,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAExE,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAAC,IAAyB;IACvD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IACvE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACn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AC,MAAM,EAAC,SAAS,EAAC,yBAAyB,IACrD,WAAW,CACP,CACH,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 Notification\n */\n\nimport \"./CursorPrompt.scss\";\nimport * as React from \"react\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Icon, Timer } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react/internal\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport {\n CursorInformation,\n useCursorInformationStore,\n} from \"../CursorInformation.js\";\nimport { CursorPopupManager } from \"../cursorpopup/CursorPopupManager.js\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { useDraggedItem } from \"../../layout/base/DragManager.js\";\n\ninterface UseCursorPromptArgs {\n show: boolean;\n timeout: number;\n iconSpec: string;\n instruction: string | undefined;\n fadeOut: boolean;\n promptAtContent: boolean;\n}\n\nconst popupId = \"cursor-prompt\";\nconst getCategory = () => UiFramework.loggerCategory(\"useCursorPrompt\");\n\n/** @internal */\nexport function useCursorPrompt(args: UseCursorPromptArgs) {\n const { show, timeout, instruction, iconSpec, promptAtContent } = args;\n const lastArgsRef = React.useRef(args);\n React.useEffect(() => {\n lastArgsRef.current = args;\n }, [args]);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const timerRef = React.useRef<Timer | undefined>(undefined);\n const [isOpen, setIsOpen] = React.useState(false);\n\n const dragged = !!useDraggedItem();\n // Workaround to make sure the prompt is not shown when dragging a widget.\n const [draggedRecently, setDraggedRecently] = React.useState(false);\n React.useEffect(() => {\n if (dragged) {\n Logger.logTrace(getCategory(), \"dragged recently\");\n setDraggedRecently(true);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const timer = new Timer(250);\n timer.setOnExecute(() => {\n Logger.logTrace(getCategory(), \"reset dragged recently\");\n setDraggedRecently(false);\n });\n timer.start();\n return () => {\n timer.stop();\n };\n }, [dragged]);\n\n const contentHovered = useCursorInformationStore(\n (state) => state.contentHovered\n );\n const shouldOpen = React.useMemo(() => {\n if (!show) return false;\n if (!isOpen) return false;\n if (promptAtContent && (dragged || draggedRecently)) return false;\n if (promptAtContent && !contentHovered) return false;\n return true;\n }, [show, isOpen, dragged, draggedRecently, promptAtContent, contentHovered]);\n\n React.useEffect(() => {\n if (timeout === Number.POSITIVE_INFINITY) return;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const timer = new Timer(timeout);\n timer.setOnExecute(() => {\n Logger.logTrace(getCategory(), \"timer expired\");\n setIsOpen(false);\n });\n timer.delay = timeout;\n timerRef.current = timer;\n return () => {\n timer.stop();\n };\n }, [timeout]);\n React.useEffect(() => {\n if (!shouldOpen) return;\n if (!instruction) return;\n\n Logger.logTrace(getCategory(), \"open\");\n CursorPopupManager.open(\n popupId,\n <CursorPrompt iconSpec={iconSpec} instruction={instruction} />,\n CursorInformation.cursorPosition,\n new Point(20, 20),\n RelativePosition.BottomRight,\n 0,\n { shadow: true },\n CursorInformation.cursorDocument\n );\n return () => {\n Logger.logTrace(getCategory(), \"close\");\n CursorPopupManager.close(popupId, false, lastArgsRef.current.fadeOut);\n };\n }, [shouldOpen, instruction, iconSpec]);\n React.useEffect(() => {\n return CursorInformation.onCursorUpdatedEvent.addListener((args) => {\n CursorPopupManager.updatePosition(\n args.newPt,\n CursorInformation.cursorDocument\n );\n });\n }, []);\n\n const open = React.useCallback(() => {\n Logger.logTrace(getCategory(), \"request open\");\n setIsOpen(true);\n timerRef.current?.start();\n }, []);\n\n return { open };\n}\n\nfunction CursorPrompt({\n iconSpec,\n instruction,\n}: {\n iconSpec: string;\n instruction: string;\n}) {\n return (\n <div className=\"uifw-cursor-prompt\">\n {iconSpec && (\n <span className=\"uifw-cursor-prompt-icon\">\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Icon iconSpec={iconSpec} />\n </span>\n )}\n <Text variant=\"body\" className=\"uifw-cursor-prompt-text\">\n {instruction}\n </Text>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"CursorPrompt.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursorprompt/CursorPrompt.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,qBAAqB,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAW7E,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAExE,gBAAgB;AAChB,MAAM,UAAU,eAAe,CAAC,IAAyB;IACvD,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IACvE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,CAAC,SAAS,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IAAI,IAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,yBAAyB,IACrD,WAAW,CACP,CACH,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 Notification\n */\n\nimport \"./CursorPrompt.scss\";\nimport * as React from \"react\";\nimport { RelativePosition } from \"@itwin/appui-abstract\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Timer } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react/internal\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport {\n CursorInformation,\n useCursorInformationStore,\n} from \"../CursorInformation.js\";\nimport { CursorPopupManager } from \"../cursorpopup/CursorPopupManager.js\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { useDraggedItem } from \"../../layout/base/DragManager.js\";\nimport { StrataKitIcon } from \"../../preview/use-stratakit/StrataKitIcon.js\";\n\ninterface UseCursorPromptArgs {\n show: boolean;\n timeout: number;\n iconSpec: string;\n instruction: string | undefined;\n fadeOut: boolean;\n promptAtContent: boolean;\n}\n\nconst popupId = \"cursor-prompt\";\nconst getCategory = () => UiFramework.loggerCategory(\"useCursorPrompt\");\n\n/** @internal */\nexport function useCursorPrompt(args: UseCursorPromptArgs) {\n const { show, timeout, instruction, iconSpec, promptAtContent } = args;\n const lastArgsRef = React.useRef(args);\n React.useEffect(() => {\n lastArgsRef.current = args;\n }, [args]);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const timerRef = React.useRef<Timer | undefined>(undefined);\n const [isOpen, setIsOpen] = React.useState(false);\n\n const dragged = !!useDraggedItem();\n // Workaround to make sure the prompt is not shown when dragging a widget.\n const [draggedRecently, setDraggedRecently] = React.useState(false);\n React.useEffect(() => {\n if (dragged) {\n Logger.logTrace(getCategory(), \"dragged recently\");\n setDraggedRecently(true);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const timer = new Timer(250);\n timer.setOnExecute(() => {\n Logger.logTrace(getCategory(), \"reset dragged recently\");\n setDraggedRecently(false);\n });\n timer.start();\n return () => {\n timer.stop();\n };\n }, [dragged]);\n\n const contentHovered = useCursorInformationStore(\n (state) => state.contentHovered\n );\n const shouldOpen = React.useMemo(() => {\n if (!show) return false;\n if (!isOpen) return false;\n if (promptAtContent && (dragged || draggedRecently)) return false;\n if (promptAtContent && !contentHovered) return false;\n return true;\n }, [show, isOpen, dragged, draggedRecently, promptAtContent, contentHovered]);\n\n React.useEffect(() => {\n if (timeout === Number.POSITIVE_INFINITY) return;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const timer = new Timer(timeout);\n timer.setOnExecute(() => {\n Logger.logTrace(getCategory(), \"timer expired\");\n setIsOpen(false);\n });\n timer.delay = timeout;\n timerRef.current = timer;\n return () => {\n timer.stop();\n };\n }, [timeout]);\n React.useEffect(() => {\n if (!shouldOpen) return;\n if (!instruction) return;\n\n Logger.logTrace(getCategory(), \"open\");\n CursorPopupManager.open(\n popupId,\n <CursorPrompt iconSpec={iconSpec} instruction={instruction} />,\n CursorInformation.cursorPosition,\n new Point(20, 20),\n RelativePosition.BottomRight,\n 0,\n { shadow: true },\n CursorInformation.cursorDocument\n );\n return () => {\n Logger.logTrace(getCategory(), \"close\");\n CursorPopupManager.close(popupId, false, lastArgsRef.current.fadeOut);\n };\n }, [shouldOpen, instruction, iconSpec]);\n React.useEffect(() => {\n return CursorInformation.onCursorUpdatedEvent.addListener((args) => {\n CursorPopupManager.updatePosition(\n args.newPt,\n CursorInformation.cursorDocument\n );\n });\n }, []);\n\n const open = React.useCallback(() => {\n Logger.logTrace(getCategory(), \"request open\");\n setIsOpen(true);\n timerRef.current?.start();\n }, []);\n\n return { open };\n}\n\nfunction CursorPrompt({\n iconSpec,\n instruction,\n}: {\n iconSpec: string;\n instruction: string;\n}) {\n return (\n <div className=\"uifw-cursor-prompt\">\n {iconSpec && (\n <span className=\"uifw-cursor-prompt-icon\">\n <StrataKitIcon iconSpec={iconSpec} />\n </span>\n )}\n <Text variant=\"body\" className=\"uifw-cursor-prompt-text\">\n {instruction}\n </Text>\n </div>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LockEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/LockEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAyE7D,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS,sBAEnB;CACF;AAED,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,sCAAsC,CAAC"}
1
+ {"version":3,"file":"LockEditor.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/LockEditor.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAuF7D,gBAAgB;AAChB,qBAAa,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS,sBAEnB;CACF;AAED,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,sCAAsC,CAAC"}
@@ -11,6 +11,7 @@ import { PropertyEditorBase } from "@itwin/components-react";
11
11
  import { IconButton } from "@itwin/itwinui-react";
12
12
  import { SvgLock, SvgLockUnlocked } from "@itwin/itwinui-icons-react";
13
13
  import { PropertyValueFormat } from "@itwin/appui-abstract";
14
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
14
15
  const LockEditor = React.forwardRef(function LockEditor(props, forwardedRef) {
15
16
  const ref = React.useRef(null);
16
17
  const getCurrentValue = () => {
@@ -52,7 +53,7 @@ const LockEditor = React.forwardRef(function LockEditor(props, forwardedRef) {
52
53
  displayValue: "",
53
54
  },
54
55
  });
55
- } }, currentValue ? React.createElement(SvgLock, null) : React.createElement(SvgLockUnlocked, null)));
56
+ } }, currentValue ? (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/lock").svgLock, iconNode: React.createElement(SvgLock, null) })) : (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/lock-unlocked").svgLockUnlocked, iconNode: React.createElement(SvgLockUnlocked, null) }))));
56
57
  });
57
58
  /** @internal */
58
59
  export class LockPropertyEditor extends PropertyEditorBase {
@@ -1 +1 @@
1
- {"version":3,"file":"LockEditor.js","sourceRoot":"","sources":["../../../src/appui-react/editors/LockEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,qDAAqD;AAErD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,SAAS,UAAU,CAAC,KAAK,EAAE,YAAY;IACrC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,IACE,KAAK,CAAC,cAAc;YACpB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,KAAK,mBAAmB,CAAC,SAAS,EACxE,CAAC;YACD,OAAO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,KAAgB,CAAC;QACrD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IACF,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,KAAK,CAAC,mB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Y;oBACpB,YAAY,EAAE,EAAE;iBACjB;aACF,CAAC,CAAC;QACL,CAAC,IAEA,YAAY,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CACtC,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB;AAChB,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,mCAAmC,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 UiProvider\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nimport * as React from \"react\";\nimport type { PropertyEditorProps, TypeEditor } from \"@itwin/components-react\";\nimport { PropertyEditorBase } from \"@itwin/components-react\";\nimport { IconButton } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport type { PropertyValue } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\n\nconst LockEditor = React.forwardRef<TypeEditor, PropertyEditorProps>(\n function LockEditor(props, forwardedRef) {\n const ref = React.useRef<HTMLButtonElement>(null);\n const getCurrentValue = () => {\n if (\n props.propertyRecord &&\n props.propertyRecord.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n return props.propertyRecord.value.value as boolean;\n }\n return false;\n };\n const currentValue = getCurrentValue();\n\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n getPropertyValue: async () => {\n let propertyValue: PropertyValue | undefined;\n if (\n props.propertyRecord &&\n props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n ) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: currentValue,\n displayValue: \"\",\n };\n }\n return propertyValue;\n },\n htmlElement: ref.current,\n hasFocus: document.activeElement === ref.current,\n }),\n [currentValue, props.propertyRecord]\n );\n\n const displayLabel = props.propertyRecord?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n const disabled = props.propertyRecord?.isDisabled;\n return (\n <IconButton\n ref={ref}\n label={label}\n size=\"small\"\n styleType=\"borderless\"\n isActive={currentValue}\n disabled={disabled}\n onClick={() => {\n if (!props.propertyRecord || !props.onCommit) return;\n props.onCommit({\n propertyRecord: props.propertyRecord,\n newValue: {\n valueFormat: PropertyValueFormat.Primitive,\n value: !currentValue,\n displayValue: \"\",\n },\n });\n }}\n >\n {currentValue ? <SvgLock /> : <SvgLockUnlocked />}\n </IconButton>\n );\n }\n);\n\n/** @internal */\nexport class LockPropertyEditor extends PropertyEditorBase {\n public get reactNode() {\n return <LockEditor />;\n }\n}\n\n/** @internal */\nexport const LockPropertyEditorName = \"appui-internal:tool-settings-lock\";\n"]}
1
+ {"version":3,"file":"LockEditor.js","sourceRoot":"","sources":["../../../src/appui-react/editors/LockEditor.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,qDAAqD;AAErD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,SAAS,UAAU,CAAC,KAAK,EAAE,YAAY;IACrC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAoB,IAAI,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,SAAS,EAAC,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC,KAAK,CAAC,QAAQ;gBAAE,OAAO;YACrD,KAAK,CAAC,QAAQ,CAAC;gBACb,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,QAAQ,EAAE;oBACR,WAAW,EAAE,mBAAmB,CAAC,SAAS;oBAC1C,KAAK,EAAE,CAAC,YAAY;oBACpB,YAAY,EAAE,EAAE;iBACjB;aACF,CAAC,CAAC;QACL,CAAC,IAEA,YAAY,CAAC,CAAC,CAAC,CACd,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC,OAAO,EACjE,QAAQ,EAAE,oBAAC,OAAO,OAAG,GACrB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CACnB,UAAU,CAAC,gCAAgC,CAAC,CAAC,eAAe,EAE9D,QAAQ,EAAE,oBAAC,eAAe,OAAG,GAC7B,CACH,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB;AAChB,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,IAAW,SAAS;QAClB,OAAO,oBAAC,UAAU,OAAG,CAAC;IACxB,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,mCAAmC,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 UiProvider\n */\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\nimport * as React from \"react\";\nimport type { PropertyEditorProps, TypeEditor } from \"@itwin/components-react\";\nimport { PropertyEditorBase } from \"@itwin/components-react\";\nimport { IconButton } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport type { PropertyValue } from \"@itwin/appui-abstract\";\nimport { PropertyValueFormat } from \"@itwin/appui-abstract\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\nconst LockEditor = React.forwardRef<TypeEditor, PropertyEditorProps>(\n function LockEditor(props, forwardedRef) {\n const ref = React.useRef<HTMLButtonElement>(null);\n const getCurrentValue = () => {\n if (\n props.propertyRecord &&\n props.propertyRecord.value.valueFormat === PropertyValueFormat.Primitive\n ) {\n return props.propertyRecord.value.value as boolean;\n }\n return false;\n };\n const currentValue = getCurrentValue();\n\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n getPropertyValue: async () => {\n let propertyValue: PropertyValue | undefined;\n if (\n props.propertyRecord &&\n props.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n ) {\n propertyValue = {\n valueFormat: PropertyValueFormat.Primitive,\n value: currentValue,\n displayValue: \"\",\n };\n }\n return propertyValue;\n },\n htmlElement: ref.current,\n hasFocus: document.activeElement === ref.current,\n }),\n [currentValue, props.propertyRecord]\n );\n\n const displayLabel = props.propertyRecord?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n const disabled = props.propertyRecord?.isDisabled;\n\n return (\n <IconButton\n ref={ref}\n label={label}\n size=\"small\"\n styleType=\"borderless\"\n isActive={currentValue}\n disabled={disabled}\n onClick={() => {\n if (!props.propertyRecord || !props.onCommit) return;\n props.onCommit({\n propertyRecord: props.propertyRecord,\n newValue: {\n valueFormat: PropertyValueFormat.Primitive,\n value: !currentValue,\n displayValue: \"\",\n },\n });\n }}\n >\n {currentValue ? (\n <StrataKitIcon\n href={(importIcon) => importIcon(\"@stratakit/icons/lock\").svgLock}\n iconNode={<SvgLock />}\n />\n ) : (\n <StrataKitIcon\n href={(importIcon) =>\n importIcon(\"@stratakit/icons/lock-unlocked\").svgLockUnlocked\n }\n iconNode={<SvgLockUnlocked />}\n />\n )}\n </IconButton>\n );\n }\n);\n\n/** @internal */\nexport class LockPropertyEditor extends PropertyEditorBase {\n public get reactNode() {\n return <LockEditor />;\n }\n}\n\n/** @internal */\nexport const LockPropertyEditorName = \"appui-internal:tool-settings-lock\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LockProvider.d.ts","sourceRoot":"","sources":["../../../src/appui-react/editors/LockProvider.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAMlE;;;GAGG;AACH,eAAO,MAAM,WAAW;IAElB,kEAAkE;qBACjD,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC;IACrC,sDAAsD;uBACnC,CACjB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,OAAO,KACpB,IAAI;cAGH,CAAC;AAEb,gBAAgB;AAChB,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,qBAgCjE;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;oBAEZ,oBAAoB;sBAClB,MAAM;IACxB,8CAA8C;sBAC5B,MAAM,GAAG,SAAS;cAG9B,CAAC;AAEb,KAAK,yBAAyB,GAAG,KAAK,CAAC,WAAW,CAChD,OAAO,qBAAqB,CAC7B,CAAC;AAEF,UAAU,2BACR,SAAQ,WAAW,CAAC,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,gBAAgB;AAChB,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,qBAiBxE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,YAchC;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,gBAA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S,8DAqBpE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,6BAoExC"}
@@ -10,6 +10,7 @@ import { InputWithDecorations } from "@itwin/itwinui-react";
10
10
  import { SvgLock, SvgLockUnlocked } from "@itwin/itwinui-icons-react";
11
11
  import { produce } from "immer";
12
12
  import { usePreviewFeatures } from "../preview/PreviewFeatures.js";
13
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
13
14
  /** This is used to notify the parent component that the lock decoration is displayed in the editor
14
15
  * and a separate lock component should not be displayed as a sibling.
15
16
  * @internal
@@ -116,6 +117,6 @@ export function LockButtonInputDecoration() {
116
117
  propertyName: lockProperty.property.name,
117
118
  });
118
119
  provider.reloadDialogItems();
119
- } }, isLocked ? React.createElement(SvgLock, null) : React.createElement(SvgLockUnlocked, null)));
120
+ } }, isLocked ? (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/lock").svgLock, iconNode: React.createElement(SvgLock, null) })) : (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/lock-unlocked").svgLockUnlocked, iconNode: React.createElement(SvgLockUnlocked, null) }))));
120
121
  }
121
122
  //# sourceMappingURL=LockProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LockProvider.js","sourceRoot":"","sources":["../../../src/appui-react/editors/LockProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAW5C,SAAS,CAAC,CAAC;AAEb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K,CAAC;IAC7C,MAAM,YAAY,GAAG,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC;IACzD,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAC1D,MAAM,QAAQ,GAAG,YAAY,EAAE,UAAU,CAAC;IAC1C,OAAO,CACL,oBAAC,oBAAoB,CAAC,MAAM,IAC1B,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC,QAAQ;gBAAE,OAAO;YACtB,IAAI,CAAC,YAAY;gBAAE,OAAO;YAE1B,QAAQ,CAAC,qBAAqB,CAAC;gBAC7B,KAAK,EAAE;oBACL,GAAG,YAAY,CAAC,KAAK;oBACrB,KAAK,EAAE,CAAC,QAAQ;iBACjB;gBACD,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI;aACzC,CAAC,CAAC;YACH,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAC/B,CAAC,IAEA,QAAQ,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,oBAAC,eAAe,OAAG,CACjB,CAC/B,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 ToolSettings\n */\n\nimport * as React from \"react\";\nimport type { UiLayoutDataProvider } from \"@itwin/appui-abstract\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport { produce } from \"immer\";\nimport { usePreviewFeatures } from \"../preview/PreviewFeatures.js\";\n\n/** This is used to notify the parent component that the lock decoration is displayed in the editor\n * and a separate lock component should not be displayed as a sibling.\n * @internal\n */\nexport const LockContext = React.createContext<\n | {\n /** Describes if the lock is displayed as an editor decoration. */\n lockDecorations: Record<string, true>;\n /** Called by editors that display lock decoration. */\n setLockDecoration: (\n propertyName: string,\n lockDecoration: boolean\n ) => void;\n }\n | undefined\n>(undefined);\n\n/** @internal */\nexport function LockProvider({ children }: React.PropsWithChildren) {\n const [lockDecorations, setLockDecorations] = React.useState<\n Record<string, true>\n >({});\n const setLockDecoration = React.useCallback(\n (propertyName: string, lockDecoration: boolean) => {\n setLockDecorations(\n produce((draft) => {\n if (lockDecoration) {\n draft[propertyName] = true;\n return;\n }\n\n delete draft[propertyName];\n })\n );\n },\n []\n );\n return (\n <LockContext.Provider\n value={React.useMemo(\n () => ({\n lockDecorations,\n setLockDecoration,\n }),\n [lockDecorations, setLockDecoration]\n )}\n >\n {children}\n </LockContext.Provider>\n );\n}\n\n/** Additional context for property editors that support lock decoration.\n * @internal\n */\nexport const PropertyEditorContext = React.createContext<\n | {\n uiDataProvider: UiLayoutDataProvider;\n itemPropertyName: string;\n /** Specified when rendering a lock editor. */\n lockPropertyName: string | undefined;\n }\n | undefined\n>(undefined);\n\ntype PropertyEditorContextType = React.ContextType<\n typeof PropertyEditorContext\n>;\n\ninterface PropertyEditorProviderProps\n extends NonNullable<PropertyEditorContextType> {\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport function PropertyEditorProvider(props: PropertyEditorProviderProps) {\n const { children, uiDataProvider, itemPropertyName, lockPropertyName } =\n props;\n return (\n <PropertyEditorContext.Provider\n value={React.useMemo(\n () => ({\n uiDataProvider,\n itemPropertyName,\n lockPropertyName,\n }),\n [uiDataProvider, itemPropertyName, lockPropertyName]\n )}\n >\n {children}\n </PropertyEditorContext.Provider>\n );\n}\n\n/** Returns `true` if the lock decoration should be displayed.\n * @internal\n */\nexport function useLockDecoration() {\n const { lockPropertyName, itemPropertyName, uiDataProvider } =\n React.useContext(PropertyEditorContext) ?? {};\n const { toolSettingsLockButton } = usePreviewFeatures();\n const dialogItem = React.useMemo(\n () =>\n uiDataProvider?.items.find(\n (item) => item.property.name === itemPropertyName\n ),\n [uiDataProvider, itemPropertyName]\n );\n return (\n !!toolSettingsLockButton && !lockPropertyName && !!dialogItem?.lockProperty\n );\n}\n\ninterface UseLockPropertyArgs {\n provider: UiLayoutDataProvider;\n itemPropertyName: string;\n}\n\n/** @internal */\nexport function useLockProperty(args: UseLockPropertyArgs | undefined) {\n const { provider, itemPropertyName } = args ?? {};\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n const listeners = provider\n ? [\n provider.onItemsReloadedEvent.addListener(onStoreChange),\n provider.onSyncPropertiesChangeEvent.addListener(onStoreChange),\n ]\n : [];\n return () => listeners.forEach((l) => l());\n },\n [provider]\n );\n const getSnapshot = React.useCallback(() => {\n const dialogItem = provider?.items.find(\n (item) => item.property.name === itemPropertyName\n );\n return dialogItem?.lockProperty;\n }, [provider, itemPropertyName]);\n return React.useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/** This component displays a lock button in the property editor when the `toolSettingsLockButton` preview feature is enabled.\n * @alpha\n */\nexport function LockButtonInputDecoration() {\n const { itemPropertyName, uiDataProvider: provider } =\n React.useContext(PropertyEditorContext) ?? {};\n const { setLockDecoration } = React.useContext(LockContext) ?? {};\n const lockDecoration = useLockDecoration();\n\n const lockProperty = useLockProperty(\n provider && itemPropertyName\n ? {\n provider,\n itemPropertyName,\n }\n : undefined\n );\n\n React.useLayoutEffect(() => {\n if (!lockDecoration) return;\n if (!setLockDecoration) return;\n if (!itemPropertyName) return;\n setLockDecoration(itemPropertyName, true);\n return () => {\n setLockDecoration(itemPropertyName, false);\n };\n }, [setLockDecoration, itemPropertyName, lockDecoration]);\n\n if (!lockDecoration) return null;\n\n const isLocked = !!lockProperty?.value.value;\n const displayLabel = lockProperty?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n const disabled = lockProperty?.isDisabled;\n return (\n <InputWithDecorations.Button\n isActive={isLocked}\n label={label}\n disabled={disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n if (!provider) return;\n if (!lockProperty) return;\n\n provider.applyUiPropertyChange({\n value: {\n ...lockProperty.value,\n value: !isLocked,\n },\n propertyName: lockProperty.property.name,\n });\n provider.reloadDialogItems();\n }}\n >\n {isLocked ? <SvgLock /> : <SvgLockUnlocked />}\n </InputWithDecorations.Button>\n );\n}\n"]}
1
+ {"version":3,"file":"LockProvider.js","sourceRoot":"","sources":["../../../src/appui-react/editors/LockProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAW5C,SAAS,CAAC,CAAC;AAEb,gBAAgB;AAChB,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAA2B;IAChE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAE1D,EAAE,CAAC,CAAC;IACN,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CACzC,CAAC,YAAoB,EAAE,cAAuB,EAAE,EAAE;QAChD,kBAAkB,CAChB,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAChB,IAAI,cAAc,EAAE,CAAC;gBACnB,KAAK,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;gBAC3B,OAAO;YACT,CAAC;YAED,OAAO,KAAK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CAAC,QAAQ;gBAAE,OAAO;YACtB,IAAI,CAAC,YAAY;gBAAE,OAAO;YAE1B,QAAQ,CAAC,qBAAqB,CAAC;gBAC7B,KAAK,EAAE;oBACL,GAAG,YAAY,CAAC,KAAK;oBACrB,KAAK,EAAE,CAAC,QAAQ;iBACjB;gBACD,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,IAAI;aACzC,CAAC,CAAC;YACH,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAC/B,CAAC,IAEA,QAAQ,CAAC,CAAC,CAAC,CACV,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC,OAAO,EACjE,QAAQ,EAAE,oBAAC,OAAO,OAAG,GACrB,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CACnB,UAAU,CAAC,gCAAgC,CAAC,CAAC,eAAe,EAE9D,QAAQ,EAAE,oBAAC,eAAe,OAAG,GAC7B,CACH,CAC2B,CAC/B,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 ToolSettings\n */\n\nimport * as React from \"react\";\nimport type { UiLayoutDataProvider } from \"@itwin/appui-abstract\";\nimport { InputWithDecorations } from \"@itwin/itwinui-react\";\nimport { SvgLock, SvgLockUnlocked } from \"@itwin/itwinui-icons-react\";\nimport { produce } from \"immer\";\nimport { usePreviewFeatures } from \"../preview/PreviewFeatures.js\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\n/** This is used to notify the parent component that the lock decoration is displayed in the editor\n * and a separate lock component should not be displayed as a sibling.\n * @internal\n */\nexport const LockContext = React.createContext<\n | {\n /** Describes if the lock is displayed as an editor decoration. */\n lockDecorations: Record<string, true>;\n /** Called by editors that display lock decoration. */\n setLockDecoration: (\n propertyName: string,\n lockDecoration: boolean\n ) => void;\n }\n | undefined\n>(undefined);\n\n/** @internal */\nexport function LockProvider({ children }: React.PropsWithChildren) {\n const [lockDecorations, setLockDecorations] = React.useState<\n Record<string, true>\n >({});\n const setLockDecoration = React.useCallback(\n (propertyName: string, lockDecoration: boolean) => {\n setLockDecorations(\n produce((draft) => {\n if (lockDecoration) {\n draft[propertyName] = true;\n return;\n }\n\n delete draft[propertyName];\n })\n );\n },\n []\n );\n return (\n <LockContext.Provider\n value={React.useMemo(\n () => ({\n lockDecorations,\n setLockDecoration,\n }),\n [lockDecorations, setLockDecoration]\n )}\n >\n {children}\n </LockContext.Provider>\n );\n}\n\n/** Additional context for property editors that support lock decoration.\n * @internal\n */\nexport const PropertyEditorContext = React.createContext<\n | {\n uiDataProvider: UiLayoutDataProvider;\n itemPropertyName: string;\n /** Specified when rendering a lock editor. */\n lockPropertyName: string | undefined;\n }\n | undefined\n>(undefined);\n\ntype PropertyEditorContextType = React.ContextType<\n typeof PropertyEditorContext\n>;\n\ninterface PropertyEditorProviderProps\n extends NonNullable<PropertyEditorContextType> {\n children?: React.ReactNode;\n}\n\n/** @internal */\nexport function PropertyEditorProvider(props: PropertyEditorProviderProps) {\n const { children, uiDataProvider, itemPropertyName, lockPropertyName } =\n props;\n return (\n <PropertyEditorContext.Provider\n value={React.useMemo(\n () => ({\n uiDataProvider,\n itemPropertyName,\n lockPropertyName,\n }),\n [uiDataProvider, itemPropertyName, lockPropertyName]\n )}\n >\n {children}\n </PropertyEditorContext.Provider>\n );\n}\n\n/** Returns `true` if the lock decoration should be displayed.\n * @internal\n */\nexport function useLockDecoration() {\n const { lockPropertyName, itemPropertyName, uiDataProvider } =\n React.useContext(PropertyEditorContext) ?? {};\n const { toolSettingsLockButton } = usePreviewFeatures();\n const dialogItem = React.useMemo(\n () =>\n uiDataProvider?.items.find(\n (item) => item.property.name === itemPropertyName\n ),\n [uiDataProvider, itemPropertyName]\n );\n return (\n !!toolSettingsLockButton && !lockPropertyName && !!dialogItem?.lockProperty\n );\n}\n\ninterface UseLockPropertyArgs {\n provider: UiLayoutDataProvider;\n itemPropertyName: string;\n}\n\n/** @internal */\nexport function useLockProperty(args: UseLockPropertyArgs | undefined) {\n const { provider, itemPropertyName } = args ?? {};\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n const listeners = provider\n ? [\n provider.onItemsReloadedEvent.addListener(onStoreChange),\n provider.onSyncPropertiesChangeEvent.addListener(onStoreChange),\n ]\n : [];\n return () => listeners.forEach((l) => l());\n },\n [provider]\n );\n const getSnapshot = React.useCallback(() => {\n const dialogItem = provider?.items.find(\n (item) => item.property.name === itemPropertyName\n );\n return dialogItem?.lockProperty;\n }, [provider, itemPropertyName]);\n return React.useSyncExternalStore(subscribe, getSnapshot);\n}\n\n/** This component displays a lock button in the property editor when the `toolSettingsLockButton` preview feature is enabled.\n * @alpha\n */\nexport function LockButtonInputDecoration() {\n const { itemPropertyName, uiDataProvider: provider } =\n React.useContext(PropertyEditorContext) ?? {};\n const { setLockDecoration } = React.useContext(LockContext) ?? {};\n const lockDecoration = useLockDecoration();\n\n const lockProperty = useLockProperty(\n provider && itemPropertyName\n ? {\n provider,\n itemPropertyName,\n }\n : undefined\n );\n\n React.useLayoutEffect(() => {\n if (!lockDecoration) return;\n if (!setLockDecoration) return;\n if (!itemPropertyName) return;\n setLockDecoration(itemPropertyName, true);\n return () => {\n setLockDecoration(itemPropertyName, false);\n };\n }, [setLockDecoration, itemPropertyName, lockDecoration]);\n\n if (!lockDecoration) return null;\n\n const isLocked = !!lockProperty?.value.value;\n const displayLabel = lockProperty?.property.displayLabel;\n const label = displayLabel ? displayLabel : \"Toggle lock\";\n const disabled = lockProperty?.isDisabled;\n\n return (\n <InputWithDecorations.Button\n isActive={isLocked}\n label={label}\n disabled={disabled}\n size=\"small\"\n styleType=\"borderless\"\n onClick={() => {\n if (!provider) return;\n if (!lockProperty) return;\n\n provider.applyUiPropertyChange({\n value: {\n ...lockProperty.value,\n value: !isLocked,\n },\n propertyName: lockProperty.property.name,\n });\n provider.reloadDialogItems();\n }}\n >\n {isLocked ? (\n <StrataKitIcon\n href={(importIcon) => importIcon(\"@stratakit/icons/lock\").svgLock}\n iconNode={<SvgLock />}\n />\n ) : (\n <StrataKitIcon\n href={(importIcon) =>\n importIcon(\"@stratakit/icons/lock-unlocked\").svgLockUnlocked\n }\n iconNode={<SvgLockUnlocked />}\n />\n )}\n </InputWithDecorations.Button>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFrontstageButton.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstageButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,UAAU,0BAA2B,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBAsBtE"}
1
+ {"version":3,"file":"ModalFrontstageButton.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstageButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,UAAU,0BAA2B,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBA8BtE"}
@@ -11,6 +11,7 @@ import { SvgProgressBackwardCircular } from "@itwin/itwinui-icons-react";
11
11
  import { UiFramework } from "../UiFramework.js";
12
12
  import { useTranslation } from "../hooks/useTranslation.js";
13
13
  import { IconButton } from "@itwin/itwinui-react";
14
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
14
15
  /** Button usually shown in the top-left corner of the modal frontstage. By default closes the modal frontstage.
15
16
  * @public
16
17
  */
@@ -18,7 +19,7 @@ export function ModalFrontstageButton(props) {
18
19
  const { translate } = useTranslation();
19
20
  const { label, icon, onClick } = props;
20
21
  const defaultLabel = translate("modalFrontstage.backButtonTitle");
21
- const defaultIcon = React.createElement(SvgProgressBackwardCircular, null);
22
+ const defaultIcon = (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/chevron-left").svgChevronLeft, iconNode: React.createElement(SvgProgressBackwardCircular, null) }));
22
23
  const defaultOnClick = React.useCallback(() => {
23
24
  UiFramework.frontstages.closeModalFrontstage();
24
25
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"ModalFrontstageButton.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstageButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAclD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,YAAY,GAAG,SAAS,CAAC,iCAAiC,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,oBAAC,2BAA2B,OAAG,CAAC;IAEpD,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC5C,WAAW,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,UAAU,IACT,SAAS,EAAC,uCAAuC,EACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAClC,KAAK,EAAE,KAAK,IAAI,YAAY,EAC5B,SAAS,EAAE;YACT,SAAS,EAAE,4CAA4C;SACxD,IAEA,IAAI,IAAI,WAAW,CACT,CACd,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 \"./ModalFrontstageButton.scss\";\nimport * as React from \"react\";\nimport { SvgProgressBackwardCircular } from \"@itwin/itwinui-icons-react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { IconButton } from \"@itwin/itwinui-react\";\n\ntype IconButtonProps = React.ComponentProps<typeof IconButton>;\n\ninterface ModalFrontstageButtonProps extends Pick<IconButtonProps, \"onClick\"> {\n children?: never;\n /** If specified overrides the default icon. */\n icon?: React.ReactNode;\n /** If specified overrides the default label. */\n label?: string;\n /** If specified overrides the default behavior of closing the modal frontstage. */\n onClick?: IconButtonProps[\"onClick\"];\n}\n\n/** Button usually shown in the top-left corner of the modal frontstage. By default closes the modal frontstage.\n * @public\n */\nexport function ModalFrontstageButton(props: ModalFrontstageButtonProps) {\n const { translate } = useTranslation();\n const { label, icon, onClick } = props;\n const defaultLabel = translate(\"modalFrontstage.backButtonTitle\");\n const defaultIcon = <SvgProgressBackwardCircular />;\n\n const defaultOnClick = React.useCallback(() => {\n UiFramework.frontstages.closeModalFrontstage();\n }, []);\n\n return (\n <IconButton\n className=\"uifw-frontstage-modalFrontstageButton\"\n onClick={onClick ?? defaultOnClick}\n label={label ?? defaultLabel}\n iconProps={{\n className: \"uifw-frontstage-modalFrontstageButton_icon\",\n }}\n >\n {icon ?? defaultIcon}\n </IconButton>\n );\n}\n"]}
1
+ {"version":3,"file":"ModalFrontstageButton.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalFrontstageButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAc1E;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAiC;IACrE,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACvC,MAAM,YAAY,GAAG,SAAS,CAAC,iCAAiC,CAAC,CAAC;IAElE,MAAM,WAAW,GAAG,CAClB,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CACnB,UAAU,CAAC,+BAA+B,CAAC,CAAC,cAAc,EAE5D,QAAQ,EAAE,oBAAC,2BAA2B,OAAG,GACzC,CACH,CAAC;IAEF,MAAM,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAC5C,WAAW,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC;IACjD,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,UAAU,IACT,SAAS,EAAC,uCAAuC,EACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAClC,KAAK,EAAE,KAAK,IAAI,YAAY,EAC5B,SAAS,EAAE;YACT,SAAS,EAAE,4CAA4C;SACxD,IAEA,IAAI,IAAI,WAAW,CACT,CACd,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 \"./ModalFrontstageButton.scss\";\nimport * as React from \"react\";\nimport { SvgProgressBackwardCircular } from \"@itwin/itwinui-icons-react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { IconButton } from \"@itwin/itwinui-react\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\ntype IconButtonProps = React.ComponentProps<typeof IconButton>;\n\ninterface ModalFrontstageButtonProps extends Pick<IconButtonProps, \"onClick\"> {\n children?: never;\n /** If specified overrides the default icon. */\n icon?: React.ReactNode;\n /** If specified overrides the default label. */\n label?: string;\n /** If specified overrides the default behavior of closing the modal frontstage. */\n onClick?: IconButtonProps[\"onClick\"];\n}\n\n/** Button usually shown in the top-left corner of the modal frontstage. By default closes the modal frontstage.\n * @public\n */\nexport function ModalFrontstageButton(props: ModalFrontstageButtonProps) {\n const { translate } = useTranslation();\n const { label, icon, onClick } = props;\n const defaultLabel = translate(\"modalFrontstage.backButtonTitle\");\n\n const defaultIcon = (\n <StrataKitIcon\n href={(importIcon) =>\n importIcon(\"@stratakit/icons/chevron-left\").svgChevronLeft\n }\n iconNode={<SvgProgressBackwardCircular />}\n />\n );\n\n const defaultOnClick = React.useCallback(() => {\n UiFramework.frontstages.closeModalFrontstage();\n }, []);\n\n return (\n <IconButton\n className=\"uifw-frontstage-modalFrontstageButton\"\n onClick={onClick ?? defaultOnClick}\n label={label ?? defaultLabel}\n iconProps={{\n className: \"uifw-frontstage-modalFrontstageButton_icon\",\n }}\n >\n {icon ?? defaultIcon}\n </IconButton>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalSettingsStage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalSettingsStage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAkEhF;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,mBAAmB;IAG9C,oBAAoB,CAAC,EAAE,MAAM;IAFhD,OAAc,EAAE,SAAoC;IAC7C,KAAK,SAAwD;gBACjD,oBAAoB,CAAC,EAAE,MAAM,YAAA;IACzC,kBAAkB,UAAQ;IACjC,IAAW,OAAO,IAAI,KAAK,CAAC,SAAS,CAIpC;IACD,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAI9B;WAEU,sBAAsB,CAClC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM;WAgBR,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,MAAM;CAiC5D"}
1
+ {"version":3,"file":"ModalSettingsStage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalSettingsStage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAmEhF;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,mBAAmB;IAG9C,oBAAoB,CAAC,EAAE,MAAM;IAFhD,OAAc,EAAE,SAAoC;IAC7C,KAAK,SAAwD;gBACjD,oBAAoB,CAAC,EAAE,MAAM,YAAA;IACzC,kBAAkB,UAAQ;IACjC,IAAW,OAAO,IAAI,KAAK,CAAC,SAAS,CAIpC;IACD,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAI9B;WAEU,sBAAsB,CAClC,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM;WAuBR,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,MAAM;CAiC5D"}
@@ -17,6 +17,7 @@ import { SyncUiEventId } from "../syncui/UiSyncEvent.js";
17
17
  import { StageUsage } from "./StageUsage.js";
18
18
  import { BackstageItemUtilities } from "../backstage/BackstageItemUtilities.js";
19
19
  import { useTranslation } from "../hooks/useTranslation.js";
20
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
20
21
  function ModalSettingsStage({ initialSettingsTabId, }) {
21
22
  const { translate } = useTranslation();
22
23
  const id = UiFramework.frontstages.activeFrontstageDef?.id ?? "none";
@@ -68,7 +69,7 @@ export class SettingsModalFrontstage {
68
69
  itemPriority,
69
70
  execute: () => UiFramework.frontstages.openModalFrontstage(new SettingsModalFrontstage()),
70
71
  label: UiFramework.translate("settings.settingsStageLabel"),
71
- icon: React.createElement(SvgSettings, null),
72
+ icon: (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/settings").svgSettings, iconNode: React.createElement(SvgSettings, null) })),
72
73
  isHidden: SettingsModalFrontstage.noSettingsAvailable(),
73
74
  });
74
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ModalSettingsStage.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/ModalSettingsStage.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,SAAS,kBAAkB,CAAC,EAC1B,oBAAoB,GAGrB;IACC,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IAEvC,MAAM,EAAE,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,EAAE,EAAE,IAAI,MAAM,CAAC;IACrE,MAAM,UAAU,GACd,WAAW,CAAC,WAAW,CAAC,mBAAmB,EAAE,KAAK,IA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,CAAC,kBAA2B;QACzD,IAAI,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACjD,qCAAqC;YACrC,IACE,WAAW,CAAC,WAAW,CAAC,qBAAqB;gBAC7C,WAAW,CAAC,WAAW,CAAC,qBAAqB;oBAC3C,uBAAuB,EACzB,CAAC;gBACD,IAAI,kBAAkB,EAAE,CAAC;oBACvB,WAAW,CAAC,eAAe,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;oBACpE,OAAO;gBACT,CAAC;YACH,CAAC;YACD,WAAW,CAAC,WAAW,CAAC,mBAAmB,CACzC,IAAI,uBAAuB,CAAC,kBAAkB,CAAC,CAChD,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,eAAe,GAAG,WAAW,CAAC,SAAS,CAC3C,wCAAwC,CACzC,CAAC;YACF,MAAM,IAAI,GAAG,IAAI,oBAAoB,CACnC,qBAAqB,CAAC,IAAI,EAC1B,WAAW,CAAC,SAAS,CAAC,8BAA8B,CAAC,EACrD,eAAe,EACf,iBAAiB,CAAC,KAAK,CACxB,CAAC;YACF,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,CAAC,OAAO,CACZ,WAAW,CAAC,cAAc,CAAC,yBAAyB,CAAC,EACrD,eAAe,CAChB,CAAC;QACJ,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 Frontstage\n */\n\nimport \"./ModalSettingsStage.scss\";\nimport * as React from \"react\";\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport {\n IModelApp,\n NotifyMessageDetails,\n OutputMessagePriority,\n OutputMessageType,\n} from \"@itwin/core-frontend\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Centered, SettingsContainer } from \"@itwin/core-react\";\nimport { SvgSettings } from \"@itwin/itwinui-icons-react\";\nimport type { ModalFrontstageInfo } from \"../framework/FrameworkFrontstages.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\nimport { StageUsage } from \"./StageUsage.js\";\nimport { BackstageItemUtilities } from \"../backstage/BackstageItemUtilities.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\n\nfunction ModalSettingsStage({\n initialSettingsTabId,\n}: {\n initialSettingsTabId?: string;\n}) {\n const { translate } = useTranslation();\n\n const id = UiFramework.frontstages.activeFrontstageDef?.id ?? \"none\";\n const stageUsage =\n UiFramework.frontstages.activeFrontstageDef?.usage ?? StageUsage.General;\n const tabEntries = UiFramework.settingsManager.getSettingEntries(\n id,\n stageUsage\n );\n\n const currentSettingsTab = React.useCallback(() => {\n const categoryToFind = initialSettingsTabId\n ? initialSettingsTabId.toLowerCase()\n : tabEntries[0].tabId.toLowerCase();\n let foundTab = tabEntries.find(\n (entry) => entry.tabId.toLowerCase() === categoryToFind\n );\n if (!foundTab)\n foundTab = tabEntries.find(\n (entry) => entry.label.toLowerCase() === categoryToFind\n );\n return foundTab;\n }, [initialSettingsTabId, tabEntries]);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onCloseModalFrontstageRequestedEvent.addListener(\n ({ modalFrontstage, stageCloseFunc }) => {\n if (\n modalFrontstage instanceof SettingsModalFrontstage &&\n stageCloseFunc\n ) {\n UiFramework.settingsManager.closeSettingsContainer(stageCloseFunc);\n }\n }\n );\n }, [tabEntries]);\n\n return (\n <div className=\"uifw-settings-container\">\n {tabEntries.length ? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <SettingsContainer\n tabs={tabEntries}\n currentSettingsTab={currentSettingsTab()}\n settingsManager={UiFramework.settingsManager}\n />\n ) : (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Centered>{translate(\"settings.noSettingsAvailable\")}</Centered>\n )}\n </div>\n );\n}\n\n/** Modal frontstage displaying and editing settings from registered settings providers. See [SettingsManager]($core-react)\n * and [SettingsContainer]($core-react).\n * @beta\n */\nexport class SettingsModalFrontstage implements ModalFrontstageInfo {\n public static id = \"appui-react.modalSettingsStage\";\n public title = UiFramework.translate(\"settings.settingsStageLabel\");\n constructor(public initialSettingsTabId?: string) {}\n public notifyCloseRequest = true;\n public get content(): React.ReactNode {\n return (\n <ModalSettingsStage initialSettingsTabId={this.initialSettingsTabId} />\n );\n }\n private static noSettingsAvailable = () =>\n new ConditionalBooleanValue(\n () => 0 === UiFramework.settingsManager.providers.length,\n [SyncUiEventId.SettingsProvidersChanged]\n );\n\n public static getBackstageActionItem(\n groupPriority: number,\n itemPriority: number\n ) {\n return BackstageItemUtilities.createActionItem({\n id: SettingsModalFrontstage.id,\n groupPriority,\n itemPriority,\n execute: () =>\n UiFramework.frontstages.openModalFrontstage(\n new SettingsModalFrontstage()\n ),\n label: UiFramework.translate(\"settings.settingsStageLabel\"),\n icon: <SvgSettings />,\n isHidden: SettingsModalFrontstage.noSettingsAvailable(),\n });\n }\n\n public static showSettingsStage(initialSettingsTab?: string) {\n if (UiFramework.settingsManager.providers.length) {\n // Check to see if it is already open\n if (\n UiFramework.frontstages.activeModalFrontstage &&\n UiFramework.frontstages.activeModalFrontstage instanceof\n SettingsModalFrontstage\n ) {\n if (initialSettingsTab) {\n UiFramework.settingsManager.activateSettingsTab(initialSettingsTab);\n return;\n }\n }\n UiFramework.frontstages.openModalFrontstage(\n new SettingsModalFrontstage(initialSettingsTab)\n );\n } else {\n const detailedMessage = UiFramework.translate(\n \"settings.noSettingsProvidersRegistered\"\n );\n const info = new NotifyMessageDetails(\n OutputMessagePriority.Info,\n UiFramework.translate(\"settings.noSettingsAvailable\"),\n detailedMessage,\n OutputMessageType.Toast\n );\n IModelApp.notifications.outputMessage(info);\n Logger.logInfo(\n UiFramework.loggerCategory(\"SettingsModalFrontstage\"),\n detailedMessage\n );\n }\n }\n}\n"]}
1
+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IAAI,WAAW,CAAC,eAAe,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACjD,qCAAqC;YACrC,IACE,WAAW,CAAC,WAAW,CAAC,qBAAqB;gBAC7C,WAAW,CAAC,WAAW,CAAC,qBAAqB;oBAC3C,uBAAuB,EACzB,CAAC;gBACD,IAAI,kBAAkB,EAAE,CAAC;oBACvB,WAAW,CAAC,eAAe,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;oBACpE,OAAO;gBACT,CAAC;YACH,CAAC;YACD,WAAW,CAAC,WAAW,CAAC,mBAAmB,CACzC,IAAI,uBAAuB,CAAC,kBAAkB,CAAC,CAChD,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,eAAe,GAAG,WAAW,CAAC,SAAS,CAC3C,wCAAwC,CACzC,CAAC;YACF,MAAM,IAAI,GAAG,IAAI,oBAAoB,CACnC,qBAAqB,CAAC,IAAI,EAC1B,WAAW,CAAC,SAAS,CAAC,8BAA8B,CAAC,EACrD,eAAe,EACf,iBAAiB,CAAC,KAAK,CACxB,CAAC;YACF,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,CAAC,OAAO,CACZ,WAAW,CAAC,cAAc,CAAC,yBAAyB,CAAC,EACrD,eAAe,CAChB,CAAC;QACJ,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 Frontstage\n */\n\nimport \"./ModalSettingsStage.scss\";\nimport * as React from \"react\";\nimport { ConditionalBooleanValue } from \"@itwin/appui-abstract\";\nimport {\n IModelApp,\n NotifyMessageDetails,\n OutputMessagePriority,\n OutputMessageType,\n} from \"@itwin/core-frontend\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { Centered, SettingsContainer } from \"@itwin/core-react\";\nimport { SvgSettings } from \"@itwin/itwinui-icons-react\";\nimport type { ModalFrontstageInfo } from \"../framework/FrameworkFrontstages.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { SyncUiEventId } from \"../syncui/UiSyncEvent.js\";\nimport { StageUsage } from \"./StageUsage.js\";\nimport { BackstageItemUtilities } from \"../backstage/BackstageItemUtilities.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\nfunction ModalSettingsStage({\n initialSettingsTabId,\n}: {\n initialSettingsTabId?: string;\n}) {\n const { translate } = useTranslation();\n\n const id = UiFramework.frontstages.activeFrontstageDef?.id ?? \"none\";\n const stageUsage =\n UiFramework.frontstages.activeFrontstageDef?.usage ?? StageUsage.General;\n const tabEntries = UiFramework.settingsManager.getSettingEntries(\n id,\n stageUsage\n );\n\n const currentSettingsTab = React.useCallback(() => {\n const categoryToFind = initialSettingsTabId\n ? initialSettingsTabId.toLowerCase()\n : tabEntries[0].tabId.toLowerCase();\n let foundTab = tabEntries.find(\n (entry) => entry.tabId.toLowerCase() === categoryToFind\n );\n if (!foundTab)\n foundTab = tabEntries.find(\n (entry) => entry.label.toLowerCase() === categoryToFind\n );\n return foundTab;\n }, [initialSettingsTabId, tabEntries]);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onCloseModalFrontstageRequestedEvent.addListener(\n ({ modalFrontstage, stageCloseFunc }) => {\n if (\n modalFrontstage instanceof SettingsModalFrontstage &&\n stageCloseFunc\n ) {\n UiFramework.settingsManager.closeSettingsContainer(stageCloseFunc);\n }\n }\n );\n }, [tabEntries]);\n\n return (\n <div className=\"uifw-settings-container\">\n {tabEntries.length ? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <SettingsContainer\n tabs={tabEntries}\n currentSettingsTab={currentSettingsTab()}\n settingsManager={UiFramework.settingsManager}\n />\n ) : (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Centered>{translate(\"settings.noSettingsAvailable\")}</Centered>\n )}\n </div>\n );\n}\n\n/** Modal frontstage displaying and editing settings from registered settings providers. See [SettingsManager]($core-react)\n * and [SettingsContainer]($core-react).\n * @beta\n */\nexport class SettingsModalFrontstage implements ModalFrontstageInfo {\n public static id = \"appui-react.modalSettingsStage\";\n public title = UiFramework.translate(\"settings.settingsStageLabel\");\n constructor(public initialSettingsTabId?: string) {}\n public notifyCloseRequest = true;\n public get content(): React.ReactNode {\n return (\n <ModalSettingsStage initialSettingsTabId={this.initialSettingsTabId} />\n );\n }\n private static noSettingsAvailable = () =>\n new ConditionalBooleanValue(\n () => 0 === UiFramework.settingsManager.providers.length,\n [SyncUiEventId.SettingsProvidersChanged]\n );\n\n public static getBackstageActionItem(\n groupPriority: number,\n itemPriority: number\n ) {\n return BackstageItemUtilities.createActionItem({\n id: SettingsModalFrontstage.id,\n groupPriority,\n itemPriority,\n execute: () =>\n UiFramework.frontstages.openModalFrontstage(\n new SettingsModalFrontstage()\n ),\n label: UiFramework.translate(\"settings.settingsStageLabel\"),\n icon: (\n <StrataKitIcon\n href={(importIcon) =>\n importIcon(\"@stratakit/icons/settings\").svgSettings\n }\n iconNode={<SvgSettings />}\n />\n ),\n isHidden: SettingsModalFrontstage.noSettingsAvailable(),\n });\n }\n\n public static showSettingsStage(initialSettingsTab?: string) {\n if (UiFramework.settingsManager.providers.length) {\n // Check to see if it is already open\n if (\n UiFramework.frontstages.activeModalFrontstage &&\n UiFramework.frontstages.activeModalFrontstage instanceof\n SettingsModalFrontstage\n ) {\n if (initialSettingsTab) {\n UiFramework.settingsManager.activateSettingsTab(initialSettingsTab);\n return;\n }\n }\n UiFramework.frontstages.openModalFrontstage(\n new SettingsModalFrontstage(initialSettingsTab)\n );\n } else {\n const detailedMessage = UiFramework.translate(\n \"settings.noSettingsProvidersRegistered\"\n );\n const info = new NotifyMessageDetails(\n OutputMessagePriority.Info,\n UiFramework.translate(\"settings.noSettingsAvailable\"),\n detailedMessage,\n OutputMessageType.Toast\n );\n IModelApp.notifications.outputMessage(info);\n Logger.logInfo(\n UiFramework.loggerCategory(\"SettingsModalFrontstage\"),\n detailedMessage\n );\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NestedFrontstage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI7D;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,sDAAsD;IACtD,WAAkB,+BAA+B,mBAUhD;CACF"}
1
+ {"version":3,"file":"NestedFrontstage.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstage.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,sDAAsD;IACtD,WAAkB,+BAA+B,mBAiBhD;CACF"}
@@ -9,6 +9,7 @@ import * as React from "react";
9
9
  import { SvgProgressBackwardCircular } from "@itwin/itwinui-icons-react";
10
10
  import { CommandItemDef } from "../shared/CommandItemDef.js";
11
11
  import { UiFramework } from "../UiFramework.js";
12
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
12
13
  /** Nested Frontstage related classes and commands
13
14
  * @public
14
15
  * @deprecated in 4.15.0. Use {@link NestedFrontstageAppButton} component instead.
@@ -19,7 +20,7 @@ export class NestedFrontstage {
19
20
  // eslint-disable-next-line @typescript-eslint/no-deprecated
20
21
  return new CommandItemDef({
21
22
  commandId: "backToPreviousFrontstage",
22
- iconSpec: React.createElement(SvgProgressBackwardCircular, null),
23
+ iconSpec: (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/chevron-left").svgChevronLeft, iconNode: React.createElement(SvgProgressBackwardCircular, null) })),
23
24
  labelKey: "UiFramework:commands.backToPreviousFrontstage",
24
25
  execute: async () => {
25
26
  await UiFramework.frontstages.closeNestedFrontstage();
@@ -1 +1 @@
1
- {"version":3,"file":"NestedFrontstage.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstage.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAC3B,sDAAsD;IAC/C,MAAM,KAAK,+BAA+B;QAC/C,4DAA4D;QAC5D,OAAO,IAAI,cAAc,CAAC;YACxB,SAAS,EAAE,0BAA0B;YACrC,QAAQ,EAAE,oBAAC,2BAA2B,OAAG;YACzC,QAAQ,EAAE,+CAA+C;YACzD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,WAAW,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;YACxD,CAAC;SACF,CAAC,CAAC;IACL,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 * as React from \"react\";\nimport { SvgProgressBackwardCircular } from \"@itwin/itwinui-icons-react\";\nimport { CommandItemDef } from \"../shared/CommandItemDef.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { NestedFrontstageAppButton } from \"./NestedFrontstageAppButton.js\";\n\n/** Nested Frontstage related classes and commands\n * @public\n * @deprecated in 4.15.0. Use {@link NestedFrontstageAppButton} component instead.\n */\nexport class NestedFrontstage {\n /** Command that returns to the previous Frontstage */\n public static get backToPreviousFrontstageCommand() {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return new CommandItemDef({\n commandId: \"backToPreviousFrontstage\",\n iconSpec: <SvgProgressBackwardCircular />,\n labelKey: \"UiFramework:commands.backToPreviousFrontstage\",\n execute: async () => {\n await UiFramework.frontstages.closeNestedFrontstage();\n },\n });\n }\n}\n"]}
1
+ {"version":3,"file":"NestedFrontstage.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstage.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAC3B,sDAAsD;IAC/C,MAAM,KAAK,+BAA+B;QAC/C,4DAA4D;QAC5D,OAAO,IAAI,cAAc,CAAC;YACxB,SAAS,EAAE,0BAA0B;YACrC,QAAQ,EAAE,CACR,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CACnB,UAAU,CAAC,+BAA+B,CAAC,CAAC,cAAc,EAE5D,QAAQ,EAAE,oBAAC,2BAA2B,OAAG,GACzC,CACH;YACD,QAAQ,EAAE,+CAA+C;YACzD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,MAAM,WAAW,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;YACxD,CAAC;SACF,CAAC,CAAC;IACL,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 * as React from \"react\";\nimport { SvgProgressBackwardCircular } from \"@itwin/itwinui-icons-react\";\nimport { CommandItemDef } from \"../shared/CommandItemDef.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { NestedFrontstageAppButton } from \"./NestedFrontstageAppButton.js\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\n/** Nested Frontstage related classes and commands\n * @public\n * @deprecated in 4.15.0. Use {@link NestedFrontstageAppButton} component instead.\n */\nexport class NestedFrontstage {\n /** Command that returns to the previous Frontstage */\n public static get backToPreviousFrontstageCommand() {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return new CommandItemDef({\n commandId: \"backToPreviousFrontstage\",\n iconSpec: (\n <StrataKitIcon\n href={(importIcon) =>\n importIcon(\"@stratakit/icons/chevron-left\").svgChevronLeft\n }\n iconNode={<SvgProgressBackwardCircular />}\n />\n ),\n labelKey: \"UiFramework:commands.backToPreviousFrontstage\",\n execute: async () => {\n await UiFramework.frontstages.closeNestedFrontstage();\n },\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NestedFrontstageAppButton.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstageAppButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,iEAAiE;AACjE,UAAU,8BAA8B;IACtC,+CAA+C;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,OAAO,GACR,EAAE,8BAA8B,qBAmBhC"}
1
+ {"version":3,"file":"NestedFrontstageAppButton.d.ts","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstageAppButton.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,iEAAiE;AACjE,UAAU,8BAA8B;IACtC,+CAA+C;IAC/C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,OAAO,GACR,EAAE,8BAA8B,qBA2BhC"}
@@ -10,13 +10,15 @@ import { SvgProgressBackwardCircular } from "@itwin/itwinui-icons-react";
10
10
  import { useTranslation } from "../hooks/useTranslation.js";
11
11
  import { UiFramework } from "../UiFramework.js";
12
12
  import { BackstageAppButton } from "../widgets/BackstageAppButton.js";
13
+ import { StrataKitIcon } from "../preview/use-stratakit/StrataKitIcon.js";
13
14
  /** App button used in a nested frontstage. By default closes the top-most nested frontstage.
14
15
  * @public
15
16
  */
16
17
  export function NestedFrontstageAppButton({ icon, label, onClick, }) {
18
+ const defaultIcon = (React.createElement(StrataKitIcon, { href: (importIcon) => importIcon("@stratakit/icons/chevron-left").svgChevronLeft, iconNode: React.createElement(SvgProgressBackwardCircular, null) }));
17
19
  const { translate } = useTranslation();
18
20
  label = label ?? translate("commands.backToPreviousFrontstage");
19
- icon = icon ?? React.createElement(SvgProgressBackwardCircular, null);
21
+ icon = icon ?? defaultIcon;
20
22
  return (React.createElement(BackstageAppButton, { label: label, iconNode: icon, execute: () => {
21
23
  if (onClick) {
22
24
  onClick();
@@ -1 +1 @@
1
- {"version":3,"file":"NestedFrontstageAppButton.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstageAppButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAYtE;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,OAAO,GACwB;IAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,KAAK,GAAG,KAAK,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;IAChE,IAAI,GAAG,IAAI,IAAI,oBAAC,2BAA2B,OAAG,CAAC;IAE/C,OAAO,CACL,oBAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,IAAI,EACd,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YAED,KAAK,WAAW,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;QACvD,CAAC,GACD,CACH,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 * as React from \"react\";\nimport { SvgProgressBackwardCircular } from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { BackstageAppButton } from \"../widgets/BackstageAppButton.js\";\n\n/** Properties of {@link NestedFrontstageAppButton} component. */\ninterface NestedFrontstageAppButtonProps {\n /** If specified overrides the default icon. */\n icon?: React.ReactNode;\n /** If specified overrides the default label. */\n label?: string;\n /** If specified overrides the default action that closes the nested frontstage. */\n onClick?: () => void;\n}\n\n/** App button used in a nested frontstage. By default closes the top-most nested frontstage.\n * @public\n */\nexport function NestedFrontstageAppButton({\n icon,\n label,\n onClick,\n}: NestedFrontstageAppButtonProps) {\n const { translate } = useTranslation();\n label = label ?? translate(\"commands.backToPreviousFrontstage\");\n icon = icon ?? <SvgProgressBackwardCircular />;\n\n return (\n <BackstageAppButton\n label={label}\n iconNode={icon}\n execute={() => {\n if (onClick) {\n onClick();\n return;\n }\n\n void UiFramework.frontstages.closeNestedFrontstage();\n }}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"NestedFrontstageAppButton.js","sourceRoot":"","sources":["../../../src/appui-react/frontstage/NestedFrontstageAppButton.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAY1E;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,OAAO,GACwB;IAC/B,MAAM,WAAW,GAAG,CAClB,oBAAC,aAAa,IACZ,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CACnB,UAAU,CAAC,+BAA+B,CAAC,CAAC,cAAc,EAE5D,QAAQ,EAAE,oBAAC,2BAA2B,OAAG,GACzC,CACH,CAAC;IAEF,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,KAAK,GAAG,KAAK,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;IAChE,IAAI,GAAG,IAAI,IAAI,WAAW,CAAC;IAC3B,OAAO,CACL,oBAAC,kBAAkB,IACjB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,IAAI,EACd,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,EAAE,CAAC;gBACV,OAAO;YACT,CAAC;YAED,KAAK,WAAW,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;QACvD,CAAC,GACD,CACH,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 * as React from \"react\";\nimport { SvgProgressBackwardCircular } from \"@itwin/itwinui-icons-react\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { BackstageAppButton } from \"../widgets/BackstageAppButton.js\";\nimport { StrataKitIcon } from \"../preview/use-stratakit/StrataKitIcon.js\";\n\n/** Properties of {@link NestedFrontstageAppButton} component. */\ninterface NestedFrontstageAppButtonProps {\n /** If specified overrides the default icon. */\n icon?: React.ReactNode;\n /** If specified overrides the default label. */\n label?: string;\n /** If specified overrides the default action that closes the nested frontstage. */\n onClick?: () => void;\n}\n\n/** App button used in a nested frontstage. By default closes the top-most nested frontstage.\n * @public\n */\nexport function NestedFrontstageAppButton({\n icon,\n label,\n onClick,\n}: NestedFrontstageAppButtonProps) {\n const defaultIcon = (\n <StrataKitIcon\n href={(importIcon) =>\n importIcon(\"@stratakit/icons/chevron-left\").svgChevronLeft\n }\n iconNode={<SvgProgressBackwardCircular />}\n />\n );\n\n const { translate } = useTranslation();\n label = label ?? translate(\"commands.backToPreviousFrontstage\");\n icon = icon ?? defaultIcon;\n return (\n <BackstageAppButton\n label={label}\n iconNode={icon}\n execute={() => {\n if (onClick) {\n onClick();\n return;\n }\n\n void UiFramework.frontstages.closeNestedFrontstage();\n }}\n />\n );\n}\n"]}
@@ -1 +1 @@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AC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChD,aAAa,EAAE,MAAM,EACrB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,SAAI,YAwDZ;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAC/B,eAAe,CAAC,EAAE,MAAM,GACvB;IACD,+BAA+B;IAC/B,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS;IACjC,yCAAyC;IACzC,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI;IAC/B,+CAA+C;IAC/C,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI;IACpC,kEAAkE;IAClE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI;IAC5C,mCAAmC;IACnC,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;CAC1B,CAuFA;AAED,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAOD,gBAAgB;AAChB,wBAAgB,oBAAoB,uCAEnC;AAeD,gBAAgB;AAChB,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EACnC,KAAK,EAAE,SAAS,MAAM,EAAE,WAUzB"}
@@ -92,14 +92,8 @@ export function DockedToolSettings(props) {
92
92
  return (React.createElement("div", { "data-toolsettings-provider": props.itemId, className: className, ref: refs, style: props.style },
93
93
  React.createElement(DockedToolSettingsHandle, { onResize: handleHandleResize }),
94
94
  dockedChildren.map(([key, child]) => {
95
- return (React.createElement(TransitionGroup, { appear: animateToolSettings, enter: animateToolSettings, key: key },
96
- React.createElement(CSSTransition, { in: animateToolSettings, timeout: 400, classNames: {
97
- appear: "toolsettings-appear",
98
- enter: "toolsettings-appear",
99
- appearActive: "toolsettings-appear-active",
100
- enterActive: "toolsettings-appear-active",
101
- } },
102
- React.createElement(DockedToolSettingsEntry, { key: key, entryKey: key, getOnResize: getOnEntryResize }, child))));
95
+ return (React.createElement(DockedToolSettingsEntryTransition, { animate: animateToolSettings, key: key },
96
+ React.createElement(DockedToolSettingsEntry, { key: key, entryKey: key, getOnResize: getOnEntryResize }, child)));
103
97
  }),
104
98
  (!overflown || overflown.length > 0) && (React.createElement(React.Fragment, null,
105
99
  React.createElement(DockedToolSettingsOverflow, { onClick: onOverflowClick, onResize: handleOverflowResize, ref: targetRef }),
@@ -108,6 +102,18 @@ export function DockedToolSettings(props) {
108
102
  return React.createElement(OverflowLabelAndEditor, { key: key, wrapper: child });
109
103
  }))))))));
110
104
  }
105
+ function DockedToolSettingsEntryTransition({ animate, children, }) {
106
+ // Without a `nodeRef`, `CSSTransition` falls back to `findDOMNode`, which React 19 removed.
107
+ const nodeRef = React.useRef(null);
108
+ return (React.createElement(TransitionGroup, { appear: animate, enter: animate, component: null },
109
+ React.createElement(CSSTransition, { nodeRef: nodeRef, in: animate, timeout: 400, classNames: {
110
+ appear: "toolsettings-appear",
111
+ enter: "toolsettings-appear",
112
+ appearActive: "toolsettings-appear-active",
113
+ enterActive: "toolsettings-appear-active",
114
+ } },
115
+ React.createElement("div", { ref: nodeRef }, children))));
116
+ }
111
117
  function DockedToolSettingsEntry({ children, entryKey, getOnResize, }) {
112
118
  const onResize = React.useMemo(() => getOnResize(entryKey), [getOnResize, entryKey]);
113
119
  const entry = React.useMemo(() => ({