/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import {FocusManagerExtension, type FocusManagerOptions} from '@lexical/a11y'; import {getExtensionDependencyFromEditor} from '@lexical/extension'; import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext'; import {type RefCallback, useCallback, useRef} from 'react'; export type {FocusManagerOptions} from '@lexical/a11y'; /** * Returns a `RefCallback` that registers the attached DOM element as a * focus-managed toolbar with {@link FocusManagerExtension}, and releases * it when the element detaches. Attach it to a toolbar element via `ref=`: * * ```tsx * const toolbarRef = useLexicalFocusManagerRef(); * return