@annotorious/react 3.0.9 → 3.0.10

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 m } from "./annotorious-react.es11.js";
2
+ import { forwardRef as a, useRef as p, useContext as u, useEffect 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 = a((n, s) => {
6
+ const { className: i, options: r } = n, t = p(null), { viewer: f, setViewer: e } = u(x);
7
7
  return c(() => {
8
- if (r.current) {
9
- const o = l({ ...t, element: r.current });
10
- return e && e(o), () => {
8
+ if (t.current) {
9
+ const o = l({ ...r, element: t.current });
10
+ return e && setTimeout(() => e(o), 10), () => {
11
11
  e && e(void 0), o.destroy();
12
12
  };
13
13
  }
14
- }, [JSON.stringify(t)]), d(s, () => a), /* @__PURE__ */ f.jsx("div", { className: i, ref: r });
14
+ }, [JSON.stringify(r)]), d(s, () => f), /* @__PURE__ */ m.jsx("div", { className: i, ref: t });
15
15
  });
16
16
  export {
17
17
  S as OpenSeadragonViewer
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es10.js","sources":["../src/openseadragon/OpenSeadragonViewer.tsx"],"sourcesContent":["import { forwardRef, useContext, useImperativeHandle, useLayoutEffect, useRef } from 'react';\nimport OpenSeadragon from 'openseadragon';\nimport { OpenSeadragonAnnotatorContext } from './OpenSeadragonAnnotator';\n\nexport interface OpenSeadragonViewerProps {\n\n className?: string;\n\n options: OpenSeadragon.Options;\n\n}\n\nexport const OpenSeadragonViewer = forwardRef<OpenSeadragon.Viewer, OpenSeadragonViewerProps>((props: OpenSeadragonViewerProps, ref) => {\n\n const { className, options } = props;\n\n const element = useRef<HTMLDivElement>(null);\n\n const { viewer, setViewer } = useContext(OpenSeadragonAnnotatorContext);\n\n useLayoutEffect(() => { \n if (element.current) {\n const v = OpenSeadragon({...options, element: element.current });\n\n // Checking for setViewer is just a convenience so we can\n // use this component also without an OpenSeadragonAnnotator\n if (setViewer) setViewer(v);\n\n return () => {\n if (setViewer)\n setViewer(undefined);\n\n v.destroy();\n }\n }\n }, [JSON.stringify(options)]);\n\n useImperativeHandle(ref, () => viewer);\n\n return (\n <div className={className} ref={element} />\n );\n\n});"],"names":["OpenSeadragonViewer","forwardRef","props","ref","className","options","element","useRef","viewer","setViewer","useContext","OpenSeadragonAnnotatorContext","useLayoutEffect","v","OpenSeadragon","useImperativeHandle","jsx"],"mappings":";;;;AAYO,MAAMA,IAAsBC,EAA2D,CAACC,GAAiCC,MAAQ;AAEhI,QAAA,EAAE,WAAAC,GAAW,SAAAC,EAAY,IAAAH,GAEzBI,IAAUC,EAAuB,IAAI,GAErC,EAAE,QAAAC,GAAQ,WAAAC,EAAU,IAAIC,EAAWC,CAA6B;AAEtE,SAAAC,EAAgB,MAAM;AACpB,QAAIN,EAAQ,SAAS;AACb,YAAAO,IAAIC,EAAc,EAAC,GAAGT,GAAS,SAASC,EAAQ,SAAS;AAI3D,aAAAG,OAAqBI,CAAC,GAEnB,MAAM;AACP,QAAAJ,KACFA,EAAU,MAAS,GAErBI,EAAE,QAAQ;AAAA,MAAA;AAAA,IAEd;AAAA,KACC,CAAC,KAAK,UAAUR,CAAO,CAAC,CAAC,GAERU,EAAAZ,GAAK,MAAMK,CAAM,GAGlCQ,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAAZ,GAAsB,KAAKE,EAAS,CAAA;AAG7C,CAAC;"}
1
+ {"version":3,"file":"annotorious-react.es10.js","sources":["../src/openseadragon/OpenSeadragonViewer.tsx"],"sourcesContent":["import { forwardRef, useContext, useEffect, useImperativeHandle, useRef } from 'react';\nimport OpenSeadragon from 'openseadragon';\nimport { OpenSeadragonAnnotatorContext } from './OpenSeadragonAnnotator';\n\nexport interface OpenSeadragonViewerProps {\n\n className?: string;\n\n options: OpenSeadragon.Options;\n\n}\n\nexport const OpenSeadragonViewer = forwardRef<OpenSeadragon.Viewer, OpenSeadragonViewerProps>((props: OpenSeadragonViewerProps, ref) => {\n\n const { className, options } = props;\n\n const element = useRef<HTMLDivElement>(null);\n\n const { viewer, setViewer } = useContext(OpenSeadragonAnnotatorContext);\n\n useEffect(() => { \n if (element.current) {\n const v = OpenSeadragon({...options, element: element.current });\n\n // Checking for setViewer is just a convenience so we can\n // use this component also without an OpenSeadragonAnnotator\n if (setViewer) {\n // There's some odd behavior where viewer exists already,\n // but viewer.element is undefined (despite us setting it to \n // element.current above). A short delay seems to make things\n // more stable.\n setTimeout(() => setViewer(v), 10);\n }\n\n return () => {\n if (setViewer)\n setViewer(undefined);\n\n v.destroy();\n }\n }\n }, [JSON.stringify(options)]);\n\n useImperativeHandle(ref, () => viewer);\n\n return (\n <div className={className} ref={element} />\n );\n\n});"],"names":["OpenSeadragonViewer","forwardRef","props","ref","className","options","element","useRef","viewer","setViewer","useContext","OpenSeadragonAnnotatorContext","useEffect","v","OpenSeadragon","useImperativeHandle","jsx"],"mappings":";;;;AAYO,MAAMA,IAAsBC,EAA2D,CAACC,GAAiCC,MAAQ;AAEhI,QAAA,EAAE,WAAAC,GAAW,SAAAC,EAAY,IAAAH,GAEzBI,IAAUC,EAAuB,IAAI,GAErC,EAAE,QAAAC,GAAQ,WAAAC,EAAU,IAAIC,EAAWC,CAA6B;AAEtE,SAAAC,EAAU,MAAM;AACd,QAAIN,EAAQ,SAAS;AACb,YAAAO,IAAIC,EAAc,EAAC,GAAGT,GAAS,SAASC,EAAQ,SAAS;AAI/D,aAAIG,KAKF,WAAW,MAAMA,EAAUI,CAAC,GAAG,EAAE,GAG5B,MAAM;AACP,QAAAJ,KACFA,EAAU,MAAS,GAErBI,EAAE,QAAQ;AAAA,MAAA;AAAA,IAEd;AAAA,KACC,CAAC,KAAK,UAAUR,CAAO,CAAC,CAAC,GAERU,EAAAZ,GAAK,MAAMK,CAAM,GAGlCQ,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAAZ,GAAsB,KAAKE,EAAS,CAAA;AAG7C,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenSeadragonViewer.d.ts","sourceRoot":"","sources":["../../src/openseadragon/OpenSeadragonViewer.tsx"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,eAAe,CAAC;AAG1C,MAAM,WAAW,wBAAwB;IAEvC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC;CAEhC;AAED,eAAO,MAAM,mBAAmB,2HA+B9B,CAAC"}
1
+ {"version":3,"file":"OpenSeadragonViewer.d.ts","sourceRoot":"","sources":["../../src/openseadragon/OpenSeadragonViewer.tsx"],"names":[],"mappings":"AACA,OAAO,aAAa,MAAM,eAAe,CAAC;AAG1C,MAAM,WAAW,wBAAwB;IAEvC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC;CAEhC;AAED,eAAO,MAAM,mBAAmB,2HAqC9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/react",
3
- "version": "3.0.9",
3
+ "version": "3.0.10",
4
4
  "description": "Annotorious React bindings",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -25,12 +25,12 @@
25
25
  "./annotorious-react.css": "./dist/annotorious-react.css"
26
26
  },
27
27
  "devDependencies": {
28
- "@types/react": "^18.3.9",
28
+ "@types/react": "^18.3.11",
29
29
  "@types/react-dom": "^18.3.0",
30
- "@vitejs/plugin-react": "^4.3.1",
30
+ "@vitejs/plugin-react": "^4.3.2",
31
31
  "typescript": "5.6.2",
32
32
  "vite": "^5.4.8",
33
- "vite-plugin-dts": "^4.2.2",
33
+ "vite-plugin-dts": "^4.2.3",
34
34
  "vite-tsconfig-paths": "^5.0.1"
35
35
  },
36
36
  "peerDependencies": {
@@ -44,9 +44,9 @@
44
44
  }
45
45
  },
46
46
  "dependencies": {
47
- "@annotorious/annotorious": "3.0.9",
48
- "@annotorious/core": "3.0.9",
49
- "@annotorious/openseadragon": "3.0.9",
47
+ "@annotorious/annotorious": "3.0.10",
48
+ "@annotorious/core": "3.0.10",
49
+ "@annotorious/openseadragon": "3.0.10",
50
50
  "@floating-ui/react": "^0.26.24"
51
51
  },
52
52
  "sideEffects": false