@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.
@@ -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 isDesktop: () => boolean;
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":"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"}
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.isDesktop = exports.isMobileOrTablet = exports.isTablet = exports.isMobile = void 0;
4
- const isTouchScreen = () => "ontouchstart" in window || navigator.maxTouchPoints > 0;
5
- const checkUserAgent = (regex) => {
6
- const userAgent = navigator.userAgent || navigator.vendor;
7
- return regex.test(userAgent);
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 (0, exports.isMobile)() || (0, exports.isTablet)();
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 isDesktop = () => {
24
- return !(0, exports.isMobileOrTablet)();
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.isDesktop = isDesktop;
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":";;;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,aAAa,EAAE,CAAC;AACxD,CAAC,CAAC;AAHW,QAAA,QAAQ,YAGnB;AAEK,MAAM,QAAQ,GAAG,GAAY,EAAE;IACpC,MAAM,WAAW,GAAG,eAAe,CAAC;IACpC,OAAO,cAAc,CAAC,WAAW,CAAC,IAAI,aAAa,EAAE,CAAC;AACxD,CAAC,CAAC;AAHW,QAAA,QAAQ,YAGnB;AAEK,MAAM,gBAAgB,GAAG,GAAY,EAAE;IAC5C,OAAO,IAAA,gBAAQ,GAAE,IAAI,IAAA,gBAAQ,GAAE,CAAC;AAClC,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAEK,MAAM,SAAS,GAAG,GAAY,EAAE;IACrC,OAAO,CAAC,IAAA,wBAAgB,GAAE,CAAC;AAC7B,CAAC,CAAC;AAFW,QAAA,SAAS,aAEpB"}
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;CAChC"}
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":";;;AA4BA,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,kDAA2B,CAAA;IAC3B,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;AACjC,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/shared",
3
- "version": "0.8.98",
3
+ "version": "0.9.0",
4
4
  "description": "Types shared across our API and client",
5
5
  "author": "Definya Team",
6
6
  "homepage": "",