@edgepdf/viewer-react 0.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/README.md +11 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12454 -0
- package/dist/lib/pdf-viewer.d.ts +66 -0
- package/dist/lib/pdf-viewer.d.ts.map +1 -0
- package/dist/lib/pdf-viewer.spec.d.ts +2 -0
- package/dist/lib/pdf-viewer.spec.d.ts.map +1 -0
- package/dist/lib/use-markers.d.ts +63 -0
- package/dist/lib/use-markers.d.ts.map +1 -0
- package/dist/lib/use-markers.spec.d.ts +2 -0
- package/dist/lib/use-markers.spec.d.ts.map +1 -0
- package/dist/lib/use-viewer.d.ts +37 -0
- package/dist/lib/use-viewer.d.ts.map +1 -0
- package/dist/lib/use-viewer.spec.d.ts +2 -0
- package/dist/lib/use-viewer.spec.d.ts.map +1 -0
- package/dist/lib/use-zoom.d.ts +52 -0
- package/dist/lib/use-zoom.d.ts.map +1 -0
- package/dist/lib/use-zoom.spec.d.ts +2 -0
- package/dist/lib/use-zoom.spec.d.ts.map +1 -0
- package/dist/lib/viewer-context.d.ts +63 -0
- package/dist/lib/viewer-context.d.ts.map +1 -0
- package/dist/lib/viewer-context.spec.d.ts +2 -0
- package/dist/lib/viewer-context.spec.d.ts.map +1 -0
- package/dist/lib/viewer-react.d.ts +2 -0
- package/dist/lib/viewer-react.d.ts.map +1 -0
- package/dist/lib/zoom-controls.d.ts +28 -0
- package/dist/lib/zoom-controls.d.ts.map +1 -0
- package/dist/styles.css +340 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type { ViewerConfig, MapOptions, Marker, MarkerData } from '@edgepdf/types';
|
|
3
|
+
import type { ZoomControlsProps } from './zoom-controls.js';
|
|
4
|
+
/**
|
|
5
|
+
* Props for EdgePDFViewer component
|
|
6
|
+
*/
|
|
7
|
+
export interface EdgePDFViewerProps {
|
|
8
|
+
/** Viewer configuration */
|
|
9
|
+
config: ViewerConfig;
|
|
10
|
+
/** Optional map options */
|
|
11
|
+
mapOptions?: MapOptions;
|
|
12
|
+
/** Optional className for the container */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Optional style for the container */
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
/** Show zoom controls (default: true) */
|
|
17
|
+
showZoomControls?: boolean;
|
|
18
|
+
/** Zoom controls position (only used if showZoomControls is true) */
|
|
19
|
+
zoomControlsPosition?: ZoomControlsProps['position'];
|
|
20
|
+
/** Show zoom level in zoom controls (only used if showZoomControls is true) */
|
|
21
|
+
showZoomLevel?: boolean;
|
|
22
|
+
/** Enable annotation functionality (default: true) */
|
|
23
|
+
enableAnnotation?: boolean;
|
|
24
|
+
/** Default zoom level for initial view */
|
|
25
|
+
defaultZoomLevel?: number;
|
|
26
|
+
/** Callback when markers/pins are updated */
|
|
27
|
+
onPinsUpdate?: (pins: Marker[]) => void;
|
|
28
|
+
/** Default pins to preload (uses internal import) */
|
|
29
|
+
defaultPins?: Marker[] | MarkerData;
|
|
30
|
+
/** Children components */
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* EdgePDFViewer - Main React component for the EdgePDF viewer
|
|
35
|
+
*
|
|
36
|
+
* This component wraps the viewer functionality in a React component,
|
|
37
|
+
* providing the ViewerProvider context to child components.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* function App() {
|
|
42
|
+
* const config: ViewerConfig = {
|
|
43
|
+
* tileUrl: 'https://example.com/tiles/{z}/{x}/{y}.png',
|
|
44
|
+
* imageInfo: {
|
|
45
|
+
* width: 2000,
|
|
46
|
+
* height: 3000,
|
|
47
|
+
* tileSize: 256,
|
|
48
|
+
* maxZoom: 5,
|
|
49
|
+
* minZoom: 0
|
|
50
|
+
* }
|
|
51
|
+
* };
|
|
52
|
+
*
|
|
53
|
+
* return (
|
|
54
|
+
* <EdgePDFViewer
|
|
55
|
+
* config={config}
|
|
56
|
+
* showZoomControls={true}
|
|
57
|
+
* zoomControlsPosition="top-right"
|
|
58
|
+
* >
|
|
59
|
+
* <MarkerControls />
|
|
60
|
+
* </EdgePDFViewer>
|
|
61
|
+
* );
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function EdgePDFViewer({ config, mapOptions, className, style, showZoomControls, zoomControlsPosition, showZoomLevel, enableAnnotation, defaultZoomLevel, onPinsUpdate, defaultPins, children, }: EdgePDFViewerProps): JSX.Element;
|
|
66
|
+
//# sourceMappingURL=pdf-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-viewer.d.ts","sourceRoot":"","sources":["../../src/lib/pdf-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qEAAqE;IACrE,oBAAoB,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACrD,+EAA+E;IAC/E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACpC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,gBAAuB,EACvB,oBAAkC,EAClC,aAAoB,EACpB,gBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,QAAQ,GACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAwClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-viewer.spec.d.ts","sourceRoot":"","sources":["../../src/lib/pdf-viewer.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Marker, MarkerData } from '@edgepdf/types';
|
|
2
|
+
import type { CreateMarkerOptions } from '@edgepdf/viewer-js';
|
|
3
|
+
/**
|
|
4
|
+
* Return type for useMarkers hook
|
|
5
|
+
*/
|
|
6
|
+
export interface UseMarkersReturn {
|
|
7
|
+
/** Current markers */
|
|
8
|
+
markers: Marker[];
|
|
9
|
+
/** Add a new marker */
|
|
10
|
+
addMarker: (options: CreateMarkerOptions) => Marker | null;
|
|
11
|
+
/** Remove a marker by ID */
|
|
12
|
+
removeMarker: (id: string) => boolean;
|
|
13
|
+
/** Update a marker */
|
|
14
|
+
updateMarker: (id: string, updates: Partial<Marker>) => boolean;
|
|
15
|
+
/** Get a marker by ID */
|
|
16
|
+
getMarker: (id: string) => Marker | null;
|
|
17
|
+
/** Get all markers */
|
|
18
|
+
getAllMarkers: () => Marker[];
|
|
19
|
+
/** Export markers as JSON */
|
|
20
|
+
exportMarkers: () => MarkerData;
|
|
21
|
+
/** Import markers from JSON */
|
|
22
|
+
importMarkers: (data: MarkerData) => boolean;
|
|
23
|
+
/** Clear all markers */
|
|
24
|
+
clearMarkers: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Hook to manage markers in the viewer
|
|
28
|
+
*
|
|
29
|
+
* Provides functions to add, remove, update, and manage markers.
|
|
30
|
+
*
|
|
31
|
+
* @returns Marker management functions and current markers
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* function MarkerControls() {
|
|
36
|
+
* const { markers, addMarker, removeMarker } = useMarkers();
|
|
37
|
+
*
|
|
38
|
+
* const handleAddMarker = () => {
|
|
39
|
+
* addMarker({
|
|
40
|
+
* position: [100, 200],
|
|
41
|
+
* x: 100,
|
|
42
|
+
* y: 200,
|
|
43
|
+
* zoom: 1,
|
|
44
|
+
* title: 'New Marker'
|
|
45
|
+
* });
|
|
46
|
+
* };
|
|
47
|
+
*
|
|
48
|
+
* return (
|
|
49
|
+
* <div>
|
|
50
|
+
* <button onClick={handleAddMarker}>Add Marker</button>
|
|
51
|
+
* {markers.map(marker => (
|
|
52
|
+
* <div key={marker.id}>
|
|
53
|
+
* {marker.title}
|
|
54
|
+
* <button onClick={() => removeMarker(marker.id)}>Remove</button>
|
|
55
|
+
* </div>
|
|
56
|
+
* ))}
|
|
57
|
+
* </div>
|
|
58
|
+
* );
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function useMarkers(): UseMarkersReturn;
|
|
63
|
+
//# sourceMappingURL=use-markers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-markers.d.ts","sourceRoot":"","sources":["../../src/lib/use-markers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,uBAAuB;IACvB,SAAS,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,MAAM,GAAG,IAAI,CAAC;IAC3D,4BAA4B;IAC5B,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC,sBAAsB;IACtB,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC;IAChE,yBAAyB;IACzB,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IACzC,sBAAsB;IACtB,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,6BAA6B;IAC7B,aAAa,EAAE,MAAM,UAAU,CAAC;IAChC,+BAA+B;IAC/B,aAAa,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IAC7C,wBAAwB;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,UAAU,IAAI,gBAAgB,CAkN7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-markers.spec.d.ts","sourceRoot":"","sources":["../../src/lib/use-markers.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { EdgePdfViewer } from '@edgepdf/viewer-js';
|
|
2
|
+
/**
|
|
3
|
+
* Return type for useViewer hook
|
|
4
|
+
*/
|
|
5
|
+
export interface UseViewerReturn {
|
|
6
|
+
/** Viewer instance */
|
|
7
|
+
viewer: EdgePdfViewer | null;
|
|
8
|
+
/** Whether viewer is initialized */
|
|
9
|
+
isInitialized: boolean;
|
|
10
|
+
/** Get the Leaflet map instance */
|
|
11
|
+
getMap: () => L.Map | null;
|
|
12
|
+
/** Check if viewer is initialized */
|
|
13
|
+
checkInitialized: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hook to access and interact with the viewer instance
|
|
17
|
+
*
|
|
18
|
+
* Provides access to the EdgePdfViewer instance and common viewer operations.
|
|
19
|
+
*
|
|
20
|
+
* @returns Viewer instance and utility functions
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* function MyComponent() {
|
|
25
|
+
* const { viewer, isInitialized, getMap } = useViewer();
|
|
26
|
+
*
|
|
27
|
+
* useEffect(() => {
|
|
28
|
+
* if (isInitialized && viewer) {
|
|
29
|
+
* const map = getMap();
|
|
30
|
+
* // Use map...
|
|
31
|
+
* }
|
|
32
|
+
* }, [isInitialized, viewer, getMap]);
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function useViewer(): UseViewerReturn;
|
|
37
|
+
//# sourceMappingURL=use-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-viewer.d.ts","sourceRoot":"","sources":["../../src/lib/use-viewer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sBAAsB;IACtB,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,oCAAoC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC;IAC3B,qCAAqC;IACrC,gBAAgB,EAAE,MAAM,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,IAAI,eAAe,CAiB3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-viewer.spec.d.ts","sourceRoot":"","sources":["../../src/lib/use-viewer.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ZoomState } from '@edgepdf/types';
|
|
2
|
+
/**
|
|
3
|
+
* Return type for useZoom hook
|
|
4
|
+
*/
|
|
5
|
+
export interface UseZoomReturn {
|
|
6
|
+
/** Current zoom state */
|
|
7
|
+
zoomState: ZoomState | null;
|
|
8
|
+
/** Current zoom level */
|
|
9
|
+
currentZoom: number;
|
|
10
|
+
/** Minimum zoom level */
|
|
11
|
+
minZoom: number;
|
|
12
|
+
/** Maximum zoom level */
|
|
13
|
+
maxZoom: number;
|
|
14
|
+
/** Zoom in */
|
|
15
|
+
zoomIn: () => void;
|
|
16
|
+
/** Zoom out */
|
|
17
|
+
zoomOut: () => void;
|
|
18
|
+
/** Set zoom level */
|
|
19
|
+
setZoom: (zoom: number) => void;
|
|
20
|
+
/** Check if can zoom in */
|
|
21
|
+
canZoomIn: () => boolean;
|
|
22
|
+
/** Check if can zoom out */
|
|
23
|
+
canZoomOut: () => boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook to manage zoom in the viewer
|
|
27
|
+
*
|
|
28
|
+
* Provides functions to control zoom level and access zoom state.
|
|
29
|
+
*
|
|
30
|
+
* @returns Zoom control functions and current zoom state
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* function ZoomControls() {
|
|
35
|
+
* const { zoomIn, zoomOut, currentZoom, canZoomIn, canZoomOut } = useZoom();
|
|
36
|
+
*
|
|
37
|
+
* return (
|
|
38
|
+
* <div>
|
|
39
|
+
* <button onClick={zoomOut} disabled={!canZoomOut()}>
|
|
40
|
+
* Zoom Out
|
|
41
|
+
* </button>
|
|
42
|
+
* <span>Zoom: {currentZoom}</span>
|
|
43
|
+
* <button onClick={zoomIn} disabled={!canZoomIn()}>
|
|
44
|
+
* Zoom In
|
|
45
|
+
* </button>
|
|
46
|
+
* </div>
|
|
47
|
+
* );
|
|
48
|
+
* }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function useZoom(): UseZoomReturn;
|
|
52
|
+
//# sourceMappingURL=use-zoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-zoom.d.ts","sourceRoot":"","sources":["../../src/lib/use-zoom.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,yBAAyB;IACzB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,yBAAyB;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc;IACd,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,eAAe;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qBAAqB;IACrB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,2BAA2B;IAC3B,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,OAAO,IAAI,aAAa,CA2IvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-zoom.spec.d.ts","sourceRoot":"","sources":["../../src/lib/use-zoom.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { EdgePdfViewer } from '@edgepdf/viewer-js';
|
|
3
|
+
import type { ViewerConfig, MapOptions, Marker, MarkerData, ZoomState } from '@edgepdf/types';
|
|
4
|
+
/**
|
|
5
|
+
* Viewer context value containing viewer instance and state
|
|
6
|
+
*/
|
|
7
|
+
export interface ViewerContextValue {
|
|
8
|
+
/** Viewer instance */
|
|
9
|
+
viewer: EdgePdfViewer | null;
|
|
10
|
+
/** Whether viewer is initialized */
|
|
11
|
+
isInitialized: boolean;
|
|
12
|
+
/** Current markers */
|
|
13
|
+
markers: Marker[];
|
|
14
|
+
/** Current zoom state */
|
|
15
|
+
zoomState: ZoomState | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Props for ViewerProvider
|
|
19
|
+
*/
|
|
20
|
+
export interface ViewerProviderProps {
|
|
21
|
+
/** Viewer configuration */
|
|
22
|
+
config: ViewerConfig;
|
|
23
|
+
/** Optional map options */
|
|
24
|
+
mapOptions?: MapOptions;
|
|
25
|
+
/** Enable annotation functionality (default: true) */
|
|
26
|
+
enableAnnotation?: boolean;
|
|
27
|
+
/** Callback when markers/pins are updated */
|
|
28
|
+
onPinsUpdate?: (pins: Marker[]) => void;
|
|
29
|
+
/** Default pins to preload (uses internal import) */
|
|
30
|
+
defaultPins?: Marker[] | MarkerData;
|
|
31
|
+
/** Children components */
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ViewerProvider - Provides viewer context to child components
|
|
36
|
+
*
|
|
37
|
+
* Manages the lifecycle of the EdgePdfViewer instance and provides it
|
|
38
|
+
* to child components through React context.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <ViewerProvider config={viewerConfig}>
|
|
43
|
+
* <EdgePDFViewer />
|
|
44
|
+
* </ViewerProvider>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function ViewerProvider({ config, mapOptions, enableAnnotation, onPinsUpdate, defaultPins, children, }: ViewerProviderProps): JSX.Element;
|
|
48
|
+
/**
|
|
49
|
+
* Hook to access viewer context
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error} If used outside ViewerProvider
|
|
52
|
+
* @returns Viewer context value
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* function MyComponent() {
|
|
57
|
+
* const { viewer, isInitialized } = useViewerContext();
|
|
58
|
+
* // Use viewer...
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function useViewerContext(): ViewerContextValue;
|
|
63
|
+
//# sourceMappingURL=viewer-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-context.d.ts","sourceRoot":"","sources":["../../src/lib/viewer-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,MAAM,EACN,UAAU,EACV,SAAS,EACV,MAAM,gBAAgB,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,oCAAoC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yBAAyB;IACzB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B;AAOD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,2BAA2B;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,sDAAsD;IACtD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACpC,0BAA0B;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,UAAU,EACV,gBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,QAAQ,GACT,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CA+OnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAMrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-context.spec.d.ts","sourceRoot":"","sources":["../../src/lib/viewer-context.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewer-react.d.ts","sourceRoot":"","sources":["../../src/lib/viewer-react.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for ZoomControls component
|
|
4
|
+
*/
|
|
5
|
+
export interface ZoomControlsProps {
|
|
6
|
+
/** Optional className for the container */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Optional style for the container */
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
/** Position of the controls */
|
|
11
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
12
|
+
/** Show zoom level display */
|
|
13
|
+
showZoomLevel?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ZoomControls - Built-in zoom controls component
|
|
17
|
+
*
|
|
18
|
+
* Provides zoom in/out buttons and optional zoom level display.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <EdgePDFViewer config={config}>
|
|
23
|
+
* <ZoomControls position="top-right" showZoomLevel />
|
|
24
|
+
* </EdgePDFViewer>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function ZoomControls({ className, style, position, showZoomLevel, }: ZoomControlsProps): JSX.Element;
|
|
28
|
+
//# sourceMappingURL=zoom-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-controls.d.ts","sourceRoot":"","sources":["../../src/lib/zoom-controls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACrE,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,KAAK,EACL,QAAsB,EACtB,aAAoB,GACrB,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA+EjC"}
|