@itwin/appui-react 5.15.2 → 5.17.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 (111) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/lib/appui-react/accudraw/AccuDrawFieldContainer.d.ts +0 -2
  3. package/lib/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
  4. package/lib/appui-react/accudraw/AccuDrawFieldContainer.js +9 -17
  5. package/lib/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  6. package/lib/appui-react/accudraw/AccuDrawKeyboardShortcuts.d.ts.map +1 -1
  7. package/lib/appui-react/accudraw/AccuDrawKeyboardShortcuts.js +19 -16
  8. package/lib/appui-react/accudraw/AccuDrawKeyboardShortcuts.js.map +1 -1
  9. package/lib/appui-react/accudraw/AccuDrawStore.d.ts +10 -0
  10. package/lib/appui-react/accudraw/AccuDrawStore.d.ts.map +1 -0
  11. package/lib/appui-react/accudraw/AccuDrawStore.js +11 -0
  12. package/lib/appui-react/accudraw/AccuDrawStore.js.map +1 -0
  13. package/lib/appui-react/accudraw/FrameworkAccuDraw.d.ts +1 -1
  14. package/lib/appui-react/accudraw/FrameworkAccuDraw.d.ts.map +1 -1
  15. package/lib/appui-react/accudraw/FrameworkAccuDraw.js +4 -1
  16. package/lib/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
  17. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts +1 -1
  18. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  19. package/lib/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  20. package/lib/appui-react/content/ContentGroup.js +1 -1
  21. package/lib/appui-react/content/ContentGroup.js.map +1 -1
  22. package/lib/appui-react/content/FloatingViewportContent.js +1 -1
  23. package/lib/appui-react/content/FloatingViewportContent.js.map +1 -1
  24. package/lib/appui-react/content/split-pane/Pane.d.ts +1 -1
  25. package/lib/appui-react/content/split-pane/Pane.d.ts.map +1 -1
  26. package/lib/appui-react/content/split-pane/Pane.js.map +1 -1
  27. package/lib/appui-react/content/split-pane/SplitPane.js +1 -1
  28. package/lib/appui-react/content/split-pane/SplitPane.js.map +1 -1
  29. package/lib/appui-react/core-icons.d.ts +8 -0
  30. package/lib/appui-react/core-icons.d.ts.map +1 -0
  31. package/lib/appui-react/core-icons.js +2 -0
  32. package/lib/appui-react/core-icons.js.map +1 -0
  33. package/lib/appui-react/cursor/cursormenu/CursorMenu.js +1 -1
  34. package/lib/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  35. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js +1 -1
  36. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
  37. package/lib/appui-react/dialog/UiDataProvidedDialog.js +2 -2
  38. package/lib/appui-react/dialog/UiDataProvidedDialog.js.map +1 -1
  39. package/lib/appui-react/framework/FrameworkFrontstages.d.ts +5 -0
  40. package/lib/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
  41. package/lib/appui-react/framework/FrameworkFrontstages.js.map +1 -1
  42. package/lib/appui-react/hooks/useLatestRef.d.ts +1 -1
  43. package/lib/appui-react/hooks/useLatestRef.d.ts.map +1 -1
  44. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.d.ts.map +1 -1
  45. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js +2 -3
  46. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
  47. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.d.ts.map +1 -1
  48. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js +1 -1
  49. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js.map +1 -1
  50. package/lib/appui-react/layout/StandardLayout.scss +0 -1
  51. package/lib/appui-react/layout/footer/tool-assistance/Instruction.scss +4 -0
  52. package/lib/appui-react/layout/tool-settings/Docked.js.map +1 -1
  53. package/lib/appui-react/layout/widget/Tab.js +2 -2
  54. package/lib/appui-react/layout/widget/Tab.js.map +1 -1
  55. package/lib/appui-react/layout/widget/TabBar.js +1 -1
  56. package/lib/appui-react/layout/widget/TabBar.js.map +1 -1
  57. package/lib/appui-react/layout/widget-panels/Grip.js +1 -1
  58. package/lib/appui-react/layout/widget-panels/Grip.js.map +1 -1
  59. package/lib/appui-react/layout/widget-panels/useAnimatePanel.d.ts +1 -1
  60. package/lib/appui-react/layout/widget-panels/useAnimatePanel.d.ts.map +1 -1
  61. package/lib/appui-react/layout/widget-panels/useAnimatePanel.js +3 -3
  62. package/lib/appui-react/layout/widget-panels/useAnimatePanel.js.map +1 -1
  63. package/lib/appui-react/messages/MessageRenderer.d.ts.map +1 -1
  64. package/lib/appui-react/messages/MessageRenderer.js +1 -1
  65. package/lib/appui-react/messages/MessageRenderer.js.map +1 -1
  66. package/lib/appui-react/pickers/ListPicker.d.ts.map +1 -1
  67. package/lib/appui-react/pickers/ListPicker.js +1 -1
  68. package/lib/appui-react/pickers/ListPicker.js.map +1 -1
  69. package/lib/appui-react/pickers/ListPicker.scss +10 -0
  70. package/lib/appui-react/settings/quantityformatting/QuantityFormat.d.ts.map +1 -1
  71. package/lib/appui-react/settings/quantityformatting/QuantityFormat.js +1 -1
  72. package/lib/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  73. package/lib/appui-react/statusbar/popup/Popup.js +1 -1
  74. package/lib/appui-react/statusbar/popup/Popup.js.map +1 -1
  75. package/lib/appui-react/statusbar/popup/StatusBarPopover.js +1 -1
  76. package/lib/appui-react/statusbar/popup/StatusBarPopover.js.map +1 -1
  77. package/lib/appui-react/statusfields/SnapMode.js +1 -1
  78. package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
  79. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +2 -0
  80. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  81. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +1 -1
  82. package/lib/appui-react/syncui/SyncUiEventDispatcher.d.ts.map +1 -1
  83. package/lib/appui-react/syncui/SyncUiEventDispatcher.js +6 -1
  84. package/lib/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  85. package/lib/appui-react/syncui/UiSyncEvent.d.ts +5 -1
  86. package/lib/appui-react/syncui/UiSyncEvent.d.ts.map +1 -1
  87. package/lib/appui-react/syncui/UiSyncEvent.js +5 -1
  88. package/lib/appui-react/syncui/UiSyncEvent.js.map +1 -1
  89. package/lib/appui-react/toolbar/new-toolbars/ToolGroup.js.map +1 -1
  90. package/lib/appui-react/toolbar/new-toolbars/useOverflow.js +2 -2
  91. package/lib/appui-react/toolbar/new-toolbars/useOverflow.js.map +1 -1
  92. package/lib/appui-react/tools/FrameworkToolAdmin.js +10 -2
  93. package/lib/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  94. package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  95. package/lib/appui-react/uiprovider/ComponentGenerator.d.ts.map +1 -1
  96. package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  97. package/lib/appui-react/widget-panels/ToolSettings.d.ts +1 -1
  98. package/lib/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  99. package/lib/appui-react/widget-panels/ToolSettings.js.map +1 -1
  100. package/lib/appui-react.d.ts +1 -0
  101. package/lib/appui-react.d.ts.map +1 -1
  102. package/lib/appui-react.js.map +1 -1
  103. package/lib/cjs/appui-react/layout/StandardLayout.scss +0 -1
  104. package/lib/cjs/appui-react/layout/footer/tool-assistance/Instruction.scss +4 -0
  105. package/lib/cjs/appui-react/pickers/ListPicker.scss +10 -0
  106. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +1 -1
  107. package/lib/esm/appui-react/layout/StandardLayout.scss +0 -1
  108. package/lib/esm/appui-react/layout/footer/tool-assistance/Instruction.scss +4 -0
  109. package/lib/esm/appui-react/pickers/ListPicker.scss +10 -0
  110. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +1 -1
  111. package/package.json +16 -16
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA+BrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E,gBAAgB;AAChB,eAAO,MAAM,qBAAqB;wBAGV,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;oBAChC,mBAAmB,CAAC,eAAe,CAAC;mBACrC,mBAAmB,CAAC,cAAc,CAAC;EAEjD,CAAC;AAEN;;;GAGG;AAEH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,kCAAkC;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oHAAoH;IACpH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8HAA8H;IAC9H,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sIAAsI;IACtI,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sHAAsH;IACtH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gHAAgH;IAChH,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAElC,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,4BAAkD,CAAC;AAE9E;;GAEG;AAEH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBAWtE;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,UAAU,mBAAmB;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE;QACb;;;;WAIG;QACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;KACxC,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA0FxD"}
1
+ {"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA+BrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E,gBAAgB;AAChB,eAAO,MAAM,qBAAqB;wBAGV,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;oBACvC,mBAAmB,CAAC,eAAe,CAAC;mBACrC,mBAAmB,CAAC,cAAc,CAAC;EAEjD,CAAC;AAEN;;;GAGG;AAEH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,kCAAkC;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oHAAoH;IACpH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4GAA4G;IAC5G,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8HAA8H;IAC9H,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sIAAsI;IACtI,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sHAAsH;IACtH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gHAAgH;IAChH,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAElC,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,4BAAkD,CAAC;AAE9E;;GAEG;AAEH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,qBAWtE;AAED,UAAU,oBAAoB;IAC5B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,kBAAkB,CAAC;CAC9B;AAED,UAAU,mBAAmB;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE;QACb;;;;WAIG;QACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;KACxC,CAAC;CACH;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA0FxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,C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9C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB,OAAO,WAAW,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,GAAG,EAAE;YACxE,MAAM,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,mBAAmB,CAAC;YAC/D,MAAM,YAAY,GAAG,UAAU,EAAE,YAAY,CAAC;YAC9C,IAAI,CAAC,YAAY;gBAAE,OAAO;YAC1B,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAmC;IACnE,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,oBAAC,wBAAwB,IAAC,gBAAgB,EAAE,MAAM,IAC/C,QAAQ,CACgB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ConfigurableUi\n */\n\nimport \"./ConfigurableUiContent.scss\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react/internal\";\nimport {\n IModelConnectionProvider,\n QuantityEditorSpec,\n} from \"@itwin/imodel-components-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport { CursorInformation } from \"../cursor/CursorInformation.js\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu.js\";\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager.js\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager.js\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager.js\";\nimport { ElementTooltip } from \"../feedback/ElementTooltip.js\";\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu.js\";\nimport { InputFieldMessage } from \"../messages/InputField.js\";\nimport { PointerMessage } from \"../messages/Pointer.js\";\nimport { PopupRenderer } from \"../popup/PopupManager.js\";\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage.js\";\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager.js\";\nimport { appUi, UiFramework } from \"../UiFramework.js\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager.js\";\nimport { MessageRenderer } from \"../messages/MessageRenderer.js\";\nimport {\n TOOLBAR_OPACITY_DEFAULT,\n WIDGET_OPACITY_DEFAULT,\n} from \"../theme/ThemeId.js\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport type { ContentProps } from \"../content/ContentGroup.js\";\nimport { ChildWindowRenderer } from \"../childwindow/ChildWindowRenderer.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport type { WidgetActions } from \"../layout/widget/WidgetActions.js\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection.js\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation.js\";\nimport type { Widget } from \"../widgets/Widget.js\";\nimport type { WidgetState } from \"../widgets/WidgetState.js\";\nimport { useActiveIModelConnection } from \"../hooks/useActiveIModelConnection.js\";\nimport { EditorsRegistryProvider } from \"@itwin/components-react\";\n\n/** @internal */\nexport const ConfigurableUiContext = React.createContext<\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n ConfigurableUiContentProps & {\n contentElementRef?: React.RefObject<HTMLElement>;\n widgetActions?: StandardLayoutProps[\"widgetActions\"];\n toolSettings?: StandardLayoutProps[\"toolSettings\"];\n }\n>({});\n\n/** Properties for [[ConfigurableUiContent]]\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof ConfigurableUiContent>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ConfigurableUiContentProps extends CommonProps {\n /** React node of the Backstage */\n appBackstage?: React.ReactNode;\n /** Controls if the view overlay should be displayed. Uses redux store as a fallback. Defaults to `true`.\n * @note Only used by configurable control APIs. See {@link ContentProps.classId}.\n * @deprecated in 4.16.0. View overlay visibility should be controlled by the components used in {@link ContentProps.content}.\n */\n viewOverlay?: boolean;\n /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */\n widgetOpacity?: number;\n /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n widgetIcon?: boolean;\n /** Controls if the unpinned panels should be collapsed automatically. Uses redux store as a fallback. Defaults to `false`. */\n collapsePanels?: boolean;\n /** Controls if the tool settings should be animated. Uses redux store as a fallback. Defaults to `false`. */\n animateToolSettings?: boolean;\n /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */\n toolAsToolSettingsLabel?: boolean;\n /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */\n toolbarOpacity?: number;\n /** Component to wrap all popout widgets and other child windows opened via {@link UiFramework.childWindows}. */\n childWindow?: React.ComponentType;\n\n /** @internal */\n idleTimeout?: number;\n /** @internal */\n intervalTimeout?: number;\n}\n\n/**\n * Allows children to get the bounds or other properties of the wrapper element.\n * @internal\n */\nexport const WrapperContext = React.createContext<HTMLElement>(document.body);\n\n/** The main component of `AppUI` that sets up the configurable UI.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\n const frontstageDef = useActiveFrontstageDef();\n const layout = frontstageDef?.initialConfig?.layout;\n return (\n <ConfigurableUiContext.Provider\n // eslint-disable-next-line react-hooks/exhaustive-deps\n value={React.useMemo(() => props, [...Object.values(props)])}\n >\n {layout ?? <StandardLayout />}\n </ConfigurableUiContext.Provider>\n );\n}\n\ninterface ToolSettingsLocation {\n section: StagePanelSection;\n location: StagePanelLocation;\n}\n\ninterface StandardLayoutProps {\n /** Overrides widget specific actions displayed in the title bar area.\n * Use {@link WidgetActions} component to customize widget actions.\n * @alpha\n */\n widgetActions?: React.ReactNode;\n /** When enabled keeps the tool settings visible to the end user.\n * This is especially useful when the tool settings is undocked as a regular widget.\n * @alpha\n */\n visibleToolSettings?: boolean;\n /** Tool settings related configuration.\n * @alpha\n */\n toolSettings?: {\n /** The default location of the tool settings. Only used when initializing the layout and ignored when restoring a saved layout.\n * When this is specified, the tool settings will be initialized as a widget, instead of the default docked state.\n * @note Use {@link Widget} for further configuration. I.e. set {@link Widget.defaultState} to {@link WidgetState.Floating} to initialize the tool settings as a floating widget.\n * @alpha\n */\n defaultLocation?: ToolSettingsLocation;\n };\n}\n\n/** The standard widget based layout used as a default layout for all frontstages.\n * @alpha\n */\nexport function StandardLayout(props: StandardLayoutProps) {\n const { widgetActions, visibleToolSettings = false, toolSettings } = props;\n const context = React.useContext(ConfigurableUiContext);\n const {\n appBackstage,\n widgetOpacity,\n toolbarOpacity,\n idleTimeout,\n intervalTimeout,\n } = context;\n\n const contentElementRef = React.useRef<HTMLElement>(null);\n useWidgetOpacity(widgetOpacity);\n useToolbarOpacity(toolbarOpacity);\n const [mainElement, setMainElement] = React.useState<HTMLElement>();\n const [portalContainer, setPortalContainer] = React.useState<HTMLElement>();\n React.useEffect(() => {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }, []);\n\n React.useEffect(() => {\n InternalConfigurableUiManager.activityTracker.initialize({\n idleTimeout,\n intervalTimeout,\n });\n return () => {\n InternalConfigurableUiManager.activityTracker.terminate();\n };\n }, [idleTimeout, intervalTimeout]);\n useVisibleToolSettings(visibleToolSettings);\n\n return (\n <ConfigurableUiContext.Provider\n value={React.useMemo(\n () => ({\n ...context,\n contentElementRef,\n widgetActions,\n toolSettings,\n }),\n [context, widgetActions, toolSettings]\n )}\n >\n <main\n role=\"main\"\n id=\"uifw-configurableui-wrapper\"\n className={context.className}\n style={context.style}\n onMouseMove={(e) => {\n const point = new Point(e.pageX, e.pageY);\n CursorInformation.handleMouseMove(point, e.view.document);\n }}\n ref={(el) => setMainElement(el ?? undefined)}\n >\n <WrapperContext.Provider value={mainElement ?? document.body}>\n <ThemeProvider\n style={{ height: \"100%\" }}\n portalContainer={portalContainer}\n >\n <IModelProvider>\n <EditorsRegistryProvider editors={defaultEditors}>\n {appBackstage}\n <WidgetPanelsFrontstage />\n\n <PointerMessage />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <KeyboardShortcutMenu />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <InputFieldMessage />\n <CursorPopupMenu />\n <CursorPopupRenderer />\n <PopupRenderer />\n <ElementTooltip />\n <MessageRenderer />\n <ChildWindowRenderer windowManager={appUi.windowManager} />\n <div\n className=\"uifw-configurableui-portalContainer\"\n ref={(instance) => setPortalContainer(instance ?? undefined)}\n >\n <ContentDialogRenderer />\n <ModelessDialogRenderer />\n <ModalDialogRenderer />\n </div>\n </EditorsRegistryProvider>\n </IModelProvider>\n </ThemeProvider>\n </WrapperContext.Provider>\n </main>\n </ConfigurableUiContext.Provider>\n );\n}\n\nconst defaultEditors = [QuantityEditorSpec];\n\nfunction useWidgetOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n widgetOpacity: ConfigurableUiContentProps[\"widgetOpacity\"]\n) {\n const reduxWidgetOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.widgetOpacity;\n });\n const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-widget-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useToolbarOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n toolbarOpacity: ConfigurableUiContentProps[\"toolbarOpacity\"]\n) {\n const reduxToolbarOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.toolbarOpacity;\n });\n\n const opacity =\n toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-toolbar-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useVisibleToolSettings(enabled: boolean) {\n React.useEffect(() => {\n if (!enabled) return;\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const frontstage = UiFramework.frontstages.activeFrontstageDef;\n const toolSettings = frontstage?.toolSettings;\n if (!toolSettings) return;\n toolSettings.show();\n });\n }, [enabled]);\n}\n\nfunction IModelProvider({ children }: React.PropsWithChildren<object>) {\n const imodel = useActiveIModelConnection();\n\n return (\n <IModelConnectionProvider iModelConnection={imodel}>\n {children}\n </IModelConnectionProvider>\n );\n}\n"]}
1
+ {"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,i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CAAC,mBAAmB,CAAC;YAC/D,MAAM,YAAY,GAAG,UAAU,EAAE,YAAY,CAAC;YAC9C,IAAI,CAAC,YAAY;gBAAE,OAAO;YAC1B,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAmC;IACnE,MAAM,MAAM,GAAG,yBAAyB,EAAE,CAAC;IAE3C,OAAO,CACL,oBAAC,wBAAwB,IAAC,gBAAgB,EAAE,MAAM,IAC/C,QAAQ,CACgB,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ConfigurableUi\n */\n\nimport \"./ConfigurableUiContent.scss\";\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { Point } from \"@itwin/core-react/internal\";\nimport {\n IModelConnectionProvider,\n QuantityEditorSpec,\n} from \"@itwin/imodel-components-react\";\nimport { ThemeProvider } from \"@itwin/itwinui-react\";\nimport { CursorInformation } from \"../cursor/CursorInformation.js\";\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu.js\";\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager.js\";\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager.js\";\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager.js\";\nimport { ElementTooltip } from \"../feedback/ElementTooltip.js\";\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu.js\";\nimport { InputFieldMessage } from \"../messages/InputField.js\";\nimport { PointerMessage } from \"../messages/Pointer.js\";\nimport { PopupRenderer } from \"../popup/PopupManager.js\";\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage.js\";\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager.js\";\nimport { appUi, UiFramework } from \"../UiFramework.js\";\nimport { InternalConfigurableUiManager } from \"./InternalConfigurableUiManager.js\";\nimport { MessageRenderer } from \"../messages/MessageRenderer.js\";\nimport {\n TOOLBAR_OPACITY_DEFAULT,\n WIDGET_OPACITY_DEFAULT,\n} from \"../theme/ThemeId.js\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport type { ContentProps } from \"../content/ContentGroup.js\";\nimport { ChildWindowRenderer } from \"../childwindow/ChildWindowRenderer.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport type { WidgetActions } from \"../layout/widget/WidgetActions.js\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection.js\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation.js\";\nimport type { Widget } from \"../widgets/Widget.js\";\nimport type { WidgetState } from \"../widgets/WidgetState.js\";\nimport { useActiveIModelConnection } from \"../hooks/useActiveIModelConnection.js\";\nimport { EditorsRegistryProvider } from \"@itwin/components-react\";\n\n/** @internal */\nexport const ConfigurableUiContext = React.createContext<\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n ConfigurableUiContentProps & {\n contentElementRef?: React.RefObject<HTMLElement | null>;\n widgetActions?: StandardLayoutProps[\"widgetActions\"];\n toolSettings?: StandardLayoutProps[\"toolSettings\"];\n }\n>({});\n\n/** Properties for [[ConfigurableUiContent]]\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof ConfigurableUiContent>`\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ConfigurableUiContentProps extends CommonProps {\n /** React node of the Backstage */\n appBackstage?: React.ReactNode;\n /** Controls if the view overlay should be displayed. Uses redux store as a fallback. Defaults to `true`.\n * @note Only used by configurable control APIs. See {@link ContentProps.classId}.\n * @deprecated in 4.16.0. View overlay visibility should be controlled by the components used in {@link ContentProps.content}.\n */\n viewOverlay?: boolean;\n /** Describes the opacity of widgets. Uses redux store as a fallback. Defaults to {@link WIDGET_OPACITY_DEFAULT}. */\n widgetOpacity?: number;\n /** Controls if the widget icons should be displayed. Uses redux store as a fallback. Defaults to `true`. */\n widgetIcon?: boolean;\n /** Controls if the unpinned panels should be collapsed automatically. Uses redux store as a fallback. Defaults to `false`. */\n collapsePanels?: boolean;\n /** Controls if the tool settings should be animated. Uses redux store as a fallback. Defaults to `false`. */\n animateToolSettings?: boolean;\n /** Controls if the tool settings label should be set based on activated tool. Uses redux store as a fallback. Defaults to `false`. */\n toolAsToolSettingsLabel?: boolean;\n /** Describes the opacity of toolbars. Uses redux store as a fallback. Defaults to {@link TOOLBAR_OPACITY_DEFAULT}. */\n toolbarOpacity?: number;\n /** Component to wrap all popout widgets and other child windows opened via {@link UiFramework.childWindows}. */\n childWindow?: React.ComponentType;\n\n /** @internal */\n idleTimeout?: number;\n /** @internal */\n intervalTimeout?: number;\n}\n\n/**\n * Allows children to get the bounds or other properties of the wrapper element.\n * @internal\n */\nexport const WrapperContext = React.createContext<HTMLElement>(document.body);\n\n/** The main component of `AppUI` that sets up the configurable UI.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\n const frontstageDef = useActiveFrontstageDef();\n const layout = frontstageDef?.initialConfig?.layout;\n return (\n <ConfigurableUiContext.Provider\n // eslint-disable-next-line react-hooks/exhaustive-deps\n value={React.useMemo(() => props, [...Object.values(props)])}\n >\n {layout ?? <StandardLayout />}\n </ConfigurableUiContext.Provider>\n );\n}\n\ninterface ToolSettingsLocation {\n section: StagePanelSection;\n location: StagePanelLocation;\n}\n\ninterface StandardLayoutProps {\n /** Overrides widget specific actions displayed in the title bar area.\n * Use {@link WidgetActions} component to customize widget actions.\n * @alpha\n */\n widgetActions?: React.ReactNode;\n /** When enabled keeps the tool settings visible to the end user.\n * This is especially useful when the tool settings is undocked as a regular widget.\n * @alpha\n */\n visibleToolSettings?: boolean;\n /** Tool settings related configuration.\n * @alpha\n */\n toolSettings?: {\n /** The default location of the tool settings. Only used when initializing the layout and ignored when restoring a saved layout.\n * When this is specified, the tool settings will be initialized as a widget, instead of the default docked state.\n * @note Use {@link Widget} for further configuration. I.e. set {@link Widget.defaultState} to {@link WidgetState.Floating} to initialize the tool settings as a floating widget.\n * @alpha\n */\n defaultLocation?: ToolSettingsLocation;\n };\n}\n\n/** The standard widget based layout used as a default layout for all frontstages.\n * @alpha\n */\nexport function StandardLayout(props: StandardLayoutProps) {\n const { widgetActions, visibleToolSettings = false, toolSettings } = props;\n const context = React.useContext(ConfigurableUiContext);\n const {\n appBackstage,\n widgetOpacity,\n toolbarOpacity,\n idleTimeout,\n intervalTimeout,\n } = context;\n\n const contentElementRef = React.useRef<HTMLElement>(null);\n useWidgetOpacity(widgetOpacity);\n useToolbarOpacity(toolbarOpacity);\n const [mainElement, setMainElement] = React.useState<HTMLElement>();\n const [portalContainer, setPortalContainer] = React.useState<HTMLElement>();\n React.useEffect(() => {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }, []);\n\n React.useEffect(() => {\n InternalConfigurableUiManager.activityTracker.initialize({\n idleTimeout,\n intervalTimeout,\n });\n return () => {\n InternalConfigurableUiManager.activityTracker.terminate();\n };\n }, [idleTimeout, intervalTimeout]);\n useVisibleToolSettings(visibleToolSettings);\n\n return (\n <ConfigurableUiContext.Provider\n value={React.useMemo(\n () => ({\n ...context,\n contentElementRef,\n widgetActions,\n toolSettings,\n }),\n [context, widgetActions, toolSettings]\n )}\n >\n <main\n role=\"main\"\n id=\"uifw-configurableui-wrapper\"\n className={context.className}\n style={context.style}\n onMouseMove={(e) => {\n const point = new Point(e.pageX, e.pageY);\n CursorInformation.handleMouseMove(point, e.view.document);\n }}\n ref={(el) => setMainElement(el ?? undefined)}\n >\n <WrapperContext.Provider value={mainElement ?? document.body}>\n <ThemeProvider\n style={{ height: \"100%\" }}\n portalContainer={portalContainer}\n >\n <IModelProvider>\n <EditorsRegistryProvider editors={defaultEditors}>\n {appBackstage}\n <WidgetPanelsFrontstage />\n\n <PointerMessage />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <KeyboardShortcutMenu />\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <InputFieldMessage />\n <CursorPopupMenu />\n <CursorPopupRenderer />\n <PopupRenderer />\n <ElementTooltip />\n <MessageRenderer />\n <ChildWindowRenderer windowManager={appUi.windowManager} />\n <div\n className=\"uifw-configurableui-portalContainer\"\n ref={(instance) => setPortalContainer(instance ?? undefined)}\n >\n <ContentDialogRenderer />\n <ModelessDialogRenderer />\n <ModalDialogRenderer />\n </div>\n </EditorsRegistryProvider>\n </IModelProvider>\n </ThemeProvider>\n </WrapperContext.Provider>\n </main>\n </ConfigurableUiContext.Provider>\n );\n}\n\nconst defaultEditors = [QuantityEditorSpec];\n\nfunction useWidgetOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n widgetOpacity: ConfigurableUiContentProps[\"widgetOpacity\"]\n) {\n const reduxWidgetOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.widgetOpacity;\n });\n const opacity = widgetOpacity ?? reduxWidgetOpacity ?? WIDGET_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentWidgetOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-widget-opacity\");\n if (currentWidgetOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-widget-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-widget-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useToolbarOpacity(\n /* eslint-disable-next-line @typescript-eslint/no-deprecated */\n toolbarOpacity: ConfigurableUiContentProps[\"toolbarOpacity\"]\n) {\n const reduxToolbarOpacity = useReduxFrameworkState((state) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return state?.configurableUiState.toolbarOpacity;\n });\n\n const opacity =\n toolbarOpacity ?? reduxToolbarOpacity ?? TOOLBAR_OPACITY_DEFAULT;\n\n React.useEffect(() => {\n const currentToolbarOpacity =\n document.documentElement.style.getPropertyValue(\"--buic-toolbar-opacity\");\n if (currentToolbarOpacity === opacity.toString()) return;\n document.documentElement.style.setProperty(\n \"--buic-toolbar-opacity\",\n opacity.toString()\n );\n return () => {\n document.documentElement.style.removeProperty(\"--buic-toolbar-opacity\");\n };\n }, [opacity]);\n}\n\nfunction useVisibleToolSettings(enabled: boolean) {\n React.useEffect(() => {\n if (!enabled) return;\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const frontstage = UiFramework.frontstages.activeFrontstageDef;\n const toolSettings = frontstage?.toolSettings;\n if (!toolSettings) return;\n toolSettings.show();\n });\n }, [enabled]);\n}\n\nfunction IModelProvider({ children }: React.PropsWithChildren<object>) {\n const imodel = useActiveIModelConnection();\n\n return (\n <IModelConnectionProvider iModelConnection={imodel}>\n {children}\n </IModelConnectionProvider>\n );\n}\n"]}
@@ -167,7 +167,7 @@ export class ContentGroup {
167
167
  */
168
168
  getControlFromElement(node) {
169
169
  if (this._contentSetMap.size === 0)
170
- this.getContentNodes();
170
+ void this.getContentNodes();
171
171
  if (node && node.key) {
172
172
  const key = node.key;
173
173
  // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id
@@ -1 +1 @@
1
- {"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAyCnG;;;GAGG;AACH,MAA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;YAClD,MAAM,GAAG,GAAI,IAAgC,CAAC,GAAa,CAAC;YAC5D,oFAAoF;YACpF,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,kBAAkB;QACvB,MAAM,eAAe,GAAqB,IAAI,KAAK,EAAkB,CAAC;QAEtE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;YACpD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,OAAO;gBAAE,OAAO;YAErB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,CAAC;;AAtNc,iBAAI,GAAG,CAAC,AAAJ,CAAK","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport type { ConfigurableUiControlConstructor } from \"../configurableui/ConfigurableUiControl.js\";\nimport {\n ConfigurableCreateInfo,\n ConfigurableUiControlType,\n} from \"../configurableui/ConfigurableUiControl.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { ContentControl } from \"./ContentControl.js\";\nimport { InternalConfigurableUiManager } from \"../configurableui/InternalConfigurableUiManager.js\";\nimport type { Frontstage } from \"../frontstage/Frontstage.js\";\nimport type { ContentLayoutProps } from \"./ContentLayoutProps.js\";\nimport type { ConditionalValue } from \"../shared/ConditionalValue.js\";\n\n/** Properties for content displayed in a content view\n * @public\n */\nexport interface ContentProps {\n /** A unique id for the Content View within the group. */\n id: string;\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead and specify an empty string for this property. This will be made optional in 5.0.0.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n classId: string | ConfigurableUiControlConstructor;\n /** Optional application data passed down to the content view.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead.\n */\n applicationData?: any;\n /** Content to be displayed in the content view. */\n content?: React.ReactNode;\n /** Describes if the content should display the active strip.\n * If `undefined` the strip will be displayed only if this content is active and multiple contents are available.\n * Floating content controls (deprecated API) and `ContentOverlay` components are considered as content nodes.\n */\n renderActiveStrip?: boolean | ConditionalValue<boolean | undefined>;\n}\n\n/** Properties for a [[ContentGroup]]\n * @public\n */\nexport interface ContentGroupProps {\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\n id: string;\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\n layout: ContentLayoutProps;\n /** A collection of [[ContentProps]], one for each content view */\n contents: ContentProps[];\n}\n\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\n * content group just prior to activating the frontstage.\n * @public\n */\nexport abstract class ContentGroupProvider {\n /** Return the contentGroup based on the `Frontstage`. */\n public abstract contentGroup(frontstage: Frontstage): Promise<ContentGroup>;\n\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\n * be to remove applicationData entries.\n */\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\n * Typically this may be to add applicationData to content entries.\n */\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to save any content group data before the stage deactivated. */\n public async onFrontstageDeactivated() {}\n}\n\n/** Callback to process content properties during toJSON method\n * @public\n */\nexport type ContentCallback = (content: ContentProps) => void;\n\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\n * @public\n */\nexport class ContentGroup {\n private static _sId = 0;\n public groupId: string;\n public propsId: string;\n public layout: ContentLayoutProps;\n public contentPropsList: ContentProps[];\n\n public get id() {\n return this.groupId;\n }\n\n constructor(contentGroupProps: ContentGroupProps) {\n this.layout = { ...contentGroupProps.layout };\n this.propsId = contentGroupProps.id;\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\n this.contentPropsList = contentGroupProps.contents;\n }\n\n /** Gets the React nodes representing the content views in this content group.\n * @deprecated in 4.16.0. Use {@link ContentGroup.contentPropsList} instead.\n */\n public getContentNodes(): React.ReactNode[] {\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\n\n this._contentSetMap.clear();\n\n this.contentPropsList.forEach((contentProps, index) => {\n if (contentProps.content) {\n contentNodes.push(contentProps.content);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentNodes.push(control.reactNode);\n this._contentSetMap.set(control.controlId, control);\n });\n\n return contentNodes;\n }\n\n /** Refreshes the React nodes representing the Content Views in this Content Group. */\n public refreshContentNodes() {\n this._contentSetMap.clear();\n }\n\n /** Called when Frontstage is deactivated. */\n public onFrontstageDeactivated(): void {\n this.clearContentControls();\n }\n\n /** Called when Frontstage is ready. */\n public onFrontstageReady(): void {}\n\n /** Clears the map of content controls. */\n public clearContentControls(): void {\n this._contentControls.clear();\n }\n\n /** Creates [[ContentGroupProps]] for JSON purposes.\n * @public\n */\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\n const contentGroupProps: ContentGroupProps = {\n id: this.propsId,\n layout: this.layout,\n contents: this.contentPropsList,\n };\n\n contentGroupProps.contents.forEach((content, index) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (typeof content.classId !== \"string\") {\n const classId = InternalConfigurableUiManager.getConstructorClassId(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n content.classId\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (classId !== undefined) content.classId = classId;\n else\n throw new UiError( // eslint-disable-line @typescript-eslint/no-deprecated\n UiFramework.loggerCategory(\"ContentGroup\"),\n `toJSON: ContentControl at index ${index} is NOT registered with a string id`\n );\n\n if (typeof contentCallback === \"function\") contentCallback(content);\n }\n });\n\n return contentGroupProps;\n }\n\n /** Gets Viewports from Viewport Content Controls.\n * @internal\n */\n public getViewports(): Array<ScreenViewport | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentControls = this.getContentControls();\n const viewports = new Array<ScreenViewport | undefined>();\n\n contentControls.forEach((control) => {\n if (control.isViewport && control.viewport) {\n viewports.push(control.viewport);\n } else {\n viewports.push(undefined);\n }\n });\n\n return viewports;\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n\n private _contentControls = new Map<string, ContentControl>();\n private _contentSetMap = new Map<string, ContentControl>();\n\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]].\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControl(\n contentProps: ContentProps,\n _index: number\n ): ContentControl | undefined {\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\n const id = `${contentProps.id}::${this.groupId}`;\n let contentControl: ContentControl | undefined;\n\n if (!this._contentControls.get(contentProps.id)) {\n let usedClassId: string = \"\";\n\n if (typeof contentProps.classId === \"string\") {\n if (\n !this._contentControls.get(contentProps.id) &&\n UiFramework.controls.isRegistered(contentProps.classId)\n ) {\n contentControl = UiFramework.controls.create(\n contentProps.classId,\n id,\n contentProps.applicationData,\n contentProps.id\n ) as ContentControl;\n usedClassId = contentProps.classId;\n }\n } else {\n const info = new ConfigurableCreateInfo(\n contentProps.classId.name,\n id,\n contentProps.id\n );\n contentControl = new contentProps.classId(\n info,\n contentProps.applicationData\n ) as ContentControl;\n usedClassId = contentProps.classId.name;\n }\n\n if (contentControl) {\n if (\n contentControl.getType() !== ConfigurableUiControlType.Content &&\n contentControl.getType() !== ConfigurableUiControlType.Viewport\n ) {\n throw new UiError(\n UiFramework.loggerCategory(\"ContentGroup\"),\n `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`\n );\n }\n contentControl.initialize();\n this._contentControls.set(contentProps.id, contentControl);\n }\n }\n\n return this._contentControls.get(contentProps.id);\n }\n\n /** Gets a [[ContentControl]] from the Content Group with a given ID.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControlById(id: string): ContentControl | undefined {\n return this._contentControls.get(id);\n }\n\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getControlFromElement(\n node: React.ReactNode\n ): ContentControl | undefined {\n if (this._contentSetMap.size === 0) this.getContentNodes();\n\n if (node && (node as React.ReactElement<any>).key) {\n const key = (node as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n const controlId = key.split(\"::\", 1)[0];\n return this._contentSetMap.get(controlId);\n }\n\n return undefined;\n }\n\n /** Gets an array of the content controls representing the Content Views.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControls(): ContentControl[] {\n const contentControls: ContentControl[] = new Array<ContentControl>();\n\n this.contentPropsList.forEach((contentProps, index) => {\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentControls.push(control);\n });\n\n return contentControls;\n }\n\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n"]}
1
+ {"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAAA;;;gG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U;QACrC,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,qBAAqB,CAC1B,IAAqB;QAErB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;YAAE,KAAK,IAAI,CAAC,eAAe,EAAE,CAAC;QAEhE,IAAI,IAAI,IAAK,IAAgC,CAAC,GAAG,EAAE,CAAC;YAClD,MAAM,GAAG,GAAI,IAAgC,CAAC,GAAa,CAAC;YAC5D,oFAAoF;YACpF,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,kBAAkB;QACvB,MAAM,eAAe,GAAqB,IAAI,KAAK,EAAkB,CAAC;QAEtE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;YACpD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,OAAO;gBAAE,OAAO;YAErB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,CAAC;;AAtNc,iBAAI,GAAG,CAAC,AAAJ,CAAK","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport type { ConfigurableUiControlConstructor } from \"../configurableui/ConfigurableUiControl.js\";\nimport {\n ConfigurableCreateInfo,\n ConfigurableUiControlType,\n} from \"../configurableui/ConfigurableUiControl.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { ContentControl } from \"./ContentControl.js\";\nimport { InternalConfigurableUiManager } from \"../configurableui/InternalConfigurableUiManager.js\";\nimport type { Frontstage } from \"../frontstage/Frontstage.js\";\nimport type { ContentLayoutProps } from \"./ContentLayoutProps.js\";\nimport type { ConditionalValue } from \"../shared/ConditionalValue.js\";\n\n/** Properties for content displayed in a content view\n * @public\n */\nexport interface ContentProps {\n /** A unique id for the Content View within the group. */\n id: string;\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead and specify an empty string for this property. This will be made optional in 5.0.0.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n classId: string | ConfigurableUiControlConstructor;\n /** Optional application data passed down to the content view.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead.\n */\n applicationData?: any;\n /** Content to be displayed in the content view. */\n content?: React.ReactNode;\n /** Describes if the content should display the active strip.\n * If `undefined` the strip will be displayed only if this content is active and multiple contents are available.\n * Floating content controls (deprecated API) and `ContentOverlay` components are considered as content nodes.\n */\n renderActiveStrip?: boolean | ConditionalValue<boolean | undefined>;\n}\n\n/** Properties for a [[ContentGroup]]\n * @public\n */\nexport interface ContentGroupProps {\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\n id: string;\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\n layout: ContentLayoutProps;\n /** A collection of [[ContentProps]], one for each content view */\n contents: ContentProps[];\n}\n\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\n * content group just prior to activating the frontstage.\n * @public\n */\nexport abstract class ContentGroupProvider {\n /** Return the contentGroup based on the `Frontstage`. */\n public abstract contentGroup(frontstage: Frontstage): Promise<ContentGroup>;\n\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\n * be to remove applicationData entries.\n */\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\n * Typically this may be to add applicationData to content entries.\n */\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to save any content group data before the stage deactivated. */\n public async onFrontstageDeactivated() {}\n}\n\n/** Callback to process content properties during toJSON method\n * @public\n */\nexport type ContentCallback = (content: ContentProps) => void;\n\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\n * @public\n */\nexport class ContentGroup {\n private static _sId = 0;\n public groupId: string;\n public propsId: string;\n public layout: ContentLayoutProps;\n public contentPropsList: ContentProps[];\n\n public get id() {\n return this.groupId;\n }\n\n constructor(contentGroupProps: ContentGroupProps) {\n this.layout = { ...contentGroupProps.layout };\n this.propsId = contentGroupProps.id;\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\n this.contentPropsList = contentGroupProps.contents;\n }\n\n /** Gets the React nodes representing the content views in this content group.\n * @deprecated in 4.16.0. Use {@link ContentGroup.contentPropsList} instead.\n */\n public getContentNodes(): React.ReactNode[] {\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\n\n this._contentSetMap.clear();\n\n this.contentPropsList.forEach((contentProps, index) => {\n if (contentProps.content) {\n contentNodes.push(contentProps.content);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentNodes.push(control.reactNode);\n this._contentSetMap.set(control.controlId, control);\n });\n\n return contentNodes;\n }\n\n /** Refreshes the React nodes representing the Content Views in this Content Group. */\n public refreshContentNodes() {\n this._contentSetMap.clear();\n }\n\n /** Called when Frontstage is deactivated. */\n public onFrontstageDeactivated(): void {\n this.clearContentControls();\n }\n\n /** Called when Frontstage is ready. */\n public onFrontstageReady(): void {}\n\n /** Clears the map of content controls. */\n public clearContentControls(): void {\n this._contentControls.clear();\n }\n\n /** Creates [[ContentGroupProps]] for JSON purposes.\n * @public\n */\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\n const contentGroupProps: ContentGroupProps = {\n id: this.propsId,\n layout: this.layout,\n contents: this.contentPropsList,\n };\n\n contentGroupProps.contents.forEach((content, index) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (typeof content.classId !== \"string\") {\n const classId = InternalConfigurableUiManager.getConstructorClassId(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n content.classId\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (classId !== undefined) content.classId = classId;\n else\n throw new UiError( // eslint-disable-line @typescript-eslint/no-deprecated\n UiFramework.loggerCategory(\"ContentGroup\"),\n `toJSON: ContentControl at index ${index} is NOT registered with a string id`\n );\n\n if (typeof contentCallback === \"function\") contentCallback(content);\n }\n });\n\n return contentGroupProps;\n }\n\n /** Gets Viewports from Viewport Content Controls.\n * @internal\n */\n public getViewports(): Array<ScreenViewport | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentControls = this.getContentControls();\n const viewports = new Array<ScreenViewport | undefined>();\n\n contentControls.forEach((control) => {\n if (control.isViewport && control.viewport) {\n viewports.push(control.viewport);\n } else {\n viewports.push(undefined);\n }\n });\n\n return viewports;\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n\n private _contentControls = new Map<string, ContentControl>();\n private _contentSetMap = new Map<string, ContentControl>();\n\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]].\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControl(\n contentProps: ContentProps,\n _index: number\n ): ContentControl | undefined {\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\n const id = `${contentProps.id}::${this.groupId}`;\n let contentControl: ContentControl | undefined;\n\n if (!this._contentControls.get(contentProps.id)) {\n let usedClassId: string = \"\";\n\n if (typeof contentProps.classId === \"string\") {\n if (\n !this._contentControls.get(contentProps.id) &&\n UiFramework.controls.isRegistered(contentProps.classId)\n ) {\n contentControl = UiFramework.controls.create(\n contentProps.classId,\n id,\n contentProps.applicationData,\n contentProps.id\n ) as ContentControl;\n usedClassId = contentProps.classId;\n }\n } else {\n const info = new ConfigurableCreateInfo(\n contentProps.classId.name,\n id,\n contentProps.id\n );\n contentControl = new contentProps.classId(\n info,\n contentProps.applicationData\n ) as ContentControl;\n usedClassId = contentProps.classId.name;\n }\n\n if (contentControl) {\n if (\n contentControl.getType() !== ConfigurableUiControlType.Content &&\n contentControl.getType() !== ConfigurableUiControlType.Viewport\n ) {\n throw new UiError(\n UiFramework.loggerCategory(\"ContentGroup\"),\n `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`\n );\n }\n contentControl.initialize();\n this._contentControls.set(contentProps.id, contentControl);\n }\n }\n\n return this._contentControls.get(contentProps.id);\n }\n\n /** Gets a [[ContentControl]] from the Content Group with a given ID.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControlById(id: string): ContentControl | undefined {\n return this._contentControls.get(id);\n }\n\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getControlFromElement(\n node: React.ReactNode\n ): ContentControl | undefined {\n if (this._contentSetMap.size === 0) void this.getContentNodes();\n\n if (node && (node as React.ReactElement<any>).key) {\n const key = (node as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n const controlId = key.split(\"::\", 1)[0];\n return this._contentSetMap.get(controlId);\n }\n\n return undefined;\n }\n\n /** Gets an array of the content controls representing the Content Views.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControls(): ContentControl[] {\n const contentControls: ContentControl[] = new Array<ContentControl>();\n\n this.contentPropsList.forEach((contentProps, index) => {\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentControls.push(control);\n });\n\n return contentControls;\n }\n\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n"]}
@@ -35,7 +35,7 @@ export function FloatingViewportContentWrapper({ children, }) {
35
35
  export function useFloatingViewport(args) {
36
36
  const { contentId, initialViewState, onContextMenu, viewportRef } = args;
37
37
  const [viewport, setViewport] = React.useState();
38
- const contentControl = React.useRef();
38
+ const contentControl = React.useRef(undefined);
39
39
  const viewState = React.useMemo(() => typeof initialViewState === "function"
40
40
  ? initialViewState()
41
41
  : initialViewState, [initialViewState]);
@@ -1 +1 @@
1
- {"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAoBrD;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,CACL,oBAAC,8BAA8B,QAC5B,eAAe,CACe,CAClC,CAAC;AACJ,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,QAAQ,GAC4B;IACpC,OAAO,CACL,6BACE,SAAS,EAA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C,4DAA4D;gBAC5D,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACvE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;YACrC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,eAAe;KAChB,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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FloatingViewportContentControl } from \"./ViewportContentControl.js\";\nimport { ContentWrapper } from \"./ContentLayout.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useRefs } from \"@itwin/core-react/internal\";\nimport type { ContentOverlay } from \"./ContentOverlay.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * @beta\n * @deprecated in 4.16.0. Props of deprecated component {@link FloatingViewportContent}.\n */\nexport interface FloatingViewportContentProps {\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** viewport/content control uniqueId */\n contentId: string;\n /** The initial view state used to create the viewport, or a function that returns it (will refresh when the function changes) */\n initialViewState: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: React.Ref<ScreenViewport>;\n}\n\n/**\n * @beta\n * @deprecated in 4.16.0. Wrap {@link @itwin/imodel-components-react#ViewportComponent} component with a {@link ContentOverlay} instead.\n */\nexport function FloatingViewportContent(props: FloatingViewportContentProps) {\n const { viewportControl } = useFloatingViewport(props);\n return (\n <FloatingViewportContentWrapper>\n {viewportControl}\n </FloatingViewportContentWrapper>\n );\n}\n\n/**\n * @public\n * @deprecated in 4.16.0. Props of deprecated component {@link FloatingViewportContentWrapper}.\n */\nexport interface FloatingViewportContentWrapperProps {\n readonly children?: React.ReactNode;\n}\n\n/**\n * @public\n * @deprecated in 4.16.0. Use {@link ContentOverlay} component to display the active content indicator instead.\n */\nexport function FloatingViewportContentWrapper({\n children,\n}: FloatingViewportContentWrapperProps) {\n return (\n <div\n className=\"uifw-dialog-imodel-content\"\n style={{ height: \"100%\", position: \"relative\" }}\n >\n <ContentWrapper\n content={children}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={undefined}\n />\n </div>\n );\n}\n\n/**\n * @alpha\n * @deprecated in 4.16.0. Use {@link @itwin/imodel-components-react#ViewportComponent} component instead.\n */\nexport function useFloatingViewport(args: FloatingViewportContentProps) {\n const { contentId, initialViewState, onContextMenu, viewportRef } = args;\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\n const contentControl = React.useRef<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n FloatingViewportContentControl | undefined\n >();\n\n const viewState = React.useMemo(\n () =>\n typeof initialViewState === \"function\"\n ? initialViewState()\n : initialViewState,\n [initialViewState]\n );\n const ref = React.useCallback((v: ScreenViewport) => {\n setViewport(v);\n }, []);\n\n const refs = useRefs(ref, viewportRef);\n const viewportControl = React.useMemo(() => {\n const node = (\n <ViewportComponent\n key={contentId}\n imodel={viewState.iModel}\n viewState={viewState}\n controlId={contentId}\n onContextMenu={onContextMenu}\n viewportRef={refs}\n />\n );\n return node;\n }, [refs, onContextMenu, viewState, contentId]);\n\n React.useEffect(() => {\n if (!contentControl.current) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n contentControl.current = new FloatingViewportContentControl(\n contentId,\n contentId,\n null\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.addFloatingContentControl(contentControl.current);\n }\n return () => {\n if (contentControl.current) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n };\n }, [contentId]);\n\n React.useEffect(() => {\n if (viewport && contentControl.current) {\n contentControl.current.viewport = viewport;\n if (null === contentControl.current.reactNode) {\n contentControl.current.reactNode = viewportControl;\n }\n }\n }, [viewport, viewportControl]);\n\n React.useEffect(() => {\n return IModelApp.viewManager.onViewClose.addListener((vp) => {\n if (contentControl.current?.viewport === vp) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n });\n }, []);\n\n return {\n viewportControl,\n };\n}\n"]}
1
+ {"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAoBrD;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAmC;IACzE,MAAM,EAAE,eAAe,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvD,OAAO,CACL,oBAAC,8BAA8B,QAC5B,eAAe,CACe,CAClC,CAAC;AACJ,CAAC;AAUD;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,QAAQ,GAC4B;IACpC,OAAO,CACL,6BACE,SAAS,EAAC,4BAA4B,EACtC,KAAK,EAAE,EA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AAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACvE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;YACrC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACL,eAAe;KAChB,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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { ViewStateProp } from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FloatingViewportContentControl } from \"./ViewportContentControl.js\";\nimport { ContentWrapper } from \"./ContentLayout.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { useRefs } from \"@itwin/core-react/internal\";\nimport type { ContentOverlay } from \"./ContentOverlay.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/**\n * @beta\n * @deprecated in 4.16.0. Props of deprecated component {@link FloatingViewportContent}.\n */\nexport interface FloatingViewportContentProps {\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\n onContextMenu?: (e: React.MouseEvent) => boolean;\n /** viewport/content control uniqueId */\n contentId: string;\n /** The initial view state used to create the viewport, or a function that returns it (will refresh when the function changes) */\n initialViewState: ViewStateProp;\n /** Function to get a reference to the ScreenViewport */\n viewportRef?: React.Ref<ScreenViewport>;\n}\n\n/**\n * @beta\n * @deprecated in 4.16.0. Wrap {@link @itwin/imodel-components-react#ViewportComponent} component with a {@link ContentOverlay} instead.\n */\nexport function FloatingViewportContent(props: FloatingViewportContentProps) {\n const { viewportControl } = useFloatingViewport(props);\n return (\n <FloatingViewportContentWrapper>\n {viewportControl}\n </FloatingViewportContentWrapper>\n );\n}\n\n/**\n * @public\n * @deprecated in 4.16.0. Props of deprecated component {@link FloatingViewportContentWrapper}.\n */\nexport interface FloatingViewportContentWrapperProps {\n readonly children?: React.ReactNode;\n}\n\n/**\n * @public\n * @deprecated in 4.16.0. Use {@link ContentOverlay} component to display the active content indicator instead.\n */\nexport function FloatingViewportContentWrapper({\n children,\n}: FloatingViewportContentWrapperProps) {\n return (\n <div\n className=\"uifw-dialog-imodel-content\"\n style={{ height: \"100%\", position: \"relative\" }}\n >\n <ContentWrapper\n content={children}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={undefined}\n />\n </div>\n );\n}\n\n/**\n * @alpha\n * @deprecated in 4.16.0. Use {@link @itwin/imodel-components-react#ViewportComponent} component instead.\n */\nexport function useFloatingViewport(args: FloatingViewportContentProps) {\n const { contentId, initialViewState, onContextMenu, viewportRef } = args;\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\n const contentControl = React.useRef<\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n FloatingViewportContentControl | undefined\n >(undefined);\n\n const viewState = React.useMemo(\n () =>\n typeof initialViewState === \"function\"\n ? initialViewState()\n : initialViewState,\n [initialViewState]\n );\n const ref = React.useCallback((v: ScreenViewport) => {\n setViewport(v);\n }, []);\n\n const refs = useRefs(ref, viewportRef);\n const viewportControl = React.useMemo(() => {\n const node = (\n <ViewportComponent\n key={contentId}\n imodel={viewState.iModel}\n viewState={viewState}\n controlId={contentId}\n onContextMenu={onContextMenu}\n viewportRef={refs}\n />\n );\n return node;\n }, [refs, onContextMenu, viewState, contentId]);\n\n React.useEffect(() => {\n if (!contentControl.current) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n contentControl.current = new FloatingViewportContentControl(\n contentId,\n contentId,\n null\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.addFloatingContentControl(contentControl.current);\n }\n return () => {\n if (contentControl.current) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n };\n }, [contentId]);\n\n React.useEffect(() => {\n if (viewport && contentControl.current) {\n contentControl.current.viewport = viewport;\n if (null === contentControl.current.reactNode) {\n contentControl.current.reactNode = viewportControl;\n }\n }\n }, [viewport, viewportControl]);\n\n React.useEffect(() => {\n return IModelApp.viewManager.onViewClose.addListener((vp) => {\n if (contentControl.current?.viewport === vp) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.dropFloatingContentControl(contentControl.current);\n contentControl.current = undefined;\n }\n });\n }, []);\n\n return {\n viewportControl,\n };\n}\n"]}
@@ -11,7 +11,7 @@ export interface PaneProps {
11
11
  size?: string | number;
12
12
  split?: "vertical" | "horizontal";
13
13
  style?: React.CSSProperties;
14
- eleRef: React.RefObject<HTMLDivElement>;
14
+ eleRef: React.RefObject<HTMLDivElement | null>;
15
15
  children?: React.ReactNode;
16
16
  }
17
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Pane.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/split-pane/Pane.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,2GAA2G;AAE3G;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,qBAoCpC"}
1
+ {"version":3,"file":"Pane.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/split-pane/Pane.tsx"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,2GAA2G;AAE3G;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,qBAoCpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pane.js","sourceRoot":"","sources":["../../../../src/appui-react/content/split-pane/Pane.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAgBpC;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAElE,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAC/B,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAC1C,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACnC,MAAM,SAAS,GAAiC;YAC9C,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,MAAM;SAChB,CAAC;QAEF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;gBACzB,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC;gBACxB,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;YAC7B,CAAC;YACD,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC;QAC1B,CAAC;QAED,OAAO;YACL,GAAG,KAAK;YACR,GAAG,SAAS;SACU,CAAC;IAC3B,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL,6BAAK,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,IACvD,QAAQ,CACL,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 ContentView\n */\nimport * as React from \"react\";\nimport classnames from \"classnames\";\n\n/** Based on react-split-pane package. See https://github.com/tomkp/react-split-pane/blob/master/LICENSE */\n\n/**\n * @internal\n */\nexport interface PaneProps {\n className?: string;\n size?: string | number;\n split?: \"vertical\" | \"horizontal\";\n style?: React.CSSProperties;\n eleRef: React.RefObject<HTMLDivElement>;\n children?: React.ReactNode;\n}\n\n/**\n * @internal\n */\nexport function Pane(props: PaneProps) {\n const { children, className, split, style, size, eleRef } = props;\n\n const paneClasses = React.useMemo(\n () => classnames(\"Pane\", split, className),\n [split, className]\n );\n\n const paneStyle = React.useMemo(() => {\n const baseStyle: Partial<React.CSSProperties> = {\n flex: 1,\n position: \"relative\",\n outline: \"none\",\n };\n\n if (size !== undefined) {\n if (split === \"vertical\") {\n baseStyle.width = size;\n } else {\n baseStyle.height = size;\n baseStyle.display = \"flex\";\n }\n baseStyle.flex = \"none\";\n }\n\n return {\n ...style,\n ...baseStyle,\n } as React.CSSProperties;\n }, [size, split, style]);\n\n return (\n <div ref={eleRef} className={paneClasses} style={paneStyle}>\n {children}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"Pane.js","sourceRoot":"","sources":["../../../../src/appui-react/content/split-pane/Pane.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AAgBpC;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAElE,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAC/B,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAC1C,CAAC,KAAK,EAAE,SAAS,CAAC,CACnB,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACnC,MAAM,SAAS,GAAiC;YAC9C,IAAI,EAAE,CAAC;YACP,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,MAAM;SAChB,CAAC;QAEF,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;gBACzB,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACN,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC;gBACxB,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;YAC7B,CAAC;YACD,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC;QAC1B,CAAC;QAED,OAAO;YACL,GAAG,KAAK;YACR,GAAG,SAAS;SACU,CAAC;IAC3B,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAEzB,OAAO,CACL,6BAAK,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,IACvD,QAAQ,CACL,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 ContentView\n */\nimport * as React from \"react\";\nimport classnames from \"classnames\";\n\n/** Based on react-split-pane package. See https://github.com/tomkp/react-split-pane/blob/master/LICENSE */\n\n/**\n * @internal\n */\nexport interface PaneProps {\n className?: string;\n size?: string | number;\n split?: \"vertical\" | \"horizontal\";\n style?: React.CSSProperties;\n eleRef: React.RefObject<HTMLDivElement | null>;\n children?: React.ReactNode;\n}\n\n/**\n * @internal\n */\nexport function Pane(props: PaneProps) {\n const { children, className, split, style, size, eleRef } = props;\n\n const paneClasses = React.useMemo(\n () => classnames(\"Pane\", split, className),\n [split, className]\n );\n\n const paneStyle = React.useMemo(() => {\n const baseStyle: Partial<React.CSSProperties> = {\n flex: 1,\n position: \"relative\",\n outline: \"none\",\n };\n\n if (size !== undefined) {\n if (split === \"vertical\") {\n baseStyle.width = size;\n } else {\n baseStyle.height = size;\n baseStyle.display = \"flex\";\n }\n baseStyle.flex = \"none\";\n }\n\n return {\n ...style,\n ...baseStyle,\n } as React.CSSProperties;\n }, [size, split, style]);\n\n return (\n <div ref={eleRef} className={paneClasses} style={paneStyle}>\n {children}\n </div>\n );\n}\n"]}
@@ -36,7 +36,7 @@ function getDefaultSize(defaultSize, minSize, maxSize, draggedSize) {
36
36
  return minSize;
37
37
  }
38
38
  function removeNullChildren(children) {
39
- return React.Children.toArray(children).filter((c) => c);
39
+ return React.Children.toArray(children).filter((c) => !!c);
40
40
  }
41
41
  /**
42
42
  * Local TypeScript implementation of `SplitPane` from `react-split-pane` package since that
@@ -1 +1 @@
1
- {"version":3,"file":"SplitPane.js","sourceRoot":"","sources":["../../../../src/appui-react/content/split-pane/SplitPane.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA+DvC,SAAS,OAAO,CAAC,QAA8B;IAC7C,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEtB,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;IAC7C,IAAI,YAAY,EAAE,CAAC;QACjB,YAAY,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,QAAQ,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;YAC1D,YAAY,EAAE,eAAe,EAAE,CAAC;QAClC,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CACrB,WAA6B,EAC7B,OAAyB,EACzB,OAAyB,EACzB,WAAoB;IAEpB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,GAAG,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,MAAM,GAAG,GACP,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;QACnE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC;IACnD,CAAC;IACD,IAA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C,WAAW,EAAE,WAAW,CAAC,CAAC;QACpD,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACnD,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACvD,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACzD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,6BAAK,SAAS,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc;QACrE,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd;QACP,oBAAC,OAAO,IACN,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,qBAAqB,EACjC,GAAG,EAAC,SAAS,EACb,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,YAAY,GACnB;QACF,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd,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 ContentView\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Pane } from \"./Pane.js\";\nimport { Resizer } from \"./Resizer.js\";\n\n/**\n * Props for [[SplitPane]] component\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof SplitPane>`\n */\nexport interface SplitPaneProps {\n /** Pass false to disable resizing */\n allowResize?: boolean;\n /** The array of two react nodes, one for each pane. */\n children: React.ReactNode[];\n /** Determines which pane maintains its size when browser window is resized.*/\n primary?: \"first\" | \"second\";\n\n minSize?: string | number;\n /** You can limit the maximal size of the 'fixed' pane using the maxSize parameter with a positive value\n * (measured in pixels but state just a number). If you wrap the SplitPane into a container component\n * (yes you can, just remember the container has to have the relative or absolute positioning), then you'll need to limit\n * the movement of the splitter (resizer) at the end of the SplitPane (otherwise it can be dragged outside the SplitPane\n * and you don't catch it never more). For this purpose use the maxSize parameter with value 0. When dragged the splitter/resizer\n * will stop at the border of the SplitPane component and think this you'll be able to pick it again and drag it back then.\n * And more: if you set the maxSize to negative value (e.g. -200), then the splitter stops 200px before the border\n * (in other words it sets the minimal size of the 'resizable' pane in this case). This can be useful also in the\n * full-screen case of use. */\n maxSize?: string | number;\n /** Default initial size of primary pane */\n defaultSize?: string | number;\n /** Size of primary pane */\n size?: string | number;\n /** You can use the step prop to only allow resizing in fixed increments. */\n step?: number;\n split?: \"vertical\" | \"horizontal\";\n /** This callback is invoked when a drag start. */\n onDragStarted?: () => void;\n /** This callback is invoked when a drag ends. */\n onDragFinished?: (newSize: number) => void;\n /** Callback is invoked with the current drag during a drag event. */\n onChange?: (newSize: number) => void;\n /** Callback is invoked if user clicks on Resizer. */\n onResizerClick?: (event: MouseEvent) => void;\n /** Callback is invoked if user double clicks on Resizer. */\n onResizerDoubleClick?: (event: MouseEvent) => void;\n /** Styling to be applied to the main container */\n style?: React.CSSProperties;\n /** Styling to be applied to both panes */\n paneStyle?: React.CSSProperties;\n /** Styling to be applied to the first pane, with precedence over paneStyle */\n pane1Style?: React.CSSProperties;\n /** Styling to be applied to the second pane, with precedence over paneStyle */\n pane2Style?: React.CSSProperties;\n /** Styling to be applied to the resizer bar */\n resizerStyle?: React.CSSProperties;\n /** Class name to be added to the SplitPane div */\n className?: string;\n /** Class name to be added to each Pane's div */\n paneClassName?: string;\n /** Class name to be added to Pane1's div */\n pane1ClassName?: string;\n /** Class name to be added to Pane2's div */\n pane2ClassName?: string;\n}\n\nfunction unFocus(ownerDoc: Document | undefined) {\n if (!ownerDoc) return;\n\n const docSelection = ownerDoc.getSelection();\n if (docSelection) {\n docSelection.empty();\n } else {\n try {\n const winSelection = ownerDoc.defaultView?.getSelection();\n winSelection?.removeAllRanges();\n } catch {}\n }\n}\n\nfunction getDefaultSize(\n defaultSize?: number | string,\n minSize?: string | number,\n maxSize?: string | number,\n draggedSize?: number\n) {\n if (typeof draggedSize === \"number\") {\n const min = typeof minSize === \"number\" ? minSize : 0;\n const max =\n typeof maxSize === \"number\" && maxSize >= 0 ? maxSize : Infinity;\n return Math.max(min, Math.min(max, draggedSize));\n }\n if (defaultSize !== undefined) {\n return defaultSize;\n }\n return minSize;\n}\n\nfunction removeNullChildren(children: React.ReactNode[]) {\n return React.Children.toArray(children).filter((c) => c);\n}\n\n/**\n * Local TypeScript implementation of `SplitPane` from `react-split-pane` package since that\n * package is not regularly maintained.\n * See https://github.com/tomkp/react-split-pane/blob/master/LICENSE.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function SplitPane(props: SplitPaneProps) {\n const {\n style,\n size,\n defaultSize,\n maxSize,\n children,\n paneStyle,\n pane1Style,\n pane2Style,\n className,\n paneClassName,\n pane1ClassName,\n pane2ClassName,\n onDragStarted,\n onDragFinished,\n step,\n onChange,\n onResizerClick,\n onResizerDoubleClick,\n } = props;\n\n // honor same defaults as react-split-pane\n const allowResize = React.useMemo(\n () => (undefined !== props.allowResize ? props.allowResize : true),\n [props.allowResize]\n );\n const minSize = React.useMemo(\n () => (undefined !== props.minSize ? props.minSize : 50),\n [props.minSize]\n );\n const primary = React.useMemo(\n () => (undefined !== props.primary ? props.primary : \"first\"),\n [props.primary]\n );\n const split = React.useMemo(\n () => (undefined !== props.split ? props.split : \"vertical\"),\n [props.split]\n );\n const initialSize =\n size !== undefined ? size : getDefaultSize(defaultSize, minSize, maxSize);\n\n const [position, setPosition] = React.useState(0);\n const [draggedSize, setDraggedSize] = React.useState<number | undefined>();\n const [active, setActive] = React.useState(false);\n const [pane1Size, setPane1Size] = React.useState(() =>\n primary === \"first\" ? initialSize : undefined\n );\n const [pane2Size, setPane2Size] = React.useState(() =>\n primary === \"second\" ? initialSize : undefined\n );\n const splitPane = React.useRef<HTMLDivElement>(null);\n const pane1 = React.useRef<HTMLDivElement>(null);\n const pane2 = React.useRef<HTMLDivElement>(null);\n const notNullChildren = React.useMemo(\n () => removeNullChildren(children),\n [children]\n );\n\n React.useEffect(() => {\n primary === \"first\" ? setPane1Size(initialSize) : setPane2Size(initialSize);\n primary === \"first\" ? setPane2Size(undefined) : setPane1Size(undefined);\n }, [initialSize, primary]);\n\n const splitPaneStyle = React.useMemo(() => {\n const directionSpecificParts =\n split === \"vertical\"\n ? {\n flexDirection: \"row\",\n left: 0,\n right: 0,\n }\n : {\n bottom: 0,\n flexDirection: \"column\",\n minHeight: \"100%\",\n top: 0,\n width: \"100%\",\n };\n\n return {\n display: \"flex\",\n flex: 1,\n height: \"100%\",\n position: \"absolute\",\n outline: \"none\",\n overflow: \"hidden\",\n MozUserSelect: \"text\",\n WebkitUserSelect: \"text\",\n msUserSelect: \"text\",\n userSelect: \"text\",\n ...style,\n ...directionSpecificParts,\n } as React.CSSProperties;\n }, [split, style]);\n\n const pane1DivStyle = { ...paneStyle, ...pane1Style };\n const pane2DivStyle = { ...paneStyle, ...pane2Style };\n const resizerStyle = React.useMemo(\n () => props.resizerStyle ?? {},\n [props.resizerStyle]\n );\n const resizerClasses = React.useMemo(\n () => classnames(\"Resizer\", !allowResize && \"disabled\"),\n [allowResize]\n );\n const splitPaneClasses = React.useMemo(\n () => classnames(\"SplitPane\", className, split, !allowResize && \"disabled\"),\n [className, split, allowResize]\n );\n const pane1Classes = React.useMemo(\n () => classnames(\"Pane1\", paneClassName, pane1ClassName),\n [paneClassName, pane1ClassName]\n );\n const pane2Classes = React.useMemo(\n () => classnames(\"Pane2\", paneClassName, pane2ClassName),\n [paneClassName, pane2ClassName]\n );\n\n const initializeDrag = React.useCallback(\n (x: number, y: number) => {\n unFocus(splitPane.current?.ownerDocument);\n const newPosition = split === \"vertical\" ? x : y;\n onDragStarted && onDragStarted();\n setActive(true);\n setPosition(newPosition);\n },\n [onDragStarted, split]\n );\n\n const onTouchStart = React.useCallback(\n (event: TouchEvent) => {\n if (allowResize) {\n initializeDrag(event.touches[0].clientX, event.touches[0].clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processMove = React.useCallback(\n (x: number, y: number) => {\n unFocus(splitPane.current?.ownerDocument);\n const isPrimaryFirst = primary === \"first\";\n const ref = isPrimaryFirst ? pane1.current : pane2.current;\n const ref2 = isPrimaryFirst ? pane2.current : pane1.current;\n const splitPaneDiv = splitPane.current;\n\n if (ref && ref2 && splitPaneDiv) {\n const node = ref;\n const node2 = ref2;\n if (node.getBoundingClientRect) {\n const width = node.getBoundingClientRect().width;\n const height = node.getBoundingClientRect().height;\n const current = split === \"vertical\" ? x : y;\n const oldSize = split === \"vertical\" ? width : height;\n let positionDelta = position - current;\n if (step) {\n if (Math.abs(positionDelta) < step) {\n return;\n }\n // Integer division\n positionDelta = ~~(positionDelta / step) * step;\n }\n let sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;\n\n const pane1Order = parseInt(\n node.ownerDocument?.defaultView?.getComputedStyle(node).order ??\n \"0\",\n 10\n );\n const pane2Order = parseInt(\n node2.ownerDocument?.defaultView?.getComputedStyle(node2).order ??\n \"0\",\n 10\n );\n if (pane1Order > pane2Order) {\n sizeDelta = -sizeDelta;\n }\n\n let newMaxSize = maxSize;\n if (\n typeof maxSize === \"number\" &&\n maxSize !== undefined &&\n maxSize <= 0\n ) {\n if (split === \"vertical\") {\n newMaxSize = splitPaneDiv.getBoundingClientRect().width + maxSize;\n } else {\n newMaxSize =\n splitPaneDiv.getBoundingClientRect().height + maxSize;\n }\n }\n\n let newSize = oldSize - sizeDelta;\n const newPosition = position - positionDelta;\n\n if (typeof minSize === \"number\" && newSize < minSize) {\n newSize = minSize;\n } else if (\n typeof newMaxSize === \"number\" &&\n newMaxSize !== undefined &&\n newSize > newMaxSize\n ) {\n newSize = newMaxSize;\n } else {\n setPosition(newPosition);\n }\n\n onChange && onChange(newSize);\n setDraggedSize(newSize);\n isPrimaryFirst ? setPane1Size(newSize) : setPane2Size(newSize);\n }\n }\n },\n [maxSize, minSize, onChange, position, primary, split, step]\n );\n\n const onTouchMove = React.useCallback(\n (event: TouchEvent) => {\n if (!allowResize || !active) return;\n processMove(event.touches[0].clientX, event.touches[0].clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseMove = React.useCallback(\n (event: MouseEvent) => {\n if (!allowResize || !active) return;\n processMove(event.clientX, event.clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseDown = React.useCallback(\n (event: MouseEvent) => {\n if (allowResize) {\n event.preventDefault();\n initializeDrag(event.clientX, event.clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processResizeFinished = React.useCallback(() => {\n if (undefined !== draggedSize && allowResize && active) {\n onDragFinished && onDragFinished(draggedSize);\n }\n setActive(false);\n }, [draggedSize, allowResize, active, onDragFinished]);\n\n const onMouseUp = React.useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n processResizeFinished();\n },\n [processResizeFinished]\n );\n\n React.useEffect(() => {\n const ownerDoc = splitPane.current?.ownerDocument;\n if (!ownerDoc) return;\n\n ownerDoc.addEventListener(\"mouseup\", onMouseUp);\n ownerDoc.addEventListener(\"mousemove\", onMouseMove);\n ownerDoc.addEventListener(\"touchmove\", onTouchMove);\n return () => {\n ownerDoc.removeEventListener(\"mouseup\", onMouseUp);\n ownerDoc.removeEventListener(\"mousemove\", onMouseMove);\n ownerDoc.removeEventListener(\"touchmove\", onTouchMove);\n };\n }, [onMouseMove, onMouseUp, onTouchMove]);\n\n return (\n <div className={splitPaneClasses} ref={splitPane} style={splitPaneStyle}>\n <Pane\n className={pane1Classes}\n key=\"pane1\"\n eleRef={pane1}\n size={pane1Size}\n split={split}\n style={pane1DivStyle}\n >\n {notNullChildren[0]}\n </Pane>\n <Resizer\n className={resizerClasses}\n onClick={onResizerClick}\n onDoubleClick={onResizerDoubleClick}\n onMouseDown={onMouseDown}\n onTouchStart={onTouchStart}\n onTouchEnd={processResizeFinished}\n key=\"resizer\"\n split={split}\n style={resizerStyle}\n />\n <Pane\n className={pane2Classes}\n key=\"pane2\"\n eleRef={pane2}\n size={pane2Size}\n split={split}\n style={pane2DivStyle}\n >\n {notNullChildren[1]}\n </Pane>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"SplitPane.js","sourceRoot":"","sources":["../../../../src/appui-react/content/split-pane/SplitPane.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA+DvC,SAAS,OAAO,CAAC,QAA8B;IAC7C,IAAI,CAAC,QAAQ;QAAE,OAAO;IAEtB,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,EAAE,CAAC;IAC7C,IAAI,YAAY,EAAE,CAAC;QACjB,YAAY,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,QAAQ,CAAC,WAAW,EAAE,YAAY,EAAE,CAAC;YAC1D,YAAY,EAAE,eAAe,EAAE,CAAC;QAClC,CAAC;QAAC,M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vB,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,qBAAqB,EACjC,GAAG,EAAC,SAAS,EACb,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,YAAY,GACnB;QACF,oBAAC,IAAI,IACH,SAAS,EAAE,YAAY,EACvB,GAAG,EAAC,OAAO,EACX,MAAM,EAAE,KAAK,EACb,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,IAEnB,eAAe,CAAC,CAAC,CAAC,CACd,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 ContentView\n */\n\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Pane } from \"./Pane.js\";\nimport { Resizer } from \"./Resizer.js\";\n\n/**\n * Props for [[SplitPane]] component\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof SplitPane>`\n */\nexport interface SplitPaneProps {\n /** Pass false to disable resizing */\n allowResize?: boolean;\n /** The array of two react nodes, one for each pane. */\n children: React.ReactNode[];\n /** Determines which pane maintains its size when browser window is resized.*/\n primary?: \"first\" | \"second\";\n\n minSize?: string | number;\n /** You can limit the maximal size of the 'fixed' pane using the maxSize parameter with a positive value\n * (measured in pixels but state just a number). If you wrap the SplitPane into a container component\n * (yes you can, just remember the container has to have the relative or absolute positioning), then you'll need to limit\n * the movement of the splitter (resizer) at the end of the SplitPane (otherwise it can be dragged outside the SplitPane\n * and you don't catch it never more). For this purpose use the maxSize parameter with value 0. When dragged the splitter/resizer\n * will stop at the border of the SplitPane component and think this you'll be able to pick it again and drag it back then.\n * And more: if you set the maxSize to negative value (e.g. -200), then the splitter stops 200px before the border\n * (in other words it sets the minimal size of the 'resizable' pane in this case). This can be useful also in the\n * full-screen case of use. */\n maxSize?: string | number;\n /** Default initial size of primary pane */\n defaultSize?: string | number;\n /** Size of primary pane */\n size?: string | number;\n /** You can use the step prop to only allow resizing in fixed increments. */\n step?: number;\n split?: \"vertical\" | \"horizontal\";\n /** This callback is invoked when a drag start. */\n onDragStarted?: () => void;\n /** This callback is invoked when a drag ends. */\n onDragFinished?: (newSize: number) => void;\n /** Callback is invoked with the current drag during a drag event. */\n onChange?: (newSize: number) => void;\n /** Callback is invoked if user clicks on Resizer. */\n onResizerClick?: (event: MouseEvent) => void;\n /** Callback is invoked if user double clicks on Resizer. */\n onResizerDoubleClick?: (event: MouseEvent) => void;\n /** Styling to be applied to the main container */\n style?: React.CSSProperties;\n /** Styling to be applied to both panes */\n paneStyle?: React.CSSProperties;\n /** Styling to be applied to the first pane, with precedence over paneStyle */\n pane1Style?: React.CSSProperties;\n /** Styling to be applied to the second pane, with precedence over paneStyle */\n pane2Style?: React.CSSProperties;\n /** Styling to be applied to the resizer bar */\n resizerStyle?: React.CSSProperties;\n /** Class name to be added to the SplitPane div */\n className?: string;\n /** Class name to be added to each Pane's div */\n paneClassName?: string;\n /** Class name to be added to Pane1's div */\n pane1ClassName?: string;\n /** Class name to be added to Pane2's div */\n pane2ClassName?: string;\n}\n\nfunction unFocus(ownerDoc: Document | undefined) {\n if (!ownerDoc) return;\n\n const docSelection = ownerDoc.getSelection();\n if (docSelection) {\n docSelection.empty();\n } else {\n try {\n const winSelection = ownerDoc.defaultView?.getSelection();\n winSelection?.removeAllRanges();\n } catch {}\n }\n}\n\nfunction getDefaultSize(\n defaultSize?: number | string,\n minSize?: string | number,\n maxSize?: string | number,\n draggedSize?: number\n) {\n if (typeof draggedSize === \"number\") {\n const min = typeof minSize === \"number\" ? minSize : 0;\n const max =\n typeof maxSize === \"number\" && maxSize >= 0 ? maxSize : Infinity;\n return Math.max(min, Math.min(max, draggedSize));\n }\n if (defaultSize !== undefined) {\n return defaultSize;\n }\n return minSize;\n}\n\nfunction removeNullChildren(children: React.ReactNode[]) {\n return React.Children.toArray(children).filter((c) => !!c);\n}\n\n/**\n * Local TypeScript implementation of `SplitPane` from `react-split-pane` package since that\n * package is not regularly maintained.\n * See https://github.com/tomkp/react-split-pane/blob/master/LICENSE.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function SplitPane(props: SplitPaneProps) {\n const {\n style,\n size,\n defaultSize,\n maxSize,\n children,\n paneStyle,\n pane1Style,\n pane2Style,\n className,\n paneClassName,\n pane1ClassName,\n pane2ClassName,\n onDragStarted,\n onDragFinished,\n step,\n onChange,\n onResizerClick,\n onResizerDoubleClick,\n } = props;\n\n // honor same defaults as react-split-pane\n const allowResize = React.useMemo(\n () => (undefined !== props.allowResize ? props.allowResize : true),\n [props.allowResize]\n );\n const minSize = React.useMemo(\n () => (undefined !== props.minSize ? props.minSize : 50),\n [props.minSize]\n );\n const primary = React.useMemo(\n () => (undefined !== props.primary ? props.primary : \"first\"),\n [props.primary]\n );\n const split = React.useMemo(\n () => (undefined !== props.split ? props.split : \"vertical\"),\n [props.split]\n );\n const initialSize =\n size !== undefined ? size : getDefaultSize(defaultSize, minSize, maxSize);\n\n const [position, setPosition] = React.useState(0);\n const [draggedSize, setDraggedSize] = React.useState<number | undefined>();\n const [active, setActive] = React.useState(false);\n const [pane1Size, setPane1Size] = React.useState(() =>\n primary === \"first\" ? initialSize : undefined\n );\n const [pane2Size, setPane2Size] = React.useState(() =>\n primary === \"second\" ? initialSize : undefined\n );\n const splitPane = React.useRef<HTMLDivElement>(null);\n const pane1 = React.useRef<HTMLDivElement>(null);\n const pane2 = React.useRef<HTMLDivElement>(null);\n const notNullChildren = React.useMemo(\n () => removeNullChildren(children),\n [children]\n );\n\n React.useEffect(() => {\n primary === \"first\" ? setPane1Size(initialSize) : setPane2Size(initialSize);\n primary === \"first\" ? setPane2Size(undefined) : setPane1Size(undefined);\n }, [initialSize, primary]);\n\n const splitPaneStyle = React.useMemo(() => {\n const directionSpecificParts =\n split === \"vertical\"\n ? {\n flexDirection: \"row\",\n left: 0,\n right: 0,\n }\n : {\n bottom: 0,\n flexDirection: \"column\",\n minHeight: \"100%\",\n top: 0,\n width: \"100%\",\n };\n\n return {\n display: \"flex\",\n flex: 1,\n height: \"100%\",\n position: \"absolute\",\n outline: \"none\",\n overflow: \"hidden\",\n MozUserSelect: \"text\",\n WebkitUserSelect: \"text\",\n msUserSelect: \"text\",\n userSelect: \"text\",\n ...style,\n ...directionSpecificParts,\n } as React.CSSProperties;\n }, [split, style]);\n\n const pane1DivStyle = { ...paneStyle, ...pane1Style };\n const pane2DivStyle = { ...paneStyle, ...pane2Style };\n const resizerStyle = React.useMemo(\n () => props.resizerStyle ?? {},\n [props.resizerStyle]\n );\n const resizerClasses = React.useMemo(\n () => classnames(\"Resizer\", !allowResize && \"disabled\"),\n [allowResize]\n );\n const splitPaneClasses = React.useMemo(\n () => classnames(\"SplitPane\", className, split, !allowResize && \"disabled\"),\n [className, split, allowResize]\n );\n const pane1Classes = React.useMemo(\n () => classnames(\"Pane1\", paneClassName, pane1ClassName),\n [paneClassName, pane1ClassName]\n );\n const pane2Classes = React.useMemo(\n () => classnames(\"Pane2\", paneClassName, pane2ClassName),\n [paneClassName, pane2ClassName]\n );\n\n const initializeDrag = React.useCallback(\n (x: number, y: number) => {\n unFocus(splitPane.current?.ownerDocument);\n const newPosition = split === \"vertical\" ? x : y;\n onDragStarted && onDragStarted();\n setActive(true);\n setPosition(newPosition);\n },\n [onDragStarted, split]\n );\n\n const onTouchStart = React.useCallback(\n (event: TouchEvent) => {\n if (allowResize) {\n initializeDrag(event.touches[0].clientX, event.touches[0].clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processMove = React.useCallback(\n (x: number, y: number) => {\n unFocus(splitPane.current?.ownerDocument);\n const isPrimaryFirst = primary === \"first\";\n const ref = isPrimaryFirst ? pane1.current : pane2.current;\n const ref2 = isPrimaryFirst ? pane2.current : pane1.current;\n const splitPaneDiv = splitPane.current;\n\n if (ref && ref2 && splitPaneDiv) {\n const node = ref;\n const node2 = ref2;\n if (node.getBoundingClientRect) {\n const width = node.getBoundingClientRect().width;\n const height = node.getBoundingClientRect().height;\n const current = split === \"vertical\" ? x : y;\n const oldSize = split === \"vertical\" ? width : height;\n let positionDelta = position - current;\n if (step) {\n if (Math.abs(positionDelta) < step) {\n return;\n }\n // Integer division\n positionDelta = ~~(positionDelta / step) * step;\n }\n let sizeDelta = isPrimaryFirst ? positionDelta : -positionDelta;\n\n const pane1Order = parseInt(\n node.ownerDocument?.defaultView?.getComputedStyle(node).order ??\n \"0\",\n 10\n );\n const pane2Order = parseInt(\n node2.ownerDocument?.defaultView?.getComputedStyle(node2).order ??\n \"0\",\n 10\n );\n if (pane1Order > pane2Order) {\n sizeDelta = -sizeDelta;\n }\n\n let newMaxSize = maxSize;\n if (\n typeof maxSize === \"number\" &&\n maxSize !== undefined &&\n maxSize <= 0\n ) {\n if (split === \"vertical\") {\n newMaxSize = splitPaneDiv.getBoundingClientRect().width + maxSize;\n } else {\n newMaxSize =\n splitPaneDiv.getBoundingClientRect().height + maxSize;\n }\n }\n\n let newSize = oldSize - sizeDelta;\n const newPosition = position - positionDelta;\n\n if (typeof minSize === \"number\" && newSize < minSize) {\n newSize = minSize;\n } else if (\n typeof newMaxSize === \"number\" &&\n newMaxSize !== undefined &&\n newSize > newMaxSize\n ) {\n newSize = newMaxSize;\n } else {\n setPosition(newPosition);\n }\n\n onChange && onChange(newSize);\n setDraggedSize(newSize);\n isPrimaryFirst ? setPane1Size(newSize) : setPane2Size(newSize);\n }\n }\n },\n [maxSize, minSize, onChange, position, primary, split, step]\n );\n\n const onTouchMove = React.useCallback(\n (event: TouchEvent) => {\n if (!allowResize || !active) return;\n processMove(event.touches[0].clientX, event.touches[0].clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseMove = React.useCallback(\n (event: MouseEvent) => {\n if (!allowResize || !active) return;\n processMove(event.clientX, event.clientY);\n },\n [active, allowResize, processMove]\n );\n\n const onMouseDown = React.useCallback(\n (event: MouseEvent) => {\n if (allowResize) {\n event.preventDefault();\n initializeDrag(event.clientX, event.clientY);\n }\n },\n [allowResize, initializeDrag]\n );\n\n const processResizeFinished = React.useCallback(() => {\n if (undefined !== draggedSize && allowResize && active) {\n onDragFinished && onDragFinished(draggedSize);\n }\n setActive(false);\n }, [draggedSize, allowResize, active, onDragFinished]);\n\n const onMouseUp = React.useCallback(\n (event: MouseEvent) => {\n event.preventDefault();\n processResizeFinished();\n },\n [processResizeFinished]\n );\n\n React.useEffect(() => {\n const ownerDoc = splitPane.current?.ownerDocument;\n if (!ownerDoc) return;\n\n ownerDoc.addEventListener(\"mouseup\", onMouseUp);\n ownerDoc.addEventListener(\"mousemove\", onMouseMove);\n ownerDoc.addEventListener(\"touchmove\", onTouchMove);\n return () => {\n ownerDoc.removeEventListener(\"mouseup\", onMouseUp);\n ownerDoc.removeEventListener(\"mousemove\", onMouseMove);\n ownerDoc.removeEventListener(\"touchmove\", onTouchMove);\n };\n }, [onMouseMove, onMouseUp, onTouchMove]);\n\n return (\n <div className={splitPaneClasses} ref={splitPane} style={splitPaneStyle}>\n <Pane\n className={pane1Classes}\n key=\"pane1\"\n eleRef={pane1}\n size={pane1Size}\n split={split}\n style={pane1DivStyle}\n >\n {notNullChildren[0]}\n </Pane>\n <Resizer\n className={resizerClasses}\n onClick={onResizerClick}\n onDoubleClick={onResizerDoubleClick}\n onMouseDown={onMouseDown}\n onTouchStart={onTouchStart}\n onTouchEnd={processResizeFinished}\n key=\"resizer\"\n split={split}\n style={resizerStyle}\n />\n <Pane\n className={pane2Classes}\n key=\"pane2\"\n eleRef={pane2}\n size={pane2Size}\n split={split}\n style={pane2DivStyle}\n >\n {notNullChildren[1]}\n </Pane>\n </div>\n );\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { ReactElement } from "react";
2
+ declare module "@itwin/core-frontend" {
3
+ interface ToolAssistanceInstruction {
4
+ /** The icon to display for the tool assistance instruction. Takes precedence over `image`. */
5
+ iconElement?: ReactElement;
6
+ }
7
+ }
8
+ //# sourceMappingURL=core-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-icons.d.ts","sourceRoot":"","sources":["../../src/appui-react/core-icons.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,yBAAyB;QACjC,8FAA8F;QAC9F,WAAW,CAAC,EAAE,YAAY,CAAC;KAC5B;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=core-icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-icons.js","sourceRoot":"","sources":["../../src/appui-react/core-icons.ts"],"names":[],"mappings":"","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 *--------------------------------------------------------------------------------------------*/\nimport type { ReactElement } from \"react\";\nimport type {} from \"@itwin/core-frontend\";\n\ndeclare module \"@itwin/core-frontend\" {\n interface ToolAssistanceInstruction {\n /** The icon to display for the tool assistance instruction. Takes precedence over `image`. */\n iconElement?: ReactElement;\n }\n}\n"]}
@@ -17,7 +17,7 @@ import { Logger } from "@itwin/core-bentley";
17
17
  */
18
18
  // eslint-disable-next-line @typescript-eslint/no-deprecated
19
19
  export function CursorPopupMenu(props) {
20
- const windowIdRef = React.useRef();
20
+ const windowIdRef = React.useRef(undefined);
21
21
  const [opened, setOpened] = React.useState(false);
22
22
  const [x, setX] = React.useState(0);
23
23
  const [y, setY] = React.useState(0);
@@ -1 +1 @@
1
- {"version":3,"file":"CursorMenu.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE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,MAAM,EACd,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,IAAI,IAGb,eAAe,CAAC,mBAAmB;IAClC,4DAA4D;IAC5D,eAAe,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAChD,CACiB,CACrB,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Cursor\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { GlobalContextMenu } from \"@itwin/core-react\"; // ContextSubMenu,\nimport { SessionStateActionId } from \"../../redux/SessionState.js\";\nimport type { CursorMenuItemProps } from \"../../shared/MenuItem.js\";\nimport { MenuItemHelpers } from \"../../shared/MenuItem.js\";\nimport { SyncUiEventDispatcher } from \"../../syncui/SyncUiEventDispatcher.js\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { Logger } from \"@itwin/core-bentley\";\n\n/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function CursorPopupMenu(props: CommonProps) {\n const windowIdRef = React.useRef<string | undefined>();\n const [opened, setOpened] = React.useState(false);\n const [x, setX] = React.useState(0);\n const [y, setY] = React.useState(0);\n const [items, setItems] = React.useState<CursorMenuItemProps[] | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {\n if (\n !SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n SessionStateActionId.UpdateCursorMenu,\n ])\n )\n return;\n\n const menuData = UiFramework.getCursorMenuData();\n const windowId = windowIdRef.current;\n if (!menuData || windowId !== menuData.childWindowId) {\n setOpened(false);\n setItems(undefined);\n return;\n }\n\n setOpened(menuData.items && menuData.items.length > 0);\n setItems(menuData.items);\n setX(menuData.position.x);\n setY(menuData.position.y);\n });\n }, []);\n\n const onClose = () => {\n setOpened(false);\n };\n\n return (\n <div\n className=\"uifw-cursor-menu-container-div\"\n ref={(el) => {\n const parentWindow = el?.ownerDocument.defaultView ?? undefined;\n const windowId = UiFramework.childWindows.findId(parentWindow);\n windowIdRef.current = windowId;\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiFramework\"),\n `Cursor Menu for ${windowId ?? \"main\"} window`\n );\n }}\n >\n {items && items.length > 0 && opened && (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <GlobalContextMenu\n className={props.className}\n style={props.style}\n identifier=\"cursor-popup-menu\"\n x={x}\n y={y}\n opened={opened}\n onEsc={onClose}\n onOutsideClick={onClose}\n edgeLimit={false}\n autoflip={true}\n >\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n {MenuItemHelpers.createMenuItemNodes(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n MenuItemHelpers.createMenuItems(items, onClose)\n )}\n </GlobalContextMenu>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"CursorMenu.js","sourceRoot":"","sources":["../../../../src/appui-react/cursor/cursormenu/CursorMenu.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC,CAAC,kBAAkB;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBA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QAAQ,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CACL,6BACE,SAAS,EAAC,gCAAgC,EAC1C,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE;YACV,MAAM,YAAY,GAAG,EAAE,EAAE,aAAa,CAAC,WAAW,IAAI,SAAS,CAAC;YAChE,MAAM,QAAQ,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YAC/D,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;YAC/B,MAAM,CAAC,OAAO,CACZ,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,EACzC,mBAAmB,QAAQ,IAAI,MAAM,SAAS,CAC/C,CAAC;QACJ,CAAC,IAEA,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI;IACtC,4DAA4D;IAC5D,oBAAC,iBAAiB,IAChB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAC,mBAAmB,EAC9B,CAAC,EAAE,CAAC,EACJ,CAAC,EAAE,CAAC,EACJ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,cAAc,EAAE,OAAO,EACvB,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,IAAI,IAGb,eAAe,CAAC,mBAAmB;IAClC,4DAA4D;IAC5D,eAAe,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAChD,CACiB,CACrB,CACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Cursor\n */\n\nimport * as React from \"react\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { GlobalContextMenu } from \"@itwin/core-react\"; // ContextSubMenu,\nimport { SessionStateActionId } from \"../../redux/SessionState.js\";\nimport type { CursorMenuItemProps } from \"../../shared/MenuItem.js\";\nimport { MenuItemHelpers } from \"../../shared/MenuItem.js\";\nimport { SyncUiEventDispatcher } from \"../../syncui/SyncUiEventDispatcher.js\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { Logger } from \"@itwin/core-bentley\";\n\n/** Popup Menu to show at cursor typically used by tools to provide a right-click context menu.\n * @alpha\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function CursorPopupMenu(props: CommonProps) {\n const windowIdRef = React.useRef<string | undefined>(undefined);\n const [opened, setOpened] = React.useState(false);\n const [x, setX] = React.useState(0);\n const [y, setY] = React.useState(0);\n const [items, setItems] = React.useState<CursorMenuItemProps[] | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {\n if (\n !SyncUiEventDispatcher.hasEventOfInterest(args.eventIds, [\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n SessionStateActionId.UpdateCursorMenu,\n ])\n )\n return;\n\n const menuData = UiFramework.getCursorMenuData();\n const windowId = windowIdRef.current;\n if (!menuData || windowId !== menuData.childWindowId) {\n setOpened(false);\n setItems(undefined);\n return;\n }\n\n setOpened(menuData.items && menuData.items.length > 0);\n setItems(menuData.items);\n setX(menuData.position.x);\n setY(menuData.position.y);\n });\n }, []);\n\n const onClose = () => {\n setOpened(false);\n };\n\n return (\n <div\n className=\"uifw-cursor-menu-container-div\"\n ref={(el) => {\n const parentWindow = el?.ownerDocument.defaultView ?? undefined;\n const windowId = UiFramework.childWindows.findId(parentWindow);\n windowIdRef.current = windowId;\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiFramework\"),\n `Cursor Menu for ${windowId ?? \"main\"} window`\n );\n }}\n >\n {items && items.length > 0 && opened && (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <GlobalContextMenu\n className={props.className}\n style={props.style}\n identifier=\"cursor-popup-menu\"\n x={x}\n y={y}\n opened={opened}\n onEsc={onClose}\n onOutsideClick={onClose}\n edgeLimit={false}\n autoflip={true}\n >\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n {MenuItemHelpers.createMenuItemNodes(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n MenuItemHelpers.createMenuItems(items, onClose)\n )}\n </GlobalContextMenu>\n )}\n </div>\n );\n}\n"]}
@@ -26,7 +26,7 @@ export function useCursorPrompt(args) {
26
26
  lastArgsRef.current = args;
27
27
  }, [args]);
28
28
  // eslint-disable-next-line @typescript-eslint/no-deprecated
29
- const timerRef = React.useRef();
29
+ const timerRef = React.useRef(undefined);
30
30
  const [isOpen, setIsOpen] = React.useState(false);
31
31
  const dragged = !!useDraggedItem();
32
32
  // Workaround to make sure the prompt is not shown when dragging a widget.
@@ -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,MA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IAEP,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,CAAC;QAC/C,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,SAAS,YAAY,CAAC,EACpB,QAAQ,EACR,WAAW,GAIZ;IACC,OAAO,CACL,6BAAK,SAAS,EAAC,oBAAoB;QAChC,QAAQ,IAAI,CACX,8BAAM,SAAS,EAAC,yBAAyB;YAEvC,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACR;QACD,oBAAC,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 { 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>();\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,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,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,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAClC,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,CAAC;QAC/C,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC;AAED,SAAS,YAAY,CAAC,EACpB,QAAQ,EACR,WAAW,GAIZ;IACC,OAAO,CACL,6BAAK,SAAS,EAAC,oBAAoB;QAChC,QAAQ,IAAI,CACX,8BAAM,SAAS,EAAC,yBAAyB;YAEvC,oBAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,GAAI,CACvB,CACR;QACD,oBAAC,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 { 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"]}
@@ -21,8 +21,8 @@ import { useTranslation } from "../hooks/useTranslation.js";
21
21
  export function UiDataProvidedDialog({ uiDataProvider, id, isModal, title, movable, resizable, minWidth, minHeight, maxWidth, maxHeight, width, height, style, }) {
22
22
  const dialogId = React.useRef(id ? id : getUniqueId());
23
23
  const dialogIsModal = React.useRef(isModal);
24
- const onOK = React.useRef();
25
- const onCancel = React.useRef();
24
+ const onOK = React.useRef(undefined);
25
+ const onCancel = React.useRef(undefined);
26
26
  const closeDialog = () => {
27
27
  if (dialogIsModal.current)
28
28
  UiFramework.dialogs.modal.close();