@annotorious/react 3.7.20 → 3.7.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.es11.js.map +1 -1
- package/dist/annotorious-react.es14.js.map +1 -1
- package/dist/annotorious-react.es16.js +188 -187
- package/dist/annotorious-react.es16.js.map +1 -1
- package/dist/annotorious-react.es17.js +113 -93
- package/dist/annotorious-react.es17.js.map +1 -1
- package/dist/annotorious-react.es20.js +97 -97
- package/dist/annotorious-react.es20.js.map +1 -1
- package/dist/annotorious-react.es24.js +66 -68
- package/dist/annotorious-react.es24.js.map +1 -1
- package/dist/annotorious-react.es25.js +214 -214
- package/dist/annotorious-react.es25.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1,273 +1,273 @@
|
|
|
1
|
-
import { evaluate as
|
|
2
|
-
function
|
|
1
|
+
import { evaluate as X, rectToClientRect as _, getPaddingObject as z, getSide as F, getSideAxis as V, getOppositePlacement as J, getExpandedPlacements as K, getOppositeAxisPlacements as Q, getAlignmentSides as Z, clamp as $, getAlignmentAxis as N, getAlignment as H, min as Y, max as W, getOppositeAxis as tt, getAxisLength as U } from "./annotorious-react.es24.js";
|
|
2
|
+
function I(n, c, l) {
|
|
3
3
|
let {
|
|
4
4
|
reference: e,
|
|
5
|
-
floating:
|
|
6
|
-
} =
|
|
7
|
-
const t =
|
|
8
|
-
let
|
|
5
|
+
floating: i
|
|
6
|
+
} = n;
|
|
7
|
+
const t = V(c), r = N(c), f = U(r), d = F(c), u = t === "y", x = e.x + e.width / 2 - i.width / 2, o = e.y + e.height / 2 - i.height / 2, m = e[f] / 2 - i[f] / 2;
|
|
8
|
+
let s;
|
|
9
9
|
switch (d) {
|
|
10
10
|
case "top":
|
|
11
|
-
|
|
11
|
+
s = {
|
|
12
12
|
x,
|
|
13
|
-
y: e.y -
|
|
13
|
+
y: e.y - i.height
|
|
14
14
|
};
|
|
15
15
|
break;
|
|
16
16
|
case "bottom":
|
|
17
|
-
|
|
17
|
+
s = {
|
|
18
18
|
x,
|
|
19
19
|
y: e.y + e.height
|
|
20
20
|
};
|
|
21
21
|
break;
|
|
22
22
|
case "right":
|
|
23
|
-
|
|
23
|
+
s = {
|
|
24
24
|
x: e.x + e.width,
|
|
25
|
-
y:
|
|
25
|
+
y: o
|
|
26
26
|
};
|
|
27
27
|
break;
|
|
28
28
|
case "left":
|
|
29
|
-
|
|
30
|
-
x: e.x -
|
|
31
|
-
y:
|
|
29
|
+
s = {
|
|
30
|
+
x: e.x - i.width,
|
|
31
|
+
y: o
|
|
32
32
|
};
|
|
33
33
|
break;
|
|
34
34
|
default:
|
|
35
|
-
|
|
35
|
+
s = {
|
|
36
36
|
x: e.x,
|
|
37
37
|
y: e.y
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
switch (
|
|
40
|
+
switch (H(c)) {
|
|
41
41
|
case "start":
|
|
42
|
-
|
|
42
|
+
s[r] -= m * (l && u ? -1 : 1);
|
|
43
43
|
break;
|
|
44
44
|
case "end":
|
|
45
|
-
|
|
45
|
+
s[r] += m * (l && u ? -1 : 1);
|
|
46
46
|
break;
|
|
47
47
|
}
|
|
48
|
-
return
|
|
48
|
+
return s;
|
|
49
49
|
}
|
|
50
|
-
async function et(
|
|
50
|
+
async function et(n, c) {
|
|
51
51
|
var l;
|
|
52
52
|
c === void 0 && (c = {});
|
|
53
53
|
const {
|
|
54
54
|
x: e,
|
|
55
|
-
y:
|
|
55
|
+
y: i,
|
|
56
56
|
platform: t,
|
|
57
|
-
rects:
|
|
58
|
-
elements:
|
|
57
|
+
rects: r,
|
|
58
|
+
elements: f,
|
|
59
59
|
strategy: d
|
|
60
|
-
} =
|
|
60
|
+
} = n, {
|
|
61
61
|
boundary: u = "clippingAncestors",
|
|
62
62
|
rootBoundary: x = "viewport",
|
|
63
|
-
elementContext:
|
|
63
|
+
elementContext: o = "floating",
|
|
64
64
|
altBoundary: m = !1,
|
|
65
|
-
padding:
|
|
66
|
-
} =
|
|
67
|
-
element: (l = await (t.isElement == null ? void 0 : t.isElement(
|
|
65
|
+
padding: s = 0
|
|
66
|
+
} = X(c, n), a = z(s), p = f[m ? o === "floating" ? "reference" : "floating" : o], w = _(await t.getClippingRect({
|
|
67
|
+
element: (l = await (t.isElement == null ? void 0 : t.isElement(p))) == null || l ? p : p.contextElement || await (t.getDocumentElement == null ? void 0 : t.getDocumentElement(f.floating)),
|
|
68
68
|
boundary: u,
|
|
69
69
|
rootBoundary: x,
|
|
70
70
|
strategy: d
|
|
71
|
-
})), A =
|
|
71
|
+
})), A = o === "floating" ? {
|
|
72
72
|
x: e,
|
|
73
|
-
y:
|
|
74
|
-
width:
|
|
75
|
-
height:
|
|
76
|
-
} :
|
|
73
|
+
y: i,
|
|
74
|
+
width: r.floating.width,
|
|
75
|
+
height: r.floating.height
|
|
76
|
+
} : r.reference, h = await (t.getOffsetParent == null ? void 0 : t.getOffsetParent(f.floating)), y = await (t.isElement == null ? void 0 : t.isElement(h)) ? await (t.getScale == null ? void 0 : t.getScale(h)) || {
|
|
77
77
|
x: 1,
|
|
78
78
|
y: 1
|
|
79
79
|
} : {
|
|
80
80
|
x: 1,
|
|
81
81
|
y: 1
|
|
82
|
-
},
|
|
83
|
-
elements:
|
|
82
|
+
}, O = _(t.convertOffsetParentRelativeRectToViewportRelativeRect ? await t.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
83
|
+
elements: f,
|
|
84
84
|
rect: A,
|
|
85
85
|
offsetParent: h,
|
|
86
86
|
strategy: d
|
|
87
87
|
}) : A);
|
|
88
88
|
return {
|
|
89
|
-
top: (w.top -
|
|
90
|
-
bottom: (
|
|
91
|
-
left: (w.left -
|
|
92
|
-
right: (
|
|
89
|
+
top: (w.top - O.top + a.top) / y.y,
|
|
90
|
+
bottom: (O.bottom - w.bottom + a.bottom) / y.y,
|
|
91
|
+
left: (w.left - O.left + a.left) / y.x,
|
|
92
|
+
right: (O.right - w.right + a.right) / y.x
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const nt = 50, lt = async (n, c, l) => {
|
|
96
96
|
const {
|
|
97
97
|
placement: e = "bottom",
|
|
98
|
-
strategy:
|
|
98
|
+
strategy: i = "absolute",
|
|
99
99
|
middleware: t = [],
|
|
100
|
-
platform:
|
|
101
|
-
} = l,
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
platform: r
|
|
101
|
+
} = l, f = r.detectOverflow ? r : {
|
|
102
|
+
...r,
|
|
103
|
+
detectOverflow: et
|
|
104
|
+
}, d = await (r.isRTL == null ? void 0 : r.isRTL(c));
|
|
105
|
+
let u = await r.getElementRects({
|
|
106
|
+
reference: n,
|
|
104
107
|
floating: c,
|
|
105
|
-
strategy:
|
|
108
|
+
strategy: i
|
|
106
109
|
}), {
|
|
107
110
|
x,
|
|
108
|
-
y:
|
|
109
|
-
} =
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
y: o
|
|
112
|
+
} = I(u, e, d), m = e, s = 0;
|
|
113
|
+
const a = {};
|
|
114
|
+
for (let g = 0; g < t.length; g++) {
|
|
115
|
+
const p = t[g];
|
|
116
|
+
if (!p)
|
|
117
|
+
continue;
|
|
112
118
|
const {
|
|
113
119
|
name: w,
|
|
114
120
|
fn: A
|
|
115
|
-
} =
|
|
121
|
+
} = p, {
|
|
116
122
|
x: h,
|
|
117
123
|
y,
|
|
118
|
-
data:
|
|
124
|
+
data: O,
|
|
119
125
|
reset: b
|
|
120
126
|
} = await A({
|
|
121
127
|
x,
|
|
122
|
-
y:
|
|
128
|
+
y: o,
|
|
123
129
|
initialPlacement: e,
|
|
124
130
|
placement: m,
|
|
125
|
-
strategy:
|
|
126
|
-
middlewareData:
|
|
131
|
+
strategy: i,
|
|
132
|
+
middlewareData: a,
|
|
127
133
|
rects: u,
|
|
128
|
-
platform:
|
|
129
|
-
...a,
|
|
130
|
-
detectOverflow: (p = a.detectOverflow) != null ? p : et
|
|
131
|
-
},
|
|
134
|
+
platform: f,
|
|
132
135
|
elements: {
|
|
133
|
-
reference:
|
|
136
|
+
reference: n,
|
|
134
137
|
floating: c
|
|
135
138
|
}
|
|
136
139
|
});
|
|
137
|
-
x = h ?? x,
|
|
138
|
-
...
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
}, b && f <= 50 && (f++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (u = b.rects === !0 ? await a.getElementRects({
|
|
144
|
-
reference: i,
|
|
140
|
+
x = h ?? x, o = y ?? o, a[w] = {
|
|
141
|
+
...a[w],
|
|
142
|
+
...O
|
|
143
|
+
}, b && s < nt && (s++, typeof b == "object" && (b.placement && (m = b.placement), b.rects && (u = b.rects === !0 ? await r.getElementRects({
|
|
144
|
+
reference: n,
|
|
145
145
|
floating: c,
|
|
146
|
-
strategy:
|
|
146
|
+
strategy: i
|
|
147
147
|
}) : b.rects), {
|
|
148
148
|
x,
|
|
149
|
-
y:
|
|
150
|
-
} =
|
|
149
|
+
y: o
|
|
150
|
+
} = I(u, m, d)), g = -1);
|
|
151
151
|
}
|
|
152
152
|
return {
|
|
153
153
|
x,
|
|
154
|
-
y:
|
|
154
|
+
y: o,
|
|
155
155
|
placement: m,
|
|
156
|
-
strategy:
|
|
157
|
-
middlewareData:
|
|
156
|
+
strategy: i,
|
|
157
|
+
middlewareData: a
|
|
158
158
|
};
|
|
159
|
-
},
|
|
159
|
+
}, rt = (n) => ({
|
|
160
160
|
name: "arrow",
|
|
161
|
-
options:
|
|
161
|
+
options: n,
|
|
162
162
|
async fn(c) {
|
|
163
163
|
const {
|
|
164
164
|
x: l,
|
|
165
165
|
y: e,
|
|
166
|
-
placement:
|
|
166
|
+
placement: i,
|
|
167
167
|
rects: t,
|
|
168
|
-
platform:
|
|
169
|
-
elements:
|
|
168
|
+
platform: r,
|
|
169
|
+
elements: f,
|
|
170
170
|
middlewareData: d
|
|
171
171
|
} = c, {
|
|
172
172
|
element: u,
|
|
173
173
|
padding: x = 0
|
|
174
|
-
} =
|
|
174
|
+
} = X(n, c) || {};
|
|
175
175
|
if (u == null)
|
|
176
176
|
return {};
|
|
177
|
-
const
|
|
177
|
+
const o = z(x), m = {
|
|
178
178
|
x: l,
|
|
179
179
|
y: e
|
|
180
|
-
},
|
|
181
|
-
let
|
|
182
|
-
(!
|
|
183
|
-
const
|
|
180
|
+
}, s = N(i), a = U(s), g = await r.getDimensions(u), p = s === "y", w = p ? "top" : "left", A = p ? "bottom" : "right", h = p ? "clientHeight" : "clientWidth", y = t.reference[a] + t.reference[s] - m[s] - t.floating[a], O = m[s] - t.reference[s], b = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(u));
|
|
181
|
+
let E = b ? b[h] : 0;
|
|
182
|
+
(!E || !await (r.isElement == null ? void 0 : r.isElement(b))) && (E = f.floating[h] || t.floating[a]);
|
|
183
|
+
const j = y / 2 - O / 2, T = E / 2 - g[a] / 2 - 1, v = Y(o[w], T), L = Y(o[A], T), D = v, B = E - g[a] - L, R = E / 2 - g[a] / 2 + j, k = $(D, R, B), S = !d.arrow && H(i) != null && R !== k && t.reference[a] / 2 - (R < D ? v : L) - g[a] / 2 < 0, P = S ? R < D ? R - D : R - B : 0;
|
|
184
184
|
return {
|
|
185
|
-
[
|
|
185
|
+
[s]: m[s] + P,
|
|
186
186
|
data: {
|
|
187
|
-
[
|
|
188
|
-
centerOffset: R -
|
|
189
|
-
...
|
|
190
|
-
alignmentOffset:
|
|
187
|
+
[s]: k,
|
|
188
|
+
centerOffset: R - k - P,
|
|
189
|
+
...S && {
|
|
190
|
+
alignmentOffset: P
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
-
reset:
|
|
193
|
+
reset: S
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
}), at = function(
|
|
197
|
-
return
|
|
196
|
+
}), at = function(n) {
|
|
197
|
+
return n === void 0 && (n = {}), {
|
|
198
198
|
name: "flip",
|
|
199
|
-
options:
|
|
199
|
+
options: n,
|
|
200
200
|
async fn(c) {
|
|
201
201
|
var l, e;
|
|
202
202
|
const {
|
|
203
|
-
placement:
|
|
203
|
+
placement: i,
|
|
204
204
|
middlewareData: t,
|
|
205
|
-
rects:
|
|
206
|
-
initialPlacement:
|
|
205
|
+
rects: r,
|
|
206
|
+
initialPlacement: f,
|
|
207
207
|
platform: d,
|
|
208
208
|
elements: u
|
|
209
209
|
} = c, {
|
|
210
210
|
mainAxis: x = !0,
|
|
211
|
-
crossAxis:
|
|
211
|
+
crossAxis: o = !0,
|
|
212
212
|
fallbackPlacements: m,
|
|
213
|
-
fallbackStrategy:
|
|
214
|
-
fallbackAxisSideDirection:
|
|
215
|
-
flipAlignment:
|
|
216
|
-
...
|
|
217
|
-
} =
|
|
213
|
+
fallbackStrategy: s = "bestFit",
|
|
214
|
+
fallbackAxisSideDirection: a = "none",
|
|
215
|
+
flipAlignment: g = !0,
|
|
216
|
+
...p
|
|
217
|
+
} = X(n, c);
|
|
218
218
|
if ((l = t.arrow) != null && l.alignmentOffset)
|
|
219
219
|
return {};
|
|
220
|
-
const w =
|
|
221
|
-
!m && b &&
|
|
222
|
-
const
|
|
220
|
+
const w = F(i), A = V(f), h = F(f) === f, y = await (d.isRTL == null ? void 0 : d.isRTL(u.floating)), O = m || (h || !g ? [J(f)] : K(f)), b = a !== "none";
|
|
221
|
+
!m && b && O.push(...Q(f, g, a, y));
|
|
222
|
+
const E = [f, ...O], j = await d.detectOverflow(c, p), T = [];
|
|
223
223
|
let v = ((e = t.flip) == null ? void 0 : e.overflows) || [];
|
|
224
|
-
if (x && T.push(
|
|
225
|
-
const R = Z(
|
|
226
|
-
T.push(
|
|
224
|
+
if (x && T.push(j[w]), o) {
|
|
225
|
+
const R = Z(i, r, y);
|
|
226
|
+
T.push(j[R[0]], j[R[1]]);
|
|
227
227
|
}
|
|
228
228
|
if (v = [...v, {
|
|
229
|
-
placement:
|
|
229
|
+
placement: i,
|
|
230
230
|
overflows: T
|
|
231
231
|
}], !T.every((R) => R <= 0)) {
|
|
232
|
-
var L,
|
|
233
|
-
const R = (((L = t.flip) == null ? void 0 : L.index) || 0) + 1,
|
|
234
|
-
if (
|
|
232
|
+
var L, D;
|
|
233
|
+
const R = (((L = t.flip) == null ? void 0 : L.index) || 0) + 1, k = E[R];
|
|
234
|
+
if (k && (!(o === "alignment" ? A !== V(k) : !1) || // We leave the current main axis only if every placement on that axis
|
|
235
235
|
// overflows the main axis.
|
|
236
|
-
v.every((C) =>
|
|
236
|
+
v.every((C) => V(C.placement) === A ? C.overflows[0] > 0 : !0)))
|
|
237
237
|
return {
|
|
238
238
|
data: {
|
|
239
239
|
index: R,
|
|
240
240
|
overflows: v
|
|
241
241
|
},
|
|
242
242
|
reset: {
|
|
243
|
-
placement:
|
|
243
|
+
placement: k
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
let
|
|
247
|
-
if (!
|
|
248
|
-
switch (
|
|
246
|
+
let S = (D = v.filter((P) => P.overflows[0] <= 0).sort((P, C) => P.overflows[1] - C.overflows[1])[0]) == null ? void 0 : D.placement;
|
|
247
|
+
if (!S)
|
|
248
|
+
switch (s) {
|
|
249
249
|
case "bestFit": {
|
|
250
250
|
var B;
|
|
251
|
-
const
|
|
251
|
+
const P = (B = v.filter((C) => {
|
|
252
252
|
if (b) {
|
|
253
|
-
const
|
|
254
|
-
return
|
|
253
|
+
const M = V(C.placement);
|
|
254
|
+
return M === A || // Create a bias to the `y` side axis due to horizontal
|
|
255
255
|
// reading directions favoring greater width.
|
|
256
|
-
|
|
256
|
+
M === "y";
|
|
257
257
|
}
|
|
258
258
|
return !0;
|
|
259
|
-
}).map((C) => [C.placement, C.overflows.filter((
|
|
260
|
-
|
|
259
|
+
}).map((C) => [C.placement, C.overflows.filter((M) => M > 0).reduce((M, G) => M + G, 0)]).sort((C, M) => C[1] - M[1])[0]) == null ? void 0 : B[0];
|
|
260
|
+
P && (S = P);
|
|
261
261
|
break;
|
|
262
262
|
}
|
|
263
263
|
case "initialPlacement":
|
|
264
|
-
|
|
264
|
+
S = f;
|
|
265
265
|
break;
|
|
266
266
|
}
|
|
267
|
-
if (
|
|
267
|
+
if (i !== S)
|
|
268
268
|
return {
|
|
269
269
|
reset: {
|
|
270
|
-
placement:
|
|
270
|
+
placement: S
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
}
|
|
@@ -275,64 +275,64 @@ const ct = async (i, c, l) => {
|
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
|
-
function
|
|
279
|
-
const c =
|
|
278
|
+
function q(n) {
|
|
279
|
+
const c = Y(...n.map((t) => t.left)), l = Y(...n.map((t) => t.top)), e = W(...n.map((t) => t.right)), i = W(...n.map((t) => t.bottom));
|
|
280
280
|
return {
|
|
281
281
|
x: c,
|
|
282
282
|
y: l,
|
|
283
283
|
width: e - c,
|
|
284
|
-
height:
|
|
284
|
+
height: i - l
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
const c =
|
|
287
|
+
function it(n) {
|
|
288
|
+
const c = n.slice().sort((i, t) => i.y - t.y), l = [];
|
|
289
289
|
let e = null;
|
|
290
|
-
for (let
|
|
291
|
-
const t = c[
|
|
290
|
+
for (let i = 0; i < c.length; i++) {
|
|
291
|
+
const t = c[i];
|
|
292
292
|
!e || t.y - e.y > e.height / 2 ? l.push([t]) : l[l.length - 1].push(t), e = t;
|
|
293
293
|
}
|
|
294
|
-
return l.map((
|
|
294
|
+
return l.map((i) => _(q(i)));
|
|
295
295
|
}
|
|
296
|
-
const
|
|
297
|
-
return
|
|
296
|
+
const ft = function(n) {
|
|
297
|
+
return n === void 0 && (n = {}), {
|
|
298
298
|
name: "inline",
|
|
299
|
-
options:
|
|
299
|
+
options: n,
|
|
300
300
|
async fn(c) {
|
|
301
301
|
const {
|
|
302
302
|
placement: l,
|
|
303
303
|
elements: e,
|
|
304
|
-
rects:
|
|
304
|
+
rects: i,
|
|
305
305
|
platform: t,
|
|
306
|
-
strategy:
|
|
306
|
+
strategy: r
|
|
307
307
|
} = c, {
|
|
308
|
-
padding:
|
|
308
|
+
padding: f = 2,
|
|
309
309
|
x: d,
|
|
310
310
|
y: u
|
|
311
|
-
} =
|
|
312
|
-
function
|
|
313
|
-
if (
|
|
314
|
-
return
|
|
315
|
-
if (
|
|
316
|
-
if (
|
|
317
|
-
const v =
|
|
311
|
+
} = X(n, c), x = Array.from(await (t.getClientRects == null ? void 0 : t.getClientRects(e.reference)) || []), o = it(x), m = _(q(x)), s = z(f);
|
|
312
|
+
function a() {
|
|
313
|
+
if (o.length === 2 && o[0].left > o[1].right && d != null && u != null)
|
|
314
|
+
return o.find((p) => d > p.left - s.left && d < p.right + s.right && u > p.top - s.top && u < p.bottom + s.bottom) || m;
|
|
315
|
+
if (o.length >= 2) {
|
|
316
|
+
if (V(l) === "y") {
|
|
317
|
+
const v = o[0], L = o[o.length - 1], D = F(l) === "top", B = v.top, R = L.bottom, k = D ? v.left : L.left, S = D ? v.right : L.right, P = S - k, C = R - B;
|
|
318
318
|
return {
|
|
319
319
|
top: B,
|
|
320
320
|
bottom: R,
|
|
321
|
-
left:
|
|
322
|
-
right:
|
|
323
|
-
width:
|
|
321
|
+
left: k,
|
|
322
|
+
right: S,
|
|
323
|
+
width: P,
|
|
324
324
|
height: C,
|
|
325
|
-
x:
|
|
325
|
+
x: k,
|
|
326
326
|
y: B
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
const
|
|
329
|
+
const p = F(l) === "left", w = W(...o.map((v) => v.right)), A = Y(...o.map((v) => v.left)), h = o.filter((v) => p ? v.left === A : v.right === w), y = h[0].top, O = h[h.length - 1].bottom, b = A, E = w, j = E - b, T = O - y;
|
|
330
330
|
return {
|
|
331
331
|
top: y,
|
|
332
|
-
bottom:
|
|
332
|
+
bottom: O,
|
|
333
333
|
left: b,
|
|
334
|
-
right:
|
|
335
|
-
width:
|
|
334
|
+
right: E,
|
|
335
|
+
width: j,
|
|
336
336
|
height: T,
|
|
337
337
|
x: b,
|
|
338
338
|
y
|
|
@@ -340,83 +340,83 @@ const rt = function(i) {
|
|
|
340
340
|
}
|
|
341
341
|
return m;
|
|
342
342
|
}
|
|
343
|
-
const
|
|
343
|
+
const g = await t.getElementRects({
|
|
344
344
|
reference: {
|
|
345
|
-
getBoundingClientRect:
|
|
345
|
+
getBoundingClientRect: a
|
|
346
346
|
},
|
|
347
347
|
floating: e.floating,
|
|
348
|
-
strategy:
|
|
348
|
+
strategy: r
|
|
349
349
|
});
|
|
350
|
-
return
|
|
350
|
+
return i.reference.x !== g.reference.x || i.reference.y !== g.reference.y || i.reference.width !== g.reference.width || i.reference.height !== g.reference.height ? {
|
|
351
351
|
reset: {
|
|
352
|
-
rects:
|
|
352
|
+
rects: g
|
|
353
353
|
}
|
|
354
354
|
} : {};
|
|
355
355
|
}
|
|
356
356
|
};
|
|
357
|
-
},
|
|
358
|
-
async function
|
|
357
|
+
}, ot = /* @__PURE__ */ new Set(["left", "top"]);
|
|
358
|
+
async function st(n, c) {
|
|
359
359
|
const {
|
|
360
360
|
placement: l,
|
|
361
361
|
platform: e,
|
|
362
|
-
elements:
|
|
363
|
-
} =
|
|
362
|
+
elements: i
|
|
363
|
+
} = n, t = await (e.isRTL == null ? void 0 : e.isRTL(i.floating)), r = F(l), f = H(l), d = V(l) === "y", u = ot.has(r) ? -1 : 1, x = t && d ? -1 : 1, o = X(c, n);
|
|
364
364
|
let {
|
|
365
365
|
mainAxis: m,
|
|
366
|
-
crossAxis:
|
|
367
|
-
alignmentAxis:
|
|
368
|
-
} = typeof
|
|
369
|
-
mainAxis:
|
|
366
|
+
crossAxis: s,
|
|
367
|
+
alignmentAxis: a
|
|
368
|
+
} = typeof o == "number" ? {
|
|
369
|
+
mainAxis: o,
|
|
370
370
|
crossAxis: 0,
|
|
371
371
|
alignmentAxis: null
|
|
372
372
|
} : {
|
|
373
|
-
mainAxis:
|
|
374
|
-
crossAxis:
|
|
375
|
-
alignmentAxis:
|
|
373
|
+
mainAxis: o.mainAxis || 0,
|
|
374
|
+
crossAxis: o.crossAxis || 0,
|
|
375
|
+
alignmentAxis: o.alignmentAxis
|
|
376
376
|
};
|
|
377
|
-
return
|
|
378
|
-
x:
|
|
377
|
+
return f && typeof a == "number" && (s = f === "end" ? a * -1 : a), d ? {
|
|
378
|
+
x: s * x,
|
|
379
379
|
y: m * u
|
|
380
380
|
} : {
|
|
381
381
|
x: m * u,
|
|
382
|
-
y:
|
|
382
|
+
y: s * x
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
const
|
|
386
|
-
return
|
|
385
|
+
const mt = function(n) {
|
|
386
|
+
return n === void 0 && (n = 0), {
|
|
387
387
|
name: "offset",
|
|
388
|
-
options:
|
|
388
|
+
options: n,
|
|
389
389
|
async fn(c) {
|
|
390
390
|
var l, e;
|
|
391
391
|
const {
|
|
392
|
-
x:
|
|
392
|
+
x: i,
|
|
393
393
|
y: t,
|
|
394
|
-
placement:
|
|
395
|
-
middlewareData:
|
|
396
|
-
} = c, d = await
|
|
397
|
-
return
|
|
398
|
-
x:
|
|
394
|
+
placement: r,
|
|
395
|
+
middlewareData: f
|
|
396
|
+
} = c, d = await st(c, n);
|
|
397
|
+
return r === ((l = f.offset) == null ? void 0 : l.placement) && (e = f.arrow) != null && e.alignmentOffset ? {} : {
|
|
398
|
+
x: i + d.x,
|
|
399
399
|
y: t + d.y,
|
|
400
400
|
data: {
|
|
401
401
|
...d,
|
|
402
|
-
placement:
|
|
402
|
+
placement: r
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
};
|
|
407
|
-
},
|
|
408
|
-
return
|
|
407
|
+
}, dt = function(n) {
|
|
408
|
+
return n === void 0 && (n = {}), {
|
|
409
409
|
name: "shift",
|
|
410
|
-
options:
|
|
410
|
+
options: n,
|
|
411
411
|
async fn(c) {
|
|
412
412
|
const {
|
|
413
413
|
x: l,
|
|
414
414
|
y: e,
|
|
415
|
-
placement:
|
|
415
|
+
placement: i,
|
|
416
416
|
platform: t
|
|
417
417
|
} = c, {
|
|
418
|
-
mainAxis:
|
|
419
|
-
crossAxis:
|
|
418
|
+
mainAxis: r = !0,
|
|
419
|
+
crossAxis: f = !1,
|
|
420
420
|
limiter: d = {
|
|
421
421
|
fn: (w) => {
|
|
422
422
|
let {
|
|
@@ -430,32 +430,32 @@ const ft = function(i) {
|
|
|
430
430
|
}
|
|
431
431
|
},
|
|
432
432
|
...u
|
|
433
|
-
} =
|
|
433
|
+
} = X(n, c), x = {
|
|
434
434
|
x: l,
|
|
435
435
|
y: e
|
|
436
|
-
},
|
|
437
|
-
let
|
|
438
|
-
if (a) {
|
|
439
|
-
const w = n === "y" ? "top" : "left", A = n === "y" ? "bottom" : "right", h = f + s[w], y = f - s[A];
|
|
440
|
-
f = z(h, f, y);
|
|
441
|
-
}
|
|
436
|
+
}, o = await t.detectOverflow(c, u), m = V(F(i)), s = tt(m);
|
|
437
|
+
let a = x[s], g = x[m];
|
|
442
438
|
if (r) {
|
|
443
|
-
const w =
|
|
444
|
-
|
|
439
|
+
const w = s === "y" ? "top" : "left", A = s === "y" ? "bottom" : "right", h = a + o[w], y = a - o[A];
|
|
440
|
+
a = $(h, a, y);
|
|
441
|
+
}
|
|
442
|
+
if (f) {
|
|
443
|
+
const w = m === "y" ? "top" : "left", A = m === "y" ? "bottom" : "right", h = g + o[w], y = g - o[A];
|
|
444
|
+
g = $(h, g, y);
|
|
445
445
|
}
|
|
446
|
-
const
|
|
446
|
+
const p = d.fn({
|
|
447
447
|
...c,
|
|
448
|
-
[
|
|
449
|
-
[m]:
|
|
448
|
+
[s]: a,
|
|
449
|
+
[m]: g
|
|
450
450
|
});
|
|
451
451
|
return {
|
|
452
|
-
...
|
|
452
|
+
...p,
|
|
453
453
|
data: {
|
|
454
|
-
x:
|
|
455
|
-
y:
|
|
454
|
+
x: p.x - l,
|
|
455
|
+
y: p.y - e,
|
|
456
456
|
enabled: {
|
|
457
|
-
[
|
|
458
|
-
[m]:
|
|
457
|
+
[s]: r,
|
|
458
|
+
[m]: f
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
};
|
|
@@ -463,13 +463,13 @@ const ft = function(i) {
|
|
|
463
463
|
};
|
|
464
464
|
};
|
|
465
465
|
export {
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
rt as arrow,
|
|
467
|
+
lt as computePosition,
|
|
468
468
|
et as detectOverflow,
|
|
469
469
|
at as flip,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
470
|
+
ft as inline,
|
|
471
|
+
mt as offset,
|
|
472
|
+
_ as rectToClientRect,
|
|
473
|
+
dt as shift
|
|
474
474
|
};
|
|
475
475
|
//# sourceMappingURL=annotorious-react.es25.js.map
|