@annotorious/react 3.0.20 → 3.0.21
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/annotorious-react.es10.js +8 -8
- package/dist/annotorious-react.es11.js.map +1 -1
- package/dist/annotorious-react.es13.js +157 -163
- package/dist/annotorious-react.es13.js.map +1 -1
- package/dist/annotorious-react.es15.js +8 -8
- package/dist/annotorious-react.es16.js +196 -193
- package/dist/annotorious-react.es16.js.map +1 -1
- package/dist/annotorious-react.es17.js +12 -9
- package/dist/annotorious-react.es17.js.map +1 -1
- package/dist/annotorious-react.es19.js +23 -16
- package/dist/annotorious-react.es19.js.map +1 -1
- package/dist/annotorious-react.es2.js +54 -54
- package/dist/annotorious-react.es20.js +328 -528
- package/dist/annotorious-react.es20.js.map +1 -1
- package/dist/annotorious-react.es21.js +36 -36
- package/dist/annotorious-react.es21.js.map +1 -1
- package/dist/annotorious-react.es28.js +184 -184
- package/dist/annotorious-react.es28.js.map +1 -1
- package/dist/annotorious-react.es8.js +2 -2
- package/package.json +12 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { offset as I, shift as J, flip as K, inline as N, computePosition as Q, arrow as
|
|
1
|
+
import { offset as I, shift as J, flip as K, inline as N, computePosition as Q, arrow as A } from "./annotorious-react.es16.js";
|
|
2
2
|
import { autoUpdate as le, platform as ce } from "./annotorious-react.es16.js";
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { useLayoutEffect as T, useEffect as X } from "react";
|
|
@@ -34,11 +34,11 @@ function h(e, t) {
|
|
|
34
34
|
}
|
|
35
35
|
return e !== e && t !== t;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function v(e) {
|
|
38
38
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const n =
|
|
40
|
+
function q(e, t) {
|
|
41
|
+
const n = v(e);
|
|
42
42
|
return Math.round(t * n) / n;
|
|
43
43
|
}
|
|
44
44
|
function $(e) {
|
|
@@ -128,11 +128,11 @@ function te(e) {
|
|
|
128
128
|
};
|
|
129
129
|
if (!c.floating)
|
|
130
130
|
return o;
|
|
131
|
-
const w =
|
|
131
|
+
const w = q(c.floating, i.x), m = q(c.floating, i.y);
|
|
132
132
|
return k ? {
|
|
133
133
|
...o,
|
|
134
134
|
transform: "translate(" + w + "px, " + m + "px)",
|
|
135
|
-
...
|
|
135
|
+
...v(c.floating) >= 1.5 && {
|
|
136
136
|
willChange: "transform"
|
|
137
137
|
}
|
|
138
138
|
} : {
|
|
@@ -161,10 +161,10 @@ const Z = (e) => {
|
|
|
161
161
|
element: r,
|
|
162
162
|
padding: s
|
|
163
163
|
} = typeof e == "function" ? e(n) : e;
|
|
164
|
-
return r && t(r) ? r.current != null ?
|
|
164
|
+
return r && t(r) ? r.current != null ? A({
|
|
165
165
|
element: r.current,
|
|
166
166
|
padding: s
|
|
167
|
-
}).fn(n) : {} : r ?
|
|
167
|
+
}).fn(n) : {} : r ? A({
|
|
168
168
|
element: r,
|
|
169
169
|
padding: s
|
|
170
170
|
}).fn(n) : {};
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
import { offset as
|
|
2
|
-
import { createCoords as
|
|
3
|
-
import { getOverflowAncestors as $, isElement as v, getWindow as L, getFrameElement as
|
|
4
|
-
function
|
|
5
|
-
const e =
|
|
6
|
-
let
|
|
7
|
-
const o =
|
|
8
|
-
return c && (
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
1
|
+
import { offset as ot, shift as st, flip as rt, inline as ct, arrow as lt, computePosition as ft } from "./annotorious-react.es28.js";
|
|
2
|
+
import { createCoords as m, rectToClientRect as J, round as H, floor as A, max as E, min as z } from "./annotorious-react.es27.js";
|
|
3
|
+
import { getOverflowAncestors as $, isElement as v, getWindow as L, getFrameElement as K, getComputedStyle as R, getDocumentElement as O, isHTMLElement as b, isWebKit as Q, isTopLayer as M, getNodeName as S, isOverflowElement as _, getNodeScroll as I, getParentNode as W, isLastTraversableNode as N, isTableElement as ut, isContainingBlock as Y, getContainingBlock as ht } from "./annotorious-react.es21.js";
|
|
4
|
+
function Z(t) {
|
|
5
|
+
const e = R(t);
|
|
6
|
+
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
7
|
+
const o = b(t), r = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, c = H(n) !== r || H(i) !== s;
|
|
8
|
+
return c && (n = r, i = s), {
|
|
9
|
+
width: n,
|
|
10
|
+
height: i,
|
|
11
11
|
$: c
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function q(t) {
|
|
15
15
|
return v(t) ? t : t.contextElement;
|
|
16
16
|
}
|
|
17
17
|
function F(t) {
|
|
18
|
-
const e =
|
|
19
|
-
if (!
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
width:
|
|
18
|
+
const e = q(t);
|
|
19
|
+
if (!b(e))
|
|
20
|
+
return m(1);
|
|
21
|
+
const n = e.getBoundingClientRect(), {
|
|
22
|
+
width: i,
|
|
23
23
|
height: o,
|
|
24
24
|
$: r
|
|
25
|
-
} =
|
|
26
|
-
let s = (r ? H(
|
|
25
|
+
} = Z(e);
|
|
26
|
+
let s = (r ? H(n.width) : n.width) / i, c = (r ? H(n.height) : n.height) / o;
|
|
27
27
|
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
28
28
|
x: s,
|
|
29
29
|
y: c
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
32
|
+
const at = /* @__PURE__ */ m(0);
|
|
33
|
+
function X(t) {
|
|
34
34
|
const e = L(t);
|
|
35
|
-
return !
|
|
35
|
+
return !Q() || !e.visualViewport ? at : {
|
|
36
36
|
x: e.visualViewport.offsetLeft,
|
|
37
37
|
y: e.visualViewport.offsetTop
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return e === void 0 && (e = !1), !
|
|
40
|
+
function dt(t, e, n) {
|
|
41
|
+
return e === void 0 && (e = !1), !n || e && n !== L(t) ? !1 : e;
|
|
42
42
|
}
|
|
43
|
-
function T(t, e,
|
|
44
|
-
e === void 0 && (e = !1),
|
|
45
|
-
const o = t.getBoundingClientRect(), r =
|
|
46
|
-
let s =
|
|
47
|
-
e && (
|
|
48
|
-
const c =
|
|
43
|
+
function T(t, e, n, i) {
|
|
44
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
45
|
+
const o = t.getBoundingClientRect(), r = q(t);
|
|
46
|
+
let s = m(1);
|
|
47
|
+
e && (i ? v(i) && (s = F(i)) : s = F(t));
|
|
48
|
+
const c = dt(r, n, i) ? X(r) : m(0);
|
|
49
49
|
let l = (o.left + c.x) / s.x, f = (o.top + c.y) / s.y, u = o.width / s.x, h = o.height / s.y;
|
|
50
50
|
if (r) {
|
|
51
|
-
const p = L(r),
|
|
52
|
-
let
|
|
53
|
-
for (;
|
|
54
|
-
const w = F(
|
|
55
|
-
l *= w.x, f *= w.y, u *= w.x, h *= w.y, l += C, f += B,
|
|
51
|
+
const p = L(r), a = i && v(i) ? L(i) : i;
|
|
52
|
+
let y = p, g = K(y);
|
|
53
|
+
for (; g && i && a !== y; ) {
|
|
54
|
+
const w = F(g), d = g.getBoundingClientRect(), x = R(g), C = d.left + (g.clientLeft + parseFloat(x.paddingLeft)) * w.x, B = d.top + (g.clientTop + parseFloat(x.paddingTop)) * w.y;
|
|
55
|
+
l *= w.x, f *= w.y, u *= w.x, h *= w.y, l += C, f += B, y = L(g), g = K(y);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return J({
|
|
59
59
|
width: u,
|
|
60
60
|
height: h,
|
|
61
61
|
x: l,
|
|
62
62
|
y: f
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
return e ? e.left +
|
|
65
|
+
function k(t, e) {
|
|
66
|
+
const n = I(t).scrollLeft;
|
|
67
|
+
return e ? e.left + n : T(O(t)).left + n;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
const
|
|
69
|
+
function tt(t, e, n) {
|
|
70
|
+
n === void 0 && (n = !1);
|
|
71
|
+
const i = t.getBoundingClientRect(), o = i.left + e.scrollLeft - (n ? 0 : (
|
|
72
72
|
// RTL <body> scrollbar.
|
|
73
|
-
|
|
74
|
-
)), r =
|
|
73
|
+
k(t, i)
|
|
74
|
+
)), r = i.top + e.scrollTop;
|
|
75
75
|
return {
|
|
76
76
|
x: o,
|
|
77
77
|
y: r
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function gt(t) {
|
|
81
81
|
let {
|
|
82
82
|
elements: e,
|
|
83
|
-
rect:
|
|
84
|
-
offsetParent:
|
|
83
|
+
rect: n,
|
|
84
|
+
offsetParent: i,
|
|
85
85
|
strategy: o
|
|
86
86
|
} = t;
|
|
87
|
-
const r = o === "fixed", s =
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
87
|
+
const r = o === "fixed", s = O(i), c = e ? M(e.floating) : !1;
|
|
88
|
+
if (i === s || c && r)
|
|
89
|
+
return n;
|
|
90
90
|
let l = {
|
|
91
91
|
scrollLeft: 0,
|
|
92
92
|
scrollTop: 0
|
|
93
|
-
}, f =
|
|
94
|
-
const u =
|
|
95
|
-
if ((h || !h && !r) && ((S(
|
|
96
|
-
const
|
|
97
|
-
f = F(
|
|
93
|
+
}, f = m(1);
|
|
94
|
+
const u = m(0), h = b(i);
|
|
95
|
+
if ((h || !h && !r) && ((S(i) !== "body" || _(s)) && (l = I(i)), b(i))) {
|
|
96
|
+
const a = T(i);
|
|
97
|
+
f = F(i), u.x = a.x + i.clientLeft, u.y = a.y + i.clientTop;
|
|
98
98
|
}
|
|
99
|
-
const p = s && !h && !r ?
|
|
99
|
+
const p = s && !h && !r ? tt(s, l, !0) : m(0);
|
|
100
100
|
return {
|
|
101
|
-
width:
|
|
102
|
-
height:
|
|
103
|
-
x:
|
|
104
|
-
y:
|
|
101
|
+
width: n.width * f.x,
|
|
102
|
+
height: n.height * f.y,
|
|
103
|
+
x: n.x * f.x - l.scrollLeft * f.x + u.x + p.x,
|
|
104
|
+
y: n.y * f.y - l.scrollTop * f.y + u.y + p.y
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function pt(t) {
|
|
108
108
|
return Array.from(t.getClientRects());
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
const e =
|
|
112
|
-
let s = -
|
|
113
|
-
const c = -
|
|
114
|
-
return
|
|
110
|
+
function wt(t) {
|
|
111
|
+
const e = O(t), n = I(t), i = t.ownerDocument.body, o = E(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), r = E(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
112
|
+
let s = -n.scrollLeft + k(t);
|
|
113
|
+
const c = -n.scrollTop;
|
|
114
|
+
return R(i).direction === "rtl" && (s += E(e.clientWidth, i.clientWidth) - o), {
|
|
115
115
|
width: o,
|
|
116
116
|
height: r,
|
|
117
117
|
x: s,
|
|
118
118
|
y: c
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
let r =
|
|
121
|
+
function mt(t, e) {
|
|
122
|
+
const n = L(t), i = O(t), o = n.visualViewport;
|
|
123
|
+
let r = i.clientWidth, s = i.clientHeight, c = 0, l = 0;
|
|
124
124
|
if (o) {
|
|
125
125
|
r = o.width, s = o.height;
|
|
126
|
-
const f =
|
|
126
|
+
const f = Q();
|
|
127
127
|
(!f || f && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
|
|
128
128
|
}
|
|
129
129
|
return {
|
|
@@ -133,8 +133,8 @@ function pt(t, e) {
|
|
|
133
133
|
y: l
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
const
|
|
136
|
+
function yt(t, e) {
|
|
137
|
+
const n = T(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, r = b(t) ? F(t) : m(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = o * r.x, f = i * r.y;
|
|
138
138
|
return {
|
|
139
139
|
width: s,
|
|
140
140
|
height: c,
|
|
@@ -142,53 +142,53 @@ function wt(t, e) {
|
|
|
142
142
|
y: f
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
let
|
|
145
|
+
function j(t, e, n) {
|
|
146
|
+
let i;
|
|
147
147
|
if (e === "viewport")
|
|
148
|
-
|
|
148
|
+
i = mt(t, n);
|
|
149
149
|
else if (e === "document")
|
|
150
|
-
|
|
150
|
+
i = wt(O(t));
|
|
151
151
|
else if (v(e))
|
|
152
|
-
|
|
152
|
+
i = yt(e, n);
|
|
153
153
|
else {
|
|
154
|
-
const o =
|
|
155
|
-
|
|
154
|
+
const o = X(t);
|
|
155
|
+
i = {
|
|
156
156
|
x: e.x - o.x,
|
|
157
157
|
y: e.y - o.y,
|
|
158
158
|
width: e.width,
|
|
159
159
|
height: e.height
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
return
|
|
162
|
+
return J(i);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
const
|
|
166
|
-
return
|
|
164
|
+
function et(t, e) {
|
|
165
|
+
const n = W(t);
|
|
166
|
+
return n === e || !v(n) || N(n) ? !1 : R(n).position === "fixed" || et(n, e);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
172
|
-
let
|
|
173
|
-
const r =
|
|
168
|
+
function xt(t, e) {
|
|
169
|
+
const n = e.get(t);
|
|
170
|
+
if (n)
|
|
171
|
+
return n;
|
|
172
|
+
let i = $(t, [], !1).filter((c) => v(c) && S(c) !== "body"), o = null;
|
|
173
|
+
const r = R(t).position === "fixed";
|
|
174
174
|
let s = r ? W(t) : t;
|
|
175
175
|
for (; v(s) && !N(s); ) {
|
|
176
|
-
const c =
|
|
177
|
-
!l && c.position === "fixed" && (o = null), (r ? !l && !o : !l && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l &&
|
|
176
|
+
const c = R(s), l = Y(s);
|
|
177
|
+
!l && c.position === "fixed" && (o = null), (r ? !l && !o : !l && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l && et(t, s)) ? i = i.filter((u) => u !== s) : o = c, s = W(s);
|
|
178
178
|
}
|
|
179
|
-
return e.set(t,
|
|
179
|
+
return e.set(t, i), i;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function vt(t) {
|
|
182
182
|
let {
|
|
183
183
|
element: e,
|
|
184
|
-
boundary:
|
|
185
|
-
rootBoundary:
|
|
184
|
+
boundary: n,
|
|
185
|
+
rootBoundary: i,
|
|
186
186
|
strategy: o
|
|
187
187
|
} = t;
|
|
188
|
-
const s = [...
|
|
189
|
-
const h =
|
|
188
|
+
const s = [...n === "clippingAncestors" ? M(e) ? [] : xt(e, this._c) : [].concat(n), i], c = s[0], l = s.reduce((f, u) => {
|
|
189
|
+
const h = j(e, u, o);
|
|
190
190
|
return f.top = E(h.top, f.top), f.right = z(h.right, f.right), f.bottom = z(h.bottom, f.bottom), f.left = E(h.left, f.left), f;
|
|
191
|
-
},
|
|
191
|
+
}, j(e, c, o));
|
|
192
192
|
return {
|
|
193
193
|
width: l.right - l.left,
|
|
194
194
|
height: l.bottom - l.top,
|
|
@@ -196,29 +196,29 @@ function yt(t) {
|
|
|
196
196
|
y: l.top
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function Rt(t) {
|
|
200
200
|
const {
|
|
201
201
|
width: e,
|
|
202
|
-
height:
|
|
203
|
-
} =
|
|
202
|
+
height: n
|
|
203
|
+
} = Z(t);
|
|
204
204
|
return {
|
|
205
205
|
width: e,
|
|
206
|
-
height:
|
|
206
|
+
height: n
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
const
|
|
209
|
+
function Ot(t, e, n) {
|
|
210
|
+
const i = b(e), o = O(e), r = n === "fixed", s = T(t, !0, r, e);
|
|
211
211
|
let c = {
|
|
212
212
|
scrollLeft: 0,
|
|
213
213
|
scrollTop: 0
|
|
214
214
|
};
|
|
215
|
-
const l =
|
|
216
|
-
if (
|
|
217
|
-
if ((S(e) !== "body" || _(o)) && (c =
|
|
215
|
+
const l = m(0);
|
|
216
|
+
if (i || !i && !r)
|
|
217
|
+
if ((S(e) !== "body" || _(o)) && (c = I(e)), i) {
|
|
218
218
|
const p = T(e, !0, r, e);
|
|
219
219
|
l.x = p.x + e.clientLeft, l.y = p.y + e.clientTop;
|
|
220
|
-
} else o && (l.x =
|
|
221
|
-
const f = o && !
|
|
220
|
+
} else o && (l.x = k(o));
|
|
221
|
+
const f = o && !i && !r ? tt(o, c) : m(0), u = s.left + c.scrollLeft - l.x - f.x, h = s.top + c.scrollTop - l.y - f.y;
|
|
222
222
|
return {
|
|
223
223
|
x: u,
|
|
224
224
|
y: h,
|
|
@@ -227,165 +227,168 @@ function vt(t, e, i) {
|
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
function V(t) {
|
|
230
|
-
return
|
|
230
|
+
return R(t).position === "static";
|
|
231
231
|
}
|
|
232
|
-
function
|
|
233
|
-
if (!
|
|
232
|
+
function G(t, e) {
|
|
233
|
+
if (!b(t) || R(t).position === "fixed")
|
|
234
234
|
return null;
|
|
235
235
|
if (e)
|
|
236
236
|
return e(t);
|
|
237
|
-
let
|
|
238
|
-
return
|
|
237
|
+
let n = t.offsetParent;
|
|
238
|
+
return O(t) === n && (n = n.ownerDocument.body), n;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
241
|
-
const
|
|
240
|
+
function nt(t, e) {
|
|
241
|
+
const n = L(t);
|
|
242
242
|
if (M(t))
|
|
243
|
-
return
|
|
244
|
-
if (!
|
|
243
|
+
return n;
|
|
244
|
+
if (!b(t)) {
|
|
245
245
|
let o = W(t);
|
|
246
246
|
for (; o && !N(o); ) {
|
|
247
247
|
if (v(o) && !V(o))
|
|
248
248
|
return o;
|
|
249
249
|
o = W(o);
|
|
250
250
|
}
|
|
251
|
-
return
|
|
251
|
+
return n;
|
|
252
252
|
}
|
|
253
|
-
let
|
|
254
|
-
for (;
|
|
255
|
-
|
|
256
|
-
return
|
|
253
|
+
let i = G(t, e);
|
|
254
|
+
for (; i && ut(i) && V(i); )
|
|
255
|
+
i = G(i, e);
|
|
256
|
+
return i && N(i) && V(i) && !Y(i) ? n : i || ht(t) || n;
|
|
257
257
|
}
|
|
258
258
|
const bt = async function(t) {
|
|
259
|
-
const e = this.getOffsetParent ||
|
|
259
|
+
const e = this.getOffsetParent || nt, n = this.getDimensions, i = await n(t.floating);
|
|
260
260
|
return {
|
|
261
|
-
reference:
|
|
261
|
+
reference: Ot(t.reference, await e(t.floating), t.strategy),
|
|
262
262
|
floating: {
|
|
263
263
|
x: 0,
|
|
264
264
|
y: 0,
|
|
265
|
-
width:
|
|
266
|
-
height:
|
|
265
|
+
width: i.width,
|
|
266
|
+
height: i.height
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
};
|
|
270
|
-
function
|
|
271
|
-
return
|
|
270
|
+
function Ct(t) {
|
|
271
|
+
return R(t).direction === "rtl";
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
275
|
-
getDocumentElement:
|
|
276
|
-
getClippingRect:
|
|
277
|
-
getOffsetParent:
|
|
273
|
+
const Lt = {
|
|
274
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: gt,
|
|
275
|
+
getDocumentElement: O,
|
|
276
|
+
getClippingRect: vt,
|
|
277
|
+
getOffsetParent: nt,
|
|
278
278
|
getElementRects: bt,
|
|
279
|
-
getClientRects:
|
|
280
|
-
getDimensions:
|
|
279
|
+
getClientRects: pt,
|
|
280
|
+
getDimensions: Rt,
|
|
281
281
|
getScale: F,
|
|
282
282
|
isElement: v,
|
|
283
|
-
isRTL:
|
|
283
|
+
isRTL: Ct
|
|
284
284
|
};
|
|
285
|
-
function
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
function it(t, e) {
|
|
286
|
+
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
287
|
+
}
|
|
288
|
+
function Tt(t, e) {
|
|
289
|
+
let n = null, i;
|
|
290
|
+
const o = O(t);
|
|
288
291
|
function r() {
|
|
289
292
|
var c;
|
|
290
|
-
clearTimeout(
|
|
293
|
+
clearTimeout(i), (c = n) == null || c.disconnect(), n = null;
|
|
291
294
|
}
|
|
292
295
|
function s(c, l) {
|
|
293
296
|
c === void 0 && (c = !1), l === void 0 && (l = 1), r();
|
|
294
|
-
const {
|
|
295
|
-
left:
|
|
296
|
-
top:
|
|
297
|
-
width:
|
|
298
|
-
height:
|
|
299
|
-
} =
|
|
300
|
-
if (c || e(), !
|
|
297
|
+
const f = t.getBoundingClientRect(), {
|
|
298
|
+
left: u,
|
|
299
|
+
top: h,
|
|
300
|
+
width: p,
|
|
301
|
+
height: a
|
|
302
|
+
} = f;
|
|
303
|
+
if (c || e(), !p || !a)
|
|
301
304
|
return;
|
|
302
|
-
const
|
|
303
|
-
rootMargin: -
|
|
305
|
+
const y = A(h), g = A(o.clientWidth - (u + p)), w = A(o.clientHeight - (h + a)), d = A(u), C = {
|
|
306
|
+
rootMargin: -y + "px " + -g + "px " + -w + "px " + -d + "px",
|
|
304
307
|
threshold: E(0, z(1, l)) || 1
|
|
305
308
|
};
|
|
306
|
-
let
|
|
307
|
-
function
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
310
|
-
if (!
|
|
309
|
+
let B = !0;
|
|
310
|
+
function P(U) {
|
|
311
|
+
const D = U[0].intersectionRatio;
|
|
312
|
+
if (D !== l) {
|
|
313
|
+
if (!B)
|
|
311
314
|
return s();
|
|
312
|
-
|
|
315
|
+
D ? s(!1, D) : i = setTimeout(() => {
|
|
313
316
|
s(!1, 1e-7);
|
|
314
317
|
}, 1e3);
|
|
315
318
|
}
|
|
316
|
-
|
|
319
|
+
D === 1 && !it(f, t.getBoundingClientRect()) && s(), B = !1;
|
|
317
320
|
}
|
|
318
321
|
try {
|
|
319
|
-
|
|
320
|
-
...
|
|
322
|
+
n = new IntersectionObserver(P, {
|
|
323
|
+
...C,
|
|
321
324
|
// Handle <iframe>s
|
|
322
325
|
root: o.ownerDocument
|
|
323
326
|
});
|
|
324
327
|
} catch {
|
|
325
|
-
|
|
328
|
+
n = new IntersectionObserver(P, C);
|
|
326
329
|
}
|
|
327
|
-
|
|
330
|
+
n.observe(t);
|
|
328
331
|
}
|
|
329
332
|
return s(!0), r;
|
|
330
333
|
}
|
|
331
|
-
function
|
|
332
|
-
|
|
334
|
+
function Bt(t, e, n, i) {
|
|
335
|
+
i === void 0 && (i = {});
|
|
333
336
|
const {
|
|
334
337
|
ancestorScroll: o = !0,
|
|
335
338
|
ancestorResize: r = !0,
|
|
336
339
|
elementResize: s = typeof ResizeObserver == "function",
|
|
337
340
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
338
341
|
animationFrame: l = !1
|
|
339
|
-
} =
|
|
342
|
+
} = i, f = q(t), u = o || r ? [...f ? $(f) : [], ...$(e)] : [];
|
|
340
343
|
u.forEach((d) => {
|
|
341
|
-
o && d.addEventListener("scroll",
|
|
344
|
+
o && d.addEventListener("scroll", n, {
|
|
342
345
|
passive: !0
|
|
343
|
-
}), r && d.addEventListener("resize",
|
|
346
|
+
}), r && d.addEventListener("resize", n);
|
|
344
347
|
});
|
|
345
|
-
const h = f && c ?
|
|
346
|
-
let p = -1,
|
|
347
|
-
s && (
|
|
348
|
-
let [
|
|
349
|
-
|
|
348
|
+
const h = f && c ? Tt(f, n) : null;
|
|
349
|
+
let p = -1, a = null;
|
|
350
|
+
s && (a = new ResizeObserver((d) => {
|
|
351
|
+
let [x] = d;
|
|
352
|
+
x && x.target === f && a && (a.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
350
353
|
var C;
|
|
351
|
-
(C =
|
|
352
|
-
})),
|
|
353
|
-
}), f && !l &&
|
|
354
|
-
let
|
|
354
|
+
(C = a) == null || C.observe(e);
|
|
355
|
+
})), n();
|
|
356
|
+
}), f && !l && a.observe(f), a.observe(e));
|
|
357
|
+
let y, g = l ? T(t) : null;
|
|
355
358
|
l && w();
|
|
356
359
|
function w() {
|
|
357
360
|
const d = T(t);
|
|
358
|
-
|
|
361
|
+
g && !it(g, d) && n(), g = d, y = requestAnimationFrame(w);
|
|
359
362
|
}
|
|
360
|
-
return
|
|
363
|
+
return n(), () => {
|
|
361
364
|
var d;
|
|
362
|
-
u.forEach((
|
|
363
|
-
o &&
|
|
364
|
-
}), h == null || h(), (d =
|
|
365
|
+
u.forEach((x) => {
|
|
366
|
+
o && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
|
|
367
|
+
}), h == null || h(), (d = a) == null || d.disconnect(), a = null, l && cancelAnimationFrame(y);
|
|
365
368
|
};
|
|
366
369
|
}
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
platform:
|
|
370
|
-
...
|
|
370
|
+
const Dt = ot, At = st, Ht = rt, Nt = lt, It = ct, Vt = (t, e, n) => {
|
|
371
|
+
const i = /* @__PURE__ */ new Map(), o = {
|
|
372
|
+
platform: Lt,
|
|
373
|
+
...n
|
|
371
374
|
}, r = {
|
|
372
375
|
...o.platform,
|
|
373
|
-
_c:
|
|
376
|
+
_c: i
|
|
374
377
|
};
|
|
375
|
-
return
|
|
378
|
+
return ft(t, e, {
|
|
376
379
|
...o,
|
|
377
380
|
platform: r
|
|
378
381
|
});
|
|
379
382
|
};
|
|
380
383
|
export {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
384
|
+
Nt as arrow,
|
|
385
|
+
Bt as autoUpdate,
|
|
386
|
+
Vt as computePosition,
|
|
387
|
+
Ht as flip,
|
|
385
388
|
$ as getOverflowAncestors,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
It as inline,
|
|
390
|
+
Dt as offset,
|
|
391
|
+
Lt as platform,
|
|
392
|
+
At as shift
|
|
390
393
|
};
|
|
391
394
|
//# sourceMappingURL=annotorious-react.es16.js.map
|