@annotorious/react 3.1.3 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/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.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAC,MAAM,mBAAmB,CAAC;AAExF,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,SAAS,IAAI,aAAa,EAC1B,eAAe,EACf,KAAK,EAEL,IAAI,EACL,MAAM,0BAA0B,CAAC;AAElC,UAAU,SAAS,CAAC,CAAC,SAAS,UAAU,GAA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AC,CAAC;AAE1D,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,EAC3E,OAAO,sBAAsB,CAAC,CAAC,CAAC,QA6BjC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageAnnotationPopup.d.ts","sourceRoot":"","sources":["../src/ImageAnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAG/D,OAAO,EASL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C,UAAU,yBAAyB;IAEjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,UAAU,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC;IAEzD,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC;CAEzC;AAED,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ImageAnnotationPopup.d.ts","sourceRoot":"","sources":["../src/ImageAnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAG/D,OAAO,EASL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAsB1C,UAAU,yBAAyB;IAEjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,UAAU,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC;IAEzD,KAAK,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,SAAS,CAAC;CAEzC;AAED,eAAO,MAAM,oBAAoB,GAAI,OAAO,yBAAyB,4CAkHpE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageAnnotator.d.ts","sourceRoot":"","sources":["../src/ImageAnnotator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAuC,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGrF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,OAAO,CAAE,SAAQ,eAAe,CAAC,eAAe,EAAE,CAAC,CAAC;IAEjG,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAEzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,MAAM,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IAEjC,IAAI,CAAC,EAAE,WAAW,CAAC;CAEpB;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"ImageAnnotator.d.ts","sourceRoot":"","sources":["../src/ImageAnnotator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAuC,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGrF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,OAAO,CAAE,SAAQ,eAAe,CAAC,eAAe,EAAE,CAAC,CAAC;IAEjG,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAEzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,MAAM,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IAEjC,IAAI,CAAC,EAAE,WAAW,CAAC;CAEpB;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,OAAO,EAAE,OAAO,mBAAmB,CAAC,CAAC,CAAC,4CA4C9E,CAAA"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as m, useRef as
|
|
2
|
+
import { forwardRef as m, useRef as p, useContext as u, useLayoutEffect as c, useImperativeHandle as d } from "react";
|
|
3
3
|
import l from "openseadragon";
|
|
4
|
-
import { OpenSeadragonAnnotatorContext as
|
|
5
|
-
const S = m((
|
|
6
|
-
const { className: s, options: t } =
|
|
4
|
+
import { OpenSeadragonAnnotatorContext as v } from "./annotorious-react.es8.js";
|
|
5
|
+
const S = m((n, i) => {
|
|
6
|
+
const { className: s, options: t } = n, r = p(null), { viewer: f, setViewer: e } = u(v);
|
|
7
7
|
return c(() => {
|
|
8
8
|
if (r.current) {
|
|
9
|
-
const
|
|
10
|
-
return e && e(
|
|
11
|
-
e && e(void 0),
|
|
9
|
+
const o = l({ ...t, element: r.current });
|
|
10
|
+
return e && e(o), () => {
|
|
11
|
+
e && e(void 0), o.destroy();
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
}, [JSON.stringify(t)]), d(i, () => f), /* @__PURE__ */ a("div", { className: s, ref: r });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as c, useRef as n, useEffect as s } from "react";
|
|
2
2
|
const i = (e, t) => {
|
|
3
|
-
const [
|
|
4
|
-
return s(() => (
|
|
5
|
-
clearTimeout(
|
|
6
|
-
}), [e, t]),
|
|
3
|
+
const [u, o] = c(e), r = n(void 0);
|
|
4
|
+
return s(() => (r.current = setTimeout(() => o(e), t), () => {
|
|
5
|
+
clearTimeout(r.current);
|
|
6
|
+
}), [e, t]), u;
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
i as useDebounce
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
2
|
import { useLayoutEffect as k, useEffect as q } from "react";
|
|
3
3
|
import { jsxs as Q, jsx as O } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import { getOverflowAncestors as
|
|
4
|
+
import { isElement as F, getComputedStyle as Z } from "./annotorious-react.es17.js";
|
|
5
|
+
import { getOverflowAncestors as xe } from "./annotorious-react.es17.js";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
import { useFloating as z } from "./annotorious-react.
|
|
8
|
-
import { arrow as we, flip as Ee, inline as Se, offset as Ie, shift as Fe } from "./annotorious-react.
|
|
7
|
+
import { useFloating as z } from "./annotorious-react.es15.js";
|
|
8
|
+
import { arrow as we, flip as Ee, inline as Se, offset as Ie, shift as Fe } from "./annotorious-react.es15.js";
|
|
9
9
|
const $ = {
|
|
10
10
|
...s
|
|
11
11
|
}, G = $.useInsertionEffect, J = G || ((t) => t());
|
|
@@ -67,11 +67,11 @@ const pe = /* @__PURE__ */ s.forwardRef(function(n, c) {
|
|
|
67
67
|
},
|
|
68
68
|
middlewareData: {
|
|
69
69
|
arrow: i,
|
|
70
|
-
shift:
|
|
70
|
+
shift: u
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
width: l = 14,
|
|
74
|
-
height:
|
|
74
|
+
height: a = 7,
|
|
75
75
|
tipRadius: I = 0,
|
|
76
76
|
strokeWidth: d = 0,
|
|
77
77
|
staticOffset: g,
|
|
@@ -81,10 +81,10 @@ const pe = /* @__PURE__ */ s.forwardRef(function(n, c) {
|
|
|
81
81
|
transform: p,
|
|
82
82
|
...R
|
|
83
83
|
} = {},
|
|
84
|
-
...
|
|
84
|
+
...v
|
|
85
85
|
} = n;
|
|
86
86
|
process.env.NODE_ENV !== "production" && (c || ne("The `ref` prop is required for `FloatingArrow`."));
|
|
87
|
-
const
|
|
87
|
+
const x = B(), [E, f] = s.useState(!1);
|
|
88
88
|
if (M(() => {
|
|
89
89
|
if (!o) return;
|
|
90
90
|
Z(o).direction === "rtl" && f(!0);
|
|
@@ -92,47 +92,47 @@ const pe = /* @__PURE__ */ s.forwardRef(function(n, c) {
|
|
|
92
92
|
return null;
|
|
93
93
|
const [m, b] = e.split("-"), D = m === "top" || m === "bottom";
|
|
94
94
|
let S = g;
|
|
95
|
-
(D &&
|
|
96
|
-
const
|
|
95
|
+
(D && u != null && u.x || !D && u != null && u.y) && (S = null);
|
|
96
|
+
const C = d * 2, N = C / 2, A = l / 2 * (I / -8 + 1), T = a / 2 * I / 4, w = !!r, U = S && b === "end" ? "bottom" : "top";
|
|
97
97
|
let L = S && b === "end" ? "right" : "left";
|
|
98
98
|
S && E && (L = b === "end" ? "left" : "right");
|
|
99
|
-
const H = (i == null ? void 0 : i.x) != null ? S || i.x : "", X = (i == null ? void 0 : i.y) != null ? S || i.y : "", V = r || "M0,0" + (" H" + l) + (" L" + (l - A) + "," + (
|
|
99
|
+
const H = (i == null ? void 0 : i.x) != null ? S || i.x : "", X = (i == null ? void 0 : i.y) != null ? S || i.y : "", V = r || "M0,0" + (" H" + l) + (" L" + (l - A) + "," + (a - T)) + (" Q" + l / 2 + "," + a + " " + A + "," + (a - T)) + " Z", Y = {
|
|
100
100
|
top: w ? "rotate(180deg)" : "",
|
|
101
101
|
left: w ? "rotate(90deg)" : "rotate(-90deg)",
|
|
102
102
|
bottom: w ? "" : "rotate(180deg)",
|
|
103
103
|
right: w ? "rotate(-90deg)" : "rotate(90deg)"
|
|
104
104
|
}[m];
|
|
105
105
|
return /* @__PURE__ */ Q("svg", {
|
|
106
|
-
...
|
|
106
|
+
...v,
|
|
107
107
|
"aria-hidden": !0,
|
|
108
108
|
ref: c,
|
|
109
|
-
width: w ? l : l +
|
|
109
|
+
width: w ? l : l + C,
|
|
110
110
|
height: l,
|
|
111
|
-
viewBox: "0 0 " + l + " " + (
|
|
111
|
+
viewBox: "0 0 " + l + " " + (a > l ? a : l),
|
|
112
112
|
style: {
|
|
113
113
|
position: "absolute",
|
|
114
114
|
pointerEvents: "none",
|
|
115
115
|
[L]: H,
|
|
116
116
|
[U]: X,
|
|
117
|
-
[m]: D || w ? "100%" : "calc(100% - " +
|
|
117
|
+
[m]: D || w ? "100%" : "calc(100% - " + C / 2 + "px)",
|
|
118
118
|
transform: [Y, p].filter((j) => !!j).join(" "),
|
|
119
119
|
...R
|
|
120
120
|
},
|
|
121
|
-
children: [
|
|
122
|
-
clipPath: "url(#" +
|
|
121
|
+
children: [C > 0 && /* @__PURE__ */ O("path", {
|
|
122
|
+
clipPath: "url(#" + x + ")",
|
|
123
123
|
fill: "none",
|
|
124
124
|
stroke: h,
|
|
125
|
-
strokeWidth:
|
|
125
|
+
strokeWidth: C + (r ? 0 : 1),
|
|
126
126
|
d: V
|
|
127
127
|
}), /* @__PURE__ */ O("path", {
|
|
128
|
-
stroke:
|
|
128
|
+
stroke: C && !r ? v.fill : "none",
|
|
129
129
|
d: V
|
|
130
130
|
}), /* @__PURE__ */ O("clipPath", {
|
|
131
|
-
id:
|
|
131
|
+
id: x,
|
|
132
132
|
children: /* @__PURE__ */ O("rect", {
|
|
133
133
|
x: -N,
|
|
134
134
|
y: N * (w ? -1 : 1),
|
|
135
|
-
width: l +
|
|
135
|
+
width: l + C,
|
|
136
136
|
height: l
|
|
137
137
|
})
|
|
138
138
|
})]
|
|
@@ -163,13 +163,13 @@ function fe(t) {
|
|
|
163
163
|
open: n = !1,
|
|
164
164
|
onOpenChange: c,
|
|
165
165
|
elements: e
|
|
166
|
-
} = t, o = B(), i = s.useRef({}), [
|
|
166
|
+
} = t, o = B(), i = s.useRef({}), [u] = s.useState(() => re()), l = ie() != null;
|
|
167
167
|
if (process.env.NODE_ENV !== "production") {
|
|
168
168
|
const r = e.reference;
|
|
169
169
|
r && !F(r) && oe("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
170
170
|
}
|
|
171
|
-
const [
|
|
172
|
-
i.current.openEvent = r ? p : void 0,
|
|
171
|
+
const [a, I] = s.useState(e.reference), d = K((r, p, R) => {
|
|
172
|
+
i.current.openEvent = r ? p : void 0, u.emit("openchange", {
|
|
173
173
|
open: r,
|
|
174
174
|
event: p,
|
|
175
175
|
reason: R,
|
|
@@ -178,19 +178,19 @@ function fe(t) {
|
|
|
178
178
|
}), g = s.useMemo(() => ({
|
|
179
179
|
setPositionReference: I
|
|
180
180
|
}), []), h = s.useMemo(() => ({
|
|
181
|
-
reference:
|
|
181
|
+
reference: a || e.reference || null,
|
|
182
182
|
floating: e.floating || null,
|
|
183
183
|
domReference: e.reference
|
|
184
|
-
}), [
|
|
184
|
+
}), [a, e.reference, e.floating]);
|
|
185
185
|
return s.useMemo(() => ({
|
|
186
186
|
dataRef: i,
|
|
187
187
|
open: n,
|
|
188
188
|
onOpenChange: d,
|
|
189
189
|
elements: h,
|
|
190
|
-
events:
|
|
190
|
+
events: u,
|
|
191
191
|
floatingId: o,
|
|
192
192
|
refs: g
|
|
193
|
-
}), [n, d, h,
|
|
193
|
+
}), [n, d, h, u, o, g]);
|
|
194
194
|
}
|
|
195
195
|
function he(t) {
|
|
196
196
|
t === void 0 && (t = {});
|
|
@@ -203,7 +203,7 @@ function he(t) {
|
|
|
203
203
|
floating: null,
|
|
204
204
|
...t.elements
|
|
205
205
|
}
|
|
206
|
-
}), e = t.rootContext || c, o = e.elements, [i,
|
|
206
|
+
}), e = t.rootContext || c, o = e.elements, [i, u] = s.useState(null), [l, a] = s.useState(null), d = (o == null ? void 0 : o.domReference) || i, g = s.useRef(null), h = le();
|
|
207
207
|
M(() => {
|
|
208
208
|
d && (g.current = d);
|
|
209
209
|
}, [d]);
|
|
@@ -220,27 +220,27 @@ function he(t) {
|
|
|
220
220
|
getBoundingClientRect: () => f.getBoundingClientRect(),
|
|
221
221
|
contextElement: f
|
|
222
222
|
} : f;
|
|
223
|
-
|
|
223
|
+
a(m), r.refs.setReference(m);
|
|
224
224
|
}, [r.refs]), R = s.useCallback((f) => {
|
|
225
|
-
(F(f) || f === null) && (g.current = f,
|
|
225
|
+
(F(f) || f === null) && (g.current = f, u(f)), (F(r.refs.reference.current) || r.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
226
226
|
// `null` to support `positionReference` + an unstable `reference`
|
|
227
227
|
// callback ref.
|
|
228
228
|
f !== null && !F(f)) && r.refs.setReference(f);
|
|
229
|
-
}, [r.refs]),
|
|
229
|
+
}, [r.refs]), v = s.useMemo(() => ({
|
|
230
230
|
...r.refs,
|
|
231
231
|
setReference: R,
|
|
232
232
|
setPositionReference: p,
|
|
233
233
|
domReference: g
|
|
234
|
-
}), [r.refs, R, p]),
|
|
234
|
+
}), [r.refs, R, p]), x = s.useMemo(() => ({
|
|
235
235
|
...r.elements,
|
|
236
236
|
domReference: d
|
|
237
237
|
}), [r.elements, d]), E = s.useMemo(() => ({
|
|
238
238
|
...r,
|
|
239
239
|
...e,
|
|
240
|
-
refs:
|
|
241
|
-
elements:
|
|
240
|
+
refs: v,
|
|
241
|
+
elements: x,
|
|
242
242
|
nodeId: n
|
|
243
|
-
}), [r,
|
|
243
|
+
}), [r, v, x, n, e]);
|
|
244
244
|
return M(() => {
|
|
245
245
|
e.dataRef.current.floatingContext = E;
|
|
246
246
|
const f = h == null ? void 0 : h.nodesRef.current.find((m) => m.id === n);
|
|
@@ -248,15 +248,15 @@ function he(t) {
|
|
|
248
248
|
}), s.useMemo(() => ({
|
|
249
249
|
...r,
|
|
250
250
|
context: E,
|
|
251
|
-
refs:
|
|
252
|
-
elements:
|
|
253
|
-
}), [r,
|
|
251
|
+
refs: v,
|
|
252
|
+
elements: x
|
|
253
|
+
}), [r, v, x, E]);
|
|
254
254
|
}
|
|
255
255
|
export {
|
|
256
256
|
pe as FloatingArrow,
|
|
257
257
|
we as arrow,
|
|
258
258
|
Ee as flip,
|
|
259
|
-
|
|
259
|
+
xe as getOverflowAncestors,
|
|
260
260
|
Se as inline,
|
|
261
261
|
Ie as offset,
|
|
262
262
|
Fe as shift,
|