@papyrus-sdk/ui-react-native 0.2.17 → 0.2.18-beta.1
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3137 -2604
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3270 -2614
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3IPQ5HO7.mjs +0 -121
- package/dist/chunk-3IPQ5HO7.mjs.map +0 -1
- package/dist/chunk-KXNP73MZ.mjs +0 -63
- package/dist/chunk-KXNP73MZ.mjs.map +0 -1
- package/dist/chunk-ZD7AOCMD.mjs +0 -9
- package/dist/chunk-ZD7AOCMD.mjs.map +0 -1
- package/dist/gesture/pinchZoom.d.mts +0 -48
- package/dist/gesture/pinchZoom.d.ts +0 -48
- package/dist/gesture/pinchZoom.js +0 -157
- package/dist/gesture/pinchZoom.js.map +0 -1
- package/dist/gesture/pinchZoom.mjs +0 -34
- package/dist/gesture/pinchZoom.mjs.map +0 -1
- package/dist/gesture/selectionInteraction.d.mts +0 -35
- package/dist/gesture/selectionInteraction.d.ts +0 -35
- package/dist/gesture/selectionInteraction.js +0 -90
- package/dist/gesture/selectionInteraction.js.map +0 -1
- package/dist/gesture/selectionInteraction.mjs +0 -16
- package/dist/gesture/selectionInteraction.mjs.map +0 -1
package/package.json
CHANGED
package/dist/chunk-3IPQ5HO7.mjs
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// gesture/pinchZoom.ts
|
|
2
|
-
var DEFAULT_PINCH_ZOOM_BOUNDS = {
|
|
3
|
-
minZoom: 0.5,
|
|
4
|
-
maxZoom: 4
|
|
5
|
-
};
|
|
6
|
-
var PINCH_PRESS_SUPPRESSION_MS = 120;
|
|
7
|
-
var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
8
|
-
var getTouchDistance = (touches) => {
|
|
9
|
-
if (touches.length < 2) return 0;
|
|
10
|
-
const [first, second] = touches;
|
|
11
|
-
return Math.hypot(second.pageX - first.pageX, second.pageY - first.pageY);
|
|
12
|
-
};
|
|
13
|
-
var isPinchTouchList = (touches) => touches.length === 2 && getTouchDistance(touches) > 0;
|
|
14
|
-
var createPinchSession = (touches, zoom, bounds = DEFAULT_PINCH_ZOOM_BOUNDS) => ({
|
|
15
|
-
initialDistance: Math.max(1, getTouchDistance(touches)),
|
|
16
|
-
initialZoom: clamp(zoom, bounds.minZoom, bounds.maxZoom)
|
|
17
|
-
});
|
|
18
|
-
var resolvePinchZoomChange = (session, touches, bounds = DEFAULT_PINCH_ZOOM_BOUNDS) => {
|
|
19
|
-
const distance = getTouchDistance(touches);
|
|
20
|
-
if (distance <= 0) {
|
|
21
|
-
return clamp(session.initialZoom, bounds.minZoom, bounds.maxZoom);
|
|
22
|
-
}
|
|
23
|
-
return clamp(
|
|
24
|
-
session.initialZoom * (distance / session.initialDistance),
|
|
25
|
-
bounds.minZoom,
|
|
26
|
-
bounds.maxZoom
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
|
-
var resolvePinchPreviewScale = (startZoom, previewZoom) => {
|
|
30
|
-
const safeStartZoom = Math.max(1e-4, Math.abs(startZoom));
|
|
31
|
-
return previewZoom / safeStartZoom;
|
|
32
|
-
};
|
|
33
|
-
var sanitizePinchPreviewScale = (value) => {
|
|
34
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
35
|
-
return 1;
|
|
36
|
-
}
|
|
37
|
-
return value;
|
|
38
|
-
};
|
|
39
|
-
var resolvePinchGestureZoom = (startZoom, scaleFactor, bounds = DEFAULT_PINCH_ZOOM_BOUNDS) => clamp(
|
|
40
|
-
(Number.isFinite(startZoom) && startZoom > 0 ? startZoom : 1) * (Number.isFinite(scaleFactor) && scaleFactor > 0 ? scaleFactor : 1),
|
|
41
|
-
bounds.minZoom,
|
|
42
|
-
bounds.maxZoom
|
|
43
|
-
);
|
|
44
|
-
var resolveAnchoredViewportOffset = ({
|
|
45
|
-
viewportOffset,
|
|
46
|
-
startScrollOffset,
|
|
47
|
-
startItemOffset,
|
|
48
|
-
startItemLength,
|
|
49
|
-
endItemOffset,
|
|
50
|
-
endItemLength,
|
|
51
|
-
viewportLength,
|
|
52
|
-
endContentLength
|
|
53
|
-
}) => {
|
|
54
|
-
const safeViewportOffset = Number.isFinite(viewportOffset) ? viewportOffset : 0;
|
|
55
|
-
const safeStartScrollOffset = Number.isFinite(startScrollOffset) ? startScrollOffset : 0;
|
|
56
|
-
const safeStartItemOffset = Number.isFinite(startItemOffset) ? startItemOffset : 0;
|
|
57
|
-
const safeStartItemLength = Number.isFinite(startItemLength) && startItemLength > 0 ? startItemLength : 1;
|
|
58
|
-
const safeEndItemOffset = Number.isFinite(endItemOffset) ? endItemOffset : 0;
|
|
59
|
-
const safeEndItemLength = Number.isFinite(endItemLength) && endItemLength > 0 ? endItemLength : 1;
|
|
60
|
-
const safeViewportLength = Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;
|
|
61
|
-
const safeEndContentLength = Number.isFinite(endContentLength) && endContentLength > 0 ? endContentLength : safeEndItemOffset + safeEndItemLength;
|
|
62
|
-
const contentPoint = safeStartScrollOffset + safeViewportOffset - safeStartItemOffset;
|
|
63
|
-
const normalizedPoint = clamp(contentPoint / safeStartItemLength, 0, 1);
|
|
64
|
-
const anchoredContentPoint = safeEndItemOffset + normalizedPoint * safeEndItemLength;
|
|
65
|
-
return clamp(
|
|
66
|
-
anchoredContentPoint - safeViewportOffset,
|
|
67
|
-
0,
|
|
68
|
-
Math.max(0, safeEndContentLength - safeViewportLength)
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
var resolveClampedScrollOffset = (offset, contentLength, viewportLength) => {
|
|
72
|
-
const safeOffset = Number.isFinite(offset) ? offset : 0;
|
|
73
|
-
const safeContentLength = Number.isFinite(contentLength) && contentLength > 0 ? contentLength : 0;
|
|
74
|
-
const safeViewportLength = Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;
|
|
75
|
-
return clamp(
|
|
76
|
-
safeOffset,
|
|
77
|
-
0,
|
|
78
|
-
Math.max(0, safeContentLength - safeViewportLength)
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
var resolveDocumentSurfaceWidth = ({
|
|
82
|
-
viewportWidth,
|
|
83
|
-
contentWidth,
|
|
84
|
-
horizontalPadding
|
|
85
|
-
}) => {
|
|
86
|
-
const safeViewportWidth = Number.isFinite(viewportWidth) && viewportWidth > 0 ? viewportWidth : 0;
|
|
87
|
-
const safeContentWidth = Number.isFinite(contentWidth) && contentWidth > 0 ? contentWidth : 0;
|
|
88
|
-
const safeHorizontalPadding = Number.isFinite(horizontalPadding) && horizontalPadding > 0 ? horizontalPadding : 0;
|
|
89
|
-
return Math.max(
|
|
90
|
-
safeViewportWidth,
|
|
91
|
-
safeContentWidth + safeHorizontalPadding * 2
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
var resolveGlobalHorizontalOffset = ({
|
|
95
|
-
offsetX,
|
|
96
|
-
surfaceWidth,
|
|
97
|
-
viewportWidth
|
|
98
|
-
}) => resolveClampedScrollOffset(offsetX, surfaceWidth, viewportWidth);
|
|
99
|
-
var shouldSuppressPressAfterPinch = (lastPinchEndedAt, now = Date.now(), windowMs = PINCH_PRESS_SUPPRESSION_MS) => {
|
|
100
|
-
if (typeof lastPinchEndedAt !== "number") return false;
|
|
101
|
-
const elapsedMs = now - lastPinchEndedAt;
|
|
102
|
-
return elapsedMs >= 0 && elapsedMs < windowMs;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
DEFAULT_PINCH_ZOOM_BOUNDS,
|
|
107
|
-
PINCH_PRESS_SUPPRESSION_MS,
|
|
108
|
-
getTouchDistance,
|
|
109
|
-
isPinchTouchList,
|
|
110
|
-
createPinchSession,
|
|
111
|
-
resolvePinchZoomChange,
|
|
112
|
-
resolvePinchPreviewScale,
|
|
113
|
-
sanitizePinchPreviewScale,
|
|
114
|
-
resolvePinchGestureZoom,
|
|
115
|
-
resolveAnchoredViewportOffset,
|
|
116
|
-
resolveClampedScrollOffset,
|
|
117
|
-
resolveDocumentSurfaceWidth,
|
|
118
|
-
resolveGlobalHorizontalOffset,
|
|
119
|
-
shouldSuppressPressAfterPinch
|
|
120
|
-
};
|
|
121
|
-
//# sourceMappingURL=chunk-3IPQ5HO7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../gesture/pinchZoom.ts"],"sourcesContent":["export type PinchTouchPoint = {\n pageX: number;\n pageY: number;\n};\n\nexport type PinchSession = {\n initialDistance: number;\n initialZoom: number;\n};\n\nexport type PinchZoomBounds = {\n minZoom: number;\n maxZoom: number;\n};\n\nexport type AnchoredViewportOffsetInput = {\n viewportOffset: number;\n startScrollOffset: number;\n startItemOffset: number;\n startItemLength: number;\n endItemOffset: number;\n endItemLength: number;\n viewportLength: number;\n endContentLength: number;\n};\n\nexport type DocumentSurfaceWidthInput = {\n viewportWidth: number;\n contentWidth: number;\n horizontalPadding: number;\n};\n\nexport type GlobalHorizontalOffsetInput = {\n offsetX: number;\n surfaceWidth: number;\n viewportWidth: number;\n};\n\nexport const DEFAULT_PINCH_ZOOM_BOUNDS: PinchZoomBounds = {\n minZoom: 0.5,\n maxZoom: 4,\n};\nexport const PINCH_PRESS_SUPPRESSION_MS = 120;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nexport const getTouchDistance = (touches: PinchTouchPoint[]): number => {\n if (touches.length < 2) return 0;\n const [first, second] = touches;\n return Math.hypot(second.pageX - first.pageX, second.pageY - first.pageY);\n};\n\nexport const isPinchTouchList = (touches: PinchTouchPoint[]): boolean =>\n touches.length === 2 && getTouchDistance(touches) > 0;\n\nexport const createPinchSession = (\n touches: PinchTouchPoint[],\n zoom: number,\n bounds: PinchZoomBounds = DEFAULT_PINCH_ZOOM_BOUNDS\n): PinchSession => ({\n initialDistance: Math.max(1, getTouchDistance(touches)),\n initialZoom: clamp(zoom, bounds.minZoom, bounds.maxZoom),\n});\n\nexport const resolvePinchZoomChange = (\n session: PinchSession,\n touches: PinchTouchPoint[],\n bounds: PinchZoomBounds = DEFAULT_PINCH_ZOOM_BOUNDS\n): number => {\n const distance = getTouchDistance(touches);\n if (distance <= 0) {\n return clamp(session.initialZoom, bounds.minZoom, bounds.maxZoom);\n }\n\n return clamp(\n session.initialZoom * (distance / session.initialDistance),\n bounds.minZoom,\n bounds.maxZoom\n );\n};\n\nexport const resolvePinchPreviewScale = (\n startZoom: number,\n previewZoom: number\n): number => {\n const safeStartZoom = Math.max(0.0001, Math.abs(startZoom));\n return previewZoom / safeStartZoom;\n};\n\nexport const sanitizePinchPreviewScale = (value: number): number => {\n if (!Number.isFinite(value) || value <= 0) {\n return 1;\n }\n return value;\n};\n\nexport const resolvePinchGestureZoom = (\n startZoom: number,\n scaleFactor: number,\n bounds: PinchZoomBounds = DEFAULT_PINCH_ZOOM_BOUNDS\n): number =>\n clamp(\n (Number.isFinite(startZoom) && startZoom > 0 ? startZoom : 1) *\n (Number.isFinite(scaleFactor) && scaleFactor > 0 ? scaleFactor : 1),\n bounds.minZoom,\n bounds.maxZoom\n );\n\nexport const resolveAnchoredViewportOffset = ({\n viewportOffset,\n startScrollOffset,\n startItemOffset,\n startItemLength,\n endItemOffset,\n endItemLength,\n viewportLength,\n endContentLength,\n}: AnchoredViewportOffsetInput): number => {\n const safeViewportOffset = Number.isFinite(viewportOffset)\n ? viewportOffset\n : 0;\n const safeStartScrollOffset = Number.isFinite(startScrollOffset)\n ? startScrollOffset\n : 0;\n const safeStartItemOffset = Number.isFinite(startItemOffset)\n ? startItemOffset\n : 0;\n const safeStartItemLength =\n Number.isFinite(startItemLength) && startItemLength > 0\n ? startItemLength\n : 1;\n const safeEndItemOffset = Number.isFinite(endItemOffset) ? endItemOffset : 0;\n const safeEndItemLength =\n Number.isFinite(endItemLength) && endItemLength > 0 ? endItemLength : 1;\n const safeViewportLength =\n Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;\n const safeEndContentLength =\n Number.isFinite(endContentLength) && endContentLength > 0\n ? endContentLength\n : safeEndItemOffset + safeEndItemLength;\n\n const contentPoint =\n safeStartScrollOffset + safeViewportOffset - safeStartItemOffset;\n const normalizedPoint = clamp(contentPoint / safeStartItemLength, 0, 1);\n const anchoredContentPoint =\n safeEndItemOffset + normalizedPoint * safeEndItemLength;\n return clamp(\n anchoredContentPoint - safeViewportOffset,\n 0,\n Math.max(0, safeEndContentLength - safeViewportLength)\n );\n};\n\nexport const resolveClampedScrollOffset = (\n offset: number,\n contentLength: number,\n viewportLength: number\n): number => {\n const safeOffset = Number.isFinite(offset) ? offset : 0;\n const safeContentLength =\n Number.isFinite(contentLength) && contentLength > 0 ? contentLength : 0;\n const safeViewportLength =\n Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;\n return clamp(\n safeOffset,\n 0,\n Math.max(0, safeContentLength - safeViewportLength)\n );\n};\n\nexport const resolveDocumentSurfaceWidth = ({\n viewportWidth,\n contentWidth,\n horizontalPadding,\n}: DocumentSurfaceWidthInput): number => {\n const safeViewportWidth =\n Number.isFinite(viewportWidth) && viewportWidth > 0 ? viewportWidth : 0;\n const safeContentWidth =\n Number.isFinite(contentWidth) && contentWidth > 0 ? contentWidth : 0;\n const safeHorizontalPadding =\n Number.isFinite(horizontalPadding) && horizontalPadding > 0\n ? horizontalPadding\n : 0;\n\n return Math.max(\n safeViewportWidth,\n safeContentWidth + safeHorizontalPadding * 2\n );\n};\n\nexport const resolveGlobalHorizontalOffset = ({\n offsetX,\n surfaceWidth,\n viewportWidth,\n}: GlobalHorizontalOffsetInput): number =>\n resolveClampedScrollOffset(offsetX, surfaceWidth, viewportWidth);\n\nexport const shouldSuppressPressAfterPinch = (\n lastPinchEndedAt: number | null | undefined,\n now = Date.now(),\n windowMs = PINCH_PRESS_SUPPRESSION_MS\n): boolean => {\n if (typeof lastPinchEndedAt !== \"number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iB;AAC3E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,KAAK,IAAI,GAAG,oBAAoB,kBAAkB;AAAA,EACpD;AACF;AAEO,IAAM,8BAA8B,CAAC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF,MAAyC;AACvC,QAAM,oBACJ,OAAO,SAAS,aAAa,KAAK,gBAAgB,IAAI,gBAAgB;AACxE,QAAM,mBACJ,OAAO,SAAS,YAAY,KAAK,eAAe,IAAI,eAAe;AACrE,QAAM,wBACJ,OAAO,SAAS,iBAAiB,KAAK,oBAAoB,IACtD,oBACA;AAEN,SAAO,KAAK;AAAA,IACV;AAAA,IACA,mBAAmB,wBAAwB;AAAA,EAC7C;AACF;AAEO,IAAM,gCAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACF,MACE,2BAA2B,SAAS,cAAc,aAAa;AAE1D,IAAM,gCAAgC,CAC3C,kBACA,MAAM,KAAK,IAAI,GACf,WAAW,+BACC;AACZ,MAAI,OAAO,qBAAqB,SAAU,QAAO;AACjD,QAAM,YAAY,MAAM;AACxB,SAAO,aAAa,KAAK,YAAY;AACvC;","names":[]}
|
package/dist/chunk-KXNP73MZ.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// gesture/selectionInteraction.ts
|
|
2
|
-
var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
3
|
-
var DRAG_SELECTION_TOOLS = /* @__PURE__ */ new Set([
|
|
4
|
-
"highlight",
|
|
5
|
-
"underline",
|
|
6
|
-
"squiggly",
|
|
7
|
-
"strikeout"
|
|
8
|
-
]);
|
|
9
|
-
var resolveAxisAutoscroll = (coordinate, size, threshold, maxStep) => {
|
|
10
|
-
if (size <= 0 || threshold <= 0 || maxStep <= 0) return 0;
|
|
11
|
-
const startDistance = clamp(coordinate, 0, size);
|
|
12
|
-
if (startDistance < threshold) {
|
|
13
|
-
const intensity = 1 - startDistance / threshold;
|
|
14
|
-
return -Math.round(maxStep * intensity);
|
|
15
|
-
}
|
|
16
|
-
const endDistance = clamp(size - coordinate, 0, size);
|
|
17
|
-
if (endDistance < threshold) {
|
|
18
|
-
const intensity = 1 - endDistance / threshold;
|
|
19
|
-
return Math.round(maxStep * intensity);
|
|
20
|
-
}
|
|
21
|
-
return 0;
|
|
22
|
-
};
|
|
23
|
-
var shouldEnableViewerScroll = ({
|
|
24
|
-
selectionDragActive,
|
|
25
|
-
gestureScrollLockActive = false
|
|
26
|
-
}) => !selectionDragActive && !gestureScrollLockActive;
|
|
27
|
-
var shouldEnableSelectionDrag = ({
|
|
28
|
-
activeTool,
|
|
29
|
-
interactionMode
|
|
30
|
-
}) => DRAG_SELECTION_TOOLS.has(activeTool) || activeTool === "select" && interactionMode === "select";
|
|
31
|
-
var isToolDockToolSelected = ({
|
|
32
|
-
activeTool,
|
|
33
|
-
interactionMode,
|
|
34
|
-
toolId
|
|
35
|
-
}) => toolId === "select" ? activeTool === "select" && interactionMode === "select" : activeTool === toolId;
|
|
36
|
-
var getToolDockDismissState = ({
|
|
37
|
-
activeTool: _activeTool,
|
|
38
|
-
interactionMode: _interactionMode
|
|
39
|
-
}) => ({
|
|
40
|
-
toolDockOpen: false,
|
|
41
|
-
activeTool: "select",
|
|
42
|
-
interactionMode: "pan"
|
|
43
|
-
});
|
|
44
|
-
var getSelectionEdgeAutoscroll = ({
|
|
45
|
-
x,
|
|
46
|
-
y,
|
|
47
|
-
width,
|
|
48
|
-
height,
|
|
49
|
-
threshold,
|
|
50
|
-
maxStep
|
|
51
|
-
}) => ({
|
|
52
|
-
dx: resolveAxisAutoscroll(x, width, threshold, maxStep),
|
|
53
|
-
dy: resolveAxisAutoscroll(y, height, threshold, maxStep)
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
shouldEnableViewerScroll,
|
|
58
|
-
shouldEnableSelectionDrag,
|
|
59
|
-
isToolDockToolSelected,
|
|
60
|
-
getToolDockDismissState,
|
|
61
|
-
getSelectionEdgeAutoscroll
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=chunk-KXNP73MZ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../gesture/selectionInteraction.ts"],"sourcesContent":["export type ViewerScrollState = {\n selectionDragActive: boolean;\n gestureScrollLockActive?: boolean;\n};\n\nexport type SelectionGestureTool =\n | \"select\"\n | \"highlight\"\n | \"underline\"\n | \"squiggly\"\n | \"strikeout\"\n | \"text\"\n | \"comment\"\n | \"ink\";\n\nexport type SelectionInteractionMode = \"pan\" | \"select\";\n\nexport type SelectionGestureActivationInput = {\n activeTool: SelectionGestureTool;\n interactionMode: SelectionInteractionMode;\n};\n\nexport type ToolDockSelectionState = SelectionGestureActivationInput & {\n toolId: SelectionGestureTool;\n};\n\nexport type ToolDockDismissState = SelectionGestureActivationInput & {\n toolDockOpen: boolean;\n};\n\nexport type SelectionEdgeAutoscrollInput = {\n x: number;\n y: number;\n width: number;\n height: number;\n threshold: number;\n maxStep: number;\n};\n\nexport type SelectionEdgeAutoscroll = {\n dx: number;\n dy: number;\n};\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nconst DRAG_SELECTION_TOOLS = new Set<SelectionGestureTool>([\n \"highlight\",\n \"underline\",\n \"squiggly\",\n \"strikeout\",\n]);\n\nconst resolveAxisAutoscroll = (\n coordinate: number,\n size: number,\n threshold: number,\n maxStep: number\n) => {\n if (size <= 0 || threshold <= 0 || maxStep <= 0) return 0;\n\n const startDistance = clamp(coordinate, 0, size);\n if (startDistance < threshold) {\n const intensity = 1 - startDistance / threshold;\n return -Math.round(maxStep * intensity);\n }\n\n const endDistance = clamp(size - coordinate, 0, size);\n if (endDistance < threshold) {\n const intensity = 1 - endDistance / threshold;\n return Math.round(maxStep * intensity);\n }\n\n return 0;\n};\n\nexport const shouldEnableViewerScroll = ({\n selectionDragActive,\n gestureScrollLockActive = false,\n}: ViewerScrollState) => !selectionDragActive && !gestureScrollLockActive;\n\nexport const shouldEnableSelectionDrag = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput) =>\n DRAG_SELECTION_TOOLS.has(activeTool) ||\n (activeTool === \"select\" && interactionMode === \"select\");\n\nexport const isToolDockToolSelected = ({\n activeTool,\n interactionMode,\n toolId,\n}: ToolDockSelectionState) =>\n toolId === \"select\"\n ? activeTool === \"select\" && interactionMode === \"select\"\n : activeTool === toolId;\n\nexport const getToolDockDismissState = ({\n activeTool: _activeTool,\n interactionMode: _interactionMode,\n}: SelectionGestureActivationInput): ToolDockDismissState => ({\n toolDockOpen: false,\n activeTool: \"select\",\n interactionMode: \"pan\",\n});\n\nexport const getSelectionEdgeAutoscroll = ({\n x,\n y,\n width,\n height,\n threshold,\n maxStep,\n}: SelectionEdgeAutoscrollInput): SelectionEdgeAutoscroll => ({\n dx: resolveAxisAutoscroll(x, width, threshold, maxStep),\n dy: resolveAxisAutoscroll(y, height, threshold, maxStep),\n});\n"],"mappings":";AA4CA,IAAM,QAAQ,CAAC,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAEpC,IAAM,uBAAuB,oBAAI,IAA0B;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,wBAAwB,CAC5B,YACA,MACA,WACA,YACG;AACH,MAAI,QAAQ,KAAK,aAAa,KAAK,WAAW,EAAG,QAAO;AAExD,QAAM,gBAAgB,MAAM,YAAY,GAAG,IAAI;AAC/C,MAAI,gBAAgB,WAAW;AAC7B,UAAM,YAAY,IAAI,gBAAgB;AACtC,WAAO,CAAC,KAAK,MAAM,UAAU,SAAS;AAAA,EACxC;AAEA,QAAM,cAAc,MAAM,OAAO,YAAY,GAAG,IAAI;AACpD,MAAI,cAAc,WAAW;AAC3B,UAAM,YAAY,IAAI,cAAc;AACpC,WAAO,KAAK,MAAM,UAAU,SAAS;AAAA,EACvC;AAEA,SAAO;AACT;AAEO,IAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EACA,0BAA0B;AAC5B,MAAyB,CAAC,uBAAuB,CAAC;AAE3C,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AACF,MACE,qBAAqB,IAAI,UAAU,KAClC,eAAe,YAAY,oBAAoB;AAE3C,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,MACE,WAAW,WACP,eAAe,YAAY,oBAAoB,WAC/C,eAAe;AAEd,IAAM,0BAA0B,CAAC;AAAA,EACtC,YAAY;AAAA,EACZ,iBAAiB;AACnB,OAA8D;AAAA,EAC5D,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,iBAAiB;AACnB;AAEO,IAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,IAAI,sBAAsB,GAAG,OAAO,WAAW,OAAO;AAAA,EACtD,IAAI,sBAAsB,GAAG,QAAQ,WAAW,OAAO;AACzD;","names":[]}
|
package/dist/chunk-ZD7AOCMD.mjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
__commonJS
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=chunk-ZD7AOCMD.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
type PinchTouchPoint = {
|
|
2
|
-
pageX: number;
|
|
3
|
-
pageY: number;
|
|
4
|
-
};
|
|
5
|
-
type PinchSession = {
|
|
6
|
-
initialDistance: number;
|
|
7
|
-
initialZoom: number;
|
|
8
|
-
};
|
|
9
|
-
type PinchZoomBounds = {
|
|
10
|
-
minZoom: number;
|
|
11
|
-
maxZoom: number;
|
|
12
|
-
};
|
|
13
|
-
type AnchoredViewportOffsetInput = {
|
|
14
|
-
viewportOffset: number;
|
|
15
|
-
startScrollOffset: number;
|
|
16
|
-
startItemOffset: number;
|
|
17
|
-
startItemLength: number;
|
|
18
|
-
endItemOffset: number;
|
|
19
|
-
endItemLength: number;
|
|
20
|
-
viewportLength: number;
|
|
21
|
-
endContentLength: number;
|
|
22
|
-
};
|
|
23
|
-
type DocumentSurfaceWidthInput = {
|
|
24
|
-
viewportWidth: number;
|
|
25
|
-
contentWidth: number;
|
|
26
|
-
horizontalPadding: number;
|
|
27
|
-
};
|
|
28
|
-
type GlobalHorizontalOffsetInput = {
|
|
29
|
-
offsetX: number;
|
|
30
|
-
surfaceWidth: number;
|
|
31
|
-
viewportWidth: number;
|
|
32
|
-
};
|
|
33
|
-
declare const DEFAULT_PINCH_ZOOM_BOUNDS: PinchZoomBounds;
|
|
34
|
-
declare const PINCH_PRESS_SUPPRESSION_MS = 120;
|
|
35
|
-
declare const getTouchDistance: (touches: PinchTouchPoint[]) => number;
|
|
36
|
-
declare const isPinchTouchList: (touches: PinchTouchPoint[]) => boolean;
|
|
37
|
-
declare const createPinchSession: (touches: PinchTouchPoint[], zoom: number, bounds?: PinchZoomBounds) => PinchSession;
|
|
38
|
-
declare const resolvePinchZoomChange: (session: PinchSession, touches: PinchTouchPoint[], bounds?: PinchZoomBounds) => number;
|
|
39
|
-
declare const resolvePinchPreviewScale: (startZoom: number, previewZoom: number) => number;
|
|
40
|
-
declare const sanitizePinchPreviewScale: (value: number) => number;
|
|
41
|
-
declare const resolvePinchGestureZoom: (startZoom: number, scaleFactor: number, bounds?: PinchZoomBounds) => number;
|
|
42
|
-
declare const resolveAnchoredViewportOffset: ({ viewportOffset, startScrollOffset, startItemOffset, startItemLength, endItemOffset, endItemLength, viewportLength, endContentLength, }: AnchoredViewportOffsetInput) => number;
|
|
43
|
-
declare const resolveClampedScrollOffset: (offset: number, contentLength: number, viewportLength: number) => number;
|
|
44
|
-
declare const resolveDocumentSurfaceWidth: ({ viewportWidth, contentWidth, horizontalPadding, }: DocumentSurfaceWidthInput) => number;
|
|
45
|
-
declare const resolveGlobalHorizontalOffset: ({ offsetX, surfaceWidth, viewportWidth, }: GlobalHorizontalOffsetInput) => number;
|
|
46
|
-
declare const shouldSuppressPressAfterPinch: (lastPinchEndedAt: number | null | undefined, now?: number, windowMs?: number) => boolean;
|
|
47
|
-
|
|
48
|
-
export { type AnchoredViewportOffsetInput, DEFAULT_PINCH_ZOOM_BOUNDS, type DocumentSurfaceWidthInput, type GlobalHorizontalOffsetInput, PINCH_PRESS_SUPPRESSION_MS, type PinchSession, type PinchTouchPoint, type PinchZoomBounds, createPinchSession, getTouchDistance, isPinchTouchList, resolveAnchoredViewportOffset, resolveClampedScrollOffset, resolveDocumentSurfaceWidth, resolveGlobalHorizontalOffset, resolvePinchGestureZoom, resolvePinchPreviewScale, resolvePinchZoomChange, sanitizePinchPreviewScale, shouldSuppressPressAfterPinch };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
type PinchTouchPoint = {
|
|
2
|
-
pageX: number;
|
|
3
|
-
pageY: number;
|
|
4
|
-
};
|
|
5
|
-
type PinchSession = {
|
|
6
|
-
initialDistance: number;
|
|
7
|
-
initialZoom: number;
|
|
8
|
-
};
|
|
9
|
-
type PinchZoomBounds = {
|
|
10
|
-
minZoom: number;
|
|
11
|
-
maxZoom: number;
|
|
12
|
-
};
|
|
13
|
-
type AnchoredViewportOffsetInput = {
|
|
14
|
-
viewportOffset: number;
|
|
15
|
-
startScrollOffset: number;
|
|
16
|
-
startItemOffset: number;
|
|
17
|
-
startItemLength: number;
|
|
18
|
-
endItemOffset: number;
|
|
19
|
-
endItemLength: number;
|
|
20
|
-
viewportLength: number;
|
|
21
|
-
endContentLength: number;
|
|
22
|
-
};
|
|
23
|
-
type DocumentSurfaceWidthInput = {
|
|
24
|
-
viewportWidth: number;
|
|
25
|
-
contentWidth: number;
|
|
26
|
-
horizontalPadding: number;
|
|
27
|
-
};
|
|
28
|
-
type GlobalHorizontalOffsetInput = {
|
|
29
|
-
offsetX: number;
|
|
30
|
-
surfaceWidth: number;
|
|
31
|
-
viewportWidth: number;
|
|
32
|
-
};
|
|
33
|
-
declare const DEFAULT_PINCH_ZOOM_BOUNDS: PinchZoomBounds;
|
|
34
|
-
declare const PINCH_PRESS_SUPPRESSION_MS = 120;
|
|
35
|
-
declare const getTouchDistance: (touches: PinchTouchPoint[]) => number;
|
|
36
|
-
declare const isPinchTouchList: (touches: PinchTouchPoint[]) => boolean;
|
|
37
|
-
declare const createPinchSession: (touches: PinchTouchPoint[], zoom: number, bounds?: PinchZoomBounds) => PinchSession;
|
|
38
|
-
declare const resolvePinchZoomChange: (session: PinchSession, touches: PinchTouchPoint[], bounds?: PinchZoomBounds) => number;
|
|
39
|
-
declare const resolvePinchPreviewScale: (startZoom: number, previewZoom: number) => number;
|
|
40
|
-
declare const sanitizePinchPreviewScale: (value: number) => number;
|
|
41
|
-
declare const resolvePinchGestureZoom: (startZoom: number, scaleFactor: number, bounds?: PinchZoomBounds) => number;
|
|
42
|
-
declare const resolveAnchoredViewportOffset: ({ viewportOffset, startScrollOffset, startItemOffset, startItemLength, endItemOffset, endItemLength, viewportLength, endContentLength, }: AnchoredViewportOffsetInput) => number;
|
|
43
|
-
declare const resolveClampedScrollOffset: (offset: number, contentLength: number, viewportLength: number) => number;
|
|
44
|
-
declare const resolveDocumentSurfaceWidth: ({ viewportWidth, contentWidth, horizontalPadding, }: DocumentSurfaceWidthInput) => number;
|
|
45
|
-
declare const resolveGlobalHorizontalOffset: ({ offsetX, surfaceWidth, viewportWidth, }: GlobalHorizontalOffsetInput) => number;
|
|
46
|
-
declare const shouldSuppressPressAfterPinch: (lastPinchEndedAt: number | null | undefined, now?: number, windowMs?: number) => boolean;
|
|
47
|
-
|
|
48
|
-
export { type AnchoredViewportOffsetInput, DEFAULT_PINCH_ZOOM_BOUNDS, type DocumentSurfaceWidthInput, type GlobalHorizontalOffsetInput, PINCH_PRESS_SUPPRESSION_MS, type PinchSession, type PinchTouchPoint, type PinchZoomBounds, createPinchSession, getTouchDistance, isPinchTouchList, resolveAnchoredViewportOffset, resolveClampedScrollOffset, resolveDocumentSurfaceWidth, resolveGlobalHorizontalOffset, resolvePinchGestureZoom, resolvePinchPreviewScale, resolvePinchZoomChange, sanitizePinchPreviewScale, shouldSuppressPressAfterPinch };
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// gesture/pinchZoom.ts
|
|
20
|
-
var pinchZoom_exports = {};
|
|
21
|
-
__export(pinchZoom_exports, {
|
|
22
|
-
DEFAULT_PINCH_ZOOM_BOUNDS: () => DEFAULT_PINCH_ZOOM_BOUNDS,
|
|
23
|
-
PINCH_PRESS_SUPPRESSION_MS: () => PINCH_PRESS_SUPPRESSION_MS,
|
|
24
|
-
createPinchSession: () => createPinchSession,
|
|
25
|
-
getTouchDistance: () => getTouchDistance,
|
|
26
|
-
isPinchTouchList: () => isPinchTouchList,
|
|
27
|
-
resolveAnchoredViewportOffset: () => resolveAnchoredViewportOffset,
|
|
28
|
-
resolveClampedScrollOffset: () => resolveClampedScrollOffset,
|
|
29
|
-
resolveDocumentSurfaceWidth: () => resolveDocumentSurfaceWidth,
|
|
30
|
-
resolveGlobalHorizontalOffset: () => resolveGlobalHorizontalOffset,
|
|
31
|
-
resolvePinchGestureZoom: () => resolvePinchGestureZoom,
|
|
32
|
-
resolvePinchPreviewScale: () => resolvePinchPreviewScale,
|
|
33
|
-
resolvePinchZoomChange: () => resolvePinchZoomChange,
|
|
34
|
-
sanitizePinchPreviewScale: () => sanitizePinchPreviewScale,
|
|
35
|
-
shouldSuppressPressAfterPinch: () => shouldSuppressPressAfterPinch
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(pinchZoom_exports);
|
|
38
|
-
var DEFAULT_PINCH_ZOOM_BOUNDS = {
|
|
39
|
-
minZoom: 0.5,
|
|
40
|
-
maxZoom: 4
|
|
41
|
-
};
|
|
42
|
-
var PINCH_PRESS_SUPPRESSION_MS = 120;
|
|
43
|
-
var clamp = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
44
|
-
var getTouchDistance = (touches) => {
|
|
45
|
-
if (touches.length < 2) return 0;
|
|
46
|
-
const [first, second] = touches;
|
|
47
|
-
return Math.hypot(second.pageX - first.pageX, second.pageY - first.pageY);
|
|
48
|
-
};
|
|
49
|
-
var isPinchTouchList = (touches) => touches.length === 2 && getTouchDistance(touches) > 0;
|
|
50
|
-
var createPinchSession = (touches, zoom, bounds = DEFAULT_PINCH_ZOOM_BOUNDS) => ({
|
|
51
|
-
initialDistance: Math.max(1, getTouchDistance(touches)),
|
|
52
|
-
initialZoom: clamp(zoom, bounds.minZoom, bounds.maxZoom)
|
|
53
|
-
});
|
|
54
|
-
var resolvePinchZoomChange = (session, touches, bounds = DEFAULT_PINCH_ZOOM_BOUNDS) => {
|
|
55
|
-
const distance = getTouchDistance(touches);
|
|
56
|
-
if (distance <= 0) {
|
|
57
|
-
return clamp(session.initialZoom, bounds.minZoom, bounds.maxZoom);
|
|
58
|
-
}
|
|
59
|
-
return clamp(
|
|
60
|
-
session.initialZoom * (distance / session.initialDistance),
|
|
61
|
-
bounds.minZoom,
|
|
62
|
-
bounds.maxZoom
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
var resolvePinchPreviewScale = (startZoom, previewZoom) => {
|
|
66
|
-
const safeStartZoom = Math.max(1e-4, Math.abs(startZoom));
|
|
67
|
-
return previewZoom / safeStartZoom;
|
|
68
|
-
};
|
|
69
|
-
var sanitizePinchPreviewScale = (value) => {
|
|
70
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
71
|
-
return 1;
|
|
72
|
-
}
|
|
73
|
-
return value;
|
|
74
|
-
};
|
|
75
|
-
var resolvePinchGestureZoom = (startZoom, scaleFactor, bounds = DEFAULT_PINCH_ZOOM_BOUNDS) => clamp(
|
|
76
|
-
(Number.isFinite(startZoom) && startZoom > 0 ? startZoom : 1) * (Number.isFinite(scaleFactor) && scaleFactor > 0 ? scaleFactor : 1),
|
|
77
|
-
bounds.minZoom,
|
|
78
|
-
bounds.maxZoom
|
|
79
|
-
);
|
|
80
|
-
var resolveAnchoredViewportOffset = ({
|
|
81
|
-
viewportOffset,
|
|
82
|
-
startScrollOffset,
|
|
83
|
-
startItemOffset,
|
|
84
|
-
startItemLength,
|
|
85
|
-
endItemOffset,
|
|
86
|
-
endItemLength,
|
|
87
|
-
viewportLength,
|
|
88
|
-
endContentLength
|
|
89
|
-
}) => {
|
|
90
|
-
const safeViewportOffset = Number.isFinite(viewportOffset) ? viewportOffset : 0;
|
|
91
|
-
const safeStartScrollOffset = Number.isFinite(startScrollOffset) ? startScrollOffset : 0;
|
|
92
|
-
const safeStartItemOffset = Number.isFinite(startItemOffset) ? startItemOffset : 0;
|
|
93
|
-
const safeStartItemLength = Number.isFinite(startItemLength) && startItemLength > 0 ? startItemLength : 1;
|
|
94
|
-
const safeEndItemOffset = Number.isFinite(endItemOffset) ? endItemOffset : 0;
|
|
95
|
-
const safeEndItemLength = Number.isFinite(endItemLength) && endItemLength > 0 ? endItemLength : 1;
|
|
96
|
-
const safeViewportLength = Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;
|
|
97
|
-
const safeEndContentLength = Number.isFinite(endContentLength) && endContentLength > 0 ? endContentLength : safeEndItemOffset + safeEndItemLength;
|
|
98
|
-
const contentPoint = safeStartScrollOffset + safeViewportOffset - safeStartItemOffset;
|
|
99
|
-
const normalizedPoint = clamp(contentPoint / safeStartItemLength, 0, 1);
|
|
100
|
-
const anchoredContentPoint = safeEndItemOffset + normalizedPoint * safeEndItemLength;
|
|
101
|
-
return clamp(
|
|
102
|
-
anchoredContentPoint - safeViewportOffset,
|
|
103
|
-
0,
|
|
104
|
-
Math.max(0, safeEndContentLength - safeViewportLength)
|
|
105
|
-
);
|
|
106
|
-
};
|
|
107
|
-
var resolveClampedScrollOffset = (offset, contentLength, viewportLength) => {
|
|
108
|
-
const safeOffset = Number.isFinite(offset) ? offset : 0;
|
|
109
|
-
const safeContentLength = Number.isFinite(contentLength) && contentLength > 0 ? contentLength : 0;
|
|
110
|
-
const safeViewportLength = Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;
|
|
111
|
-
return clamp(
|
|
112
|
-
safeOffset,
|
|
113
|
-
0,
|
|
114
|
-
Math.max(0, safeContentLength - safeViewportLength)
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
var resolveDocumentSurfaceWidth = ({
|
|
118
|
-
viewportWidth,
|
|
119
|
-
contentWidth,
|
|
120
|
-
horizontalPadding
|
|
121
|
-
}) => {
|
|
122
|
-
const safeViewportWidth = Number.isFinite(viewportWidth) && viewportWidth > 0 ? viewportWidth : 0;
|
|
123
|
-
const safeContentWidth = Number.isFinite(contentWidth) && contentWidth > 0 ? contentWidth : 0;
|
|
124
|
-
const safeHorizontalPadding = Number.isFinite(horizontalPadding) && horizontalPadding > 0 ? horizontalPadding : 0;
|
|
125
|
-
return Math.max(
|
|
126
|
-
safeViewportWidth,
|
|
127
|
-
safeContentWidth + safeHorizontalPadding * 2
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
var resolveGlobalHorizontalOffset = ({
|
|
131
|
-
offsetX,
|
|
132
|
-
surfaceWidth,
|
|
133
|
-
viewportWidth
|
|
134
|
-
}) => resolveClampedScrollOffset(offsetX, surfaceWidth, viewportWidth);
|
|
135
|
-
var shouldSuppressPressAfterPinch = (lastPinchEndedAt, now = Date.now(), windowMs = PINCH_PRESS_SUPPRESSION_MS) => {
|
|
136
|
-
if (typeof lastPinchEndedAt !== "number") return false;
|
|
137
|
-
const elapsedMs = now - lastPinchEndedAt;
|
|
138
|
-
return elapsedMs >= 0 && elapsedMs < windowMs;
|
|
139
|
-
};
|
|
140
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
141
|
-
0 && (module.exports = {
|
|
142
|
-
DEFAULT_PINCH_ZOOM_BOUNDS,
|
|
143
|
-
PINCH_PRESS_SUPPRESSION_MS,
|
|
144
|
-
createPinchSession,
|
|
145
|
-
getTouchDistance,
|
|
146
|
-
isPinchTouchList,
|
|
147
|
-
resolveAnchoredViewportOffset,
|
|
148
|
-
resolveClampedScrollOffset,
|
|
149
|
-
resolveDocumentSurfaceWidth,
|
|
150
|
-
resolveGlobalHorizontalOffset,
|
|
151
|
-
resolvePinchGestureZoom,
|
|
152
|
-
resolvePinchPreviewScale,
|
|
153
|
-
resolvePinchZoomChange,
|
|
154
|
-
sanitizePinchPreviewScale,
|
|
155
|
-
shouldSuppressPressAfterPinch
|
|
156
|
-
});
|
|
157
|
-
//# sourceMappingURL=pinchZoom.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../gesture/pinchZoom.ts"],"sourcesContent":["export type PinchTouchPoint = {\n pageX: number;\n pageY: number;\n};\n\nexport type PinchSession = {\n initialDistance: number;\n initialZoom: number;\n};\n\nexport type PinchZoomBounds = {\n minZoom: number;\n maxZoom: number;\n};\n\nexport type AnchoredViewportOffsetInput = {\n viewportOffset: number;\n startScrollOffset: number;\n startItemOffset: number;\n startItemLength: number;\n endItemOffset: number;\n endItemLength: number;\n viewportLength: number;\n endContentLength: number;\n};\n\nexport type DocumentSurfaceWidthInput = {\n viewportWidth: number;\n contentWidth: number;\n horizontalPadding: number;\n};\n\nexport type GlobalHorizontalOffsetInput = {\n offsetX: number;\n surfaceWidth: number;\n viewportWidth: number;\n};\n\nexport const DEFAULT_PINCH_ZOOM_BOUNDS: PinchZoomBounds = {\n minZoom: 0.5,\n maxZoom: 4,\n};\nexport const PINCH_PRESS_SUPPRESSION_MS = 120;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nexport const getTouchDistance = (touches: PinchTouchPoint[]): number => {\n if (touches.length < 2) return 0;\n const [first, second] = touches;\n return Math.hypot(second.pageX - first.pageX, second.pageY - first.pageY);\n};\n\nexport const isPinchTouchList = (touches: PinchTouchPoint[]): boolean =>\n touches.length === 2 && getTouchDistance(touches) > 0;\n\nexport const createPinchSession = (\n touches: PinchTouchPoint[],\n zoom: number,\n bounds: PinchZoomBounds = DEFAULT_PINCH_ZOOM_BOUNDS\n): PinchSession => ({\n initialDistance: Math.max(1, getTouchDistance(touches)),\n initialZoom: clamp(zoom, bounds.minZoom, bounds.maxZoom),\n});\n\nexport const resolvePinchZoomChange = (\n session: PinchSession,\n touches: PinchTouchPoint[],\n bounds: PinchZoomBounds = DEFAULT_PINCH_ZOOM_BOUNDS\n): number => {\n const distance = getTouchDistance(touches);\n if (distance <= 0) {\n return clamp(session.initialZoom, bounds.minZoom, bounds.maxZoom);\n }\n\n return clamp(\n session.initialZoom * (distance / session.initialDistance),\n bounds.minZoom,\n bounds.maxZoom\n );\n};\n\nexport const resolvePinchPreviewScale = (\n startZoom: number,\n previewZoom: number\n): number => {\n const safeStartZoom = Math.max(0.0001, Math.abs(startZoom));\n return previewZoom / safeStartZoom;\n};\n\nexport const sanitizePinchPreviewScale = (value: number): number => {\n if (!Number.isFinite(value) || value <= 0) {\n return 1;\n }\n return value;\n};\n\nexport const resolvePinchGestureZoom = (\n startZoom: number,\n scaleFactor: number,\n bounds: PinchZoomBounds = DEFAULT_PINCH_ZOOM_BOUNDS\n): number =>\n clamp(\n (Number.isFinite(startZoom) && startZoom > 0 ? startZoom : 1) *\n (Number.isFinite(scaleFactor) && scaleFactor > 0 ? scaleFactor : 1),\n bounds.minZoom,\n bounds.maxZoom\n );\n\nexport const resolveAnchoredViewportOffset = ({\n viewportOffset,\n startScrollOffset,\n startItemOffset,\n startItemLength,\n endItemOffset,\n endItemLength,\n viewportLength,\n endContentLength,\n}: AnchoredViewportOffsetInput): number => {\n const safeViewportOffset = Number.isFinite(viewportOffset)\n ? viewportOffset\n : 0;\n const safeStartScrollOffset = Number.isFinite(startScrollOffset)\n ? startScrollOffset\n : 0;\n const safeStartItemOffset = Number.isFinite(startItemOffset)\n ? startItemOffset\n : 0;\n const safeStartItemLength =\n Number.isFinite(startItemLength) && startItemLength > 0\n ? startItemLength\n : 1;\n const safeEndItemOffset = Number.isFinite(endItemOffset) ? endItemOffset : 0;\n const safeEndItemLength =\n Number.isFinite(endItemLength) && endItemLength > 0 ? endItemLength : 1;\n const safeViewportLength =\n Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;\n const safeEndContentLength =\n Number.isFinite(endContentLength) && endContentLength > 0\n ? endContentLength\n : safeEndItemOffset + safeEndItemLength;\n\n const contentPoint =\n safeStartScrollOffset + safeViewportOffset - safeStartItemOffset;\n const normalizedPoint = clamp(contentPoint / safeStartItemLength, 0, 1);\n const anchoredContentPoint =\n safeEndItemOffset + normalizedPoint * safeEndItemLength;\n return clamp(\n anchoredContentPoint - safeViewportOffset,\n 0,\n Math.max(0, safeEndContentLength - safeViewportLength)\n );\n};\n\nexport const resolveClampedScrollOffset = (\n offset: number,\n contentLength: number,\n viewportLength: number\n): number => {\n const safeOffset = Number.isFinite(offset) ? offset : 0;\n const safeContentLength =\n Number.isFinite(contentLength) && contentLength > 0 ? contentLength : 0;\n const safeViewportLength =\n Number.isFinite(viewportLength) && viewportLength > 0 ? viewportLength : 0;\n return clamp(\n safeOffset,\n 0,\n Math.max(0, safeContentLength - safeViewportLength)\n );\n};\n\nexport const resolveDocumentSurfaceWidth = ({\n viewportWidth,\n contentWidth,\n horizontalPadding,\n}: DocumentSurfaceWidthInput): number => {\n const safeViewportWidth =\n Number.isFinite(viewportWidth) && viewportWidth > 0 ? viewportWidth : 0;\n const safeContentWidth =\n Number.isFinite(contentWidth) && contentWidth > 0 ? contentWidth : 0;\n const safeHorizontalPadding =\n Number.isFinite(horizontalPadding) && horizontalPadding > 0\n ? horizontalPadding\n : 0;\n\n return Math.max(\n safeViewportWidth,\n safeContentWidth + safeHorizontalPadding * 2\n );\n};\n\nexport const resolveGlobalHorizontalOffset = ({\n offsetX,\n surfaceWidth,\n viewportWidth,\n}: GlobalHorizontalOffsetInput): number =>\n resolveClampedScrollOffset(offsetX, surfaceWidth, viewportWidth);\n\nexport const shouldSuppressPressAfterPinch = (\n lastPinchEndedAt: number | null | undefined,\n now = Date.now(),\n windowMs = PINCH_PRESS_SUPPRESSION_MS\n): boolean => {\n if (typeof lastPinchEndedAt !== \"number\") return false;\n const elapsedMs = now - lastPinchEndedAt;\n return elapsedMs >= 0 && elapsedMs < windowMs;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsCO,IAAM,4BAA6C;AAAA,EACxD,SAAS;AAAA,EACT,SAAS;AACX;AACO,IAAM,6BAA6B;AAE1C,IAAM,QAAQ,CAAC,OAAe,KAAa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SAAS,aAAa,KAAK,gBAAgB,IAAI,gBAAgB;AACxE,QAAM,mBACJ,OAAO,SAAS,YAAY,KAAK,eAAe,IAAI,eAAe;AACrE,QAAM,wBACJ,OAAO,SAAS,iBAAiB,KAAK,oBAAoB,IACtD,oBACA;AAEN,SAAO,KAAK;AAAA,IACV;AAAA,IACA,mBAAmB,wBAAwB;AAAA,EAC7C;AACF;AAEO,IAAM,gCAAgC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AACF,MACE,2BAA2B,SAAS,cAAc,aAAa;AAE1D,IAAM,gCAAgC,CAC3C,kBACA,MAAM,KAAK,IAAI,GACf,WAAW,+BACC;AACZ,MAAI,OAAO,qBAAqB,SAAU,QAAO;AACjD,QAAM,YAAY,MAAM;AACxB,SAAO,aAAa,KAAK,YAAY;AACvC;","names":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_PINCH_ZOOM_BOUNDS,
|
|
3
|
-
PINCH_PRESS_SUPPRESSION_MS,
|
|
4
|
-
createPinchSession,
|
|
5
|
-
getTouchDistance,
|
|
6
|
-
isPinchTouchList,
|
|
7
|
-
resolveAnchoredViewportOffset,
|
|
8
|
-
resolveClampedScrollOffset,
|
|
9
|
-
resolveDocumentSurfaceWidth,
|
|
10
|
-
resolveGlobalHorizontalOffset,
|
|
11
|
-
resolvePinchGestureZoom,
|
|
12
|
-
resolvePinchPreviewScale,
|
|
13
|
-
resolvePinchZoomChange,
|
|
14
|
-
sanitizePinchPreviewScale,
|
|
15
|
-
shouldSuppressPressAfterPinch
|
|
16
|
-
} from "../chunk-3IPQ5HO7.mjs";
|
|
17
|
-
import "../chunk-ZD7AOCMD.mjs";
|
|
18
|
-
export {
|
|
19
|
-
DEFAULT_PINCH_ZOOM_BOUNDS,
|
|
20
|
-
PINCH_PRESS_SUPPRESSION_MS,
|
|
21
|
-
createPinchSession,
|
|
22
|
-
getTouchDistance,
|
|
23
|
-
isPinchTouchList,
|
|
24
|
-
resolveAnchoredViewportOffset,
|
|
25
|
-
resolveClampedScrollOffset,
|
|
26
|
-
resolveDocumentSurfaceWidth,
|
|
27
|
-
resolveGlobalHorizontalOffset,
|
|
28
|
-
resolvePinchGestureZoom,
|
|
29
|
-
resolvePinchPreviewScale,
|
|
30
|
-
resolvePinchZoomChange,
|
|
31
|
-
sanitizePinchPreviewScale,
|
|
32
|
-
shouldSuppressPressAfterPinch
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=pinchZoom.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
type ViewerScrollState = {
|
|
2
|
-
selectionDragActive: boolean;
|
|
3
|
-
gestureScrollLockActive?: boolean;
|
|
4
|
-
};
|
|
5
|
-
type SelectionGestureTool = "select" | "highlight" | "underline" | "squiggly" | "strikeout" | "text" | "comment" | "ink";
|
|
6
|
-
type SelectionInteractionMode = "pan" | "select";
|
|
7
|
-
type SelectionGestureActivationInput = {
|
|
8
|
-
activeTool: SelectionGestureTool;
|
|
9
|
-
interactionMode: SelectionInteractionMode;
|
|
10
|
-
};
|
|
11
|
-
type ToolDockSelectionState = SelectionGestureActivationInput & {
|
|
12
|
-
toolId: SelectionGestureTool;
|
|
13
|
-
};
|
|
14
|
-
type ToolDockDismissState = SelectionGestureActivationInput & {
|
|
15
|
-
toolDockOpen: boolean;
|
|
16
|
-
};
|
|
17
|
-
type SelectionEdgeAutoscrollInput = {
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
threshold: number;
|
|
23
|
-
maxStep: number;
|
|
24
|
-
};
|
|
25
|
-
type SelectionEdgeAutoscroll = {
|
|
26
|
-
dx: number;
|
|
27
|
-
dy: number;
|
|
28
|
-
};
|
|
29
|
-
declare const shouldEnableViewerScroll: ({ selectionDragActive, gestureScrollLockActive, }: ViewerScrollState) => boolean;
|
|
30
|
-
declare const shouldEnableSelectionDrag: ({ activeTool, interactionMode, }: SelectionGestureActivationInput) => boolean;
|
|
31
|
-
declare const isToolDockToolSelected: ({ activeTool, interactionMode, toolId, }: ToolDockSelectionState) => boolean;
|
|
32
|
-
declare const getToolDockDismissState: ({ activeTool: _activeTool, interactionMode: _interactionMode, }: SelectionGestureActivationInput) => ToolDockDismissState;
|
|
33
|
-
declare const getSelectionEdgeAutoscroll: ({ x, y, width, height, threshold, maxStep, }: SelectionEdgeAutoscrollInput) => SelectionEdgeAutoscroll;
|
|
34
|
-
|
|
35
|
-
export { type SelectionEdgeAutoscroll, type SelectionEdgeAutoscrollInput, type SelectionGestureActivationInput, type SelectionGestureTool, type SelectionInteractionMode, type ToolDockDismissState, type ToolDockSelectionState, type ViewerScrollState, getSelectionEdgeAutoscroll, getToolDockDismissState, isToolDockToolSelected, shouldEnableSelectionDrag, shouldEnableViewerScroll };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
type ViewerScrollState = {
|
|
2
|
-
selectionDragActive: boolean;
|
|
3
|
-
gestureScrollLockActive?: boolean;
|
|
4
|
-
};
|
|
5
|
-
type SelectionGestureTool = "select" | "highlight" | "underline" | "squiggly" | "strikeout" | "text" | "comment" | "ink";
|
|
6
|
-
type SelectionInteractionMode = "pan" | "select";
|
|
7
|
-
type SelectionGestureActivationInput = {
|
|
8
|
-
activeTool: SelectionGestureTool;
|
|
9
|
-
interactionMode: SelectionInteractionMode;
|
|
10
|
-
};
|
|
11
|
-
type ToolDockSelectionState = SelectionGestureActivationInput & {
|
|
12
|
-
toolId: SelectionGestureTool;
|
|
13
|
-
};
|
|
14
|
-
type ToolDockDismissState = SelectionGestureActivationInput & {
|
|
15
|
-
toolDockOpen: boolean;
|
|
16
|
-
};
|
|
17
|
-
type SelectionEdgeAutoscrollInput = {
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
threshold: number;
|
|
23
|
-
maxStep: number;
|
|
24
|
-
};
|
|
25
|
-
type SelectionEdgeAutoscroll = {
|
|
26
|
-
dx: number;
|
|
27
|
-
dy: number;
|
|
28
|
-
};
|
|
29
|
-
declare const shouldEnableViewerScroll: ({ selectionDragActive, gestureScrollLockActive, }: ViewerScrollState) => boolean;
|
|
30
|
-
declare const shouldEnableSelectionDrag: ({ activeTool, interactionMode, }: SelectionGestureActivationInput) => boolean;
|
|
31
|
-
declare const isToolDockToolSelected: ({ activeTool, interactionMode, toolId, }: ToolDockSelectionState) => boolean;
|
|
32
|
-
declare const getToolDockDismissState: ({ activeTool: _activeTool, interactionMode: _interactionMode, }: SelectionGestureActivationInput) => ToolDockDismissState;
|
|
33
|
-
declare const getSelectionEdgeAutoscroll: ({ x, y, width, height, threshold, maxStep, }: SelectionEdgeAutoscrollInput) => SelectionEdgeAutoscroll;
|
|
34
|
-
|
|
35
|
-
export { type SelectionEdgeAutoscroll, type SelectionEdgeAutoscrollInput, type SelectionGestureActivationInput, type SelectionGestureTool, type SelectionInteractionMode, type ToolDockDismissState, type ToolDockSelectionState, type ViewerScrollState, getSelectionEdgeAutoscroll, getToolDockDismissState, isToolDockToolSelected, shouldEnableSelectionDrag, shouldEnableViewerScroll };
|