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