@prose-reader/enhancer-hammer-gesture
Advanced tools
Comparing version 1.56.0 to 1.57.0
@@ -14,9 +14,9 @@ import "hammerjs"; | ||
const pageTurnMargin = 0.15; | ||
const normalizedEvent = reader.normalizeEventForViewport(srcEvent) || {}; | ||
const normalizedEvent = reader.events.normalizeEventForViewport(srcEvent) || {}; | ||
if (`x` in normalizedEvent) { | ||
const { x = 0 } = normalizedEvent; | ||
if (x < width * pageTurnMargin) { | ||
reader.turnLeft(); | ||
reader.viewportNavigator.turnLeft(); | ||
} else if (x > width * (1 - pageTurnMargin)) { | ||
reader.turnRight(); | ||
reader.viewportNavigator.turnRight(); | ||
} else { | ||
@@ -36,3 +36,3 @@ observer.next({ type: "tap" }); | ||
const createPanMoveListener = (reader, hammerManager) => { | ||
return reader.context.$.state$.pipe( | ||
return reader.context.state$.pipe( | ||
map(({ manifest }) => ({ manifest })), | ||
@@ -47,3 +47,3 @@ distinctUntilChanged(isShallowEqual), | ||
function onPanMove(ev) { | ||
const normalizedEvent = reader == null ? void 0 : reader.normalizeEventForViewport(ev.srcEvent); | ||
const normalizedEvent = reader == null ? void 0 : reader.events.normalizeEventForViewport(ev.srcEvent); | ||
const deltaX = normalizedEvent && `x` in normalizedEvent ? (normalizedEvent == null ? void 0 : normalizedEvent.x) - movingStartOffsets.x : ev.deltaX; | ||
@@ -58,3 +58,3 @@ const deltaY = normalizedEvent && `y` in normalizedEvent ? (normalizedEvent == null ? void 0 : normalizedEvent.y) - movingStartOffsets.y : ev.deltaY; | ||
movingStartOffsets = { x: normalizedEvent.x, y: normalizedEvent.y }; | ||
reader == null ? void 0 : reader.moveTo({ x: 0, y: 0 }, { start: true }); | ||
reader == null ? void 0 : reader.viewportNavigator.moveTo({ x: 0, y: 0 }, { start: true }); | ||
} | ||
@@ -67,3 +67,3 @@ } | ||
} else { | ||
reader == null ? void 0 : reader.moveTo({ x: deltaX, y: deltaY }); | ||
reader == null ? void 0 : reader.viewportNavigator.moveTo({ x: deltaX, y: deltaY }); | ||
} | ||
@@ -76,3 +76,3 @@ } | ||
if (movingHasStarted) { | ||
reader == null ? void 0 : reader.moveTo({ x: deltaX, y: deltaY }, { final: true }); | ||
reader == null ? void 0 : reader.viewportNavigator.moveTo({ x: deltaX, y: deltaY }, { final: true }); | ||
} | ||
@@ -79,0 +79,0 @@ } |
{ | ||
"name": "@prose-reader/enhancer-hammer-gesture", | ||
"version": "1.56.0", | ||
"version": "1.57.0", | ||
"type": "module", | ||
@@ -25,3 +25,3 @@ "main": "./dist/prose-reader-enhancer-hammer.gesture.cjs", | ||
"dependencies": { | ||
"@prose-reader/core": "^1.56.0" | ||
"@prose-reader/core": "^1.57.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "9ef8778bb817cd4733b1865134eb58e621bf07ca" | ||
"gitHead": "01b1eba3d421335168bd9d22c08302572b19f9c1" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
523679
11224
Updated@prose-reader/core@^1.57.0