import { AccessorProvider } from "@contember/binding";
import { useReferencedEntity } from "./useReferencedEntity.js";
import { useSlateStatic, ReactEditor } from "slate-react";
import { jsxDEV } from "react/jsx-dev-runtime";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/bindingFacade/richText/blockEditor/references/ReferenceElementWrapper.tsx";
const ReferenceElementWrapper = ({
  children,
  element
}) => {
  const editor = useSlateStatic();
  const path = ReactEditor.findPath(editor, element);
  const ref = useReferencedEntity(path, element.referenceId);
  return /* @__PURE__ */ jsxDEV(AccessorProvider, {
    accessor: ref,
    children
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 16,
    columnNumber: 9
  }, void 0);
};
export {
  ReferenceElementWrapper
};
//# sourceMappingURL=ReferenceElementWrapper.js.map
