@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 +11 -5
- package/dist/index.js +11 -5
- package/package.json +1 -1
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
|
|
3202
|
-
const
|
|
3203
|
-
const
|
|
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) =>
|
|
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
|
|
3200
|
-
const
|
|
3201
|
-
const
|
|
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) =>
|
|
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
|
}
|