@edgepdf/viewer-react 0.0.1 → 0.0.3

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.js CHANGED
@@ -1,3 +1,4 @@
1
+ import '@edgepdf/viewer-js/styles.css';
1
2
  // packages/viewer-react/src/lib/viewer-context.tsx
2
3
  import {
3
4
  createContext,
@@ -10574,6 +10575,8 @@ var MarkerManager = class {
10574
10575
  showEditButton: true,
10575
10576
  showDeleteButton: true
10576
10577
  };
10578
+ defaultIconType = "pin";
10579
+ iconBasePath = "/";
10577
10580
  /**
10578
10581
  * Creates a new MarkerManager instance
10579
10582
  *
@@ -10660,7 +10663,8 @@ var MarkerManager = class {
10660
10663
  annotation: options.annotation,
10661
10664
  href: options.href,
10662
10665
  target: options.target,
10663
- showLabel: options.showLabel ?? true
10666
+ showLabel: options.showLabel ?? true,
10667
+ iconType: options.iconType || this.defaultIconType
10664
10668
  };
10665
10669
  this.validateMarker(marker);
10666
10670
  const leafletMarker = this.createLeafletMarker(marker);
@@ -11042,6 +11046,75 @@ var MarkerManager = class {
11042
11046
  this.eventListeners.clear();
11043
11047
  }
11044
11048
  }
11049
+ /**
11050
+ * Sets the default icon type for new markers
11051
+ *
11052
+ * @param iconType - Icon type to use as default
11053
+ */
11054
+ setDefaultIconType(iconType) {
11055
+ this.defaultIconType = iconType;
11056
+ }
11057
+ /**
11058
+ * Gets the current default icon type
11059
+ *
11060
+ * @returns Current default icon type
11061
+ */
11062
+ getDefaultIconType() {
11063
+ return this.defaultIconType;
11064
+ }
11065
+ /**
11066
+ * Sets the base path for marker icons
11067
+ *
11068
+ * @param basePath - Base path for icon files (default: '/')
11069
+ */
11070
+ setIconBasePath(basePath) {
11071
+ this.iconBasePath = basePath.endsWith("/") ? basePath : `${basePath}/`;
11072
+ }
11073
+ /**
11074
+ * Updates the icon type for a specific marker
11075
+ *
11076
+ * @param id - Marker ID
11077
+ * @param iconType - New icon type
11078
+ * @returns True if marker was updated, false if not found
11079
+ */
11080
+ updateMarkerIcon(id, iconType) {
11081
+ const marker = this.markers.get(id);
11082
+ const leafletMarker = this.leafletMarkers.get(id);
11083
+ if (!marker || !leafletMarker) {
11084
+ return false;
11085
+ }
11086
+ const isSelected = this.selectedIds.has(id);
11087
+ if (isSelected && (iconType === "pin-gray" || iconType === "pin-yellow" || iconType === "pin")) {
11088
+ if (iconType === "pin-gray" || iconType === "pin") {
11089
+ iconType = "pin-gray-selected";
11090
+ } else if (iconType === "pin-yellow") {
11091
+ iconType = "pin-yellow-selected";
11092
+ }
11093
+ }
11094
+ marker.iconType = iconType;
11095
+ const newIcon = this.createCustomIcon(iconType);
11096
+ leafletMarker.setIcon(newIcon);
11097
+ return true;
11098
+ }
11099
+ /**
11100
+ * Updates all markers to use a new icon type
11101
+ *
11102
+ * @param iconType - Icon type to apply to all markers
11103
+ */
11104
+ updateAllMarkerIcons(iconType) {
11105
+ this.markers.forEach((marker, id) => {
11106
+ const isSelected = this.selectedIds.has(id);
11107
+ let finalIconType = iconType;
11108
+ if (isSelected) {
11109
+ if (iconType === "pin-gray" || iconType === "pin") {
11110
+ finalIconType = "pin-gray-selected";
11111
+ } else if (iconType === "pin-yellow") {
11112
+ finalIconType = "pin-yellow-selected";
11113
+ }
11114
+ }
11115
+ this.updateMarkerIcon(id, finalIconType);
11116
+ });
11117
+ }
11045
11118
  /**
11046
11119
  * Disposes of the marker manager and cleans up resources
11047
11120
  *
@@ -11054,6 +11127,28 @@ var MarkerManager = class {
11054
11127
  this.map.removeLayer(this.markerLayerGroup);
11055
11128
  }
11056
11129
  }
11130
+ /**
11131
+ * Creates a custom icon for a marker
11132
+ *
11133
+ * @param iconType - Icon type to use
11134
+ * @returns Leaflet icon instance
11135
+ */
11136
+ createCustomIcon(iconType) {
11137
+ const iconUrl = `${this.iconBasePath}${iconType}.png`;
11138
+ return import_leaflet3.default.icon({
11139
+ iconUrl,
11140
+ iconSize: [30, 40],
11141
+ // Default marker size
11142
+ iconAnchor: [30, 10],
11143
+ // Point of the icon which will correspond to marker's location
11144
+ popupAnchor: [0, 0],
11145
+ // Point from which the popup should open relative to the iconAnchor
11146
+ shadowUrl: void 0,
11147
+ // No shadow
11148
+ shadowSize: void 0,
11149
+ shadowAnchor: void 0
11150
+ });
11151
+ }
11057
11152
  /**
11058
11153
  * Creates a Leaflet marker from marker data
11059
11154
  *
@@ -11061,8 +11156,11 @@ var MarkerManager = class {
11061
11156
  * @returns Leaflet marker instance
11062
11157
  */
11063
11158
  createLeafletMarker(marker) {
11159
+ const iconType = marker.iconType || this.defaultIconType;
11160
+ const customIcon = this.createCustomIcon(iconType);
11064
11161
  const markerOptions = {
11065
- title: marker.title
11162
+ title: marker.title,
11163
+ icon: customIcon
11066
11164
  };
11067
11165
  if (this.interactionConfig.draggable) {
11068
11166
  markerOptions.draggable = true;
@@ -11165,20 +11263,32 @@ var MarkerManager = class {
11165
11263
  * @param selected - Whether marker is selected
11166
11264
  */
11167
11265
  updateMarkerSelectionVisual(id, selected) {
11266
+ const marker = this.markers.get(id);
11168
11267
  const leafletMarker = this.leafletMarkers.get(id);
11169
- if (!leafletMarker) {
11268
+ if (!marker || !leafletMarker) {
11170
11269
  return;
11171
11270
  }
11172
- const iconElement = leafletMarker.getElement();
11173
- if (iconElement) {
11174
- if (selected) {
11175
- iconElement.style.filter = "drop-shadow(0 0 8px rgba(59, 130, 246, 0.8))";
11176
- iconElement.style.zIndex = "1000";
11271
+ let newIconType;
11272
+ if (selected) {
11273
+ if (marker.iconType === "pin-gray" || marker.iconType === "pin-gray-selected") {
11274
+ newIconType = "pin-gray-selected";
11275
+ } else if (marker.iconType === "pin-yellow" || marker.iconType === "pin-yellow-selected") {
11276
+ newIconType = "pin-yellow-selected";
11277
+ } else {
11278
+ newIconType = "pin-gray-selected";
11279
+ }
11280
+ } else {
11281
+ if (marker.iconType === "pin-gray" || marker.iconType === "pin-gray-selected") {
11282
+ newIconType = "pin-gray";
11283
+ } else if (marker.iconType === "pin-yellow" || marker.iconType === "pin-yellow-selected") {
11284
+ newIconType = "pin-yellow";
11177
11285
  } else {
11178
- iconElement.style.filter = "";
11179
- iconElement.style.zIndex = "";
11286
+ newIconType = marker.iconType || this.defaultIconType;
11180
11287
  }
11181
11288
  }
11289
+ marker.iconType = newIconType;
11290
+ const newIcon = this.createCustomIcon(newIconType);
11291
+ leafletMarker.setIcon(newIcon);
11182
11292
  }
11183
11293
  /**
11184
11294
  * Emits an event to all registered listeners
@@ -11808,6 +11918,7 @@ function ViewerProvider({
11808
11918
  setIsInitialized(true);
11809
11919
  const markerManager = viewerInstance.getMarkerManager();
11810
11920
  if (markerManager) {
11921
+ markerManager.setIconBasePath("/");
11811
11922
  markerManager.setInteractionConfig({
11812
11923
  draggable: enableAnnotation,
11813
11924
  selectable: enableAnnotation,
@@ -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,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,E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,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"}
@@ -1 +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,SA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EG;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,CAkPnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAMrD"}
package/dist/styles.css CHANGED
@@ -1,5 +1,668 @@
1
1
  /* Re-export Leaflet CSS for convenience */
2
- @import 'leaflet/dist/leaflet.css';
2
+ /* Inlined leaflet/dist/leaflet.css */
3
+ /* required styles */
4
+
5
+ .leaflet-pane,
6
+ .leaflet-tile,
7
+ .leaflet-marker-icon,
8
+ .leaflet-marker-shadow,
9
+ .leaflet-tile-container,
10
+ .leaflet-pane > svg,
11
+ .leaflet-pane > canvas,
12
+ .leaflet-zoom-box,
13
+ .leaflet-image-layer,
14
+ .leaflet-layer {
15
+ position: absolute;
16
+ left: 0;
17
+ top: 0;
18
+ }
19
+ .leaflet-container {
20
+ overflow: hidden;
21
+ }
22
+ .leaflet-tile,
23
+ .leaflet-marker-icon,
24
+ .leaflet-marker-shadow {
25
+ -webkit-user-select: none;
26
+ -moz-user-select: none;
27
+ user-select: none;
28
+ -webkit-user-drag: none;
29
+ }
30
+ /* Prevents IE11 from highlighting tiles in blue */
31
+ .leaflet-tile::selection {
32
+ background: transparent;
33
+ }
34
+ /* Safari renders non-retina tile on retina better with this, but Chrome is worse */
35
+ .leaflet-safari .leaflet-tile {
36
+ image-rendering: -webkit-optimize-contrast;
37
+ }
38
+ /* hack that prevents hw layers "stretching" when loading new tiles */
39
+ .leaflet-safari .leaflet-tile-container {
40
+ width: 1600px;
41
+ height: 1600px;
42
+ -webkit-transform-origin: 0 0;
43
+ }
44
+ .leaflet-marker-icon,
45
+ .leaflet-marker-shadow {
46
+ display: block;
47
+ }
48
+ /* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
49
+ /* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
50
+ .leaflet-container .leaflet-overlay-pane svg {
51
+ max-width: none !important;
52
+ max-height: none !important;
53
+ }
54
+ .leaflet-container .leaflet-marker-pane img,
55
+ .leaflet-container .leaflet-shadow-pane img,
56
+ .leaflet-container .leaflet-tile-pane img,
57
+ .leaflet-container img.leaflet-image-layer,
58
+ .leaflet-container .leaflet-tile {
59
+ max-width: none !important;
60
+ max-height: none !important;
61
+ width: auto;
62
+ padding: 0;
63
+ }
64
+
65
+ .leaflet-container img.leaflet-tile {
66
+ /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
67
+ mix-blend-mode: plus-lighter;
68
+ }
69
+
70
+ .leaflet-container.leaflet-touch-zoom {
71
+ -ms-touch-action: pan-x pan-y;
72
+ touch-action: pan-x pan-y;
73
+ }
74
+ .leaflet-container.leaflet-touch-drag {
75
+ -ms-touch-action: pinch-zoom;
76
+ /* Fallback for FF which doesn't support pinch-zoom */
77
+ touch-action: none;
78
+ touch-action: pinch-zoom;
79
+ }
80
+ .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
81
+ -ms-touch-action: none;
82
+ touch-action: none;
83
+ }
84
+ .leaflet-container {
85
+ -webkit-tap-highlight-color: transparent;
86
+ }
87
+ .leaflet-container a {
88
+ -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
89
+ }
90
+ .leaflet-tile {
91
+ filter: inherit;
92
+ visibility: hidden;
93
+ }
94
+ .leaflet-tile-loaded {
95
+ visibility: inherit;
96
+ }
97
+ .leaflet-zoom-box {
98
+ width: 0;
99
+ height: 0;
100
+ -moz-box-sizing: border-box;
101
+ box-sizing: border-box;
102
+ z-index: 800;
103
+ }
104
+ /* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
105
+ .leaflet-overlay-pane svg {
106
+ -moz-user-select: none;
107
+ }
108
+
109
+ .leaflet-pane { z-index: 400; }
110
+
111
+ .leaflet-tile-pane { z-index: 200; }
112
+ .leaflet-overlay-pane { z-index: 400; }
113
+ .leaflet-shadow-pane { z-index: 500; }
114
+ .leaflet-marker-pane { z-index: 600; }
115
+ .leaflet-tooltip-pane { z-index: 650; }
116
+ .leaflet-popup-pane { z-index: 700; }
117
+
118
+ .leaflet-map-pane canvas { z-index: 100; }
119
+ .leaflet-map-pane svg { z-index: 200; }
120
+
121
+ .leaflet-vml-shape {
122
+ width: 1px;
123
+ height: 1px;
124
+ }
125
+ .lvml {
126
+ behavior: url(#default#VML);
127
+ display: inline-block;
128
+ position: absolute;
129
+ }
130
+
131
+
132
+ /* control positioning */
133
+
134
+ .leaflet-control {
135
+ position: relative;
136
+ z-index: 800;
137
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
138
+ pointer-events: auto;
139
+ }
140
+ .leaflet-top,
141
+ .leaflet-bottom {
142
+ position: absolute;
143
+ z-index: 1000;
144
+ pointer-events: none;
145
+ }
146
+ .leaflet-top {
147
+ top: 0;
148
+ }
149
+ .leaflet-right {
150
+ right: 0;
151
+ }
152
+ .leaflet-bottom {
153
+ bottom: 0;
154
+ }
155
+ .leaflet-left {
156
+ left: 0;
157
+ }
158
+ .leaflet-control {
159
+ float: left;
160
+ clear: both;
161
+ }
162
+ .leaflet-right .leaflet-control {
163
+ float: right;
164
+ }
165
+ .leaflet-top .leaflet-control {
166
+ margin-top: 10px;
167
+ }
168
+ .leaflet-bottom .leaflet-control {
169
+ margin-bottom: 10px;
170
+ }
171
+ .leaflet-left .leaflet-control {
172
+ margin-left: 10px;
173
+ }
174
+ .leaflet-right .leaflet-control {
175
+ margin-right: 10px;
176
+ }
177
+
178
+
179
+ /* zoom and fade animations */
180
+
181
+ .leaflet-fade-anim .leaflet-popup {
182
+ opacity: 0;
183
+ -webkit-transition: opacity 0.2s linear;
184
+ -moz-transition: opacity 0.2s linear;
185
+ transition: opacity 0.2s linear;
186
+ }
187
+ .leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
188
+ opacity: 1;
189
+ }
190
+ .leaflet-zoom-animated {
191
+ -webkit-transform-origin: 0 0;
192
+ -ms-transform-origin: 0 0;
193
+ transform-origin: 0 0;
194
+ }
195
+ svg.leaflet-zoom-animated {
196
+ will-change: transform;
197
+ }
198
+
199
+ .leaflet-zoom-anim .leaflet-zoom-animated {
200
+ -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
201
+ -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
202
+ transition: transform 0.25s cubic-bezier(0,0,0.25,1);
203
+ }
204
+ .leaflet-zoom-anim .leaflet-tile,
205
+ .leaflet-pan-anim .leaflet-tile {
206
+ -webkit-transition: none;
207
+ -moz-transition: none;
208
+ transition: none;
209
+ }
210
+
211
+ .leaflet-zoom-anim .leaflet-zoom-hide {
212
+ visibility: hidden;
213
+ }
214
+
215
+
216
+ /* cursors */
217
+
218
+ .leaflet-interactive {
219
+ cursor: pointer;
220
+ }
221
+ .leaflet-grab {
222
+ cursor: -webkit-grab;
223
+ cursor: -moz-grab;
224
+ cursor: grab;
225
+ }
226
+ .leaflet-crosshair,
227
+ .leaflet-crosshair .leaflet-interactive {
228
+ cursor: crosshair;
229
+ }
230
+ .leaflet-popup-pane,
231
+ .leaflet-control {
232
+ cursor: auto;
233
+ }
234
+ .leaflet-dragging .leaflet-grab,
235
+ .leaflet-dragging .leaflet-grab .leaflet-interactive,
236
+ .leaflet-dragging .leaflet-marker-draggable {
237
+ cursor: move;
238
+ cursor: -webkit-grabbing;
239
+ cursor: -moz-grabbing;
240
+ cursor: grabbing;
241
+ }
242
+
243
+ /* marker & overlays interactivity */
244
+ .leaflet-marker-icon,
245
+ .leaflet-marker-shadow,
246
+ .leaflet-image-layer,
247
+ .leaflet-pane > svg path,
248
+ .leaflet-tile-container {
249
+ pointer-events: none;
250
+ }
251
+
252
+ .leaflet-marker-icon.leaflet-interactive,
253
+ .leaflet-image-layer.leaflet-interactive,
254
+ .leaflet-pane > svg path.leaflet-interactive,
255
+ svg.leaflet-image-layer.leaflet-interactive path {
256
+ pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
257
+ pointer-events: auto;
258
+ }
259
+
260
+ /* visual tweaks */
261
+
262
+ .leaflet-container {
263
+ background: #ddd;
264
+ outline-offset: 1px;
265
+ }
266
+ .leaflet-container a {
267
+ color: #0078A8;
268
+ }
269
+ .leaflet-zoom-box {
270
+ border: 2px dotted #38f;
271
+ background: rgba(255,255,255,0.5);
272
+ }
273
+
274
+
275
+ /* general typography */
276
+ .leaflet-container {
277
+ font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
278
+ font-size: 12px;
279
+ font-size: 0.75rem;
280
+ line-height: 1.5;
281
+ }
282
+
283
+
284
+ /* general toolbar styles */
285
+
286
+ .leaflet-bar {
287
+ box-shadow: 0 1px 5px rgba(0,0,0,0.65);
288
+ border-radius: 4px;
289
+ }
290
+ .leaflet-bar a {
291
+ background-color: #fff;
292
+ border-bottom: 1px solid #ccc;
293
+ width: 26px;
294
+ height: 26px;
295
+ line-height: 26px;
296
+ display: block;
297
+ text-align: center;
298
+ text-decoration: none;
299
+ color: black;
300
+ }
301
+ .leaflet-bar a,
302
+ .leaflet-control-layers-toggle {
303
+ background-position: 50% 50%;
304
+ background-repeat: no-repeat;
305
+ display: block;
306
+ }
307
+ .leaflet-bar a:hover,
308
+ .leaflet-bar a:focus {
309
+ background-color: #f4f4f4;
310
+ }
311
+ .leaflet-bar a:first-child {
312
+ border-top-left-radius: 4px;
313
+ border-top-right-radius: 4px;
314
+ }
315
+ .leaflet-bar a:last-child {
316
+ border-bottom-left-radius: 4px;
317
+ border-bottom-right-radius: 4px;
318
+ border-bottom: none;
319
+ }
320
+ .leaflet-bar a.leaflet-disabled {
321
+ cursor: default;
322
+ background-color: #f4f4f4;
323
+ color: #bbb;
324
+ }
325
+
326
+ .leaflet-touch .leaflet-bar a {
327
+ width: 30px;
328
+ height: 30px;
329
+ line-height: 30px;
330
+ }
331
+ .leaflet-touch .leaflet-bar a:first-child {
332
+ border-top-left-radius: 2px;
333
+ border-top-right-radius: 2px;
334
+ }
335
+ .leaflet-touch .leaflet-bar a:last-child {
336
+ border-bottom-left-radius: 2px;
337
+ border-bottom-right-radius: 2px;
338
+ }
339
+
340
+ /* zoom control */
341
+
342
+ .leaflet-control-zoom-in,
343
+ .leaflet-control-zoom-out {
344
+ font: bold 18px 'Lucida Console', Monaco, monospace;
345
+ text-indent: 1px;
346
+ }
347
+
348
+ .leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
349
+ font-size: 22px;
350
+ }
351
+
352
+
353
+ /* layers control */
354
+
355
+ .leaflet-control-layers {
356
+ box-shadow: 0 1px 5px rgba(0,0,0,0.4);
357
+ background: #fff;
358
+ border-radius: 5px;
359
+ }
360
+ .leaflet-control-layers-toggle {
361
+ background-image: url(./images/layers.png);
362
+ width: 36px;
363
+ height: 36px;
364
+ }
365
+ .leaflet-retina .leaflet-control-layers-toggle {
366
+ background-image: url(./images/layers-2x.png);
367
+ background-size: 26px 26px;
368
+ }
369
+ .leaflet-touch .leaflet-control-layers-toggle {
370
+ width: 44px;
371
+ height: 44px;
372
+ }
373
+ .leaflet-control-layers .leaflet-control-layers-list,
374
+ .leaflet-control-layers-expanded .leaflet-control-layers-toggle {
375
+ display: none;
376
+ }
377
+ .leaflet-control-layers-expanded .leaflet-control-layers-list {
378
+ display: block;
379
+ position: relative;
380
+ }
381
+ .leaflet-control-layers-expanded {
382
+ padding: 6px 10px 6px 6px;
383
+ color: #333;
384
+ background: #fff;
385
+ }
386
+ .leaflet-control-layers-scrollbar {
387
+ overflow-y: scroll;
388
+ overflow-x: hidden;
389
+ padding-right: 5px;
390
+ }
391
+ .leaflet-control-layers-selector {
392
+ margin-top: 2px;
393
+ position: relative;
394
+ top: 1px;
395
+ }
396
+ .leaflet-control-layers label {
397
+ display: block;
398
+ font-size: 13px;
399
+ font-size: 1.08333em;
400
+ }
401
+ .leaflet-control-layers-separator {
402
+ height: 0;
403
+ border-top: 1px solid #ddd;
404
+ margin: 5px -10px 5px -6px;
405
+ }
406
+
407
+ /* Default icon URLs */
408
+ .leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
409
+ background-image: url(./images/marker-icon.png);
410
+ }
411
+
412
+
413
+ /* attribution and scale controls */
414
+
415
+ .leaflet-container .leaflet-control-attribution {
416
+ background: #fff;
417
+ background: rgba(255, 255, 255, 0.8);
418
+ margin: 0;
419
+ }
420
+ .leaflet-control-attribution,
421
+ .leaflet-control-scale-line {
422
+ padding: 0 5px;
423
+ color: #333;
424
+ line-height: 1.4;
425
+ }
426
+ .leaflet-control-attribution a {
427
+ text-decoration: none;
428
+ }
429
+ .leaflet-control-attribution a:hover,
430
+ .leaflet-control-attribution a:focus {
431
+ text-decoration: underline;
432
+ }
433
+ .leaflet-attribution-flag {
434
+ display: inline !important;
435
+ vertical-align: baseline !important;
436
+ width: 1em;
437
+ height: 0.6669em;
438
+ }
439
+ .leaflet-left .leaflet-control-scale {
440
+ margin-left: 5px;
441
+ }
442
+ .leaflet-bottom .leaflet-control-scale {
443
+ margin-bottom: 5px;
444
+ }
445
+ .leaflet-control-scale-line {
446
+ border: 2px solid #777;
447
+ border-top: none;
448
+ line-height: 1.1;
449
+ padding: 2px 5px 1px;
450
+ white-space: nowrap;
451
+ -moz-box-sizing: border-box;
452
+ box-sizing: border-box;
453
+ background: rgba(255, 255, 255, 0.8);
454
+ text-shadow: 1px 1px #fff;
455
+ }
456
+ .leaflet-control-scale-line:not(:first-child) {
457
+ border-top: 2px solid #777;
458
+ border-bottom: none;
459
+ margin-top: -2px;
460
+ }
461
+ .leaflet-control-scale-line:not(:first-child):not(:last-child) {
462
+ border-bottom: 2px solid #777;
463
+ }
464
+
465
+ .leaflet-touch .leaflet-control-attribution,
466
+ .leaflet-touch .leaflet-control-layers,
467
+ .leaflet-touch .leaflet-bar {
468
+ box-shadow: none;
469
+ }
470
+ .leaflet-touch .leaflet-control-layers,
471
+ .leaflet-touch .leaflet-bar {
472
+ border: 2px solid rgba(0,0,0,0.2);
473
+ background-clip: padding-box;
474
+ }
475
+
476
+
477
+ /* popup */
478
+
479
+ .leaflet-popup {
480
+ position: absolute;
481
+ text-align: center;
482
+ margin-bottom: 20px;
483
+ }
484
+ .leaflet-popup-content-wrapper {
485
+ padding: 1px;
486
+ text-align: left;
487
+ border-radius: 12px;
488
+ }
489
+ .leaflet-popup-content {
490
+ margin: 13px 24px 13px 20px;
491
+ line-height: 1.3;
492
+ font-size: 13px;
493
+ font-size: 1.08333em;
494
+ min-height: 1px;
495
+ }
496
+ .leaflet-popup-content p {
497
+ margin: 17px 0;
498
+ margin: 1.3em 0;
499
+ }
500
+ .leaflet-popup-tip-container {
501
+ width: 40px;
502
+ height: 20px;
503
+ position: absolute;
504
+ left: 50%;
505
+ margin-top: -1px;
506
+ margin-left: -20px;
507
+ overflow: hidden;
508
+ pointer-events: none;
509
+ }
510
+ .leaflet-popup-tip {
511
+ width: 17px;
512
+ height: 17px;
513
+ padding: 1px;
514
+
515
+ margin: -10px auto 0;
516
+ pointer-events: auto;
517
+
518
+ -webkit-transform: rotate(45deg);
519
+ -moz-transform: rotate(45deg);
520
+ -ms-transform: rotate(45deg);
521
+ transform: rotate(45deg);
522
+ }
523
+ .leaflet-popup-content-wrapper,
524
+ .leaflet-popup-tip {
525
+ background: white;
526
+ color: #333;
527
+ box-shadow: 0 3px 14px rgba(0,0,0,0.4);
528
+ }
529
+ .leaflet-container a.leaflet-popup-close-button {
530
+ position: absolute;
531
+ top: 0;
532
+ right: 0;
533
+ border: none;
534
+ text-align: center;
535
+ width: 24px;
536
+ height: 24px;
537
+ font: 16px/24px Tahoma, Verdana, sans-serif;
538
+ color: #757575;
539
+ text-decoration: none;
540
+ background: transparent;
541
+ }
542
+ .leaflet-container a.leaflet-popup-close-button:hover,
543
+ .leaflet-container a.leaflet-popup-close-button:focus {
544
+ color: #585858;
545
+ }
546
+ .leaflet-popup-scrolled {
547
+ overflow: auto;
548
+ }
549
+
550
+ .leaflet-oldie .leaflet-popup-content-wrapper {
551
+ -ms-zoom: 1;
552
+ }
553
+ .leaflet-oldie .leaflet-popup-tip {
554
+ width: 24px;
555
+ margin: 0 auto;
556
+
557
+ -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
558
+ filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
559
+ }
560
+
561
+ .leaflet-oldie .leaflet-control-zoom,
562
+ .leaflet-oldie .leaflet-control-layers,
563
+ .leaflet-oldie .leaflet-popup-content-wrapper,
564
+ .leaflet-oldie .leaflet-popup-tip {
565
+ border: 1px solid #999;
566
+ }
567
+
568
+
569
+ /* div icon */
570
+
571
+ .leaflet-div-icon {
572
+ background: #fff;
573
+ border: 1px solid #666;
574
+ }
575
+
576
+
577
+ /* Tooltip */
578
+ /* Base styles for the element that has a tooltip */
579
+ .leaflet-tooltip {
580
+ position: absolute;
581
+ padding: 6px;
582
+ background-color: #fff;
583
+ border: 1px solid #fff;
584
+ border-radius: 3px;
585
+ color: #222;
586
+ white-space: nowrap;
587
+ -webkit-user-select: none;
588
+ -moz-user-select: none;
589
+ -ms-user-select: none;
590
+ user-select: none;
591
+ pointer-events: none;
592
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4);
593
+ }
594
+ .leaflet-tooltip.leaflet-interactive {
595
+ cursor: pointer;
596
+ pointer-events: auto;
597
+ }
598
+ .leaflet-tooltip-top:before,
599
+ .leaflet-tooltip-bottom:before,
600
+ .leaflet-tooltip-left:before,
601
+ .leaflet-tooltip-right:before {
602
+ position: absolute;
603
+ pointer-events: none;
604
+ border: 6px solid transparent;
605
+ background: transparent;
606
+ content: "";
607
+ }
608
+
609
+ /* Directions */
610
+
611
+ .leaflet-tooltip-bottom {
612
+ margin-top: 6px;
613
+ }
614
+ .leaflet-tooltip-top {
615
+ margin-top: -6px;
616
+ }
617
+ .leaflet-tooltip-bottom:before,
618
+ .leaflet-tooltip-top:before {
619
+ left: 50%;
620
+ margin-left: -6px;
621
+ }
622
+ .leaflet-tooltip-top:before {
623
+ bottom: 0;
624
+ margin-bottom: -12px;
625
+ border-top-color: #fff;
626
+ }
627
+ .leaflet-tooltip-bottom:before {
628
+ top: 0;
629
+ margin-top: -12px;
630
+ margin-left: -6px;
631
+ border-bottom-color: #fff;
632
+ }
633
+ .leaflet-tooltip-left {
634
+ margin-left: -6px;
635
+ }
636
+ .leaflet-tooltip-right {
637
+ margin-left: 6px;
638
+ }
639
+ .leaflet-tooltip-left:before,
640
+ .leaflet-tooltip-right:before {
641
+ top: 50%;
642
+ margin-top: -6px;
643
+ }
644
+ .leaflet-tooltip-left:before {
645
+ right: 0;
646
+ margin-right: -12px;
647
+ border-left-color: #fff;
648
+ }
649
+ .leaflet-tooltip-right:before {
650
+ left: 0;
651
+ margin-left: -12px;
652
+ border-right-color: #fff;
653
+ }
654
+
655
+ /* Printing */
656
+
657
+ @media print {
658
+ /* Prevent printers from removing background-images of controls. */
659
+ .leaflet-control {
660
+ -webkit-print-color-adjust: exact;
661
+ print-color-adjust: exact;
662
+ }
663
+ }
664
+
665
+
3
666
 
4
667
  /* Seamless tile rendering - removes borders and gaps between tiles */
5
668
  .seamless-tiles img,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgepdf/viewer-react",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
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",
@@ -35,6 +35,10 @@
35
35
  },
36
36
  "./styles.css": "./dist/styles.css"
37
37
  },
38
+ "sideEffects": [
39
+ "./dist/index.js",
40
+ "**/*.css"
41
+ ],
38
42
  "files": [
39
43
  "dist",
40
44
  "!**/*.tsbuildinfo"
@@ -66,6 +70,7 @@
66
70
  "@edgepdf/testing-utils": "workspace:*"
67
71
  },
68
72
  "peerDependencies": {
73
+ "@edgepdf/viewer-js": "^0.0.3",
69
74
  "react": "^18.0.0",
70
75
  "react-dom": "^18.0.0"
71
76
  }