@annotorious/react-manifold 3.1.4 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKzD,UAAU,gBAAgB;IAExB,QAAQ,EAAE,SAAS,CAAC;IAEpB,EAAE,EAAE,MAAM,CAAC;CAEZ;AAsBD;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,gBAAgB,4CAUlD,CAAA"}
1
+ {"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKzD,UAAU,gBAAgB;IAExB,QAAQ,EAAE,SAAS,CAAC;IAEpB,EAAE,EAAE,MAAM,CAAC;CAEZ;AAsBD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAUlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotoriousManifold.d.ts","sourceRoot":"","sources":["../src/AnnotoriousManifold.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA0D,MAAM,OAAO,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,2BAA2B,EAA0B,MAAM,+BAA+B,CAAC;AAEpG,UAAU,+BAA+B;IAEvC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAExD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAEvC,SAAS,EAAE,iBAAiB,CAAC;IAE7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A;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,UAAU,OAE3B,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CACtC,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,OAE3B,iBAAiB,CAAC,CAAC,CACxC,CAAA"}
@@ -14,7 +14,7 @@ export interface AnnotoriousManifoldInstance<I extends Annotation = Annotation,
14
14
  getAnnotation(id: string): I | undefined;
15
15
  getAnnotations(): I[];
16
16
  getAnnotator(id: string): Annotator<I, E> | undefined;
17
- setSelected(annotationId: string): void;
17
+ setSelected(annotationId: string, editable?: boolean): void;
18
18
  updateAnnotation(arg1: string | I, arg2?: I | Origin, arg3?: Origin): void;
19
19
  }
20
20
  export declare const createManifoldInstance: <I extends Annotation = Annotation, E extends {
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotoriousManifoldInstance.d.ts","sourceRoot":"","sources":["../src/AnnotoriousManifoldInstance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU;IAEnH,UAAU,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAE9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErD,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAE7D,UAAU,CAAC,IAAI,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EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KACvC,2BAA2B,CAAC,CAAC,EAAE,CAAC,CA+FlC,CAAA"}
@@ -1,18 +1,18 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { createContext as i, useState as o, useContext as w } from "react";
2
+ import { createContext as i, useState as n, useContext as w } from "react";
3
3
  const r = i({
4
4
  viewers: void 0,
5
5
  setViewers: void 0
6
- }), u = (e) => {
7
- const [t, n] = o(/* @__PURE__ */ new Map());
8
- return /* @__PURE__ */ s(r.Provider, { value: { viewers: t, setViewers: n }, children: e.children });
9
- }, a = () => {
6
+ }), d = (e) => {
7
+ const [t, o] = n(/* @__PURE__ */ new Map());
8
+ return /* @__PURE__ */ s(r.Provider, { value: { viewers: t, setViewers: o }, children: e.children });
9
+ }, u = () => {
10
10
  const { viewers: e } = w(r);
11
11
  return e;
12
12
  };
13
13
  export {
14
14
  r as OSDViewerContext,
15
- u as OSDViewerManifold,
16
- a as useViewers
15
+ d as OSDViewerManifold,
16
+ u as useViewers
17
17
  };
18
18
  //# sourceMappingURL=annotorious-react-manifold.es3.js.map
@@ -1,33 +1,33 @@
1
1
  import { Origin as c } from "@annotorious/react";
2
2
  const B = (r) => {
3
- const e = (t) => Array.from(r.entries()).reduce((n, [o, s]) => {
4
- if (n)
5
- return n;
3
+ const e = (t) => Array.from(r.entries()).reduce((o, [n, s]) => {
4
+ if (o)
5
+ return o;
6
6
  const a = s.state.store.getAnnotation(t);
7
7
  if (a)
8
- return { annotation: a, annotator: s, source: o };
9
- }, void 0) || { annotation: void 0, annotator: void 0, source: void 0 }, i = (t, n = c.LOCAL) => {
10
- const { annotator: o } = e(t.annotation);
11
- o && o.state.store.addBody(t, n);
12
- }, d = (t = c.LOCAL) => Array.from(r.values()).forEach((n) => n.state.store.clear(t)), f = (t, n = c.LOCAL) => {
13
- const { annotation: o, annotator: s } = e(t);
8
+ return { annotation: a, annotator: s, source: n };
9
+ }, void 0) || { annotation: void 0, annotator: void 0, source: void 0 }, i = (t, o = c.LOCAL) => {
10
+ const { annotator: n } = e(t.annotation);
11
+ n && n.state.store.addBody(t, o);
12
+ }, d = (t = c.LOCAL) => Array.from(r.values()).forEach((o) => o.state.store.clear(t)), f = (t, o = c.LOCAL) => {
13
+ const { annotation: n, annotator: s } = e(t);
14
14
  if (s)
15
- return s.state.store.deleteAnnotation(t, n), o;
16
- }, u = (t, n = c.LOCAL) => {
17
- const { annotator: o } = e(t.annotation);
18
- o && o.state.store.deleteBody(t, n);
15
+ return s.state.store.deleteAnnotation(t, o), n;
16
+ }, u = (t, o = c.LOCAL) => {
17
+ const { annotator: n } = e(t.annotation);
18
+ n && n.state.store.deleteBody(t, o);
19
19
  }, A = () => Array.from(r.values()).forEach((t) => t.destroy()), l = (t) => {
20
- const { annotator: n } = e(t);
21
- return n;
20
+ const { annotator: o } = e(t);
21
+ return o;
22
22
  }, y = (t) => {
23
- const { source: n } = e(t);
24
- return n;
25
- }, L = (t) => e(t).annotation, m = () => Array.from(r.values()).reduce((t, n) => [...t, ...n.state.store.all()], []), p = (t) => r.get(t), O = (t, n, o) => {
23
+ const { source: o } = e(t);
24
+ return o;
25
+ }, v = (t) => e(t).annotation, L = () => Array.from(r.values()).reduce((t, o) => [...t, ...o.state.store.all()], []), m = (t) => r.get(t), p = (t, o, n) => {
26
26
  const s = typeof t == "string" ? t : t.id, { annotator: a } = e(s);
27
- a && a.state.store.updateAnnotation(t, n, o);
28
- }, g = (t) => {
27
+ a && a.state.store.updateAnnotation(t, o, n);
28
+ }, O = (t, o) => {
29
29
  const { annotator: n } = e(t);
30
- n && n.setSelected(t);
30
+ n && n.setSelected(t, o);
31
31
  };
32
32
  return {
33
33
  annotators: [...r.values()],
@@ -39,11 +39,11 @@ const B = (r) => {
39
39
  destroy: A,
40
40
  findAnnotator: l,
41
41
  findSource: y,
42
- getAnnotation: L,
43
- getAnnotations: m,
44
- getAnnotator: p,
45
- setSelected: g,
46
- updateAnnotation: O
42
+ getAnnotation: v,
43
+ getAnnotations: L,
44
+ getAnnotator: m,
45
+ setSelected: O,
46
+ updateAnnotation: p
47
47
  };
48
48
  };
49
49
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react-manifold.es6.js","sources":["../src/AnnotoriousManifoldInstance.ts"],"sourcesContent":["import { Origin } from '@annotorious/react';\nimport type {\n Annotation, \n AnnotationBody, \n Annotator\n} from '@annotorious/react';\n\nexport interface AnnotoriousManifoldInstance<I extends Annotation = Annotation, E extends { id: string } = Annotation> {\n\n annotators: Annotator<I, E>[];\n\n sources: string[];\n\n addBody(body: AnnotationBody, origin?: Origin): void;\n\n clear(origin: Origin): void;\n\n deleteAnnotation(id: string, origin?: Origin): I | undefined;\n\n deleteBody(body: AnnotationBody, origin?: Origin): void;\n\n destroy(): void;\n\n findAnnotator(annotationId: string): Annotator<I, E> | undefined;\n\n findSource(annotationId: string): string | undefined;\n\n getAnnotation(id: string): I | undefined;\n \n getAnnotations(): I[];\n\n getAnnotator(id: string): Annotator<I, E> | undefined;\n \n setSelected(annotationId: string): void;\n\n updateAnnotation(arg1: string | I, arg2?: I | Origin, arg3?: Origin): void;\n\n}\n\nexport const createManifoldInstance = <I extends Annotation = Annotation, E extends { id: string } = Annotation>(\n annotators: Map<string, Annotator<I, E>>\n): AnnotoriousManifoldInstance<I, E> => {\n\n const find = (annotationId: string): { annotation?: I, source?: string, annotator?: Annotator<I, E> } =>\n Array.from(annotators.entries()).reduce((found, [source, annotator]) => {\n if (found)\n return found;\n\n const annotation = annotator.state.store.getAnnotation(annotationId);\n if (annotation) \n return { annotation, annotator, source };\n }, undefined as { annotation: I, annotator: Annotator<I, E> } | undefined ) || \n\n { annotation: undefined, annotator: undefined, source: undefined };\n\n /*********/\n /** API **/\n /*********/\n\n const addBody = (body: AnnotationBody, origin = Origin.LOCAL) => {\n const { annotator } = find(body.annotation);\n if (annotator)\n annotator.state.store.addBody(body, origin);\n }\n\n const clear = (origin = Origin.LOCAL) =>\n Array.from(annotators.values()).forEach(a => a.state.store.clear(origin));\n\n const deleteAnnotation = (id: string, origin = Origin.LOCAL) => {\n const { annotation, annotator } = find(id);\n\n if (annotator) {\n annotator.state.store.deleteAnnotation(id, origin);\n return annotation;\n }\n }\n\n const deleteBody = (body: AnnotationBody, origin = Origin.LOCAL) => {\n const { annotator } = find(body.annotation);\n if (annotator)\n annotator.state.store.deleteBody(body, origin);\n }\n\n const destroy = () =>\n Array.from(annotators.values()).forEach(a => a.destroy());\n\n const findAnnotator = (annotationId: string) => {\n const { annotator } = find(annotationId);\n return annotator;\n }\n\n const findSource = (annotationId: string) => {\n const { source } = find(annotationId);\n return source;\n }\n\n const getAnnotation = (annotationId: string) => \n find(annotationId).annotation;\n\n const getAnnotations = () => \n Array.from(annotators.values()).reduce((all, annotator) =>\n [...all, ...annotator.state.store.all()], [] as I[]);\n\n const getAnnotator = (id: string) => annotators.get(id);\n\n const updateAnnotation = (arg1: string | I, arg2?: I | Origin, arg3?: Origin) => {\n const oldId: string = typeof arg1 === 'string' ? arg1 : arg1.id;\n\n const { annotator } = find(oldId);\n if (annotator)\n annotator.state.store.updateAnnotation(arg1, arg2, arg3);\n }\n\n const setSelected = (id: string) => {\n const { annotator } = find(id);\n if (annotator)\n annotator.setSelected(id);\n }\n\n return {\n annotators: [...annotators.values()],\n sources: [...annotators.keys()],\n addBody,\n clear,\n deleteAnnotation,\n deleteBody,\n destroy,\n findAnnotator,\n findSource,\n getAnnotation,\n getAnnotations,\n getAnnotator,\n setSelected,\n updateAnnotation\n }\n\n}"],"names":["createManifoldInstance","annotators","find","annotationId","found","source","annotator","annotation","addBody","body","origin","Origin","clear","a","deleteAnnotation","id","deleteBody","destroy","findAnnotator","findSource","getAnnotation","getAnnotations","all","getAnnotator","updateAnnotation","arg1","arg2","arg3","oldId","setSelected"],"mappings":";AAuCa,MAAAA,IAAyB,CACpCC,MACsC;AAEtC,QAAMC,IAAO,CAACC,MACZ,MAAM,KAAKF,EAAW,SAAS,EAAE,OAAO,CAACG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E;AAAA,EACT,GAEMe,IAAgB,CAACjB,MACrBD,EAAKC,CAAY,EAAE,YAEfkB,IAAiB,MACrB,MAAM,KAAKpB,EAAW,OAAQ,CAAA,EAAE,OAAO,CAACqB,GAAKhB,MAC3C,CAAC,GAAGgB,GAAK,GAAGhB,EAAU,MAAM,MAAM,KAAK,GAAG,EAAS,GAEjDiB,IAAe,CAACR,MAAed,EAAW,IAAIc,CAAE,GAEhDS,IAAmB,CAACC,GAAkBC,GAAmBC,MAAkB;AAC/E,UAAMC,IAAgB,OAAOH,KAAS,WAAWA,IAAOA,EAAK,IAEvD,EAAE,WAAAnB,EAAA,IAAcJ,EAAK0B,CAAK;AAC5B,IAAAtB,KACFA,EAAU,MAAM,MAAM,iBAAiBmB,GAAMC,GAAMC,CAAI;AAAA,EAC3D,GAEME,IAAc,CAACd,MAAe;AAClC,UAAM,EAAE,WAAAT,EAAA,IAAcJ,EAAKa,CAAE;AACzB,IAAAT,KACFA,EAAU,YAAYS,CAAE;AAAA,EAC5B;AAEO,SAAA;AAAA,IACL,YAAY,CAAC,GAAGd,EAAW,QAAQ;AAAA,IACnC,SAAS,CAAC,GAAGA,EAAW,MAAM;AAAA,IAC9B,SAAAO;AAAA,IACA,OAAAI;AAAA,IACA,kBAAAE;AAAA,IACA,YAAAE;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAE;AAAA,IACA,aAAAM;AAAA,IACA,kBAAAL;AAAA,EACF;AAEF;"}
1
+ {"version":3,"file":"annotorious-react-manifold.es6.js","sources":["../src/AnnotoriousManifoldInstance.ts"],"sourcesContent":["import { Origin } from '@annotorious/react';\nimport type {\n Annotation, \n AnnotationBody, \n Annotator\n} from '@annotorious/react';\n\nexport interface AnnotoriousManifoldInstance<I extends Annotation = Annotation, E extends { id: string } = Annotation> {\n\n annotators: Annotator<I, E>[];\n\n sources: string[];\n\n addBody(body: AnnotationBody, origin?: Origin): void;\n\n clear(origin: Origin): void;\n\n deleteAnnotation(id: string, origin?: Origin): I | undefined;\n\n deleteBody(body: AnnotationBody, origin?: Origin): void;\n\n destroy(): void;\n\n findAnnotator(annotationId: string): Annotator<I, E> | undefined;\n\n findSource(annotationId: string): string | undefined;\n\n getAnnotation(id: string): I | undefined;\n \n getAnnotations(): I[];\n\n getAnnotator(id: string): Annotator<I, E> | undefined;\n \n setSelected(annotationId: string, editable?: boolean): void;\n\n updateAnnotation(arg1: string | I, arg2?: I | Origin, arg3?: Origin): void;\n\n}\n\nexport const createManifoldInstance = <I extends Annotation = Annotation, E extends { id: string } = Annotation>(\n annotators: Map<string, Annotator<I, E>>\n): AnnotoriousManifoldInstance<I, E> => {\n\n const find = (annotationId: string): { annotation?: I, source?: string, annotator?: Annotator<I, E> } =>\n Array.from(annotators.entries()).reduce((found, [source, annotator]) => {\n if (found)\n return found;\n\n const annotation = annotator.state.store.getAnnotation(annotationId);\n if (annotation) \n return { annotation, annotator, source };\n }, undefined as { annotation: I, annotator: Annotator<I, E> } | undefined ) || \n\n { annotation: undefined, annotator: undefined, source: undefined };\n\n /*********/\n /** API **/\n /*********/\n\n const addBody = (body: AnnotationBody, origin = Origin.LOCAL) => {\n const { annotator } = find(body.annotation);\n if (annotator)\n annotator.state.store.addBody(body, origin);\n }\n\n const clear = (origin = Origin.LOCAL) =>\n Array.from(annotators.values()).forEach(a => a.state.store.clear(origin));\n\n const deleteAnnotation = (id: string, origin = Origin.LOCAL) => {\n const { annotation, annotator } = find(id);\n\n if (annotator) {\n annotator.state.store.deleteAnnotation(id, origin);\n return annotation;\n }\n }\n\n const deleteBody = (body: AnnotationBody, origin = Origin.LOCAL) => {\n const { annotator } = find(body.annotation);\n if (annotator)\n annotator.state.store.deleteBody(body, origin);\n }\n\n const destroy = () =>\n Array.from(annotators.values()).forEach(a => a.destroy());\n\n const findAnnotator = (annotationId: string) => {\n const { annotator } = find(annotationId);\n return annotator;\n }\n\n const findSource = (annotationId: string) => {\n const { source } = find(annotationId);\n return source;\n }\n\n const getAnnotation = (annotationId: string) => \n find(annotationId).annotation;\n\n const getAnnotations = () => \n Array.from(annotators.values()).reduce((all, annotator) =>\n [...all, ...annotator.state.store.all()], [] as I[]);\n\n const getAnnotator = (id: string) => annotators.get(id);\n\n const updateAnnotation = (arg1: string | I, arg2?: I | Origin, arg3?: Origin) => {\n const oldId: string = typeof arg1 === 'string' ? arg1 : arg1.id;\n\n const { annotator } = find(oldId);\n if (annotator)\n annotator.state.store.updateAnnotation(arg1, arg2, arg3);\n }\n\n const setSelected = (id: string, editable?: boolean) => {\n const { annotator } = find(id);\n if (annotator)\n annotator.setSelected(id, editable);\n }\n\n return {\n annotators: [...annotators.values()],\n sources: [...annotators.keys()],\n addBody,\n clear,\n deleteAnnotation,\n deleteBody,\n destroy,\n findAnnotator,\n findSource,\n getAnnotation,\n getAnnotations,\n getAnnotator,\n setSelected,\n updateAnnotation\n }\n\n}"],"names":["createManifoldInstance","annotators","find","annotationId","found","source","annotator","annotation","addBody","body","origin","Origin","clear","a","deleteAnnotation","id","deleteBody","destroy","findAnnotator","findSource","getAnnotation","getAnnotations","all","getAnnotator","updateAnnotation","arg1","arg2","arg3","oldId","setSelected","editable"],"mappings":";AAuCa,MAAAA,IAAyB,CACpCC,MACsC;AAEtC,QAAMC,IAAO,CAACC,MACZ,MAAM,KAAKF,EAAW,SAAS,EAAE,OAAO,CAACG,GAAO,CAACC,GAAQC,CAAS,MAAM;AAClE,QAAAF;AACK,aAAAA;AAET,UAAMG,IAAaD,EAAU,MAAM,MAAM,cAAcH,CAAY;AAC/D,QAAAI;AACK,aAAA,EAAE,YAAAA,GAAY,WAAAD,GAAW,QAAAD,EAAO;AAAA,EAAA,GACxC,MAAuE,KAE1E,EAAE,YAAY,QAAW,WAAW,QAAW,QAAQ,OAAU,GAM7DG,IAAU,CAACC,GAAsBC,IAASC,EAAO,UAAU;AAC/D,UAAM,EAAE,WAAAL,EAAc,IAAAJ,EAA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AWA,IAAOA,EAAK,IAEvD,EAAE,WAAAnB,EAAA,IAAcJ,EAAK0B,CAAK;AAC5B,IAAAtB,KACFA,EAAU,MAAM,MAAM,iBAAiBmB,GAAMC,GAAMC,CAAI;AAAA,EAC3D,GAEME,IAAc,CAACd,GAAYe,MAAuB;AACtD,UAAM,EAAE,WAAAxB,EAAA,IAAcJ,EAAKa,CAAE;AACzB,IAAAT,KACQA,EAAA,YAAYS,GAAIe,CAAQ;AAAA,EACtC;AAEO,SAAA;AAAA,IACL,YAAY,CAAC,GAAG7B,EAAW,QAAQ;AAAA,IACnC,SAAS,CAAC,GAAGA,EAAW,MAAM;AAAA,IAC9B,SAAAO;AAAA,IACA,OAAAI;AAAA,IACA,kBAAAE;AAAA,IACA,YAAAE;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,cAAAE;AAAA,IACA,aAAAM;AAAA,IACA,kBAAAL;AAAA,EACF;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenSeadragonViewer.d.ts","sourceRoot":"","sources":["../../src/openseadragon/OpenSeadragonViewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,wBAAwB,IAAI,gCAAgC,EAE7D,MAAM,oBAAoB,CAAC;AAuB5B,KAAK,wBAAwB,GAAG,gCAAgC,GAAG;IAEjE,EAAE,EAAE,MAAM,CAAA;CAEX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,UAAW,wBAAwB,4CASlE,CAAA"}
1
+ {"version":3,"file":"OpenSeadragonViewer.d.ts","sourceRoot":"","sources":["../../src/openseadragon/OpenSeadragonViewer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,wBAAwB,IAAI,gCAAgC,EAE7D,MAAM,oBAAoB,CAAC;AAuB5B,KAAK,wBAAwB,GAAG,gCAAgC,GAAG;IAEjE,EAAE,EAAE,MAAM,CAAA;CAEX,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CASlE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenSeadragonViewerManifold.d.ts","sourceRoot":"","sources":["../../src/openseadragon/OpenSeadragonViewerManifold.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuC,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,UAAU,qBAAqB;IAE7B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;CAEtE;AAED,eAAO,MAAM,gBAAgB,gDAM3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,UAAW;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAU/D,CAAA;AAED,eAAO,MAAM,UAAU,2BAGtB,CAAA"}
1
+ {"version":3,"file":"OpenSeadragonViewerManifold.d.ts","sourceRoot":"","sources":["../../src/openseadragon/OpenSeadragonViewerManifold.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuC,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,UAAU,qBAAqB;IAE7B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE7B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;CAEtE;AAED,eAAO,MAAM,gBAAgB,gDAM3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAAI,OAAO;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAU/D,CAAA;AAED,eAAO,MAAM,UAAU,2BAGtB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"synchronizeInstances.d.ts","sourceRoot":"","sources":["../src/synchronizeInstances.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,UAAU,eAAe,CAAC,SAAS,OAAO,0BAC5E,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAO7B,CAAA"}
1
+ {"version":3,"file":"synchronizeInstances.d.ts","sourceRoot":"","sources":["../src/synchronizeInstances.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE3D,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,CAAC,SAAS,OAAO,GAAG,UAAU,EACpG,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAO7B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/react-manifold",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "A utility to manage multiple parallel Annotorious instances more efficiently",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -31,16 +31,16 @@
31
31
  "test": "echo 'Skipping tests in @annotorious/annotorious-react-manifold package'"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/react": "^19.0.8",
35
- "@types/react-dom": "^19.0.3",
34
+ "@types/react": "^19.0.10",
35
+ "@types/react-dom": "^19.0.4",
36
36
  "@vitejs/plugin-react": "^4.3.4",
37
- "typescript": "5.7.3",
37
+ "typescript": "5.8.2",
38
38
  "vite": "^5.4.14",
39
39
  "vite-plugin-dts": "^4.5.0",
40
40
  "vite-tsconfig-paths": "^5.1.4"
41
41
  },
42
42
  "peerDependencies": {
43
- "@annotorious/react": "3.1.4",
43
+ "@annotorious/react": "3.1.5",
44
44
  "openseadragon": "^5.0.1",
45
45
  "react": "16.8.0 || >=17.x || >=18.x || >=19.x",
46
46
  "react-dom": "16.8.0 || >=17.x || >=18.x|| >=19.x"