@itwin/appui-react 5.15.2 → 5.16.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 (71) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/lib/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  3. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts +1 -1
  4. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  5. package/lib/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  6. package/lib/appui-react/content/ContentGroup.js +1 -1
  7. package/lib/appui-react/content/ContentGroup.js.map +1 -1
  8. package/lib/appui-react/content/FloatingViewportContent.js +1 -1
  9. package/lib/appui-react/content/FloatingViewportContent.js.map +1 -1
  10. package/lib/appui-react/content/split-pane/Pane.d.ts +1 -1
  11. package/lib/appui-react/content/split-pane/Pane.d.ts.map +1 -1
  12. package/lib/appui-react/content/split-pane/Pane.js.map +1 -1
  13. package/lib/appui-react/content/split-pane/SplitPane.js +1 -1
  14. package/lib/appui-react/content/split-pane/SplitPane.js.map +1 -1
  15. package/lib/appui-react/cursor/cursormenu/CursorMenu.js +1 -1
  16. package/lib/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  17. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js +1 -1
  18. package/lib/appui-react/cursor/cursorprompt/CursorPrompt.js.map +1 -1
  19. package/lib/appui-react/dialog/UiDataProvidedDialog.js +2 -2
  20. package/lib/appui-react/dialog/UiDataProvidedDialog.js.map +1 -1
  21. package/lib/appui-react/framework/FrameworkFrontstages.d.ts +5 -0
  22. package/lib/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
  23. package/lib/appui-react/framework/FrameworkFrontstages.js.map +1 -1
  24. package/lib/appui-react/hooks/useLatestRef.d.ts +1 -1
  25. package/lib/appui-react/hooks/useLatestRef.d.ts.map +1 -1
  26. package/lib/appui-react/layout/StandardLayout.scss +0 -1
  27. package/lib/appui-react/layout/tool-settings/Docked.js.map +1 -1
  28. package/lib/appui-react/layout/widget/Tab.js +2 -2
  29. package/lib/appui-react/layout/widget/Tab.js.map +1 -1
  30. package/lib/appui-react/layout/widget/TabBar.js +1 -1
  31. package/lib/appui-react/layout/widget/TabBar.js.map +1 -1
  32. package/lib/appui-react/layout/widget-panels/Grip.js +1 -1
  33. package/lib/appui-react/layout/widget-panels/Grip.js.map +1 -1
  34. package/lib/appui-react/layout/widget-panels/useAnimatePanel.d.ts +1 -1
  35. package/lib/appui-react/layout/widget-panels/useAnimatePanel.d.ts.map +1 -1
  36. package/lib/appui-react/layout/widget-panels/useAnimatePanel.js +3 -3
  37. package/lib/appui-react/layout/widget-panels/useAnimatePanel.js.map +1 -1
  38. package/lib/appui-react/messages/MessageRenderer.d.ts.map +1 -1
  39. package/lib/appui-react/messages/MessageRenderer.js +1 -1
  40. package/lib/appui-react/messages/MessageRenderer.js.map +1 -1
  41. package/lib/appui-react/pickers/ListPicker.d.ts.map +1 -1
  42. package/lib/appui-react/pickers/ListPicker.js +1 -1
  43. package/lib/appui-react/pickers/ListPicker.js.map +1 -1
  44. package/lib/appui-react/pickers/ListPicker.scss +10 -0
  45. package/lib/appui-react/settings/quantityformatting/QuantityFormat.d.ts.map +1 -1
  46. package/lib/appui-react/settings/quantityformatting/QuantityFormat.js +1 -1
  47. package/lib/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  48. package/lib/appui-react/statusbar/popup/Popup.js +1 -1
  49. package/lib/appui-react/statusbar/popup/Popup.js.map +1 -1
  50. package/lib/appui-react/statusbar/popup/StatusBarPopover.js +1 -1
  51. package/lib/appui-react/statusbar/popup/StatusBarPopover.js.map +1 -1
  52. package/lib/appui-react/statusfields/SnapMode.js +1 -1
  53. package/lib/appui-react/statusfields/SnapMode.js.map +1 -1
  54. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  55. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +1 -1
  56. package/lib/appui-react/toolbar/new-toolbars/ToolGroup.js.map +1 -1
  57. package/lib/appui-react/toolbar/new-toolbars/useOverflow.js +2 -2
  58. package/lib/appui-react/toolbar/new-toolbars/useOverflow.js.map +1 -1
  59. package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  60. package/lib/appui-react/uiprovider/ComponentGenerator.d.ts.map +1 -1
  61. package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  62. package/lib/appui-react/widget-panels/ToolSettings.d.ts +1 -1
  63. package/lib/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
  64. package/lib/appui-react/widget-panels/ToolSettings.js.map +1 -1
  65. package/lib/cjs/appui-react/layout/StandardLayout.scss +0 -1
  66. package/lib/cjs/appui-react/pickers/ListPicker.scss +10 -0
  67. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +1 -1
  68. package/lib/esm/appui-react/layout/StandardLayout.scss +0 -1
  69. package/lib/esm/appui-react/pickers/ListPicker.scss +10 -0
  70. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +1 -1
  71. package/package.json +16 -16
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentGenerator.js","sourceRoot":"","sources":["../../../src/appui-react/uiprovider/ComponentGenerator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,yBAA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AAS,cAAc,CACrB,cAAoC,EACpC,YAAoB,EACpB,MAAe;IAEf,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;QACpD,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC;AACxD,CAAC;AASD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,GACpE,KAAK,CAAC;IACR,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAChE,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxC,OAAO,eAAe,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAExC,MAAM,UAAU,GAAG,uBAAuB;QACxC,CAAC,CAAC,4DAA4D;QAC9D,CAAC,CAAC,6BAA6B,CAAC;IAClC,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU;QACvB,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;QACvC,KAAK,CACF,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 UiProvider\n */\n\nimport \"./DefaultDialogGridContainer.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n BaseDialogItem,\n DialogItem,\n DialogItemValue,\n DialogPropertySyncItem,\n DialogRow,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n UiLayoutDataProvider,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"@itwin/components-react\";\nimport { EditorContainer, PropertyRecordEditor } from \"@itwin/components-react\";\nimport { assert, Logger } from \"@itwin/core-bentley\";\nimport { Label } from \"@itwin/itwinui-react\";\nimport { useToolSettingsNewEditors } from \"../preview/tool-settings-new-editors/useToolSettingsNewEditors.js\";\nimport type { ToolSettingsEntry } from \"../widget-panels/ToolSettings.js\";\nimport { useLockButtonPropertyRecord } from \"../preview/tool-settings-lock-button/useToolSettingsLockButton.js\";\nimport {\n LockContext,\n PropertyEditorProvider,\n} from \"../editors/LockProvider.js\";\n\nfunction EditorLabel({\n uiDataProvider,\n item,\n isLeftmostRecord,\n}: {\n uiDataProvider: UiLayoutDataProvider;\n item: DialogItem;\n isLeftmostRecord?: boolean;\n}) {\n const [isDisabled, setIsDisabled] = React.useState(!!item.isDisabled);\n const displayLabel = React.useMemo(() => {\n return item.property.displayLabel || item.property.name;\n }, [item]);\n\n // listen for tool sync property events and update the isDisabled state\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem) => syncItem.propertyName === item.property.name\n );\n if (mySyncItem) {\n setIsDisabled(!!mySyncItem.isDisabled);\n }\n });\n }, [uiDataProvider, item]);\n\n const className = classnames(\n \"uifw-default-label\",\n !!isLeftmostRecord && \"uifw-default-narrow-only-display\"\n );\n return (\n <Label\n className={className}\n htmlFor={item.property.name}\n disabled={isDisabled}\n >\n {displayLabel}:\n </Label>\n );\n}\n\nfunction PropertyEditor(props: {\n uiDataProvider: UiLayoutDataProvider;\n // Property or a lock property.\n initialItem: BaseDialogItem;\n // If a lock property is rendered, this prop contains the property name of the property that the lock property locks.\n itemPropertyName: string;\n isLock?: boolean;\n setFocus?: boolean;\n onCancel?: () => void;\n}) {\n const {\n uiDataProvider,\n initialItem,\n itemPropertyName,\n isLock = false,\n setFocus,\n onCancel,\n } = props;\n const getLatestRecordValue = React.useCallback(\n (initial: BaseDialogItem) => {\n let newRecord = UiLayoutDataProvider.getPropertyRecord(initial);\n\n const foundItem = isLock\n ? uiDataProvider.items.find(\n (item) => item.lockProperty?.property.name === initial.property.name\n )\n : uiDataProvider.items.find(\n (item) => item.property.name === initial.property.name\n );\n if (foundItem) {\n if (isLock) {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.lockProperty!.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.lockProperty!.isDisabled;\n } else {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.isDisabled;\n }\n }\n return newRecord;\n },\n [isLock, uiDataProvider.items]\n );\n\n const currentRecord = getLatestRecordValue(initialItem);\n const [_propertyRecord, setPropertyRecord] = React.useState(currentRecord);\n const propertyRecord = useLockButtonPropertyRecord(_propertyRecord, isLock);\n\n // monitor tool for sync UI events\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === initialItem.property.name\n );\n if (mySyncItem) {\n const newPropertyValue = propertyRecord.copyWithNewValue(\n {\n value: mySyncItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n displayValue: mySyncItem.value.displayValue,\n },\n mySyncItem.property\n );\n\n if (mySyncItem.property) {\n if (mySyncItem.property.name === mySyncItem.propertyName) {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n } else {\n Logger.logError(\n \"PropertyEditor\",\n `Error trying to replace propertyName=${mySyncItem.propertyName} with property named ${mySyncItem.property.name}`\n );\n }\n } else {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n }\n }\n });\n }, [uiDataProvider, propertyRecord, initialItem.property.name]);\n\n React.useEffect(() => {\n return uiDataProvider.onItemsReloadedEvent.addListener(() => {\n const newItem = findDialogItem(\n uiDataProvider,\n initialItem.property.name,\n isLock\n );\n if (!newItem) return;\n setPropertyRecord(getLatestRecordValue(newItem));\n });\n }, [uiDataProvider, initialItem.property.name, getLatestRecordValue, isLock]);\n\n const className = React.useMemo(\n () => (isLock ? \"uifw-default-property-lock\" : \"uifw-default-editor\"),\n [isLock]\n );\n const handleCommit = React.useCallback(\n (commit: PropertyUpdatedArgs) => {\n // UiLayoutDataProvider supports only primitive property types\n assert(\n commit.newValue.valueFormat === PropertyValueFormat.Primitive &&\n commit.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n );\n const newPropertyValue = propertyRecord.copyWithNewValue(commit.newValue);\n const syncItem: DialogPropertySyncItem = {\n value: commit.newValue as DialogItemValue,\n propertyName: initialItem.property.name,\n isDisabled: newPropertyValue.isDisabled,\n };\n uiDataProvider.applyUiPropertyChange(syncItem);\n // Now have the uiDataProvider refetch the latest property values from the tool\n uiDataProvider.reloadDialogItems(true);\n },\n [initialItem.property.name, propertyRecord, uiDataProvider]\n );\n const handleCancel = () => {};\n\n const useNewEditors = useToolSettingsNewEditors();\n\n const lockPropertyName = isLock ? initialItem.property.name : undefined;\n return (\n <PropertyEditorProvider\n uiDataProvider={uiDataProvider}\n itemPropertyName={itemPropertyName ?? initialItem.property.name}\n lockPropertyName={lockPropertyName}\n >\n <div key={initialItem.property.name} className={className}>\n {useNewEditors ? (\n <PropertyRecordEditor\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n editorSystem=\"new\"\n size=\"small\"\n />\n ) : (\n <EditorContainer\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n />\n )}\n </div>\n </PropertyEditorProvider>\n );\n}\n\n/** Utility methods to generate react ui from DialogRow specs\n * @public\n */\nexport class ComponentGenerator {\n constructor(\n private _uiDataProvider: UiLayoutDataProvider,\n private _onCancel?: () => void\n ) {}\n\n public get uiDataProvider() {\n return this._uiDataProvider;\n }\n\n private getEditor(\n item: BaseDialogItem,\n isLock = false,\n setFocus = false,\n itemPropertyName?: string\n ): React.ReactNode {\n return (\n <PropertyEditor\n key={item.property.name}\n uiDataProvider={this.uiDataProvider}\n initialItem={item}\n itemPropertyName={itemPropertyName ?? item.property.name}\n isLock={isLock}\n setFocus={setFocus}\n onCancel={this._onCancel}\n />\n );\n }\n\n private generateRowWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): React.ReactNode {\n if (1 === row.items.length) {\n return (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n );\n }\n\n return (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item) => this.getEditor(item))}\n </div>\n </div>\n );\n }\n\n private generateEntryWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n if (1 === row.items.length) {\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n ),\n };\n }\n\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item) => this.getEditor(item))}\n </div>\n </div>\n ),\n };\n }\n\n private getEditorLabel(\n item: DialogItem,\n isLeftmostRecord = false\n ): React.ReactNode {\n return (\n <EditorLabel\n uiDataProvider={this.uiDataProvider}\n item={item}\n isLeftmostRecord={isLeftmostRecord}\n />\n );\n }\n\n private getLeftLockAndLabel(\n rowItem: DialogItem,\n multiplePropertiesOnRow: boolean\n ): React.ReactNode {\n const record = UiLayoutDataProvider.getPropertyRecord(rowItem);\n const lockEditor = UiLayoutDataProvider.hasAssociatedLockProperty(rowItem)\n ? this.getEditor(rowItem.lockProperty!, true)\n : null;\n const label = UiLayoutDataProvider.editorWantsLabel(rowItem)\n ? this.getEditorLabel(rowItem)\n : null;\n return (\n <LeftLockAndLabel\n key={`lock-${record.property.name}`}\n lockEditor={lockEditor}\n label={label}\n multiplePropertiesOnRow={multiplePropertiesOnRow}\n itemPropertyName={rowItem.property.name}\n />\n );\n }\n\n private getInlineLabelAndEditor(\n item: DialogItem,\n isLeftmostRecord: boolean\n ): React.ReactNode {\n const label = UiLayoutDataProvider.editorWantsLabel(item)\n ? this.getEditorLabel(item, isLeftmostRecord)\n : null;\n return (\n <div\n key={item.property.name}\n className=\"uifw-default-inline-label-and-editor\"\n >\n {label}\n {this.getEditor(item)}\n </div>\n );\n }\n\n private getRowWithMultipleEditors(row: DialogRow): React.ReactNode {\n return (\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item: DialogItem, index: number) =>\n this.getInlineLabelAndEditor(item, index === 0)\n )}\n </div>\n );\n }\n\n private getDivForRow(row: DialogRow): React.ReactNode {\n if (row.items.length === 1) return this.getEditor(row.items[0]);\n return this.getRowWithMultipleEditors(row);\n }\n\n public getRow(row: DialogRow, rowIndex: number): React.ReactNode {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateRowWithButtonGroupEditors(row, rowIndex);\n } else {\n return (\n <React.Fragment key={rowIndex}>\n {this.getLeftLockAndLabel(row.items[0], row.items.length > 1)}\n {this.getDivForRow(row)}\n </React.Fragment>\n );\n }\n }\n\n public getToolSettingsEntry(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateEntryWithButtonGroupEditors(row, rowIndex);\n } else {\n return {\n labelNode: this.getLeftLockAndLabel(row.items[0], row.items.length > 1),\n editorNode: this.getDivForRow(row),\n };\n }\n }\n\n /** ToolSettingsEntries are used by the tool settings bar. */\n public getToolSettingsEntries(): ToolSettingsEntry[] {\n return this.uiDataProvider.rows.map((row: DialogRow, index: number) =>\n this.getToolSettingsEntry(row, index)\n );\n }\n}\n\nfunction findDialogItem(\n uiDataProvider: UiLayoutDataProvider,\n propertyName: string,\n isLock: boolean\n) {\n const dialogItem = uiDataProvider.items.find((item) => {\n if (isLock) {\n return item.lockProperty?.property.name === propertyName;\n }\n return item.property.name === propertyName;\n });\n return isLock ? dialogItem?.lockProperty : dialogItem;\n}\n\ninterface LeftLockAndLabelProps {\n lockEditor?: React.ReactNode;\n label?: React.ReactNode;\n multiplePropertiesOnRow: boolean;\n itemPropertyName: string;\n}\n\nfunction LeftLockAndLabel(props: LeftLockAndLabelProps) {\n const { lockEditor, label, multiplePropertiesOnRow, itemPropertyName } =\n props;\n const { lockDecorations } = React.useContext(LockContext) ?? {};\n const lockDecoration = React.useMemo(() => {\n return lockDecorations?.[itemPropertyName];\n }, [lockDecorations, itemPropertyName]);\n\n const classNames = multiplePropertiesOnRow\n ? \"uifw-default-lock-and-label uifw-default-wide-only-display\"\n : \"uifw-default-lock-and-label\";\n return (\n <div className={classNames}>\n {lockDecoration ? undefined : lockEditor}\n {label}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ComponentGenerator.js","sourceRoot":"","sources":["../../../src/appui-react/uiprovider/ComponentGenerator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GAC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C,UAAU;QACvC,KAAK,CACF,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 UiProvider\n */\n\nimport \"./DefaultDialogGridContainer.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n BaseDialogItem,\n DialogItem,\n DialogItemValue,\n DialogPropertySyncItem,\n DialogRow,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n UiLayoutDataProvider,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"@itwin/components-react\";\nimport { EditorContainer, PropertyRecordEditor } from \"@itwin/components-react\";\nimport { assert, Logger } from \"@itwin/core-bentley\";\nimport { Label } from \"@itwin/itwinui-react\";\nimport { useToolSettingsNewEditors } from \"../preview/tool-settings-new-editors/useToolSettingsNewEditors.js\";\nimport type { ToolSettingsEntry } from \"../widget-panels/ToolSettings.js\";\nimport { useLockButtonPropertyRecord } from \"../preview/tool-settings-lock-button/useToolSettingsLockButton.js\";\nimport {\n LockContext,\n PropertyEditorProvider,\n} from \"../editors/LockProvider.js\";\n\nfunction EditorLabel({\n uiDataProvider,\n item,\n isLeftmostRecord,\n}: {\n uiDataProvider: UiLayoutDataProvider;\n item: DialogItem;\n isLeftmostRecord?: boolean;\n}) {\n const [isDisabled, setIsDisabled] = React.useState(!!item.isDisabled);\n const displayLabel = React.useMemo(() => {\n return item.property.displayLabel || item.property.name;\n }, [item]);\n\n // listen for tool sync property events and update the isDisabled state\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem) => syncItem.propertyName === item.property.name\n );\n if (mySyncItem) {\n setIsDisabled(!!mySyncItem.isDisabled);\n }\n });\n }, [uiDataProvider, item]);\n\n const className = classnames(\n \"uifw-default-label\",\n !!isLeftmostRecord && \"uifw-default-narrow-only-display\"\n );\n return (\n <Label\n className={className}\n htmlFor={item.property.name}\n disabled={isDisabled}\n >\n {displayLabel}:\n </Label>\n );\n}\n\nfunction PropertyEditor(props: {\n uiDataProvider: UiLayoutDataProvider;\n // Property or a lock property.\n initialItem: BaseDialogItem;\n // If a lock property is rendered, this prop contains the property name of the property that the lock property locks.\n itemPropertyName: string;\n isLock?: boolean;\n setFocus?: boolean;\n onCancel?: () => void;\n}) {\n const {\n uiDataProvider,\n initialItem,\n itemPropertyName,\n isLock = false,\n setFocus,\n onCancel,\n } = props;\n const getLatestRecordValue = React.useCallback(\n (initial: BaseDialogItem) => {\n let newRecord = UiLayoutDataProvider.getPropertyRecord(initial);\n\n const foundItem = isLock\n ? uiDataProvider.items.find(\n (item) => item.lockProperty?.property.name === initial.property.name\n )\n : uiDataProvider.items.find(\n (item) => item.property.name === initial.property.name\n );\n if (foundItem) {\n if (isLock) {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.lockProperty!.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.lockProperty!.isDisabled;\n } else {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.isDisabled;\n }\n }\n return newRecord;\n },\n [isLock, uiDataProvider.items]\n );\n\n const currentRecord = getLatestRecordValue(initialItem);\n const [_propertyRecord, setPropertyRecord] = React.useState(currentRecord);\n const propertyRecord = useLockButtonPropertyRecord(_propertyRecord, isLock);\n\n // monitor tool for sync UI events\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === initialItem.property.name\n );\n if (mySyncItem) {\n const newPropertyValue = propertyRecord.copyWithNewValue(\n {\n value: mySyncItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n displayValue: mySyncItem.value.displayValue,\n },\n mySyncItem.property\n );\n\n if (mySyncItem.property) {\n if (mySyncItem.property.name === mySyncItem.propertyName) {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n } else {\n Logger.logError(\n \"PropertyEditor\",\n `Error trying to replace propertyName=${mySyncItem.propertyName} with property named ${mySyncItem.property.name}`\n );\n }\n } else {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n }\n }\n });\n }, [uiDataProvider, propertyRecord, initialItem.property.name]);\n\n React.useEffect(() => {\n return uiDataProvider.onItemsReloadedEvent.addListener(() => {\n const newItem = findDialogItem(\n uiDataProvider,\n initialItem.property.name,\n isLock\n );\n if (!newItem) return;\n setPropertyRecord(getLatestRecordValue(newItem));\n });\n }, [uiDataProvider, initialItem.property.name, getLatestRecordValue, isLock]);\n\n const className = React.useMemo(\n () => (isLock ? \"uifw-default-property-lock\" : \"uifw-default-editor\"),\n [isLock]\n );\n const handleCommit = React.useCallback(\n (commit: PropertyUpdatedArgs) => {\n // UiLayoutDataProvider supports only primitive property types\n assert(\n commit.newValue.valueFormat === PropertyValueFormat.Primitive &&\n commit.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n );\n const newPropertyValue = propertyRecord.copyWithNewValue(commit.newValue);\n const syncItem: DialogPropertySyncItem = {\n value: commit.newValue as DialogItemValue,\n propertyName: initialItem.property.name,\n isDisabled: newPropertyValue.isDisabled,\n };\n uiDataProvider.applyUiPropertyChange(syncItem);\n // Now have the uiDataProvider refetch the latest property values from the tool\n uiDataProvider.reloadDialogItems(true);\n },\n [initialItem.property.name, propertyRecord, uiDataProvider]\n );\n const handleCancel = () => {};\n\n const useNewEditors = useToolSettingsNewEditors();\n\n const lockPropertyName = isLock ? initialItem.property.name : undefined;\n return (\n <PropertyEditorProvider\n uiDataProvider={uiDataProvider}\n itemPropertyName={itemPropertyName ?? initialItem.property.name}\n lockPropertyName={lockPropertyName}\n >\n <div key={initialItem.property.name} className={className}>\n {useNewEditors ? (\n <PropertyRecordEditor\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n editorSystem=\"new\"\n size=\"small\"\n />\n ) : (\n <EditorContainer\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n />\n )}\n </div>\n </PropertyEditorProvider>\n );\n}\n\n/** Utility methods to generate react ui from DialogRow specs\n * @public\n */\nexport class ComponentGenerator {\n constructor(\n private _uiDataProvider: UiLayoutDataProvider,\n private _onCancel?: () => void\n ) {}\n\n public get uiDataProvider() {\n return this._uiDataProvider;\n }\n\n private getEditor(\n item: BaseDialogItem,\n isLock = false,\n setFocus = false,\n itemPropertyName?: string\n ): React.ReactNode {\n return (\n <PropertyEditor\n key={item.property.name}\n uiDataProvider={this.uiDataProvider}\n initialItem={item}\n itemPropertyName={itemPropertyName ?? item.property.name}\n isLock={isLock}\n setFocus={setFocus}\n onCancel={this._onCancel}\n />\n );\n }\n\n private generateRowWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): React.ReactNode {\n if (1 === row.items.length) {\n return (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n );\n }\n\n return (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item): React.ReactNode => this.getEditor(item))}\n </div>\n </div>\n );\n }\n\n private generateEntryWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n if (1 === row.items.length) {\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n ),\n };\n }\n\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item): React.ReactNode => this.getEditor(item))}\n </div>\n </div>\n ),\n };\n }\n\n private getEditorLabel(\n item: DialogItem,\n isLeftmostRecord = false\n ): React.ReactNode {\n return (\n <EditorLabel\n uiDataProvider={this.uiDataProvider}\n item={item}\n isLeftmostRecord={isLeftmostRecord}\n />\n );\n }\n\n private getLeftLockAndLabel(\n rowItem: DialogItem,\n multiplePropertiesOnRow: boolean\n ): React.ReactNode {\n const record = UiLayoutDataProvider.getPropertyRecord(rowItem);\n const lockEditor = UiLayoutDataProvider.hasAssociatedLockProperty(rowItem)\n ? this.getEditor(rowItem.lockProperty!, true)\n : null;\n const label = UiLayoutDataProvider.editorWantsLabel(rowItem)\n ? this.getEditorLabel(rowItem)\n : null;\n return (\n <LeftLockAndLabel\n key={`lock-${record.property.name}`}\n lockEditor={lockEditor}\n label={label}\n multiplePropertiesOnRow={multiplePropertiesOnRow}\n itemPropertyName={rowItem.property.name}\n />\n );\n }\n\n private getInlineLabelAndEditor(\n item: DialogItem,\n isLeftmostRecord: boolean\n ): React.ReactNode {\n const label = UiLayoutDataProvider.editorWantsLabel(item)\n ? this.getEditorLabel(item, isLeftmostRecord)\n : null;\n return (\n <div\n key={item.property.name}\n className=\"uifw-default-inline-label-and-editor\"\n >\n {label}\n {this.getEditor(item)}\n </div>\n );\n }\n\n private getRowWithMultipleEditors(row: DialogRow): React.ReactNode {\n return (\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map(\n (item: DialogItem, index: number): React.ReactNode =>\n this.getInlineLabelAndEditor(item, index === 0)\n )}\n </div>\n );\n }\n\n private getDivForRow(row: DialogRow): React.ReactNode {\n if (row.items.length === 1) return this.getEditor(row.items[0]);\n return this.getRowWithMultipleEditors(row);\n }\n\n public getRow(row: DialogRow, rowIndex: number): React.ReactNode {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateRowWithButtonGroupEditors(row, rowIndex);\n } else {\n return (\n <React.Fragment key={rowIndex}>\n {this.getLeftLockAndLabel(row.items[0], row.items.length > 1)}\n {this.getDivForRow(row)}\n </React.Fragment>\n );\n }\n }\n\n public getToolSettingsEntry(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateEntryWithButtonGroupEditors(row, rowIndex);\n } else {\n return {\n labelNode: this.getLeftLockAndLabel(row.items[0], row.items.length > 1),\n editorNode: this.getDivForRow(row),\n };\n }\n }\n\n /** ToolSettingsEntries are used by the tool settings bar. */\n public getToolSettingsEntries(): ToolSettingsEntry[] {\n return this.uiDataProvider.rows.map((row: DialogRow, index: number) =>\n this.getToolSettingsEntry(row, index)\n );\n }\n}\n\nfunction findDialogItem(\n uiDataProvider: UiLayoutDataProvider,\n propertyName: string,\n isLock: boolean\n) {\n const dialogItem = uiDataProvider.items.find((item) => {\n if (isLock) {\n return item.lockProperty?.property.name === propertyName;\n }\n return item.property.name === propertyName;\n });\n return isLock ? dialogItem?.lockProperty : dialogItem;\n}\n\ninterface LeftLockAndLabelProps {\n lockEditor?: React.ReactNode;\n label?: React.ReactNode;\n multiplePropertiesOnRow: boolean;\n itemPropertyName: string;\n}\n\nfunction LeftLockAndLabel(props: LeftLockAndLabelProps) {\n const { lockEditor, label, multiplePropertiesOnRow, itemPropertyName } =\n props;\n const { lockDecorations } = React.useContext(LockContext) ?? {};\n const lockDecoration = React.useMemo(() => {\n return lockDecorations?.[itemPropertyName];\n }, [lockDecorations, itemPropertyName]);\n\n const classNames = multiplePropertiesOnRow\n ? \"uifw-default-lock-and-label uifw-default-wide-only-display\"\n : \"uifw-default-lock-and-label\";\n return (\n <div className={classNames}>\n {lockDecoration ? undefined : lockEditor}\n {label}\n </div>\n );\n}\n"]}
@@ -21,7 +21,7 @@ export declare function ToolSettingsDockedContent(): React.JSX.Element;
21
21
  /** @internal */
22
22
  export declare function useHorizontalToolSettingEntries(): ToolSettingsEntry[] | undefined;
23
23
  /** @internal */
24
- export declare function useToolSettingsNode(): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | null | undefined;
24
+ export declare function useToolSettingsNode(): React.ReactNode;
25
25
  /** @internal */
26
26
  export declare function ToolSettingsContent(): React.JSX.Element | null;
27
27
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"ToolSettings.d.ts","sourceRoot":"","sources":["../../../src/appui-react/widget-panels/ToolSettings.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,qBAAqB,CAAC;AAS7B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAeD;;eAEe;AACf,wBAAgB,iCAAiC,YAMhD;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,6BAGvC;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,sBA+CxC;AAED,gBAAgB;AAChB,wBAAgB,+BAA+B,oCA4B9C;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,sKAwBlC;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,6BAKlC;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,sBA2BxC"}
1
+ {"version":3,"file":"ToolSettings.d.ts","sourceRoot":"","sources":["../../../src/appui-react/widget-panels/ToolSettings.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,qBAAqB,CAAC;AAS7B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,UAAU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e;QAEpB,oBAAC,uBAAuB;YACtB,oBAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI;gBACvC,oBAAC,2BAA2B,QACzB,IAAI,IAAI,aAAa,EAAE,mBAAmB,IAAI,CAC7C,oBAAC,sBAAsB,IAAC,MAAM,EAAE,YAAY,GAAI,CACjD,CAC2B,CACD,CACP,CACtB,CACP,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,gBAAqB;IAC1C,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACzE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,+EAA+E;QAC/E,0BAA0B;QAC1B,kBAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACvB,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ToolSettings\n */\n\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager.js\";\nimport { useLayout } from \"../layout/base/LayoutStore.js\";\nimport { DockedToolSettings } from \"../layout/tool-settings/Docked.js\";\nimport { DockedToolSetting } from \"../layout/tool-settings/Setting.js\";\nimport { ScrollableWidgetContent } from \"../layout/widget/Content.js\";\nimport \"./ToolSettings.scss\";\nimport { useActiveToolId } from \"../hooks/useActiveToolId.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { DockedBar } from \"./DockedBar.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { LockProvider } from \"../editors/LockProvider.js\";\nimport { ToolSettingsEditorsProvider } from \"../preview/tool-settings-lock-button/useToolSettingsLockButton.js\";\nimport { ToolSettingsContext } from \"../preview/tool-settings-key-press-commit/useToolSettingsKeyPressCommit.js\";\n\n/** Defines a ToolSettings property entry.\n * @public\n */\nexport interface ToolSettingsEntry {\n // label node which potentially can contain a lock node as well.\n labelNode: React.ReactNode;\n // editor entry used to display and edit the property value\n editorNode: React.ReactNode;\n}\n\nfunction EmptyToolSettingsLabel({ toolId }: { toolId?: string }) {\n const { translate } = useTranslation();\n const tool = toolId ? IModelApp.tools.find(toolId) : undefined;\n const toolName = tool?.flyover;\n return (\n <Text as=\"i\" isMuted={true} className=\"uifw-toolSettings-label-empty\">\n {translate(\"tools.noToolSettingsStart\")}\n {toolName || translate(\"tools.noToolSettingsPlaceholderName\")}\n {translate(\"tools.noToolSettingsEnd\")}\n </Text>\n );\n}\n\n/**\n * Hook that returns true if the tool settings should be rendered docked.\n * @internal */\nexport function useShouldRenderDockedToolSettings() {\n return useLayout((state) => {\n const toolSettings = state.toolSettings;\n if (!toolSettings || toolSettings.type === \"widget\") return false;\n return !toolSettings.hidden;\n });\n}\n\n/** @internal */\nexport function WidgetPanelsToolSettings() {\n if (!useShouldRenderDockedToolSettings()) return null;\n return <ToolSettingsDockedContent />;\n}\n\n/** @internal */\nexport function ToolSettingsDockedContent() {\n const activeToolId = useActiveToolId();\n const toolSettingEntries = useHorizontalToolSettingEntries();\n const forceRefreshKey = useRefreshKey(toolSettingEntries);\n const frontstageDef = useActiveFrontstageDef();\n\n const emptySettings = React.useMemo<ToolSettingsEntry[]>(\n () => [\n {\n editorNode: null,\n labelNode: frontstageDef?.activeToolEmptyNode ?? (\n <EmptyToolSettingsLabel toolId={activeToolId} />\n ),\n },\n ],\n [activeToolId, frontstageDef]\n );\n const entries =\n !toolSettingEntries || toolSettingEntries.length === 0\n ? emptySettings\n : toolSettingEntries;\n\n // for the overflow to work properly each setting in the DockedToolSettings should be wrapped by a DockedToolSetting component\n return (\n <DockedBar placement=\"top\">\n <ToolSettingsContext.Provider value={true}>\n <ToolSettingsEditorsProvider>\n <DockedToolSettings\n itemId={\n InternalFrontstageManager.activeToolSettingsProvider?.uniqueId ??\n \"none\"\n }\n key={forceRefreshKey}\n >\n {entries.map((entry, index) => (\n <DockedToolSetting key={index}>\n <LockProvider>\n {entry.labelNode}\n {entry.editorNode}\n </LockProvider>\n </DockedToolSetting>\n ))}\n </DockedToolSettings>\n </ToolSettingsEditorsProvider>\n </ToolSettingsContext.Provider>\n </DockedBar>\n );\n}\n\n/** @internal */\nexport function useHorizontalToolSettingEntries() {\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.frontstages.activeToolInformation?.toolUiProvider?.reloadPropertiesFromTool();\n }, []);\n const [settings, setSettings] = React.useState(\n InternalFrontstageManager.activeToolSettingsProvider\n ?.horizontalToolSettingNodes\n );\n React.useEffect(() => {\n return UiFramework.frontstages.onToolActivatedEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider\n ?.horizontalToolSettingNodes;\n setSettings(nodes);\n });\n }, []);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider\n ?.horizontalToolSettingNodes;\n setSettings(nodes);\n });\n }, []);\n\n return settings;\n}\n\n/** @internal */\nexport function useToolSettingsNode() {\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.frontstages.activeToolInformation?.toolUiProvider?.reloadPropertiesFromTool();\n }, []);\n const [settings, setSettings] = React.useState(\n InternalFrontstageManager.activeToolSettingsProvider?.toolSettingsNode\n );\n React.useEffect(() => {\n return UiFramework.frontstages.onToolActivatedEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider?.toolSettingsNode;\n setSettings(nodes);\n });\n }, [setSettings]);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider?.toolSettingsNode;\n setSettings(nodes);\n });\n }, [setSettings]);\n return settings;\n}\n\n/** @internal */\nexport function ToolSettingsContent() {\n const toolSettingsType = useLayout((state) => state.toolSettings?.type);\n // This is needed to remount underlying components tree when going into widget state.\n if (!toolSettingsType || toolSettingsType === \"docked\") return null;\n return <ToolSettingsWidgetContent />;\n}\n\n/** @internal */\nexport function ToolSettingsWidgetContent() {\n const floatingToolSettingsContainerRef = React.useRef<HTMLDivElement>(null);\n const node = useToolSettingsNode();\n const activeToolId = useActiveToolId();\n const forceRefreshKey = useRefreshKey(node);\n const frontstageDef = useActiveFrontstageDef();\n\n const providerId =\n InternalFrontstageManager.activeToolSettingsProvider?.uniqueId ?? \"none\";\n return (\n <div\n data-toolsettings-provider={providerId}\n className=\"uifw-floating-toolSettings-container\"\n ref={floatingToolSettingsContainerRef}\n key={forceRefreshKey}\n >\n <ScrollableWidgetContent>\n <ToolSettingsContext.Provider value={true}>\n <ToolSettingsEditorsProvider>\n {node ?? frontstageDef?.activeToolEmptyNode ?? (\n <EmptyToolSettingsLabel toolId={activeToolId} />\n )}\n </ToolSettingsEditorsProvider>\n </ToolSettingsContext.Provider>\n </ScrollableWidgetContent>\n </div>\n );\n}\n\n/**\n * Hook that returns a key that can be used to force refresh the tool settings.\n * @param toolSettingNodes Nodes that are used to determine if the tool settings should be refreshed.\n * @returns a new key if the dependency changes.\n */\nfunction useRefreshKey(toolSettingNodes: any) {\n const [forceRefreshKey, setForceRefreshKey] = React.useState(Date.now());\n React.useEffect(() => {\n // We cant work with the content of the settings, but we can force refresh when\n // the array is different.\n setForceRefreshKey(Date.now());\n }, [toolSettingNodes]);\n return forceRefreshKey;\n}\n"]}
1
+ {"version":3,"file":"ToolSettings.js","sourceRoot":"","sources":["../../../src/appui-react/widget-panels/ToolSettings.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,+EAA+E;QAC/E,0BAA0B;QAC1B,kBAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACvB,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ToolSettings\n */\n\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { Text } from \"@itwin/itwinui-react\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { InternalFrontstageManager } from \"../frontstage/InternalFrontstageManager.js\";\nimport { useLayout } from \"../layout/base/LayoutStore.js\";\nimport { DockedToolSettings } from \"../layout/tool-settings/Docked.js\";\nimport { DockedToolSetting } from \"../layout/tool-settings/Setting.js\";\nimport { ScrollableWidgetContent } from \"../layout/widget/Content.js\";\nimport \"./ToolSettings.scss\";\nimport { useActiveToolId } from \"../hooks/useActiveToolId.js\";\nimport { useTranslation } from \"../hooks/useTranslation.js\";\nimport { DockedBar } from \"./DockedBar.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { LockProvider } from \"../editors/LockProvider.js\";\nimport { ToolSettingsEditorsProvider } from \"../preview/tool-settings-lock-button/useToolSettingsLockButton.js\";\nimport { ToolSettingsContext } from \"../preview/tool-settings-key-press-commit/useToolSettingsKeyPressCommit.js\";\n\n/** Defines a ToolSettings property entry.\n * @public\n */\nexport interface ToolSettingsEntry {\n // label node which potentially can contain a lock node as well.\n labelNode: React.ReactNode;\n // editor entry used to display and edit the property value\n editorNode: React.ReactNode;\n}\n\nfunction EmptyToolSettingsLabel({ toolId }: { toolId?: string }) {\n const { translate } = useTranslation();\n const tool = toolId ? IModelApp.tools.find(toolId) : undefined;\n const toolName = tool?.flyover;\n return (\n <Text as=\"i\" isMuted={true} className=\"uifw-toolSettings-label-empty\">\n {translate(\"tools.noToolSettingsStart\")}\n {toolName || translate(\"tools.noToolSettingsPlaceholderName\")}\n {translate(\"tools.noToolSettingsEnd\")}\n </Text>\n );\n}\n\n/**\n * Hook that returns true if the tool settings should be rendered docked.\n * @internal */\nexport function useShouldRenderDockedToolSettings() {\n return useLayout((state) => {\n const toolSettings = state.toolSettings;\n if (!toolSettings || toolSettings.type === \"widget\") return false;\n return !toolSettings.hidden;\n });\n}\n\n/** @internal */\nexport function WidgetPanelsToolSettings() {\n if (!useShouldRenderDockedToolSettings()) return null;\n return <ToolSettingsDockedContent />;\n}\n\n/** @internal */\nexport function ToolSettingsDockedContent() {\n const activeToolId = useActiveToolId();\n const toolSettingEntries = useHorizontalToolSettingEntries();\n const forceRefreshKey = useRefreshKey(toolSettingEntries);\n const frontstageDef = useActiveFrontstageDef();\n\n const emptySettings = React.useMemo<ToolSettingsEntry[]>(\n () => [\n {\n editorNode: null,\n labelNode: frontstageDef?.activeToolEmptyNode ?? (\n <EmptyToolSettingsLabel toolId={activeToolId} />\n ),\n },\n ],\n [activeToolId, frontstageDef]\n );\n const entries =\n !toolSettingEntries || toolSettingEntries.length === 0\n ? emptySettings\n : toolSettingEntries;\n\n // for the overflow to work properly each setting in the DockedToolSettings should be wrapped by a DockedToolSetting component\n return (\n <DockedBar placement=\"top\">\n <ToolSettingsContext.Provider value={true}>\n <ToolSettingsEditorsProvider>\n <DockedToolSettings\n itemId={\n InternalFrontstageManager.activeToolSettingsProvider?.uniqueId ??\n \"none\"\n }\n key={forceRefreshKey}\n >\n {entries.map((entry, index) => (\n <DockedToolSetting key={index}>\n <LockProvider>\n {entry.labelNode}\n {entry.editorNode}\n </LockProvider>\n </DockedToolSetting>\n ))}\n </DockedToolSettings>\n </ToolSettingsEditorsProvider>\n </ToolSettingsContext.Provider>\n </DockedBar>\n );\n}\n\n/** @internal */\nexport function useHorizontalToolSettingEntries() {\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.frontstages.activeToolInformation?.toolUiProvider?.reloadPropertiesFromTool();\n }, []);\n const [settings, setSettings] = React.useState(\n InternalFrontstageManager.activeToolSettingsProvider\n ?.horizontalToolSettingNodes\n );\n React.useEffect(() => {\n return UiFramework.frontstages.onToolActivatedEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider\n ?.horizontalToolSettingNodes;\n setSettings(nodes);\n });\n }, []);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider\n ?.horizontalToolSettingNodes;\n setSettings(nodes);\n });\n }, []);\n\n return settings;\n}\n\n/** @internal */\nexport function useToolSettingsNode(): React.ReactNode {\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.frontstages.activeToolInformation?.toolUiProvider?.reloadPropertiesFromTool();\n }, []);\n const [settings, setSettings] = React.useState(\n InternalFrontstageManager.activeToolSettingsProvider?.toolSettingsNode\n );\n React.useEffect(() => {\n return UiFramework.frontstages.onToolActivatedEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider?.toolSettingsNode;\n setSettings(nodes);\n });\n }, [setSettings]);\n\n React.useEffect(() => {\n return UiFramework.frontstages.onToolSettingsReloadEvent.addListener(() => {\n const nodes =\n InternalFrontstageManager.activeToolSettingsProvider?.toolSettingsNode;\n setSettings(nodes);\n });\n }, [setSettings]);\n return settings;\n}\n\n/** @internal */\nexport function ToolSettingsContent() {\n const toolSettingsType = useLayout((state) => state.toolSettings?.type);\n // This is needed to remount underlying components tree when going into widget state.\n if (!toolSettingsType || toolSettingsType === \"docked\") return null;\n return <ToolSettingsWidgetContent />;\n}\n\n/** @internal */\nexport function ToolSettingsWidgetContent() {\n const floatingToolSettingsContainerRef = React.useRef<HTMLDivElement>(null);\n const node = useToolSettingsNode();\n const activeToolId = useActiveToolId();\n const forceRefreshKey = useRefreshKey(node);\n const frontstageDef = useActiveFrontstageDef();\n\n const providerId =\n InternalFrontstageManager.activeToolSettingsProvider?.uniqueId ?? \"none\";\n return (\n <div\n data-toolsettings-provider={providerId}\n className=\"uifw-floating-toolSettings-container\"\n ref={floatingToolSettingsContainerRef}\n key={forceRefreshKey}\n >\n <ScrollableWidgetContent>\n <ToolSettingsContext.Provider value={true}>\n <ToolSettingsEditorsProvider>\n {node ?? frontstageDef?.activeToolEmptyNode ?? (\n <EmptyToolSettingsLabel toolId={activeToolId} />\n )}\n </ToolSettingsEditorsProvider>\n </ToolSettingsContext.Provider>\n </ScrollableWidgetContent>\n </div>\n );\n}\n\n/**\n * Hook that returns a key that can be used to force refresh the tool settings.\n * @param toolSettingNodes Nodes that are used to determine if the tool settings should be refreshed.\n * @returns a new key if the dependency changes.\n */\nfunction useRefreshKey(toolSettingNodes: any) {\n const [forceRefreshKey, setForceRefreshKey] = React.useState(Date.now());\n React.useEffect(() => {\n // We cant work with the content of the settings, but we can force refresh when\n // the array is different.\n setForceRefreshKey(Date.now());\n }, [toolSettingNodes]);\n return forceRefreshKey;\n}\n"]}
@@ -6,7 +6,6 @@
6
6
  .nz-standardLayout {
7
7
  position: relative;
8
8
  height: 100%;
9
- background-color: var(--iui-color-background-backdrop);
10
9
  overflow: hidden;
11
10
 
12
11
  display: grid;
@@ -14,6 +14,9 @@ $space-before-label: 16px;
14
14
  $label-color: var(--iui-color-text);
15
15
  $border-color: var(--iui-color-background-disabled);
16
16
  $item-height: 32px;
17
+ $button-inline-padding: 8px;
18
+ $button-block-padding: 8px;
19
+ $button-border-width: 1px;
17
20
 
18
21
  .ListPicker-separator {
19
22
  height: 1px;
@@ -29,6 +32,13 @@ $item-height: 32px;
29
32
  @include uicore-scrollbar();
30
33
  }
31
34
 
35
+ .ListPicker-button {
36
+ padding-block: $button-block-padding;
37
+ padding-inline: $button-inline-padding;
38
+
39
+ border-width: $button-border-width;
40
+ }
41
+
32
42
  .ListPickerInnerContainer {
33
43
  border: 1px solid $border-color;
34
44
  margin-left: 10px;
@@ -14,7 +14,7 @@ $key-size-large: 36px;
14
14
  $key-size-modifier: 24px;
15
15
 
16
16
  .uifw-statusFields-toolAssistance-toolAssistanceField {
17
- width: 30ch;
17
+ max-width: 30ch;
18
18
  justify-content: flex-start;
19
19
 
20
20
  .prompt {
@@ -6,7 +6,6 @@
6
6
  .nz-standardLayout {
7
7
  position: relative;
8
8
  height: 100%;
9
- background-color: var(--iui-color-background-backdrop);
10
9
  overflow: hidden;
11
10
 
12
11
  display: grid;
@@ -14,6 +14,9 @@ $space-before-label: 16px;
14
14
  $label-color: var(--iui-color-text);
15
15
  $border-color: var(--iui-color-background-disabled);
16
16
  $item-height: 32px;
17
+ $button-inline-padding: 8px;
18
+ $button-block-padding: 8px;
19
+ $button-border-width: 1px;
17
20
 
18
21
  .ListPicker-separator {
19
22
  height: 1px;
@@ -29,6 +32,13 @@ $item-height: 32px;
29
32
  @include uicore-scrollbar();
30
33
  }
31
34
 
35
+ .ListPicker-button {
36
+ padding-block: $button-block-padding;
37
+ padding-inline: $button-inline-padding;
38
+
39
+ border-width: $button-border-width;
40
+ }
41
+
32
42
  .ListPickerInnerContainer {
33
43
  border: 1px solid $border-color;
34
44
  margin-left: 10px;
@@ -14,7 +14,7 @@ $key-size-large: 36px;
14
14
  $key-size-modifier: 24px;
15
15
 
16
16
  .uifw-statusFields-toolAssistance-toolAssistanceField {
17
- width: 30ch;
17
+ max-width: 30ch;
18
18
  justify-content: flex-start;
19
19
 
20
20
  .prompt {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/appui-react",
3
- "version": "5.15.2",
3
+ "version": "5.16.0",
4
4
  "description": "A react component library for AppUI framework",
5
5
  "type": "module",
6
6
  "types": "./lib/appui-react.d.ts",
@@ -41,13 +41,13 @@
41
41
  "@itwin/core-geometry": "^4.0.0 || ^5.0.0",
42
42
  "@itwin/core-quantity": "^4.0.0 || ^5.0.0",
43
43
  "@itwin/itwinui-react": "^3.15.0",
44
- "react": "^18.0.0",
45
- "react-dom": "^18.0.0",
44
+ "react": "^18.0.0 || ^19.0.0",
45
+ "react-dom": "^18.0.0 || ^19.0.0",
46
46
  "react-redux": "^7.2.2 || ^8.0.0 || ^9.0.0",
47
47
  "redux": "^4.1.0 || ^5.0.0",
48
- "@itwin/components-react": "5.15.2",
49
- "@itwin/core-react": "5.15.2",
50
- "@itwin/imodel-components-react": "5.15.2"
48
+ "@itwin/components-react": "5.16.0",
49
+ "@itwin/imodel-components-react": "5.16.0",
50
+ "@itwin/core-react": "5.16.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@itwin/appui-abstract": "^5.1.0",
@@ -62,13 +62,13 @@
62
62
  "@itwin/eslint-plugin": "5.1.0",
63
63
  "@itwin/itwinui-react": "^3.19.4",
64
64
  "@itwin/webgl-compatibility": "^5.1.0",
65
- "@testing-library/dom": "^10.1.0",
66
- "@testing-library/react": "^15.0.7",
67
- "@testing-library/user-event": "^14.5.2",
65
+ "@testing-library/dom": "^10.4.1",
66
+ "@testing-library/react": "^16.3.0",
67
+ "@testing-library/user-event": "^14.6.1",
68
68
  "@types/lodash": "^4.14.0",
69
69
  "@types/node": "20.17.8",
70
- "@types/react": "^18.3.12",
71
- "@types/react-dom": "^18.3.1",
70
+ "@types/react": "^19.2.0",
71
+ "@types/react-dom": "^19.2.0",
72
72
  "@types/react-transition-group": "^4.4.4",
73
73
  "@vitest/coverage-v8": "^3.0.6",
74
74
  "cpx2": "^3.0.0",
@@ -80,8 +80,8 @@
80
80
  "jsdom": "^24.0.0",
81
81
  "npm-run-all": "^4.1.5",
82
82
  "raf": "^3.4.0",
83
- "react": "^18.3.1",
84
- "react-dom": "^18.3.1",
83
+ "react": "^19.2.0",
84
+ "react-dom": "^19.2.0",
85
85
  "react-redux": "^9.1.2",
86
86
  "redux": "^5.0.1",
87
87
  "reflect-metadata": "^0.1.13",
@@ -91,9 +91,9 @@
91
91
  "typescript": "~5.6.2",
92
92
  "upath": "^2.0.1",
93
93
  "vitest": "^3.0.6",
94
- "@itwin/components-react": "5.15.2",
95
- "@itwin/core-react": "5.15.2",
96
- "@itwin/imodel-components-react": "5.15.2"
94
+ "@itwin/imodel-components-react": "5.16.0",
95
+ "@itwin/core-react": "5.16.0",
96
+ "@itwin/components-react": "5.16.0"
97
97
  },
98
98
  "dependencies": {
99
99
  "@itwin/itwinui-icons-react": "^2.8.0",