@itwin/appui-react 5.33.3 → 5.35.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 (72) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts +6 -2
  3. package/lib/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  4. package/lib/appui-react/configurableui/ConfigurableUiContent.js +9 -2
  5. package/lib/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  6. package/lib/appui-react/framework/FrameworkFrontstages.d.ts +1 -0
  7. package/lib/appui-react/framework/FrameworkFrontstages.d.ts.map +1 -1
  8. package/lib/appui-react/framework/FrameworkFrontstages.js.map +1 -1
  9. package/lib/appui-react/framework/FrameworkVisibility.d.ts +3 -1
  10. package/lib/appui-react/framework/FrameworkVisibility.d.ts.map +1 -1
  11. package/lib/appui-react/framework/FrameworkVisibility.js.map +1 -1
  12. package/lib/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
  13. package/lib/appui-react/frontstage/InternalFrontstageManager.js +6 -0
  14. package/lib/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
  15. package/lib/appui-react/keyboardshortcut/KeyboardShortcutUtilities.d.ts.map +1 -1
  16. package/lib/appui-react/keyboardshortcut/KeyboardShortcutUtilities.js +6 -1
  17. package/lib/appui-react/keyboardshortcut/KeyboardShortcutUtilities.js.map +1 -1
  18. package/lib/appui-react/layout/_widgetopacity.scss +1 -1
  19. package/lib/appui-react/popup/CardPopup.d.ts.map +1 -1
  20. package/lib/appui-react/popup/CardPopup.js +3 -1
  21. package/lib/appui-react/popup/CardPopup.js.map +1 -1
  22. package/lib/appui-react/popup/ToolbarPopup.d.ts.map +1 -1
  23. package/lib/appui-react/popup/ToolbarPopup.js +3 -1
  24. package/lib/appui-react/popup/ToolbarPopup.js.map +1 -1
  25. package/lib/appui-react/shared/ToolItemDef.d.ts.map +1 -1
  26. package/lib/appui-react/shared/ToolItemDef.js +6 -5
  27. package/lib/appui-react/shared/ToolItemDef.js.map +1 -1
  28. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  29. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js +4 -2
  30. package/lib/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  31. package/lib/appui-react/theme/ThemeId.d.ts +3 -1
  32. package/lib/appui-react/theme/ThemeId.d.ts.map +1 -1
  33. package/lib/appui-react/theme/ThemeId.js +3 -1
  34. package/lib/appui-react/theme/ThemeId.js.map +1 -1
  35. package/lib/appui-react/toolbar/Toolbar.d.ts +3 -1
  36. package/lib/appui-react/toolbar/Toolbar.d.ts.map +1 -1
  37. package/lib/appui-react/toolbar/Toolbar.js.map +1 -1
  38. package/lib/appui-react/toolbar/ToolbarComposer.d.ts.map +1 -1
  39. package/lib/appui-react/toolbar/ToolbarComposer.js +13 -5
  40. package/lib/appui-react/toolbar/ToolbarComposer.js.map +1 -1
  41. package/lib/appui-react/toolbar/ToolbarWithOverflow.d.ts +3 -1
  42. package/lib/appui-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
  43. package/lib/appui-react/toolbar/ToolbarWithOverflow.js.map +1 -1
  44. package/lib/appui-react/toolbar/new-toolbars/Surface.d.ts.map +1 -1
  45. package/lib/appui-react/toolbar/new-toolbars/Surface.js +1 -0
  46. package/lib/appui-react/toolbar/new-toolbars/Surface.js.map +1 -1
  47. package/lib/appui-react/toolbar/new-toolbars/Surface.scss +1 -6
  48. package/lib/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  49. package/lib/appui-react/tools/CoreToolDefinitions.js +37 -133
  50. package/lib/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  51. package/lib/appui-react/tools/defineToolIcons.d.ts +3 -0
  52. package/lib/appui-react/tools/defineToolIcons.d.ts.map +1 -0
  53. package/lib/appui-react/tools/defineToolIcons.js +45 -0
  54. package/lib/appui-react/tools/defineToolIcons.js.map +1 -0
  55. package/lib/appui-react/uistate/AppUiSettings.d.ts +6 -0
  56. package/lib/appui-react/uistate/AppUiSettings.d.ts.map +1 -1
  57. package/lib/appui-react/uistate/AppUiSettings.js +15 -0
  58. package/lib/appui-react/uistate/AppUiSettings.js.map +1 -1
  59. package/lib/appui-react/widgets/NavigationWidgetComposer.d.ts.map +1 -1
  60. package/lib/appui-react/widgets/NavigationWidgetComposer.js +4 -1
  61. package/lib/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  62. package/lib/appui-react/widgets/ToolWidgetComposer.d.ts.map +1 -1
  63. package/lib/appui-react/widgets/ToolWidgetComposer.js +3 -1
  64. package/lib/appui-react/widgets/ToolWidgetComposer.js.map +1 -1
  65. package/lib/appui-react.d.ts.map +1 -1
  66. package/lib/appui-react.js +2 -0
  67. package/lib/appui-react.js.map +1 -1
  68. package/lib/cjs/appui-react/layout/_widgetopacity.scss +1 -1
  69. package/lib/cjs/appui-react/toolbar/new-toolbars/Surface.scss +1 -6
  70. package/lib/esm/appui-react/layout/_widgetopacity.scss +1 -1
  71. package/lib/esm/appui-react/toolbar/new-toolbars/Surface.scss +1 -6
  72. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"ToolAssistanceField.js","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/toolassistance/ToolAssistanceField.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC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AC,EACf,WAAW,EACX,SAAS,GAIV;IACC,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC;QAE9D,oBAAC,YAAY,QAAE,WAAW,CAAgB,CACtC,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 { Logger, ProcessDetector } from \"@itwin/core-bentley\";\nimport type {\n ToolAssistanceInstruction,\n ToolAssistanceInstructions,\n ToolAssistanceKeyboardInfo,\n ToolAssistanceSection,\n} from \"@itwin/core-frontend\";\nimport {\n ToolAssistanceImage,\n ToolAssistanceInputMethod,\n} from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { FillCentered, Icon } from \"@itwin/core-react\";\nimport { Button, Tabs, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { useCursorPrompt } from \"../../cursor/cursorprompt/CursorPrompt.js\";\nimport { MessageManager } from \"../../messages/MessageManager.js\";\nimport { UiStateStorageContext } from \"../../uistate/useUiStateStorage.js\";\nimport \"./ToolAssistanceField.scss\";\n\nimport {\n SvgAdd,\n SvgClose,\n SvgCursorClick,\n SvgGestureOneFingerDrag,\n SvgGestureOneFingerTap,\n SvgGestureOneFingerTapDouble,\n SvgGesturePinch,\n SvgGestureTwoFingerDrag,\n SvgGestureTwoFingerTap,\n SvgMouseClickLeft,\n SvgMouseClickRight,\n SvgMouseClickWheel,\n SvgPin,\n} from \"@itwin/itwinui-icons-react\";\nimport { ToolAssistanceDialog } from \"../../layout/footer/tool-assistance/Dialog.js\";\nimport { ToolAssistanceInstruction as NZ_ToolAssistanceInstruction } from \"../../layout/footer/tool-assistance/Instruction.js\";\nimport { ToolAssistanceItem } from \"../../layout/footer/tool-assistance/Item.js\";\nimport { ToolAssistanceSeparator } from \"../../layout/footer/tool-assistance/Separator.js\";\nimport { StatusBarDialog } from \"../../statusbar/dialog/Dialog.js\";\nimport { StatusBarPopover } from \"../../statusbar/popup/StatusBarPopover.js\";\nimport {\n type UiStateStorage,\n UiStateStorageStatus,\n} from \"../../uistate/UiStateStorage.js\";\nimport { SvgTouchCursorPoint } from \"../../icons/SvgTouchCursorPoint.js\";\nimport { SvgTouchCursorPan } from \"../../icons/SvgTouchCursorPan.js\";\nimport { SvgMouseClickLeftDrag } from \"../../icons/SvgMouseClickLeftDrag.js\";\nimport { SvgMouseClickRightDrag } from \"../../icons/SvgMouseClickRightDrag.js\";\nimport { SvgMouseClickWheelDrag } from \"../../icons/SvgMouseClickWheelDrag.js\";\nimport { useTranslation } from \"../../hooks/useTranslation.js\";\nimport { useActiveTool } from \"../../hooks/useActiveTool.js\";\nimport { useControlledState } from \"../../hooks/useControlledState.js\";\n\n/** Properties of [[ToolAssistanceField]] component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ToolAssistanceFieldProps extends CommonProps {\n /** Indicates whether to include promptAtCursor Checkbox. Defaults to `true`. */\n includePromptAtCursor: boolean;\n /** Optional parameter for persistent UI settings. Defaults to `UiStateStorageContext`. */\n uiStateStorage?: UiStateStorage;\n /** Cursor prompt timeout period. Defaults to `5000`.\n * @note Specify `Number.POSITIVE_INFINITY` to keep the cursor prompt open indefinitely.\n */\n cursorPromptTimeout: number;\n /** Fade out the cursor prompt when closed. */\n fadeOutCursorPrompt: boolean;\n /** Indicates whether to show promptAtCursor by default. Defaults to `false`. */\n defaultPromptAtCursor: boolean;\n /** When set to `true` will show prompt at cursor only when the content area is hovered. */\n promptAtContent?: boolean;\n}\n\ntype PopoverProps = React.ComponentProps<typeof StatusBarPopover>;\n\ninterface Props\n extends Omit<\n ToolAssistanceFieldProps,\n | \"includePromptAtCursor\"\n | \"cursorPromptTimeout\"\n | \"fadeOutCursorPrompt\"\n | \"defaultPromptAtCursor\"\n >,\n Partial<\n Pick<\n ToolAssistanceFieldProps,\n | \"includePromptAtCursor\"\n | \"cursorPromptTimeout\"\n | \"fadeOutCursorPrompt\"\n | \"defaultPromptAtCursor\"\n >\n >,\n Pick<PopoverProps, \"visible\" | \"onVisibleChange\"> {\n /**\n * Controlled flag for whether the popover is pinned.\n */\n pinned?: boolean;\n /**\n * Callback invoked every time the popover is pinned or unpinned as a result\n * of internal logic. Should be used alongside `pinned` prop.\n */\n onPinnedChange?: (pinned: boolean) => void;\n}\n\ninterface ToolAssistanceFieldState {\n instructions: ToolAssistanceInstructions | undefined;\n toolIconSpec: string;\n showPromptAtCursor: boolean;\n mouseTouchTabIndex: number;\n}\n\nconst toolAssistanceKey = \"ToolAssistance\";\nconst showPromptAtCursorKey = \"showPromptAtCursor\";\nconst mouseTouchTabIndexKey = \"mouseTouchTabIndex\";\n\n/** Tool Assistance Field React component.\n * @public\n * @note Tool assistance field will only display 30 characters in the status bar. Any additional text will be hidden. The full text will always be shown in the opened popover.\n */\nexport function ToolAssistanceField(props: Props) {\n const {\n includePromptAtCursor = true,\n cursorPromptTimeout = 5000,\n fadeOutCursorPrompt = true,\n defaultPromptAtCursor = false,\n uiStateStorage: uiStateStorageProp,\n promptAtContent = false,\n visible: visibleProp,\n onVisibleChange,\n pinned: pinnedProp,\n onPinnedChange,\n } = props;\n const uiStateStorageCtx = React.useContext(UiStateStorageContext);\n const uiStateStorage = uiStateStorageProp ?? uiStateStorageCtx;\n const { translate } = useTranslation();\n const activeTool = useActiveTool();\n\n const [state, setState] = React.useState<ToolAssistanceFieldState>(() => {\n return {\n instructions: undefined,\n toolIconSpec: \"\",\n showPromptAtCursor: defaultPromptAtCursor,\n mouseTouchTabIndex: 0,\n };\n });\n\n const { showPromptAtCursor, toolIconSpec, mouseTouchTabIndex, instructions } =\n state;\n const mainInstruction = state.instructions?.mainInstruction.text;\n const { open } = useCursorPrompt({\n show: showPromptAtCursor,\n timeout: cursorPromptTimeout,\n iconSpec: toolIconSpec,\n instruction: mainInstruction,\n fadeOut: fadeOutCursorPrompt,\n promptAtContent,\n });\n\n const handleClose = () => {\n if (pinned) {\n setPinned(false);\n }\n setVisible(false);\n };\n\n const getDisplayableInstructions = (section: ToolAssistanceSection) => {\n const displayableInstructions = section.instructions.filter(\n (instruction) => {\n const includeMouseInstructions = showMouseTouchTabs\n ? mouseTouchTabIndex === 0 && showMouseInstructions\n : showMouseInstructions;\n const includeTouchInstructions = showMouseTouchTabs\n ? mouseTouchTabIndex === 1 && showTouchInstructions\n : showTouchInstructions;\n return (\n isBothInstruction(instruction) ||\n (includeMouseInstructions && isMouseInstruction(instruction)) ||\n (includeTouchInstructions && isTouchInstruction(instruction))\n );\n }\n );\n return displayableInstructions;\n };\n\n React.useEffect(() => {\n void (async () => {\n const result = await uiStateStorage.getSetting(\n toolAssistanceKey,\n showPromptAtCursorKey\n );\n\n if (result.status !== UiStateStorageStatus.Success) return;\n setState((prev) => ({\n ...prev,\n showPromptAtCursor: result.setting,\n }));\n })();\n }, [uiStateStorage]);\n React.useEffect(() => {\n void (async () => {\n const result = await uiStateStorage.getSetting(\n toolAssistanceKey,\n mouseTouchTabIndexKey\n );\n\n if (result.status !== UiStateStorageStatus.Success) return;\n setState((prev) => ({\n ...prev,\n mouseTouchTabIndex: result.setting,\n }));\n })();\n }, [uiStateStorage]);\n React.useEffect(() => {\n return MessageManager.onToolAssistanceChangedEvent.addListener((args) => {\n setState((prev) => ({\n ...prev,\n instructions: args.instructions,\n }));\n open();\n });\n }, [open]);\n React.useEffect(() => {\n return UiFramework.frontstages.onToolIconChangedEvent.addListener(\n (args) => {\n setState((prev) => ({\n ...prev,\n toolIconSpec: args.iconSpec,\n }));\n open();\n }\n );\n }, [open]);\n\n const hasMouseInstructions = !!instructions?.sections?.some((section) => {\n return section.instructions.some((instruction) =>\n isMouseInstruction(instruction)\n );\n });\n const hasTouchInstructions = !!instructions?.sections?.some((section) => {\n return section.instructions.some((instruction) =>\n isTouchInstruction(instruction)\n );\n });\n\n const isMobileBrowser = React.useMemo(() => {\n return ProcessDetector.isMobileBrowser;\n }, []);\n const showMouseInstructions = !isMobileBrowser && hasMouseInstructions;\n const showTouchInstructions = hasTouchInstructions;\n const showMouseTouchTabs = showMouseInstructions && showTouchInstructions;\n\n const sectionInstructions = (instructions?.sections ?? [])\n .map((section) => {\n const displayableInstructions = getDisplayableInstructions(section);\n return {\n displayableInstructions,\n section,\n };\n })\n .filter((section) => {\n return section.displayableInstructions.length > 0;\n });\n\n const prompt = instructions?.mainInstruction.text;\n const tooltip = React.useMemo(() => {\n const lineBreak = \"\\u000d\\u000a\";\n const moreInfo = translate(\"toolAssistance.moreInfo\");\n const postfix = `${lineBreak}${moreInfo}`;\n if (activeTool) {\n return `${activeTool.flyover}${prompt ? ` > ${prompt}` : \"\"}${postfix}`;\n }\n if (prompt) {\n return `${prompt}${postfix}`;\n }\n return moreInfo;\n }, [prompt, activeTool, translate]);\n\n const dialogTitle = activeTool?.flyover ?? translate(\"toolAssistance.title\");\n const tabs = [\n translate(\"toolAssistance.mouse\"),\n translate(\"toolAssistance.touch\"),\n ];\n const [visible, setVisible] = useControlledState(\n false,\n visibleProp,\n onVisibleChange as React.Dispatch<React.SetStateAction<boolean>>\n );\n const [pinned, setPinned] = useControlledState(\n false,\n pinnedProp,\n onPinnedChange as React.Dispatch<React.SetStateAction<boolean>>\n );\n return (\n <StatusBarPopover\n visible={visible}\n onVisibleChange={setVisible}\n closeOnOutsideClick={!pinned}\n content={\n <ToolAssistanceDialog\n buttons={\n <StatusBarDialog.TitleBarButton\n onClick={() => {\n if (pinned) {\n handleClose();\n return;\n }\n setPinned(true);\n }}\n title={translate(pinned ? \"dialog.close\" : \"toolAssistance.pin\")}\n >\n {pinned ? <SvgClose /> : <SvgPin />}\n </StatusBarDialog.TitleBarButton>\n }\n title={dialogTitle}\n >\n <div>\n {showMouseTouchTabs && (\n <Tabs.Wrapper type=\"pill\" value={String(mouseTouchTabIndex)}>\n <Tabs.TabList className=\"uifw-toolAssistance-tabs\">\n {tabs.map((tab, index) => (\n <Tabs.Tab\n key={index}\n className=\"uifw-tab\"\n value={String(index)}\n label={tab}\n onClick={async () => {\n setState((prev) => ({\n ...prev,\n mouseTouchTabIndex: index,\n }));\n void uiStateStorage.saveSetting(\n toolAssistanceKey,\n mouseTouchTabIndexKey,\n index\n );\n }}\n />\n ))}\n </Tabs.TabList>\n </Tabs.Wrapper>\n )}\n {instructions ? (\n <div className=\"uifw-toolAssistance-content\">\n <NZ_ToolAssistanceInstruction\n key=\"main\"\n image={\n <InstructionImage\n instruction={instructions.mainInstruction}\n />\n }\n text={instructions.mainInstruction.text}\n isNew={instructions.mainInstruction.isNew}\n />\n\n {sectionInstructions.map((sectionInstruction, index) => {\n const { section, displayableInstructions } =\n sectionInstruction;\n return (\n <React.Fragment key={index.toString()}>\n <ToolAssistanceSeparator>\n {section.label}\n </ToolAssistanceSeparator>\n {displayableInstructions.map((instruction, index1) => {\n return (\n <NZ_ToolAssistanceInstruction\n key={`${index1.toString()}-${index.toString()}`}\n image={\n <InstructionImage instruction={instruction} />\n }\n text={instruction.text}\n isNew={instruction.isNew}\n />\n );\n })}\n </React.Fragment>\n );\n })}\n\n {includePromptAtCursor && (\n <>\n <ToolAssistanceSeparator key=\"prompt-sep\" />\n <ToolAssistanceItem key=\"prompt-item\">\n <ToggleSwitch\n label={translate(\"toolAssistance.promptAtCursor\")}\n labelPosition=\"right\"\n checked={state.showPromptAtCursor}\n onChange={(e) => {\n const checked = e.target.checked;\n setState((prev) => ({\n ...prev,\n showPromptAtCursor: checked,\n }));\n void uiStateStorage.saveSetting(\n toolAssistanceKey,\n showPromptAtCursorKey,\n checked\n );\n }}\n />\n </ToolAssistanceItem>\n </>\n )}\n </div>\n ) : undefined}\n </div>\n </ToolAssistanceDialog>\n }\n >\n <Button\n styleType=\"borderless\"\n startIcon={\n instructions ? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Icon iconSpec={state.toolIconSpec} />\n ) : (\n <></>\n )\n }\n className={classnames(\n \"uifw-statusFields-toolAssistance-toolAssistanceField\",\n props.className\n )}\n title={tooltip}\n style={props.style}\n labelProps={{ className: \"prompt\" }}\n >\n {prompt}\n <StatusBarPopover.ExpandIndicator />\n </Button>\n </StatusBarPopover>\n );\n}\n\nfunction isBothInstruction(instruction: ToolAssistanceInstruction) {\n return (\n instruction.inputMethod === undefined ||\n instruction.inputMethod === ToolAssistanceInputMethod.Both\n );\n}\n\nfunction isMouseInstruction(instruction: ToolAssistanceInstruction) {\n return instruction.inputMethod === ToolAssistanceInputMethod.Mouse;\n}\n\nfunction isTouchInstruction(instruction: ToolAssistanceInstruction) {\n return instruction.inputMethod === ToolAssistanceInputMethod.Touch;\n}\n\nfunction getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(\"webSvg:\") && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n}\n\nfunction InstructionImage({\n instruction,\n}: {\n instruction: ToolAssistanceInstruction;\n}): React.ReactNode {\n let image: React.ReactNode;\n\n if (instruction.iconElement) return instruction.iconElement;\n\n if (\n (typeof instruction.image === \"string\" ||\n instruction.image !== ToolAssistanceImage.Keyboard) &&\n instruction.keyboardInfo\n ) {\n if (\n instruction.keyboardInfo.keys.length === 1 &&\n !instruction.keyboardInfo.bottomKeys\n ) {\n const key = instruction.keyboardInfo.keys[0];\n const rightImage =\n typeof instruction.image === \"string\" ? (\n <div className=\"uifw-toolassistance-icon-medium\">\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Icon iconSpec={instruction.image} />\n </div>\n ) : (\n <InstructionSvgImage instruction={instruction} mediumSize={true} />\n );\n\n image = (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <FillCentered>\n <KeyNode\n keyboardKey={key}\n className=\"uifw-toolassistance-key-modifier\"\n />\n {rightImage}\n </FillCentered>\n );\n } else {\n Logger.logError(\n UiFramework.loggerCategory(\"ToolAssistanceField\"),\n `getInstructionImage: Invalid keyboardInfo provided with image`\n );\n }\n } else if (typeof instruction.image === \"string\") {\n if (instruction.image.length > 0) {\n const svgSource = getWebComponentSource(instruction.image);\n const className =\n svgSource !== undefined\n ? \"uifw-toolassistance-svg\"\n : \"uifw-toolassistance-icon-large\";\n image = (\n <div className={className}>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Icon iconSpec={svgSource ?? instruction.image} />\n </div>\n );\n }\n } else if (instruction.image === ToolAssistanceImage.Keyboard) {\n if (instruction.keyboardInfo) {\n image = (\n <InstructionKeyboardImage keyboardInfo={instruction.keyboardInfo} />\n );\n } else {\n Logger.logError(\n UiFramework.loggerCategory(\"ToolAssistanceField\"),\n `getInstructionImage: ToolAssistanceImage.Keyboard specified but no keyboardInfo provided`\n );\n }\n } else {\n image = (\n <InstructionSvgImage instruction={instruction} mediumSize={false} />\n );\n }\n\n return image;\n}\n\nfunction InstructionSvgImage({\n instruction,\n mediumSize,\n}: {\n instruction: ToolAssistanceInstruction;\n mediumSize: boolean;\n}): React.ReactNode {\n let image: React.ReactNode;\n let className = mediumSize\n ? \"uifw-toolassistance-svg-medium\"\n : \"uifw-toolassistance-svg\";\n\n if (\n typeof instruction.image !== \"string\" &&\n instruction.image !== ToolAssistanceImage.Keyboard\n ) {\n const toolAssistanceImage: ToolAssistanceImage = instruction.image;\n let svgImage: React.ReactNode;\n\n switch (toolAssistanceImage) {\n case ToolAssistanceImage.AcceptPoint:\n svgImage = <SvgAdd />;\n break;\n case ToolAssistanceImage.CursorClick:\n svgImage = <SvgCursorClick />;\n break;\n case ToolAssistanceImage.LeftClick:\n svgImage = <SvgMouseClickLeft />;\n break;\n case ToolAssistanceImage.RightClick:\n svgImage = <SvgMouseClickRight />;\n break;\n case ToolAssistanceImage.MouseWheel:\n svgImage = <SvgMouseClickWheel />;\n break;\n case ToolAssistanceImage.LeftClickDrag:\n svgImage = <SvgMouseClickLeftDrag />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n case ToolAssistanceImage.RightClickDrag:\n svgImage = <SvgMouseClickRightDrag />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n case ToolAssistanceImage.MouseWheelClickDrag:\n svgImage = <SvgMouseClickWheelDrag />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n case ToolAssistanceImage.OneTouchTap:\n svgImage = <SvgGestureOneFingerTap />;\n break;\n case ToolAssistanceImage.OneTouchDoubleTap:\n svgImage = <SvgGestureOneFingerTapDouble />;\n break;\n case ToolAssistanceImage.OneTouchDrag:\n svgImage = <SvgGestureOneFingerDrag />;\n break;\n case ToolAssistanceImage.TwoTouchTap:\n svgImage = <SvgGestureTwoFingerTap />;\n break;\n case ToolAssistanceImage.TwoTouchDrag:\n svgImage = <SvgGestureTwoFingerDrag />;\n break;\n case ToolAssistanceImage.TwoTouchPinch:\n svgImage = <SvgGesturePinch />;\n break;\n case ToolAssistanceImage.TouchCursorTap:\n svgImage = <SvgTouchCursorPoint />;\n break;\n case ToolAssistanceImage.TouchCursorDrag:\n svgImage = <SvgTouchCursorPan />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n }\n\n image = (\n <div className={className}>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n {svgImage && <Icon iconSpec={svgImage} />}\n </div>\n );\n }\n\n return image;\n}\n\nfunction InstructionKeyboardImage({\n keyboardInfo,\n}: {\n keyboardInfo: ToolAssistanceKeyboardInfo;\n}): React.ReactNode {\n let image: React.ReactNode;\n\n if (keyboardInfo.bottomKeys !== undefined) {\n image = (\n <div className=\"uifw-toolassistance-key-group\">\n <span className=\"row1\">\n {keyboardInfo.keys.map((key, index) => {\n return (\n <KeyNode\n key={index}\n keyboardKey={key}\n className=\"uifw-toolassistance-key-small\"\n />\n );\n })}\n </span>\n <br />\n <span className=\"row2\">\n {keyboardInfo.bottomKeys.map((key, index) => {\n return (\n <KeyNode\n key={index}\n keyboardKey={key}\n className=\"uifw-toolassistance-key-small\"\n />\n );\n })}\n </span>\n </div>\n );\n } else if (keyboardInfo.keys.length === 2) {\n image = (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <FillCentered>\n {keyboardInfo.keys.map((key, index) => {\n let className = \"uifw-toolassistance-key-medium\";\n if (key.length > 1) className = \"uifw-toolassistance-key-modifier\";\n return (\n <KeyNode key={index} keyboardKey={key} className={className} />\n );\n })}\n </FillCentered>\n );\n } else if (keyboardInfo.keys[0]) {\n if (keyboardInfo.keys[0].length > 1)\n image = (\n <KeyNode\n keyboardKey={keyboardInfo.keys[0]}\n className=\"uifw-toolassistance-key-large\"\n />\n );\n else image = <KeyNode keyboardKey={keyboardInfo.keys[0]} />;\n } else {\n Logger.logError(\n UiFramework.loggerCategory(\"ToolAssistanceField\"),\n `ToolAssistanceImage.Keyboard specified but ToolAssistanceKeyboardInfo not valid`\n );\n }\n\n return image;\n}\n\nfunction KeyNode({\n keyboardKey,\n className,\n}: {\n keyboardKey: string;\n className?: string;\n}) {\n return (\n <div className={classnames(\"uifw-toolassistance-key\", className)}>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <FillCentered>{keyboardKey}</FillCentered>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ToolAssistanceField.js","sourceRoot":"","sources":["../../../../src/appui-react/statusfields/toolassistance/ToolAssistanceField.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAO9D,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,m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BAAC,OAAO,IAAC,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,GAAI,CAAC;IAC9D,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,QAAQ,CACb,WAAW,CAAC,cAAc,CAAC,qBAAqB,CAAC,EACjD,iFAAiF,CAClF,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,EACf,WAAW,EACX,SAAS,GAIV;IACC,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE,SAAS,CAAC;QAE9D,oBAAC,YAAY,QAAE,WAAW,CAAgB,CACtC,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 { Logger, ProcessDetector } from \"@itwin/core-bentley\";\nimport type {\n ToolAssistanceInstruction,\n ToolAssistanceInstructions,\n ToolAssistanceKeyboardInfo,\n ToolAssistanceSection,\n} from \"@itwin/core-frontend\";\nimport {\n ToolAssistanceImage,\n ToolAssistanceInputMethod,\n} from \"@itwin/core-frontend\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { FillCentered, Icon } from \"@itwin/core-react\";\nimport { Button, Tabs, ToggleSwitch } from \"@itwin/itwinui-react\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { useCursorPrompt } from \"../../cursor/cursorprompt/CursorPrompt.js\";\nimport { MessageManager } from \"../../messages/MessageManager.js\";\nimport { UiStateStorageContext } from \"../../uistate/useUiStateStorage.js\";\nimport \"./ToolAssistanceField.scss\";\n\nimport {\n SvgAdd,\n SvgClose,\n SvgCursorClick,\n SvgGestureOneFingerDrag,\n SvgGestureOneFingerTap,\n SvgGestureOneFingerTapDouble,\n SvgGesturePinch,\n SvgGestureTwoFingerDrag,\n SvgGestureTwoFingerTap,\n SvgMouseClickLeft,\n SvgMouseClickRight,\n SvgMouseClickWheel,\n SvgPin,\n} from \"@itwin/itwinui-icons-react\";\nimport { ToolAssistanceDialog } from \"../../layout/footer/tool-assistance/Dialog.js\";\nimport { ToolAssistanceInstruction as NZ_ToolAssistanceInstruction } from \"../../layout/footer/tool-assistance/Instruction.js\";\nimport { ToolAssistanceItem } from \"../../layout/footer/tool-assistance/Item.js\";\nimport { ToolAssistanceSeparator } from \"../../layout/footer/tool-assistance/Separator.js\";\nimport { StatusBarDialog } from \"../../statusbar/dialog/Dialog.js\";\nimport { StatusBarPopover } from \"../../statusbar/popup/StatusBarPopover.js\";\nimport {\n type UiStateStorage,\n UiStateStorageStatus,\n} from \"../../uistate/UiStateStorage.js\";\nimport { SvgTouchCursorPoint } from \"../../icons/SvgTouchCursorPoint.js\";\nimport { SvgTouchCursorPan } from \"../../icons/SvgTouchCursorPan.js\";\nimport { SvgMouseClickLeftDrag } from \"../../icons/SvgMouseClickLeftDrag.js\";\nimport { SvgMouseClickRightDrag } from \"../../icons/SvgMouseClickRightDrag.js\";\nimport { SvgMouseClickWheelDrag } from \"../../icons/SvgMouseClickWheelDrag.js\";\nimport { useTranslation } from \"../../hooks/useTranslation.js\";\nimport { useActiveTool } from \"../../hooks/useActiveTool.js\";\nimport { useControlledState } from \"../../hooks/useControlledState.js\";\n\n/** Properties of [[ToolAssistanceField]] component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ToolAssistanceFieldProps extends CommonProps {\n /** Indicates whether to include promptAtCursor Checkbox. Defaults to `true`. */\n includePromptAtCursor: boolean;\n /** Optional parameter for persistent UI settings. Defaults to `UiStateStorageContext`. */\n uiStateStorage?: UiStateStorage;\n /** Cursor prompt timeout period. Defaults to `5000`.\n * @note Specify `Number.POSITIVE_INFINITY` to keep the cursor prompt open indefinitely.\n */\n cursorPromptTimeout: number;\n /** Fade out the cursor prompt when closed. */\n fadeOutCursorPrompt: boolean;\n /** Indicates whether to show promptAtCursor by default. Defaults to `false`. */\n defaultPromptAtCursor: boolean;\n /** When set to `true` will show prompt at cursor only when the content area is hovered. */\n promptAtContent?: boolean;\n}\n\ntype PopoverProps = React.ComponentProps<typeof StatusBarPopover>;\n\ninterface Props\n extends Omit<\n ToolAssistanceFieldProps,\n | \"includePromptAtCursor\"\n | \"cursorPromptTimeout\"\n | \"fadeOutCursorPrompt\"\n | \"defaultPromptAtCursor\"\n >,\n Partial<\n Pick<\n ToolAssistanceFieldProps,\n | \"includePromptAtCursor\"\n | \"cursorPromptTimeout\"\n | \"fadeOutCursorPrompt\"\n | \"defaultPromptAtCursor\"\n >\n >,\n Pick<PopoverProps, \"visible\" | \"onVisibleChange\"> {\n /**\n * Controlled flag for whether the popover is pinned.\n */\n pinned?: boolean;\n /**\n * Callback invoked every time the popover is pinned or unpinned as a result\n * of internal logic. Should be used alongside `pinned` prop.\n */\n onPinnedChange?: (pinned: boolean) => void;\n}\n\ninterface ToolAssistanceFieldState {\n instructions: ToolAssistanceInstructions | undefined;\n toolIconSpec: string;\n toolIconElement: React.ReactElement | undefined;\n showPromptAtCursor: boolean;\n mouseTouchTabIndex: number;\n}\n\nconst toolAssistanceKey = \"ToolAssistance\";\nconst showPromptAtCursorKey = \"showPromptAtCursor\";\nconst mouseTouchTabIndexKey = \"mouseTouchTabIndex\";\n\n/** Tool Assistance Field React component.\n * @public\n * @note Tool assistance field will only display 30 characters in the status bar. Any additional text will be hidden. The full text will always be shown in the opened popover.\n */\nexport function ToolAssistanceField(props: Props) {\n const {\n includePromptAtCursor = true,\n cursorPromptTimeout = 5000,\n fadeOutCursorPrompt = true,\n defaultPromptAtCursor = false,\n uiStateStorage: uiStateStorageProp,\n promptAtContent = false,\n visible: visibleProp,\n onVisibleChange,\n pinned: pinnedProp,\n onPinnedChange,\n } = props;\n const uiStateStorageCtx = React.useContext(UiStateStorageContext);\n const uiStateStorage = uiStateStorageProp ?? uiStateStorageCtx;\n const { translate } = useTranslation();\n const activeTool = useActiveTool();\n\n const [state, setState] = React.useState<ToolAssistanceFieldState>(() => {\n return {\n instructions: undefined,\n toolIconSpec: \"\",\n toolIconElement: undefined,\n showPromptAtCursor: defaultPromptAtCursor,\n mouseTouchTabIndex: 0,\n };\n });\n\n const { showPromptAtCursor, toolIconSpec, mouseTouchTabIndex, instructions } =\n state;\n const mainInstruction = state.instructions?.mainInstruction.text;\n const { open } = useCursorPrompt({\n show: showPromptAtCursor,\n timeout: cursorPromptTimeout,\n iconSpec: toolIconSpec,\n instruction: mainInstruction,\n fadeOut: fadeOutCursorPrompt,\n promptAtContent,\n });\n\n const handleClose = () => {\n if (pinned) {\n setPinned(false);\n }\n setVisible(false);\n };\n\n const getDisplayableInstructions = (section: ToolAssistanceSection) => {\n const displayableInstructions = section.instructions.filter(\n (instruction) => {\n const includeMouseInstructions = showMouseTouchTabs\n ? mouseTouchTabIndex === 0 && showMouseInstructions\n : showMouseInstructions;\n const includeTouchInstructions = showMouseTouchTabs\n ? mouseTouchTabIndex === 1 && showTouchInstructions\n : showTouchInstructions;\n return (\n isBothInstruction(instruction) ||\n (includeMouseInstructions && isMouseInstruction(instruction)) ||\n (includeTouchInstructions && isTouchInstruction(instruction))\n );\n }\n );\n return displayableInstructions;\n };\n\n React.useEffect(() => {\n void (async () => {\n const result = await uiStateStorage.getSetting(\n toolAssistanceKey,\n showPromptAtCursorKey\n );\n\n if (result.status !== UiStateStorageStatus.Success) return;\n setState((prev) => ({\n ...prev,\n showPromptAtCursor: result.setting,\n }));\n })();\n }, [uiStateStorage]);\n React.useEffect(() => {\n void (async () => {\n const result = await uiStateStorage.getSetting(\n toolAssistanceKey,\n mouseTouchTabIndexKey\n );\n\n if (result.status !== UiStateStorageStatus.Success) return;\n setState((prev) => ({\n ...prev,\n mouseTouchTabIndex: result.setting,\n }));\n })();\n }, [uiStateStorage]);\n React.useEffect(() => {\n return MessageManager.onToolAssistanceChangedEvent.addListener((args) => {\n setState((prev) => ({\n ...prev,\n instructions: args.instructions,\n }));\n open();\n });\n }, [open]);\n React.useEffect(() => {\n return UiFramework.frontstages.onToolIconChangedEvent.addListener(\n (args) => {\n setState((prev) => ({\n ...prev,\n toolIconSpec: args.iconSpec,\n toolIconElement: args.iconElement,\n }));\n open();\n }\n );\n }, [open]);\n\n const hasMouseInstructions = !!instructions?.sections?.some((section) => {\n return section.instructions.some((instruction) =>\n isMouseInstruction(instruction)\n );\n });\n const hasTouchInstructions = !!instructions?.sections?.some((section) => {\n return section.instructions.some((instruction) =>\n isTouchInstruction(instruction)\n );\n });\n\n const isMobileBrowser = React.useMemo(() => {\n return ProcessDetector.isMobileBrowser;\n }, []);\n const showMouseInstructions = !isMobileBrowser && hasMouseInstructions;\n const showTouchInstructions = hasTouchInstructions;\n const showMouseTouchTabs = showMouseInstructions && showTouchInstructions;\n\n const sectionInstructions = (instructions?.sections ?? [])\n .map((section) => {\n const displayableInstructions = getDisplayableInstructions(section);\n return {\n displayableInstructions,\n section,\n };\n })\n .filter((section) => {\n return section.displayableInstructions.length > 0;\n });\n\n const prompt = instructions?.mainInstruction.text;\n const tooltip = React.useMemo(() => {\n const lineBreak = \"\\u000d\\u000a\";\n const moreInfo = translate(\"toolAssistance.moreInfo\");\n const postfix = `${lineBreak}${moreInfo}`;\n if (activeTool) {\n return `${activeTool.flyover}${prompt ? ` > ${prompt}` : \"\"}${postfix}`;\n }\n if (prompt) {\n return `${prompt}${postfix}`;\n }\n return moreInfo;\n }, [prompt, activeTool, translate]);\n\n const dialogTitle = activeTool?.flyover ?? translate(\"toolAssistance.title\");\n const tabs = [\n translate(\"toolAssistance.mouse\"),\n translate(\"toolAssistance.touch\"),\n ];\n const [visible, setVisible] = useControlledState(\n false,\n visibleProp,\n onVisibleChange as React.Dispatch<React.SetStateAction<boolean>>\n );\n const [pinned, setPinned] = useControlledState(\n false,\n pinnedProp,\n onPinnedChange as React.Dispatch<React.SetStateAction<boolean>>\n );\n return (\n <StatusBarPopover\n visible={visible}\n onVisibleChange={setVisible}\n closeOnOutsideClick={!pinned}\n content={\n <ToolAssistanceDialog\n buttons={\n <StatusBarDialog.TitleBarButton\n onClick={() => {\n if (pinned) {\n handleClose();\n return;\n }\n setPinned(true);\n }}\n title={translate(pinned ? \"dialog.close\" : \"toolAssistance.pin\")}\n >\n {pinned ? <SvgClose /> : <SvgPin />}\n </StatusBarDialog.TitleBarButton>\n }\n title={dialogTitle}\n >\n <div>\n {showMouseTouchTabs && (\n <Tabs.Wrapper type=\"pill\" value={String(mouseTouchTabIndex)}>\n <Tabs.TabList className=\"uifw-toolAssistance-tabs\">\n {tabs.map((tab, index) => (\n <Tabs.Tab\n key={index}\n className=\"uifw-tab\"\n value={String(index)}\n label={tab}\n onClick={async () => {\n setState((prev) => ({\n ...prev,\n mouseTouchTabIndex: index,\n }));\n void uiStateStorage.saveSetting(\n toolAssistanceKey,\n mouseTouchTabIndexKey,\n index\n );\n }}\n />\n ))}\n </Tabs.TabList>\n </Tabs.Wrapper>\n )}\n {instructions ? (\n <div className=\"uifw-toolAssistance-content\">\n <NZ_ToolAssistanceInstruction\n key=\"main\"\n image={\n <InstructionImage\n instruction={instructions.mainInstruction}\n />\n }\n text={instructions.mainInstruction.text}\n isNew={instructions.mainInstruction.isNew}\n />\n\n {sectionInstructions.map((sectionInstruction, index) => {\n const { section, displayableInstructions } =\n sectionInstruction;\n return (\n <React.Fragment key={index.toString()}>\n <ToolAssistanceSeparator>\n {section.label}\n </ToolAssistanceSeparator>\n {displayableInstructions.map((instruction, index1) => {\n return (\n <NZ_ToolAssistanceInstruction\n key={`${index1.toString()}-${index.toString()}`}\n image={\n <InstructionImage instruction={instruction} />\n }\n text={instruction.text}\n isNew={instruction.isNew}\n />\n );\n })}\n </React.Fragment>\n );\n })}\n\n {includePromptAtCursor && (\n <>\n <ToolAssistanceSeparator key=\"prompt-sep\" />\n <ToolAssistanceItem key=\"prompt-item\">\n <ToggleSwitch\n label={translate(\"toolAssistance.promptAtCursor\")}\n labelPosition=\"right\"\n checked={state.showPromptAtCursor}\n onChange={(e) => {\n const checked = e.target.checked;\n setState((prev) => ({\n ...prev,\n showPromptAtCursor: checked,\n }));\n void uiStateStorage.saveSetting(\n toolAssistanceKey,\n showPromptAtCursorKey,\n checked\n );\n }}\n />\n </ToolAssistanceItem>\n </>\n )}\n </div>\n ) : undefined}\n </div>\n </ToolAssistanceDialog>\n }\n >\n <Button\n styleType=\"borderless\"\n startIcon={\n instructions ? (\n state.toolIconElement ?? (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Icon iconSpec={state.toolIconSpec} />\n )\n ) : (\n <></>\n )\n }\n className={classnames(\n \"uifw-statusFields-toolAssistance-toolAssistanceField\",\n props.className\n )}\n title={tooltip}\n style={props.style}\n labelProps={{ className: \"prompt\" }}\n >\n {prompt}\n <StatusBarPopover.ExpandIndicator />\n </Button>\n </StatusBarPopover>\n );\n}\n\nfunction isBothInstruction(instruction: ToolAssistanceInstruction) {\n return (\n instruction.inputMethod === undefined ||\n instruction.inputMethod === ToolAssistanceInputMethod.Both\n );\n}\n\nfunction isMouseInstruction(instruction: ToolAssistanceInstruction) {\n return instruction.inputMethod === ToolAssistanceInputMethod.Mouse;\n}\n\nfunction isTouchInstruction(instruction: ToolAssistanceInstruction) {\n return instruction.inputMethod === ToolAssistanceInputMethod.Touch;\n}\n\nfunction getWebComponentSource(iconSpec: string): string | undefined {\n if (iconSpec.startsWith(\"webSvg:\") && iconSpec.length > 7) {\n return iconSpec.slice(7);\n }\n\n return undefined;\n}\n\nfunction InstructionImage({\n instruction,\n}: {\n instruction: ToolAssistanceInstruction;\n}): React.ReactNode {\n let image: React.ReactNode;\n\n if (instruction.iconElement) return instruction.iconElement;\n\n if (\n (typeof instruction.image === \"string\" ||\n instruction.image !== ToolAssistanceImage.Keyboard) &&\n instruction.keyboardInfo\n ) {\n if (\n instruction.keyboardInfo.keys.length === 1 &&\n !instruction.keyboardInfo.bottomKeys\n ) {\n const key = instruction.keyboardInfo.keys[0];\n const rightImage =\n typeof instruction.image === \"string\" ? (\n <div className=\"uifw-toolassistance-icon-medium\">\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Icon iconSpec={instruction.image} />\n </div>\n ) : (\n <InstructionSvgImage instruction={instruction} mediumSize={true} />\n );\n\n image = (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <FillCentered>\n <KeyNode\n keyboardKey={key}\n className=\"uifw-toolassistance-key-modifier\"\n />\n {rightImage}\n </FillCentered>\n );\n } else {\n Logger.logError(\n UiFramework.loggerCategory(\"ToolAssistanceField\"),\n `getInstructionImage: Invalid keyboardInfo provided with image`\n );\n }\n } else if (typeof instruction.image === \"string\") {\n if (instruction.image.length > 0) {\n const svgSource = getWebComponentSource(instruction.image);\n const className =\n svgSource !== undefined\n ? \"uifw-toolassistance-svg\"\n : \"uifw-toolassistance-icon-large\";\n image = (\n <div className={className}>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Icon iconSpec={svgSource ?? instruction.image} />\n </div>\n );\n }\n } else if (instruction.image === ToolAssistanceImage.Keyboard) {\n if (instruction.keyboardInfo) {\n image = (\n <InstructionKeyboardImage keyboardInfo={instruction.keyboardInfo} />\n );\n } else {\n Logger.logError(\n UiFramework.loggerCategory(\"ToolAssistanceField\"),\n `getInstructionImage: ToolAssistanceImage.Keyboard specified but no keyboardInfo provided`\n );\n }\n } else {\n image = (\n <InstructionSvgImage instruction={instruction} mediumSize={false} />\n );\n }\n\n return image;\n}\n\nfunction InstructionSvgImage({\n instruction,\n mediumSize,\n}: {\n instruction: ToolAssistanceInstruction;\n mediumSize: boolean;\n}): React.ReactNode {\n let image: React.ReactNode;\n let className = mediumSize\n ? \"uifw-toolassistance-svg-medium\"\n : \"uifw-toolassistance-svg\";\n\n if (\n typeof instruction.image !== \"string\" &&\n instruction.image !== ToolAssistanceImage.Keyboard\n ) {\n const toolAssistanceImage: ToolAssistanceImage = instruction.image;\n let svgImage: React.ReactNode;\n\n switch (toolAssistanceImage) {\n case ToolAssistanceImage.AcceptPoint:\n svgImage = <SvgAdd />;\n break;\n case ToolAssistanceImage.CursorClick:\n svgImage = <SvgCursorClick />;\n break;\n case ToolAssistanceImage.LeftClick:\n svgImage = <SvgMouseClickLeft />;\n break;\n case ToolAssistanceImage.RightClick:\n svgImage = <SvgMouseClickRight />;\n break;\n case ToolAssistanceImage.MouseWheel:\n svgImage = <SvgMouseClickWheel />;\n break;\n case ToolAssistanceImage.LeftClickDrag:\n svgImage = <SvgMouseClickLeftDrag />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n case ToolAssistanceImage.RightClickDrag:\n svgImage = <SvgMouseClickRightDrag />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n case ToolAssistanceImage.MouseWheelClickDrag:\n svgImage = <SvgMouseClickWheelDrag />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n case ToolAssistanceImage.OneTouchTap:\n svgImage = <SvgGestureOneFingerTap />;\n break;\n case ToolAssistanceImage.OneTouchDoubleTap:\n svgImage = <SvgGestureOneFingerTapDouble />;\n break;\n case ToolAssistanceImage.OneTouchDrag:\n svgImage = <SvgGestureOneFingerDrag />;\n break;\n case ToolAssistanceImage.TwoTouchTap:\n svgImage = <SvgGestureTwoFingerTap />;\n break;\n case ToolAssistanceImage.TwoTouchDrag:\n svgImage = <SvgGestureTwoFingerDrag />;\n break;\n case ToolAssistanceImage.TwoTouchPinch:\n svgImage = <SvgGesturePinch />;\n break;\n case ToolAssistanceImage.TouchCursorTap:\n svgImage = <SvgTouchCursorPoint />;\n break;\n case ToolAssistanceImage.TouchCursorDrag:\n svgImage = <SvgTouchCursorPan />;\n className = mediumSize\n ? \"uifw-toolassistance-svg-medium-wide\"\n : \"uifw-toolassistance-svg-wide\";\n break;\n }\n\n image = (\n <div className={className}>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n {svgImage && <Icon iconSpec={svgImage} />}\n </div>\n );\n }\n\n return image;\n}\n\nfunction InstructionKeyboardImage({\n keyboardInfo,\n}: {\n keyboardInfo: ToolAssistanceKeyboardInfo;\n}): React.ReactNode {\n let image: React.ReactNode;\n\n if (keyboardInfo.bottomKeys !== undefined) {\n image = (\n <div className=\"uifw-toolassistance-key-group\">\n <span className=\"row1\">\n {keyboardInfo.keys.map((key, index) => {\n return (\n <KeyNode\n key={index}\n keyboardKey={key}\n className=\"uifw-toolassistance-key-small\"\n />\n );\n })}\n </span>\n <br />\n <span className=\"row2\">\n {keyboardInfo.bottomKeys.map((key, index) => {\n return (\n <KeyNode\n key={index}\n keyboardKey={key}\n className=\"uifw-toolassistance-key-small\"\n />\n );\n })}\n </span>\n </div>\n );\n } else if (keyboardInfo.keys.length === 2) {\n image = (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <FillCentered>\n {keyboardInfo.keys.map((key, index) => {\n let className = \"uifw-toolassistance-key-medium\";\n if (key.length > 1) className = \"uifw-toolassistance-key-modifier\";\n return (\n <KeyNode key={index} keyboardKey={key} className={className} />\n );\n })}\n </FillCentered>\n );\n } else if (keyboardInfo.keys[0]) {\n if (keyboardInfo.keys[0].length > 1)\n image = (\n <KeyNode\n keyboardKey={keyboardInfo.keys[0]}\n className=\"uifw-toolassistance-key-large\"\n />\n );\n else image = <KeyNode keyboardKey={keyboardInfo.keys[0]} />;\n } else {\n Logger.logError(\n UiFramework.loggerCategory(\"ToolAssistanceField\"),\n `ToolAssistanceImage.Keyboard specified but ToolAssistanceKeyboardInfo not valid`\n );\n }\n\n return image;\n}\n\nfunction KeyNode({\n keyboardKey,\n className,\n}: {\n keyboardKey: string;\n className?: string;\n}) {\n return (\n <div className={classnames(\"uifw-toolassistance-key\", className)}>\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <FillCentered>{keyboardKey}</FillCentered>\n </div>\n );\n}\n"]}
@@ -28,10 +28,12 @@ export declare enum ColorTheme {
28
28
  */
29
29
  export type ThemeId = `${ColorTheme}` | (string & {});
30
30
  /** The default widget opacity.
31
+ * @deprecated in 5.35.0. Use the default configuration.
31
32
  * @public
32
33
  */
33
- export declare const WIDGET_OPACITY_DEFAULT = 0.9;
34
+ export declare const WIDGET_OPACITY_DEFAULT = 1;
34
35
  /** The default widget opacity.
36
+ * @deprecated in 5.35.0. Use the default configuration.
35
37
  * @public
36
38
  */
37
39
  export declare const TOOLBAR_OPACITY_DEFAULT = 0.5;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeId.d.ts","sourceRoot":"","sources":["../../../src/appui-react/theme/ThemeId.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D;;GAEG;AACH,oBAAY,UAAU;IACpB,sCAAsC;IACtC,KAAK,UAAU;IACf,qCAAqC;IACrC,IAAI,SAAS;IACb,mCAAmC;IACnC,MAAM,qBAA+B;IACrC,mFAAmF;IACnF,OAAO,YAAY;IACnB,uEAAuE;IACvE,iBAAiB,wBAAwB;IACzC,sEAAsE;IACtE,gBAAgB,uBAAuB;CACxC;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,GAAG,UAAU,EAAE,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC"}
1
+ {"version":3,"file":"ThemeId.d.ts","sourceRoot":"","sources":["../../../src/appui-react/theme/ThemeId.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH;;GAEG;AACH,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D;;GAEG;AACH,oBAAY,UAAU;IACpB,sCAAsC;IACtC,KAAK,UAAU;IACf,qCAAqC;IACrC,IAAI,SAAS;IACb,mCAAmC;IACnC,MAAM,qBAA+B;IACrC,mFAAmF;IACnF,OAAO,YAAY;IACnB,uEAAuE;IACvE,iBAAiB,wBAAwB;IACzC,sEAAsE;IACtE,gBAAgB,uBAAuB;CACxC;AAED;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,GAAG,UAAU,EAAE,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC"}
@@ -28,10 +28,12 @@ export var ColorTheme;
28
28
  ColorTheme["HighContrastDark"] = "high-contrast-dark";
29
29
  })(ColorTheme || (ColorTheme = {}));
30
30
  /** The default widget opacity.
31
+ * @deprecated in 5.35.0. Use the default configuration.
31
32
  * @public
32
33
  */
33
- export const WIDGET_OPACITY_DEFAULT = 0.9;
34
+ export const WIDGET_OPACITY_DEFAULT = 1;
34
35
  /** The default widget opacity.
36
+ * @deprecated in 5.35.0. Use the default configuration.
35
37
  * @public
36
38
  */
37
39
  export const TOOLBAR_OPACITY_DEFAULT = 0.5;
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeId.js","sourceRoot":"","sources":["../../../src/appui-react/theme/ThemeId.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAN,IAAY,UAaX;AAbD,WAAY,UAAU;IACpB,sCAAsC;IACtC,6BAAe,CAAA;IACf,qCAAqC;IACrC,2BAAa,CAAA;IACb,mCAAmC;IACnC,yCAAqC,CAAA;IACrC,mFAAmF;IACnF,iCAAmB,CAAA;IACnB,uEAAuE;IACvE,uDAAyC,CAAA;IACzC,sEAAsE;IACtE,qDAAuC,CAAA;AACzC,CAAC,EAbW,UAAU,KAAV,UAAU,QAarB;AAQD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,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 State\n */\n\nimport type { ThemeManager } from \"./ThemeManager.js\";\n\n/** System preferred color theme.\n * @public\n */\nexport const SYSTEM_PREFERRED_COLOR_THEME = \"SYSTEM_PREFERRED\";\n\n/** Enum for the Color Theme string.\n * @public\n */\nexport enum ColorTheme {\n /** Will use iTwinUI `light` theme. */\n Light = \"light\",\n /** Will use iTwinUI `dark` theme. */\n Dark = \"dark\",\n /** Will use iTwinUI `os` theme. */\n System = SYSTEM_PREFERRED_COLOR_THEME,\n /** Will use iTwinUI wrapping `ThemeProvider` if provided, or default to 'Light' */\n Inherit = \"inherit\",\n /** Will use iTwinUI `light` theme with `highContrast` set to `true` */\n HighContrastLight = \"high-contrast-light\",\n /** Will use iTwinUI `dark` theme with `highContrast` set to `true` */\n HighContrastDark = \"high-contrast-dark\",\n}\n\n/** Describe valid themes.\n * See {@link ThemeManager} for more information.\n * @public\n */\nexport type ThemeId = `${ColorTheme}` | (string & {});\n\n/** The default widget opacity.\n * @public\n */\nexport const WIDGET_OPACITY_DEFAULT = 0.9;\n\n/** The default widget opacity.\n * @public\n */\nexport const TOOLBAR_OPACITY_DEFAULT = 0.5;\n"]}
1
+ {"version":3,"file":"ThemeId.js","sourceRoot":"","sources":["../../../src/appui-react/theme/ThemeId.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D;;GAEG;AACH,MAAM,CAAN,IAAY,UAaX;AAbD,WAAY,UAAU;IACpB,sCAAsC;IACtC,6BAAe,CAAA;IACf,qCAAqC;IACrC,2BAAa,CAAA;IACb,mCAAmC;IACnC,yCAAqC,CAAA;IACrC,mFAAmF;IACnF,iCAAmB,CAAA;IACnB,uEAAuE;IACvE,uDAAyC,CAAA;IACzC,sEAAsE;IACtE,qDAAuC,CAAA;AACzC,CAAC,EAbW,UAAU,KAAV,UAAU,QAarB;AAQD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,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 State\n */\n\nimport type { ThemeManager } from \"./ThemeManager.js\";\n\n/** System preferred color theme.\n * @public\n */\nexport const SYSTEM_PREFERRED_COLOR_THEME = \"SYSTEM_PREFERRED\";\n\n/** Enum for the Color Theme string.\n * @public\n */\nexport enum ColorTheme {\n /** Will use iTwinUI `light` theme. */\n Light = \"light\",\n /** Will use iTwinUI `dark` theme. */\n Dark = \"dark\",\n /** Will use iTwinUI `os` theme. */\n System = SYSTEM_PREFERRED_COLOR_THEME,\n /** Will use iTwinUI wrapping `ThemeProvider` if provided, or default to 'Light' */\n Inherit = \"inherit\",\n /** Will use iTwinUI `light` theme with `highContrast` set to `true` */\n HighContrastLight = \"high-contrast-light\",\n /** Will use iTwinUI `dark` theme with `highContrast` set to `true` */\n HighContrastDark = \"high-contrast-dark\",\n}\n\n/** Describe valid themes.\n * See {@link ThemeManager} for more information.\n * @public\n */\nexport type ThemeId = `${ColorTheme}` | (string & {});\n\n/** The default widget opacity.\n * @deprecated in 5.35.0. Use the default configuration.\n * @public\n */\nexport const WIDGET_OPACITY_DEFAULT = 1;\n\n/** The default widget opacity.\n * @deprecated in 5.35.0. Use the default configuration.\n * @public\n */\nexport const TOOLBAR_OPACITY_DEFAULT = 0.5;\n"]}
@@ -29,7 +29,9 @@ export interface ToolbarProps extends CommonProps, NoChildrenProps {
29
29
  panelAlignment?: ToolbarPanelAlignment;
30
30
  /** Use drag interaction to open popups with nested toolbar buttons. */
31
31
  useDragInteraction?: boolean;
32
- /** Determines whether to use mouse proximity to alter the opacity of the toolbar */
32
+ /** Determines whether to use mouse proximity to alter the opacity of the toolbar.
33
+ * @deprecated in 5.35.0. Use the default configuration.
34
+ */
33
35
  toolbarOpacitySetting?: ToolbarOpacitySetting;
34
36
  /** Optional function to call on any item execution */
35
37
  onItemExecuted?: OnItemExecutedFunc;
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../../src/appui-react/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,mIAAmI;IACnI,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;GAEG;AAEH,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,eAAe;IAChE,2OAA2O;IAC3O,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gHAAgH;IAChH,cAAc,CAAC,EAAE,OAAO,GAAG,sBAAsB,CAAC;IAClD,uGAAuG;IACvG,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,qBAAqB,CAA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KAAK,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAyC;IACjE,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,qBAAqB,CAAC,GAAG;YAC5B,OAAO,KAAK,CAAC;QACf,KAAK,qBAAqB,CAAC,KAAK;YAC9B,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type { ToolbarOpacitySetting } from \"@itwin/components-react\";\nimport { Direction, ToolbarPanelAlignment } from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem.js\";\nimport { Toolbar as ToolGroupToolbar } from \"./new-toolbars/Toolbar.js\";\n\n/**\n * Properties of [[Toolbar.enableOverflow]] component.\n * @public\n */\nexport interface OverflowToolbarOptions {\n /** Describes to which direction the overflow popup panels are expanded if overflow is enabled. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n}\n\n/** Properties of [[Toolbar]] component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded, also defines the orientation of the toolbar (Top/Bottom will create an horizontal toolbar, Left/Right will create a vertical toolbar). Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes if items that do not fit available space should move to an expandable panel. Defaults to: false */\n enableOverflow?: boolean | OverflowToolbarOptions;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use drag interaction to open popups with nested toolbar buttons. */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items.\n * @beta\n */\nexport function Toolbar(props: ToolbarProps) {\n const {\n expandsTo: expandsToProp,\n panelAlignment: panelAlignmentProp,\n ...rest\n } = props;\n const expandsTo = toDirection(expandsToProp);\n const panelAlignment = toPanelAlignment(panelAlignmentProp);\n return (\n <ToolGroupToolbar\n expandsTo={expandsTo}\n panelAlignment={panelAlignment}\n {...rest}\n />\n );\n}\n\nfunction toDirection(direction: ToolbarProps[\"expandsTo\"]) {\n switch (direction) {\n case Direction.Bottom:\n return \"bottom\";\n case Direction.Left:\n return \"left\";\n case Direction.Right:\n return \"right\";\n case Direction.Top:\n return \"top\";\n }\n return undefined;\n}\n\nfunction toPanelAlignment(alignment: ToolbarProps[\"panelAlignment\"]) {\n switch (alignment) {\n case ToolbarPanelAlignment.End:\n return \"end\";\n case ToolbarPanelAlignment.Start:\n return \"start\";\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAqCxE;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,MAAM,EACJ,SAAS,EAAE,aAAa,EACxB,cAAc,EAAE,kBAAkB,EAClC,GAAG,IAAI,EACR,GAAG,KAAK,CAAC;IACV,MAAM,SAAS,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,cAAc,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IAC5D,OAAO,CACL,oBAAC,gBAAgB,IACf,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,KAC1B,IAAI,GACR,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,SAAoC;IACvD,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,SAAS,CAAC,MAAM;YACnB,OAAO,QAAQ,CAAC;QAClB,KAAK,SAAS,CAAC,IAAI;YACjB,OAAO,MAAM,CAAC;QAChB,KAAK,SAAS,CAAC,KAAK;YAClB,OAAO,OAAO,CAAC;QACjB,KAAK,SAAS,CAAC,GAAG;YAChB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAyC;IACjE,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,qBAAqB,CAAC,GAAG;YAC5B,OAAO,KAAK,CAAC;QACf,KAAK,qBAAqB,CAAC,KAAK;YAC9B,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type { ToolbarOpacitySetting } from \"@itwin/components-react\";\nimport { Direction, ToolbarPanelAlignment } from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem.js\";\nimport { Toolbar as ToolGroupToolbar } from \"./new-toolbars/Toolbar.js\";\n\n/**\n * Properties of [[Toolbar.enableOverflow]] component.\n * @public\n */\nexport interface OverflowToolbarOptions {\n /** Describes to which direction the overflow popup panels are expanded if overflow is enabled. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n}\n\n/** Properties of [[Toolbar]] component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ToolbarProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded, also defines the orientation of the toolbar (Top/Bottom will create an horizontal toolbar, Left/Right will create a vertical toolbar). Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes if items that do not fit available space should move to an expandable panel. Defaults to: false */\n enableOverflow?: boolean | OverflowToolbarOptions;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use drag interaction to open popups with nested toolbar buttons. */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar.\n * @deprecated in 5.35.0. Use the default configuration.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items.\n * @beta\n */\nexport function Toolbar(props: ToolbarProps) {\n const {\n expandsTo: expandsToProp,\n panelAlignment: panelAlignmentProp,\n ...rest\n } = props;\n const expandsTo = toDirection(expandsToProp);\n const panelAlignment = toPanelAlignment(panelAlignmentProp);\n return (\n <ToolGroupToolbar\n expandsTo={expandsTo}\n panelAlignment={panelAlignment}\n {...rest}\n />\n );\n}\n\nfunction toDirection(direction: ToolbarProps[\"expandsTo\"]) {\n switch (direction) {\n case Direction.Bottom:\n return \"bottom\";\n case Direction.Left:\n return \"left\";\n case Direction.Right:\n return \"right\";\n case Direction.Top:\n return \"top\";\n }\n return undefined;\n}\n\nfunction toPanelAlignment(alignment: ToolbarProps[\"panelAlignment\"]) {\n switch (alignment) {\n case ToolbarPanelAlignment.End:\n return \"end\";\n case ToolbarPanelAlignment.Start:\n return \"start\";\n }\n return undefined;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarComposer.d.ts","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAIV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,kBAAkB,EAClB,YAAY,EACb,MAAM,kBAAkB,CAAC;AA8J1B;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,8FAA8F;IAC9F,KAAK,EAAE,YAAY,CAAC;IACpB,2BAA2B;IAC3B,WAAW,EAAE,kBAAkB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,qBA4C5D;AAqED,gBAAgB;AAChB,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAAE,EACpB,aAAa,EAAE,MAAM,EAAE,iBA4BxB"}
1
+ {"version":3,"file":"ToolbarComposer.d.ts","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAIV,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,kBAAkB,EAClB,YAAY,EACb,MAAM,kBAAkB,CAAC;AAgK1B;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,8FAA8F;IAC9F,KAAK,EAAE,YAAY,CAAC;IACpB,2BAA2B;IAC3B,WAAW,EAAE,kBAAkB,CAAC;IAChC;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,KAAK,EAAE,sBAAsB,qBA+C5D;AAqED,gBAAgB;AAChB,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,WAAW,EAAE,EACpB,aAAa,EAAE,MAAM,EAAE,iBA4BxB"}
@@ -119,9 +119,13 @@ const useProximityOpacitySetting = () => {
119
119
  return proximityOpacity;
120
120
  };
121
121
  const useSnapWidgetOpacitySetting = () => {
122
- const [snapWidgetOpacity, setSnapWidgetOpacity] = React.useState(UiFramework.visibility.snapWidgetOpacity);
122
+ const [snapWidgetOpacity, setSnapWidgetOpacity] = React.useState(
123
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
124
+ UiFramework.visibility.snapWidgetOpacity);
123
125
  React.useEffect(() => {
124
- UiFramework.onUiVisibilityChanged.addListener(() => setSnapWidgetOpacity(UiFramework.visibility.snapWidgetOpacity));
126
+ UiFramework.onUiVisibilityChanged.addListener(() =>
127
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
128
+ setSnapWidgetOpacity(UiFramework.visibility.snapWidgetOpacity));
125
129
  }, []);
126
130
  return snapWidgetOpacity;
127
131
  };
@@ -152,10 +156,14 @@ export function ToolbarComposer(props) {
152
156
  const snapWidgetOpacity = useSnapWidgetOpacitySetting();
153
157
  const expandsTo = toExpandsTo(orientation, usage);
154
158
  const panelAlignment = toPanelAlignment(orientation, usage);
155
- return (React.createElement(Toolbar, { enableOverflow: true, expandsTo: expandsTo, panelAlignment: panelAlignment, items: items, useDragInteraction: isDragEnabled, toolbarOpacitySetting: (useProximityOpacity || snapWidgetOpacity) &&
159
+ return (React.createElement(Toolbar, { enableOverflow: true, expandsTo: expandsTo, panelAlignment: panelAlignment, items: items, useDragInteraction: isDragEnabled,
160
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
161
+ toolbarOpacitySetting: (useProximityOpacity || snapWidgetOpacity) &&
156
162
  !ProcessDetector.isMobileBrowser
157
- ? ToolbarOpacitySetting.Proximity
158
- : ToolbarOpacitySetting.Defaults }));
163
+ ? // eslint-disable-next-line @typescript-eslint/no-deprecated
164
+ ToolbarOpacitySetting.Proximity
165
+ : // eslint-disable-next-line @typescript-eslint/no-deprecated
166
+ ToolbarOpacitySetting.Defaults }));
159
167
  }
160
168
  function toExpandsTo(orientation, usage) {
161
169
  if (orientation === ToolbarOrientation.Vertical) {
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarComposer.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAOrE,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;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C,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAkB,CAAU,CAAC,CAAC;QAEvE,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC;YAE1C,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpD,4DAA4D;YAC5D,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAE5B,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;oBAClC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC/C,CAAC;YACH,CAAC;YAED,IAAI,CAAC,QAAQ;gBAAE,SAAS;YAExB,2CAA2C;YAC3C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;gBACjC,4DAA4D;gBAC5D,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,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 Toolbar\n */\n\nimport * as React from \"react\";\nimport { produce } from \"immer\";\nimport {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { Logger, ProcessDetector } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { ToolbarDragInteractionContext } from \"./DragInteraction.js\";\nimport type {\n CommonToolbarItem,\n ToolbarActionItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem.js\";\nimport {\n isToolbarActionItem,\n isToolbarGroupItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\nimport { useActiveStageProvidedToolbarItems } from \"./useActiveStageProvidedToolbarItems.js\";\nimport { useActiveToolId } from \"../hooks/useActiveToolId.js\";\nimport { ConditionalBooleanValue } from \"../shared/ConditionalValue.js\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher.js\";\n\nfunction addItemToSpecifiedParentGroup<T extends ToolbarItem>(\n items: readonly T[],\n groupChildren: Array<ToolbarActionItem | ToolbarGroupItem>\n): T[] {\n const outItems: T[] = [];\n for (const toolbarItem of items) {\n if (!isToolbarGroupItem(toolbarItem)) {\n outItems.push(toolbarItem);\n continue;\n }\n\n const newChildren = addItemToSpecifiedParentGroup(\n toolbarItem.items,\n groupChildren\n );\n const foundIndices: number[] = [];\n\n groupChildren.forEach((entry, index) => {\n if (entry.parentGroupItemId === toolbarItem.id) {\n foundIndices.push(index);\n }\n });\n\n if (foundIndices.length) {\n // process in reverse order so groupChildren can be reduced as we find matches\n foundIndices\n .sort((a, b) => a - b)\n .reverse()\n .forEach((foundIndex) => {\n newChildren.push(groupChildren[foundIndex]);\n groupChildren.splice(foundIndex);\n });\n }\n\n outItems.push({ ...toolbarItem, items: newChildren });\n }\n return outItems;\n}\n\nfunction cloneGroup(inGroup: ToolbarGroupItem): ToolbarGroupItem {\n const childItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n inGroup.items.forEach((item) => {\n if (isToolbarGroupItem(item)) childItems.push(cloneGroup(item));\n else childItems.push(item);\n });\n\n const clonedGroup = { ...inGroup, items: childItems };\n return clonedGroup;\n}\n\nfunction getItemSortValue(item: ToolbarItem) {\n const groupValue = undefined === item.groupPriority ? 0 : item.groupPriority;\n return groupValue * 10000 + item.itemPriority;\n}\n\nfunction sortItems(items: ReadonlyArray<ToolbarItem>): ToolbarItem[] {\n return [...items]\n .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))\n .map((i) => {\n if (isToolbarGroupItem(i)) {\n return { ...i, items: sortItems(i.items) };\n }\n return i;\n });\n}\n\n/**\n * Create a forEach handler that will add every element of an array of ToolbarItems\n * to a list of items that can then be replaced in its proper place, ensuring that\n * the same item, from different list, is not added multiple times.\n * @param items Output list of items\n * @param groupChildren Output list of group children to redistribute.\n * @returns Array<ToolbarItem>.forEach handler.\n */\nfunction addIfNotDuplicate(\n items: ToolbarItem[],\n groupChildren: (ToolbarActionItem | ToolbarGroupItem)[]\n): (value: ToolbarItem) => void {\n return (srcItem: ToolbarItem) => {\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\n // if the default item is a group that an addon may insert into copy it so we don't mess with original\n const toolbarItem = isToolbarGroupItem(srcItem)\n ? cloneGroup(srcItem)\n : srcItem;\n if (\n (isToolbarGroupItem(toolbarItem) || isToolbarActionItem(toolbarItem)) &&\n toolbarItem.parentGroupItemId\n )\n groupChildren.push(toolbarItem);\n else items.push(toolbarItem);\n }\n };\n}\n\n/** local function to combine items from Stage and from Extensions */\nfunction combineItems(\n defaultItems: ReadonlyArray<ToolbarItem>,\n addonItems: ReadonlyArray<ToolbarItem>\n): ToolbarItem[] {\n let items: ToolbarItem[] = [];\n const groupChildren: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n\n defaultItems.forEach(addIfNotDuplicate(items, groupChildren));\n addonItems.forEach(addIfNotDuplicate(items, groupChildren));\n\n // if an item from an addon has specified a parent group then try to find it and insert it. If no parent is found, add item at root level.\n if (groupChildren.length) {\n items = addItemToSpecifiedParentGroup(items, groupChildren);\n\n groupChildren.forEach((toolbarItem) => {\n Logger.logWarning(\n \"ToolbarComposer\",\n `Requested Parent Group [${toolbarItem.parentGroupItemId!}] not found, so item [${\n toolbarItem.id\n }] is added directly to toolbar.`\n );\n items.push(toolbarItem);\n });\n }\n\n return sortItems(items);\n}\n\nconst useProximityOpacitySetting = () => {\n const [proximityOpacity, setProximityOpacity] = React.useState(\n UiFramework.visibility.useProximityOpacity // eslint-disable-line @typescript-eslint/no-deprecated\n );\n\n React.useEffect(() => {\n UiFramework.onUiVisibilityChanged.addListener(\n () => setProximityOpacity(UiFramework.visibility.useProximityOpacity) // eslint-disable-line @typescript-eslint/no-deprecated\n );\n }, []);\n\n return proximityOpacity;\n};\n\nconst useSnapWidgetOpacitySetting = () => {\n const [snapWidgetOpacity, setSnapWidgetOpacity] = React.useState(\n UiFramework.visibility.snapWidgetOpacity\n );\n\n React.useEffect(() => {\n UiFramework.onUiVisibilityChanged.addListener(() =>\n setSnapWidgetOpacity(UiFramework.visibility.snapWidgetOpacity)\n );\n }, []);\n\n return snapWidgetOpacity;\n};\n\n/** Properties for the [[ToolbarComposer]] React components\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof ToolbarComposer>`\n */\nexport interface ExtensibleToolbarProps {\n /** Toolbar items to be displayed in addition to the provided toolbar items. */\n items: ToolbarItem[];\n /** Toolbar usage based on which additional toolbar items are added from UI item providers. */\n usage: ToolbarUsage;\n /** Toolbar orientation. */\n orientation: ToolbarOrientation;\n /** Describes the ids of active toolbar items.\n * By default only the toolbar item with id that matches the active `Tool` id is active.\n * @note Property {@link CommonToolbarItem.isActiveCondition} takes precedence when determining the active state of a toolbar item.\n */\n activeItemIds?: string[];\n}\n\n/**\n * Toolbar that is populated and maintained by UI item providers.\n * @note Overrides {@link CommonToolbarItem.isActive} property based on the active tool id, unless {@link ExtensibleToolbarProps.activeItemIds} is specified.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function ToolbarComposer(props: ExtensibleToolbarProps) {\n const { usage, orientation, activeItemIds: activeItemIdsProp } = props;\n\n // process items from addon UI providers\n const addonItems = useActiveStageProvidedToolbarItems(usage, orientation);\n\n const allItems = React.useMemo(() => {\n return combineItems(props.items, addonItems);\n }, [props.items, addonItems]);\n\n const activeToolId = useActiveToolId();\n const activeItemIds = React.useMemo(\n () => activeItemIdsProp ?? (activeToolId ? [activeToolId] : []),\n [activeItemIdsProp, activeToolId]\n );\n const activeConditionalItemIds = useActiveConditionalItemIds(allItems);\n const items = React.useMemo(() => {\n return updateActiveItems(allItems, [\n ...activeItemIds,\n ...activeConditionalItemIds,\n ]);\n }, [allItems, activeItemIds, activeConditionalItemIds]);\n\n const isDragEnabled = React.useContext(ToolbarDragInteractionContext);\n const useProximityOpacity = useProximityOpacitySetting();\n const snapWidgetOpacity = useSnapWidgetOpacitySetting();\n\n const expandsTo = toExpandsTo(orientation, usage);\n const panelAlignment = toPanelAlignment(orientation, usage);\n return (\n <Toolbar\n enableOverflow={true}\n expandsTo={expandsTo}\n panelAlignment={panelAlignment}\n items={items}\n useDragInteraction={isDragEnabled}\n toolbarOpacitySetting={\n (useProximityOpacity || snapWidgetOpacity) &&\n !ProcessDetector.isMobileBrowser\n ? ToolbarOpacitySetting.Proximity\n : ToolbarOpacitySetting.Defaults\n }\n />\n );\n}\n\nfunction toExpandsTo(orientation: ToolbarOrientation, usage: ToolbarUsage) {\n if (orientation === ToolbarOrientation.Vertical) {\n if (usage === ToolbarUsage.ViewNavigation) return Direction.Left;\n return Direction.Right;\n }\n\n return Direction.Bottom;\n}\n\nfunction toPanelAlignment(\n orientation: ToolbarOrientation,\n usage: ToolbarUsage\n) {\n if (\n orientation === ToolbarOrientation.Horizontal &&\n usage === ToolbarUsage.ViewNavigation\n )\n return ToolbarPanelAlignment.End;\n\n return ToolbarPanelAlignment.Start;\n}\n\nfunction useActiveConditionalItemIds(items: ToolbarItem[]) {\n const [activeItemIds, setActiveItemIds] = React.useState<string[]>([]);\n const conditionalItems = React.useMemo(() => {\n const conditionals: ToolbarItem[] = [];\n const stack = [...items];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (current.isActiveCondition) conditionals.push(current);\n\n if (isToolbarGroupItem(current)) {\n for (const child of current.items) {\n stack.push(child);\n }\n }\n }\n return conditionals;\n }, [items]);\n React.useEffect(() => {\n return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {\n const newActiveIds: string[] = [];\n for (const item of conditionalItems) {\n ConditionalBooleanValue.refreshValue(\n item.isActiveCondition,\n args.eventIds\n );\n\n const isActive = ConditionalBooleanValue.getValue(\n item.isActiveCondition\n );\n if (isActive) newActiveIds.push(item.id);\n }\n setActiveItemIds(newActiveIds);\n });\n }, [conditionalItems]);\n React.useEffect(() => {\n const newActiveIds: string[] = [];\n for (const item of conditionalItems) {\n const isActive = ConditionalBooleanValue.getValue(item.isActiveCondition);\n if (isActive) newActiveIds.push(item.id);\n }\n setActiveItemIds(newActiveIds);\n }, [conditionalItems]);\n return activeItemIds;\n}\n\n/** @internal */\nexport function updateActiveItems(\n items: ToolbarItem[],\n activeItemIds: string[]\n) {\n return produce(items, (draft) => {\n // Iterative DFS with ancestor backtracking.\n const stack = draft.map((item) => [item, [] as typeof draft] as const);\n\n while (stack.length > 0) {\n const [current, ancestors] = stack.pop()!;\n\n const isActive = activeItemIds.includes(current.id);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n current.isActive = isActive;\n\n if (isToolbarGroupItem(current)) {\n for (const child of current.items) {\n stack.push([child, [...ancestors, current]]);\n }\n }\n\n if (!isActive) continue;\n\n // Mark ancestors of active item as active.\n for (const ancestor of ancestors) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ancestor.isActive = true;\n }\n }\n });\n}\n"]}
1
+ {"version":3,"file":"ToolbarComposer.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarComposer.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAA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QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,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 Toolbar\n */\n\nimport * as React from \"react\";\nimport { produce } from \"immer\";\nimport {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport { Logger, ProcessDetector } from \"@itwin/core-bentley\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { ToolbarDragInteractionContext } from \"./DragInteraction.js\";\nimport type {\n CommonToolbarItem,\n ToolbarActionItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem.js\";\nimport {\n isToolbarActionItem,\n isToolbarGroupItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\nimport { useActiveStageProvidedToolbarItems } from \"./useActiveStageProvidedToolbarItems.js\";\nimport { useActiveToolId } from \"../hooks/useActiveToolId.js\";\nimport { ConditionalBooleanValue } from \"../shared/ConditionalValue.js\";\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher.js\";\n\nfunction addItemToSpecifiedParentGroup<T extends ToolbarItem>(\n items: readonly T[],\n groupChildren: Array<ToolbarActionItem | ToolbarGroupItem>\n): T[] {\n const outItems: T[] = [];\n for (const toolbarItem of items) {\n if (!isToolbarGroupItem(toolbarItem)) {\n outItems.push(toolbarItem);\n continue;\n }\n\n const newChildren = addItemToSpecifiedParentGroup(\n toolbarItem.items,\n groupChildren\n );\n const foundIndices: number[] = [];\n\n groupChildren.forEach((entry, index) => {\n if (entry.parentGroupItemId === toolbarItem.id) {\n foundIndices.push(index);\n }\n });\n\n if (foundIndices.length) {\n // process in reverse order so groupChildren can be reduced as we find matches\n foundIndices\n .sort((a, b) => a - b)\n .reverse()\n .forEach((foundIndex) => {\n newChildren.push(groupChildren[foundIndex]);\n groupChildren.splice(foundIndex);\n });\n }\n\n outItems.push({ ...toolbarItem, items: newChildren });\n }\n return outItems;\n}\n\nfunction cloneGroup(inGroup: ToolbarGroupItem): ToolbarGroupItem {\n const childItems: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n inGroup.items.forEach((item) => {\n if (isToolbarGroupItem(item)) childItems.push(cloneGroup(item));\n else childItems.push(item);\n });\n\n const clonedGroup = { ...inGroup, items: childItems };\n return clonedGroup;\n}\n\nfunction getItemSortValue(item: ToolbarItem) {\n const groupValue = undefined === item.groupPriority ? 0 : item.groupPriority;\n return groupValue * 10000 + item.itemPriority;\n}\n\nfunction sortItems(items: ReadonlyArray<ToolbarItem>): ToolbarItem[] {\n return [...items]\n .sort((a, b) => getItemSortValue(a) - getItemSortValue(b))\n .map((i) => {\n if (isToolbarGroupItem(i)) {\n return { ...i, items: sortItems(i.items) };\n }\n return i;\n });\n}\n\n/**\n * Create a forEach handler that will add every element of an array of ToolbarItems\n * to a list of items that can then be replaced in its proper place, ensuring that\n * the same item, from different list, is not added multiple times.\n * @param items Output list of items\n * @param groupChildren Output list of group children to redistribute.\n * @returns Array<ToolbarItem>.forEach handler.\n */\nfunction addIfNotDuplicate(\n items: ToolbarItem[],\n groupChildren: (ToolbarActionItem | ToolbarGroupItem)[]\n): (value: ToolbarItem) => void {\n return (srcItem: ToolbarItem) => {\n if (-1 === items.findIndex((item) => item.id === srcItem.id)) {\n // if the default item is a group that an addon may insert into copy it so we don't mess with original\n const toolbarItem = isToolbarGroupItem(srcItem)\n ? cloneGroup(srcItem)\n : srcItem;\n if (\n (isToolbarGroupItem(toolbarItem) || isToolbarActionItem(toolbarItem)) &&\n toolbarItem.parentGroupItemId\n )\n groupChildren.push(toolbarItem);\n else items.push(toolbarItem);\n }\n };\n}\n\n/** local function to combine items from Stage and from Extensions */\nfunction combineItems(\n defaultItems: ReadonlyArray<ToolbarItem>,\n addonItems: ReadonlyArray<ToolbarItem>\n): ToolbarItem[] {\n let items: ToolbarItem[] = [];\n const groupChildren: Array<ToolbarActionItem | ToolbarGroupItem> = [];\n\n defaultItems.forEach(addIfNotDuplicate(items, groupChildren));\n addonItems.forEach(addIfNotDuplicate(items, groupChildren));\n\n // if an item from an addon has specified a parent group then try to find it and insert it. If no parent is found, add item at root level.\n if (groupChildren.length) {\n items = addItemToSpecifiedParentGroup(items, groupChildren);\n\n groupChildren.forEach((toolbarItem) => {\n Logger.logWarning(\n \"ToolbarComposer\",\n `Requested Parent Group [${toolbarItem.parentGroupItemId!}] not found, so item [${\n toolbarItem.id\n }] is added directly to toolbar.`\n );\n items.push(toolbarItem);\n });\n }\n\n return sortItems(items);\n}\n\nconst useProximityOpacitySetting = () => {\n const [proximityOpacity, setProximityOpacity] = React.useState(\n UiFramework.visibility.useProximityOpacity // eslint-disable-line @typescript-eslint/no-deprecated\n );\n\n React.useEffect(() => {\n UiFramework.onUiVisibilityChanged.addListener(\n () => setProximityOpacity(UiFramework.visibility.useProximityOpacity) // eslint-disable-line @typescript-eslint/no-deprecated\n );\n }, []);\n\n return proximityOpacity;\n};\n\nconst useSnapWidgetOpacitySetting = () => {\n const [snapWidgetOpacity, setSnapWidgetOpacity] = React.useState(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.visibility.snapWidgetOpacity\n );\n\n React.useEffect(() => {\n UiFramework.onUiVisibilityChanged.addListener(() =>\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setSnapWidgetOpacity(UiFramework.visibility.snapWidgetOpacity)\n );\n }, []);\n\n return snapWidgetOpacity;\n};\n\n/** Properties for the [[ToolbarComposer]] React components\n * @public\n * @deprecated in 4.17.0. Use `React.ComponentProps<typeof ToolbarComposer>`\n */\nexport interface ExtensibleToolbarProps {\n /** Toolbar items to be displayed in addition to the provided toolbar items. */\n items: ToolbarItem[];\n /** Toolbar usage based on which additional toolbar items are added from UI item providers. */\n usage: ToolbarUsage;\n /** Toolbar orientation. */\n orientation: ToolbarOrientation;\n /** Describes the ids of active toolbar items.\n * By default only the toolbar item with id that matches the active `Tool` id is active.\n * @note Property {@link CommonToolbarItem.isActiveCondition} takes precedence when determining the active state of a toolbar item.\n */\n activeItemIds?: string[];\n}\n\n/**\n * Toolbar that is populated and maintained by UI item providers.\n * @note Overrides {@link CommonToolbarItem.isActive} property based on the active tool id, unless {@link ExtensibleToolbarProps.activeItemIds} is specified.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport function ToolbarComposer(props: ExtensibleToolbarProps) {\n const { usage, orientation, activeItemIds: activeItemIdsProp } = props;\n\n // process items from addon UI providers\n const addonItems = useActiveStageProvidedToolbarItems(usage, orientation);\n\n const allItems = React.useMemo(() => {\n return combineItems(props.items, addonItems);\n }, [props.items, addonItems]);\n\n const activeToolId = useActiveToolId();\n const activeItemIds = React.useMemo(\n () => activeItemIdsProp ?? (activeToolId ? [activeToolId] : []),\n [activeItemIdsProp, activeToolId]\n );\n const activeConditionalItemIds = useActiveConditionalItemIds(allItems);\n const items = React.useMemo(() => {\n return updateActiveItems(allItems, [\n ...activeItemIds,\n ...activeConditionalItemIds,\n ]);\n }, [allItems, activeItemIds, activeConditionalItemIds]);\n\n const isDragEnabled = React.useContext(ToolbarDragInteractionContext);\n const useProximityOpacity = useProximityOpacitySetting();\n const snapWidgetOpacity = useSnapWidgetOpacitySetting();\n\n const expandsTo = toExpandsTo(orientation, usage);\n const panelAlignment = toPanelAlignment(orientation, usage);\n return (\n <Toolbar\n enableOverflow={true}\n expandsTo={expandsTo}\n panelAlignment={panelAlignment}\n items={items}\n useDragInteraction={isDragEnabled}\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n toolbarOpacitySetting={\n (useProximityOpacity || snapWidgetOpacity) &&\n !ProcessDetector.isMobileBrowser\n ? // eslint-disable-next-line @typescript-eslint/no-deprecated\n ToolbarOpacitySetting.Proximity\n : // eslint-disable-next-line @typescript-eslint/no-deprecated\n ToolbarOpacitySetting.Defaults\n }\n />\n );\n}\n\nfunction toExpandsTo(orientation: ToolbarOrientation, usage: ToolbarUsage) {\n if (orientation === ToolbarOrientation.Vertical) {\n if (usage === ToolbarUsage.ViewNavigation) return Direction.Left;\n return Direction.Right;\n }\n\n return Direction.Bottom;\n}\n\nfunction toPanelAlignment(\n orientation: ToolbarOrientation,\n usage: ToolbarUsage\n) {\n if (\n orientation === ToolbarOrientation.Horizontal &&\n usage === ToolbarUsage.ViewNavigation\n )\n return ToolbarPanelAlignment.End;\n\n return ToolbarPanelAlignment.Start;\n}\n\nfunction useActiveConditionalItemIds(items: ToolbarItem[]) {\n const [activeItemIds, setActiveItemIds] = React.useState<string[]>([]);\n const conditionalItems = React.useMemo(() => {\n const conditionals: ToolbarItem[] = [];\n const stack = [...items];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (current.isActiveCondition) conditionals.push(current);\n\n if (isToolbarGroupItem(current)) {\n for (const child of current.items) {\n stack.push(child);\n }\n }\n }\n return conditionals;\n }, [items]);\n React.useEffect(() => {\n return SyncUiEventDispatcher.onSyncUiEvent.addListener((args) => {\n const newActiveIds: string[] = [];\n for (const item of conditionalItems) {\n ConditionalBooleanValue.refreshValue(\n item.isActiveCondition,\n args.eventIds\n );\n\n const isActive = ConditionalBooleanValue.getValue(\n item.isActiveCondition\n );\n if (isActive) newActiveIds.push(item.id);\n }\n setActiveItemIds(newActiveIds);\n });\n }, [conditionalItems]);\n React.useEffect(() => {\n const newActiveIds: string[] = [];\n for (const item of conditionalItems) {\n const isActive = ConditionalBooleanValue.getValue(item.isActiveCondition);\n if (isActive) newActiveIds.push(item.id);\n }\n setActiveItemIds(newActiveIds);\n }, [conditionalItems]);\n return activeItemIds;\n}\n\n/** @internal */\nexport function updateActiveItems(\n items: ToolbarItem[],\n activeItemIds: string[]\n) {\n return produce(items, (draft) => {\n // Iterative DFS with ancestor backtracking.\n const stack = draft.map((item) => [item, [] as typeof draft] as const);\n\n while (stack.length > 0) {\n const [current, ancestors] = stack.pop()!;\n\n const isActive = activeItemIds.includes(current.id);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n current.isActive = isActive;\n\n if (isToolbarGroupItem(current)) {\n for (const child of current.items) {\n stack.push([child, [...ancestors, current]]);\n }\n }\n\n if (!isActive) continue;\n\n // Mark ancestors of active item as active.\n for (const ancestor of ancestors) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ancestor.isActive = true;\n }\n }\n });\n}\n"]}
@@ -20,7 +20,9 @@ export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {
20
20
  panelAlignment?: ToolbarPanelAlignment;
21
21
  /** Use Drag Interaction to open popups with nest action buttons */
22
22
  useDragInteraction?: boolean;
23
- /** Determines whether to use mouse proximity to alter the opacity of the toolbar */
23
+ /** Determines whether to use mouse proximity to alter the opacity of the toolbar.
24
+ * @deprecated in 5.35.0. Use the default configuration.
25
+ */
24
26
  toolbarOpacitySetting?: ToolbarOpacitySetting;
25
27
  /** Optional function to call on any item execution */
26
28
  onItemExecuted?: OnItemExecutedFunc;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarWithOverflow.d.ts","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD;;GAEG;AAEH,MAAM,WAAW,wBAAyB,SAAQ,WAAW,EAAE,eAAe;IAC5E,2OAA2O;IAC3O,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,4GAA4G;IAC5G,iBAA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AC7B;;OAEG;IAEH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,sDAAsD;IACtD,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,qBAGlE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarWithOverflow.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAyBvC;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,oBAAC,OAAO,IAAC,cAAc,EAAE,EAAE,iBAAiB,EAAE,KAAM,YAAY,GAAI,CAAC;AAC9E,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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\n\n/** Component that displays toolbar items.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded, also defines the orientation of the toolbar (Top/Bottom will create an horizontal toolbar, Left/Right will create a vertical toolbar). Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items, displaying only the elements that can fit in the available space,\n * and put the other items into a single panel.\n * @beta\n */\nexport function ToolbarWithOverflow(props: ToolbarWithOverflowProps) {\n const { overflowExpandsTo, ...toolbarProps } = props;\n return <Toolbar enableOverflow={{ overflowExpandsTo }} {...toolbarProps} />;\n}\n"]}
1
+ {"version":3,"file":"ToolbarWithOverflow.js","sourceRoot":"","sources":["../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA4BvC;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,oBAAC,OAAO,IAAC,cAAc,EAAE,EAAE,iBAAiB,EAAE,KAAM,YAAY,GAAI,CAAC;AAC9E,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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\n\n/** Component that displays toolbar items.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded, also defines the orientation of the toolbar (Top/Bottom will create an horizontal toolbar, Left/Right will create a vertical toolbar). Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar.\n * @deprecated in 5.35.0. Use the default configuration.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items, displaying only the elements that can fit in the available space,\n * and put the other items into a single panel.\n * @beta\n */\nexport function ToolbarWithOverflow(props: ToolbarWithOverflowProps) {\n const { overflowExpandsTo, ...toolbarProps } = props;\n return <Toolbar enableOverflow={{ overflowExpandsTo }} {...toolbarProps} />;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/Surface.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,mBAAmB,GAAG,WAAW,CACpC,KAAK,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CACzC,CAAC;AAEF,UAAU,YAAa,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC;IACrE,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CACjD;AAED,gBAAgB;AAChB,eAAO,MAAM,OAAO,kGAiCnB,CAAC"}
1
+ {"version":3,"file":"Surface.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/Surface.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAW9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,mBAAmB,GAAG,WAAW,CACpC,KAAK,CAAC,WAAW,CAAC,OAAO,cAAc,CAAC,CACzC,CAAC;AAEF,UAAU,YAAa,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC;IACrE,WAAW,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;CACjD;AAED,gBAAgB;AAChB,eAAO,MAAM,OAAO,kGAkCnB,CAAC"}
@@ -21,6 +21,7 @@ export const Surface = React.forwardRef(function Surface({ className, style, ori
21
21
  const calculateOpacity = useConditionalValue(() => {
22
22
  if (ProcessDetector.isMobileBrowser)
23
23
  return false;
24
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
24
25
  if (UiFramework.visibility.snapWidgetOpacity)
25
26
  return true;
26
27
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"Surface.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/Surface.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,OAAO,EACP,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAW5D,gBAAgB;AAChB,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CACrC,SAAS,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY;IACvE,MAAM,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,uBAAuB,EAAkB,CAAC;IAC1E,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAExC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,EAAE;QAChD,IAAI,eAAe,CAAC,eAAe;YAAE,OAAO,KAAK,CAAC;QAClD,IAAI,WAAW,CAAC,UAAU,CAAC,iBAAiB;YAAE,OAAO,IAAI,CAAC;QAC1D,OAAO,KAAK,CAAC;IACf,CAAC,EAAE,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACjC,IAAI,CAAC,gBAAgB;YAAE,OAAO,SAAS,CAAC;QACxC,OAAO,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACvC,MAAM,eAAe,GACnB,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEzE,OAAO,CACL,oBAAC,WAAW,OACN,IAAI,EACR,KAAK,EAAE;YACL,eAAe;YACf,GAAG,KAAK;SACT,EACD,SAAS,EAAE,UAAU,CACnB,4BAA4B,EAC5B,QAAQ,WAAW,EAAE,EACrB,SAAS,CACV,EACD,GAAG,EAAE,IAAI,GACT,CACH,CAAC;AACJ,CAAC,CACF,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 Toolbar\n */\n\nimport \"./Surface.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Surface as IUI_Surface } from \"@itwin/itwinui-react\";\nimport {\n calculateToolbarOpacity,\n getToolbarBackgroundColor,\n useRefs,\n useWidgetOpacityContext,\n} from \"@itwin/core-react/internal\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { ProcessDetector } from \"@itwin/core-bentley\";\nimport { useConditionalValue } from \"../../hooks/useConditionalValue.js\";\nimport { SyncUiEventId } from \"../../syncui/UiSyncEvent.js\";\nimport type { ToolbarContext } from \"./Toolbar.js\";\n\ntype ToolbarContextProps = NonNullable<\n React.ContextType<typeof ToolbarContext>\n>;\n\ninterface SurfaceProps extends React.ComponentProps<typeof IUI_Surface> {\n orientation: ToolbarContextProps[\"orientation\"];\n}\n\n/** @internal */\nexport const Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n function Surface({ className, style, orientation, ...rest }, forwardedRed) {\n const { ref, proximityScale } = useWidgetOpacityContext<HTMLDivElement>();\n const refs = useRefs(ref, forwardedRed);\n\n const calculateOpacity = useConditionalValue(() => {\n if (ProcessDetector.isMobileBrowser) return false;\n if (UiFramework.visibility.snapWidgetOpacity) return true;\n return false;\n }, [SyncUiEventId.ShowHideManagerSettingChange]);\n const opacity = React.useMemo(() => {\n if (!calculateOpacity) return undefined;\n return calculateToolbarOpacity(proximityScale);\n }, [proximityScale, calculateOpacity]);\n const backgroundColor =\n opacity === undefined ? undefined : getToolbarBackgroundColor(opacity);\n\n return (\n <IUI_Surface\n {...rest}\n style={{\n backgroundColor,\n ...style,\n }}\n className={classnames(\n \"uifw-toolbar-group-surface\",\n `uifw-${orientation}`,\n className\n )}\n ref={refs}\n />\n );\n }\n);\n"]}
1
+ {"version":3,"file":"Surface.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/Surface.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,OAAO,EACP,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,M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------------------------------------------------------------------------------------------\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 Toolbar\n */\n\nimport \"./Surface.scss\";\nimport * as React from \"react\";\nimport classnames from \"classnames\";\nimport { Surface as IUI_Surface } from \"@itwin/itwinui-react\";\nimport {\n calculateToolbarOpacity,\n getToolbarBackgroundColor,\n useRefs,\n useWidgetOpacityContext,\n} from \"@itwin/core-react/internal\";\nimport { UiFramework } from \"../../UiFramework.js\";\nimport { ProcessDetector } from \"@itwin/core-bentley\";\nimport { useConditionalValue } from \"../../hooks/useConditionalValue.js\";\nimport { SyncUiEventId } from \"../../syncui/UiSyncEvent.js\";\nimport type { ToolbarContext } from \"./Toolbar.js\";\n\ntype ToolbarContextProps = NonNullable<\n React.ContextType<typeof ToolbarContext>\n>;\n\ninterface SurfaceProps extends React.ComponentProps<typeof IUI_Surface> {\n orientation: ToolbarContextProps[\"orientation\"];\n}\n\n/** @internal */\nexport const Surface = React.forwardRef<HTMLDivElement, SurfaceProps>(\n function Surface({ className, style, orientation, ...rest }, forwardedRed) {\n const { ref, proximityScale } = useWidgetOpacityContext<HTMLDivElement>();\n const refs = useRefs(ref, forwardedRed);\n\n const calculateOpacity = useConditionalValue(() => {\n if (ProcessDetector.isMobileBrowser) return false;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (UiFramework.visibility.snapWidgetOpacity) return true;\n return false;\n }, [SyncUiEventId.ShowHideManagerSettingChange]);\n const opacity = React.useMemo(() => {\n if (!calculateOpacity) return undefined;\n return calculateToolbarOpacity(proximityScale);\n }, [proximityScale, calculateOpacity]);\n const backgroundColor =\n opacity === undefined ? undefined : getToolbarBackgroundColor(opacity);\n\n return (\n <IUI_Surface\n {...rest}\n style={{\n backgroundColor,\n ...style,\n }}\n className={classnames(\n \"uifw-toolbar-group-surface\",\n `uifw-${orientation}`,\n className\n )}\n ref={refs}\n />\n );\n }\n);\n"]}
@@ -15,12 +15,7 @@
15
15
  // TODO: fixes an issues on Safari where borders and backgrounds are overlapped by the viewport.
16
16
  position: relative;
17
17
 
18
- @supports (backdrop-filter: blur(5px)) {
19
- background-color: hsl(
20
- var(--iui-color-background-hsl) / var(--iui-opacity-2)
21
- );
22
- backdrop-filter: blur(5px);
23
- }
18
+ background-color: var(--iui-color-background);
24
19
 
25
20
  &.uifw-vertical {
26
21
  flex-direction: column;
@@ -1 +1 @@
1
- {"version":3,"file":"CoreToolDefinitions.d.ts","sourceRoot":"","sources":["../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAkCH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAiBvD;;;GAGG;AACH,qBAAa,SAAS;IACpB,WAAkB,yBAAyB,gBAW1C;IAED,WAAkB,cAAc,gBAa/B;IAED,WAAkB,iBAAiB,gBAYlC;IAED,WAAkB,eAAe,gBAYhC;IAED,WAAkB,cAAc,gBAY/B;IAED,WAAkB,iBAAiB,gBAoBlC;IAED,WAAkB,eAAe,gBAoBhC;IAED,WAAkB,oBAAoB,gBAQrC;IAED,WAAkB,mBAAmB,gBAQpC;IAED,WAAkB,uBAAuB,gBA2CxC;IAED,WAAkB,cAAc,gBAY/B;IAID,WAAkB,eAAe,gBAqBhC;IAED,WAAkB,eAAe,gBAqBhC;IAED,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAS/B,WAAkB,4BAA4B,gBAc7C;IAGD,WAAkB,8BAA8B,gBAc/C;IAGD,WAAkB,4BAA4B,gBAc7C;IAGD,WAAkB,4BAA4B,gBAc7C;IAED,WAAkB,gBAAgB,iBA0BjC;IAED,WAAkB,yBAAyB,iBAuC1C;IAGD,WAAkB,0BAA0B,gBAU3C;IAGD,WAAkB,0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