@rpg-engine/shared 0.8.97 → 0.8.98
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/deviceHelpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deviceHelpers.d.ts","sourceRoot":"","sources":["../../src/helpers/deviceHelpers.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,QAAQ,QAAO,OAG3B,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,OAG3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,OAEnC,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,OAE5B,CAAC"}
|
|
@@ -6,21 +6,14 @@ const checkUserAgent = (regex) => {
|
|
|
6
6
|
const userAgent = navigator.userAgent || navigator.vendor;
|
|
7
7
|
return regex.test(userAgent);
|
|
8
8
|
};
|
|
9
|
-
const hasMotionAndOrientation = () => {
|
|
10
|
-
return "DeviceMotionEvent" in window && "DeviceOrientationEvent" in window;
|
|
11
|
-
};
|
|
12
|
-
const estimatePerformance = () => {
|
|
13
|
-
const isHighPerformance = window.matchMedia("(min-resolution: 2dppx)").matches;
|
|
14
|
-
return isHighPerformance;
|
|
15
|
-
};
|
|
16
9
|
const isMobile = () => {
|
|
17
10
|
const mobileRegex = /iPhone|Android.+Mobile/i;
|
|
18
|
-
return checkUserAgent(mobileRegex) && isTouchScreen()
|
|
11
|
+
return checkUserAgent(mobileRegex) && isTouchScreen();
|
|
19
12
|
};
|
|
20
13
|
exports.isMobile = isMobile;
|
|
21
14
|
const isTablet = () => {
|
|
22
15
|
const tabletRegex = /iPad|Android/i;
|
|
23
|
-
return checkUserAgent(tabletRegex) && isTouchScreen()
|
|
16
|
+
return checkUserAgent(tabletRegex) && isTouchScreen();
|
|
24
17
|
};
|
|
25
18
|
exports.isTablet = isTablet;
|
|
26
19
|
const isMobileOrTablet = () => {
|
|
@@ -28,7 +21,7 @@ const isMobileOrTablet = () => {
|
|
|
28
21
|
};
|
|
29
22
|
exports.isMobileOrTablet = isMobileOrTablet;
|
|
30
23
|
const isDesktop = () => {
|
|
31
|
-
return !(0, exports.isMobileOrTablet)()
|
|
24
|
+
return !(0, exports.isMobileOrTablet)();
|
|
32
25
|
};
|
|
33
26
|
exports.isDesktop = isDesktop;
|
|
34
27
|
//# sourceMappingURL=deviceHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceHelpers.js","sourceRoot":"","sources":["../../src/helpers/deviceHelpers.ts"],"names":[],"mappings":";;;AACA,MAAM,aAAa,GAAG,GAAY,EAAE,CAAC,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;AAG9F,MAAM,cAAc,GAAG,CAAC,KAAa,EAAW,EAAE;IAChD,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"deviceHelpers.js","sourceRoot":"","sources":["../../src/helpers/deviceHelpers.ts"],"names":[],"mappings":";;;AACA,MAAM,aAAa,GAAG,GAAY,EAAE,CAAC,cAAc,IAAI,MAAM,IAAI,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;AAG9F,MAAM,cAAc,GAAG,CAAC,KAAa,EAAW,EAAE;IAChD,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEK,MAAM,QAAQ,GAAG,GAAY,EAAE;IACpC,MAAM,WAAW,GAAG,yBAAyB,CAAC;IAC9C,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,a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