@annotorious/react 3.0.0 → 3.0.1
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 +6 -6
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/AnnotoriousPlugin.d.ts +6 -3
- package/dist/AnnotoriousPlugin.d.ts.map +1 -1
- package/dist/AnnotoriousPopupProps.d.ts +10 -0
- package/dist/AnnotoriousPopupProps.d.ts.map +1 -0
- package/dist/ImageAnnotationPopup.d.ts +9 -0
- package/dist/ImageAnnotationPopup.d.ts.map +1 -0
- package/dist/ImageAnnotator.d.ts +2 -2
- package/dist/ImageAnnotator.d.ts.map +1 -1
- package/dist/annotorious-react.es.js +20 -20
- package/dist/annotorious-react.es.js.map +1 -1
- package/dist/annotorious-react.es11.js +3 -3
- package/dist/annotorious-react.es13.js +264 -126
- package/dist/annotorious-react.es13.js.map +1 -1
- package/dist/annotorious-react.es14.js +9 -32
- package/dist/annotorious-react.es14.js.map +1 -1
- package/dist/annotorious-react.es15.js +193 -2
- package/dist/annotorious-react.es15.js.map +1 -1
- package/dist/annotorious-react.es16.js +368 -25
- package/dist/annotorious-react.es16.js.map +1 -1
- package/dist/annotorious-react.es17.js +10 -605
- package/dist/annotorious-react.es17.js.map +1 -1
- package/dist/annotorious-react.es18.js +2 -2
- package/dist/annotorious-react.es19.js +26 -2
- package/dist/annotorious-react.es19.js.map +1 -1
- package/dist/annotorious-react.es2.js.map +1 -1
- package/dist/annotorious-react.es20.js +609 -0
- package/dist/annotorious-react.es20.js.map +1 -0
- package/dist/annotorious-react.es21.js +129 -0
- package/dist/annotorious-react.es21.js.map +1 -0
- package/dist/annotorious-react.es22.js +5 -0
- package/dist/annotorious-react.es22.js.map +1 -0
- package/dist/annotorious-react.es23.js +5 -0
- package/dist/annotorious-react.es23.js.map +1 -0
- package/dist/annotorious-react.es24.js +10 -0
- package/dist/annotorious-react.es24.js.map +1 -0
- package/dist/annotorious-react.es25.js +8 -0
- package/dist/annotorious-react.es25.js.map +1 -0
- package/dist/annotorious-react.es26.js +10 -0
- package/dist/annotorious-react.es26.js.map +1 -0
- package/dist/annotorious-react.es27.js +129 -0
- package/dist/annotorious-react.es27.js.map +1 -0
- package/dist/annotorious-react.es28.js +466 -0
- package/dist/annotorious-react.es28.js.map +1 -0
- package/dist/annotorious-react.es3.js +12 -12
- package/dist/annotorious-react.es3.js.map +1 -1
- package/dist/annotorious-react.es4.js +90 -12
- package/dist/annotorious-react.es4.js.map +1 -1
- package/dist/annotorious-react.es5.js +15 -13
- package/dist/annotorious-react.es5.js.map +1 -1
- package/dist/annotorious-react.es8.js.map +1 -1
- package/dist/annotorious-react.es9.js +103 -32
- package/dist/annotorious-react.es9.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/openseadragon/OpenSeadragonAnnotationPopup.d.ts +9 -0
- package/dist/openseadragon/OpenSeadragonAnnotationPopup.d.ts.map +1 -0
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts +5 -6
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
- package/dist/openseadragon/index.d.ts +1 -1
- package/dist/openseadragon/index.d.ts.map +1 -1
- package/dist/utils/toClientRects.d.ts +6 -0
- package/dist/utils/toClientRects.d.ts.map +1 -0
- package/package.json +7 -7
- package/dist/AnnotoriousPopup.d.ts +0 -16
- package/dist/AnnotoriousPopup.d.ts.map +0 -1
- package/dist/openseadragon/OpenSeadragonPopup.d.ts +0 -11
- package/dist/openseadragon/OpenSeadragonPopup.d.ts.map +0 -1
|
@@ -1,5 +1,196 @@
|
|
|
1
|
-
|
|
1
|
+
import { offset as H, shift as I, flip as J, inline as K, computePosition as N, arrow as j } from "./annotorious-react.es16.js";
|
|
2
|
+
import { autoUpdate as ue, platform as le } from "./annotorious-react.es16.js";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { useLayoutEffect as Q, useEffect as T } from "react";
|
|
5
|
+
import * as X from "react-dom";
|
|
6
|
+
var R = typeof document < "u" ? Q : T;
|
|
7
|
+
function h(e, t) {
|
|
8
|
+
if (e === t)
|
|
9
|
+
return !0;
|
|
10
|
+
if (typeof e != typeof t)
|
|
11
|
+
return !1;
|
|
12
|
+
if (typeof e == "function" && e.toString() === t.toString())
|
|
13
|
+
return !0;
|
|
14
|
+
let n, r, s;
|
|
15
|
+
if (e && t && typeof e == "object") {
|
|
16
|
+
if (Array.isArray(e)) {
|
|
17
|
+
if (n = e.length, n !== t.length) return !1;
|
|
18
|
+
for (r = n; r-- !== 0; )
|
|
19
|
+
if (!h(e[r], t[r]))
|
|
20
|
+
return !1;
|
|
21
|
+
return !0;
|
|
22
|
+
}
|
|
23
|
+
if (s = Object.keys(e), n = s.length, n !== Object.keys(t).length)
|
|
24
|
+
return !1;
|
|
25
|
+
for (r = n; r-- !== 0; )
|
|
26
|
+
if (!{}.hasOwnProperty.call(t, s[r]))
|
|
27
|
+
return !1;
|
|
28
|
+
for (r = n; r-- !== 0; ) {
|
|
29
|
+
const p = s[r];
|
|
30
|
+
if (!(p === "_owner" && e.$$typeof) && !h(e[p], t[p]))
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
33
|
+
return !0;
|
|
34
|
+
}
|
|
35
|
+
return e !== e && t !== t;
|
|
36
|
+
}
|
|
37
|
+
function A(e) {
|
|
38
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
39
|
+
}
|
|
40
|
+
function L(e, t) {
|
|
41
|
+
const n = A(e);
|
|
42
|
+
return Math.round(t * n) / n;
|
|
43
|
+
}
|
|
44
|
+
function v(e) {
|
|
45
|
+
const t = f.useRef(e);
|
|
46
|
+
return R(() => {
|
|
47
|
+
t.current = e;
|
|
48
|
+
}), t;
|
|
49
|
+
}
|
|
50
|
+
function ee(e) {
|
|
51
|
+
e === void 0 && (e = {});
|
|
52
|
+
const {
|
|
53
|
+
placement: t = "bottom",
|
|
54
|
+
strategy: n = "absolute",
|
|
55
|
+
middleware: r = [],
|
|
56
|
+
platform: s,
|
|
57
|
+
elements: {
|
|
58
|
+
reference: p,
|
|
59
|
+
floating: q
|
|
60
|
+
} = {},
|
|
61
|
+
transform: E = !0,
|
|
62
|
+
whileElementsMounted: $,
|
|
63
|
+
open: k
|
|
64
|
+
} = e, [i, D] = f.useState({
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 0,
|
|
67
|
+
strategy: n,
|
|
68
|
+
placement: t,
|
|
69
|
+
middlewareData: {},
|
|
70
|
+
isPositioned: !1
|
|
71
|
+
}), [x, B] = f.useState(r);
|
|
72
|
+
h(x, r) || B(r);
|
|
73
|
+
const [U, V] = f.useState(null), [W, z] = f.useState(null), O = f.useCallback((o) => {
|
|
74
|
+
o !== a.current && (a.current = o, V(o));
|
|
75
|
+
}, []), _ = f.useCallback((o) => {
|
|
76
|
+
o !== d.current && (d.current = o, z(o));
|
|
77
|
+
}, []), u = p || U, l = q || W, a = f.useRef(null), d = f.useRef(null), y = f.useRef(i), G = $ != null, M = v($), P = v(s), g = f.useCallback(() => {
|
|
78
|
+
if (!a.current || !d.current)
|
|
79
|
+
return;
|
|
80
|
+
const o = {
|
|
81
|
+
placement: t,
|
|
82
|
+
strategy: n,
|
|
83
|
+
middleware: x
|
|
84
|
+
};
|
|
85
|
+
P.current && (o.platform = P.current), N(a.current, d.current, o).then((w) => {
|
|
86
|
+
const m = {
|
|
87
|
+
...w,
|
|
88
|
+
isPositioned: !0
|
|
89
|
+
};
|
|
90
|
+
S.current && !h(y.current, m) && (y.current = m, X.flushSync(() => {
|
|
91
|
+
D(m);
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
}, [x, t, n, P]);
|
|
95
|
+
R(() => {
|
|
96
|
+
k === !1 && y.current.isPositioned && (y.current.isPositioned = !1, D((o) => ({
|
|
97
|
+
...o,
|
|
98
|
+
isPositioned: !1
|
|
99
|
+
})));
|
|
100
|
+
}, [k]);
|
|
101
|
+
const S = f.useRef(!1);
|
|
102
|
+
R(() => (S.current = !0, () => {
|
|
103
|
+
S.current = !1;
|
|
104
|
+
}), []), R(() => {
|
|
105
|
+
if (u && (a.current = u), l && (d.current = l), u && l) {
|
|
106
|
+
if (M.current)
|
|
107
|
+
return M.current(u, l, g);
|
|
108
|
+
g();
|
|
109
|
+
}
|
|
110
|
+
}, [u, l, g, M, G]);
|
|
111
|
+
const C = f.useMemo(() => ({
|
|
112
|
+
reference: a,
|
|
113
|
+
floating: d,
|
|
114
|
+
setReference: O,
|
|
115
|
+
setFloating: _
|
|
116
|
+
}), [O, _]), c = f.useMemo(() => ({
|
|
117
|
+
reference: u,
|
|
118
|
+
floating: l
|
|
119
|
+
}), [u, l]), F = f.useMemo(() => {
|
|
120
|
+
const o = {
|
|
121
|
+
position: n,
|
|
122
|
+
left: 0,
|
|
123
|
+
top: 0
|
|
124
|
+
};
|
|
125
|
+
if (!c.floating)
|
|
126
|
+
return o;
|
|
127
|
+
const w = L(c.floating, i.x), m = L(c.floating, i.y);
|
|
128
|
+
return E ? {
|
|
129
|
+
...o,
|
|
130
|
+
transform: "translate(" + w + "px, " + m + "px)",
|
|
131
|
+
...A(c.floating) >= 1.5 && {
|
|
132
|
+
willChange: "transform"
|
|
133
|
+
}
|
|
134
|
+
} : {
|
|
135
|
+
position: n,
|
|
136
|
+
left: w,
|
|
137
|
+
top: m
|
|
138
|
+
};
|
|
139
|
+
}, [n, E, c.floating, i.x, i.y]);
|
|
140
|
+
return f.useMemo(() => ({
|
|
141
|
+
...i,
|
|
142
|
+
update: g,
|
|
143
|
+
refs: C,
|
|
144
|
+
elements: c,
|
|
145
|
+
floatingStyles: F
|
|
146
|
+
}), [i, g, C, c, F]);
|
|
147
|
+
}
|
|
148
|
+
const Y = (e) => {
|
|
149
|
+
function t(n) {
|
|
150
|
+
return {}.hasOwnProperty.call(n, "current");
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
name: "arrow",
|
|
154
|
+
options: e,
|
|
155
|
+
fn(n) {
|
|
156
|
+
const {
|
|
157
|
+
element: r,
|
|
158
|
+
padding: s
|
|
159
|
+
} = typeof e == "function" ? e(n) : e;
|
|
160
|
+
return r && t(r) ? r.current != null ? j({
|
|
161
|
+
element: r.current,
|
|
162
|
+
padding: s
|
|
163
|
+
}).fn(n) : {} : r ? j({
|
|
164
|
+
element: r,
|
|
165
|
+
padding: s
|
|
166
|
+
}).fn(n) : {};
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}, te = (e, t) => ({
|
|
170
|
+
...H(e),
|
|
171
|
+
options: [e, t]
|
|
172
|
+
}), ne = (e, t) => ({
|
|
173
|
+
...I(e),
|
|
174
|
+
options: [e, t]
|
|
175
|
+
}), re = (e, t) => ({
|
|
176
|
+
...J(e),
|
|
177
|
+
options: [e, t]
|
|
178
|
+
}), fe = (e, t) => ({
|
|
179
|
+
...K(e),
|
|
180
|
+
options: [e, t]
|
|
181
|
+
}), oe = (e, t) => ({
|
|
182
|
+
...Y(e),
|
|
183
|
+
options: [e, t]
|
|
184
|
+
});
|
|
2
185
|
export {
|
|
3
|
-
|
|
186
|
+
oe as arrow,
|
|
187
|
+
ue as autoUpdate,
|
|
188
|
+
N as computePosition,
|
|
189
|
+
re as flip,
|
|
190
|
+
fe as inline,
|
|
191
|
+
te as offset,
|
|
192
|
+
le as platform,
|
|
193
|
+
ne as shift,
|
|
194
|
+
ee as useFloating
|
|
4
195
|
};
|
|
5
196
|
//# sourceMappingURL=annotorious-react.es15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es15.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"annotorious-react.es15.js","sources":["../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs"],"sourcesContent":["import { computePosition, arrow as arrow$2, offset as offset$1, shift as shift$1, limitShift as limitShift$1, flip as flip$1, size as size$1, autoPlacement as autoPlacement$1, hide as hide$1, inline as inline$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n isPositioned: true\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => ({\n ...offset$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => ({\n ...shift$1(options),\n options: [options, deps]\n});\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => ({\n ...limitShift$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => ({\n ...flip$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => ({\n ...size$1(options),\n options: [options, deps]\n});\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => ({\n ...autoPlacement$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => ({\n ...hide$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => ({\n ...inline$1(options),\n options: [options, deps]\n});\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => ({\n ...arrow$1(options),\n options: [options, deps]\n});\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n"],"names":["index","useLayoutEffect","useEffect","deepEqual","a","b","length","i","keys","key","getDPR","element","roundByDPR","value","dpr","useLatestRef","ref","React","useFloating","options","placement","strategy","middleware","platform","externalReference","externalFloating","transform","whileElementsMounted","open","data","setData","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","setReference","node","referenceRef","setFloating","floatingRef","referenceEl","floatingEl","dataRef","hasWhileElementsMounted","whileElementsMountedRef","platformRef","update","config","computePosition","fullData","isMountedRef","ReactDOM","refs","elements","floatingStyles","initialStyles","x","y","arrow$1","isRef","state","padding","arrow$2","offset","deps","offset$1","shift","shift$1","flip","flip$1","inline","inline$1","arrow"],"mappings":";;;;;AAMA,IAAIA,IAAQ,OAAO,WAAa,MAAcC,IAAkBC;AAIhE,SAASC,EAAUC,GAAGC,GAAG;AACvB,MAAID,MAAMC;AACR,WAAO;AAET,MAAI,OAAOD,KAAM,OAAOC;AACtB,WAAO;AAET,MAAI,OAAOD,KAAM,cAAcA,EAAE,eAAeC,EAAE;AAChD,WAAO;AAET,MAAIC,GACAC,GACAC;AACJ,MAAIJ,KAAKC,KAAK,OAAOD,KAAM,UAAU;AACnC,QAAI,MAAM,QAAQA,CAAC,GAAG;AAEpB,UADAE,IAASF,EAAE,QACPE,MAAWD,EAAE,OAAQ,QAAO;AAChC,WAAKE,IAAID,GAAQC,QAAQ;AACvB,YAAI,CAACJ,EAAUC,EAAEG,CAAC,GAAGF,EAAEE,CAAC,CAAC;AACvB,iBAAO;AAGX,aAAO;AAAA,IACR;AAGD,QAFAC,IAAO,OAAO,KAAKJ,CAAC,GACpBE,IAASE,EAAK,QACVF,MAAW,OAAO,KAAKD,CAAC,EAAE;AAC5B,aAAO;AAET,SAAKE,IAAID,GAAQC,QAAQ;AACvB,UAAI,CAAC,CAAE,EAAC,eAAe,KAAKF,GAAGG,EAAKD,CAAC,CAAC;AACpC,eAAO;AAGX,SAAKA,IAAID,GAAQC,QAAQ,KAAI;AAC3B,YAAME,IAAMD,EAAKD,CAAC;AAClB,UAAI,EAAAE,MAAQ,YAAYL,EAAE,aAGtB,CAACD,EAAUC,EAAEK,CAAG,GAAGJ,EAAEI,CAAG,CAAC;AAC3B,eAA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AuCMM,KAAS,CAACrD,GAAS+C,OAAU;AAAA,EACjC,GAAGO,EAAStD,CAAO;AAAA,EACnB,SAAS,CAACA,GAAS+C,CAAI;AACzB,IAQMQ,KAAQ,CAACvD,GAAS+C,OAAU;AAAA,EAChC,GAAGN,EAAQzC,CAAO;AAAA,EAClB,SAAS,CAACA,GAAS+C,CAAI;AACzB;","x_google_ignoreList":[0]}
|
|
@@ -1,29 +1,372 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function v() {
|
|
14
|
-
if (p) return t;
|
|
15
|
-
p = 1;
|
|
16
|
-
var s = R, m = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
17
|
-
function i(o, r, u) {
|
|
18
|
-
var e, n = {}, _ = null, f = null;
|
|
19
|
-
u !== void 0 && (_ = "" + u), r.key !== void 0 && (_ = "" + r.key), r.ref !== void 0 && (f = r.ref);
|
|
20
|
-
for (e in r) c.call(r, e) && !y.hasOwnProperty(e) && (n[e] = r[e]);
|
|
21
|
-
if (o && o.defaultProps) for (e in r = o.defaultProps, r) n[e] === void 0 && (n[e] = r[e]);
|
|
22
|
-
return { $$typeof: m, type: o, key: _, ref: f, props: n, _owner: d.current };
|
|
23
|
-
}
|
|
24
|
-
return t.Fragment = l, t.jsx = i, t.jsxs = i, t;
|
|
1
|
+
import { offset as et, shift as it, flip as nt, inline as ot, arrow as st, computePosition as rt } from "./annotorious-react.es28.js";
|
|
2
|
+
import { createCoords as b, rectToClientRect as X, round as D, floor as A, max as T, min as z } from "./annotorious-react.es27.js";
|
|
3
|
+
import { getOverflowAncestors as $, isElement as x, getWindow as E, getFrameElement as U, getComputedStyle as y, getDocumentElement as C, isHTMLElement as R, isWebKit as j, isTopLayer as S, getNodeName as M, isOverflowElement as _, getNodeScroll as H, getParentNode as W, isLastTraversableNode as N, isTableElement as ct, isContainingBlock as G, getContainingBlock as lt } from "./annotorious-react.es21.js";
|
|
4
|
+
function J(t) {
|
|
5
|
+
const e = y(t);
|
|
6
|
+
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
|
7
|
+
const o = R(t), c = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, r = D(n) !== c || D(i) !== s;
|
|
8
|
+
return r && (n = c, i = s), {
|
|
9
|
+
width: n,
|
|
10
|
+
height: i,
|
|
11
|
+
$: r
|
|
12
|
+
};
|
|
25
13
|
}
|
|
14
|
+
function k(t) {
|
|
15
|
+
return x(t) ? t : t.contextElement;
|
|
16
|
+
}
|
|
17
|
+
function F(t) {
|
|
18
|
+
const e = k(t);
|
|
19
|
+
if (!R(e))
|
|
20
|
+
return b(1);
|
|
21
|
+
const n = e.getBoundingClientRect(), {
|
|
22
|
+
width: i,
|
|
23
|
+
height: o,
|
|
24
|
+
$: c
|
|
25
|
+
} = J(e);
|
|
26
|
+
let s = (c ? D(n.width) : n.width) / i, r = (c ? D(n.height) : n.height) / o;
|
|
27
|
+
return (!s || !Number.isFinite(s)) && (s = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
|
28
|
+
x: s,
|
|
29
|
+
y: r
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const ft = /* @__PURE__ */ b(0);
|
|
33
|
+
function Q(t) {
|
|
34
|
+
const e = E(t);
|
|
35
|
+
return !j() || !e.visualViewport ? ft : {
|
|
36
|
+
x: e.visualViewport.offsetLeft,
|
|
37
|
+
y: e.visualViewport.offsetTop
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function ut(t, e, n) {
|
|
41
|
+
return e === void 0 && (e = !1), !n || e && n !== E(t) ? !1 : e;
|
|
42
|
+
}
|
|
43
|
+
function L(t, e, n, i) {
|
|
44
|
+
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
|
45
|
+
const o = t.getBoundingClientRect(), c = k(t);
|
|
46
|
+
let s = b(1);
|
|
47
|
+
e && (i ? x(i) && (s = F(i)) : s = F(t));
|
|
48
|
+
const r = ut(c, n, i) ? Q(c) : b(0);
|
|
49
|
+
let l = (o.left + r.x) / s.x, f = (o.top + r.y) / s.y, u = o.width / s.x, h = o.height / s.y;
|
|
50
|
+
if (c) {
|
|
51
|
+
const m = E(c), g = i && x(i) ? E(i) : i;
|
|
52
|
+
let v = m, a = U(v);
|
|
53
|
+
for (; a && i && g !== v; ) {
|
|
54
|
+
const p = F(a), d = a.getBoundingClientRect(), w = y(a), O = d.left + (a.clientLeft + parseFloat(w.paddingLeft)) * p.x, B = d.top + (a.clientTop + parseFloat(w.paddingTop)) * p.y;
|
|
55
|
+
l *= p.x, f *= p.y, u *= p.x, h *= p.y, l += O, f += B, v = E(a), a = U(v);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return X({
|
|
59
|
+
width: u,
|
|
60
|
+
height: h,
|
|
61
|
+
x: l,
|
|
62
|
+
y: f
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function ht(t) {
|
|
66
|
+
let {
|
|
67
|
+
elements: e,
|
|
68
|
+
rect: n,
|
|
69
|
+
offsetParent: i,
|
|
70
|
+
strategy: o
|
|
71
|
+
} = t;
|
|
72
|
+
const c = o === "fixed", s = C(i), r = e ? S(e.floating) : !1;
|
|
73
|
+
if (i === s || r && c)
|
|
74
|
+
return n;
|
|
75
|
+
let l = {
|
|
76
|
+
scrollLeft: 0,
|
|
77
|
+
scrollTop: 0
|
|
78
|
+
}, f = b(1);
|
|
79
|
+
const u = b(0), h = R(i);
|
|
80
|
+
if ((h || !h && !c) && ((M(i) !== "body" || _(s)) && (l = H(i)), R(i))) {
|
|
81
|
+
const m = L(i);
|
|
82
|
+
f = F(i), u.x = m.x + i.clientLeft, u.y = m.y + i.clientTop;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
width: n.width * f.x,
|
|
86
|
+
height: n.height * f.y,
|
|
87
|
+
x: n.x * f.x - l.scrollLeft * f.x + u.x,
|
|
88
|
+
y: n.y * f.y - l.scrollTop * f.y + u.y
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function at(t) {
|
|
92
|
+
return Array.from(t.getClientRects());
|
|
93
|
+
}
|
|
94
|
+
function Y(t) {
|
|
95
|
+
return L(C(t)).left + H(t).scrollLeft;
|
|
96
|
+
}
|
|
97
|
+
function dt(t) {
|
|
98
|
+
const e = C(t), n = H(t), i = t.ownerDocument.body, o = T(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), c = T(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
|
99
|
+
let s = -n.scrollLeft + Y(t);
|
|
100
|
+
const r = -n.scrollTop;
|
|
101
|
+
return y(i).direction === "rtl" && (s += T(e.clientWidth, i.clientWidth) - o), {
|
|
102
|
+
width: o,
|
|
103
|
+
height: c,
|
|
104
|
+
x: s,
|
|
105
|
+
y: r
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function gt(t, e) {
|
|
109
|
+
const n = E(t), i = C(t), o = n.visualViewport;
|
|
110
|
+
let c = i.clientWidth, s = i.clientHeight, r = 0, l = 0;
|
|
111
|
+
if (o) {
|
|
112
|
+
c = o.width, s = o.height;
|
|
113
|
+
const f = j();
|
|
114
|
+
(!f || f && e === "fixed") && (r = o.offsetLeft, l = o.offsetTop);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
width: c,
|
|
118
|
+
height: s,
|
|
119
|
+
x: r,
|
|
120
|
+
y: l
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function pt(t, e) {
|
|
124
|
+
const n = L(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, c = R(t) ? F(t) : b(1), s = t.clientWidth * c.x, r = t.clientHeight * c.y, l = o * c.x, f = i * c.y;
|
|
125
|
+
return {
|
|
126
|
+
width: s,
|
|
127
|
+
height: r,
|
|
128
|
+
x: l,
|
|
129
|
+
y: f
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function K(t, e, n) {
|
|
133
|
+
let i;
|
|
134
|
+
if (e === "viewport")
|
|
135
|
+
i = gt(t, n);
|
|
136
|
+
else if (e === "document")
|
|
137
|
+
i = dt(C(t));
|
|
138
|
+
else if (x(e))
|
|
139
|
+
i = pt(e, n);
|
|
140
|
+
else {
|
|
141
|
+
const o = Q(t);
|
|
142
|
+
i = {
|
|
143
|
+
...e,
|
|
144
|
+
x: e.x - o.x,
|
|
145
|
+
y: e.y - o.y
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return X(i);
|
|
149
|
+
}
|
|
150
|
+
function Z(t, e) {
|
|
151
|
+
const n = W(t);
|
|
152
|
+
return n === e || !x(n) || N(n) ? !1 : y(n).position === "fixed" || Z(n, e);
|
|
153
|
+
}
|
|
154
|
+
function wt(t, e) {
|
|
155
|
+
const n = e.get(t);
|
|
156
|
+
if (n)
|
|
157
|
+
return n;
|
|
158
|
+
let i = $(t, [], !1).filter((r) => x(r) && M(r) !== "body"), o = null;
|
|
159
|
+
const c = y(t).position === "fixed";
|
|
160
|
+
let s = c ? W(t) : t;
|
|
161
|
+
for (; x(s) && !N(s); ) {
|
|
162
|
+
const r = y(s), l = G(s);
|
|
163
|
+
!l && r.position === "fixed" && (o = null), (c ? !l && !o : !l && r.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l && Z(t, s)) ? i = i.filter((u) => u !== s) : o = r, s = W(s);
|
|
164
|
+
}
|
|
165
|
+
return e.set(t, i), i;
|
|
166
|
+
}
|
|
167
|
+
function mt(t) {
|
|
168
|
+
let {
|
|
169
|
+
element: e,
|
|
170
|
+
boundary: n,
|
|
171
|
+
rootBoundary: i,
|
|
172
|
+
strategy: o
|
|
173
|
+
} = t;
|
|
174
|
+
const s = [...n === "clippingAncestors" ? S(e) ? [] : wt(e, this._c) : [].concat(n), i], r = s[0], l = s.reduce((f, u) => {
|
|
175
|
+
const h = K(e, u, o);
|
|
176
|
+
return f.top = T(h.top, f.top), f.right = z(h.right, f.right), f.bottom = z(h.bottom, f.bottom), f.left = T(h.left, f.left), f;
|
|
177
|
+
}, K(e, r, o));
|
|
178
|
+
return {
|
|
179
|
+
width: l.right - l.left,
|
|
180
|
+
height: l.bottom - l.top,
|
|
181
|
+
x: l.left,
|
|
182
|
+
y: l.top
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function vt(t) {
|
|
186
|
+
const {
|
|
187
|
+
width: e,
|
|
188
|
+
height: n
|
|
189
|
+
} = J(t);
|
|
190
|
+
return {
|
|
191
|
+
width: e,
|
|
192
|
+
height: n
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
function xt(t, e, n) {
|
|
196
|
+
const i = R(e), o = C(e), c = n === "fixed", s = L(t, !0, c, e);
|
|
197
|
+
let r = {
|
|
198
|
+
scrollLeft: 0,
|
|
199
|
+
scrollTop: 0
|
|
200
|
+
};
|
|
201
|
+
const l = b(0);
|
|
202
|
+
if (i || !i && !c)
|
|
203
|
+
if ((M(e) !== "body" || _(o)) && (r = H(e)), i) {
|
|
204
|
+
const h = L(e, !0, c, e);
|
|
205
|
+
l.x = h.x + e.clientLeft, l.y = h.y + e.clientTop;
|
|
206
|
+
} else o && (l.x = Y(o));
|
|
207
|
+
const f = s.left + r.scrollLeft - l.x, u = s.top + r.scrollTop - l.y;
|
|
208
|
+
return {
|
|
209
|
+
x: f,
|
|
210
|
+
y: u,
|
|
211
|
+
width: s.width,
|
|
212
|
+
height: s.height
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function V(t) {
|
|
216
|
+
return y(t).position === "static";
|
|
217
|
+
}
|
|
218
|
+
function P(t, e) {
|
|
219
|
+
return !R(t) || y(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
|
220
|
+
}
|
|
221
|
+
function tt(t, e) {
|
|
222
|
+
const n = E(t);
|
|
223
|
+
if (S(t))
|
|
224
|
+
return n;
|
|
225
|
+
if (!R(t)) {
|
|
226
|
+
let o = W(t);
|
|
227
|
+
for (; o && !N(o); ) {
|
|
228
|
+
if (x(o) && !V(o))
|
|
229
|
+
return o;
|
|
230
|
+
o = W(o);
|
|
231
|
+
}
|
|
232
|
+
return n;
|
|
233
|
+
}
|
|
234
|
+
let i = P(t, e);
|
|
235
|
+
for (; i && ct(i) && V(i); )
|
|
236
|
+
i = P(i, e);
|
|
237
|
+
return i && N(i) && V(i) && !G(i) ? n : i || lt(t) || n;
|
|
238
|
+
}
|
|
239
|
+
const yt = async function(t) {
|
|
240
|
+
const e = this.getOffsetParent || tt, n = this.getDimensions, i = await n(t.floating);
|
|
241
|
+
return {
|
|
242
|
+
reference: xt(t.reference, await e(t.floating), t.strategy),
|
|
243
|
+
floating: {
|
|
244
|
+
x: 0,
|
|
245
|
+
y: 0,
|
|
246
|
+
width: i.width,
|
|
247
|
+
height: i.height
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
function bt(t) {
|
|
252
|
+
return y(t).direction === "rtl";
|
|
253
|
+
}
|
|
254
|
+
const Rt = {
|
|
255
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ht,
|
|
256
|
+
getDocumentElement: C,
|
|
257
|
+
getClippingRect: mt,
|
|
258
|
+
getOffsetParent: tt,
|
|
259
|
+
getElementRects: yt,
|
|
260
|
+
getClientRects: at,
|
|
261
|
+
getDimensions: vt,
|
|
262
|
+
getScale: F,
|
|
263
|
+
isElement: x,
|
|
264
|
+
isRTL: bt
|
|
265
|
+
};
|
|
266
|
+
function Ct(t, e) {
|
|
267
|
+
let n = null, i;
|
|
268
|
+
const o = C(t);
|
|
269
|
+
function c() {
|
|
270
|
+
var r;
|
|
271
|
+
clearTimeout(i), (r = n) == null || r.disconnect(), n = null;
|
|
272
|
+
}
|
|
273
|
+
function s(r, l) {
|
|
274
|
+
r === void 0 && (r = !1), l === void 0 && (l = 1), c();
|
|
275
|
+
const {
|
|
276
|
+
left: f,
|
|
277
|
+
top: u,
|
|
278
|
+
width: h,
|
|
279
|
+
height: m
|
|
280
|
+
} = t.getBoundingClientRect();
|
|
281
|
+
if (r || e(), !h || !m)
|
|
282
|
+
return;
|
|
283
|
+
const g = A(u), v = A(o.clientWidth - (f + h)), a = A(o.clientHeight - (u + m)), p = A(f), w = {
|
|
284
|
+
rootMargin: -g + "px " + -v + "px " + -a + "px " + -p + "px",
|
|
285
|
+
threshold: T(0, z(1, l)) || 1
|
|
286
|
+
};
|
|
287
|
+
let O = !0;
|
|
288
|
+
function B(q) {
|
|
289
|
+
const I = q[0].intersectionRatio;
|
|
290
|
+
if (I !== l) {
|
|
291
|
+
if (!O)
|
|
292
|
+
return s();
|
|
293
|
+
I ? s(!1, I) : i = setTimeout(() => {
|
|
294
|
+
s(!1, 1e-7);
|
|
295
|
+
}, 1e3);
|
|
296
|
+
}
|
|
297
|
+
O = !1;
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
n = new IntersectionObserver(B, {
|
|
301
|
+
...w,
|
|
302
|
+
// Handle <iframe>s
|
|
303
|
+
root: o.ownerDocument
|
|
304
|
+
});
|
|
305
|
+
} catch {
|
|
306
|
+
n = new IntersectionObserver(B, w);
|
|
307
|
+
}
|
|
308
|
+
n.observe(t);
|
|
309
|
+
}
|
|
310
|
+
return s(!0), c;
|
|
311
|
+
}
|
|
312
|
+
function Tt(t, e, n, i) {
|
|
313
|
+
i === void 0 && (i = {});
|
|
314
|
+
const {
|
|
315
|
+
ancestorScroll: o = !0,
|
|
316
|
+
ancestorResize: c = !0,
|
|
317
|
+
elementResize: s = typeof ResizeObserver == "function",
|
|
318
|
+
layoutShift: r = typeof IntersectionObserver == "function",
|
|
319
|
+
animationFrame: l = !1
|
|
320
|
+
} = i, f = k(t), u = o || c ? [...f ? $(f) : [], ...$(e)] : [];
|
|
321
|
+
u.forEach((d) => {
|
|
322
|
+
o && d.addEventListener("scroll", n, {
|
|
323
|
+
passive: !0
|
|
324
|
+
}), c && d.addEventListener("resize", n);
|
|
325
|
+
});
|
|
326
|
+
const h = f && r ? Ct(f, n) : null;
|
|
327
|
+
let m = -1, g = null;
|
|
328
|
+
s && (g = new ResizeObserver((d) => {
|
|
329
|
+
let [w] = d;
|
|
330
|
+
w && w.target === f && g && (g.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
331
|
+
var O;
|
|
332
|
+
(O = g) == null || O.observe(e);
|
|
333
|
+
})), n();
|
|
334
|
+
}), f && !l && g.observe(f), g.observe(e));
|
|
335
|
+
let v, a = l ? L(t) : null;
|
|
336
|
+
l && p();
|
|
337
|
+
function p() {
|
|
338
|
+
const d = L(t);
|
|
339
|
+
a && (d.x !== a.x || d.y !== a.y || d.width !== a.width || d.height !== a.height) && n(), a = d, v = requestAnimationFrame(p);
|
|
340
|
+
}
|
|
341
|
+
return n(), () => {
|
|
342
|
+
var d;
|
|
343
|
+
u.forEach((w) => {
|
|
344
|
+
o && w.removeEventListener("scroll", n), c && w.removeEventListener("resize", n);
|
|
345
|
+
}), h == null || h(), (d = g) == null || d.disconnect(), g = null, l && cancelAnimationFrame(v);
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
const Ft = et, Wt = it, Bt = nt, At = st, Dt = ot, Nt = (t, e, n) => {
|
|
349
|
+
const i = /* @__PURE__ */ new Map(), o = {
|
|
350
|
+
platform: Rt,
|
|
351
|
+
...n
|
|
352
|
+
}, c = {
|
|
353
|
+
...o.platform,
|
|
354
|
+
_c: i
|
|
355
|
+
};
|
|
356
|
+
return rt(t, e, {
|
|
357
|
+
...o,
|
|
358
|
+
platform: c
|
|
359
|
+
});
|
|
360
|
+
};
|
|
26
361
|
export {
|
|
27
|
-
|
|
362
|
+
At as arrow,
|
|
363
|
+
Tt as autoUpdate,
|
|
364
|
+
Nt as computePosition,
|
|
365
|
+
Bt as flip,
|
|
366
|
+
$ as getOverflowAncestors,
|
|
367
|
+
Dt as inline,
|
|
368
|
+
Ft as offset,
|
|
369
|
+
Rt as platform,
|
|
370
|
+
Wt as shift
|
|
28
371
|
};
|
|
29
372
|
//# sourceMappingURL=annotorious-react.es16.js.map
|