@annotorious/react 3.1.4 → 3.1.5
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.d.ts.map +1 -1
- package/dist/AnnotoriousPlugin.d.ts.map +1 -1
- package/dist/ImageAnnotationPopup.d.ts.map +1 -1
- package/dist/ImageAnnotator.d.ts.map +1 -1
- package/dist/annotorious-react.es10.js +7 -7
- package/dist/annotorious-react.es11.js +5 -5
- package/dist/annotorious-react.es12.js +40 -40
- package/dist/annotorious-react.es12.js.map +1 -1
- package/dist/annotorious-react.es14.js +379 -185
- package/dist/annotorious-react.es14.js.map +1 -1
- package/dist/annotorious-react.es15.js +185 -379
- package/dist/annotorious-react.es15.js.map +1 -1
- package/dist/annotorious-react.es17.js +42 -42
- package/dist/annotorious-react.es2.js +50 -50
- package/dist/annotorious-react.es22.js +184 -184
- package/dist/annotorious-react.es4.js +8 -8
- package/dist/annotorious-react.es8.js +4 -4
- package/dist/annotorious-react.es9.js +2 -2
- package/dist/openseadragon/OpenSeadragonAnnotationPopup.d.ts.map +1 -1
- package/dist/openseadragon/setPosition.d.ts.map +1 -1
- package/dist/state/AnnotoriousZustand.d.ts.map +1 -1
- package/dist/useDebounce.d.ts.map +1 -1
- package/dist/utils/toClientRects.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1,394 +1,200 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
width: i,
|
|
23
|
-
height: o,
|
|
24
|
-
$: r
|
|
25
|
-
} = Z(e);
|
|
26
|
-
let s = (r ? H(n.width) : n.width) / i, c = (r ? H(n.height) : n.height) / o;
|
|
27
|
-
return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
28
|
-
x: s,
|
|
29
|
-
y: c
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const at = /* @__PURE__ */ m(0);
|
|
33
|
-
function X(t) {
|
|
34
|
-
const e = L(t);
|
|
35
|
-
return !Q() || !e.visualViewport ? at : {
|
|
36
|
-
x: e.visualViewport.offsetLeft,
|
|
37
|
-
y: e.visualViewport.offsetTop
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function dt(t, e, n) {
|
|
41
|
-
return e === void 0 && (e = !1), !n || e && n !== L(t) ? !1 : e;
|
|
42
|
-
}
|
|
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
|
-
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
|
-
if (r) {
|
|
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);
|
|
1
|
+
import { inline as I, offset as J, flip as K, shift as N, arrow as v, computePosition as Q } from "./annotorious-react.es14.js";
|
|
2
|
+
import { autoUpdate as le, platform as ce } from "./annotorious-react.es14.js";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { useLayoutEffect as T, useEffect as X } from "react";
|
|
5
|
+
import * as Y from "react-dom";
|
|
6
|
+
var R = typeof document < "u" ? T : X;
|
|
7
|
+
function h(e, t) {
|
|
8
|
+
if (e === t)
|
|
9
|
+
return !0;
|
|
10
|
+
if (typeof e != typeof t)
|
|
11
|
+
return !1;
|
|
12
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
13
|
+
return !0;
|
|
14
|
+
let n, r, s;
|
|
15
|
+
if (e && t && typeof e == "object") {
|
|
16
|
+
if (Array.isArray(e)) {
|
|
17
|
+
if (n = e.length, n !== t.length) return !1;
|
|
18
|
+
for (r = n; r-- !== 0; )
|
|
19
|
+
if (!h(e[r], t[r]))
|
|
20
|
+
return !1;
|
|
21
|
+
return !0;
|
|
56
22
|
}
|
|
23
|
+
if (s = Object.keys(e), n = s.length, n !== Object.keys(t).length)
|
|
24
|
+
return !1;
|
|
25
|
+
for (r = n; r-- !== 0; )
|
|
26
|
+
if (!{}.hasOwnProperty.call(t, s[r]))
|
|
27
|
+
return !1;
|
|
28
|
+
for (r = n; r-- !== 0; ) {
|
|
29
|
+
const p = s[r];
|
|
30
|
+
if (!(p === "_owner" && e.$$typeof) && !h(e[p], t[p]))
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
33
|
+
return !0;
|
|
57
34
|
}
|
|
58
|
-
return
|
|
59
|
-
width: u,
|
|
60
|
-
height: h,
|
|
61
|
-
x: l,
|
|
62
|
-
y: f
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function k(t, e) {
|
|
66
|
-
const n = I(t).scrollLeft;
|
|
67
|
-
return e ? e.left + n : T(O(t)).left + n;
|
|
68
|
-
}
|
|
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
|
-
// RTL <body> scrollbar.
|
|
73
|
-
k(t, i)
|
|
74
|
-
)), r = i.top + e.scrollTop;
|
|
75
|
-
return {
|
|
76
|
-
x: o,
|
|
77
|
-
y: r
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function gt(t) {
|
|
81
|
-
let {
|
|
82
|
-
elements: e,
|
|
83
|
-
rect: n,
|
|
84
|
-
offsetParent: i,
|
|
85
|
-
strategy: o
|
|
86
|
-
} = t;
|
|
87
|
-
const r = o === "fixed", s = O(i), c = e ? M(e.floating) : !1;
|
|
88
|
-
if (i === s || c && r)
|
|
89
|
-
return n;
|
|
90
|
-
let l = {
|
|
91
|
-
scrollLeft: 0,
|
|
92
|
-
scrollTop: 0
|
|
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
|
-
}
|
|
99
|
-
const p = s && !h && !r ? tt(s, l, !0) : m(0);
|
|
100
|
-
return {
|
|
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
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function pt(t) {
|
|
108
|
-
return Array.from(t.getClientRects());
|
|
109
|
-
}
|
|
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
|
-
width: o,
|
|
116
|
-
height: r,
|
|
117
|
-
x: s,
|
|
118
|
-
y: c
|
|
119
|
-
};
|
|
120
|
-
}
|
|
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
|
-
if (o) {
|
|
125
|
-
r = o.width, s = o.height;
|
|
126
|
-
const f = Q();
|
|
127
|
-
(!f || f && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
width: r,
|
|
131
|
-
height: s,
|
|
132
|
-
x: c,
|
|
133
|
-
y: l
|
|
134
|
-
};
|
|
135
|
-
}
|
|
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
|
-
return {
|
|
139
|
-
width: s,
|
|
140
|
-
height: c,
|
|
141
|
-
x: l,
|
|
142
|
-
y: f
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function j(t, e, n) {
|
|
146
|
-
let i;
|
|
147
|
-
if (e === "viewport")
|
|
148
|
-
i = mt(t, n);
|
|
149
|
-
else if (e === "document")
|
|
150
|
-
i = wt(O(t));
|
|
151
|
-
else if (v(e))
|
|
152
|
-
i = yt(e, n);
|
|
153
|
-
else {
|
|
154
|
-
const o = X(t);
|
|
155
|
-
i = {
|
|
156
|
-
x: e.x - o.x,
|
|
157
|
-
y: e.y - o.y,
|
|
158
|
-
width: e.width,
|
|
159
|
-
height: e.height
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
return J(i);
|
|
35
|
+
return e !== e && t !== t;
|
|
163
36
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
return n === e || !v(n) || N(n) ? !1 : R(n).position === "fixed" || et(n, e);
|
|
37
|
+
function q(e) {
|
|
38
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
167
39
|
}
|
|
168
|
-
function
|
|
169
|
-
const n = e
|
|
170
|
-
|
|
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
|
-
let s = r ? W(t) : t;
|
|
175
|
-
for (; v(s) && !N(s); ) {
|
|
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
|
-
}
|
|
179
|
-
return e.set(t, i), i;
|
|
40
|
+
function A(e, t) {
|
|
41
|
+
const n = q(e);
|
|
42
|
+
return Math.round(t * n) / n;
|
|
180
43
|
}
|
|
181
|
-
function
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
strategy: o
|
|
187
|
-
} = t;
|
|
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
|
-
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
|
-
}, j(e, c, o));
|
|
192
|
-
return {
|
|
193
|
-
width: l.right - l.left,
|
|
194
|
-
height: l.bottom - l.top,
|
|
195
|
-
x: l.left,
|
|
196
|
-
y: l.top
|
|
197
|
-
};
|
|
44
|
+
function $(e) {
|
|
45
|
+
const t = f.useRef(e);
|
|
46
|
+
return R(() => {
|
|
47
|
+
t.current = e;
|
|
48
|
+
}), t;
|
|
198
49
|
}
|
|
199
|
-
function
|
|
50
|
+
function te(e) {
|
|
51
|
+
e === void 0 && (e = {});
|
|
200
52
|
const {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
function V(t) {
|
|
230
|
-
return R(t).position === "static";
|
|
231
|
-
}
|
|
232
|
-
function G(t, e) {
|
|
233
|
-
if (!b(t) || R(t).position === "fixed")
|
|
234
|
-
return null;
|
|
235
|
-
if (e)
|
|
236
|
-
return e(t);
|
|
237
|
-
let n = t.offsetParent;
|
|
238
|
-
return O(t) === n && (n = n.ownerDocument.body), n;
|
|
239
|
-
}
|
|
240
|
-
function nt(t, e) {
|
|
241
|
-
const n = L(t);
|
|
242
|
-
if (M(t))
|
|
243
|
-
return n;
|
|
244
|
-
if (!b(t)) {
|
|
245
|
-
let o = W(t);
|
|
246
|
-
for (; o && !N(o); ) {
|
|
247
|
-
if (v(o) && !V(o))
|
|
248
|
-
return o;
|
|
249
|
-
o = W(o);
|
|
250
|
-
}
|
|
251
|
-
return n;
|
|
252
|
-
}
|
|
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
|
-
}
|
|
258
|
-
const bt = async function(t) {
|
|
259
|
-
const e = this.getOffsetParent || nt, n = this.getDimensions, i = await n(t.floating);
|
|
260
|
-
return {
|
|
261
|
-
reference: Ot(t.reference, await e(t.floating), t.strategy),
|
|
262
|
-
floating: {
|
|
263
|
-
x: 0,
|
|
264
|
-
y: 0,
|
|
265
|
-
width: i.width,
|
|
266
|
-
height: i.height
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
function Ct(t) {
|
|
271
|
-
return R(t).direction === "rtl";
|
|
272
|
-
}
|
|
273
|
-
const Lt = {
|
|
274
|
-
convertOffsetParentRelativeRectToViewportRelativeRect: gt,
|
|
275
|
-
getDocumentElement: O,
|
|
276
|
-
getClippingRect: vt,
|
|
277
|
-
getOffsetParent: nt,
|
|
278
|
-
getElementRects: bt,
|
|
279
|
-
getClientRects: pt,
|
|
280
|
-
getDimensions: Rt,
|
|
281
|
-
getScale: F,
|
|
282
|
-
isElement: v,
|
|
283
|
-
isRTL: Ct
|
|
284
|
-
};
|
|
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);
|
|
291
|
-
function r() {
|
|
292
|
-
var c;
|
|
293
|
-
clearTimeout(i), (c = n) == null || c.disconnect(), n = null;
|
|
294
|
-
}
|
|
295
|
-
function s(c, l) {
|
|
296
|
-
c === void 0 && (c = !1), l === void 0 && (l = 1), r();
|
|
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)
|
|
53
|
+
placement: t = "bottom",
|
|
54
|
+
strategy: n = "absolute",
|
|
55
|
+
middleware: r = [],
|
|
56
|
+
platform: s,
|
|
57
|
+
elements: {
|
|
58
|
+
reference: p,
|
|
59
|
+
floating: B
|
|
60
|
+
} = {},
|
|
61
|
+
transform: k = !0,
|
|
62
|
+
whileElementsMounted: D,
|
|
63
|
+
open: x
|
|
64
|
+
} = e, [i, O] = f.useState({
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 0,
|
|
67
|
+
strategy: n,
|
|
68
|
+
placement: t,
|
|
69
|
+
middlewareData: {},
|
|
70
|
+
isPositioned: !1
|
|
71
|
+
}), [M, U] = f.useState(r);
|
|
72
|
+
h(M, r) || U(r);
|
|
73
|
+
const [V, W] = f.useState(null), [z, G] = f.useState(null), _ = f.useCallback((o) => {
|
|
74
|
+
o !== a.current && (a.current = o, W(o));
|
|
75
|
+
}, []), C = f.useCallback((o) => {
|
|
76
|
+
o !== d.current && (d.current = o, G(o));
|
|
77
|
+
}, []), u = p || V, l = B || z, a = f.useRef(null), d = f.useRef(null), y = f.useRef(i), H = D != null, P = $(D), S = $(s), F = $(x), g = f.useCallback(() => {
|
|
78
|
+
if (!a.current || !d.current)
|
|
304
79
|
return;
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
80
|
+
const o = {
|
|
81
|
+
placement: t,
|
|
82
|
+
strategy: n,
|
|
83
|
+
middleware: M
|
|
308
84
|
};
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
85
|
+
S.current && (o.platform = S.current), Q(a.current, d.current, o).then((w) => {
|
|
86
|
+
const m = {
|
|
87
|
+
...w,
|
|
88
|
+
// The floating element's position may be recomputed while it's closed
|
|
89
|
+
// but still mounted (such as when transitioning out). To ensure
|
|
90
|
+
// `isPositioned` will be `false` initially on the next open, avoid
|
|
91
|
+
// setting it to `true` when `open === false` (must be specified).
|
|
92
|
+
isPositioned: F.current !== !1
|
|
93
|
+
};
|
|
94
|
+
E.current && !h(y.current, m) && (y.current = m, Y.flushSync(() => {
|
|
95
|
+
O(m);
|
|
96
|
+
}));
|
|
97
|
+
});
|
|
98
|
+
}, [M, t, n, S, F]);
|
|
99
|
+
R(() => {
|
|
100
|
+
x === !1 && y.current.isPositioned && (y.current.isPositioned = !1, O((o) => ({
|
|
101
|
+
...o,
|
|
102
|
+
isPositioned: !1
|
|
103
|
+
})));
|
|
104
|
+
}, [x]);
|
|
105
|
+
const E = f.useRef(!1);
|
|
106
|
+
R(() => (E.current = !0, () => {
|
|
107
|
+
E.current = !1;
|
|
108
|
+
}), []), R(() => {
|
|
109
|
+
if (u && (a.current = u), l && (d.current = l), u && l) {
|
|
110
|
+
if (P.current)
|
|
111
|
+
return P.current(u, l, g);
|
|
112
|
+
g();
|
|
320
113
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
114
|
+
}, [u, l, g, P, H]);
|
|
115
|
+
const j = f.useMemo(() => ({
|
|
116
|
+
reference: a,
|
|
117
|
+
floating: d,
|
|
118
|
+
setReference: _,
|
|
119
|
+
setFloating: C
|
|
120
|
+
}), [_, C]), c = f.useMemo(() => ({
|
|
121
|
+
reference: u,
|
|
122
|
+
floating: l
|
|
123
|
+
}), [u, l]), L = f.useMemo(() => {
|
|
124
|
+
const o = {
|
|
125
|
+
position: n,
|
|
126
|
+
left: 0,
|
|
127
|
+
top: 0
|
|
128
|
+
};
|
|
129
|
+
if (!c.floating)
|
|
130
|
+
return o;
|
|
131
|
+
const w = A(c.floating, i.x), m = A(c.floating, i.y);
|
|
132
|
+
return k ? {
|
|
133
|
+
...o,
|
|
134
|
+
transform: "translate(" + w + "px, " + m + "px)",
|
|
135
|
+
...q(c.floating) >= 1.5 && {
|
|
136
|
+
willChange: "transform"
|
|
137
|
+
}
|
|
138
|
+
} : {
|
|
139
|
+
position: n,
|
|
140
|
+
left: w,
|
|
141
|
+
top: m
|
|
142
|
+
};
|
|
143
|
+
}, [n, k, c.floating, i.x, i.y]);
|
|
144
|
+
return f.useMemo(() => ({
|
|
145
|
+
...i,
|
|
146
|
+
update: g,
|
|
147
|
+
refs: j,
|
|
148
|
+
elements: c,
|
|
149
|
+
floatingStyles: L
|
|
150
|
+
}), [i, g, j, c, L]);
|
|
151
|
+
}
|
|
152
|
+
const Z = (e) => {
|
|
153
|
+
function t(n) {
|
|
154
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
362
155
|
}
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
156
|
+
return {
|
|
157
|
+
name: "arrow",
|
|
158
|
+
options: e,
|
|
159
|
+
fn(n) {
|
|
160
|
+
const {
|
|
161
|
+
element: r,
|
|
162
|
+
padding: s
|
|
163
|
+
} = typeof e == "function" ? e(n) : e;
|
|
164
|
+
return r && t(r) ? r.current != null ? v({
|
|
165
|
+
element: r.current,
|
|
166
|
+
padding: s
|
|
167
|
+
}).fn(n) : {} : r ? v({
|
|
168
|
+
element: r,
|
|
169
|
+
padding: s
|
|
170
|
+
}).fn(n) : {};
|
|
171
|
+
}
|
|
377
172
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
173
|
+
}, ne = (e, t) => ({
|
|
174
|
+
...J(e),
|
|
175
|
+
options: [e, t]
|
|
176
|
+
}), re = (e, t) => ({
|
|
177
|
+
...N(e),
|
|
178
|
+
options: [e, t]
|
|
179
|
+
}), fe = (e, t) => ({
|
|
180
|
+
...K(e),
|
|
181
|
+
options: [e, t]
|
|
182
|
+
}), oe = (e, t) => ({
|
|
183
|
+
...I(e),
|
|
184
|
+
options: [e, t]
|
|
185
|
+
}), se = (e, t) => ({
|
|
186
|
+
...Z(e),
|
|
187
|
+
options: [e, t]
|
|
188
|
+
});
|
|
383
189
|
export {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
190
|
+
se as arrow,
|
|
191
|
+
le as autoUpdate,
|
|
192
|
+
Q as computePosition,
|
|
193
|
+
fe as flip,
|
|
194
|
+
oe as inline,
|
|
195
|
+
ne as offset,
|
|
196
|
+
ce as platform,
|
|
197
|
+
re as shift,
|
|
198
|
+
te as useFloating
|
|
393
199
|
};
|
|
394
200
|
//# sourceMappingURL=annotorious-react.es15.js.map
|