@pega/cosmos-react-core 9.40.0 → 9.41.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/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +25 -9
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -0
- package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.styles.js +40 -31
- package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
- package/lib/components/Lightbox/ZoomControls/ZoomControls.d.ts +14 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.d.ts.map +1 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.js +23 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.js.map +1 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.styles.d.ts +5 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.styles.d.ts.map +1 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.styles.js +40 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.styles.js.map +1 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.test-ids.d.ts +2 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.test-ids.d.ts.map +1 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.test-ids.js +7 -0
- package/lib/components/Lightbox/ZoomControls/ZoomControls.test-ids.js.map +1 -0
- package/lib/components/Lightbox/ZoomControls/index.d.ts +4 -0
- package/lib/components/Lightbox/ZoomControls/index.d.ts.map +1 -0
- package/lib/components/Lightbox/ZoomControls/index.js +3 -0
- package/lib/components/Lightbox/ZoomControls/index.js.map +1 -0
- package/lib/components/Lightbox/useZoom.d.ts +30 -0
- package/lib/components/Lightbox/useZoom.d.ts.map +1 -0
- package/lib/components/Lightbox/useZoom.js +183 -0
- package/lib/components/Lightbox/useZoom.js.map +1 -0
- package/lib/hooks/useI18n.d.ts +5 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/i18n/default.d.ts +5 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +5 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +5 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/utils/clamp.d.ts +11 -0
- package/lib/utils/clamp.d.ts.map +1 -0
- package/lib/utils/clamp.js +13 -0
- package/lib/utils/clamp.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { clamp, isInstance } from '../../utils';
|
|
3
|
+
const ZOOM_STEP = 1.5;
|
|
4
|
+
const MIN_SCALE = 0.5;
|
|
5
|
+
const DOUBLE_TAP_SCALE = 2;
|
|
6
|
+
const DOUBLE_TAP_DELAY = 300;
|
|
7
|
+
const DOUBLE_TAP_DISTANCE = 30;
|
|
8
|
+
const TAP_MOVE_THRESHOLD = 8;
|
|
9
|
+
const WHEEL_ZOOM_SPEED = 0.01;
|
|
10
|
+
const WHEEL_MAX_DELTA = 25;
|
|
11
|
+
const LINE_HEIGHT = 16;
|
|
12
|
+
// Scaling from the top left only adds overflow at the end, so space before the target (e.g. from
|
|
13
|
+
// centering) is never matched there. Shrinks that space as the target grows to fill the container.
|
|
14
|
+
const getShift = (start, size, containerSize, scale) => {
|
|
15
|
+
const free = containerSize - size;
|
|
16
|
+
if (free <= 0)
|
|
17
|
+
return 0;
|
|
18
|
+
return -start * (1 - clamp((containerSize - size * scale) / free, 0, 1));
|
|
19
|
+
};
|
|
20
|
+
// Below the resting size, keep the center of the visible area fixed, wherever it is scrolled to.
|
|
21
|
+
const getZoomOutShift = (start, scroll, containerSize, scale) => (scroll + containerSize / 2 - start) * (1 - scale);
|
|
22
|
+
/**
|
|
23
|
+
* Adds pinch, ctrl + wheel and double tap zooming to a target element.
|
|
24
|
+
*
|
|
25
|
+
* Zooming only scales the target. Above the resting size, scrolling is left to the container,
|
|
26
|
+
* which must be scrollable, and the content under the gesture stays in place. Below the resting
|
|
27
|
+
* size, the target scales around the center of the visible area, and the scroll position is kept.
|
|
28
|
+
*
|
|
29
|
+
* @param container The scrollable element that receives gestures. Gestures are off while null.
|
|
30
|
+
* @param target The element that is scaled.
|
|
31
|
+
*/
|
|
32
|
+
const useZoom = (container, target, { maxScale = 4 } = {}) => {
|
|
33
|
+
const scale = useRef(1);
|
|
34
|
+
const shift = useRef({ x: 0, y: 0 });
|
|
35
|
+
const [scaleState, setScaleState] = useState(1);
|
|
36
|
+
const reset = useCallback(() => {
|
|
37
|
+
scale.current = 1;
|
|
38
|
+
shift.current = { x: 0, y: 0 };
|
|
39
|
+
setScaleState(1);
|
|
40
|
+
if (!target)
|
|
41
|
+
return;
|
|
42
|
+
target.style.transform = '';
|
|
43
|
+
target.style.transformOrigin = '';
|
|
44
|
+
}, [target]);
|
|
45
|
+
const zoomTo = useCallback((nextScale, point) => {
|
|
46
|
+
const next = clamp(nextScale, MIN_SCALE, Math.max(1, maxScale));
|
|
47
|
+
if (!container || !target || next === scale.current)
|
|
48
|
+
return;
|
|
49
|
+
const zoomedOut = next < 1;
|
|
50
|
+
const rect = target.getBoundingClientRect();
|
|
51
|
+
const bounds = container.getBoundingClientRect();
|
|
52
|
+
const current = scale.current;
|
|
53
|
+
// The target's unscaled position within the container's scrollable content.
|
|
54
|
+
const startX = rect.left - bounds.left + container.scrollLeft - shift.current.x;
|
|
55
|
+
const startY = rect.top - bounds.top + container.scrollTop - shift.current.y;
|
|
56
|
+
const width = rect.width / current;
|
|
57
|
+
const height = rect.height / current;
|
|
58
|
+
const previousShift = shift.current;
|
|
59
|
+
const nextShift = zoomedOut
|
|
60
|
+
? {
|
|
61
|
+
x: getZoomOutShift(startX, container.scrollLeft, container.clientWidth, next),
|
|
62
|
+
y: getZoomOutShift(startY, container.scrollTop, container.clientHeight, next)
|
|
63
|
+
}
|
|
64
|
+
: {
|
|
65
|
+
x: getShift(startX, width, container.clientWidth, next),
|
|
66
|
+
y: getShift(startY, height, container.clientHeight, next)
|
|
67
|
+
};
|
|
68
|
+
scale.current = next;
|
|
69
|
+
shift.current = nextShift;
|
|
70
|
+
setScaleState(next);
|
|
71
|
+
target.style.transformOrigin = next === 1 ? '' : '0 0';
|
|
72
|
+
target.style.transform =
|
|
73
|
+
next === 1 ? '' : `translate(${nextShift.x}px, ${nextShift.y}px) scale(${next})`;
|
|
74
|
+
if (zoomedOut)
|
|
75
|
+
return;
|
|
76
|
+
const origin = point ?? {
|
|
77
|
+
x: (bounds.left + bounds.right) / 2,
|
|
78
|
+
y: (bounds.top + bounds.bottom) / 2
|
|
79
|
+
};
|
|
80
|
+
const growth = next / current - 1;
|
|
81
|
+
const scrollX = growth * (origin.x - rect.left) + nextShift.x - previousShift.x;
|
|
82
|
+
const scrollY = growth * (origin.y - rect.top) + nextShift.y - previousShift.y;
|
|
83
|
+
container.scrollLeft += scrollX;
|
|
84
|
+
container.scrollTop += scrollY;
|
|
85
|
+
}, [container, target, maxScale]);
|
|
86
|
+
const zoomIn = useCallback(() => zoomTo(scale.current * ZOOM_STEP), [zoomTo]);
|
|
87
|
+
const zoomOut = useCallback(() => zoomTo(scale.current / ZOOM_STEP), [zoomTo]);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (!container)
|
|
90
|
+
return;
|
|
91
|
+
const pointers = new Map();
|
|
92
|
+
let tap;
|
|
93
|
+
let lastTap;
|
|
94
|
+
// Allows native scrolling, but not the browser's own pinch zoom.
|
|
95
|
+
const previousTouchAction = container.style.touchAction;
|
|
96
|
+
container.style.touchAction = 'pan-x pan-y';
|
|
97
|
+
const measure = () => {
|
|
98
|
+
const [a, b] = [...pointers.values()];
|
|
99
|
+
return {
|
|
100
|
+
mid: { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 },
|
|
101
|
+
distance: Math.hypot(a.x - b.x, a.y - b.y)
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const onWheel = (e) => {
|
|
105
|
+
// Trackpad pinches arrive as ctrl + wheel in Chromium and Firefox.
|
|
106
|
+
if (!e.ctrlKey)
|
|
107
|
+
return;
|
|
108
|
+
e.preventDefault();
|
|
109
|
+
const delta = clamp(e.deltaY * (e.deltaMode === 1 ? LINE_HEIGHT : 1), -WHEEL_MAX_DELTA, WHEEL_MAX_DELTA);
|
|
110
|
+
zoomTo(scale.current * Math.exp(-delta * WHEEL_ZOOM_SPEED), { x: e.clientX, y: e.clientY });
|
|
111
|
+
};
|
|
112
|
+
const onPointerDown = (e) => {
|
|
113
|
+
if ((e.pointerType === 'mouse' && e.button !== 0) || pointers.size >= 2)
|
|
114
|
+
return;
|
|
115
|
+
container.setPointerCapture(e.pointerId);
|
|
116
|
+
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
117
|
+
tap =
|
|
118
|
+
pointers.size === 1
|
|
119
|
+
? {
|
|
120
|
+
id: e.pointerId,
|
|
121
|
+
x: e.clientX,
|
|
122
|
+
y: e.clientY,
|
|
123
|
+
onTarget: !!target && isInstance(e.target, Node) && target.contains(e.target)
|
|
124
|
+
}
|
|
125
|
+
: undefined;
|
|
126
|
+
};
|
|
127
|
+
const onPointerMove = (e) => {
|
|
128
|
+
if (!pointers.has(e.pointerId))
|
|
129
|
+
return;
|
|
130
|
+
const before = pointers.size === 2 ? measure() : undefined;
|
|
131
|
+
pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
132
|
+
if (tap && Math.hypot(e.clientX - tap.x, e.clientY - tap.y) > TAP_MOVE_THRESHOLD) {
|
|
133
|
+
tap = undefined;
|
|
134
|
+
}
|
|
135
|
+
if (before && before.distance > 0) {
|
|
136
|
+
const after = measure();
|
|
137
|
+
zoomTo((scale.current * after.distance) / before.distance, after.mid);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const onPointerEnd = (e) => {
|
|
141
|
+
if (!pointers.delete(e.pointerId))
|
|
142
|
+
return;
|
|
143
|
+
const completedTap = e.type === 'pointerup' && tap?.id === e.pointerId ? tap : undefined;
|
|
144
|
+
tap = undefined;
|
|
145
|
+
if (!completedTap?.onTarget)
|
|
146
|
+
return;
|
|
147
|
+
const point = { x: e.clientX, y: e.clientY };
|
|
148
|
+
if (lastTap &&
|
|
149
|
+
e.timeStamp - lastTap.time < DOUBLE_TAP_DELAY &&
|
|
150
|
+
Math.hypot(point.x - lastTap.x, point.y - lastTap.y) < DOUBLE_TAP_DISTANCE) {
|
|
151
|
+
lastTap = undefined;
|
|
152
|
+
if (scale.current !== 1)
|
|
153
|
+
reset();
|
|
154
|
+
else
|
|
155
|
+
zoomTo(DOUBLE_TAP_SCALE, point);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
lastTap = { ...point, time: e.timeStamp };
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const ac = new AbortController();
|
|
162
|
+
// Non-passive so wheel events can cancel the browser's page zoom.
|
|
163
|
+
const listenerOptions = { passive: false, signal: ac.signal };
|
|
164
|
+
container.addEventListener('wheel', onWheel, listenerOptions);
|
|
165
|
+
container.addEventListener('pointerdown', onPointerDown, listenerOptions);
|
|
166
|
+
container.addEventListener('pointermove', onPointerMove, listenerOptions);
|
|
167
|
+
container.addEventListener('pointerup', onPointerEnd, listenerOptions);
|
|
168
|
+
container.addEventListener('pointercancel', onPointerEnd, listenerOptions);
|
|
169
|
+
return () => {
|
|
170
|
+
ac.abort();
|
|
171
|
+
container.style.touchAction = previousTouchAction;
|
|
172
|
+
reset();
|
|
173
|
+
};
|
|
174
|
+
}, [container, target, zoomTo, reset]);
|
|
175
|
+
return {
|
|
176
|
+
zoomIn,
|
|
177
|
+
zoomOut,
|
|
178
|
+
reset,
|
|
179
|
+
zoomed: scaleState !== 1
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
export default useZoom;
|
|
183
|
+
//# sourceMappingURL=useZoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoom.js","sourceRoot":"","sources":["../../../src/components/Lightbox/useZoom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOhD,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,iGAAiG;AACjG,mGAAmG;AACnG,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,aAAqB,EAAE,KAAa,EAAE,EAAE;IACrF,MAAM,IAAI,GAAG,aAAa,GAAG,IAAI,CAAC;IAClC,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAExB,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,aAAa,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,iGAAiG;AACjG,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,MAAc,EAAE,aAAqB,EAAE,KAAa,EAAE,EAAE,CAC9F,CAAC,MAAM,GAAG,aAA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;KACzB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { clamp, isInstance } from '../../utils';\n\ninterface Point {\n x: number;\n y: number;\n}\n\nconst ZOOM_STEP = 1.5;\nconst MIN_SCALE = 0.5;\nconst DOUBLE_TAP_SCALE = 2;\nconst DOUBLE_TAP_DELAY = 300;\nconst DOUBLE_TAP_DISTANCE = 30;\nconst TAP_MOVE_THRESHOLD = 8;\nconst WHEEL_ZOOM_SPEED = 0.01;\nconst WHEEL_MAX_DELTA = 25;\nconst LINE_HEIGHT = 16;\n\n// Scaling from the top left only adds overflow at the end, so space before the target (e.g. from\n// centering) is never matched there. Shrinks that space as the target grows to fill the container.\nconst getShift = (start: number, size: number, containerSize: number, scale: number) => {\n const free = containerSize - size;\n if (free <= 0) return 0;\n\n return -start * (1 - clamp((containerSize - size * scale) / free, 0, 1));\n};\n\n// Below the resting size, keep the center of the visible area fixed, wherever it is scrolled to.\nconst getZoomOutShift = (start: number, scroll: number, containerSize: number, scale: number) =>\n (scroll + containerSize / 2 - start) * (1 - scale);\n\ninterface UseZoomOptions {\n /**\n * The largest allowed scale. Values below 1 are treated as 1.\n * @default 4\n */\n maxScale?: number;\n}\n\ninterface UseZoomResult {\n /** Zooms in a step, centered on the container. */\n zoomIn: () => void;\n /** Zooms out a step, centered on the container. */\n zoomOut: () => void;\n /** Returns the target to its resting size. */\n reset: () => void;\n /** Whether the target is currently zoomed away from its resting size. */\n zoomed: boolean;\n}\n\n/**\n * Adds pinch, ctrl + wheel and double tap zooming to a target element.\n *\n * Zooming only scales the target. Above the resting size, scrolling is left to the container,\n * which must be scrollable, and the content under the gesture stays in place. Below the resting\n * size, the target scales around the center of the visible area, and the scroll position is kept.\n *\n * @param container The scrollable element that receives gestures. Gestures are off while null.\n * @param target The element that is scaled.\n */\nconst useZoom = (\n container: HTMLElement | null,\n target: HTMLElement | null,\n { maxScale = 4 }: UseZoomOptions = {}\n): UseZoomResult => {\n const scale = useRef(1);\n const shift = useRef<Point>({ x: 0, y: 0 });\n const [scaleState, setScaleState] = useState(1);\n\n const reset = useCallback(() => {\n scale.current = 1;\n shift.current = { x: 0, y: 0 };\n setScaleState(1);\n if (!target) return;\n\n target.style.transform = '';\n target.style.transformOrigin = '';\n }, [target]);\n\n const zoomTo = useCallback(\n (nextScale: number, point?: Point) => {\n const next = clamp(nextScale, MIN_SCALE, Math.max(1, maxScale));\n if (!container || !target || next === scale.current) return;\n\n const zoomedOut = next < 1;\n const rect = target.getBoundingClientRect();\n const bounds = container.getBoundingClientRect();\n const current = scale.current;\n // The target's unscaled position within the container's scrollable content.\n const startX = rect.left - bounds.left + container.scrollLeft - shift.current.x;\n const startY = rect.top - bounds.top + container.scrollTop - shift.current.y;\n const width = rect.width / current;\n const height = rect.height / current;\n const previousShift = shift.current;\n const nextShift = zoomedOut\n ? {\n x: getZoomOutShift(startX, container.scrollLeft, container.clientWidth, next),\n y: getZoomOutShift(startY, container.scrollTop, container.clientHeight, next)\n }\n : {\n x: getShift(startX, width, container.clientWidth, next),\n y: getShift(startY, height, container.clientHeight, next)\n };\n\n scale.current = next;\n shift.current = nextShift;\n setScaleState(next);\n target.style.transformOrigin = next === 1 ? '' : '0 0';\n target.style.transform =\n next === 1 ? '' : `translate(${nextShift.x}px, ${nextShift.y}px) scale(${next})`;\n if (zoomedOut) return;\n\n const origin = point ?? {\n x: (bounds.left + bounds.right) / 2,\n y: (bounds.top + bounds.bottom) / 2\n };\n const growth = next / current - 1;\n const scrollX = growth * (origin.x - rect.left) + nextShift.x - previousShift.x;\n const scrollY = growth * (origin.y - rect.top) + nextShift.y - previousShift.y;\n\n container.scrollLeft += scrollX;\n container.scrollTop += scrollY;\n },\n [container, target, maxScale]\n );\n\n const zoomIn = useCallback(() => zoomTo(scale.current * ZOOM_STEP), [zoomTo]);\n const zoomOut = useCallback(() => zoomTo(scale.current / ZOOM_STEP), [zoomTo]);\n\n useEffect(() => {\n if (!container) return;\n\n const pointers = new Map<number, Point>();\n let tap: { id: number; x: number; y: number; onTarget: boolean } | undefined;\n let lastTap: { x: number; y: number; time: number } | undefined;\n\n // Allows native scrolling, but not the browser's own pinch zoom.\n const previousTouchAction = container.style.touchAction;\n container.style.touchAction = 'pan-x pan-y';\n\n const measure = () => {\n const [a, b] = [...pointers.values()];\n\n return {\n mid: { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 },\n distance: Math.hypot(a.x - b.x, a.y - b.y)\n };\n };\n\n const onWheel = (e: WheelEvent) => {\n // Trackpad pinches arrive as ctrl + wheel in Chromium and Firefox.\n if (!e.ctrlKey) return;\n\n e.preventDefault();\n const delta = clamp(\n e.deltaY * (e.deltaMode === 1 ? LINE_HEIGHT : 1),\n -WHEEL_MAX_DELTA,\n WHEEL_MAX_DELTA\n );\n zoomTo(scale.current * Math.exp(-delta * WHEEL_ZOOM_SPEED), { x: e.clientX, y: e.clientY });\n };\n\n const onPointerDown = (e: PointerEvent) => {\n if ((e.pointerType === 'mouse' && e.button !== 0) || pointers.size >= 2) return;\n\n container.setPointerCapture(e.pointerId);\n pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });\n\n tap =\n pointers.size === 1\n ? {\n id: e.pointerId,\n x: e.clientX,\n y: e.clientY,\n onTarget: !!target && isInstance(e.target, Node) && target.contains(e.target)\n }\n : undefined;\n };\n\n const onPointerMove = (e: PointerEvent) => {\n if (!pointers.has(e.pointerId)) return;\n\n const before = pointers.size === 2 ? measure() : undefined;\n pointers.set(e.pointerId, { x: e.clientX, y: e.clientY });\n\n if (tap && Math.hypot(e.clientX - tap.x, e.clientY - tap.y) > TAP_MOVE_THRESHOLD) {\n tap = undefined;\n }\n\n if (before && before.distance > 0) {\n const after = measure();\n zoomTo((scale.current * after.distance) / before.distance, after.mid);\n }\n };\n\n const onPointerEnd = (e: PointerEvent) => {\n if (!pointers.delete(e.pointerId)) return;\n\n const completedTap = e.type === 'pointerup' && tap?.id === e.pointerId ? tap : undefined;\n tap = undefined;\n if (!completedTap?.onTarget) return;\n\n const point = { x: e.clientX, y: e.clientY };\n if (\n lastTap &&\n e.timeStamp - lastTap.time < DOUBLE_TAP_DELAY &&\n Math.hypot(point.x - lastTap.x, point.y - lastTap.y) < DOUBLE_TAP_DISTANCE\n ) {\n lastTap = undefined;\n if (scale.current !== 1) reset();\n else zoomTo(DOUBLE_TAP_SCALE, point);\n } else {\n lastTap = { ...point, time: e.timeStamp };\n }\n };\n\n const ac = new AbortController();\n // Non-passive so wheel events can cancel the browser's page zoom.\n const listenerOptions = { passive: false, signal: ac.signal };\n container.addEventListener('wheel', onWheel, listenerOptions);\n container.addEventListener('pointerdown', onPointerDown, listenerOptions);\n container.addEventListener('pointermove', onPointerMove, listenerOptions);\n container.addEventListener('pointerup', onPointerEnd, listenerOptions);\n container.addEventListener('pointercancel', onPointerEnd, listenerOptions);\n\n return () => {\n ac.abort();\n container.style.touchAction = previousTouchAction;\n reset();\n };\n }, [container, target, zoomTo, reset]);\n\n return {\n zoomIn,\n zoomOut,\n reset,\n zoomed: scaleState !== 1\n };\n};\n\nexport default useZoom;\n"]}
|
package/lib/hooks/useI18n.d.ts
CHANGED
|
@@ -146,6 +146,11 @@ declare const useI18n: () => import("../i18n/translate").TranslationFunction<Rea
|
|
|
146
146
|
add_condition: string;
|
|
147
147
|
enter_fullscreen: string;
|
|
148
148
|
exit_fullscreen: string;
|
|
149
|
+
zoom_controls: string;
|
|
150
|
+
zoom_in: string;
|
|
151
|
+
zoom_out: string;
|
|
152
|
+
reset_zoom: string;
|
|
153
|
+
scroll_image: string;
|
|
149
154
|
disable_word_wrap: string;
|
|
150
155
|
enable_word_wrap: string;
|
|
151
156
|
expand_search: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.d.ts","sourceRoot":"","sources":["../../src/hooks/useI18n.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"useI18n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GZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/lib/i18n/default.d.ts
CHANGED
|
@@ -142,6 +142,11 @@ declare const _default: {
|
|
|
142
142
|
add_condition: string;
|
|
143
143
|
enter_fullscreen: string;
|
|
144
144
|
exit_fullscreen: string;
|
|
145
|
+
zoom_controls: string;
|
|
146
|
+
zoom_in: string;
|
|
147
|
+
zoom_out: string;
|
|
148
|
+
reset_zoom: string;
|
|
149
|
+
scroll_image: string;
|
|
145
150
|
disable_word_wrap: string;
|
|
146
151
|
enable_word_wrap: string;
|
|
147
152
|
expand_search: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../src/i18n/default.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8PxB,6CAA6C;;;;;;;;;;;;;;IAgB7C,6CAA6C;;;;;;;;IAS7C,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwGzC,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2C/B,wCAAwC;;IAGxC,oCAAoC;;;;;;;;IASpC,oCAAoC;;;;;;IAOpC,uCAAuC;;;;;;;;;;;IAavC,6CAA6C;;;;;;;IAQ7C,uCAAuC;;;;;;;;IAUvC,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5uE3C,wBA4xEE"}
|
package/lib/i18n/default.js
CHANGED
|
@@ -148,6 +148,11 @@ export default {
|
|
|
148
148
|
add_condition: 'Add condition',
|
|
149
149
|
enter_fullscreen: 'Enter fullscreen',
|
|
150
150
|
exit_fullscreen: 'Exit fullscreen',
|
|
151
|
+
zoom_controls: 'Zoom controls',
|
|
152
|
+
zoom_in: 'Zoom in',
|
|
153
|
+
zoom_out: 'Zoom out',
|
|
154
|
+
reset_zoom: 'Reset zoom',
|
|
155
|
+
scroll_image: 'Scroll image',
|
|
151
156
|
disable_word_wrap: 'Disable word wrap',
|
|
152
157
|
enable_word_wrap: 'Enable word wrap',
|
|
153
158
|
expand_search: 'Expand search',
|