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