UNPKG

monaco-editor

Version:
41 lines 1.96 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { EditorCommand, registerEditorCommand, registerEditorContribution } from '../../../browser/editorExtensions.js'; import { registerEditorFeature } from '../../../common/editorFeatures.js'; import { DefaultDropProvidersFeature } from './defaultProviders.js'; import { DropIntoEditorController, changeDropTypeCommandId, dropWidgetVisibleCtx } from './dropIntoEditorController.js'; registerEditorContribution(DropIntoEditorController.ID, DropIntoEditorController, 2 /* EditorContributionInstantiation.BeforeFirstInteraction */); registerEditorFeature(DefaultDropProvidersFeature); registerEditorCommand(new class extends EditorCommand { constructor() { super({ id: changeDropTypeCommandId, precondition: dropWidgetVisibleCtx, kbOpts: { weight: 100 /* KeybindingWeight.EditorContrib */, primary: 2048 /* KeyMod.CtrlCmd */ | 89 /* KeyCode.Period */, } }); } runEditorCommand(_accessor, editor, _args) { DropIntoEditorController.get(editor)?.changeDropType(); } }); registerEditorCommand(new class extends EditorCommand { constructor() { super({ id: 'editor.hideDropWidget', precondition: dropWidgetVisibleCtx, kbOpts: { weight: 100 /* KeybindingWeight.EditorContrib */, primary: 9 /* KeyCode.Escape */, } }); } runEditorCommand(_accessor, editor, _args) { DropIntoEditorController.get(editor)?.clearWidgets(); } }); //# sourceMappingURL=dropIntoEditorContribution.js.map