// packages/block-editor/src/components/block-controls/fill.js
import {
  __experimentalStyleProvider as StyleProvider,
  ToolbarGroup
} from "@wordpress/components";
import useBlockControlsFill from "./hook";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
function BlockControlsFill({
  group = "default",
  controls,
  children,
  __experimentalShareWithChildBlocks = false
}) {
  const Fill = useBlockControlsFill(
    group,
    __experimentalShareWithChildBlocks
  );
  if (!Fill) {
    return null;
  }
  const innerMarkup = /* @__PURE__ */ jsxs(Fragment, { children: [
    group === "default" && /* @__PURE__ */ jsx(ToolbarGroup, { controls }),
    children
  ] });
  return /* @__PURE__ */ jsx(StyleProvider, { document, children: /* @__PURE__ */ jsx(Fill, { children: (fillProps) => {
    const { forwardedContext = [] } = fillProps;
    return forwardedContext.reduce(
      (inner, [Provider, props]) => /* @__PURE__ */ jsx(Provider, { ...props, children: inner }),
      innerMarkup
    );
  } }) });
}
export {
  BlockControlsFill as default
};
//# sourceMappingURL=fill.js.map
