@annotorious/react 3.0.0-rc.10 → 3.0.0-rc.13
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 +15 -15
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/AnnotoriousPlugin.d.ts +1 -1
- package/dist/AnnotoriousPlugin.d.ts.map +1 -1
- package/dist/AnnotoriousPopup.d.ts +1 -1
- package/dist/AnnotoriousPopup.d.ts.map +1 -1
- package/dist/ImageAnnotator.d.ts +2 -2
- package/dist/ImageAnnotator.d.ts.map +1 -1
- package/dist/annotorious-react.es.js +1001 -27
- package/dist/annotorious-react.es.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts +1 -1
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
- package/dist/openseadragon/annotorious-react-osd.es.js +21937 -0
- package/dist/openseadragon/annotorious-react-osd.es.js.map +1 -0
- package/package.json +9 -3
- package/dist/annotorious-react.es10.js +0 -11
- package/dist/annotorious-react.es10.js.map +0 -1
- package/dist/annotorious-react.es11.js +0 -156
- package/dist/annotorious-react.es11.js.map +0 -1
- package/dist/annotorious-react.es12.js +0 -9
- package/dist/annotorious-react.es12.js.map +0 -1
- package/dist/annotorious-react.es13.js +0 -5
- package/dist/annotorious-react.es13.js.map +0 -1
- package/dist/annotorious-react.es14.js +0 -33
- package/dist/annotorious-react.es14.js.map +0 -1
- package/dist/annotorious-react.es15.js +0 -602
- package/dist/annotorious-react.es15.js.map +0 -1
- package/dist/annotorious-react.es16.js +0 -5
- package/dist/annotorious-react.es16.js.map +0 -1
- package/dist/annotorious-react.es17.js +0 -5
- package/dist/annotorious-react.es17.js.map +0 -1
- package/dist/annotorious-react.es2.js +0 -97
- package/dist/annotorious-react.es2.js.map +0 -1
- package/dist/annotorious-react.es3.js +0 -17
- package/dist/annotorious-react.es3.js.map +0 -1
- package/dist/annotorious-react.es4.js +0 -19
- package/dist/annotorious-react.es4.js.map +0 -1
- package/dist/annotorious-react.es5.js +0 -26
- package/dist/annotorious-react.es5.js.map +0 -1
- package/dist/annotorious-react.es6.js +0 -5
- package/dist/annotorious-react.es6.js.map +0 -1
- package/dist/annotorious-react.es7.js +0 -5
- package/dist/annotorious-react.es7.js.map +0 -1
- package/dist/annotorious-react.es8.js +0 -85
- package/dist/annotorious-react.es8.js.map +0 -1
- package/dist/annotorious-react.es9.js +0 -7
- package/dist/annotorious-react.es9.js.map +0 -1
|
@@ -1,30 +1,1004 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import tr, { useState as ue, useRef as nr, useEffect as z, createContext as Dr, forwardRef as or, useImperativeHandle as Or, useContext as te, Children as Ar, cloneElement as Pr } from "react";
|
|
2
|
+
import { createImageAnnotator as ar, ShapeType as jr, W3CImageFormat as kr } from "@annotorious/annotorious";
|
|
3
|
+
var Ve = { exports: {} }, Re = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var Ke;
|
|
14
|
+
function Fr() {
|
|
15
|
+
if (Ke)
|
|
16
|
+
return Re;
|
|
17
|
+
Ke = 1;
|
|
18
|
+
var r = tr, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, c = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
|
+
function m(R, g, h) {
|
|
20
|
+
var b, _ = {}, C = null, P = null;
|
|
21
|
+
h !== void 0 && (C = "" + h), g.key !== void 0 && (C = "" + g.key), g.ref !== void 0 && (P = g.ref);
|
|
22
|
+
for (b in g)
|
|
23
|
+
i.call(g, b) && !d.hasOwnProperty(b) && (_[b] = g[b]);
|
|
24
|
+
if (R && R.defaultProps)
|
|
25
|
+
for (b in g = R.defaultProps, g)
|
|
26
|
+
_[b] === void 0 && (_[b] = g[b]);
|
|
27
|
+
return { $$typeof: n, type: R, key: C, ref: P, props: _, _owner: c.current };
|
|
28
|
+
}
|
|
29
|
+
return Re.Fragment = a, Re.jsx = m, Re.jsxs = m, Re;
|
|
30
|
+
}
|
|
31
|
+
var _e = {};
|
|
32
|
+
/**
|
|
33
|
+
* @license React
|
|
34
|
+
* react-jsx-runtime.development.js
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the MIT license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
var Qe;
|
|
42
|
+
function Ir() {
|
|
43
|
+
return Qe || (Qe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
44
|
+
var r = tr, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), R = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), D = Symbol.iterator, M = "@@iterator";
|
|
45
|
+
function I(e) {
|
|
46
|
+
if (e === null || typeof e != "object")
|
|
47
|
+
return null;
|
|
48
|
+
var t = D && e[D] || e[M];
|
|
49
|
+
return typeof t == "function" ? t : null;
|
|
50
|
+
}
|
|
51
|
+
var O = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
52
|
+
function l(e) {
|
|
53
|
+
{
|
|
54
|
+
for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
55
|
+
o[s - 1] = arguments[s];
|
|
56
|
+
k("error", e, o);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function k(e, t, o) {
|
|
60
|
+
{
|
|
61
|
+
var s = O.ReactDebugCurrentFrame, p = s.getStackAddendum();
|
|
62
|
+
p !== "" && (t += "%s", o = o.concat([p]));
|
|
63
|
+
var y = o.map(function(v) {
|
|
64
|
+
return String(v);
|
|
65
|
+
});
|
|
66
|
+
y.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, y);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var Q = !1, ce = !1, pe = !1, De = !1, le = !1, B;
|
|
70
|
+
B = Symbol.for("react.module.reference");
|
|
71
|
+
function J(e) {
|
|
72
|
+
return !!(typeof e == "string" || typeof e == "function" || e === i || e === d || le || e === c || e === h || e === b || De || e === P || Q || ce || pe || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === _ || e.$$typeof === m || e.$$typeof === R || e.$$typeof === g || // This needs to include all possible module reference object
|
|
73
|
+
// types supported by any Flight configuration anywhere since
|
|
74
|
+
// we don't know which Flight build this will end up being used
|
|
75
|
+
// with.
|
|
76
|
+
e.$$typeof === B || e.getModuleId !== void 0));
|
|
77
|
+
}
|
|
78
|
+
function ne(e, t, o) {
|
|
79
|
+
var s = e.displayName;
|
|
80
|
+
if (s)
|
|
81
|
+
return s;
|
|
82
|
+
var p = t.displayName || t.name || "";
|
|
83
|
+
return p !== "" ? o + "(" + p + ")" : o;
|
|
84
|
+
}
|
|
85
|
+
function Z(e) {
|
|
86
|
+
return e.displayName || "Context";
|
|
87
|
+
}
|
|
88
|
+
function N(e) {
|
|
89
|
+
if (e == null)
|
|
90
|
+
return null;
|
|
91
|
+
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")
|
|
92
|
+
return e.displayName || e.name || null;
|
|
93
|
+
if (typeof e == "string")
|
|
94
|
+
return e;
|
|
95
|
+
switch (e) {
|
|
96
|
+
case i:
|
|
97
|
+
return "Fragment";
|
|
98
|
+
case a:
|
|
99
|
+
return "Portal";
|
|
100
|
+
case d:
|
|
101
|
+
return "Profiler";
|
|
102
|
+
case c:
|
|
103
|
+
return "StrictMode";
|
|
104
|
+
case h:
|
|
105
|
+
return "Suspense";
|
|
106
|
+
case b:
|
|
107
|
+
return "SuspenseList";
|
|
108
|
+
}
|
|
109
|
+
if (typeof e == "object")
|
|
110
|
+
switch (e.$$typeof) {
|
|
111
|
+
case R:
|
|
112
|
+
var t = e;
|
|
113
|
+
return Z(t) + ".Consumer";
|
|
114
|
+
case m:
|
|
115
|
+
var o = e;
|
|
116
|
+
return Z(o._context) + ".Provider";
|
|
117
|
+
case g:
|
|
118
|
+
return ne(e, e.render, "ForwardRef");
|
|
119
|
+
case _:
|
|
120
|
+
var s = e.displayName || null;
|
|
121
|
+
return s !== null ? s : N(e.type) || "Memo";
|
|
122
|
+
case C: {
|
|
123
|
+
var p = e, y = p._payload, v = p._init;
|
|
124
|
+
try {
|
|
125
|
+
return N(v(y));
|
|
126
|
+
} catch {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
var W = Object.assign, q = 0, oe, $, H, ee, fe, he, me;
|
|
134
|
+
function we() {
|
|
135
|
+
}
|
|
136
|
+
we.__reactDisabledLog = !0;
|
|
137
|
+
function ye() {
|
|
138
|
+
{
|
|
139
|
+
if (q === 0) {
|
|
140
|
+
oe = console.log, $ = console.info, H = console.warn, ee = console.error, fe = console.group, he = console.groupCollapsed, me = console.groupEnd;
|
|
141
|
+
var e = {
|
|
142
|
+
configurable: !0,
|
|
143
|
+
enumerable: !0,
|
|
144
|
+
value: we,
|
|
145
|
+
writable: !0
|
|
146
|
+
};
|
|
147
|
+
Object.defineProperties(console, {
|
|
148
|
+
info: e,
|
|
149
|
+
log: e,
|
|
150
|
+
warn: e,
|
|
151
|
+
error: e,
|
|
152
|
+
group: e,
|
|
153
|
+
groupCollapsed: e,
|
|
154
|
+
groupEnd: e
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
q++;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function G() {
|
|
161
|
+
{
|
|
162
|
+
if (q--, q === 0) {
|
|
163
|
+
var e = {
|
|
164
|
+
configurable: !0,
|
|
165
|
+
enumerable: !0,
|
|
166
|
+
writable: !0
|
|
167
|
+
};
|
|
168
|
+
Object.defineProperties(console, {
|
|
169
|
+
log: W({}, e, {
|
|
170
|
+
value: oe
|
|
171
|
+
}),
|
|
172
|
+
info: W({}, e, {
|
|
173
|
+
value: $
|
|
174
|
+
}),
|
|
175
|
+
warn: W({}, e, {
|
|
176
|
+
value: H
|
|
177
|
+
}),
|
|
178
|
+
error: W({}, e, {
|
|
179
|
+
value: ee
|
|
180
|
+
}),
|
|
181
|
+
group: W({}, e, {
|
|
182
|
+
value: fe
|
|
183
|
+
}),
|
|
184
|
+
groupCollapsed: W({}, e, {
|
|
185
|
+
value: he
|
|
186
|
+
}),
|
|
187
|
+
groupEnd: W({}, e, {
|
|
188
|
+
value: me
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
q < 0 && l("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
var ae = O.ReactCurrentDispatcher, ie;
|
|
196
|
+
function re(e, t, o) {
|
|
197
|
+
{
|
|
198
|
+
if (ie === void 0)
|
|
199
|
+
try {
|
|
200
|
+
throw Error();
|
|
201
|
+
} catch (p) {
|
|
202
|
+
var s = p.stack.trim().match(/\n( *(at )?)/);
|
|
203
|
+
ie = s && s[1] || "";
|
|
204
|
+
}
|
|
205
|
+
return `
|
|
206
|
+
` + ie + e;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var de = !1, se;
|
|
210
|
+
{
|
|
211
|
+
var Se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
|
+
se = new Se();
|
|
213
|
+
}
|
|
214
|
+
function be(e, t) {
|
|
215
|
+
if (!e || de)
|
|
216
|
+
return "";
|
|
217
|
+
{
|
|
218
|
+
var o = se.get(e);
|
|
219
|
+
if (o !== void 0)
|
|
220
|
+
return o;
|
|
221
|
+
}
|
|
222
|
+
var s;
|
|
223
|
+
de = !0;
|
|
224
|
+
var p = Error.prepareStackTrace;
|
|
225
|
+
Error.prepareStackTrace = void 0;
|
|
226
|
+
var y;
|
|
227
|
+
y = ae.current, ae.current = null, ye();
|
|
228
|
+
try {
|
|
229
|
+
if (t) {
|
|
230
|
+
var v = function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
};
|
|
233
|
+
if (Object.defineProperty(v.prototype, "props", {
|
|
234
|
+
set: function() {
|
|
235
|
+
throw Error();
|
|
236
|
+
}
|
|
237
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
238
|
+
try {
|
|
239
|
+
Reflect.construct(v, []);
|
|
240
|
+
} catch (X) {
|
|
241
|
+
s = X;
|
|
242
|
+
}
|
|
243
|
+
Reflect.construct(e, [], v);
|
|
244
|
+
} else {
|
|
245
|
+
try {
|
|
246
|
+
v.call();
|
|
247
|
+
} catch (X) {
|
|
248
|
+
s = X;
|
|
249
|
+
}
|
|
250
|
+
e.call(v.prototype);
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
try {
|
|
254
|
+
throw Error();
|
|
255
|
+
} catch (X) {
|
|
256
|
+
s = X;
|
|
257
|
+
}
|
|
258
|
+
e();
|
|
259
|
+
}
|
|
260
|
+
} catch (X) {
|
|
261
|
+
if (X && s && typeof X.stack == "string") {
|
|
262
|
+
for (var f = X.stack.split(`
|
|
263
|
+
`), U = s.stack.split(`
|
|
264
|
+
`), T = f.length - 1, x = U.length - 1; T >= 1 && x >= 0 && f[T] !== U[x]; )
|
|
265
|
+
x--;
|
|
266
|
+
for (; T >= 1 && x >= 0; T--, x--)
|
|
267
|
+
if (f[T] !== U[x]) {
|
|
268
|
+
if (T !== 1 || x !== 1)
|
|
269
|
+
do
|
|
270
|
+
if (T--, x--, x < 0 || f[T] !== U[x]) {
|
|
271
|
+
var L = `
|
|
272
|
+
` + f[T].replace(" at new ", " at ");
|
|
273
|
+
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && se.set(e, L), L;
|
|
274
|
+
}
|
|
275
|
+
while (T >= 1 && x >= 0);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
} finally {
|
|
280
|
+
de = !1, ae.current = y, G(), Error.prepareStackTrace = p;
|
|
281
|
+
}
|
|
282
|
+
var ge = e ? e.displayName || e.name : "", ze = ge ? re(ge) : "";
|
|
283
|
+
return typeof e == "function" && se.set(e, ze), ze;
|
|
284
|
+
}
|
|
285
|
+
function u(e, t, o) {
|
|
286
|
+
return be(e, !1);
|
|
287
|
+
}
|
|
288
|
+
function w(e) {
|
|
289
|
+
var t = e.prototype;
|
|
290
|
+
return !!(t && t.isReactComponent);
|
|
291
|
+
}
|
|
292
|
+
function S(e, t, o) {
|
|
293
|
+
if (e == null)
|
|
294
|
+
return "";
|
|
295
|
+
if (typeof e == "function")
|
|
296
|
+
return be(e, w(e));
|
|
297
|
+
if (typeof e == "string")
|
|
298
|
+
return re(e);
|
|
299
|
+
switch (e) {
|
|
300
|
+
case h:
|
|
301
|
+
return re("Suspense");
|
|
302
|
+
case b:
|
|
303
|
+
return re("SuspenseList");
|
|
304
|
+
}
|
|
305
|
+
if (typeof e == "object")
|
|
306
|
+
switch (e.$$typeof) {
|
|
307
|
+
case g:
|
|
308
|
+
return u(e.render);
|
|
309
|
+
case _:
|
|
310
|
+
return S(e.type, t, o);
|
|
311
|
+
case C: {
|
|
312
|
+
var s = e, p = s._payload, y = s._init;
|
|
313
|
+
try {
|
|
314
|
+
return S(y(p), t, o);
|
|
315
|
+
} catch {
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return "";
|
|
320
|
+
}
|
|
321
|
+
var A = Object.prototype.hasOwnProperty, V = {}, E = O.ReactDebugCurrentFrame;
|
|
322
|
+
function F(e) {
|
|
323
|
+
if (e) {
|
|
324
|
+
var t = e._owner, o = S(e.type, e._source, t ? t.type : null);
|
|
325
|
+
E.setExtraStackFrame(o);
|
|
326
|
+
} else
|
|
327
|
+
E.setExtraStackFrame(null);
|
|
328
|
+
}
|
|
329
|
+
function Y(e, t, o, s, p) {
|
|
330
|
+
{
|
|
331
|
+
var y = Function.call.bind(A);
|
|
332
|
+
for (var v in e)
|
|
333
|
+
if (y(e, v)) {
|
|
334
|
+
var f = void 0;
|
|
335
|
+
try {
|
|
336
|
+
if (typeof e[v] != "function") {
|
|
337
|
+
var U = Error((s || "React class") + ": " + o + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
338
|
+
throw U.name = "Invariant Violation", U;
|
|
339
|
+
}
|
|
340
|
+
f = e[v](t, v, s, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
341
|
+
} catch (T) {
|
|
342
|
+
f = T;
|
|
343
|
+
}
|
|
344
|
+
f && !(f instanceof Error) && (F(p), 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).", s || "React class", o, v, typeof f), F(null)), f instanceof Error && !(f.message in V) && (V[f.message] = !0, F(p), l("Failed %s type: %s", o, f.message), F(null));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
var cr = Array.isArray;
|
|
349
|
+
function Oe(e) {
|
|
350
|
+
return cr(e);
|
|
351
|
+
}
|
|
352
|
+
function lr(e) {
|
|
353
|
+
{
|
|
354
|
+
var t = typeof Symbol == "function" && Symbol.toStringTag, o = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
355
|
+
return o;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function fr(e) {
|
|
359
|
+
try {
|
|
360
|
+
return Le(e), !1;
|
|
361
|
+
} catch {
|
|
362
|
+
return !0;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function Le(e) {
|
|
366
|
+
return "" + e;
|
|
367
|
+
}
|
|
368
|
+
function Me(e) {
|
|
369
|
+
if (fr(e))
|
|
370
|
+
return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lr(e)), Le(e);
|
|
371
|
+
}
|
|
372
|
+
var Ee = O.ReactCurrentOwner, dr = {
|
|
373
|
+
key: !0,
|
|
374
|
+
ref: !0,
|
|
375
|
+
__self: !0,
|
|
376
|
+
__source: !0
|
|
377
|
+
}, We, Ye, Ae;
|
|
378
|
+
Ae = {};
|
|
379
|
+
function vr(e) {
|
|
380
|
+
if (A.call(e, "ref")) {
|
|
381
|
+
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
382
|
+
if (t && t.isReactWarning)
|
|
383
|
+
return !1;
|
|
384
|
+
}
|
|
385
|
+
return e.ref !== void 0;
|
|
386
|
+
}
|
|
387
|
+
function gr(e) {
|
|
388
|
+
if (A.call(e, "key")) {
|
|
389
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
390
|
+
if (t && t.isReactWarning)
|
|
391
|
+
return !1;
|
|
392
|
+
}
|
|
393
|
+
return e.key !== void 0;
|
|
394
|
+
}
|
|
395
|
+
function pr(e, t) {
|
|
396
|
+
if (typeof e.ref == "string" && Ee.current && t && Ee.current.stateNode !== t) {
|
|
397
|
+
var o = N(Ee.current.type);
|
|
398
|
+
Ae[o] || (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', N(Ee.current.type), e.ref), Ae[o] = !0);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function hr(e, t) {
|
|
402
|
+
{
|
|
403
|
+
var o = function() {
|
|
404
|
+
We || (We = !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)", t));
|
|
405
|
+
};
|
|
406
|
+
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
407
|
+
get: o,
|
|
408
|
+
configurable: !0
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function mr(e, t) {
|
|
413
|
+
{
|
|
414
|
+
var o = function() {
|
|
415
|
+
Ye || (Ye = !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)", t));
|
|
416
|
+
};
|
|
417
|
+
o.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
418
|
+
get: o,
|
|
419
|
+
configurable: !0
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
var yr = function(e, t, o, s, p, y, v) {
|
|
424
|
+
var f = {
|
|
425
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
426
|
+
$$typeof: n,
|
|
427
|
+
// Built-in properties that belong on the element
|
|
428
|
+
type: e,
|
|
429
|
+
key: t,
|
|
430
|
+
ref: o,
|
|
431
|
+
props: v,
|
|
432
|
+
// Record the component responsible for creating this element.
|
|
433
|
+
_owner: y
|
|
434
|
+
};
|
|
435
|
+
return f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
436
|
+
configurable: !1,
|
|
437
|
+
enumerable: !1,
|
|
438
|
+
writable: !0,
|
|
439
|
+
value: !1
|
|
440
|
+
}), Object.defineProperty(f, "_self", {
|
|
441
|
+
configurable: !1,
|
|
442
|
+
enumerable: !1,
|
|
443
|
+
writable: !1,
|
|
444
|
+
value: s
|
|
445
|
+
}), Object.defineProperty(f, "_source", {
|
|
446
|
+
configurable: !1,
|
|
447
|
+
enumerable: !1,
|
|
448
|
+
writable: !1,
|
|
449
|
+
value: p
|
|
450
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
451
|
+
};
|
|
452
|
+
function br(e, t, o, s, p) {
|
|
453
|
+
{
|
|
454
|
+
var y, v = {}, f = null, U = null;
|
|
455
|
+
o !== void 0 && (Me(o), f = "" + o), gr(t) && (Me(t.key), f = "" + t.key), vr(t) && (U = t.ref, pr(t, p));
|
|
456
|
+
for (y in t)
|
|
457
|
+
A.call(t, y) && !dr.hasOwnProperty(y) && (v[y] = t[y]);
|
|
458
|
+
if (e && e.defaultProps) {
|
|
459
|
+
var T = e.defaultProps;
|
|
460
|
+
for (y in T)
|
|
461
|
+
v[y] === void 0 && (v[y] = T[y]);
|
|
462
|
+
}
|
|
463
|
+
if (f || U) {
|
|
464
|
+
var x = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
465
|
+
f && hr(v, x), U && mr(v, x);
|
|
466
|
+
}
|
|
467
|
+
return yr(e, f, U, p, s, Ee.current, v);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
var Pe = O.ReactCurrentOwner, Be = O.ReactDebugCurrentFrame;
|
|
471
|
+
function ve(e) {
|
|
472
|
+
if (e) {
|
|
473
|
+
var t = e._owner, o = S(e.type, e._source, t ? t.type : null);
|
|
474
|
+
Be.setExtraStackFrame(o);
|
|
475
|
+
} else
|
|
476
|
+
Be.setExtraStackFrame(null);
|
|
477
|
+
}
|
|
478
|
+
var je;
|
|
479
|
+
je = !1;
|
|
480
|
+
function ke(e) {
|
|
481
|
+
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
482
|
+
}
|
|
483
|
+
function qe() {
|
|
484
|
+
{
|
|
485
|
+
if (Pe.current) {
|
|
486
|
+
var e = N(Pe.current.type);
|
|
487
|
+
if (e)
|
|
488
|
+
return `
|
|
489
|
+
|
|
490
|
+
Check the render method of \`` + e + "`.";
|
|
491
|
+
}
|
|
492
|
+
return "";
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function Er(e) {
|
|
496
|
+
{
|
|
497
|
+
if (e !== void 0) {
|
|
498
|
+
var t = e.fileName.replace(/^.*[\\\/]/, ""), o = e.lineNumber;
|
|
499
|
+
return `
|
|
500
|
+
|
|
501
|
+
Check your code at ` + t + ":" + o + ".";
|
|
502
|
+
}
|
|
503
|
+
return "";
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
var He = {};
|
|
507
|
+
function Rr(e) {
|
|
508
|
+
{
|
|
509
|
+
var t = qe();
|
|
510
|
+
if (!t) {
|
|
511
|
+
var o = typeof e == "string" ? e : e.displayName || e.name;
|
|
512
|
+
o && (t = `
|
|
513
|
+
|
|
514
|
+
Check the top-level render call using <` + o + ">.");
|
|
515
|
+
}
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function Ge(e, t) {
|
|
520
|
+
{
|
|
521
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
522
|
+
return;
|
|
523
|
+
e._store.validated = !0;
|
|
524
|
+
var o = Rr(t);
|
|
525
|
+
if (He[o])
|
|
526
|
+
return;
|
|
527
|
+
He[o] = !0;
|
|
528
|
+
var s = "";
|
|
529
|
+
e && e._owner && e._owner !== Pe.current && (s = " It was passed a child from " + N(e._owner.type) + "."), ve(e), l('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, s), ve(null);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function Je(e, t) {
|
|
533
|
+
{
|
|
534
|
+
if (typeof e != "object")
|
|
535
|
+
return;
|
|
536
|
+
if (Oe(e))
|
|
537
|
+
for (var o = 0; o < e.length; o++) {
|
|
538
|
+
var s = e[o];
|
|
539
|
+
ke(s) && Ge(s, t);
|
|
540
|
+
}
|
|
541
|
+
else if (ke(e))
|
|
542
|
+
e._store && (e._store.validated = !0);
|
|
543
|
+
else if (e) {
|
|
544
|
+
var p = I(e);
|
|
545
|
+
if (typeof p == "function" && p !== e.entries)
|
|
546
|
+
for (var y = p.call(e), v; !(v = y.next()).done; )
|
|
547
|
+
ke(v.value) && Ge(v.value, t);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
function _r(e) {
|
|
552
|
+
{
|
|
553
|
+
var t = e.type;
|
|
554
|
+
if (t == null || typeof t == "string")
|
|
555
|
+
return;
|
|
556
|
+
var o;
|
|
557
|
+
if (typeof t == "function")
|
|
558
|
+
o = t.propTypes;
|
|
559
|
+
else if (typeof t == "object" && (t.$$typeof === g || // Note: Memo only checks outer props here.
|
|
560
|
+
// Inner props are checked in the reconciler.
|
|
561
|
+
t.$$typeof === _))
|
|
562
|
+
o = t.propTypes;
|
|
563
|
+
else
|
|
564
|
+
return;
|
|
565
|
+
if (o) {
|
|
566
|
+
var s = N(t);
|
|
567
|
+
Y(o, e.props, "prop", s, e);
|
|
568
|
+
} else if (t.PropTypes !== void 0 && !je) {
|
|
569
|
+
je = !0;
|
|
570
|
+
var p = N(t);
|
|
571
|
+
l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", p || "Unknown");
|
|
572
|
+
}
|
|
573
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
function wr(e) {
|
|
577
|
+
{
|
|
578
|
+
for (var t = Object.keys(e.props), o = 0; o < t.length; o++) {
|
|
579
|
+
var s = t[o];
|
|
580
|
+
if (s !== "children" && s !== "key") {
|
|
581
|
+
ve(e), l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), ve(null);
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
e.ref !== null && (ve(e), l("Invalid attribute `ref` supplied to `React.Fragment`."), ve(null));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
function Xe(e, t, o, s, p, y) {
|
|
589
|
+
{
|
|
590
|
+
var v = J(e);
|
|
591
|
+
if (!v) {
|
|
592
|
+
var f = "";
|
|
593
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
|
+
var U = Er(p);
|
|
595
|
+
U ? f += U : f += qe();
|
|
596
|
+
var T;
|
|
597
|
+
e === null ? T = "null" : Oe(e) ? T = "array" : e !== void 0 && e.$$typeof === n ? (T = "<" + (N(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, f);
|
|
598
|
+
}
|
|
599
|
+
var x = br(e, t, o, p, y);
|
|
600
|
+
if (x == null)
|
|
601
|
+
return x;
|
|
602
|
+
if (v) {
|
|
603
|
+
var L = t.children;
|
|
604
|
+
if (L !== void 0)
|
|
605
|
+
if (s)
|
|
606
|
+
if (Oe(L)) {
|
|
607
|
+
for (var ge = 0; ge < L.length; ge++)
|
|
608
|
+
Je(L[ge], e);
|
|
609
|
+
Object.freeze && Object.freeze(L);
|
|
610
|
+
} else
|
|
611
|
+
l("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
|
+
else
|
|
613
|
+
Je(L, e);
|
|
614
|
+
}
|
|
615
|
+
return e === i ? wr(x) : _r(x), x;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
function Sr(e, t, o) {
|
|
619
|
+
return Xe(e, t, o, !0);
|
|
620
|
+
}
|
|
621
|
+
function Cr(e, t, o) {
|
|
622
|
+
return Xe(e, t, o, !1);
|
|
623
|
+
}
|
|
624
|
+
var Tr = Cr, xr = Sr;
|
|
625
|
+
_e.Fragment = i, _e.jsx = Tr, _e.jsxs = xr;
|
|
626
|
+
}()), _e;
|
|
627
|
+
}
|
|
628
|
+
process.env.NODE_ENV === "production" ? Ve.exports = Fr() : Ve.exports = Ir();
|
|
629
|
+
var ir = Ve.exports;
|
|
630
|
+
const Ur = ir.Fragment, $e = ir.jsx, sr = (r, n) => {
|
|
631
|
+
const [a, i] = ue(r), c = nr();
|
|
632
|
+
return z(() => (c.current = setTimeout(() => i(r), n), () => {
|
|
633
|
+
clearTimeout(c.current);
|
|
634
|
+
}), [r, n]), a;
|
|
635
|
+
}, K = Dr({
|
|
636
|
+
anno: void 0,
|
|
637
|
+
setAnno: void 0,
|
|
638
|
+
annotations: [],
|
|
639
|
+
selection: { selected: [] }
|
|
640
|
+
}), ot = or((r, n) => {
|
|
641
|
+
const [a, i] = ue(null), [c, d] = ue([]), [m, R] = ue({ selected: [] });
|
|
642
|
+
return Or(n, () => a), z(() => {
|
|
643
|
+
if (a) {
|
|
644
|
+
const { selection: g, store: h } = a.state;
|
|
645
|
+
h.all().length > 0 && d(h.all());
|
|
646
|
+
const b = (P) => d(() => h.all());
|
|
647
|
+
h.observe(b);
|
|
648
|
+
let _;
|
|
649
|
+
const C = g.subscribe(({ selected: P, pointerEvent: D }) => {
|
|
650
|
+
_ && h.unobserve(_);
|
|
651
|
+
const M = (P || []).map(({ id: I, editable: O }) => ({ annotation: h.getAnnotation(I), editable: O }));
|
|
652
|
+
R({ selected: M, pointerEvent: D }), _ = (I) => {
|
|
653
|
+
const { updated: O } = I.changes;
|
|
654
|
+
R(({ selected: l }) => ({
|
|
655
|
+
selected: l.map(({ annotation: k, editable: Q }) => {
|
|
656
|
+
const ce = O.find((pe) => pe.oldValue.id === k.id);
|
|
657
|
+
return ce ? { annotation: ce.newValue, editable: Q } : { annotation: k, editable: Q };
|
|
658
|
+
})
|
|
659
|
+
}));
|
|
660
|
+
}, h.observe(_, { annotations: P.map(({ id: I }) => I) });
|
|
661
|
+
});
|
|
662
|
+
return () => {
|
|
663
|
+
h.unobserve(b), C();
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
}, [a]), /* @__PURE__ */ $e(K.Provider, { value: {
|
|
667
|
+
anno: a,
|
|
668
|
+
setAnno: i,
|
|
669
|
+
annotations: c,
|
|
670
|
+
selection: m
|
|
671
|
+
}, children: r.children });
|
|
672
|
+
}), Vr = () => {
|
|
673
|
+
const { anno: r } = te(K);
|
|
674
|
+
return r;
|
|
675
|
+
}, at = () => {
|
|
676
|
+
const { anno: r } = te(K);
|
|
677
|
+
return r == null ? void 0 : r.state.store;
|
|
678
|
+
}, Nr = () => {
|
|
679
|
+
const { annotations: r } = te(K);
|
|
680
|
+
return r;
|
|
681
|
+
}, $r = (r) => {
|
|
682
|
+
const { annotations: n } = te(K);
|
|
683
|
+
return sr(n, r);
|
|
684
|
+
}, it = (r) => r ? $r(r) : Nr(), st = () => {
|
|
685
|
+
const { selection: r } = te(K);
|
|
686
|
+
return r;
|
|
687
|
+
}, ut = () => {
|
|
688
|
+
const { anno: r } = te(K);
|
|
689
|
+
return r == null ? void 0 : r.getUser();
|
|
690
|
+
}, ur = () => {
|
|
691
|
+
const { anno: r } = te(K), [n, a] = ue([]);
|
|
692
|
+
return z(() => {
|
|
693
|
+
if (r) {
|
|
694
|
+
const { store: i, viewport: c } = r.state;
|
|
695
|
+
if (!c)
|
|
696
|
+
return;
|
|
697
|
+
let d;
|
|
698
|
+
const m = c.subscribe((R) => {
|
|
699
|
+
d && i.unobserve(d);
|
|
700
|
+
const g = R.map((h) => i.getAnnotation(h));
|
|
701
|
+
a(g), d = (h) => {
|
|
702
|
+
const { updated: b } = h.changes;
|
|
703
|
+
a((_) => _.map((C) => {
|
|
704
|
+
const P = b.find((D) => D.oldValue.id === C.id);
|
|
705
|
+
return P ? P.newValue : C;
|
|
706
|
+
}));
|
|
707
|
+
}, i.observe(d, { annotations: R });
|
|
708
|
+
});
|
|
709
|
+
return () => {
|
|
710
|
+
m();
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
}, [r]), n;
|
|
714
|
+
}, Lr = (r) => {
|
|
715
|
+
const n = ur();
|
|
716
|
+
return sr(n, r);
|
|
717
|
+
}, ct = (r) => r ? Lr(r) : ur(), lt = (r) => {
|
|
718
|
+
const { plugin: n, opts: a } = r, i = Vr();
|
|
719
|
+
return z(() => {
|
|
720
|
+
if (i) {
|
|
721
|
+
const c = n(i, a);
|
|
722
|
+
return () => {
|
|
723
|
+
c && "unmount" in c && c.unmount();
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
}, [i]), null;
|
|
727
|
+
};
|
|
728
|
+
var Fe = { dragStart: !0 }, Mr = (r, n = {}) => {
|
|
729
|
+
let a, i, { bounds: c, axis: d = "both", gpuAcceleration: m = !0, legacyTranslate: R = !0, transform: g, applyUserSelectHack: h = !0, disabled: b = !1, ignoreMultitouch: _ = !1, recomputeBounds: C = Fe, grid: P, position: D, cancel: M, handle: I, defaultClass: O = "neodrag", defaultClassDragging: l = "neodrag-dragging", defaultClassDragged: k = "neodrag-dragged", defaultPosition: Q = { x: 0, y: 0 }, onDragStart: ce, onDrag: pe, onDragEnd: De } = n, le = !1, B = 0, J = 0, ne = 0, Z = 0, N = 0, W = 0, { x: q, y: oe } = D ? { x: (D == null ? void 0 : D.x) ?? 0, y: (D == null ? void 0 : D.y) ?? 0 } : Q;
|
|
730
|
+
ae(q, oe);
|
|
731
|
+
let $, H, ee, fe, he, me = "", we = !!D;
|
|
732
|
+
C = { ...Fe, ...C };
|
|
733
|
+
const ye = document.body.style, G = r.classList;
|
|
734
|
+
function ae(u = B, w = J) {
|
|
735
|
+
if (!g) {
|
|
736
|
+
if (R) {
|
|
737
|
+
let A = `${+u}px, ${+w}px`;
|
|
738
|
+
return Ce(r, "transform", m ? `translate3d(${A}, 0)` : `translate(${A})`);
|
|
739
|
+
}
|
|
740
|
+
return Ce(r, "translate", `${+u}px ${+w}px ${m ? "1px" : ""}`);
|
|
741
|
+
}
|
|
742
|
+
const S = g({ offsetX: u, offsetY: w, rootNode: r });
|
|
743
|
+
Ie(S) && Ce(r, "transform", S);
|
|
744
|
+
}
|
|
745
|
+
const ie = (u, w) => {
|
|
746
|
+
const S = { offsetX: B, offsetY: J, rootNode: r, currentNode: he };
|
|
747
|
+
r.dispatchEvent(new CustomEvent(u, { detail: S })), w == null || w(S);
|
|
748
|
+
}, re = addEventListener;
|
|
749
|
+
re("pointerdown", se, !1), re("pointerup", Se, !1), re("pointermove", be, !1), Ce(r, "touch-action", "none");
|
|
750
|
+
const de = () => {
|
|
751
|
+
let u = r.offsetWidth / H.width;
|
|
752
|
+
return isNaN(u) && (u = 1), u;
|
|
753
|
+
};
|
|
754
|
+
function se(u) {
|
|
755
|
+
if (b || u.button === 2 || _ && !u.isPrimary)
|
|
756
|
+
return;
|
|
757
|
+
if (C.dragStart && ($ = Ue(c, r)), Ie(I) && Ie(M) && I === M)
|
|
758
|
+
throw new Error("`handle` selector can't be same as `cancel` selector");
|
|
759
|
+
if (G.add(O), ee = function(E, F) {
|
|
760
|
+
if (!E)
|
|
761
|
+
return [F];
|
|
762
|
+
if (Ne(E))
|
|
763
|
+
return [E];
|
|
764
|
+
if (Array.isArray(E))
|
|
765
|
+
return E;
|
|
766
|
+
const Y = F.querySelectorAll(E);
|
|
767
|
+
if (Y === null)
|
|
768
|
+
throw new Error("Selector passed for `handle` option should be child of the element on which the action is applied");
|
|
769
|
+
return Array.from(Y.values());
|
|
770
|
+
}(I, r), fe = function(E, F) {
|
|
771
|
+
if (!E)
|
|
772
|
+
return [];
|
|
773
|
+
if (Ne(E))
|
|
774
|
+
return [E];
|
|
775
|
+
if (Array.isArray(E))
|
|
776
|
+
return E;
|
|
777
|
+
const Y = F.querySelectorAll(E);
|
|
778
|
+
if (Y === null)
|
|
779
|
+
throw new Error("Selector passed for `cancel` option should be child of the element on which the action is applied");
|
|
780
|
+
return Array.from(Y.values());
|
|
781
|
+
}(M, r), a = /(both|x)/.test(d), i = /(both|y)/.test(d), er(fe, ee))
|
|
782
|
+
throw new Error("Element being dragged can't be a child of the element on which `cancel` is applied");
|
|
783
|
+
const w = u.composedPath()[0];
|
|
784
|
+
if (!ee.some((E) => {
|
|
785
|
+
var F;
|
|
786
|
+
return E.contains(w) || ((F = E.shadowRoot) == null ? void 0 : F.contains(w));
|
|
787
|
+
}) || er(fe, [w]))
|
|
788
|
+
return;
|
|
789
|
+
he = ee.length === 1 ? r : ee.find((E) => E.contains(w)), le = !0, H = r.getBoundingClientRect(), h && (me = ye.userSelect, ye.userSelect = "none"), ie("neodrag:start", ce);
|
|
790
|
+
const { clientX: S, clientY: A } = u, V = de();
|
|
791
|
+
a && (ne = S - q / V), i && (Z = A - oe / V), $ && (N = S - H.left, W = A - H.top);
|
|
792
|
+
}
|
|
793
|
+
function Se() {
|
|
794
|
+
le && (C.dragEnd && ($ = Ue(c, r)), G.remove(l), G.add(k), h && (ye.userSelect = me), ie("neodrag:end", De), a && (ne = B), i && (Z = J), le = !1);
|
|
795
|
+
}
|
|
796
|
+
function be(u) {
|
|
797
|
+
if (!le)
|
|
798
|
+
return;
|
|
799
|
+
C.drag && ($ = Ue(c, r)), G.add(l), u.preventDefault(), H = r.getBoundingClientRect();
|
|
800
|
+
let w = u.clientX, S = u.clientY;
|
|
801
|
+
const A = de();
|
|
802
|
+
if ($) {
|
|
803
|
+
const V = { left: $.left + N, top: $.top + W, right: $.right + N - H.width, bottom: $.bottom + W - H.height };
|
|
804
|
+
w = Ze(w, V.left, V.right), S = Ze(S, V.top, V.bottom);
|
|
805
|
+
}
|
|
806
|
+
if (Array.isArray(P)) {
|
|
807
|
+
let [V, E] = P;
|
|
808
|
+
if (isNaN(+V) || V < 0)
|
|
809
|
+
throw new Error("1st argument of `grid` must be a valid positive number");
|
|
810
|
+
if (isNaN(+E) || E < 0)
|
|
811
|
+
throw new Error("2nd argument of `grid` must be a valid positive number");
|
|
812
|
+
let F = w - ne, Y = S - Z;
|
|
813
|
+
[F, Y] = Wr([V / A, E / A], F, Y), w = ne + F, S = Z + Y;
|
|
814
|
+
}
|
|
815
|
+
a && (B = Math.round((w - ne) * A)), i && (J = Math.round((S - Z) * A)), q = B, oe = J, ie("neodrag", pe), ae();
|
|
816
|
+
}
|
|
817
|
+
return { destroy: () => {
|
|
818
|
+
const u = removeEventListener;
|
|
819
|
+
u("pointerdown", se, !1), u("pointerup", Se, !1), u("pointermove", be, !1);
|
|
820
|
+
}, update: (u) => {
|
|
821
|
+
var S, A;
|
|
822
|
+
d = u.axis || "both", b = u.disabled ?? !1, _ = u.ignoreMultitouch ?? !1, I = u.handle, c = u.bounds, C = u.recomputeBounds ?? Fe, M = u.cancel, h = u.applyUserSelectHack ?? !0, P = u.grid, m = u.gpuAcceleration ?? !0, R = u.legacyTranslate ?? !0, g = u.transform;
|
|
823
|
+
const w = G.contains(k);
|
|
824
|
+
G.remove(O, k), O = u.defaultClass ?? "neodrag", l = u.defaultClassDragging ?? "neodrag-dragging", k = u.defaultClassDragged ?? "neodrag-dragged", G.add(O), w && G.add(k), we && (q = B = ((S = u.position) == null ? void 0 : S.x) ?? B, oe = J = ((A = u.position) == null ? void 0 : A.y) ?? J, ae());
|
|
825
|
+
} };
|
|
826
|
+
}, Ze = (r, n, a) => Math.min(Math.max(r, n), a), Ie = (r) => typeof r == "string", Wr = ([r, n], a, i) => {
|
|
827
|
+
const c = (d, m) => m === 0 ? 0 : Math.ceil(d / m) * m;
|
|
828
|
+
return [c(a, r), c(i, n)];
|
|
829
|
+
}, er = (r, n) => r.some((a) => n.some((i) => a.contains(i)));
|
|
830
|
+
function Ue(r, n) {
|
|
831
|
+
if (r === void 0)
|
|
832
|
+
return;
|
|
833
|
+
if (Ne(r))
|
|
834
|
+
return r.getBoundingClientRect();
|
|
835
|
+
if (typeof r == "object") {
|
|
836
|
+
const { top: i = 0, left: c = 0, right: d = 0, bottom: m = 0 } = r;
|
|
837
|
+
return { top: i, right: window.innerWidth - d, bottom: window.innerHeight - m, left: c };
|
|
838
|
+
}
|
|
839
|
+
if (r === "parent")
|
|
840
|
+
return n.parentNode.getBoundingClientRect();
|
|
841
|
+
const a = document.querySelector(r);
|
|
842
|
+
if (a === null)
|
|
843
|
+
throw new Error("The selector provided for bound doesn't exists in the document.");
|
|
844
|
+
return a.getBoundingClientRect();
|
|
845
|
+
}
|
|
846
|
+
var Ce = (r, n, a) => r.style.setProperty(n, a), Ne = (r) => r instanceof HTMLElement;
|
|
847
|
+
function Te(r) {
|
|
848
|
+
return r == null || typeof r == "string" || r instanceof HTMLElement ? r : "current" in r ? r.current : Array.isArray(r) ? r.map((n) => n instanceof HTMLElement ? n : n.current) : void 0;
|
|
849
|
+
}
|
|
850
|
+
function Yr(r, n = {}) {
|
|
851
|
+
const a = nr(), [i, c] = ue(!1), [d, m] = ue();
|
|
852
|
+
let { onDragStart: R, onDrag: g, onDragEnd: h, handle: b, cancel: _ } = n, C = Te(b), P = Te(_);
|
|
853
|
+
function D(l, k) {
|
|
854
|
+
m(l), k == null || k(l);
|
|
855
|
+
}
|
|
856
|
+
function M(l) {
|
|
857
|
+
c(!0), D(l, R);
|
|
858
|
+
}
|
|
859
|
+
function I(l) {
|
|
860
|
+
D(l, g);
|
|
861
|
+
}
|
|
862
|
+
function O(l) {
|
|
863
|
+
c(!1), D(l, h);
|
|
864
|
+
}
|
|
865
|
+
return z(() => {
|
|
866
|
+
if (typeof window > "u")
|
|
867
|
+
return;
|
|
868
|
+
const l = r.current;
|
|
869
|
+
if (!l)
|
|
870
|
+
return;
|
|
871
|
+
({ onDragStart: R, onDrag: g, onDragEnd: h } = n);
|
|
872
|
+
const { update: k, destroy: Q } = Mr(l, { ...n, handle: C, cancel: P, onDragStart: M, onDrag: I, onDragEnd: O });
|
|
873
|
+
return a.current = k, Q;
|
|
874
|
+
}, []), z(() => {
|
|
875
|
+
var l;
|
|
876
|
+
(l = a.current) == null || l.call(a, { ...n, handle: Te(b), cancel: Te(_), onDragStart: M, onDrag: I, onDragEnd: O });
|
|
877
|
+
}, [n]), { isDragging: i, dragState: d };
|
|
878
|
+
}
|
|
879
|
+
const ft = or((r, n) => {
|
|
880
|
+
const { children: a, className: i, onDragStart: c, onDragEnd: d } = r;
|
|
881
|
+
return Yr(n, { onDragStart: c, onDragEnd: d, cancel: "button, .no-drag" }), /* @__PURE__ */ $e(
|
|
882
|
+
"div",
|
|
883
|
+
{
|
|
884
|
+
ref: n,
|
|
885
|
+
className: i,
|
|
886
|
+
style: { position: "absolute" },
|
|
887
|
+
children: a
|
|
888
|
+
}
|
|
889
|
+
);
|
|
890
|
+
}), dt = (r) => {
|
|
891
|
+
const { children: n, tool: a, ...i } = r, c = Ar.only(n), { anno: d, setAnno: m } = te(K), R = (g) => {
|
|
892
|
+
if (!d) {
|
|
893
|
+
const h = g.target, b = ar(h, i);
|
|
894
|
+
m(b);
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
return z(() => {
|
|
898
|
+
r.tool && d && d.setDrawingTool(r.tool);
|
|
899
|
+
}, [r.tool, d]), z(() => {
|
|
900
|
+
d && d.setFilter(r.filter);
|
|
901
|
+
}, [r.filter]), z(() => {
|
|
902
|
+
d && d.setStyle(r.style);
|
|
903
|
+
}, [r.style]), /* @__PURE__ */ $e(Ur, { children: Pr(c, { onLoad: R }) });
|
|
904
|
+
};
|
|
905
|
+
var Br = /* @__PURE__ */ ((r) => (r.EDIT = "EDIT", r.SELECT = "SELECT", r.NONE = "NONE", r))(Br || {});
|
|
906
|
+
let xe;
|
|
907
|
+
const qr = new Uint8Array(16);
|
|
908
|
+
function Hr() {
|
|
909
|
+
if (!xe && (xe = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !xe))
|
|
910
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
911
|
+
return xe(qr);
|
|
912
|
+
}
|
|
913
|
+
const j = [];
|
|
914
|
+
for (let r = 0; r < 256; ++r)
|
|
915
|
+
j.push((r + 256).toString(16).slice(1));
|
|
916
|
+
function Gr(r, n = 0) {
|
|
917
|
+
return j[r[n + 0]] + j[r[n + 1]] + j[r[n + 2]] + j[r[n + 3]] + "-" + j[r[n + 4]] + j[r[n + 5]] + "-" + j[r[n + 6]] + j[r[n + 7]] + "-" + j[r[n + 8]] + j[r[n + 9]] + "-" + j[r[n + 10]] + j[r[n + 11]] + j[r[n + 12]] + j[r[n + 13]] + j[r[n + 14]] + j[r[n + 15]];
|
|
918
|
+
}
|
|
919
|
+
const Jr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), rr = {
|
|
920
|
+
randomUUID: Jr
|
|
921
|
+
};
|
|
922
|
+
function Xr(r, n, a) {
|
|
923
|
+
if (rr.randomUUID && !n && !r)
|
|
924
|
+
return rr.randomUUID();
|
|
925
|
+
r = r || {};
|
|
926
|
+
const i = r.random || (r.rng || Hr)();
|
|
927
|
+
if (i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, n) {
|
|
928
|
+
a = a || 0;
|
|
929
|
+
for (let c = 0; c < 16; ++c)
|
|
930
|
+
n[a + c] = i[c];
|
|
931
|
+
return n;
|
|
932
|
+
}
|
|
933
|
+
return Gr(i);
|
|
934
|
+
}
|
|
935
|
+
const vt = (r, n, a, i) => ({
|
|
936
|
+
id: Xr(),
|
|
937
|
+
annotation: r.id,
|
|
938
|
+
created: a || /* @__PURE__ */ new Date(),
|
|
939
|
+
creator: i,
|
|
940
|
+
...n
|
|
941
|
+
});
|
|
942
|
+
var zr = /* @__PURE__ */ ((r) => (r.LOCAL = "LOCAL", r.REMOTE = "REMOTE", r))(zr || {});
|
|
943
|
+
let Kr = (r) => crypto.getRandomValues(new Uint8Array(r)), Qr = (r, n, a) => {
|
|
944
|
+
let i = (2 << Math.log(r.length - 1) / Math.LN2) - 1, c = -~(1.6 * i * n / r.length);
|
|
945
|
+
return (d = n) => {
|
|
946
|
+
let m = "";
|
|
947
|
+
for (; ; ) {
|
|
948
|
+
let R = a(c), g = c;
|
|
949
|
+
for (; g--; )
|
|
950
|
+
if (m += r[R[g] & i] || "", m.length === d)
|
|
951
|
+
return m;
|
|
952
|
+
}
|
|
953
|
+
};
|
|
954
|
+
}, Zr = (r, n = 21) => Qr(r, n, Kr), et = (r = 21) => crypto.getRandomValues(new Uint8Array(r)).reduce((n, a) => (a &= 63, a < 36 ? n += a.toString(36) : a < 62 ? n += (a - 26).toString(36).toUpperCase() : a > 62 ? n += "-" : n += "_", n), "");
|
|
955
|
+
const gt = () => ({ isGuest: !0, id: Zr("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), rt = [
|
|
956
|
+
"#ff7c00",
|
|
957
|
+
// orange
|
|
958
|
+
"#1ac938",
|
|
959
|
+
// green
|
|
960
|
+
"#e8000b",
|
|
961
|
+
// red
|
|
962
|
+
"#8b2be2",
|
|
963
|
+
// purple
|
|
964
|
+
"#9f4800",
|
|
965
|
+
// brown
|
|
966
|
+
"#f14cc1",
|
|
967
|
+
// pink
|
|
968
|
+
"#ffc400",
|
|
969
|
+
// khaki
|
|
970
|
+
"#00d7ff",
|
|
971
|
+
// cyan
|
|
972
|
+
"#023eff"
|
|
973
|
+
// blue
|
|
974
|
+
], pt = () => {
|
|
975
|
+
const r = [...rt];
|
|
976
|
+
return { assignRandomColor: () => {
|
|
977
|
+
const n = Math.floor(Math.random() * r.length), a = r[n];
|
|
978
|
+
return r.splice(n, 1), a;
|
|
979
|
+
}, releaseColor: (n) => r.push(n) };
|
|
980
|
+
};
|
|
981
|
+
et();
|
|
982
|
+
const ht = ar, mt = jr, yt = kr;
|
|
9
983
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
984
|
+
ot as Annotorious,
|
|
985
|
+
K as AnnotoriousContext,
|
|
986
|
+
lt as AnnotoriousPlugin,
|
|
987
|
+
ft as Draggable,
|
|
988
|
+
dt as ImageAnnotator,
|
|
989
|
+
zr as Origin,
|
|
990
|
+
Br as PointerSelectAction,
|
|
991
|
+
mt as ShapeType,
|
|
992
|
+
yt as W3CImageFormat,
|
|
993
|
+
gt as createAnonymousGuest,
|
|
994
|
+
vt as createBody,
|
|
995
|
+
ht as createImageAnnotator,
|
|
996
|
+
pt as defaultColorProvider,
|
|
997
|
+
at as useAnnotationStore,
|
|
998
|
+
it as useAnnotations,
|
|
999
|
+
Vr as useAnnotator,
|
|
1000
|
+
ut as useAnnotatorUser,
|
|
1001
|
+
st as useSelection,
|
|
1002
|
+
ct as useViewportState
|
|
29
1003
|
};
|
|
30
1004
|
//# sourceMappingURL=annotorious-react.es.js.map
|