import PropTypes from "prop-types";
import React from "react";
import { createMediaUploadFn } from "./../../../_shared/create-media-upload-fn.js";
import { useWixInstanceService } from "./../../../_shared/request-service-provider/wix-instance-context.js";
import { useEditorProps } from "./../../../_shared/some-editor-props-context.js";
const RCEHelpersPropTypes = {
  rce: PropTypes.shape({
    isViewMode: PropTypes.bool.isRequired,
    setInPluginEditingMode: PropTypes.func,
    getSiteMembers: PropTypes.func,
    handleFileUpload: PropTypes.func
  }).isRequired,
  t: PropTypes.func.isRequired,
  layout: PropTypes.object.isRequired,
  design: PropTypes.object.isRequired
};
const RCEHelpersContext = React.createContext({});
const withRCEHelpers = (WrappedComponent) => (props) => {
  const wixInstance = useWixInstanceService();
  const editorProps = useEditorProps();
  const handleFileUpload = createMediaUploadFn({ wixInstance, editorProps });
  return /* @__PURE__ */ React.createElement(RCEHelpersContext.Consumer, null, ({ layout, design, t, ...rest }) => /* @__PURE__ */ React.createElement(
    WrappedComponent,
    {
      ...props,
      rce: { ...rest, handleFileUpload },
      t,
      layout,
      design
    }
  ));
};
export {
  RCEHelpersContext,
  RCEHelpersPropTypes,
  withRCEHelpers
};
//# sourceMappingURL=index.js.map
