@annotorious/react-manifold 3.0.0-rc.31 → 3.0.0-rc.32

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,11 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
-
3
2
  interface AnnotoriousProps {
4
3
  children: ReactNode;
5
4
  id: string;
6
5
  }
7
6
  /**
8
- * An alternative <Annotorious /> component that mimicks the original
7
+ * An alternative <Annotorious /> component that mimics the original
9
8
  * from @annotorious/react, but injects the shim component, which connects
10
9
  * the Annotator to the Manifold.
11
10
  */
@@ -1,7 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Annotation, Annotator } from '@annotorious/react';
3
3
  import { AnnotoriousManifoldInstance } from './AnnotoriousManifoldInstance';
4
-
5
4
  interface AnnotoriousManifoldContextValue {
6
5
  annotators: Map<string, Annotator<any, {
7
6
  id: string;
@@ -1,5 +1,4 @@
1
1
  import { Origin, Annotation, AnnotationBody, Annotator } from '@annotorious/react';
2
-
3
2
  export interface AnnotoriousManifoldInstance<I extends Annotation = Annotation, E extends {
4
3
  id: string;
5
4
  } = Annotation> {
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react-manifold.es2.js","sources":["../src/openseadragon/OpenSeadragonViewer.tsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { OSDViewerContext } from './OpenSeadragonViewerManifold';\nimport { \n OpenSeadragonViewer as OpenSeadragonViewerInstance, \n OpenSeadragonViewerProps as OpenSeadragonViewerInstanceProps, \n useViewer \n} from '@annotorious/react';\n\n/** Passes the OSD viewer instance upwards to the manifold **/\nconst OpenSeadragonViewerInstanceShim = (props: { id: string }) => {\n\n const viewer = useViewer();\n\n const { setViewers } = useContext(OSDViewerContext);\n\n useEffect(() => {\n if (viewer) {\n setViewers(m => new Map(m.entries()).set(props.id, viewer));\n\n return () => {\n setViewers(m => new Map(Array.from(m.entries()).filter(([key, _]) => key !== props.id)));\n }\n }\n }, [viewer]);\n\n return null;\n\n}\n\ntype OpenSeadragonViewerProps = OpenSeadragonViewerInstanceProps & {\n\n id: string\n\n};\n\n/**\n * An alternative <OpenSeadragonViewer /> component that mimicks the original\n * from @annotorious/react, but injects a shim component that connects\n * the Viewer to the ViewerManifold.\n */\nexport const OpenSeadragonViewer = (props: OpenSeadragonViewerProps) => {\n\n return (\n <>\n <OpenSeadragonViewerInstance {...props} />\n <OpenSeadragonViewerInstanceShim id={props.id} />\n </>\n )\n\n}"],"names":["OpenSeadragonViewerInstanceShim","props","viewer","useViewer","setViewers","useContext","OSDViewerContext","useEffect","m","key","_","OpenSeadragonViewer","jsxs","Fragment","jsx","OpenSeadragonViewerInstance"],"mappings":";;;;AASA,MAAMA,IAAkC,CAACC,MAA0B;AAEjE,QAAMC,IAASC,KAET,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAgB;AAElD,SAAAC,EAAU,MAAM;AACd,QAAIL;AACS,aAAAE,EAAA,CAAAI,MAAK,IAAI,IAAIA,EAAE,SAAS,EAAE,IAAIP,EAAM,IAAIC,CAAM,CAAC,GAEnD,MAAM;AACX,QAAAE,EAAW,OAAK,IAAI,IAAI,MAAM,KAAKI,EAAE,QAAS,CAAA,EAAE,OAAO,CAAC,CAACC,GAAKC,CAAC,MAAMD,MAAQR,EAAM,EAAE,CAAC,CAAC;AAAA,MAAA;AAAA,EAE3F,GACC,CAACC,CAAM,CAAC,GAEJ;AAET,GAaaS,IAAsB,CAACV,MAI9BW,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,EAACC,gBAAAA,EAAAA,IAAAC,GAAA,EAA6B,GAAGd,GAAO;AAAA,EACvCa,gBAAAA,EAAAA,IAAAd,GAAA,EAAgC,IAAIC,EAAM,GAAI,CAAA;AACjD,EAAA,CAAA;"}
1
+ {"version":3,"file":"annotorious-react-manifold.es2.js","sources":["../src/openseadragon/OpenSeadragonViewer.tsx"],"sourcesContent":["import { useContext, useEffect } from 'react';\nimport { OSDViewerContext } from './OpenSeadragonViewerManifold';\nimport { \n OpenSeadragonViewer as OpenSeadragonViewerInstance, \n OpenSeadragonViewerProps as OpenSeadragonViewerInstanceProps, \n useViewer \n} from '@annotorious/react';\n\n/** Passes the OSD viewer instance upwards to the manifold **/\nconst OpenSeadragonViewerInstanceShim = (props: { id: string }) => {\n\n const viewer = useViewer();\n\n const { setViewers } = useContext(OSDViewerContext);\n\n useEffect(() => {\n if (viewer) {\n setViewers(m => new Map(m.entries()).set(props.id, viewer));\n\n return () => {\n setViewers(m => new Map(Array.from(m.entries()).filter(([key, _]) => key !== props.id)));\n }\n }\n }, [viewer]);\n\n return null;\n\n}\n\ntype OpenSeadragonViewerProps = OpenSeadragonViewerInstanceProps & {\n\n id: string\n\n};\n\n/**\n * An alternative <OpenSeadragonViewer /> component that mimics the original\n * from @annotorious/react, but injects a shim component that connects\n * the Viewer to the ViewerManifold.\n */\nexport const OpenSeadragonViewer = (props: OpenSeadragonViewerProps) => {\n\n return (\n <>\n <OpenSeadragonViewerInstance {...props} />\n <OpenSeadragonViewerInstanceShim id={props.id} />\n </>\n )\n\n}"],"names":["OpenSeadragonViewerInstanceShim","props","viewer","useViewer","setViewers","useContext","OSDViewerContext","useEffect","m","key","_","OpenSeadragonViewer","jsxs","Fragment","jsx","OpenSeadragonViewerInstance"],"mappings":";;;;AASA,MAAMA,IAAkC,CAACC,MAA0B;AAEjE,QAAMC,IAASC,KAET,EAAE,YAAAC,EAAA,IAAeC,EAAWC,CAAgB;AAElD,SAAAC,EAAU,MAAM;AACd,QAAIL;AACS,aAAAE,EAAA,CAAAI,MAAK,IAAI,IAAIA,EAAE,SAAS,EAAE,IAAIP,EAAM,IAAIC,CAAM,CAAC,GAEnD,MAAM;AACX,QAAAE,EAAW,OAAK,IAAI,IAAI,MAAM,KAAKI,EAAE,QAAS,CAAA,EAAE,OAAO,CAAC,CAACC,GAAKC,CAAC,MAAMD,MAAQR,EAAM,EAAE,CAAC,CAAC;AAAA,MAAA;AAAA,EAE3F,GACC,CAACC,CAAM,CAAC,GAEJ;AAET,GAaaS,IAAsB,CAACV,MAI9BW,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,EAACC,gBAAAA,EAAAA,IAAAC,GAAA,EAA6B,GAAGd,GAAO;AAAA,EACvCa,gBAAAA,EAAAA,IAAAd,GAAA,EAAgC,IAAIC,EAAM,GAAI,CAAA;AACjD,EAAA,CAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react-manifold.es4.js","sources":["../src/Annotorious.tsx"],"sourcesContent":["import { ReactNode, useContext, useEffect } from 'react';\nimport { Annotation, Annotator, useAnnotator } from '@annotorious/react';\nimport { Annotorious as AnnotoriousInstance } from '@annotorious/react';\nimport { AnnotoriousManifoldContext } from './AnnotoriousManifold';\n\ninterface AnnotoriousProps {\n\n children: ReactNode;\n\n id: string;\n\n}\n\n/**\n * Consumes the standard Annotorious context, and passes the Annotator\n * upwards to the manifold.\n */\nconst AnnotoriousInstanceShim = <I extends Annotation = Annotation, E extends { id: string } = Annotation>(props: AnnotoriousProps) => {\n\n const anno = useAnnotator<Annotator<I, E>>();\n\n const { connectAnnotator } = useContext(AnnotoriousManifoldContext);\n\n useEffect(() => { \n if (anno) {\n return connectAnnotator(props.id, anno);\n }\n }, [anno]);\n\n return <>{props.children}</>;\n\n}\n\n/**\n * An alternative <Annotorious /> component that mimicks the original\n * from @annotorious/react, but injects the shim component, which connects\n * the Annotator to the Manifold.\n */\nexport const Annotorious = (props: AnnotoriousProps) => {\n\n return (\n <AnnotoriousInstance>\n <AnnotoriousInstanceShim id={props.id}>\n {props.children}\n </AnnotoriousInstanceShim>\n </AnnotoriousInstance>\n )\n\n}"],"names":["AnnotoriousInstanceShim","props","anno","useAnnotator","connectAnnotator","useContext","AnnotoriousManifoldContext","useEffect","jsx","Fragment","Annotorious","AnnotoriousInstance"],"mappings":";;;;AAiBA,MAAMA,IAA0B,CAA2EC,MAA4B;AAErI,QAAMC,IAAOC,KAEP,EAAE,kBAAAC,EAAA,IAAqBC,EAAWC,CAA0B;AAElE,SAAAC,EAAU,MAAM;AACd,QAAIL;AACK,aAAAE,EAAiBH,EAAM,IAAIC,CAAI;AAAA,EACxC,GACC,CAACA,CAAI,CAAC,GAEFM,gBAAAA,EAAAA,IAAAC,EAAAA,UAAA,EAAG,YAAM,SAAS,CAAA;AAE3B,GAOaC,IAAc,CAACT,MAGxBO,gBAAAA,EAAAA,IAACG,KACC,UAACH,gBAAAA,EAAA,IAAAR,GAAA,EAAwB,IAAIC,EAAM,IAChC,UAAMA,EAAA,SACT,CAAA,EACF,CAAA;"}
1
+ {"version":3,"file":"annotorious-react-manifold.es4.js","sources":["../src/Annotorious.tsx"],"sourcesContent":["import { ReactNode, useContext, useEffect } from 'react';\nimport { Annotation, Annotator, useAnnotator } from '@annotorious/react';\nimport { Annotorious as AnnotoriousInstance } from '@annotorious/react';\nimport { AnnotoriousManifoldContext } from './AnnotoriousManifold';\n\ninterface AnnotoriousProps {\n\n children: ReactNode;\n\n id: string;\n\n}\n\n/**\n * Consumes the standard Annotorious context, and passes the Annotator\n * upwards to the manifold.\n */\nconst AnnotoriousInstanceShim = <I extends Annotation = Annotation, E extends { id: string } = Annotation>(props: AnnotoriousProps) => {\n\n const anno = useAnnotator<Annotator<I, E>>();\n\n const { connectAnnotator } = useContext(AnnotoriousManifoldContext);\n\n useEffect(() => { \n if (anno) {\n return connectAnnotator(props.id, anno);\n }\n }, [anno]);\n\n return <>{props.children}</>;\n\n}\n\n/**\n * An alternative <Annotorious /> component that mimics the original\n * from @annotorious/react, but injects the shim component, which connects\n * the Annotator to the Manifold.\n */\nexport const Annotorious = (props: AnnotoriousProps) => {\n\n return (\n <AnnotoriousInstance>\n <AnnotoriousInstanceShim id={props.id}>\n {props.children}\n </AnnotoriousInstanceShim>\n </AnnotoriousInstance>\n )\n\n}"],"names":["AnnotoriousInstanceShim","props","anno","useAnnotator","connectAnnotator","useContext","AnnotoriousManifoldContext","useEffect","jsx","Fragment","Annotorious","AnnotoriousInstance"],"mappings":";;;;AAiBA,MAAMA,IAA0B,CAA2EC,MAA4B;AAErI,QAAMC,IAAOC,KAEP,EAAE,kBAAAC,EAAA,IAAqBC,EAAWC,CAA0B;AAElE,SAAAC,EAAU,MAAM;AACd,QAAIL;AACK,aAAAE,EAAiBH,EAAM,IAAIC,CAAI;AAAA,EACxC,GACC,CAACA,CAAI,CAAC,GAEFM,gBAAAA,EAAAA,IAAAC,EAAAA,UAAA,EAAG,YAAM,SAAS,CAAA;AAE3B,GAOaC,IAAc,CAACT,MAGxBO,gBAAAA,EAAAA,IAACG,KACC,UAACH,gBAAAA,EAAA,IAAAR,GAAA,EAAwB,IAAIC,EAAM,IAChC,UAAMA,EAAA,SACT,CAAA,EACF,CAAA;"}
@@ -1,10 +1,9 @@
1
1
  import { OpenSeadragonViewerProps as OpenSeadragonViewerInstanceProps } from '@annotorious/react';
2
-
3
2
  type OpenSeadragonViewerProps = OpenSeadragonViewerInstanceProps & {
4
3
  id: string;
5
4
  };
6
5
  /**
7
- * An alternative <OpenSeadragonViewer /> component that mimicks the original
6
+ * An alternative <OpenSeadragonViewer /> component that mimics the original
8
7
  * from @annotorious/react, but injects a shim component that connects
9
8
  * the Viewer to the ViewerManifold.
10
9
  */
@@ -1,6 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { Viewer } from '@annotorious/react';
3
-
4
3
  interface OSDViewerContextValue {
5
4
  viewers: Map<string, Viewer>;
6
5
  setViewers: React.Dispatch<React.SetStateAction<Map<string, Viewer>>>;
@@ -1,4 +1,3 @@
1
1
  import { Annotation, Annotator } from '@annotorious/react';
2
-
3
2
  export declare const synchronizeInstances: <I extends Annotation = Annotation, E extends unknown = Annotation>(instances: Annotator<I, E>[]) => any;
4
3
  //# sourceMappingURL=synchronizeInstances.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/react-manifold",
3
- "version": "3.0.0-rc.31",
3
+ "version": "3.0.0-rc.32",
4
4
  "description": "A utility to manage multiple parallel Annotorious instances more efficiently",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -30,17 +30,17 @@
30
30
  "test": "echo 'Skipping tests in @annotorious/annotorious-react-manifold package'"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/react": "^18.3.3",
33
+ "@types/react": "^18.3.4",
34
34
  "@types/react-dom": "^18.3.0",
35
35
  "@vitejs/plugin-react": "^4.3.1",
36
- "typescript": "5.5.3",
37
- "vite": "^5.3.5",
38
- "vite-plugin-dts": "^3.9.1",
39
- "vite-tsconfig-paths": "^4.3.2"
36
+ "typescript": "5.5.4",
37
+ "vite": "^5.4.2",
38
+ "vite-plugin-dts": "^4.0.3",
39
+ "vite-tsconfig-paths": "^5.0.1"
40
40
  },
41
41
  "peerDependencies": {
42
- "@annotorious/react": "3.0.0-rc.31",
43
- "openseadragon": "^3.0.0 || ^4.0.0",
42
+ "@annotorious/react": "3.0.0-rc.32",
43
+ "openseadragon": "^3.0.0 || ^4.0.0 || ^5.0.0",
44
44
  "react": "16.8.0 || >=17.x || >=18.x",
45
45
  "react-dom": "16.8.0 || >=17.x || >=18.x"
46
46
  }