"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxDevRuntime = require("react/jsx-dev-runtime");
const ui = require("@contember/ui");
const react = require("react");
const slateReact = require("slate-react");
const reactI18n = require("@contember/react-i18n");
const index = require("../ContemberEditor/index.cjs");
const editorDictionary = require("./editorDictionary.cjs");
const BlockElement = react.memo(function BlockElement2({
  element,
  children,
  attributes,
  domElement = "div",
  withBoundaries = false
}) {
  const editor = slateReact.useSlateStatic();
  const dataAttributes = index.ContemberEditor.getElementDataAttributes(element);
  const El = domElement;
  const formatter = reactI18n.useMessageFormatter(editorDictionary.editorDictionary);
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(El, { ...dataAttributes, ...attributes, children: [
    withBoundaries && /* @__PURE__ */ jsxDevRuntime.jsxDEV(
      ui.EditorBlockBoundary,
      {
        blockEdge: "before",
        newParagraphText: formatter("editorBlock.editorBlockBoundary.newParagraph"),
        onClick: () => {
          const elementPath = slateReact.ReactEditor.findPath(editor, element);
          editor.insertBetweenBlocks([element, elementPath], "before");
        }
      },
      void 0,
      false,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/baseEditor/BlockElement.tsx",
        lineNumber: 28,
        columnNumber: 5
      },
      this
    ),
    children,
    withBoundaries && /* @__PURE__ */ jsxDevRuntime.jsxDEV(
      ui.EditorBlockBoundary,
      {
        blockEdge: "after",
        newParagraphText: formatter("editorBlock.editorBlockBoundary.newParagraph"),
        onClick: () => {
          const elementPath = slateReact.ReactEditor.findPath(editor, element);
          editor.insertBetweenBlocks([element, elementPath], "after");
        }
      },
      void 0,
      false,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/baseEditor/BlockElement.tsx",
        lineNumber: 39,
        columnNumber: 5
      },
      this
    )
  ] }, void 0, true, {
    fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/baseEditor/BlockElement.tsx",
    lineNumber: 26,
    columnNumber: 3
  }, this);
});
exports.BlockElement = BlockElement;
//# sourceMappingURL=BlockElement.cjs.map
