"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.codeLangSelectTooltipViewCreator = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const BaseTooltip_1 = require("../../../../../plugins/BaseTooltip/index.js");
const CodeBlockSpecs_1 = require("../../CodeBlockSpecs/index.js");
const codeBlockLangsPlugin_1 = require("../plugins/codeBlockLangsPlugin.js");
const CodeBlockToolbar_1 = require("./CodeBlockToolbar.js");
require("./TooltipView.css");
const codeLangSelectTooltipViewCreator = (view, { showCodeWrapping, showLineNumbers }) => {
    return new BaseTooltip_1.BaseTooltipPluginView(view, {
        idPrefix: 'code-block-tooltip',
        nodeType: (0, CodeBlockSpecs_1.codeBlockType)(view.state.schema),
        popupPlacement: ['bottom', 'top'],
        content: (view, { node, pos }, _onChange, _forceEdit, _onOutsideClick, rerender) => {
            const { langItems, aliasMapping } = (0, codeBlockLangsPlugin_1.getCodeBlockLangsState)(view.state);
            return ((0, jsx_runtime_1.jsx)(CodeBlockToolbar_1.CodeBlockToolbar, { pos: pos, node: node, editorView: view, mapping: aliasMapping, langItems: langItems, rerenderTooltip: rerender, showLineNumbers: showLineNumbers, showCodeWrapping: showCodeWrapping }));
        },
    });
};
exports.codeLangSelectTooltipViewCreator = codeLangSelectTooltipViewCreator;
//# sourceMappingURL=index.js.map
