@pallasoft/ps-utilities 2.13.0 → 2.14.0
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.
- package/dist/client/constants/device-config.d.ts +6 -0
- package/dist/client/constants/device-config.js +9 -0
- package/dist/client/device-service.d.ts +5 -0
- package/dist/client/device-service.js +22 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/models/device-data.d.ts +4 -0
- package/dist/models/device-data.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceConfig = void 0;
|
|
4
|
+
exports.DeviceConfig = {
|
|
5
|
+
ios: /iPhone|iPad|iPod/i,
|
|
6
|
+
macintosh: /Macintosh/i,
|
|
7
|
+
mobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet|Silk|Kindle/i,
|
|
8
|
+
touchPointsForTablet: 1,
|
|
9
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceService = void 0;
|
|
4
|
+
var device_config_1 = require("./constants/device-config");
|
|
5
|
+
var DeviceService = /** @class */ (function () {
|
|
6
|
+
function DeviceService() {
|
|
7
|
+
}
|
|
8
|
+
DeviceService.fromUserAgent = function (userAgent, maxTouchPoints) {
|
|
9
|
+
var isIPadOS = device_config_1.DeviceConfig.macintosh.test(userAgent) && maxTouchPoints > device_config_1.DeviceConfig.touchPointsForTablet;
|
|
10
|
+
return {
|
|
11
|
+
isIOS: device_config_1.DeviceConfig.ios.test(userAgent) || isIPadOS,
|
|
12
|
+
isMobile: device_config_1.DeviceConfig.mobile.test(userAgent) || isIPadOS,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
DeviceService.current = function () {
|
|
16
|
+
if (typeof navigator === 'undefined')
|
|
17
|
+
return { isIOS: false, isMobile: false };
|
|
18
|
+
return DeviceService.fromUserAgent(navigator.userAgent, navigator.maxTouchPoints);
|
|
19
|
+
};
|
|
20
|
+
return DeviceService;
|
|
21
|
+
}());
|
|
22
|
+
exports.DeviceService = DeviceService;
|
package/dist/client/index.d.ts
CHANGED
package/dist/client/index.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./debounce-service"), exports);
|
|
18
|
+
__exportStar(require("./device-service"), exports);
|
|
18
19
|
__exportStar(require("./http-service"), exports);
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as CommonNamespace from './common';
|
|
|
3
3
|
export declare const Common: typeof CommonNamespace;
|
|
4
4
|
export declare const Client: typeof ClientNamespace;
|
|
5
5
|
export { AmountDirection } from './common/constants/amount-direction';
|
|
6
|
+
export type { DeviceData } from './models/device-data';
|
|
6
7
|
export type { EmailPreviewInput } from './models/email-preview-input';
|
|
7
8
|
export type { SignedTokenHeader } from './models/signed-token-header';
|
|
8
9
|
export type { SignedTokenKeyPair } from './models/signed-token-key-pair';
|