code: function createViewportDeterminer(props) {
    const { viewportRect, panelRect, actionRect } = props;
  
    return function isInViewport({ containerPosition }) {
      const containerTop = actionRect.top + containerPosition.top;
      const containerLeft = actionRect.left + containerPosition.left;
      const containerRight = containerLeft + panelRect.width;
      const containerBottom = containerTop + panelRect.height;
      const result =
        containerLeft >= viewportRect.left &&
        containerTop >= viewportRect.top &&
        containerRight <= viewportRect.right &&
        containerBottom <= viewportRect.bottom;
  
      return result;
    };
  }
docs: Determines whether the given position is entirely within the viewport
  @param {Payload} payload
  @returns {function(Coordinates): boolean}