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