import { useContext, useEffect } from "react";
import { RicosContext } from "./../../../ricos-context/index.js";
const useJsdomWidthFix = (ref, editor) => {
  const { jsdomMode } = useContext(RicosContext);
  useEffect(() => {
    if (jsdomMode && ref) {
      Object.defineProperty(ref, "clientWidth", {
        get: () => 1e3
      });
    }
  }, [jsdomMode, ref]);
  useEffect(() => {
    editor.on("create", () => {
      if (jsdomMode) {
        Object.defineProperty(editor.view.dom, "clientWidth", {
          get: () => 1e3
        });
      }
    });
  }, []);
};
export {
  useJsdomWidthFix
};
//# sourceMappingURL=use-jsdom-width-fix.js.map
