"use strict";
/*---------------------------------------------------------------------------------------------
 * 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
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigurableUiContent = void 0;
require("./configurableui.scss");
const React = require("react");
const core_react_1 = require("@itwin/core-react");
const CursorInformation_1 = require("../cursor/CursorInformation");
const CursorMenu_1 = require("../cursor/cursormenu/CursorMenu");
const CursorPopupManager_1 = require("../cursor/cursorpopup/CursorPopupManager");
const ModalDialogManager_1 = require("../dialog/ModalDialogManager");
const ModelessDialogManager_1 = require("../dialog/ModelessDialogManager");
const ElementTooltip_1 = require("../feedback/ElementTooltip");
const KeyboardShortcutMenu_1 = require("../keyboardshortcut/KeyboardShortcutMenu");
const InputField_1 = require("../messages/InputField");
const Pointer_1 = require("../messages/Pointer");
const PopupManager_1 = require("../popup/PopupManager");
const Frontstage_1 = require("../widget-panels/Frontstage");
const ContentDialogManager_1 = require("../dialog/ContentDialogManager");
const UiFramework_1 = require("../UiFramework");
const InternalConfigurableUiManager_1 = require("./InternalConfigurableUiManager");
/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi
 * @public
 */
function ConfigurableUiContent(props) {
    React.useEffect(() => {
        UiFramework_1.UiFramework.keyboardShortcuts.setFocusToHome();
    }, []);
    React.useEffect(() => {
        InternalConfigurableUiManager_1.InternalConfigurableUiManager.activityTracker.initialize({
            idleTimeout: props.idleTimeout,
            intervalTimeout: props.intervalTimeout,
        });
        return () => {
            InternalConfigurableUiManager_1.InternalConfigurableUiManager.activityTracker.terminate();
        };
    }, [props.idleTimeout, props.intervalTimeout]);
    const handleMouseMove = React.useCallback((e) => {
        const point = new core_react_1.Point(e.pageX, e.pageY);
        CursorInformation_1.CursorInformation.handleMouseMove(point);
    }, []);
    return (React.createElement("main", { role: "main", id: "uifw-configurableui-wrapper", className: props.className, style: props.style, onMouseMove: handleMouseMove },
        props.appBackstage,
        React.createElement(Frontstage_1.WidgetPanelsFrontstage, null),
        React.createElement(ContentDialogManager_1.ContentDialogRenderer, null),
        React.createElement(ModelessDialogManager_1.ModelessDialogRenderer, null),
        React.createElement(ModalDialogManager_1.ModalDialogRenderer, null),
        React.createElement(ElementTooltip_1.ElementTooltip, null),
        React.createElement(Pointer_1.PointerMessage, null),
        React.createElement(KeyboardShortcutMenu_1.KeyboardShortcutMenu, null),
        React.createElement(InputField_1.InputFieldMessage, null),
        React.createElement(CursorMenu_1.CursorPopupMenu, null),
        React.createElement(CursorPopupManager_1.CursorPopupRenderer, null),
        React.createElement(PopupManager_1.PopupRenderer, null)));
}
exports.ConfigurableUiContent = ConfigurableUiContent;
//# sourceMappingURL=ConfigurableUiContent.js.map