@annotorious/react-manifold 0.0.14 → 0.0.16

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,OAAc,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKhE,UAAU,gBAAgB;IAExB,QAAQ,EAAE,SAAS,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;CAEhB;AAqBD;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,gBAAgB,4CAUlD,CAAA"}
1
+ {"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAyB,MAAM,OAAO,CAAC;AAKhE,UAAU,gBAAgB;IAExB,QAAQ,EAAE,SAAS,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;CAEhB;AAsBD;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,gBAAgB,4CAUlD,CAAA"}
@@ -7,12 +7,12 @@ export interface AnnotoriousManifoldInstance<I extends Annotation = Annotation,
7
7
  sources: string[];
8
8
  addBody(body: AnnotationBody, origin?: Origin): void;
9
9
  clear(origin: Origin): void;
10
- deleteAnnotation(id: string, origin?: Origin): E | undefined;
10
+ deleteAnnotation(id: string, origin?: Origin): I | undefined;
11
11
  deleteBody(body: AnnotationBody, origin?: Origin): void;
12
12
  destroy(): void;
13
- getAnnotation(id: string): E | undefined;
14
- getAnnotations(): E[];
15
- updateAnnotation(annotation: E): void;
13
+ getAnnotation(id: string): I | undefined;
14
+ getAnnotations(): I[];
15
+ updateAnnotation(arg1: string | I, arg2?: I | Origin, arg3?: Origin): void;
16
16
  }
17
17
  export declare const createManifoldInstance: <I extends Annotation = Annotation, E extends {
18
18
  id: string;
@@ -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,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExD,OAAO,IAAI,IAAI,CAAC;IAEhB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAEzC,cAAc,IAAI,CAAC,EAAE,CAAC;IAEtB,gBAAgB,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC;CAEvC;AAED,eAAO,MAAM,sBAAsB;QAAuD,MAAM;8FAyE/F,CAAA"}
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,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExD,OAAO,IAAI,IAAI,CAAC;IAEhB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAEzC,cAAc,IAAI,CAAC,EAAE,CAAC;IAEtB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAE5E;AAED,eAAO,MAAM,sBAAsB;QAAuD,MAAM;8FA2E/F,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react-manifold.es2.js","sources":["../src/Annotorious.tsx"],"sourcesContent":["import React, { 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 source: 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.source, anno);\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 source={props.source}>\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;AACV,QAAAL;AACK,aAAAE,EAAiBH,EAAM,QAAQC,CAAI;AAAA,EAAA,GAC3C,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,QAAQC,EAAM,QACpC,UAAMA,EAAA,SACT,CAAA,EACF,CAAA;"}
1
+ {"version":3,"file":"annotorious-react-manifold.es2.js","sources":["../src/Annotorious.tsx"],"sourcesContent":["import React, { 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 source: 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.source, 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 source={props.source}>\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,QAAQC,CAAI;AAAA,EAC5C,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,QAAQC,EAAM,QACpC,UAAMA,EAAA,SACT,CAAA,EACF,CAAA;"}
@@ -1,39 +1,39 @@
1
1
  import { Origin as s } from "@annotorious/react";
2
- const L = (e) => {
3
- const a = (t) => Array.from(e.values()).reduce((n, o) => {
4
- if (n)
5
- return n;
6
- const r = o.getAnnotationById(t);
7
- if (r)
8
- return { annotation: r, annotator: o };
9
- }, void 0) || { annotation: void 0, annotator: void 0 }, i = (t, n = s.LOCAL) => {
10
- const { annotator: o } = a(t.annotation);
11
- o && o.state.store.addBody(t, n);
12
- }, c = (t = s.LOCAL) => Array.from(e.values()).forEach((n) => n.state.store.clear(t)), d = (t, n = s.LOCAL) => {
13
- const { annotation: o, annotator: r } = a(t);
14
- if (r)
15
- return r.state.store.deleteAnnotation(t, n), o;
16
- }, A = (t, n = s.LOCAL) => {
17
- const { annotator: o } = a(t.annotation);
18
- o && o.state.store.deleteBody(t, n);
19
- }, f = () => Array.from(e.values()).forEach((t) => t.destroy()), u = (t) => a(t).annotation, l = () => Array.from(e.values()).reduce((t, n) => [...t, ...n.getAnnotations()], []), y = (t) => {
20
- const { annotator: n } = a(t.id);
21
- n && n.updateAnnotation(t);
2
+ const m = (a) => {
3
+ const r = (t) => Array.from(a.values()).reduce((o, n) => {
4
+ if (o)
5
+ return o;
6
+ const e = n.state.store.getAnnotation(t);
7
+ if (e)
8
+ return { annotation: e, annotator: n };
9
+ }, void 0) || { annotation: void 0, annotator: void 0 }, c = (t, o = s.LOCAL) => {
10
+ const { annotator: n } = r(t.annotation);
11
+ n && n.state.store.addBody(t, o);
12
+ }, d = (t = s.LOCAL) => Array.from(a.values()).forEach((o) => o.state.store.clear(t)), f = (t, o = s.LOCAL) => {
13
+ const { annotation: n, annotator: e } = r(t);
14
+ if (e)
15
+ return e.state.store.deleteAnnotation(t, o), n;
16
+ }, l = (t, o = s.LOCAL) => {
17
+ const { annotator: n } = r(t.annotation);
18
+ n && n.state.store.deleteBody(t, o);
19
+ }, A = () => Array.from(a.values()).forEach((t) => t.destroy()), u = (t) => r(t).annotation, y = () => Array.from(a.values()).reduce((t, o) => [...t, ...o.state.store.all()], []), v = (t, o, n) => {
20
+ const e = typeof t == "string" ? t : t.id, { annotator: i } = r(e);
21
+ i && i.state.store.updateAnnotation(t, o, n);
22
22
  };
23
23
  return {
24
- annotators: [...e.values()],
25
- sources: [...e.keys()],
26
- addBody: i,
27
- clear: c,
28
- deleteAnnotation: d,
29
- deleteBody: A,
30
- destroy: f,
24
+ annotators: [...a.values()],
25
+ sources: [...a.keys()],
26
+ addBody: c,
27
+ clear: d,
28
+ deleteAnnotation: f,
29
+ deleteBody: l,
30
+ destroy: A,
31
31
  getAnnotation: u,
32
- getAnnotations: l,
33
- updateAnnotation: y
32
+ getAnnotations: y,
33
+ updateAnnotation: v
34
34
  };
35
35
  };
36
36
  export {
37
- L as createManifoldInstance
37
+ m as createManifoldInstance
38
38
  };
39
39
  //# sourceMappingURL=annotorious-react-manifold.es4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react-manifold.es4.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): E | undefined;\n\n deleteBody(body: AnnotationBody, origin?: Origin): void;\n\n destroy(): void;\n\n getAnnotation(id: string): E | undefined;\n\n getAnnotations(): E[];\n\n updateAnnotation(annotation: E): 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?: E, annotator?: Annotator<I, E> } =>\n Array.from(annotators.values()).reduce((found, annotator) => {\n if (found)\n return found;\n\n const annotation = annotator.getAnnotationById(annotationId);\n if (annotation) \n return { annotation, annotator };\n }, undefined as { annotation: E, annotator: Annotator<I, E> } | undefined ) || \n\n { annotation: undefined, annotator: 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 getAnnotation = (id: string) => \n find(id).annotation;\n\n const getAnnotations = () => \n Array.from(annotators.values()).reduce((all, annotator) =>\n [...all, ...annotator.getAnnotations()], [] as E[]);\n\n const updateAnnotation = (annotation: E) => {\n const { annotator } = find(annotation.id);\n if (annotator)\n annotator.updateAnnotation(annotation)\n }\n\n return {\n annotators: [...annotators.values()],\n sources: [...annotators.keys()],\n addBody,\n clear,\n deleteAnnotation,\n deleteBody,\n destroy,\n getAnnotation,\n getAnnotations,\n updateAnnotation\n }\n\n}"],"names":["createManifoldInstance","annotators","find","annotationId","found","annotator","annotation","addBody","body","origin","Origin","clear","a","deleteAnnotation","id","deleteBody","destroy","getAnnotation","getAnnotations","all","updateAnnotation"],"mappings":";AA+Ba,MAAAA,IAAyB,CACpCC,MACsC;AAEtC,QAAMC,IAAO,CAACC,MACZ,MAAM,KAAKF,EAAW,OAAO,CAAC,EAAE,OAAO,CAACG,GAAOC,MAAc;AACvD,QAAAD;AACK,aAAAA;AAEH,UAAAE,IAAaD,EAAU,kBAAkBF,CAAY;AACvD,QAAAG;AACK,aAAA,EAAE,YAAAA,GAAY,WAAAD;EAAU,GAChC,MAAuE,KAE1E,EAAE,YAAY,QAAW,WAAW,UAMhCE,IAAU,CAACC,GAAsBC,I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;AAAA,IACA,kBAAAE;AAAA,IACA,YAAAE;AAAA,IACA,SAAAC;AAAA,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAE;AAAA,EAAA;AAGJ;"}
1
+ {"version":3,"file":"annotorious-react-manifold.es4.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 getAnnotation(id: string): I | undefined;\n\n getAnnotations(): I[];\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, annotator?: Annotator<I, E> } =>\n Array.from(annotators.values()).reduce((found, annotator) => {\n if (found)\n return found;\n\n const annotation = annotator.state.store.getAnnotation(annotationId);\n if (annotation) \n return { annotation, annotator };\n }, undefined as { annotation: I, annotator: Annotator<I, E> } | undefined ) || \n\n { annotation: undefined, annotator: 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 getAnnotation = (id: string) => \n find(id).annotation;\n\n const getAnnotations = () => \n Array.from(annotators.values()).reduce((all, annotator) =>\n [...all, ...annotator.state.store.all()], [] as I[]);\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 return {\n annotators: [...annotators.values()],\n sources: [...annotators.keys()],\n addBody,\n clear,\n deleteAnnotation,\n deleteBody,\n destroy,\n getAnnotation,\n getAnnotations,\n updateAnnotation\n }\n\n}"],"names":["createManifoldInstance","annotators","find","annotationId","found","annotator","annotation","addBody","body","origin","Origin","clear","a","deleteAnnotation","id","deleteBody","destroy","getAnnotation","getAnnotations","all","updateAnnotation","arg1","arg2","arg3","oldId"],"mappings":";AA+Ba,MAAAA,IAAyB,CACpCC,MACsC;AAEtC,QAAMC,IAAO,CAACC,MACZ,MAAM,KAAKF,EAAW,OAAO,CAAC,EAAE,OAAO,CAACG,GAAOC,MAAc;AACvD,QAAAD;AACK,aAAAA;AAET,UAAME,IAAaD,EAAU,MAAM,MAAM,cAAcF,CAAY;AAC/D,QAAAG;AACK,aAAA,EAAE,YAAAA,GAAY,WAAAD;EAAU,GAChC,MAAuE,KAE1E,EAAE,YAAY,QAAW,WAAW,UAMhCE,IAAU,CAACC,GAAsBC,IAASC,EAAO,UAAU;AAC/D,UAAM,EAAE,WAAAL,EAAc,IAAAH,EAAKM,EAAK,UAAU;AACtC,IAAAH,KACFA,EAAU,MAAM,MAAM,QAAQG,GAAMC,CAAM;AAAA,EAAA,GAGxCE,IAAQ,CAACF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A,IACA,eAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,kBAAAE;AAAA,EAAA;AAGJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/react-manifold",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "A utility to manage multiple parallel Annotorious instances more efficiently",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",