@heycar/heycars-map 0.7.1 → 0.7.2

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/index.cjs CHANGED
@@ -3197,10 +3197,11 @@ const useDeviceOrientation = (props) => {
3197
3197
  () => elementRef.value,
3198
3198
  (element, _, onCleanup) => {
3199
3199
  const handleDeviceOrientation = throttle((event) => {
3200
- var _a, _b, _c;
3201
- const alpha = (_a = event.alpha) != null ? _a : void 0;
3202
- const beta = (_b = event.beta) != null ? _b : void 0;
3203
- const gamma = (_c = event.gamma) != null ? _c : void 0;
3200
+ var _a, _b, _c, _d;
3201
+ const webkitCompassHeading = (_a = event.webkitCompassHeading) != null ? _a : void 0;
3202
+ const alpha = webkitCompassHeading !== void 0 ? 360 - webkitCompassHeading : (_b = event.alpha) != null ? _b : void 0;
3203
+ const beta = (_c = event.beta) != null ? _c : void 0;
3204
+ const gamma = (_d = event.gamma) != null ? _d : void 0;
3204
3205
  const cssRotationVariableValue = `${360 - (alpha != null ? alpha : 0)}deg`;
3205
3206
  const cssRotationVariableName = alpha === void 0 ? void 0 : cssVarName;
3206
3207
  Object.assign(orientation, { alpha, beta, gamma });
@@ -3236,7 +3237,12 @@ function compatibaleAddEventListenerDeviceOrientation(handler) {
3236
3237
  isIOSDeviceOrientationPermissionGranted = true;
3237
3238
  addEventListener("deviceorientation", handler);
3238
3239
  }
3239
- }).catch((err) => console.error(err.message));
3240
+ }).catch((err) => {
3241
+ if (err.name === "NotAllowedError") {
3242
+ addEventListener("touchend", handleTouchEnd);
3243
+ }
3244
+ console.error(err.name, err.message);
3245
+ });
3240
3246
  };
3241
3247
  addEventListener("touchend", handleTouchEnd);
3242
3248
  }
package/dist/index.js CHANGED
@@ -3195,10 +3195,11 @@ const useDeviceOrientation = (props) => {
3195
3195
  () => elementRef.value,
3196
3196
  (element, _, onCleanup) => {
3197
3197
  const handleDeviceOrientation = throttle((event) => {
3198
- var _a, _b, _c;
3199
- const alpha = (_a = event.alpha) != null ? _a : void 0;
3200
- const beta = (_b = event.beta) != null ? _b : void 0;
3201
- const gamma = (_c = event.gamma) != null ? _c : void 0;
3198
+ var _a, _b, _c, _d;
3199
+ const webkitCompassHeading = (_a = event.webkitCompassHeading) != null ? _a : void 0;
3200
+ const alpha = webkitCompassHeading !== void 0 ? 360 - webkitCompassHeading : (_b = event.alpha) != null ? _b : void 0;
3201
+ const beta = (_c = event.beta) != null ? _c : void 0;
3202
+ const gamma = (_d = event.gamma) != null ? _d : void 0;
3202
3203
  const cssRotationVariableValue = `${360 - (alpha != null ? alpha : 0)}deg`;
3203
3204
  const cssRotationVariableName = alpha === void 0 ? void 0 : cssVarName;
3204
3205
  Object.assign(orientation, { alpha, beta, gamma });
@@ -3234,7 +3235,12 @@ function compatibaleAddEventListenerDeviceOrientation(handler) {
3234
3235
  isIOSDeviceOrientationPermissionGranted = true;
3235
3236
  addEventListener("deviceorientation", handler);
3236
3237
  }
3237
- }).catch((err) => console.error(err.message));
3238
+ }).catch((err) => {
3239
+ if (err.name === "NotAllowedError") {
3240
+ addEventListener("touchend", handleTouchEnd);
3241
+ }
3242
+ console.error(err.name, err.message);
3243
+ });
3238
3244
  };
3239
3245
  addEventListener("touchend", handleTouchEnd);
3240
3246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite -c vite.config.dev.ts",