sprotty
Version:
A next-gen framework for graphical views
53 lines • 3.3 kB
JavaScript
;
/********************************************************************************
* Copyright (c) 2017-2018 TypeFox and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
Object.defineProperty(exports, "__esModule", { value: true });
const inversify_1 = require("inversify");
const types_1 = require("../../base/types");
const hover_1 = require("./hover");
const popup_position_updater_1 = require("./popup-position-updater");
const command_registration_1 = require("../../base/commands/command-registration");
const action_handler_1 = require("../../base/actions/action-handler");
const center_fit_1 = require("../viewport/center-fit");
const viewport_1 = require("../viewport/viewport");
const move_1 = require("../move/move");
const hoverModule = new inversify_1.ContainerModule((bind, _unbind, isBound) => {
bind(popup_position_updater_1.PopupPositionUpdater).toSelf().inSingletonScope();
bind(types_1.TYPES.PopupVNodePostprocessor).toService(popup_position_updater_1.PopupPositionUpdater);
bind(hover_1.HoverMouseListener).toSelf().inSingletonScope();
bind(types_1.TYPES.MouseListener).toService(hover_1.HoverMouseListener);
bind(hover_1.PopupHoverMouseListener).toSelf().inSingletonScope();
bind(types_1.TYPES.PopupMouseListener).toService(hover_1.PopupHoverMouseListener);
bind(hover_1.HoverKeyListener).toSelf().inSingletonScope();
bind(types_1.TYPES.KeyListener).toService(hover_1.HoverKeyListener);
bind(types_1.TYPES.HoverState).toConstantValue({
mouseOverTimer: undefined,
mouseOutTimer: undefined,
popupOpen: false,
previousPopupElement: undefined
});
bind(hover_1.ClosePopupActionHandler).toSelf().inSingletonScope();
const context = { bind, isBound };
(0, command_registration_1.configureCommand)(context, hover_1.HoverFeedbackCommand);
(0, command_registration_1.configureCommand)(context, hover_1.SetPopupModelCommand);
(0, action_handler_1.configureActionHandler)(context, hover_1.SetPopupModelCommand.KIND, hover_1.ClosePopupActionHandler);
(0, action_handler_1.configureActionHandler)(context, center_fit_1.FitToScreenCommand.KIND, hover_1.ClosePopupActionHandler);
(0, action_handler_1.configureActionHandler)(context, center_fit_1.CenterCommand.KIND, hover_1.ClosePopupActionHandler);
(0, action_handler_1.configureActionHandler)(context, viewport_1.SetViewportCommand.KIND, hover_1.ClosePopupActionHandler);
(0, action_handler_1.configureActionHandler)(context, move_1.MoveCommand.KIND, hover_1.ClosePopupActionHandler);
});
exports.default = hoverModule;
//# sourceMappingURL=di.config.js.map