@edgepdf/viewer-react 0.1.0 → 0.1.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/index.js +63 -63
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -96,7 +96,7 @@ var Ro = zr((y, r) => {
|
|
|
96
96
|
t.options[i] = e[i];
|
|
97
97
|
return t.options;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function q(t, e, i) {
|
|
100
100
|
var o = [];
|
|
101
101
|
for (var n in t)
|
|
102
102
|
o.push(encodeURIComponent(i ? n.toUpperCase() : n) + "=" + encodeURIComponent(t[n]));
|
|
@@ -143,7 +143,7 @@ var Ro = zr((y, r) => {
|
|
|
143
143
|
}
|
|
144
144
|
var $o = { __proto__: null, extend: u, create: m, bind: f, get lastId() {
|
|
145
145
|
return x;
|
|
146
|
-
}, stamp: g, throttle: C, wrapNum: M, falseFn: v, formatNum: B, trim: j, splitWords: O, setOptions: S, getParamString:
|
|
146
|
+
}, stamp: g, throttle: C, wrapNum: M, falseFn: v, formatNum: B, trim: j, splitWords: O, setOptions: S, getParamString: q, template: yi, isArray: st, indexOf: Te, emptyImageUrl: re, requestFn: Ee, cancelFn: wi, requestAnimFrame: J, cancelAnimFrame: it };
|
|
147
147
|
function pt() {
|
|
148
148
|
}
|
|
149
149
|
pt.extend = function(t) {
|
|
@@ -599,11 +599,11 @@ var Ro = zr((y, r) => {
|
|
|
599
599
|
function Ln(t) {
|
|
600
600
|
It[t.pointerId] && (It[t.pointerId] = t);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Vi(t) {
|
|
603
603
|
delete It[t.pointerId];
|
|
604
604
|
}
|
|
605
605
|
function Mn() {
|
|
606
|
-
Ui || (document.addEventListener(Ni, wn, true), document.addEventListener(Hi, Ln, true), document.addEventListener(ji,
|
|
606
|
+
Ui || (document.addEventListener(Ni, wn, true), document.addEventListener(Hi, Ln, true), document.addEventListener(ji, Vi, true), document.addEventListener(Wi, Vi, true), Ui = true);
|
|
607
607
|
}
|
|
608
608
|
function ae(t, e) {
|
|
609
609
|
if (e.pointerType !== (e.MSPOINTER_TYPE_MOUSE || "mouse")) {
|
|
@@ -648,7 +648,7 @@ var Ro = zr((y, r) => {
|
|
|
648
648
|
function En(t, e) {
|
|
649
649
|
t.removeEventListener("dblclick", e.dblclick), t.removeEventListener("click", e.simDblclick);
|
|
650
650
|
}
|
|
651
|
-
var Ne = ce(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]), Ft = ce(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]),
|
|
651
|
+
var Ne = ce(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]), Ft = ce(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]), qi = Ft === "webkitTransition" || Ft === "OTransition" ? Ft + "End" : "transitionend";
|
|
652
652
|
function Gi(t) {
|
|
653
653
|
return typeof t == "string" ? document.getElementById(t) : t;
|
|
654
654
|
}
|
|
@@ -733,21 +733,21 @@ var Ro = zr((y, r) => {
|
|
|
733
733
|
function Pt(t) {
|
|
734
734
|
return t._leaflet_pos || new P(0, 0);
|
|
735
735
|
}
|
|
736
|
-
var
|
|
736
|
+
var Vt, qt, We;
|
|
737
737
|
if ("onselectstart" in document)
|
|
738
|
-
|
|
738
|
+
Vt = function() {
|
|
739
739
|
T(window, "selectstart", Y);
|
|
740
|
-
},
|
|
740
|
+
}, qt = function() {
|
|
741
741
|
D(window, "selectstart", Y);
|
|
742
742
|
};
|
|
743
743
|
else {
|
|
744
744
|
var Gt = ce(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
|
|
745
|
-
|
|
745
|
+
Vt = function() {
|
|
746
746
|
if (Gt) {
|
|
747
747
|
var t = document.documentElement.style;
|
|
748
748
|
We = t[Gt], t[Gt] = "none";
|
|
749
749
|
}
|
|
750
|
-
},
|
|
750
|
+
}, qt = function() {
|
|
751
751
|
Gt && (document.documentElement.style[Gt] = We, We = void 0);
|
|
752
752
|
};
|
|
753
753
|
}
|
|
@@ -757,14 +757,14 @@ var Ro = zr((y, r) => {
|
|
|
757
757
|
function Ue() {
|
|
758
758
|
D(window, "dragstart", Y);
|
|
759
759
|
}
|
|
760
|
-
var ue,
|
|
761
|
-
function
|
|
760
|
+
var ue, Ve;
|
|
761
|
+
function qe(t) {
|
|
762
762
|
for (; t.tabIndex === -1; )
|
|
763
763
|
t = t.parentNode;
|
|
764
|
-
t.style && (de(), ue = t,
|
|
764
|
+
t.style && (de(), ue = t, Ve = t.style.outlineStyle, t.style.outlineStyle = "none", T(window, "keydown", de));
|
|
765
765
|
}
|
|
766
766
|
function de() {
|
|
767
|
-
ue && (ue.style.outlineStyle =
|
|
767
|
+
ue && (ue.style.outlineStyle = Ve, ue = void 0, Ve = void 0, D(window, "keydown", de));
|
|
768
768
|
}
|
|
769
769
|
function Yi(t) {
|
|
770
770
|
do
|
|
@@ -776,11 +776,11 @@ var Ro = zr((y, r) => {
|
|
|
776
776
|
var e = t.getBoundingClientRect();
|
|
777
777
|
return { x: e.width / t.offsetWidth || 1, y: e.height / t.offsetHeight || 1, boundingClientRect: e };
|
|
778
778
|
}
|
|
779
|
-
var In = { __proto__: null, TRANSFORM: Ne, TRANSITION: Ft, TRANSITION_END:
|
|
780
|
-
return qt;
|
|
781
|
-
}, get enableTextSelection() {
|
|
779
|
+
var In = { __proto__: null, TRANSFORM: Ne, TRANSITION: Ft, TRANSITION_END: qi, get: Gi, getStyle: Ut, create: A, remove: H, empty: le, toFront: Zt, toBack: St, hasClass: He, addClass: E, removeClass: W, setClass: je, getClass: he, setOpacity: ot, testProp: ce, setTransform: kt, setPosition: U, getPosition: Pt, get disableTextSelection() {
|
|
782
780
|
return Vt;
|
|
783
|
-
},
|
|
781
|
+
}, get enableTextSelection() {
|
|
782
|
+
return qt;
|
|
783
|
+
}, disableImageDrag: Fe, enableImageDrag: Ue, preventOutline: qe, restoreOutline: de, getSizedParentNode: Yi, getScale: Ge };
|
|
784
784
|
function T(t, e, i, o) {
|
|
785
785
|
if (e && typeof e == "object")
|
|
786
786
|
for (var n in e)
|
|
@@ -894,7 +894,7 @@ var Ro = zr((y, r) => {
|
|
|
894
894
|
}, _easeOut: function(t) {
|
|
895
895
|
return 1 - Math.pow(1 - t, this._easeOutPower);
|
|
896
896
|
} }), Z = Ht.extend({ options: { crs: Ze, center: void 0, zoom: void 0, minZoom: void 0, maxZoom: void 0, layers: [], maxBounds: void 0, renderer: void 0, zoomAnimation: true, zoomAnimationThreshold: 4, fadeAnimation: true, markerZoomAnimation: true, transform3DLimit: 8388608, zoomSnap: 1, zoomDelta: 1, trackResize: true }, initialize: function(t, e) {
|
|
897
|
-
e = S(this, e), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = true, this._initContainer(t), this._initLayout(), this._onResize = f(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.zoom !== void 0 && (this._zoom = this._limitZoom(e.zoom)), e.center && e.zoom !== void 0 && this.setView(I(e.center), e.zoom, { reset: true }), this.callInitHooks(), this._zoomAnimated = Ft && b.any3d && !b.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), T(this._proxy,
|
|
897
|
+
e = S(this, e), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._sizeChanged = true, this._initContainer(t), this._initLayout(), this._onResize = f(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.zoom !== void 0 && (this._zoom = this._limitZoom(e.zoom)), e.center && e.zoom !== void 0 && this.setView(I(e.center), e.zoom, { reset: true }), this.callInitHooks(), this._zoomAnimated = Ft && b.any3d && !b.mobileOpera && this.options.zoomAnimation, this._zoomAnimated && (this._createAnimProxy(), T(this._proxy, qi, this._catchTransitionEnd, this)), this._addLayers(this.options.layers);
|
|
898
898
|
}, setView: function(t, e, i) {
|
|
899
899
|
if (e = e === void 0 ? this._zoom : this._limitZoom(e), t = this._limitCenter(I(t), e, this.options.maxBounds), i = i || {}, this._stop(), this._loaded && !i.reset && i !== true) {
|
|
900
900
|
i.animate !== void 0 && (i.zoom = u({ animate: i.animate }, i.zoom), i.pan = u({ animate: i.animate, duration: i.duration }, i.pan));
|
|
@@ -947,33 +947,33 @@ var Ro = zr((y, r) => {
|
|
|
947
947
|
var o = this.project(this.getCenter()), n = this.project(t), a = this.getSize(), l = this._zoom;
|
|
948
948
|
t = I(t), e = e === void 0 ? l : e;
|
|
949
949
|
var c = Math.max(a.x, a.y), d = c * this.getZoomScale(l, e), p = n.distanceTo(o) || 1, _ = 1.42, w = _ * _;
|
|
950
|
-
function z(
|
|
951
|
-
var Me =
|
|
950
|
+
function z(V) {
|
|
951
|
+
var Me = V ? -1 : 1, xr = V ? d : c, wr = d * d - c * c + Me * w * w * p * p, Lr = 2 * xr * w * p, hi = wr / Lr, Ao = Math.sqrt(hi * hi + 1) - hi, Mr = Ao < 1e-9 ? -18 : Math.log(Ao);
|
|
952
952
|
return Mr;
|
|
953
953
|
}
|
|
954
|
-
function X(
|
|
955
|
-
return (Math.exp(
|
|
954
|
+
function X(V) {
|
|
955
|
+
return (Math.exp(V) - Math.exp(-V)) / 2;
|
|
956
956
|
}
|
|
957
|
-
function G(
|
|
958
|
-
return (Math.exp(
|
|
957
|
+
function G(V) {
|
|
958
|
+
return (Math.exp(V) + Math.exp(-V)) / 2;
|
|
959
959
|
}
|
|
960
|
-
function rt(
|
|
961
|
-
return X(
|
|
960
|
+
function rt(V) {
|
|
961
|
+
return X(V) / G(V);
|
|
962
962
|
}
|
|
963
963
|
var tt = z(0);
|
|
964
|
-
function Nt(
|
|
965
|
-
return c * (G(tt) / G(tt + _ *
|
|
964
|
+
function Nt(V) {
|
|
965
|
+
return c * (G(tt) / G(tt + _ * V));
|
|
966
966
|
}
|
|
967
|
-
function _r(
|
|
968
|
-
return c * (G(tt) * rt(tt + _ *
|
|
967
|
+
function _r(V) {
|
|
968
|
+
return c * (G(tt) * rt(tt + _ * V) - X(tt)) / w;
|
|
969
969
|
}
|
|
970
|
-
function vr(
|
|
971
|
-
return 1 - Math.pow(1 -
|
|
970
|
+
function vr(V) {
|
|
971
|
+
return 1 - Math.pow(1 - V, 1.5);
|
|
972
972
|
}
|
|
973
973
|
var yr = Date.now(), Zo = (z(1) - tt) / _, br = i.duration ? 1e3 * i.duration : 1e3 * Zo * 0.8;
|
|
974
974
|
function So() {
|
|
975
|
-
var
|
|
976
|
-
|
|
975
|
+
var V = (Date.now() - yr) / br, Me = vr(V) * Zo;
|
|
976
|
+
V <= 1 ? (this._flyToFrame = J(So, this), this._move(this.unproject(o.add(n.subtract(o).multiplyBy(_r(Me) / p)), l), this.getScaleZoom(c / Nt(Me), l), { flyTo: true })) : this._move(t, e)._moveEnd(true);
|
|
977
977
|
}
|
|
978
978
|
return this._moveStart(true, i.noMoveStart), So.call(this), this;
|
|
979
979
|
}, flyToBounds: function(t, e) {
|
|
@@ -1201,7 +1201,7 @@ var Ro = zr((y, r) => {
|
|
|
1201
1201
|
var e = t.target || t.srcElement;
|
|
1202
1202
|
if (!(!this._loaded || e._leaflet_disable_events || t.type === "click" && this._isClickDisabled(e))) {
|
|
1203
1203
|
var i = t.type;
|
|
1204
|
-
i === "mousedown" &&
|
|
1204
|
+
i === "mousedown" && qe(e), this._fireDOMEvent(t, i);
|
|
1205
1205
|
}
|
|
1206
1206
|
}, _mouseEvents: ["click", "dblclick", "mouseover", "mouseout", "contextmenu"], _fireDOMEvent: function(t, e, i) {
|
|
1207
1207
|
if (t.type === "click") {
|
|
@@ -1557,7 +1557,7 @@ var Ro = zr((y, r) => {
|
|
|
1557
1557
|
xt._dragging === this && this.finishDrag();
|
|
1558
1558
|
return;
|
|
1559
1559
|
}
|
|
1560
|
-
if (!(xt._dragging || t.shiftKey || t.which !== 1 && t.button !== 1 && !t.touches) && (xt._dragging = this, this._preventOutline &&
|
|
1560
|
+
if (!(xt._dragging || t.shiftKey || t.which !== 1 && t.button !== 1 && !t.touches) && (xt._dragging = this, this._preventOutline && qe(this._element), Fe(), Vt(), !this._moving)) {
|
|
1561
1561
|
this.fire("down");
|
|
1562
1562
|
var e = t.touches ? t.touches[0] : t, i = Yi(this._element);
|
|
1563
1563
|
this._startPoint = new P(e.clientX, e.clientY), this._startPos = Pt(this._element), this._parentScale = Ge(i);
|
|
@@ -1580,7 +1580,7 @@ var Ro = zr((y, r) => {
|
|
|
1580
1580
|
}, _onUp: function() {
|
|
1581
1581
|
this._enabled && this.finishDrag();
|
|
1582
1582
|
}, finishDrag: function(t) {
|
|
1583
|
-
W(document.body, "leaflet-dragging"), this._lastTarget && (W(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null), D(document, "mousemove touchmove", this._onMove, this), D(document, "mouseup touchend touchcancel", this._onUp, this), Ue(),
|
|
1583
|
+
W(document.body, "leaflet-dragging"), this._lastTarget && (W(this._lastTarget, "leaflet-drag-target"), this._lastTarget = null), D(document, "mousemove touchmove", this._onMove, this), D(document, "mouseup touchend touchcancel", this._onUp, this), Ue(), qt();
|
|
1584
1584
|
var e = this._moved && this._moving;
|
|
1585
1585
|
this._moving = false, xt._dragging = false, e && this.fire("dragend", { noInertia: t, distance: this._newPos.distanceTo(this._startPos) });
|
|
1586
1586
|
} });
|
|
@@ -1649,7 +1649,7 @@ var Ro = zr((y, r) => {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
function Un(t, e) {
|
|
1651
1651
|
for (var i = [t[0]], o = 1, n = 0, a = t.length; o < a; o++)
|
|
1652
|
-
|
|
1652
|
+
Vn(t[o], t[n]) > e && (i.push(t[o]), n = o);
|
|
1653
1653
|
return n < a - 1 && i.push(t[a - 1]), i;
|
|
1654
1654
|
}
|
|
1655
1655
|
var ao;
|
|
@@ -1671,7 +1671,7 @@ var Ro = zr((y, r) => {
|
|
|
1671
1671
|
var i = 0;
|
|
1672
1672
|
return t.x < e.min.x ? i |= 1 : t.x > e.max.x && (i |= 2), t.y < e.min.y ? i |= 4 : t.y > e.max.y && (i |= 8), i;
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function Vn(t, e) {
|
|
1675
1675
|
var i = e.x - t.x, o = e.y - t.y;
|
|
1676
1676
|
return i * i + o * o;
|
|
1677
1677
|
}
|
|
@@ -1710,7 +1710,7 @@ var Ro = zr((y, r) => {
|
|
|
1710
1710
|
var tt = e.unproject(k(p));
|
|
1711
1711
|
return I([tt.lat + _.lat, tt.lng + _.lng]);
|
|
1712
1712
|
}
|
|
1713
|
-
var
|
|
1713
|
+
var qn = { __proto__: null, simplify: ro, pointToSegmentDistance: so, closestPointOnSegment: Wn, clipSegment: lo, _getEdgeIntersection: pe, _getBitCode: Et, _sqClosestPointOnSegment: Xt, isFlat: nt, _flat: ho, polylineCenter: co }, oi = { project: function(t) {
|
|
1714
1714
|
return new P(t.lng, t.lat);
|
|
1715
1715
|
}, unproject: function(t) {
|
|
1716
1716
|
return new R(t.y, t.x);
|
|
@@ -2917,7 +2917,7 @@ var Ro = zr((y, r) => {
|
|
|
2917
2917
|
this.wmsParams[e] = this._crs.code, Dt.prototype.onAdd.call(this, t);
|
|
2918
2918
|
}, getTileUrl: function(t) {
|
|
2919
2919
|
var e = this._tileCoordsToNwSe(t), i = this._crs, o = $(i.project(e[0]), i.project(e[1])), n = o.min, a = o.max, l = (this._wmsVersion >= 1.3 && this._crs === uo ? [n.y, n.x, a.y, a.x] : [n.x, n.y, a.x, a.y]).join(","), c = Dt.prototype.getTileUrl.call(this, t);
|
|
2920
|
-
return c +
|
|
2920
|
+
return c + q(this.wmsParams, c, this.options.uppercase) + (this.options.uppercase ? "&BBOX=" : "&bbox=") + l;
|
|
2921
2921
|
}, setParams: function(t, e) {
|
|
2922
2922
|
return u(this.wmsParams, t), e || this.redraw(), this;
|
|
2923
2923
|
} });
|
|
@@ -3210,13 +3210,13 @@ var Ro = zr((y, r) => {
|
|
|
3210
3210
|
}, _onMouseDown: function(t) {
|
|
3211
3211
|
if (!t.shiftKey || t.which !== 1 && t.button !== 1)
|
|
3212
3212
|
return false;
|
|
3213
|
-
this._clearDeferredResetState(), this._resetState(),
|
|
3213
|
+
this._clearDeferredResetState(), this._resetState(), Vt(), Fe(), this._startPoint = this._map.mouseEventToContainerPoint(t), T(document, { contextmenu: Ct, mousemove: this._onMouseMove, mouseup: this._onMouseUp, keydown: this._onKeyDown }, this);
|
|
3214
3214
|
}, _onMouseMove: function(t) {
|
|
3215
3215
|
this._moved || (this._moved = true, this._box = A("div", "leaflet-zoom-box", this._container), E(this._container, "leaflet-crosshair"), this._map.fire("boxzoomstart")), this._point = this._map.mouseEventToContainerPoint(t);
|
|
3216
3216
|
var e = new N(this._point, this._startPoint), i = e.getSize();
|
|
3217
3217
|
U(this._box, e.min), this._box.style.width = i.x + "px", this._box.style.height = i.y + "px";
|
|
3218
3218
|
}, _finish: function() {
|
|
3219
|
-
this._moved && (H(this._box), W(this._container, "leaflet-crosshair")),
|
|
3219
|
+
this._moved && (H(this._box), W(this._container, "leaflet-crosshair")), qt(), Ue(), D(document, { contextmenu: Ct, mousemove: this._onMouseMove, mouseup: this._onMouseUp, keydown: this._onKeyDown }, this);
|
|
3220
3220
|
}, _onMouseUp: function(t) {
|
|
3221
3221
|
if (!(t.which !== 1 && t.button !== 1) && (this._finish(), !!this._moved)) {
|
|
3222
3222
|
this._clearDeferredResetState(), this._resetStateTimeout = setTimeout(f(this._resetState, this), 0);
|
|
@@ -3423,7 +3423,7 @@ var Ro = zr((y, r) => {
|
|
|
3423
3423
|
}
|
|
3424
3424
|
this._zooming = false, it(this._animRequest), D(document, "touchmove", this._onTouchMove, this), D(document, "touchend touchcancel", this._onTouchEnd, this), this._map.options.zoomAnimation ? this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap) : this._map._resetView(this._center, this._map._limitZoom(this._zoom));
|
|
3425
3425
|
} });
|
|
3426
|
-
Z.addInitHook("addHandler", "touchZoom", Io), Z.BoxZoom = ko, Z.DoubleClickZoom = Po, Z.Drag = To, Z.Keyboard = Co, Z.ScrollWheelZoom = Eo, Z.TapHold = zo, Z.TouchZoom = Io, s.Bounds = N, s.Browser = b, s.CRS = mt, s.Canvas = xo, s.Circle = ri, s.CircleMarker = fe, s.Class = pt, s.Control = at, s.DivIcon = vo, s.DivOverlay = dt, s.DomEvent = Sn, s.DomUtil = In, s.Draggable = xt, s.Evented = Ht, s.FeatureGroup = ft, s.GeoJSON = _t, s.GridLayer = $t, s.Handler = ut, s.Icon = Ot, s.ImageOverlay = be, s.LatLng = R, s.LatLngBounds = Q, s.Layer = lt, s.LayerGroup = At, s.LineUtil =
|
|
3426
|
+
Z.addInitHook("addHandler", "touchZoom", Io), Z.BoxZoom = ko, Z.DoubleClickZoom = Po, Z.Drag = To, Z.Keyboard = Co, Z.ScrollWheelZoom = Eo, Z.TapHold = zo, Z.TouchZoom = Io, s.Bounds = N, s.Browser = b, s.CRS = mt, s.Canvas = xo, s.Circle = ri, s.CircleMarker = fe, s.Class = pt, s.Control = at, s.DivIcon = vo, s.DivOverlay = dt, s.DomEvent = Sn, s.DomUtil = In, s.Draggable = xt, s.Evented = Ht, s.FeatureGroup = ft, s.GeoJSON = _t, s.GridLayer = $t, s.Handler = ut, s.Icon = Ot, s.ImageOverlay = be, s.LatLng = R, s.LatLngBounds = Q, s.Layer = lt, s.LayerGroup = At, s.LineUtil = qn, s.Map = Z, s.Marker = me, s.Mixin = Hn, s.Path = wt, s.Point = P, s.PolyUtil = jn, s.Polygon = Bt, s.Polyline = gt, s.Popup = xe, s.PosAnimation = Qi, s.Projection = Gn, s.Rectangle = Mo, s.Renderer = vt, s.SVG = te, s.SVGOverlay = _o, s.TileLayer = Dt, s.Tooltip = we, s.Transformation = Ie, s.Util = $o, s.VideoOverlay = go, s.bind = f, s.bounds = $, s.canvas = wo, s.circle = er, s.circleMarker = tr, s.control = Kt, s.divIcon = cr, s.extend = u, s.featureGroup = Jn, s.geoJSON = fo, s.geoJson = nr, s.gridLayer = ur, s.icon = $n, s.imageOverlay = rr, s.latLng = I, s.latLngBounds = F, s.layerGroup = Xn, s.map = An, s.marker = Qn, s.point = k, s.polygon = or, s.polyline = ir, s.popup = lr, s.rectangle = mr, s.setOptions = S, s.stamp = g, s.svg = Lo, s.svgOverlay = ar, s.tileLayer = yo, s.tooltip = hr, s.transformation = jt, s.version = h, s.videoOverlay = sr;
|
|
3427
3427
|
var gr = window.L;
|
|
3428
3428
|
s.noConflict = function() {
|
|
3429
3429
|
return window.L = gr, this;
|
|
@@ -3696,9 +3696,9 @@ var oe = class {
|
|
|
3696
3696
|
}
|
|
3697
3697
|
};
|
|
3698
3698
|
var Lt = null;
|
|
3699
|
-
function
|
|
3699
|
+
function Vo(y) {
|
|
3700
3700
|
Lt && Lt.parentElement && (Lt.parentElement.removeChild(Lt), Lt = null);
|
|
3701
|
-
let { marker: r, onSave: s, onCancel: h } = y, u = (
|
|
3701
|
+
let { marker: r, onSave: s, onCancel: h } = y, u = (q) => q ? q.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'") : "", m = document.createElement("div");
|
|
3702
3702
|
m.className = "edgepdf-marker-edit-popup", m.innerHTML = `
|
|
3703
3703
|
<div class="edgepdf-marker-edit-popup-overlay"></div>
|
|
3704
3704
|
<div class="edgepdf-marker-edit-popup-content">
|
|
@@ -3734,8 +3734,8 @@ function qo(y) {
|
|
|
3734
3734
|
</div>
|
|
3735
3735
|
</div>
|
|
3736
3736
|
`;
|
|
3737
|
-
let f = m.querySelector(".edgepdf-marker-edit-popup-overlay"), x = m.querySelector(".edgepdf-marker-edit-popup-close"), g = m.querySelector(".edgepdf-marker-edit-button-cancel"), C = m.querySelector(".edgepdf-marker-edit-button-save"), M = m.querySelector("#marker-edit-title"), v = m.querySelector("#marker-edit-url"), B = (
|
|
3738
|
-
|
|
3737
|
+
let f = m.querySelector(".edgepdf-marker-edit-popup-overlay"), x = m.querySelector(".edgepdf-marker-edit-popup-close"), g = m.querySelector(".edgepdf-marker-edit-button-cancel"), C = m.querySelector(".edgepdf-marker-edit-button-save"), M = m.querySelector("#marker-edit-title"), v = m.querySelector("#marker-edit-url"), B = (q) => {
|
|
3738
|
+
q.key === "Escape" && (j(), h());
|
|
3739
3739
|
};
|
|
3740
3740
|
document.addEventListener("keydown", B);
|
|
3741
3741
|
let j = () => {
|
|
@@ -3743,26 +3743,26 @@ function qo(y) {
|
|
|
3743
3743
|
}, O = () => {
|
|
3744
3744
|
j(), h();
|
|
3745
3745
|
};
|
|
3746
|
-
f.addEventListener("click", (
|
|
3747
|
-
|
|
3748
|
-
}), x.addEventListener("click", (
|
|
3749
|
-
|
|
3750
|
-
}), g.addEventListener("click", (
|
|
3751
|
-
|
|
3752
|
-
}), C.addEventListener("click", (
|
|
3753
|
-
|
|
3746
|
+
f.addEventListener("click", (q) => {
|
|
3747
|
+
q.stopPropagation(), O();
|
|
3748
|
+
}), x.addEventListener("click", (q) => {
|
|
3749
|
+
q.stopPropagation(), O();
|
|
3750
|
+
}), g.addEventListener("click", (q) => {
|
|
3751
|
+
q.stopPropagation(), O();
|
|
3752
|
+
}), C.addEventListener("click", (q) => {
|
|
3753
|
+
q.stopPropagation();
|
|
3754
3754
|
let zt = { label: M.value.trim() || void 0, href: v.value.trim() || void 0 };
|
|
3755
3755
|
s(zt), j();
|
|
3756
3756
|
});
|
|
3757
|
-
let S = (
|
|
3758
|
-
|
|
3757
|
+
let S = (q) => {
|
|
3758
|
+
q.key === "Enter" && C.click();
|
|
3759
3759
|
};
|
|
3760
3760
|
return M.addEventListener("keydown", S), v.addEventListener("keydown", S), document.body.appendChild(m), Lt = m, setTimeout(() => {
|
|
3761
3761
|
M.focus(), M.select();
|
|
3762
3762
|
}, 0), m;
|
|
3763
3763
|
}
|
|
3764
3764
|
var Mt = null;
|
|
3765
|
-
function
|
|
3765
|
+
function qo(y) {
|
|
3766
3766
|
Mt && Mt.parentElement && (Mt.parentElement.removeChild(Mt), Mt = null);
|
|
3767
3767
|
let { marker: r, onConfirm: s, onCancel: h } = y, u = (O) => {
|
|
3768
3768
|
if (!O)
|
|
@@ -4030,7 +4030,7 @@ var ne = class {
|
|
|
4030
4030
|
if (v !== 0 || B !== 0) {
|
|
4031
4031
|
let j = this.map.getZoom(), O = j !== x;
|
|
4032
4032
|
O && this.map.setZoom(x, { animate: false });
|
|
4033
|
-
let S = this.map.latLngToContainerPoint(g),
|
|
4033
|
+
let S = this.map.latLngToContainerPoint(g), q = K.point(S.x + v, S.y + B), zt = this.map.containerPointToLatLng(q);
|
|
4034
4034
|
O && C && this.map.setZoom(j, { animate: false }), C ? this.map.flyTo(zt, x, { duration: M }) : this.map.setView(zt, x);
|
|
4035
4035
|
} else
|
|
4036
4036
|
C ? this.map.flyTo(g, x, { duration: M }) : this.map.setView(g, x);
|
|
@@ -4151,7 +4151,7 @@ var ne = class {
|
|
|
4151
4151
|
}
|
|
4152
4152
|
return;
|
|
4153
4153
|
}
|
|
4154
|
-
|
|
4154
|
+
Vo({ marker: r, onSave: (s) => {
|
|
4155
4155
|
this.updateMarker(r.id, s);
|
|
4156
4156
|
let h = this.getMarker(r.id);
|
|
4157
4157
|
h && this.emitEvent("edit", h, void 0);
|
|
@@ -4167,7 +4167,7 @@ var ne = class {
|
|
|
4167
4167
|
}
|
|
4168
4168
|
return;
|
|
4169
4169
|
}
|
|
4170
|
-
|
|
4170
|
+
qo({ marker: r, onConfirm: () => {
|
|
4171
4171
|
this.deleteMarker(r.id);
|
|
4172
4172
|
}, onCancel: () => {
|
|
4173
4173
|
} });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgepdf/viewer-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
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",
|
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@edgepdf/viewer-js": "0.1.0",
|
|
51
50
|
"@edgepdf/types": "0.0.1",
|
|
52
51
|
"@edgepdf/utils": "0.0.1",
|
|
53
|
-
"@edgepdf/testing-utils": "0.0.1"
|
|
52
|
+
"@edgepdf/testing-utils": "0.0.1",
|
|
53
|
+
"@edgepdf/viewer-js": "0.1.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^18.0.0",
|