"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { HorizontalRuleExtension } from "@lexical/extension";
import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
import { declarePeerDependency, defineExtension } from "lexical";
import { useToolbarActiveEditor } from "../../plugins/toolbar-plugin/toolbar-active-editor.js";
import { DropDownItem } from "../../ui/dropdown.js";
import { BylineToolbarExtension } from "../byline-toolbar/byline-toolbar-extension.js";
function HorizontalRuleInsertItem() {
    const editor = useToolbarActiveEditor();
    return /*#__PURE__*/ jsxs(DropDownItem, {
        onClick: ()=>{
            editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, void 0);
        },
        className: "item",
        children: [
            /*#__PURE__*/ jsx("i", {
                className: "icon horizontal-rule"
            }),
            /*#__PURE__*/ jsx("span", {
                className: "text",
                children: "Horizontal Rule"
            })
        ]
    });
}
const horizontal_rule_extension_HorizontalRuleExtension = defineExtension({
    name: '@byline/richtext-lexical/HorizontalRule',
    dependencies: [
        HorizontalRuleExtension
    ],
    peerDependencies: [
        declarePeerDependency(BylineToolbarExtension.name, {
            items: [
                {
                    id: '@byline/richtext-lexical/HorizontalRule/insert',
                    placement: 'insert-menu',
                    order: 10,
                    node: /*#__PURE__*/ jsx(HorizontalRuleInsertItem, {})
                }
            ]
        })
    ]
});
export { horizontal_rule_extension_HorizontalRuleExtension as HorizontalRuleExtension };
