point-focus 1.0.0 → 1.0.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/ImageMagnifier.d.ts +1 -1
- package/dist/ImageMagnifier.types.d.ts +63 -13
- package/dist/assets/svgCollection.d.ts +6 -0
- package/dist/components/ImageStatusPlaceholder.d.ts +10 -0
- package/dist/index.cjs +120 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +50 -13
- package/dist/index.js +120 -61
- package/dist/index.js.map +1 -1
- package/dist/utils/globalUtils.d.ts +25 -21
- package/package.json +20 -3
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IImageTypes, ZoomFallbackBoundaryProps, ZoomFallbackBoundaryState } from '../ImageMagnifier.types';
|
|
3
|
+
export type PageCoords = {
|
|
3
4
|
x: number;
|
|
4
5
|
y: number;
|
|
5
6
|
};
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export type OffSetCoords = {
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
};
|
|
11
|
+
export type PageDimensions = {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
9
14
|
};
|
|
15
|
+
export declare function isTouchEvent(e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent | React.KeyboardEvent | KeyboardEvent): e is TouchEvent | React.TouchEvent;
|
|
16
|
+
export declare function getPageCoords(e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent | React.KeyboardEvent | KeyboardEvent, fallbackElement?: HTMLElement | null): PageCoords;
|
|
17
|
+
export declare const getOffsets: (pageX: number, pageY: number, left: number, top: number) => PageCoords;
|
|
10
18
|
export declare const getBounds: (container: HTMLDivElement | null) => DOMRect | {
|
|
11
19
|
width: number;
|
|
12
20
|
height: number;
|
|
@@ -19,28 +27,24 @@ export declare const getRatios: (bounds: {
|
|
|
19
27
|
}, dimensions: {
|
|
20
28
|
width: number;
|
|
21
29
|
height: number;
|
|
22
|
-
}) =>
|
|
23
|
-
x: number;
|
|
24
|
-
y: number;
|
|
25
|
-
};
|
|
30
|
+
}) => PageCoords;
|
|
26
31
|
export declare function clampToBounds(left: number, top: number, bounds: {
|
|
27
32
|
minLeft: number;
|
|
28
33
|
maxLeft: number;
|
|
29
34
|
minTop: number;
|
|
30
35
|
maxTop: number;
|
|
31
|
-
}):
|
|
32
|
-
left: number;
|
|
33
|
-
top: number;
|
|
34
|
-
};
|
|
36
|
+
}): OffSetCoords;
|
|
35
37
|
export declare function calculateDragPosition(pageX: number, pageY: number, offsets: {
|
|
36
38
|
x: number;
|
|
37
39
|
y: number;
|
|
38
|
-
}):
|
|
39
|
-
|
|
40
|
-
top: number;
|
|
41
|
-
};
|
|
42
|
-
export declare const getScaledDimensions: (zoomedImgRef: HTMLImageElement, zoomScale: number) => {
|
|
43
|
-
width: number;
|
|
44
|
-
height: number;
|
|
45
|
-
};
|
|
40
|
+
}): OffSetCoords;
|
|
41
|
+
export declare const getScaledDimensions: (zoomedImgRef: HTMLImageElement, zoomScale: number) => PageDimensions;
|
|
46
42
|
export declare const getDefaults: () => IImageTypes;
|
|
43
|
+
export declare class ZoomFallbackBoundary extends React.Component<ZoomFallbackBoundaryProps, ZoomFallbackBoundaryState> {
|
|
44
|
+
constructor(props: ZoomFallbackBoundaryProps);
|
|
45
|
+
static getDerivedStateFromError(): {
|
|
46
|
+
hasError: boolean;
|
|
47
|
+
};
|
|
48
|
+
componentDidCatch(error: any, info: any): void;
|
|
49
|
+
render(): React.ReactNode;
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "point-focus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A React component for zooming and focusing on image points via click, drag, or cursor.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "rollup -c rollup.config.cjs",
|
|
21
21
|
"scss:types": "typed-scss-modules src --includePaths src",
|
|
22
|
-
"scss:watch": "typed-scss-modules src --includePaths src --watch"
|
|
22
|
+
"scss:watch": "typed-scss-modules src --includePaths src --watch",
|
|
23
|
+
"release:patch": "npm version patch && npm publish --access public",
|
|
24
|
+
"release:minor": "npm version minor && npm publish --access public",
|
|
25
|
+
"release:major": "npm version major && npm publish --access public"
|
|
23
26
|
},
|
|
24
27
|
"keywords": [
|
|
25
28
|
"react",
|
|
@@ -29,8 +32,22 @@
|
|
|
29
32
|
"lens",
|
|
30
33
|
"component",
|
|
31
34
|
"tsx",
|
|
35
|
+
"point-focus",
|
|
32
36
|
"image-zoom",
|
|
33
|
-
"
|
|
37
|
+
"zoom-image",
|
|
38
|
+
"image-magnifier",
|
|
39
|
+
"image-gallery",
|
|
40
|
+
"product-image-zoom",
|
|
41
|
+
"click-to-zoom",
|
|
42
|
+
"drag-to-zoom",
|
|
43
|
+
"hover-zoom",
|
|
44
|
+
"touch-zoom",
|
|
45
|
+
"typescript",
|
|
46
|
+
"responsive-image",
|
|
47
|
+
"ecommerce",
|
|
48
|
+
"accessibility",
|
|
49
|
+
"customizable",
|
|
50
|
+
"touch-friendly"
|
|
34
51
|
],
|
|
35
52
|
"author": "Adrian Perdomo Llerena",
|
|
36
53
|
"license": "MIT",
|