/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module ConfigurableUi
 */
import "./configurableui.scss";
import * as React from "react";
import { Point } from "@itwin/core-react";
import { CursorInformation } from "../cursor/CursorInformation";
import { CursorPopupMenu } from "../cursor/cursormenu/CursorMenu";
import { CursorPopupRenderer } from "../cursor/cursorpopup/CursorPopupManager";
import { ModalDialogRenderer } from "../dialog/ModalDialogManager";
import { ModelessDialogRenderer } from "../dialog/ModelessDialogManager";
import { ElementTooltip } from "../feedback/ElementTooltip";
import { FrontstageComposer } from "../frontstage/FrontstageComposer";
import { useFrameworkVersion } from "../hooks/useFrameworkVersion";
import { KeyboardShortcutMenu } from "../keyboardshortcut/KeyboardShortcutMenu";
import { InputFieldMessage } from "../messages/InputField";
import { PointerMessage } from "../messages/Pointer";
import { PopupRenderer } from "../popup/PopupManager";
import { WidgetPanelsFrontstage } from "../widget-panels/Frontstage";
import { ContentDialogRenderer } from "../dialog/ContentDialogManager";
import { UiFramework } from "../UiFramework";
import { InternalConfigurableUiManager } from "./InternalConfigurableUiManager";
/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi
 * @public
 */
export function ConfigurableUiContent(props) {
    const version = useFrameworkVersion(); // eslint-disable-line deprecation/deprecation
    React.useEffect(() => {
        UiFramework.keyboardShortcuts.setFocusToHome();
    }, []);
    React.useEffect(() => {
        InternalConfigurableUiManager.activityTracker.initialize({ idleTimeout: props.idleTimeout, intervalTimeout: props.intervalTimeout });
        return () => {
            InternalConfigurableUiManager.activityTracker.terminate();
        };
    }, [props.idleTimeout, props.intervalTimeout]);
    const handleMouseMove = React.useCallback((e) => {
        const point = new Point(e.pageX, e.pageY);
        CursorInformation.handleMouseMove(point);
    }, []);
    return (React.createElement("main", { role: "main", id: "uifw-configurableui-wrapper", className: props.className, style: props.style, onMouseMove: handleMouseMove },
        props.appBackstage,
        version === "1" ? /* istanbul ignore next */ React.createElement(FrontstageComposer, { style: { position: "relative", height: "100%" } }) : /* istanbul ignore next */ React.createElement(WidgetPanelsFrontstage, null),
        React.createElement(ContentDialogRenderer, null),
        React.createElement(ModelessDialogRenderer, null),
        React.createElement(ModalDialogRenderer, null),
        React.createElement(ElementTooltip, null),
        React.createElement(PointerMessage, null),
        React.createElement(KeyboardShortcutMenu, null),
        React.createElement(InputFieldMessage, null),
        React.createElement(CursorPopupMenu, null),
        React.createElement(CursorPopupRenderer, null),
        React.createElement(PopupRenderer, null)));
}
//# sourceMappingURL=ConfigurableUiContent.js.map