@edgepdf/viewer-react 0.0.25 → 0.0.27

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 CHANGED
@@ -19,51 +19,123 @@ yarn add @edgepdf/viewer-react @edgepdf/viewer-js
19
19
  In your Next.js application, you need to import the CSS file manually:
20
20
 
21
21
  **App Router (app directory):**
22
+
22
23
  ```tsx
23
- // app/layout.tsx or app/page.tsx
24
+ // app/layout.tsx
24
25
  import '@edgepdf/viewer-react/styles.css';
25
- import { EdgePDFViewer } from '@edgepdf/viewer-react';
26
+ import { ViewerProvider } from '@edgepdf/viewer-react';
27
+
28
+ export default function RootLayout({
29
+ children,
30
+ }: {
31
+ children: React.ReactNode;
32
+ }) {
33
+ return (
34
+ <html lang="en">
35
+ <body>
36
+ <ViewerProvider>{children}</ViewerProvider>
37
+ </body>
38
+ </html>
39
+ );
40
+ }
26
41
  ```
27
42
 
28
- **Pages Router:**
29
43
  ```tsx
30
- // pages/_app.tsx
31
- import '@edgepdf/viewer-react/styles.css';
32
-
33
- export default function App({ Component, pageProps }) {
34
- return <Component {...pageProps} />;
44
+ // app/page.tsx
45
+ import { EdgePDFViewer } from '@edgepdf/viewer-react';
46
+ import type { ViewerConfig } from '@edgepdf/types';
47
+
48
+ const config: ViewerConfig = {
49
+ tileUrl: 'https://example.com/tiles/{z}/{x}/{y}.png',
50
+ imageInfo: {
51
+ width: 2000,
52
+ height: 3000,
53
+ tileSize: 256,
54
+ maxZoom: 5,
55
+ minZoom: 0,
56
+ },
57
+ };
58
+
59
+ export default function Page() {
60
+ return <EdgePDFViewer config={config} />;
35
61
  }
36
62
  ```
37
63
 
38
- **Or in a specific page:**
64
+ **Pages Router:**
65
+
39
66
  ```tsx
40
67
  // pages/your-page.tsx
41
68
  import '@edgepdf/viewer-react/styles.css';
42
- import { EdgePDFViewer } from '@edgepdf/viewer-react';
69
+ import { ViewerProvider, EdgePDFViewer } from '@edgepdf/viewer-react';
70
+ import type { ViewerConfig } from '@edgepdf/types';
71
+
72
+ const config: ViewerConfig = {
73
+ tileUrl: 'https://example.com/tiles/{z}/{x}/{y}.png',
74
+ imageInfo: {
75
+ width: 2000,
76
+ height: 3000,
77
+ tileSize: 256,
78
+ maxZoom: 5,
79
+ minZoom: 0,
80
+ },
81
+ };
82
+
83
+ export default function Page() {
84
+ return (
85
+ <ViewerProvider>
86
+ <EdgePDFViewer config={config} />
87
+ </ViewerProvider>
88
+ );
89
+ }
43
90
  ```
44
91
 
45
92
  ### Other React Applications
46
93
 
47
94
  ```tsx
48
95
  import '@edgepdf/viewer-react/styles.css';
49
- import { EdgePDFViewer } from '@edgepdf/viewer-react';
96
+ import {
97
+ ViewerProvider,
98
+ EdgePDFViewer,
99
+ useMarkers,
100
+ useViewer,
101
+ } from '@edgepdf/viewer-react';
102
+ import type { ViewerConfig } from '@edgepdf/types';
103
+
104
+ const config: ViewerConfig = {
105
+ tileUrl: 'https://example.com/tiles/{z}/{x}/{y}.png',
106
+ imageInfo: {
107
+ width: 2000,
108
+ height: 3000,
109
+ tileSize: 256,
110
+ maxZoom: 5,
111
+ minZoom: 0,
112
+ },
113
+ };
114
+
115
+ function MarkerPanel() {
116
+ const { markers } = useMarkers();
117
+ const { viewer, isInitialized } = useViewer();
118
+
119
+ // You can interact with viewer + markers here,
120
+ // independent of where <EdgePDFViewer /> is rendered.
50
121
 
51
- function App() {
52
- const config = {
53
- tileUrl: 'https://example.com/tiles/{z}/{x}/{y}.png',
54
- imageInfo: {
55
- width: 2000,
56
- height: 3000,
57
- tileSize: 256,
58
- maxZoom: 5,
59
- minZoom: 0
60
- }
61
- };
122
+ return (
123
+ <div>
124
+ <div>Initialized: {isInitialized ? 'yes' : 'no'}</div>
125
+ <div>Total markers: {markers.length}</div>
126
+ </div>
127
+ );
128
+ }
62
129
 
130
+ function App() {
63
131
  return (
64
- <EdgePDFViewer config={config}>
65
- {/* Your components */}
66
- </EdgePDFViewer>
132
+ <ViewerProvider>
133
+ {/* This can be on one route/screen */}
134
+ <MarkerPanel />
135
+
136
+ {/* And EdgePDFViewer can be on another */}
137
+ <EdgePDFViewer config={config} />
138
+ </ViewerProvider>
67
139
  );
68
140
  }
69
141
  ```
package/dist/index.js CHANGED
@@ -1,11 +1,5 @@
1
- // packages/viewer-react/src/lib/viewer-context.tsx
2
- import {
3
- createContext,
4
- useContext,
5
- useEffect,
6
- useRef,
7
- useState
8
- } from "react";
1
+ // packages/viewer-react/src/lib/pdf-viewer.tsx
2
+ import { useEffect as useEffect2, useRef as useRef2 } from "react";
9
3
 
10
4
  // packages/viewer-js/dist/index.js
11
5
  var __create = Object.create;
@@ -11280,11 +11274,23 @@ var MarkerManager = class {
11280
11274
  */
11281
11275
  createCustomIcon(iconType) {
11282
11276
  const iconUrl = `${this.iconBasePath}${iconType}.png`;
11277
+ const getOffsetBasedOnIconType = (iconType2) => {
11278
+ if (iconType2 === "pin") {
11279
+ return [15, 40];
11280
+ }
11281
+ if (iconType2 === "pin-gray-selected" || iconType2 === "pin-yellow-selected") {
11282
+ return [16, 36];
11283
+ }
11284
+ if (iconType2 === "pin-gray" || iconType2 === "pin-yellow") {
11285
+ return [16, 36];
11286
+ }
11287
+ return [15, 40];
11288
+ };
11283
11289
  return import_leaflet3.default.icon({
11284
11290
  iconUrl,
11285
11291
  iconSize: [30, 40],
11286
11292
  // Default marker size
11287
- iconAnchor: [30, 10],
11293
+ iconAnchor: getOffsetBasedOnIconType(iconType),
11288
11294
  // Point of the icon which will correspond to marker's location
11289
11295
  popupAnchor: [0, 0],
11290
11296
  // Point from which the popup should open relative to the iconAnchor
@@ -11319,7 +11325,7 @@ var MarkerManager = class {
11319
11325
  leafletMarker.bindTooltip(marker.label, {
11320
11326
  permanent: false,
11321
11327
  direction: "top",
11322
- offset: [-13, -10],
11328
+ offset: [0, -40],
11323
11329
  className: "edgepdf-marker-tooltip"
11324
11330
  });
11325
11331
  }
@@ -11415,8 +11421,8 @@ var MarkerManager = class {
11415
11421
  }
11416
11422
  const overlaySize = 40;
11417
11423
  const borderWidth = 1;
11418
- const overlayAnchorX = 35;
11419
- const overlayAnchorY = 10;
11424
+ const overlayAnchorX = 20;
11425
+ const overlayAnchorY = 40;
11420
11426
  const overlayHTML = `
11421
11427
  <div style="
11422
11428
  width: ${overlaySize}px;
@@ -12397,14 +12403,104 @@ var EdgePdfViewer = class {
12397
12403
  };
12398
12404
 
12399
12405
  // packages/viewer-react/src/lib/viewer-context.tsx
12400
- import { jsx, jsxs } from "react/jsx-runtime";
12406
+ import {
12407
+ createContext,
12408
+ useCallback,
12409
+ useContext,
12410
+ useState
12411
+ } from "react";
12412
+ import { jsx } from "react/jsx-runtime";
12401
12413
  var ViewerContext = createContext(null);
12402
- function ViewerProvider({
12414
+ function ViewerProvider({ children }) {
12415
+ const [viewer, setViewer] = useState(null);
12416
+ const [isInitialized, setIsInitialized] = useState(false);
12417
+ const [markers, setMarkers] = useState([]);
12418
+ const [zoomState, setZoomState] = useState(null);
12419
+ const setContextValue = useCallback(
12420
+ (updates) => {
12421
+ if (updates.viewer !== void 0) {
12422
+ setViewer(updates.viewer);
12423
+ }
12424
+ if (updates.isInitialized !== void 0) {
12425
+ setIsInitialized(updates.isInitialized);
12426
+ }
12427
+ if (updates.markers !== void 0) {
12428
+ setMarkers(updates.markers);
12429
+ }
12430
+ if (updates.zoomState !== void 0) {
12431
+ setZoomState(updates.zoomState);
12432
+ }
12433
+ },
12434
+ []
12435
+ );
12436
+ const contextValue = {
12437
+ viewer,
12438
+ isInitialized,
12439
+ markers,
12440
+ zoomState,
12441
+ setContextValue
12442
+ };
12443
+ return /* @__PURE__ */ jsx(ViewerContext.Provider, { value: contextValue, children });
12444
+ }
12445
+ function useViewerContext() {
12446
+ const context = useContext(ViewerContext);
12447
+ if (!context) {
12448
+ throw new Error("useViewerContext must be used within ViewerProvider");
12449
+ }
12450
+ return context;
12451
+ }
12452
+
12453
+ // packages/viewer-react/src/lib/zoom-controls.tsx
12454
+ import { useEffect, useRef } from "react";
12455
+ function ZoomControls({
12456
+ className,
12457
+ style,
12458
+ position = "top-right",
12459
+ showZoomLevel = true
12460
+ }) {
12461
+ const { viewer, isInitialized } = useViewerContext();
12462
+ const controlsRef = useRef(null);
12463
+ useEffect(() => {
12464
+ if (!viewer || !isInitialized) {
12465
+ return;
12466
+ }
12467
+ const map = viewer.getMap();
12468
+ const zoomController = viewer.getZoomController();
12469
+ if (!map || !zoomController) {
12470
+ return;
12471
+ }
12472
+ const container = map.getContainer();
12473
+ const controlsElement = createZoomControls(container, zoomController, {
12474
+ position
12475
+ });
12476
+ controlsRef.current = controlsElement;
12477
+ if (className) {
12478
+ controlsElement.className = `${controlsElement.className} ${className}`;
12479
+ }
12480
+ if (style) {
12481
+ Object.assign(controlsElement.style, style);
12482
+ }
12483
+ return () => {
12484
+ controlsRef.current = null;
12485
+ };
12486
+ }, [viewer, isInitialized, className, style, position]);
12487
+ return null;
12488
+ }
12489
+
12490
+ // packages/viewer-react/src/lib/pdf-viewer.tsx
12491
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
12492
+ function EdgePDFViewer({
12403
12493
  config,
12404
12494
  mapOptions,
12495
+ className,
12496
+ style,
12497
+ showZoomControls = true,
12498
+ zoomControlsPosition = "top-right",
12499
+ showZoomLevel = true,
12405
12500
  enableAnnotation = true,
12406
12501
  showEditButton = true,
12407
12502
  showDeleteButton = true,
12503
+ defaultZoomLevel,
12408
12504
  onPinsUpdate,
12409
12505
  onMarkerClick,
12410
12506
  onMarkerUpdate,
@@ -12413,45 +12509,52 @@ function ViewerProvider({
12413
12509
  defaultPins,
12414
12510
  children
12415
12511
  }) {
12416
- const [viewer, setViewer] = useState(null);
12417
- const [isInitialized, setIsInitialized] = useState(false);
12418
- const [markers, setMarkers] = useState([]);
12419
- const [zoomState, setZoomState] = useState(null);
12420
- const containerRef = useRef(null);
12421
- const onPinsUpdateRef = useRef(onPinsUpdate);
12422
- const onMarkerClickRef = useRef(onMarkerClick);
12423
- const onMarkerUpdateRef = useRef(onMarkerUpdate);
12424
- const onMarkerDeleteRef = useRef(onMarkerDelete);
12425
- const onMarkerAddRef = useRef(onMarkerAdd);
12426
- useEffect(() => {
12512
+ const { setContextValue } = useViewerContext();
12513
+ const containerRef = useRef2(null);
12514
+ const viewerRef = useRef2(null);
12515
+ const onPinsUpdateRef = useRef2(onPinsUpdate);
12516
+ const onMarkerClickRef = useRef2(onMarkerClick);
12517
+ const onMarkerUpdateRef = useRef2(onMarkerUpdate);
12518
+ const onMarkerDeleteRef = useRef2(onMarkerDelete);
12519
+ const onMarkerAddRef = useRef2(onMarkerAdd);
12520
+ useEffect2(() => {
12427
12521
  onPinsUpdateRef.current = onPinsUpdate;
12428
12522
  }, [onPinsUpdate]);
12429
- useEffect(() => {
12523
+ useEffect2(() => {
12430
12524
  onMarkerClickRef.current = onMarkerClick;
12431
12525
  }, [onMarkerClick]);
12432
- useEffect(() => {
12526
+ useEffect2(() => {
12433
12527
  onMarkerUpdateRef.current = onMarkerUpdate;
12434
12528
  }, [onMarkerUpdate]);
12435
- useEffect(() => {
12529
+ useEffect2(() => {
12436
12530
  onMarkerDeleteRef.current = onMarkerDelete;
12437
12531
  }, [onMarkerDelete]);
12438
- useEffect(() => {
12532
+ useEffect2(() => {
12439
12533
  onMarkerAddRef.current = onMarkerAdd;
12440
12534
  }, [onMarkerAdd]);
12441
- useEffect(() => {
12442
- if (!containerRef.current || viewer) {
12535
+ const finalConfig = {
12536
+ ...config,
12537
+ // Remove onPinsUpdate from config if it exists, as it will be handled at prop level
12538
+ onPinsUpdate: void 0
12539
+ };
12540
+ const finalMapOptions = defaultZoomLevel ? { ...mapOptions, zoom: defaultZoomLevel } : mapOptions;
12541
+ useEffect2(() => {
12542
+ if (!containerRef.current || viewerRef.current) {
12443
12543
  return;
12444
12544
  }
12445
12545
  let viewerInstance = null;
12446
12546
  try {
12447
12547
  viewerInstance = new EdgePdfViewer({
12448
12548
  container: containerRef.current,
12449
- config,
12450
- mapOptions
12549
+ config: finalConfig,
12550
+ mapOptions: finalMapOptions
12451
12551
  });
12452
12552
  viewerInstance.initialize();
12453
- setViewer(viewerInstance);
12454
- setIsInitialized(true);
12553
+ viewerRef.current = viewerInstance;
12554
+ setContextValue({
12555
+ viewer: viewerInstance,
12556
+ isInitialized: true
12557
+ });
12455
12558
  const markerManager = viewerInstance.getMarkerManager();
12456
12559
  if (markerManager) {
12457
12560
  markerManager.setIconBasePath("/");
@@ -12484,14 +12587,15 @@ function ViewerProvider({
12484
12587
  }
12485
12588
  }
12486
12589
  const allMarkers = markerManager.getAllMarkers();
12487
- setMarkers(allMarkers);
12590
+ setContextValue({ markers: allMarkers });
12488
12591
  if (onPinsUpdateRef.current) {
12489
12592
  onPinsUpdateRef.current(allMarkers);
12490
12593
  }
12491
12594
  }
12492
12595
  const zoomController = viewerInstance.getZoomController();
12493
12596
  if (zoomController) {
12494
- setZoomState(zoomController.getZoomState());
12597
+ const zoomState = zoomController.getZoomState();
12598
+ setContextValue({ zoomState });
12495
12599
  }
12496
12600
  } catch (error) {
12497
12601
  console.error("Failed to initialize viewer:", error);
@@ -12500,14 +12604,21 @@ function ViewerProvider({
12500
12604
  if (viewerInstance) {
12501
12605
  viewerInstance.dispose();
12502
12606
  viewerInstance = null;
12607
+ viewerRef.current = null;
12608
+ setContextValue({
12609
+ viewer: null,
12610
+ isInitialized: false,
12611
+ markers: [],
12612
+ zoomState: null
12613
+ });
12503
12614
  }
12504
12615
  };
12505
12616
  }, []);
12506
- useEffect(() => {
12507
- if (!viewer || !isInitialized) {
12617
+ useEffect2(() => {
12618
+ if (!viewerRef.current) {
12508
12619
  return;
12509
12620
  }
12510
- const markerManager = viewer.getMarkerManager();
12621
+ const markerManager = viewerRef.current.getMarkerManager();
12511
12622
  if (markerManager) {
12512
12623
  markerManager.setInteractionConfig({
12513
12624
  draggable: enableAnnotation,
@@ -12522,22 +12633,16 @@ function ViewerProvider({
12522
12633
  // Show delete only if both enabled
12523
12634
  });
12524
12635
  }
12525
- }, [
12526
- viewer,
12527
- isInitialized,
12528
- enableAnnotation,
12529
- showEditButton,
12530
- showDeleteButton
12531
- ]);
12532
- useEffect(() => {
12533
- if (!viewer || !isInitialized) {
12636
+ }, [enableAnnotation, showEditButton, showDeleteButton, setContextValue]);
12637
+ useEffect2(() => {
12638
+ if (!viewerRef.current) {
12534
12639
  return;
12535
12640
  }
12536
- const map = viewer.getMap();
12641
+ const map = viewerRef.current.getMap();
12537
12642
  if (!map) {
12538
12643
  return;
12539
12644
  }
12540
- const markerManager = viewer.getMarkerManager();
12645
+ const markerManager = viewerRef.current.getMarkerManager();
12541
12646
  if (!markerManager) {
12542
12647
  return;
12543
12648
  }
@@ -12552,7 +12657,7 @@ function ViewerProvider({
12552
12657
  label: `Marker ${markerManager.getMarkerCount() + 1}`
12553
12658
  });
12554
12659
  const allMarkers = markerManager.getAllMarkers();
12555
- setMarkers(allMarkers);
12660
+ setContextValue({ markers: allMarkers });
12556
12661
  if (onMarkerAddRef.current) {
12557
12662
  onMarkerAddRef.current(newMarker);
12558
12663
  }
@@ -12568,12 +12673,12 @@ function ViewerProvider({
12568
12673
  return () => {
12569
12674
  map.off("click", handleMapClick);
12570
12675
  };
12571
- }, [viewer, isInitialized, enableAnnotation]);
12572
- useEffect(() => {
12573
- if (!viewer || !isInitialized) {
12676
+ }, [enableAnnotation, setContextValue]);
12677
+ useEffect2(() => {
12678
+ if (!viewerRef.current) {
12574
12679
  return;
12575
12680
  }
12576
- const markerManager = viewer.getMarkerManager();
12681
+ const markerManager = viewerRef.current.getMarkerManager();
12577
12682
  if (!markerManager) {
12578
12683
  return;
12579
12684
  }
@@ -12585,12 +12690,12 @@ function ViewerProvider({
12585
12690
  return () => {
12586
12691
  unsubscribeClick();
12587
12692
  };
12588
- }, [viewer, isInitialized]);
12589
- useEffect(() => {
12590
- if (!viewer || !isInitialized) {
12693
+ }, [setContextValue]);
12694
+ useEffect2(() => {
12695
+ if (!viewerRef.current) {
12591
12696
  return;
12592
12697
  }
12593
- const markerManager = viewer.getMarkerManager();
12698
+ const markerManager = viewerRef.current.getMarkerManager();
12594
12699
  if (!markerManager) {
12595
12700
  return;
12596
12701
  }
@@ -12602,12 +12707,12 @@ function ViewerProvider({
12602
12707
  return () => {
12603
12708
  unsubscribeEdit();
12604
12709
  };
12605
- }, [viewer, isInitialized]);
12606
- useEffect(() => {
12607
- if (!viewer || !isInitialized) {
12710
+ }, [setContextValue]);
12711
+ useEffect2(() => {
12712
+ if (!viewerRef.current) {
12608
12713
  return;
12609
12714
  }
12610
- const markerManager = viewer.getMarkerManager();
12715
+ const markerManager = viewerRef.current.getMarkerManager();
12611
12716
  if (!markerManager) {
12612
12717
  return;
12613
12718
  }
@@ -12619,26 +12724,21 @@ function ViewerProvider({
12619
12724
  return () => {
12620
12725
  unsubscribeDelete();
12621
12726
  };
12622
- }, [viewer, isInitialized]);
12623
- useEffect(() => {
12624
- if (!viewer || !isInitialized) {
12727
+ }, [setContextValue]);
12728
+ useEffect2(() => {
12729
+ if (!viewerRef.current) {
12625
12730
  return;
12626
12731
  }
12627
- const markerManager = viewer.getMarkerManager();
12732
+ const markerManager = viewerRef.current.getMarkerManager();
12628
12733
  if (!markerManager) {
12629
12734
  return;
12630
12735
  }
12631
12736
  const updateMarkers = () => {
12632
12737
  const allMarkers = markerManager.getAllMarkers();
12633
- setMarkers((prevMarkers) => {
12634
- const hasChanged = allMarkers.length !== prevMarkers.length || allMarkers.some((m, i) => m.id !== prevMarkers[i]?.id) || allMarkers.some(
12635
- (m) => JSON.stringify(m) !== JSON.stringify(prevMarkers.find((pm) => pm.id === m.id))
12636
- );
12637
- if (hasChanged && onPinsUpdateRef.current) {
12638
- onPinsUpdateRef.current(allMarkers);
12639
- }
12640
- return hasChanged ? allMarkers : prevMarkers;
12641
- });
12738
+ setContextValue({ markers: allMarkers });
12739
+ if (onPinsUpdateRef.current) {
12740
+ onPinsUpdateRef.current(allMarkers);
12741
+ }
12642
12742
  };
12643
12743
  const unsubscribeDelete = markerManager.on("delete", updateMarkers);
12644
12744
  const unsubscribeDragend = markerManager.on("dragend", updateMarkers);
@@ -12650,92 +12750,28 @@ function ViewerProvider({
12650
12750
  unsubscribeEdit();
12651
12751
  clearInterval(interval);
12652
12752
  };
12653
- }, [viewer, isInitialized]);
12654
- const contextValue = {
12655
- viewer,
12656
- isInitialized,
12657
- markers,
12658
- zoomState
12659
- };
12660
- return /* @__PURE__ */ jsx(ViewerContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
12661
- /* @__PURE__ */ jsx("div", { ref: containerRef, style: { width: "100%", height: "100%" } }),
12662
- children
12663
- ] }) });
12664
- }
12665
- function useViewerContext() {
12666
- const context = useContext(ViewerContext);
12667
- if (!context) {
12668
- throw new Error("useViewerContext must be used within ViewerProvider");
12669
- }
12670
- return context;
12671
- }
12672
-
12673
- // packages/viewer-react/src/lib/zoom-controls.tsx
12674
- import { useEffect as useEffect2, useRef as useRef2 } from "react";
12675
- function ZoomControls({
12676
- className,
12677
- style,
12678
- position = "top-right",
12679
- showZoomLevel = true
12680
- }) {
12681
- const { viewer, isInitialized } = useViewerContext();
12682
- const controlsRef = useRef2(null);
12753
+ }, [setContextValue]);
12683
12754
  useEffect2(() => {
12684
- if (!viewer || !isInitialized) {
12755
+ if (!viewerRef.current) {
12685
12756
  return;
12686
12757
  }
12687
- const map = viewer.getMap();
12688
- const zoomController = viewer.getZoomController();
12689
- if (!map || !zoomController) {
12758
+ const map = viewerRef.current.getMap();
12759
+ if (!map) {
12690
12760
  return;
12691
12761
  }
12692
- const container = map.getContainer();
12693
- const controlsElement = createZoomControls(container, zoomController, {
12694
- position
12695
- });
12696
- controlsRef.current = controlsElement;
12697
- if (className) {
12698
- controlsElement.className = `${controlsElement.className} ${className}`;
12699
- }
12700
- if (style) {
12701
- Object.assign(controlsElement.style, style);
12702
- }
12762
+ const updateZoomState = () => {
12763
+ const zoomController = viewerRef.current?.getZoomController();
12764
+ if (zoomController) {
12765
+ const zoomState = zoomController.getZoomState();
12766
+ setContextValue({ zoomState });
12767
+ }
12768
+ };
12769
+ map.on("zoomend", updateZoomState);
12703
12770
  return () => {
12704
- controlsRef.current = null;
12771
+ map.off("zoomend", updateZoomState);
12705
12772
  };
12706
- }, [viewer, isInitialized, className, style, position]);
12707
- return null;
12708
- }
12709
-
12710
- // packages/viewer-react/src/lib/pdf-viewer.tsx
12711
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
12712
- function EdgePDFViewer({
12713
- config,
12714
- mapOptions,
12715
- className,
12716
- style,
12717
- showZoomControls = true,
12718
- zoomControlsPosition = "top-right",
12719
- showZoomLevel = true,
12720
- enableAnnotation = true,
12721
- showEditButton = true,
12722
- showDeleteButton = true,
12723
- defaultZoomLevel,
12724
- onPinsUpdate,
12725
- onMarkerClick,
12726
- onMarkerUpdate,
12727
- onMarkerDelete,
12728
- onMarkerAdd,
12729
- defaultPins,
12730
- children
12731
- }) {
12732
- const finalConfig = {
12733
- ...config,
12734
- // Remove onPinsUpdate from config if it exists, as it will be handled at prop level
12735
- onPinsUpdate: void 0
12736
- };
12737
- const finalMapOptions = defaultZoomLevel ? { ...mapOptions, zoom: defaultZoomLevel } : mapOptions;
12738
- return /* @__PURE__ */ jsx2(
12773
+ }, [setContextValue]);
12774
+ return /* @__PURE__ */ jsxs(
12739
12775
  "div",
12740
12776
  {
12741
12777
  className,
@@ -12745,44 +12781,29 @@ function EdgePDFViewer({
12745
12781
  position: "relative",
12746
12782
  ...style
12747
12783
  },
12748
- children: /* @__PURE__ */ jsxs2(
12749
- ViewerProvider,
12750
- {
12751
- config: finalConfig,
12752
- mapOptions: finalMapOptions,
12753
- enableAnnotation,
12754
- showEditButton,
12755
- showDeleteButton,
12756
- onPinsUpdate,
12757
- onMarkerClick,
12758
- onMarkerUpdate,
12759
- onMarkerDelete,
12760
- onMarkerAdd,
12761
- defaultPins,
12762
- children: [
12763
- showZoomControls && /* @__PURE__ */ jsx2(
12764
- ZoomControls,
12765
- {
12766
- position: zoomControlsPosition,
12767
- showZoomLevel
12768
- }
12769
- ),
12770
- children
12771
- ]
12772
- }
12773
- )
12784
+ children: [
12785
+ /* @__PURE__ */ jsx2("div", { ref: containerRef, style: { width: "100%", height: "100%" } }),
12786
+ showZoomControls && /* @__PURE__ */ jsx2(
12787
+ ZoomControls,
12788
+ {
12789
+ position: zoomControlsPosition,
12790
+ showZoomLevel
12791
+ }
12792
+ ),
12793
+ children
12794
+ ]
12774
12795
  }
12775
12796
  );
12776
12797
  }
12777
12798
 
12778
12799
  // packages/viewer-react/src/lib/use-viewer.ts
12779
- import { useCallback } from "react";
12800
+ import { useCallback as useCallback2 } from "react";
12780
12801
  function useViewer() {
12781
12802
  const { viewer, isInitialized } = useViewerContext();
12782
- const getMap = useCallback(() => {
12803
+ const getMap = useCallback2(() => {
12783
12804
  return viewer?.getMap() ?? null;
12784
12805
  }, [viewer]);
12785
- const checkInitialized = useCallback(() => {
12806
+ const checkInitialized = useCallback2(() => {
12786
12807
  return viewer?.isInitialized() ?? false;
12787
12808
  }, [viewer]);
12788
12809
  return {
@@ -12794,7 +12815,7 @@ function useViewer() {
12794
12815
  }
12795
12816
 
12796
12817
  // packages/viewer-react/src/lib/use-markers.ts
12797
- import { useCallback as useCallback2, useEffect as useEffect3, useState as useState2 } from "react";
12818
+ import { useCallback as useCallback3, useEffect as useEffect3, useState as useState2 } from "react";
12798
12819
  function useMarkers() {
12799
12820
  const { viewer, isInitialized, markers: contextMarkers } = useViewerContext();
12800
12821
  const [markers, setMarkers] = useState2(contextMarkers);
@@ -12811,7 +12832,7 @@ function useMarkers() {
12811
12832
  setMarkers(allMarkers);
12812
12833
  }
12813
12834
  }, [viewer, isInitialized]);
12814
- const addMarker = useCallback2(
12835
+ const addMarker = useCallback3(
12815
12836
  (options) => {
12816
12837
  if (!viewer || !isInitialized) {
12817
12838
  console.warn("Viewer not initialized");
@@ -12834,7 +12855,7 @@ function useMarkers() {
12834
12855
  },
12835
12856
  [viewer, isInitialized]
12836
12857
  );
12837
- const removeMarker = useCallback2(
12858
+ const removeMarker = useCallback3(
12838
12859
  (id) => {
12839
12860
  if (!viewer || !isInitialized) {
12840
12861
  console.warn("Viewer not initialized");
@@ -12859,7 +12880,7 @@ function useMarkers() {
12859
12880
  },
12860
12881
  [viewer, isInitialized]
12861
12882
  );
12862
- const updateMarker = useCallback2(
12883
+ const updateMarker = useCallback3(
12863
12884
  (id, updates) => {
12864
12885
  if (!viewer || !isInitialized) {
12865
12886
  console.warn("Viewer not initialized");
@@ -12889,7 +12910,7 @@ function useMarkers() {
12889
12910
  },
12890
12911
  [viewer, isInitialized]
12891
12912
  );
12892
- const getMarker = useCallback2(
12913
+ const getMarker = useCallback3(
12893
12914
  (id) => {
12894
12915
  if (!viewer || !isInitialized) {
12895
12916
  return null;
@@ -12902,10 +12923,10 @@ function useMarkers() {
12902
12923
  },
12903
12924
  [viewer, isInitialized]
12904
12925
  );
12905
- const getAllMarkers = useCallback2(() => {
12926
+ const getAllMarkers = useCallback3(() => {
12906
12927
  return markers;
12907
12928
  }, [markers]);
12908
- const exportMarkers = useCallback2(() => {
12929
+ const exportMarkers = useCallback3(() => {
12909
12930
  if (!viewer || !isInitialized) {
12910
12931
  return { markers: [], version: "1.0" };
12911
12932
  }
@@ -12920,7 +12941,7 @@ function useMarkers() {
12920
12941
  return { markers: [], version: "1.0" };
12921
12942
  }
12922
12943
  }, [viewer, isInitialized]);
12923
- const importMarkers = useCallback2(
12944
+ const importMarkers = useCallback3(
12924
12945
  (data) => {
12925
12946
  if (!viewer || !isInitialized) {
12926
12947
  console.warn("Viewer not initialized");
@@ -12945,7 +12966,7 @@ function useMarkers() {
12945
12966
  },
12946
12967
  [viewer, isInitialized]
12947
12968
  );
12948
- const clearMarkers = useCallback2(() => {
12969
+ const clearMarkers = useCallback3(() => {
12949
12970
  if (!viewer || !isInitialized) {
12950
12971
  console.warn("Viewer not initialized");
12951
12972
  return;
@@ -12979,7 +13000,7 @@ function useMarkers() {
12979
13000
  }
12980
13001
 
12981
13002
  // packages/viewer-react/src/lib/use-zoom.ts
12982
- import { useCallback as useCallback3, useEffect as useEffect4, useState as useState3 } from "react";
13003
+ import { useCallback as useCallback4, useEffect as useEffect4, useState as useState3 } from "react";
12983
13004
  function useZoom() {
12984
13005
  const { viewer, isInitialized, zoomState: contextZoomState } = useViewerContext();
12985
13006
  const [zoomState, setZoomState] = useState3(contextZoomState);
@@ -13016,7 +13037,7 @@ function useZoom() {
13016
13037
  map.off("zoomend", updateZoomState);
13017
13038
  };
13018
13039
  }, [viewer, isInitialized]);
13019
- const zoomIn = useCallback3(() => {
13040
+ const zoomIn = useCallback4(() => {
13020
13041
  if (!viewer || !isInitialized) {
13021
13042
  console.warn("Viewer not initialized");
13022
13043
  return;
@@ -13034,7 +13055,7 @@ function useZoom() {
13034
13055
  console.error("Failed to zoom in:", error);
13035
13056
  }
13036
13057
  }, [viewer, isInitialized]);
13037
- const zoomOut = useCallback3(() => {
13058
+ const zoomOut = useCallback4(() => {
13038
13059
  if (!viewer || !isInitialized) {
13039
13060
  console.warn("Viewer not initialized");
13040
13061
  return;
@@ -13052,7 +13073,7 @@ function useZoom() {
13052
13073
  console.error("Failed to zoom out:", error);
13053
13074
  }
13054
13075
  }, [viewer, isInitialized]);
13055
- const setZoom = useCallback3(
13076
+ const setZoom = useCallback4(
13056
13077
  (zoom) => {
13057
13078
  if (!viewer || !isInitialized) {
13058
13079
  console.warn("Viewer not initialized");
@@ -13073,13 +13094,13 @@ function useZoom() {
13073
13094
  },
13074
13095
  [viewer, isInitialized]
13075
13096
  );
13076
- const canZoomIn = useCallback3(() => {
13097
+ const canZoomIn = useCallback4(() => {
13077
13098
  if (!zoomState) {
13078
13099
  return false;
13079
13100
  }
13080
13101
  return zoomState.currentZoom < zoomState.maxZoom;
13081
13102
  }, [zoomState]);
13082
- const canZoomOut = useCallback3(() => {
13103
+ const canZoomOut = useCallback4(() => {
13083
13104
  if (!zoomState) {
13084
13105
  return false;
13085
13106
  }
@@ -45,33 +45,19 @@ export interface EdgePDFViewerProps {
45
45
  /**
46
46
  * EdgePDFViewer - Main React component for the EdgePDF viewer
47
47
  *
48
- * This component wraps the viewer functionality in a React component,
49
- * providing the ViewerProvider context to child components.
48
+ * This component initializes the viewer and updates the context.
49
+ * Must be used within a ViewerProvider.
50
50
  *
51
51
  * @example
52
52
  * ```tsx
53
- * function App() {
54
- * const config: ViewerConfig = {
55
- * tileUrl: 'https://example.com/tiles/{z}/{x}/{y}.png',
56
- * imageInfo: {
57
- * width: 2000,
58
- * height: 3000,
59
- * tileSize: 256,
60
- * maxZoom: 5,
61
- * minZoom: 0
62
- * }
63
- * };
64
- *
65
- * return (
66
- * <EdgePDFViewer
67
- * config={config}
68
- * showZoomControls={true}
69
- * zoomControlsPosition="top-right"
70
- * >
71
- * <MarkerControls />
72
- * </EdgePDFViewer>
73
- * );
74
- * }
53
+ * <ViewerProvider>
54
+ * <App />
55
+ * <EdgePDFViewer
56
+ * config={config}
57
+ * showZoomControls={true}
58
+ * zoomControlsPosition="top-right"
59
+ * />
60
+ * </ViewerProvider>
75
61
  * ```
76
62
  */
77
63
  export declare function EdgePDFViewer({ config, mapOptions, className, style, showZoomControls, zoomControlsPosition, showZoomLevel, enableAnnotation, showEditButton, showDeleteButton, defaultZoomLevel, onPinsUpdate, onMarkerClick, onMarkerUpdate, onMarkerDelete, onMarkerAdd, defaultPins, children, }: EdgePDFViewerProps): JSX.Element;
@@ -1 +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,EACV,YAAY,EACZ,UAAU,EACV,MAAM,EACN,UAAU,EACX,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D;;GAEG;AACH,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IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACxC,wCAAwC;IACxC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,wCAAwC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,wCAAwC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,kEAAkE;IAClE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IACpC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,UAAU,EACV,SAAS,EACT,KAAK,EACL,gBAAuB,EACvB,oBAAkC,EAClC,aAAoB,EACpB,gBAAuB,EACvB,cAAqB,EACrB,gBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,WAAW,EACX,QAAQ,GACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CA6XlC"}
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { EdgePdfViewer } from '@edgepdf/viewer-js';
3
- import type { ViewerConfig, MapOptions, Marker, MarkerData, ZoomState } from '@edgepdf/types';
3
+ import type { Marker, ZoomState } from '@edgepdf/types';
4
4
  /**
5
5
  * Viewer context value containing viewer instance and state
6
6
  */
@@ -13,50 +13,30 @@ export interface ViewerContextValue {
13
13
  markers: Marker[];
14
14
  /** Current zoom state */
15
15
  zoomState: ZoomState | null;
16
+ /** Internal: Function to update context value (used by EdgePDFViewer) */
17
+ setContextValue: (updates: Partial<Omit<ViewerContextValue, 'setContextValue'>>) => void;
16
18
  }
17
19
  /**
18
20
  * Props for ViewerProvider
19
21
  */
20
22
  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
- /** Show edit button in marker action controls (default: true) */
28
- showEditButton?: boolean;
29
- /** Show delete button in marker action controls (default: true) */
30
- showDeleteButton?: boolean;
31
- /** Callback when markers/pins are updated */
32
- onPinsUpdate?: (pins: Marker[]) => void;
33
- /** Callback when a marker is clicked */
34
- onMarkerClick?: (marker: Marker) => void;
35
- /** Callback when a marker is updated */
36
- onMarkerUpdate?: (marker: Marker) => void;
37
- /** Callback when a marker is deleted */
38
- onMarkerDelete?: (marker: Marker) => void;
39
- /** Callback when a marker is added (created by user tap/click) */
40
- onMarkerAdd?: (marker: Marker) => void;
41
- /** Default pins to preload (uses internal import) */
42
- defaultPins?: Marker[] | MarkerData;
43
23
  /** Children components */
44
24
  children: ReactNode;
45
25
  }
46
26
  /**
47
27
  * ViewerProvider - Provides viewer context to child components
48
28
  *
49
- * Manages the lifecycle of the EdgePdfViewer instance and provides it
50
- * to child components through React context.
29
+ * Provides an empty context that can be updated by EdgePDFViewer.
30
+ * This allows hooks to be used anywhere within the provider tree.
51
31
  *
52
32
  * @example
53
33
  * ```tsx
54
- * <ViewerProvider config={viewerConfig}>
55
- * <EdgePDFViewer />
34
+ * <ViewerProvider>
35
+ * <App />
56
36
  * </ViewerProvider>
57
37
  * ```
58
38
  */
59
- export declare function ViewerProvider({ config, mapOptions, enableAnnotation, showEditButton, showDeleteButton, onPinsUpdate, onMarkerClick, onMarkerUpdate, onMarkerDelete, onMarkerAdd, defaultPins, children, }: ViewerProviderProps): JSX.Element;
39
+ export declare function ViewerProvider({ children }: ViewerProviderProps): JSX.Element;
60
40
  /**
61
41
  * Hook to access viewer context
62
42
  *
@@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C,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAsC7E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAMrD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgepdf/viewer-react",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "description": "EdgePDF Viewer - React components for viewing PDF documents with interactive markers and zoom controls",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",