@newtonschool/react_proctoring_library 0.0.126 → 0.0.127

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,21 +4,24 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = useFullscreenData;
7
+ require("core-js/modules/es.regexp.exec.js");
8
+ require("core-js/modules/es.regexp.test.js");
7
9
  require("core-js/modules/web.dom-collections.iterator.js");
8
10
  var _react = require("react");
9
11
  var _utils = require("../../utils");
10
12
  var _fullScreen = _interopRequireDefault(require("../../utils/fullScreen"));
11
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
14
  const browserFullscreenElementProp = (0, _utils.getBrowserFullscreenElementProp)();
15
+ const isIOS = typeof window !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent || '') && !window.MSStream;
13
16
  function useFullscreenData() {
14
17
  const fullScreenElement = (0, _react.useRef)(document.documentElement);
15
- const [isFullscreen, setIsFullscreen] = (0, _react.useState)(typeof window !== 'undefined' && (document[browserFullscreenElementProp] != null || !!window.NS_TESTING_ENVIRONMENT));
18
+ const [isFullscreen, setIsFullscreen] = (0, _react.useState)(typeof window !== 'undefined' && (isIOS || document[browserFullscreenElementProp] != null || !!window.NS_TESTING_ENVIRONMENT));
16
19
  const setFullscreen = (0, _react.useCallback)(() => {
17
20
  var _fullScreenElement$cu, _fullScreenElement$cu2, _fullScreenElement$cu3, _fullScreenElement$cu4, _fullScreenElement$cu5, _fullScreenElement$cu6;
18
21
  if (!fullScreenElement || !fullScreenElement.current) {
19
22
  return;
20
23
  }
21
- if (typeof window !== 'undefined' && window.NS_TESTING_ENVIRONMENT) {
24
+ if (typeof window !== 'undefined' && (window.NS_TESTING_ENVIRONMENT || isIOS)) {
22
25
  setIsFullscreen(true);
23
26
  return;
24
27
  }
@@ -31,6 +34,9 @@ function useFullscreenData() {
31
34
  });
32
35
  }, []);
33
36
  (0, _react.useEffect)(() => {
37
+ if (isIOS) {
38
+ return;
39
+ }
34
40
  const cleanup = _fullScreen.default.addFullScreenListener(() => {
35
41
  setIsFullscreen(document[browserFullscreenElementProp] !== null);
36
42
  });
@@ -18,7 +18,6 @@ const hasAllPermissions = (requiredPermissions, permissions) => {
18
18
  hasPermission = hasPermission && false;
19
19
  }
20
20
  });
21
- console.log('::[hasAllPermissions]', status, 'allGranted:', hasPermission);
22
21
  return hasPermission;
23
22
  };
24
23
  exports.hasAllPermissions = hasAllPermissions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtonschool/react_proctoring_library",
3
- "version": "0.0.126",
3
+ "version": "0.0.127",
4
4
  "description": "Used to proctor online tests",
5
5
  "author": "ayushkagrawal,shreyachandra,weastel",
6
6
  "main": "dist/index.js",