@edgepdf/viewer-react 0.0.35 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 EdgePDF
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @edgepdf/viewer-react
2
2
 
3
- EdgePDF Viewer - React components for viewing PDF documents with interactive markers and zoom controls.
3
+ React components and hooks for the EdgePDF viewer. Provides a declarative, React-friendly API for viewing large PDF documents with interactive markers, annotations, and zoom controls.
4
4
 
5
5
  ## Installation
6
6
 
@@ -274,7 +274,7 @@ interface UseViewerReturn {
274
274
  viewer: EdgePdfViewer | null;
275
275
  /** Whether viewer is initialized */
276
276
  isInitialized: boolean;
277
- /** Get the Leaflet map instance */
277
+ /** Get the map instance */
278
278
  getMap: () => L.Map | null;
279
279
  /** Check if viewer is initialized */
280
280
  checkInitialized: () => boolean;
@@ -412,8 +412,9 @@ function MarkerControls() {
412
412
  - **`clearMarkers(): void`** - Removes all markers.
413
413
 
414
414
  - **`focusMarker(markerOrId: string | Marker, options?: FocusOptions): boolean`** - Focuses on a marker by panning and zooming. Returns `true` if successful, `false` otherwise.
415
-
415
+
416
416
  **Options:**
417
+
417
418
  - `zoom?: number` - Target zoom level (uses marker's zoom or default if not provided)
418
419
  - `animate?: boolean` - Whether to animate the transition (default: true)
419
420
  - `duration?: number` - Animation duration in seconds (default: 0.5)
@@ -421,8 +422,9 @@ function MarkerControls() {
421
422
  - `offsetRight?: number` - Pixel offset to move focus marker to the right (default: 0)
422
423
  - `offsetTop?: number` - Pixel offset to move focus marker upward (default: 0)
423
424
  - `offsetBottom?: number` - Pixel offset to move focus marker downward (default: 0)
424
-
425
+
425
426
  **Example:**
427
+
426
428
  ```tsx
427
429
  // Focus with offset to account for overlay
428
430
  focusMarker(markerId, { offsetLeft: 100, offsetTop: 50 });
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import './styles.css';
2
1
  export { EdgePDFViewer } from './lib/pdf-viewer.js';
3
2
  export type { EdgePDFViewerProps } from './lib/pdf-viewer.js';
4
3
  export { ZoomControls } from './lib/zoom-controls.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,YAAY,EACV,kBAAkB,EAClB,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