@annotorious/react 3.0.0-rc.15 → 3.0.0-rc.16
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 +0 -8
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/annotorious-react.es.js +27 -28
- package/dist/annotorious-react.es10.js +1 -1
- package/dist/annotorious-react.es15.js +3 -3
- package/dist/annotorious-react.es16.js +21039 -2
- package/dist/annotorious-react.es16.js.map +1 -1
- package/dist/annotorious-react.es17.js +32 -30
- package/dist/annotorious-react.es17.js.map +1 -1
- package/dist/annotorious-react.es18.js +2 -599
- package/dist/annotorious-react.es18.js.map +1 -1
- package/dist/annotorious-react.es19.js +25 -21004
- package/dist/annotorious-react.es19.js.map +1 -1
- package/dist/annotorious-react.es2.js +39 -40
- package/dist/annotorious-react.es2.js.map +1 -1
- package/dist/annotorious-react.es20.js +599 -32
- package/dist/annotorious-react.es20.js.map +1 -1
- package/dist/annotorious-react.es8.js +10 -10
- package/dist/annotorious-react.es8.js.map +1 -1
- package/dist/annotorious-react.es9.js +22 -26
- package/dist/annotorious-react.es9.js.map +1 -1
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es10.js +3 -3
- package/dist/openseadragon/annotorious-react-osd.es11.js +2 -153
- package/dist/openseadragon/annotorious-react-osd.es11.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es12.js +30 -2
- package/dist/openseadragon/annotorious-react-osd.es12.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es13.js +590 -21
- package/dist/openseadragon/annotorious-react-osd.es13.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es14.js +151 -597
- package/dist/openseadragon/annotorious-react-osd.es14.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es2.js +17 -17
- package/dist/openseadragon/annotorious-react-osd.es2.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es6.js +2374 -2344
- package/dist/openseadragon/annotorious-react-osd.es6.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es7.js +28 -29
- package/dist/openseadragon/annotorious-react-osd.es7.js.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es8.js +1 -1
- package/dist/openseadragon/annotorious-react-osd.es9.js +2 -2
- package/package.json +1 -1
|
@@ -1,602 +1,156 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
var Ce = !1, Pe = !1, we = !1, Oe = !1, Se = !1, z;
|
|
41
|
-
z = Symbol.for("react.module.reference");
|
|
42
|
-
function je(e) {
|
|
43
|
-
return !!(typeof e == "string" || typeof e == "function" || e === _ || e === N || Se || e === U || e === k || e === D || Oe || e === me || Ce || Pe || we || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === C || e.$$typeof === B || e.$$typeof === q || e.$$typeof === T || // This needs to include all possible module reference object
|
|
44
|
-
// types supported by any Flight configuration anywhere since
|
|
45
|
-
// we don't know which Flight build this will end up being used
|
|
46
|
-
// with.
|
|
47
|
-
e.$$typeof === z || e.getModuleId !== void 0));
|
|
48
|
-
}
|
|
49
|
-
function xe(e, r, t) {
|
|
50
|
-
var n = e.displayName;
|
|
51
|
-
if (n)
|
|
52
|
-
return n;
|
|
53
|
-
var o = r.displayName || r.name || "";
|
|
54
|
-
return o !== "" ? t + "(" + o + ")" : t;
|
|
55
|
-
}
|
|
56
|
-
function J(e) {
|
|
57
|
-
return e.displayName || "Context";
|
|
58
|
-
}
|
|
59
|
-
function d(e) {
|
|
60
|
-
if (e == null)
|
|
61
|
-
return null;
|
|
62
|
-
if (typeof e.tag == "number" && l("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
63
|
-
return e.displayName || e.name || null;
|
|
64
|
-
if (typeof e == "string")
|
|
65
|
-
return e;
|
|
66
|
-
switch (e) {
|
|
67
|
-
case _:
|
|
68
|
-
return "Fragment";
|
|
69
|
-
case ye:
|
|
70
|
-
return "Portal";
|
|
71
|
-
case N:
|
|
72
|
-
return "Profiler";
|
|
73
|
-
case U:
|
|
74
|
-
return "StrictMode";
|
|
75
|
-
case k:
|
|
76
|
-
return "Suspense";
|
|
77
|
-
case D:
|
|
78
|
-
return "SuspenseList";
|
|
79
|
-
}
|
|
80
|
-
if (typeof e == "object")
|
|
81
|
-
switch (e.$$typeof) {
|
|
82
|
-
case q:
|
|
83
|
-
var r = e;
|
|
84
|
-
return J(r) + ".Consumer";
|
|
85
|
-
case B:
|
|
86
|
-
var t = e;
|
|
87
|
-
return J(t._context) + ".Provider";
|
|
88
|
-
case T:
|
|
89
|
-
return xe(e, e.render, "ForwardRef");
|
|
90
|
-
case C:
|
|
91
|
-
var n = e.displayName || null;
|
|
92
|
-
return n !== null ? n : d(e.type) || "Memo";
|
|
93
|
-
case F: {
|
|
94
|
-
var o = e, u = o._payload, i = o._init;
|
|
95
|
-
try {
|
|
96
|
-
return d(i(u));
|
|
97
|
-
} catch {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
var g = Object.assign, y = 0, K, H, X, Z, Q, ee, re;
|
|
105
|
-
function te() {
|
|
106
|
-
}
|
|
107
|
-
te.__reactDisabledLog = !0;
|
|
108
|
-
function ke() {
|
|
109
|
-
{
|
|
110
|
-
if (y === 0) {
|
|
111
|
-
K = console.log, H = console.info, X = console.warn, Z = console.error, Q = console.group, ee = console.groupCollapsed, re = console.groupEnd;
|
|
112
|
-
var e = {
|
|
113
|
-
configurable: !0,
|
|
114
|
-
enumerable: !0,
|
|
115
|
-
value: te,
|
|
116
|
-
writable: !0
|
|
117
|
-
};
|
|
118
|
-
Object.defineProperties(console, {
|
|
119
|
-
info: e,
|
|
120
|
-
log: e,
|
|
121
|
-
warn: e,
|
|
122
|
-
error: e,
|
|
123
|
-
group: e,
|
|
124
|
-
groupCollapsed: e,
|
|
125
|
-
groupEnd: e
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
y++;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
function De() {
|
|
132
|
-
{
|
|
133
|
-
if (y--, y === 0) {
|
|
134
|
-
var e = {
|
|
135
|
-
configurable: !0,
|
|
136
|
-
enumerable: !0,
|
|
137
|
-
writable: !0
|
|
138
|
-
};
|
|
139
|
-
Object.defineProperties(console, {
|
|
140
|
-
log: g({}, e, {
|
|
141
|
-
value: K
|
|
142
|
-
}),
|
|
143
|
-
info: g({}, e, {
|
|
144
|
-
value: H
|
|
145
|
-
}),
|
|
146
|
-
warn: g({}, e, {
|
|
147
|
-
value: X
|
|
148
|
-
}),
|
|
149
|
-
error: g({}, e, {
|
|
150
|
-
value: Z
|
|
151
|
-
}),
|
|
152
|
-
group: g({}, e, {
|
|
153
|
-
value: Q
|
|
154
|
-
}),
|
|
155
|
-
groupCollapsed: g({}, e, {
|
|
156
|
-
value: ee
|
|
157
|
-
}),
|
|
158
|
-
groupEnd: g({}, e, {
|
|
159
|
-
value: re
|
|
160
|
-
})
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
y < 0 && l("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
var A = b.ReactCurrentDispatcher, I;
|
|
167
|
-
function P(e, r, t) {
|
|
168
|
-
{
|
|
169
|
-
if (I === void 0)
|
|
170
|
-
try {
|
|
171
|
-
throw Error();
|
|
172
|
-
} catch (o) {
|
|
173
|
-
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
174
|
-
I = n && n[1] || "";
|
|
175
|
-
}
|
|
176
|
-
return `
|
|
177
|
-
` + I + e;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
var W = !1, w;
|
|
181
|
-
{
|
|
182
|
-
var Fe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
183
|
-
w = new Fe();
|
|
184
|
-
}
|
|
185
|
-
function ne(e, r) {
|
|
186
|
-
if (!e || W)
|
|
187
|
-
return "";
|
|
188
|
-
{
|
|
189
|
-
var t = w.get(e);
|
|
190
|
-
if (t !== void 0)
|
|
191
|
-
return t;
|
|
192
|
-
}
|
|
193
|
-
var n;
|
|
194
|
-
W = !0;
|
|
195
|
-
var o = Error.prepareStackTrace;
|
|
196
|
-
Error.prepareStackTrace = void 0;
|
|
197
|
-
var u;
|
|
198
|
-
u = A.current, A.current = null, ke();
|
|
199
|
-
try {
|
|
200
|
-
if (r) {
|
|
201
|
-
var i = function() {
|
|
202
|
-
throw Error();
|
|
203
|
-
};
|
|
204
|
-
if (Object.defineProperty(i.prototype, "props", {
|
|
205
|
-
set: function() {
|
|
206
|
-
throw Error();
|
|
207
|
-
}
|
|
208
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
209
|
-
try {
|
|
210
|
-
Reflect.construct(i, []);
|
|
211
|
-
} catch (p) {
|
|
212
|
-
n = p;
|
|
213
|
-
}
|
|
214
|
-
Reflect.construct(e, [], i);
|
|
215
|
-
} else {
|
|
216
|
-
try {
|
|
217
|
-
i.call();
|
|
218
|
-
} catch (p) {
|
|
219
|
-
n = p;
|
|
220
|
-
}
|
|
221
|
-
e.call(i.prototype);
|
|
222
|
-
}
|
|
223
|
-
} else {
|
|
224
|
-
try {
|
|
225
|
-
throw Error();
|
|
226
|
-
} catch (p) {
|
|
227
|
-
n = p;
|
|
228
|
-
}
|
|
229
|
-
e();
|
|
230
|
-
}
|
|
231
|
-
} catch (p) {
|
|
232
|
-
if (p && n && typeof p.stack == "string") {
|
|
233
|
-
for (var a = p.stack.split(`
|
|
234
|
-
`), c = n.stack.split(`
|
|
235
|
-
`), s = a.length - 1, f = c.length - 1; s >= 1 && f >= 0 && a[s] !== c[f]; )
|
|
236
|
-
f--;
|
|
237
|
-
for (; s >= 1 && f >= 0; s--, f--)
|
|
238
|
-
if (a[s] !== c[f]) {
|
|
239
|
-
if (s !== 1 || f !== 1)
|
|
240
|
-
do
|
|
241
|
-
if (s--, f--, f < 0 || a[s] !== c[f]) {
|
|
242
|
-
var v = `
|
|
243
|
-
` + a[s].replace(" at new ", " at ");
|
|
244
|
-
return e.displayName && v.includes("<anonymous>") && (v = v.replace("<anonymous>", e.displayName)), typeof e == "function" && w.set(e, v), v;
|
|
245
|
-
}
|
|
246
|
-
while (s >= 1 && f >= 0);
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
} finally {
|
|
251
|
-
W = !1, A.current = u, De(), Error.prepareStackTrace = o;
|
|
252
|
-
}
|
|
253
|
-
var E = e ? e.displayName || e.name : "", be = E ? P(E) : "";
|
|
254
|
-
return typeof e == "function" && w.set(e, be), be;
|
|
255
|
-
}
|
|
256
|
-
function Ae(e, r, t) {
|
|
257
|
-
return ne(e, !1);
|
|
258
|
-
}
|
|
259
|
-
function Ie(e) {
|
|
260
|
-
var r = e.prototype;
|
|
261
|
-
return !!(r && r.isReactComponent);
|
|
262
|
-
}
|
|
263
|
-
function O(e, r, t) {
|
|
264
|
-
if (e == null)
|
|
265
|
-
return "";
|
|
266
|
-
if (typeof e == "function")
|
|
267
|
-
return ne(e, Ie(e));
|
|
268
|
-
if (typeof e == "string")
|
|
269
|
-
return P(e);
|
|
270
|
-
switch (e) {
|
|
271
|
-
case k:
|
|
272
|
-
return P("Suspense");
|
|
273
|
-
case D:
|
|
274
|
-
return P("SuspenseList");
|
|
275
|
-
}
|
|
276
|
-
if (typeof e == "object")
|
|
277
|
-
switch (e.$$typeof) {
|
|
278
|
-
case T:
|
|
279
|
-
return Ae(e.render);
|
|
280
|
-
case C:
|
|
281
|
-
return O(e.type, r, t);
|
|
282
|
-
case F: {
|
|
283
|
-
var n = e, o = n._payload, u = n._init;
|
|
284
|
-
try {
|
|
285
|
-
return O(u(o), r, t);
|
|
286
|
-
} catch {
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
return "";
|
|
291
|
-
}
|
|
292
|
-
var S = Object.prototype.hasOwnProperty, ae = {}, ie = b.ReactDebugCurrentFrame;
|
|
293
|
-
function j(e) {
|
|
294
|
-
if (e) {
|
|
295
|
-
var r = e._owner, t = O(e.type, e._source, r ? r.type : null);
|
|
296
|
-
ie.setExtraStackFrame(t);
|
|
297
|
-
} else
|
|
298
|
-
ie.setExtraStackFrame(null);
|
|
299
|
-
}
|
|
300
|
-
function We(e, r, t, n, o) {
|
|
301
|
-
{
|
|
302
|
-
var u = Function.call.bind(S);
|
|
303
|
-
for (var i in e)
|
|
304
|
-
if (u(e, i)) {
|
|
305
|
-
var a = void 0;
|
|
306
|
-
try {
|
|
307
|
-
if (typeof e[i] != "function") {
|
|
308
|
-
var c = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
309
|
-
throw c.name = "Invariant Violation", c;
|
|
310
|
-
}
|
|
311
|
-
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
312
|
-
} catch (s) {
|
|
313
|
-
a = s;
|
|
314
|
-
}
|
|
315
|
-
a && !(a instanceof Error) && (j(o), l("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), j(null)), a instanceof Error && !(a.message in ae) && (ae[a.message] = !0, j(o), l("Failed %s type: %s", t, a.message), j(null));
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
var $e = Array.isArray;
|
|
320
|
-
function $(e) {
|
|
321
|
-
return $e(e);
|
|
322
|
-
}
|
|
323
|
-
function Ye(e) {
|
|
324
|
-
{
|
|
325
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
326
|
-
return t;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
function Me(e) {
|
|
330
|
-
try {
|
|
331
|
-
return oe(e), !1;
|
|
332
|
-
} catch {
|
|
333
|
-
return !0;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
function oe(e) {
|
|
337
|
-
return "" + e;
|
|
338
|
-
}
|
|
339
|
-
function ue(e) {
|
|
340
|
-
if (Me(e))
|
|
341
|
-
return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ye(e)), oe(e);
|
|
342
|
-
}
|
|
343
|
-
var m = b.ReactCurrentOwner, Ve = {
|
|
344
|
-
key: !0,
|
|
345
|
-
ref: !0,
|
|
346
|
-
__self: !0,
|
|
347
|
-
__source: !0
|
|
348
|
-
}, se, fe, Y;
|
|
349
|
-
Y = {};
|
|
350
|
-
function Le(e) {
|
|
351
|
-
if (S.call(e, "ref")) {
|
|
352
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
353
|
-
if (r && r.isReactWarning)
|
|
354
|
-
return !1;
|
|
355
|
-
}
|
|
356
|
-
return e.ref !== void 0;
|
|
357
|
-
}
|
|
358
|
-
function Ue(e) {
|
|
359
|
-
if (S.call(e, "key")) {
|
|
360
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
361
|
-
if (r && r.isReactWarning)
|
|
362
|
-
return !1;
|
|
363
|
-
}
|
|
364
|
-
return e.key !== void 0;
|
|
365
|
-
}
|
|
366
|
-
function Ne(e, r) {
|
|
367
|
-
if (typeof e.ref == "string" && m.current && r && m.current.stateNode !== r) {
|
|
368
|
-
var t = d(m.current.type);
|
|
369
|
-
Y[t] || (l('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', d(m.current.type), e.ref), Y[t] = !0);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
function Be(e, r) {
|
|
373
|
-
{
|
|
374
|
-
var t = function() {
|
|
375
|
-
se || (se = !0, l("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
376
|
-
};
|
|
377
|
-
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
378
|
-
get: t,
|
|
379
|
-
configurable: !0
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
function qe(e, r) {
|
|
384
|
-
{
|
|
385
|
-
var t = function() {
|
|
386
|
-
fe || (fe = !0, l("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
387
|
-
};
|
|
388
|
-
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
389
|
-
get: t,
|
|
390
|
-
configurable: !0
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
var Ge = function(e, r, t, n, o, u, i) {
|
|
395
|
-
var a = {
|
|
396
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
397
|
-
$$typeof: x,
|
|
398
|
-
// Built-in properties that belong on the element
|
|
399
|
-
type: e,
|
|
400
|
-
key: r,
|
|
401
|
-
ref: t,
|
|
402
|
-
props: i,
|
|
403
|
-
// Record the component responsible for creating this element.
|
|
404
|
-
_owner: u
|
|
405
|
-
};
|
|
406
|
-
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
407
|
-
configurable: !1,
|
|
408
|
-
enumerable: !1,
|
|
409
|
-
writable: !0,
|
|
410
|
-
value: !1
|
|
411
|
-
}), Object.defineProperty(a, "_self", {
|
|
412
|
-
configurable: !1,
|
|
413
|
-
enumerable: !1,
|
|
414
|
-
writable: !1,
|
|
415
|
-
value: n
|
|
416
|
-
}), Object.defineProperty(a, "_source", {
|
|
417
|
-
configurable: !1,
|
|
418
|
-
enumerable: !1,
|
|
419
|
-
writable: !1,
|
|
420
|
-
value: o
|
|
421
|
-
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
422
|
-
};
|
|
423
|
-
function ze(e, r, t, n, o) {
|
|
424
|
-
{
|
|
425
|
-
var u, i = {}, a = null, c = null;
|
|
426
|
-
t !== void 0 && (ue(t), a = "" + t), Ue(r) && (ue(r.key), a = "" + r.key), Le(r) && (c = r.ref, Ne(r, o));
|
|
427
|
-
for (u in r)
|
|
428
|
-
S.call(r, u) && !Ve.hasOwnProperty(u) && (i[u] = r[u]);
|
|
429
|
-
if (e && e.defaultProps) {
|
|
430
|
-
var s = e.defaultProps;
|
|
431
|
-
for (u in s)
|
|
432
|
-
i[u] === void 0 && (i[u] = s[u]);
|
|
433
|
-
}
|
|
434
|
-
if (a || c) {
|
|
435
|
-
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
436
|
-
a && Be(i, f), c && qe(i, f);
|
|
437
|
-
}
|
|
438
|
-
return Ge(e, a, c, o, n, m.current, i);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
var M = b.ReactCurrentOwner, le = b.ReactDebugCurrentFrame;
|
|
442
|
-
function h(e) {
|
|
443
|
-
if (e) {
|
|
444
|
-
var r = e._owner, t = O(e.type, e._source, r ? r.type : null);
|
|
445
|
-
le.setExtraStackFrame(t);
|
|
446
|
-
} else
|
|
447
|
-
le.setExtraStackFrame(null);
|
|
448
|
-
}
|
|
449
|
-
var V;
|
|
450
|
-
V = !1;
|
|
451
|
-
function L(e) {
|
|
452
|
-
return typeof e == "object" && e !== null && e.$$typeof === x;
|
|
453
|
-
}
|
|
454
|
-
function ce() {
|
|
455
|
-
{
|
|
456
|
-
if (M.current) {
|
|
457
|
-
var e = d(M.current.type);
|
|
458
|
-
if (e)
|
|
459
|
-
return `
|
|
460
|
-
|
|
461
|
-
Check the render method of \`` + e + "`.";
|
|
462
|
-
}
|
|
463
|
-
return "";
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
function Je(e) {
|
|
467
|
-
{
|
|
468
|
-
if (e !== void 0) {
|
|
469
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
470
|
-
return `
|
|
471
|
-
|
|
472
|
-
Check your code at ` + r + ":" + t + ".";
|
|
473
|
-
}
|
|
474
|
-
return "";
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
var ve = {};
|
|
478
|
-
function Ke(e) {
|
|
479
|
-
{
|
|
480
|
-
var r = ce();
|
|
481
|
-
if (!r) {
|
|
482
|
-
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
483
|
-
t && (r = `
|
|
484
|
-
|
|
485
|
-
Check the top-level render call using <` + t + ">.");
|
|
486
|
-
}
|
|
1
|
+
import { useRef as ge, useState as ae, useEffect as ie } from "react";
|
|
2
|
+
var O = { dragStart: !0 }, he = (e, t = {}) => {
|
|
3
|
+
let o, c, { bounds: l, axis: m = "both", gpuAcceleration: f = !0, legacyTranslate: B = !0, transform: M, applyUserSelectHack: N = !0, disabled: R = !1, ignoreMultitouch: $ = !1, recomputeBounds: b = O, grid: H, position: u, cancel: D, handle: E, defaultClass: S = "neodrag", defaultClassDragging: i = "neodrag-dragging", defaultClassDragged: g = "neodrag-dragged", defaultPosition: W = { x: 0, y: 0 }, onDragStart: ce, onDrag: le, onDragEnd: ue } = t, X = !1, x = 0, A = 0, L = 0, T = 0, j = 0, z = 0, { x: Y, y: q } = u ? { x: (u == null ? void 0 : u.x) ?? 0, y: (u == null ? void 0 : u.y) ?? 0 } : W;
|
|
4
|
+
I(Y, q);
|
|
5
|
+
let y, C, P, F, _, ee = "", fe = !!u;
|
|
6
|
+
b = { ...O, ...b };
|
|
7
|
+
const G = document.body.style, v = e.classList;
|
|
8
|
+
function I(n = x, a = A) {
|
|
9
|
+
if (!M) {
|
|
10
|
+
if (B) {
|
|
11
|
+
let d = `${+n}px, ${+a}px`;
|
|
12
|
+
return k(e, "transform", f ? `translate3d(${d}, 0)` : `translate(${d})`);
|
|
13
|
+
}
|
|
14
|
+
return k(e, "translate", `${+n}px ${+a}px ${f ? "1px" : ""}`);
|
|
15
|
+
}
|
|
16
|
+
const s = M({ offsetX: n, offsetY: a, rootNode: e });
|
|
17
|
+
Q(s) && k(e, "transform", s);
|
|
18
|
+
}
|
|
19
|
+
const J = (n, a) => {
|
|
20
|
+
const s = { offsetX: x, offsetY: A, rootNode: e, currentNode: _ };
|
|
21
|
+
e.dispatchEvent(new CustomEvent(n, { detail: s })), a == null || a(s);
|
|
22
|
+
}, K = addEventListener;
|
|
23
|
+
K("pointerdown", re, !1), K("pointerup", te, !1), K("pointermove", oe, !1), k(e, "touch-action", "none");
|
|
24
|
+
const ne = () => {
|
|
25
|
+
let n = e.offsetWidth / C.width;
|
|
26
|
+
return isNaN(n) && (n = 1), n;
|
|
27
|
+
};
|
|
28
|
+
function re(n) {
|
|
29
|
+
if (R || n.button === 2 || $ && !n.isPrimary)
|
|
30
|
+
return;
|
|
31
|
+
if (b.dragStart && (y = V(l, e)), Q(E) && Q(D) && E === D)
|
|
32
|
+
throw new Error("`handle` selector can't be same as `cancel` selector");
|
|
33
|
+
if (v.add(S), P = function(r, p) {
|
|
34
|
+
if (!r)
|
|
35
|
+
return [p];
|
|
36
|
+
if (Z(r))
|
|
37
|
+
return [r];
|
|
38
|
+
if (Array.isArray(r))
|
|
487
39
|
return r;
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
40
|
+
const w = p.querySelectorAll(r);
|
|
41
|
+
if (w === null)
|
|
42
|
+
throw new Error("Selector passed for `handle` option should be child of the element on which the action is applied");
|
|
43
|
+
return Array.from(w.values());
|
|
44
|
+
}(E, e), F = function(r, p) {
|
|
45
|
+
if (!r)
|
|
46
|
+
return [];
|
|
47
|
+
if (Z(r))
|
|
48
|
+
return [r];
|
|
49
|
+
if (Array.isArray(r))
|
|
50
|
+
return r;
|
|
51
|
+
const w = p.querySelectorAll(r);
|
|
52
|
+
if (w === null)
|
|
53
|
+
throw new Error("Selector passed for `cancel` option should be child of the element on which the action is applied");
|
|
54
|
+
return Array.from(w.values());
|
|
55
|
+
}(D, e), o = /(both|x)/.test(m), c = /(both|y)/.test(m), de(F, P))
|
|
56
|
+
throw new Error("Element being dragged can't be a child of the element on which `cancel` is applied");
|
|
57
|
+
const a = n.composedPath()[0];
|
|
58
|
+
if (!P.some((r) => {
|
|
59
|
+
var p;
|
|
60
|
+
return r.contains(a) || ((p = r.shadowRoot) == null ? void 0 : p.contains(a));
|
|
61
|
+
}) || de(F, [a]))
|
|
62
|
+
return;
|
|
63
|
+
_ = P.length === 1 ? e : P.find((r) => r.contains(a)), X = !0, C = e.getBoundingClientRect(), N && (ee = G.userSelect, G.userSelect = "none"), J("neodrag:start", ce);
|
|
64
|
+
const { clientX: s, clientY: d } = n, h = ne();
|
|
65
|
+
o && (L = s - Y / h), c && (T = d - q / h), y && (j = s - C.left, z = d - C.top);
|
|
66
|
+
}
|
|
67
|
+
function te() {
|
|
68
|
+
X && (b.dragEnd && (y = V(l, e)), v.remove(i), v.add(g), N && (G.userSelect = ee), J("neodrag:end", ue), o && (L = x), c && (T = A), X = !1);
|
|
69
|
+
}
|
|
70
|
+
function oe(n) {
|
|
71
|
+
if (!X)
|
|
72
|
+
return;
|
|
73
|
+
b.drag && (y = V(l, e)), v.add(i), n.preventDefault(), C = e.getBoundingClientRect();
|
|
74
|
+
let a = n.clientX, s = n.clientY;
|
|
75
|
+
const d = ne();
|
|
76
|
+
if (y) {
|
|
77
|
+
const h = { left: y.left + j, top: y.top + z, right: y.right + j - C.width, bottom: y.bottom + z - C.height };
|
|
78
|
+
a = se(a, h.left, h.right), s = se(s, h.top, h.bottom);
|
|
79
|
+
}
|
|
80
|
+
if (Array.isArray(H)) {
|
|
81
|
+
let [h, r] = H;
|
|
82
|
+
if (isNaN(+h) || h < 0)
|
|
83
|
+
throw new Error("1st argument of `grid` must be a valid positive number");
|
|
84
|
+
if (isNaN(+r) || r < 0)
|
|
85
|
+
throw new Error("2nd argument of `grid` must be a valid positive number");
|
|
86
|
+
let p = a - L, w = s - T;
|
|
87
|
+
[p, w] = pe([h / d, r / d], p, w), a = L + p, s = T + w;
|
|
88
|
+
}
|
|
89
|
+
o && (x = Math.round((a - L) * d)), c && (A = Math.round((s - T) * d)), Y = x, q = A, J("neodrag", le), I();
|
|
90
|
+
}
|
|
91
|
+
return { destroy: () => {
|
|
92
|
+
const n = removeEventListener;
|
|
93
|
+
n("pointerdown", re, !1), n("pointerup", te, !1), n("pointermove", oe, !1);
|
|
94
|
+
}, update: (n) => {
|
|
95
|
+
var s, d;
|
|
96
|
+
m = n.axis || "both", R = n.disabled ?? !1, $ = n.ignoreMultitouch ?? !1, E = n.handle, l = n.bounds, b = n.recomputeBounds ?? O, D = n.cancel, N = n.applyUserSelectHack ?? !0, H = n.grid, f = n.gpuAcceleration ?? !0, B = n.legacyTranslate ?? !0, M = n.transform;
|
|
97
|
+
const a = v.contains(g);
|
|
98
|
+
v.remove(S, g), S = n.defaultClass ?? "neodrag", i = n.defaultClassDragging ?? "neodrag-dragging", g = n.defaultClassDragged ?? "neodrag-dragged", v.add(S), a && v.add(g), fe && (Y = x = ((s = n.position) == null ? void 0 : s.x) ?? x, q = A = ((d = n.position) == null ? void 0 : d.y) ?? A, I());
|
|
99
|
+
} };
|
|
100
|
+
}, se = (e, t, o) => Math.min(Math.max(e, t), o), Q = (e) => typeof e == "string", pe = ([e, t], o, c) => {
|
|
101
|
+
const l = (m, f) => f === 0 ? 0 : Math.ceil(m / f) * f;
|
|
102
|
+
return [l(o, e), l(c, t)];
|
|
103
|
+
}, de = (e, t) => e.some((o) => t.some((c) => o.contains(c)));
|
|
104
|
+
function V(e, t) {
|
|
105
|
+
if (e === void 0)
|
|
106
|
+
return;
|
|
107
|
+
if (Z(e))
|
|
108
|
+
return e.getBoundingClientRect();
|
|
109
|
+
if (typeof e == "object") {
|
|
110
|
+
const { top: c = 0, left: l = 0, right: m = 0, bottom: f = 0 } = e;
|
|
111
|
+
return { top: c, right: window.innerWidth - m, bottom: window.innerHeight - f, left: l };
|
|
112
|
+
}
|
|
113
|
+
if (e === "parent")
|
|
114
|
+
return t.parentNode.getBoundingClientRect();
|
|
115
|
+
const o = document.querySelector(e);
|
|
116
|
+
if (o === null)
|
|
117
|
+
throw new Error("The selector provided for bound doesn't exists in the document.");
|
|
118
|
+
return o.getBoundingClientRect();
|
|
119
|
+
}
|
|
120
|
+
var k = (e, t, o) => e.style.setProperty(t, o), Z = (e) => e instanceof HTMLElement;
|
|
121
|
+
function U(e) {
|
|
122
|
+
return e == null || typeof e == "string" || e instanceof HTMLElement ? e : "current" in e ? e.current : Array.isArray(e) ? e.map((t) => t instanceof HTMLElement ? t : t.current) : void 0;
|
|
123
|
+
}
|
|
124
|
+
function ye(e, t = {}) {
|
|
125
|
+
const o = ge(), [c, l] = ae(!1), [m, f] = ae();
|
|
126
|
+
let { onDragStart: B, onDrag: M, onDragEnd: N, handle: R, cancel: $ } = t, b = U(R), H = U($);
|
|
127
|
+
function u(i, g) {
|
|
128
|
+
f(i), g == null || g(i);
|
|
129
|
+
}
|
|
130
|
+
function D(i) {
|
|
131
|
+
l(!0), u(i, B);
|
|
132
|
+
}
|
|
133
|
+
function E(i) {
|
|
134
|
+
u(i, M);
|
|
135
|
+
}
|
|
136
|
+
function S(i) {
|
|
137
|
+
l(!1), u(i, N);
|
|
138
|
+
}
|
|
139
|
+
return ie(() => {
|
|
140
|
+
if (typeof window > "u")
|
|
141
|
+
return;
|
|
142
|
+
const i = e.current;
|
|
143
|
+
if (!i)
|
|
144
|
+
return;
|
|
145
|
+
({ onDragStart: B, onDrag: M, onDragEnd: N } = t);
|
|
146
|
+
const { update: g, destroy: W } = he(i, { ...t, handle: b, cancel: H, onDragStart: D, onDrag: E, onDragEnd: S });
|
|
147
|
+
return o.current = g, W;
|
|
148
|
+
}, []), ie(() => {
|
|
149
|
+
var i;
|
|
150
|
+
(i = o.current) == null || i.call(o, { ...t, handle: U(R), cancel: U($), onDragStart: D, onDrag: E, onDragEnd: S });
|
|
151
|
+
}, [t]), { isDragging: c, dragState: m };
|
|
598
152
|
}
|
|
599
153
|
export {
|
|
600
|
-
|
|
154
|
+
ye as useDraggable
|
|
601
155
|
};
|
|
602
156
|
//# sourceMappingURL=annotorious-react-osd.es14.js.map
|