"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const reactBinding = require("@contember/react-binding");
const reactUtils = require("@contember/react-utils");
const react = require("react");
const getEditorTemplate = require("./getEditorTemplate.cjs");
const useBlockProps = require("../../../blocks/useBlockProps.cjs");
const useDiscriminatedData = require("../../../discrimination/useDiscriminatedData.cjs");
const useEditorReferenceBlocks = (children) => {
  reactUtils.useConstantValueInvariant(children, `BlockEditor: cannot change the set of Blocks between renders!`);
  const env = reactBinding.useEnvironment();
  const propList = useBlockProps.useBlockProps(children);
  const propsWithTemplates = react.useMemo(() => {
    return propList.map(
      (props) => ({
        ...props,
        template: getEditorTemplate.getEditorTemplate(props.children, env)
      })
    );
  }, [env, propList]);
  return useDiscriminatedData.useDiscriminatedData(propsWithTemplates);
};
exports.useEditorReferenceBlocks = useEditorReferenceBlocks;
//# sourceMappingURL=useEditorReferenceBlocks.cjs.map
