@annotorious/react 3.0.20 → 3.0.22

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.
@@ -1,17 +1,17 @@
1
- import { j as f } from "./annotorious-react.es11.js";
2
- import { forwardRef as m, useRef as p, useContext as u, useLayoutEffect as c, useImperativeHandle as d } from "react";
1
+ import { j as a } from "./annotorious-react.es11.js";
2
+ import { forwardRef as m, useRef as u, useContext as p, useLayoutEffect as c, useImperativeHandle as d } from "react";
3
3
  import l from "openseadragon";
4
4
  import { OpenSeadragonAnnotatorContext as x } from "./annotorious-react.es8.js";
5
- const S = m((n, s) => {
6
- const { className: i, options: t } = n, r = p(null), { viewer: a, setViewer: e } = u(x);
5
+ const S = m((o, s) => {
6
+ const { className: i, options: t } = o, r = u(null), { viewer: f, setViewer: e } = p(x);
7
7
  return c(() => {
8
8
  if (r.current) {
9
- const o = l({ ...t, element: r.current });
10
- return e && e(o), () => {
11
- e && e(void 0), o.destroy();
9
+ const n = l({ ...t, element: r.current });
10
+ return e && e(n), () => {
11
+ e && e(void 0), n.destroy();
12
12
  };
13
13
  }
14
- }, [JSON.stringify(t)]), d(s, () => a), /* @__PURE__ */ f.jsx("div", { className: i, ref: r });
14
+ }, [JSON.stringify(t)]), d(s, () => f), /* @__PURE__ */ a.jsx("div", { className: i, ref: r });
15
15
  });
16
16
  export {
17
17
  S as OpenSeadragonViewer
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es11.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;AAEI,QAAQ,IAAI,aAAa,eAC3BA,EAAA,UAAiBC,EAAoD,IAErED,EAAA,UAAiBE,EAAiD;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"annotorious-react.es11.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;AAEI,QAAQ,IAAI,aAAa,eAC3BA,EAAA,UAAiBC,EAAgD,IAEjED,EAAA,UAAiBE,EAAiD;;","x_google_ignoreList":[0]}
@@ -4,7 +4,7 @@ import { getComputedStyle as Z, isElement as I } from "./annotorious-react.es21.
4
4
  import { getOverflowAncestors as Re } from "./annotorious-react.es21.js";
5
5
  import "react-dom";
6
6
  import { useFloating as z } from "./annotorious-react.es15.js";
7
- import { arrow as xe, flip as Ee, inline as we, offset as Ce, shift as Se } from "./annotorious-react.es15.js";
7
+ import { arrow as Ee, flip as ve, inline as we, offset as Ce, shift as Se } from "./annotorious-react.es15.js";
8
8
  const $ = {
9
9
  ...o
10
10
  }, G = $.useInsertionEffect, J = G || ((t) => t());
@@ -90,10 +90,10 @@ const me = /* @__PURE__ */ o.forwardRef(function(n, s) {
90
90
  transform: p,
91
91
  ...R
92
92
  } = {},
93
- ...v
93
+ ...x
94
94
  } = n;
95
95
  process.env.NODE_ENV !== "production" && (s || te("The `ref` prop is required for `FloatingArrow`."));
96
- const x = B(), [C, f] = o.useState(!1);
96
+ const E = B(), [C, f] = o.useState(!1);
97
97
  if (b(() => {
98
98
  if (!r) return;
99
99
  Z(r).direction === "rtl" && f(!0);
@@ -102,7 +102,7 @@ const me = /* @__PURE__ */ o.forwardRef(function(n, s) {
102
102
  const [m, F] = e.split("-"), M = m === "top" || m === "bottom";
103
103
  let S = g;
104
104
  (M && u != null && u.x || !M && u != null && u.y) && (S = null);
105
- const E = d * 2, N = E / 2, A = i / 2 * (O / -8 + 1), T = a / 2 * O / 4, w = !!c, U = S && F === "end" ? "bottom" : "top";
105
+ const v = d * 2, N = v / 2, A = i / 2 * (O / -8 + 1), T = a / 2 * O / 4, w = !!c, U = S && F === "end" ? "bottom" : "top";
106
106
  let j = S && F === "end" ? "right" : "left";
107
107
  S && C && (j = F === "end" ? "left" : "right");
108
108
  const H = (l == null ? void 0 : l.x) != null ? S || l.x : "", X = (l == null ? void 0 : l.y) != null ? S || l.y : "", y = c || "M0,0" + (" H" + i) + (" L" + (i - A) + "," + (a - T)) + (" Q" + i / 2 + "," + a + " " + A + "," + (a - T)) + " Z", Y = {
@@ -111,10 +111,10 @@ const me = /* @__PURE__ */ o.forwardRef(function(n, s) {
111
111
  bottom: w ? "" : "rotate(180deg)",
112
112
  right: w ? "rotate(-90deg)" : "rotate(90deg)"
113
113
  }[m];
114
- return /* @__PURE__ */ o.createElement("svg", D({}, v, {
114
+ return /* @__PURE__ */ o.createElement("svg", D({}, x, {
115
115
  "aria-hidden": !0,
116
116
  ref: s,
117
- width: w ? i : i + E,
117
+ width: w ? i : i + v,
118
118
  height: i,
119
119
  viewBox: "0 0 " + i + " " + (a > i ? a : i),
120
120
  style: {
@@ -122,25 +122,25 @@ const me = /* @__PURE__ */ o.forwardRef(function(n, s) {
122
122
  pointerEvents: "none",
123
123
  [j]: H,
124
124
  [U]: X,
125
- [m]: M || w ? "100%" : "calc(100% - " + E / 2 + "px)",
125
+ [m]: M || w ? "100%" : "calc(100% - " + v / 2 + "px)",
126
126
  transform: [Y, p].filter((L) => !!L).join(" "),
127
127
  ...R
128
128
  }
129
- }), E > 0 && /* @__PURE__ */ o.createElement("path", {
130
- clipPath: "url(#" + x + ")",
129
+ }), v > 0 && /* @__PURE__ */ o.createElement("path", {
130
+ clipPath: "url(#" + E + ")",
131
131
  fill: "none",
132
132
  stroke: h,
133
- strokeWidth: E + (c ? 0 : 1),
133
+ strokeWidth: v + (c ? 0 : 1),
134
134
  d: y
135
135
  }), /* @__PURE__ */ o.createElement("path", {
136
- stroke: E && !c ? v.fill : "none",
136
+ stroke: v && !c ? x.fill : "none",
137
137
  d: y
138
138
  }), /* @__PURE__ */ o.createElement("clipPath", {
139
- id: x
139
+ id: E
140
140
  }, /* @__PURE__ */ o.createElement("rect", {
141
141
  x: -N,
142
142
  y: N * (w ? -1 : 1),
143
- width: i + E,
143
+ width: i + v,
144
144
  height: i
145
145
  })));
146
146
  });
@@ -232,21 +232,21 @@ function ge(t) {
232
232
  // `null` to support `positionReference` + an unstable `reference`
233
233
  // callback ref.
234
234
  f !== null && !I(f)) && c.refs.setReference(f);
235
- }, [c.refs]), v = o.useMemo(() => ({
235
+ }, [c.refs]), x = o.useMemo(() => ({
236
236
  ...c.refs,
237
237
  setReference: R,
238
238
  setPositionReference: p,
239
239
  domReference: g
240
- }), [c.refs, R, p]), x = o.useMemo(() => ({
240
+ }), [c.refs, R, p]), E = o.useMemo(() => ({
241
241
  ...c.elements,
242
242
  domReference: d
243
243
  }), [c.elements, d]), C = o.useMemo(() => ({
244
244
  ...c,
245
245
  ...e,
246
- refs: v,
247
- elements: x,
246
+ refs: x,
247
+ elements: E,
248
248
  nodeId: n
249
- }), [c, v, x, n, e]);
249
+ }), [c, x, E, n, e]);
250
250
  return b(() => {
251
251
  e.dataRef.current.floatingContext = C;
252
252
  const f = h == null ? void 0 : h.nodesRef.current.find((m) => m.id === n);
@@ -254,14 +254,14 @@ function ge(t) {
254
254
  }), o.useMemo(() => ({
255
255
  ...c,
256
256
  context: C,
257
- refs: v,
258
- elements: x
259
- }), [c, v, x, C]);
257
+ refs: x,
258
+ elements: E
259
+ }), [c, x, E, C]);
260
260
  }
261
261
  export {
262
262
  me as FloatingArrow,
263
- xe as arrow,
264
- Ee as flip,
263
+ Ee as arrow,
264
+ ve as flip,
265
265
  Re as getOverflowAncestors,
266
266
  we as inline,
267
267
  Ce as offset,
@@ -1,4 +1,4 @@
1
- import { offset as I, shift as J, flip as K, inline as N, computePosition as Q, arrow as v } from "./annotorious-react.es16.js";
1
+ import { offset as I, shift as J, flip as K, inline as N, computePosition as Q, arrow as A } from "./annotorious-react.es16.js";
2
2
  import { autoUpdate as le, platform as ce } from "./annotorious-react.es16.js";
3
3
  import * as f from "react";
4
4
  import { useLayoutEffect as T, useEffect as X } from "react";
@@ -34,11 +34,11 @@ function h(e, t) {
34
34
  }
35
35
  return e !== e && t !== t;
36
36
  }
37
- function q(e) {
37
+ function v(e) {
38
38
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
39
39
  }
40
- function A(e, t) {
41
- const n = q(e);
40
+ function q(e, t) {
41
+ const n = v(e);
42
42
  return Math.round(t * n) / n;
43
43
  }
44
44
  function $(e) {
@@ -128,11 +128,11 @@ function te(e) {
128
128
  };
129
129
  if (!c.floating)
130
130
  return o;
131
- const w = A(c.floating, i.x), m = A(c.floating, i.y);
131
+ const w = q(c.floating, i.x), m = q(c.floating, i.y);
132
132
  return k ? {
133
133
  ...o,
134
134
  transform: "translate(" + w + "px, " + m + "px)",
135
- ...q(c.floating) >= 1.5 && {
135
+ ...v(c.floating) >= 1.5 && {
136
136
  willChange: "transform"
137
137
  }
138
138
  } : {
@@ -161,10 +161,10 @@ const Z = (e) => {
161
161
  element: r,
162
162
  padding: s
163
163
  } = typeof e == "function" ? e(n) : e;
164
- return r && t(r) ? r.current != null ? v({
164
+ return r && t(r) ? r.current != null ? A({
165
165
  element: r.current,
166
166
  padding: s
167
- }).fn(n) : {} : r ? v({
167
+ }).fn(n) : {} : r ? A({
168
168
  element: r,
169
169
  padding: s
170
170
  }).fn(n) : {};