@rpg-engine/shared 0.8.98 → 0.9.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/helpers/deviceHelpers.d.ts +1 -3
- package/dist/helpers/deviceHelpers.d.ts.map +1 -1
- package/dist/helpers/deviceHelpers.js +9 -19
- package/dist/helpers/deviceHelpers.js.map +1 -1
- package/dist/types/useWith.types.d.ts +5 -1
- package/dist/types/useWith.types.d.ts.map +1 -1
- package/dist/types/useWith.types.js +1 -0
- package/dist/types/useWith.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export declare const isMobile: () => boolean;
|
|
2
|
-
export declare const isTablet: () => boolean;
|
|
3
1
|
export declare const isMobileOrTablet: () => boolean;
|
|
4
|
-
export declare const
|
|
2
|
+
export declare const isMobile: () => boolean;
|
|
5
3
|
//# sourceMappingURL=deviceHelpers.d.ts.map
|
|
@@ -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":"AAUA,eAAO,MAAM,gBAAgB,QAAO,OAEnC,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,OAE3B,CAAC"}
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return
|
|
3
|
+
exports.isMobile = exports.isMobileOrTablet = void 0;
|
|
4
|
+
const mobile_device_detect_1 = require("mobile-device-detect");
|
|
5
|
+
const isSmallerThanBreakpoint = (breakpoint) => {
|
|
6
|
+
const mql = window.matchMedia(`(max-width: ${breakpoint}) and (orientation: portrait), (max-height: ${breakpoint}) and (orientation: landscape)`);
|
|
7
|
+
return mql.matches;
|
|
8
8
|
};
|
|
9
|
-
const isMobile = () => {
|
|
10
|
-
const mobileRegex = /iPhone|Android.+Mobile/i;
|
|
11
|
-
return checkUserAgent(mobileRegex) && isTouchScreen();
|
|
12
|
-
};
|
|
13
|
-
exports.isMobile = isMobile;
|
|
14
|
-
const isTablet = () => {
|
|
15
|
-
const tabletRegex = /iPad|Android/i;
|
|
16
|
-
return checkUserAgent(tabletRegex) && isTouchScreen();
|
|
17
|
-
};
|
|
18
|
-
exports.isTablet = isTablet;
|
|
19
9
|
const isMobileOrTablet = () => {
|
|
20
|
-
return
|
|
10
|
+
return mobile_device_detect_1.isMobile !== null && mobile_device_detect_1.isMobile !== void 0 ? mobile_device_detect_1.isMobile : (isSmallerThanBreakpoint("767px") && !isSmallerThanBreakpoint("479px"));
|
|
21
11
|
};
|
|
22
12
|
exports.isMobileOrTablet = isMobileOrTablet;
|
|
23
|
-
const
|
|
24
|
-
return
|
|
13
|
+
const isMobile = () => {
|
|
14
|
+
return mobile_device_detect_1.isMobileOnly !== null && mobile_device_detect_1.isMobileOnly !== void 0 ? mobile_device_detect_1.isMobileOnly : isSmallerThanBreakpoint("479px");
|
|
25
15
|
};
|
|
26
|
-
exports.
|
|
16
|
+
exports.isMobile = isMobile;
|
|
27
17
|
//# sourceMappingURL=deviceHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceHelpers.js","sourceRoot":"","sources":["../../src/helpers/deviceHelpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"deviceHelpers.js","sourceRoot":"","sources":["../../src/helpers/deviceHelpers.ts"],"names":[],"mappings":";;;AAAA,+DAA8G;AAE9G,MAAM,uBAAuB,GAAG,CAAC,UAAkB,EAAW,EAAE;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAC3B,eAAe,UAAU,+CAA+C,UAAU,gCAAgC,CACnH,CAAC;IAEF,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC,CAAC;AAEK,MAAM,gBAAgB,GAAG,GAAY,EAAE;IAC5C,OAAO,+BAAsB,aAAtB,+BAAsB,cAAtB,+BAAsB,GAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3G,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEK,MAAM,QAAQ,GAAG,GAAY,EAAE;IACpC,OAAO,mCAAkB,aAAlB,mCAAkB,cAAlB,mCAAkB,GAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,QAAQ,YAEnB"}
|
|
@@ -18,9 +18,13 @@ export interface IUseWithEntity {
|
|
|
18
18
|
entityId: string;
|
|
19
19
|
entityType: EntityType;
|
|
20
20
|
}
|
|
21
|
+
export interface IUseWithTileValidation {
|
|
22
|
+
status: boolean;
|
|
23
|
+
}
|
|
21
24
|
export declare enum UseWithSocketEvents {
|
|
22
25
|
UseWithItem = "UseWithItem",
|
|
23
26
|
UseWithTile = "UseWithTile",
|
|
24
|
-
UseWithEntity = "UseWithEntity"
|
|
27
|
+
UseWithEntity = "UseWithEntity",
|
|
28
|
+
UseWithTileValidation = "UseWithTileValidation"
|
|
25
29
|
}
|
|
26
30
|
//# sourceMappingURL=useWith.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWith.types.d.ts","sourceRoot":"","sources":["../../src/types/useWith.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB;AAID,oBAAY,mBAAmB;IAC7B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"useWith.types.d.ts","sourceRoot":"","sources":["../../src/types/useWith.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,OAAO,CAAC;CACjB;AAID,oBAAY,mBAAmB;IAC7B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,qBAAqB,0BAA0B;CAChD"}
|
|
@@ -6,5 +6,6 @@ var UseWithSocketEvents;
|
|
|
6
6
|
UseWithSocketEvents["UseWithItem"] = "UseWithItem";
|
|
7
7
|
UseWithSocketEvents["UseWithTile"] = "UseWithTile";
|
|
8
8
|
UseWithSocketEvents["UseWithEntity"] = "UseWithEntity";
|
|
9
|
+
UseWithSocketEvents["UseWithTileValidation"] = "UseWithTileValidation";
|
|
9
10
|
})(UseWithSocketEvents = exports.UseWithSocketEvents || (exports.UseWithSocketEvents = {}));
|
|
10
11
|
//# sourceMappingURL=useWith.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWith.types.js","sourceRoot":"","sources":["../../src/types/useWith.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"useWith.types.js","sourceRoot":"","sources":["../../src/types/useWith.types.ts"],"names":[],"mappings":";;;AAgCA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,kDAA2B,CAAA;IAC3B,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,sEAA+C,CAAA;AACjD,CAAC,EALW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAK9B"}
|