@annotorious/react 3.0.0-rc.20 → 3.0.0-rc.3

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.
Files changed (91) hide show
  1. package/dist/Annotorious.d.ts +28 -3
  2. package/dist/Annotorious.d.ts.map +1 -1
  3. package/dist/AnnotoriousPlugin.d.ts +6 -7
  4. package/dist/AnnotoriousPlugin.d.ts.map +1 -1
  5. package/dist/ImageAnnotator.d.ts.map +1 -1
  6. package/dist/annotorious-react.css +1 -1
  7. package/dist/annotorious-react.es.js +50 -33
  8. package/dist/annotorious-react.es.js.map +1 -1
  9. package/dist/annotorious-react.es10.js +3 -29
  10. package/dist/annotorious-react.es10.js.map +1 -1
  11. package/dist/annotorious-react.es11.js +27 -36
  12. package/dist/annotorious-react.es11.js.map +1 -1
  13. package/dist/annotorious-react.es12.js +20 -16
  14. package/dist/annotorious-react.es12.js.map +1 -1
  15. package/dist/annotorious-react.es13.js +54 -6
  16. package/dist/annotorious-react.es13.js.map +1 -1
  17. package/dist/annotorious-react.es14.js +17 -8
  18. package/dist/annotorious-react.es14.js.map +1 -1
  19. package/dist/annotorious-react.es15.js +21 -152
  20. package/dist/annotorious-react.es15.js.map +1 -1
  21. package/dist/annotorious-react.es16.js +2 -27436
  22. package/dist/annotorious-react.es16.js.map +1 -1
  23. package/dist/annotorious-react.es17.js +2 -32
  24. package/dist/annotorious-react.es17.js.map +1 -1
  25. package/dist/annotorious-react.es18.js +3859 -2
  26. package/dist/annotorious-react.es18.js.map +1 -1
  27. package/dist/annotorious-react.es19.js +29 -30
  28. package/dist/annotorious-react.es19.js.map +1 -1
  29. package/dist/annotorious-react.es2.js +32 -32
  30. package/dist/annotorious-react.es2.js.map +1 -1
  31. package/dist/annotorious-react.es20.js +35 -598
  32. package/dist/annotorious-react.es20.js.map +1 -1
  33. package/dist/annotorious-react.es21.js +16 -2
  34. package/dist/annotorious-react.es21.js.map +1 -1
  35. package/dist/annotorious-react.es22.js +4 -2
  36. package/dist/annotorious-react.es22.js.map +1 -1
  37. package/dist/annotorious-react.es23.js +11 -0
  38. package/dist/annotorious-react.es23.js.map +1 -0
  39. package/dist/annotorious-react.es24.js +156 -0
  40. package/dist/annotorious-react.es24.js.map +1 -0
  41. package/dist/annotorious-react.es25.js +9 -0
  42. package/dist/annotorious-react.es25.js.map +1 -0
  43. package/dist/annotorious-react.es26.js +20665 -0
  44. package/dist/annotorious-react.es26.js.map +1 -0
  45. package/dist/annotorious-react.es27.js +35 -0
  46. package/dist/annotorious-react.es27.js.map +1 -0
  47. package/dist/annotorious-react.es28.js +5 -0
  48. package/dist/annotorious-react.es28.js.map +1 -0
  49. package/dist/annotorious-react.es29.js +33 -0
  50. package/dist/annotorious-react.es29.js.map +1 -0
  51. package/dist/annotorious-react.es3.js +7 -7
  52. package/dist/annotorious-react.es3.js.map +1 -1
  53. package/dist/annotorious-react.es30.js +602 -0
  54. package/dist/annotorious-react.es30.js.map +1 -0
  55. package/dist/annotorious-react.es31.js +5 -0
  56. package/dist/annotorious-react.es31.js.map +1 -0
  57. package/dist/annotorious-react.es32.js +5 -0
  58. package/dist/annotorious-react.es32.js.map +1 -0
  59. package/dist/annotorious-react.es33.js +20 -0
  60. package/dist/annotorious-react.es33.js.map +1 -0
  61. package/dist/annotorious-react.es34.js +30 -0
  62. package/dist/annotorious-react.es34.js.map +1 -0
  63. package/dist/annotorious-react.es35.js +19 -0
  64. package/dist/annotorious-react.es35.js.map +1 -0
  65. package/dist/annotorious-react.es36.js +24 -0
  66. package/dist/annotorious-react.es36.js.map +1 -0
  67. package/dist/annotorious-react.es37.js +19 -0
  68. package/dist/annotorious-react.es37.js.map +1 -0
  69. package/dist/annotorious-react.es38.js +7 -0
  70. package/dist/annotorious-react.es38.js.map +1 -0
  71. package/dist/annotorious-react.es39.js +11 -0
  72. package/dist/annotorious-react.es39.js.map +1 -0
  73. package/dist/annotorious-react.es4.js +8 -8
  74. package/dist/annotorious-react.es4.js.map +1 -1
  75. package/dist/annotorious-react.es40.js +10 -0
  76. package/dist/annotorious-react.es40.js.map +1 -0
  77. package/dist/annotorious-react.es5.js +10 -10
  78. package/dist/annotorious-react.es5.js.map +1 -1
  79. package/dist/annotorious-react.es6.js +4 -1
  80. package/dist/annotorious-react.es6.js.map +1 -1
  81. package/dist/annotorious-react.es7.js +4 -1
  82. package/dist/annotorious-react.es7.js.map +1 -1
  83. package/dist/annotorious-react.es8.js +46 -85
  84. package/dist/annotorious-react.es8.js.map +1 -1
  85. package/dist/annotorious-react.es9.js +10 -4237
  86. package/dist/annotorious-react.es9.js.map +1 -1
  87. package/dist/index.d.ts +10 -12
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
  90. package/dist/openseadragon/setPosition.d.ts.map +1 -1
  91. package/package.json +8 -16
@@ -1,33 +1,32 @@
1
- import { __exports as t } from "./annotorious-react.es21.js";
2
- import R from "react";
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var p;
13
- function v() {
14
- if (p)
15
- return t;
16
- p = 1;
17
- var s = R, m = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, d = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function i(o, r, u) {
19
- var e, n = {}, _ = null, f = null;
20
- u !== void 0 && (_ = "" + u), r.key !== void 0 && (_ = "" + r.key), r.ref !== void 0 && (f = r.ref);
21
- for (e in r)
22
- c.call(r, e) && !y.hasOwnProperty(e) && (n[e] = r[e]);
23
- if (o && o.defaultProps)
24
- for (e in r = o.defaultProps, r)
25
- n[e] === void 0 && (n[e] = r[e]);
26
- return { $$typeof: m, type: o, key: _, ref: f, props: n, _owner: d.current };
27
- }
28
- return t.Fragment = l, t.jsx = i, t.jsxs = i, t;
29
- }
1
+ import { jsx as d } from "./annotorious-react.es22.js";
2
+ import { createContext as u, useState as w, useContext as l, useEffect as n } from "react";
3
+ import { createOSDAnnotator as m } from "./annotorious-react.es26.js";
4
+ import { AnnotoriousContext as g } from "./annotorious-react.es2.js";
5
+ const s = u({ viewer: null, setViewer: null }), y = (e) => {
6
+ const { children: v, tool: i, ...c } = e, [o, f] = w(), { anno: t, setAnno: a } = l(g);
7
+ return n(() => {
8
+ if (o) {
9
+ const r = m(o, c);
10
+ return e.tool && r.setDrawingTool(e.tool), a(r), () => {
11
+ r.destroy(), a(void 0);
12
+ };
13
+ }
14
+ }, [o]), n(() => {
15
+ t && t.setDrawingTool(i);
16
+ }, [i]), n(() => {
17
+ t && t.setDrawingEnabled(e.drawingEnabled);
18
+ }, [e.drawingEnabled]), n(() => {
19
+ t && t.setFilter(e.filter);
20
+ }, [e.filter]), n(() => {
21
+ t && t.setStyle(e.style);
22
+ }, [e.style]), /* @__PURE__ */ d(s.Provider, { value: { viewer: o, setViewer: f }, children: e.children });
23
+ }, C = () => {
24
+ const { viewer: e } = l(s);
25
+ return e;
26
+ };
30
27
  export {
31
- v as __require
28
+ y as OpenSeadragonAnnotator,
29
+ s as OpenSeadragonAnnotatorContext,
30
+ C as useViewer
32
31
  };
33
32
  //# sourceMappingURL=annotorious-react.es19.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es19.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.min.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n"],"names":["f","require$$0","k","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min"],"mappings":";;;;;;;;;;;;;;;;AASa,MAAIA,IAAEC,GAAiBC,IAAE,OAAO,IAAI,eAAe,GAAE,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAeC,IAAEJ,EAAE,mDAAmD,mBAAkBK,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,QAAIC,GAAEC,IAAE,IAAGC,IAAE,MAAKC,IAAE;AAAK,IAASJ,MAAT,WAAaG,IAAE,KAAGH,IAAYD,EAAE,QAAX,WAAiBI,IAAE,KAAGJ,EAAE,MAAcA,EAAE,QAAX,WAAiBK,IAAEL,EAAE;AAAK,SAAIE,KAAKF;AAAE,MAAAL,EAAE,KAAKK,GAAEE,CAAC,KAAG,CAACL,EAAE,eAAeK,CAAC,MAAIC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,QAAGH,KAAGA,EAAE;AAAa,WAAIG,KAAKF,IAAED,EAAE,cAAaC;AAAE,QAASG,EAAED,CAAC,MAAZ,WAAgBC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,WAAM,EAAC,UAASR,GAAE,MAAKK,GAAE,KAAIK,GAAE,KAAIC,GAAE,OAAMF,GAAE,QAAOP,EAAE,QAAO;AAAA,EAAC;AAAC,SAAAU,aAAiB,GAAEA,EAAW,MAACR,GAAEQ,EAAA,OAAaR;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"annotorious-react.es19.js","sources":["../src/openseadragon/OpenSeadragonAnnotator.tsx"],"sourcesContent":["import { createContext, ReactNode, useContext, useEffect, useState } from 'react';\nimport OpenSeadragon from 'openseadragon';\nimport { createOSDAnnotator } from '@annotorious/openseadragon';\nimport { AnnotoriousOpts, DrawingStyle, Filter, ImageAnnotation } from '@annotorious/annotorious';\nimport { AnnotoriousContext } from '../Annotorious';\n\nexport const OpenSeadragonAnnotatorContext = createContext<{ \n viewer: OpenSeadragon.Viewer,\n setViewer(viewer: OpenSeadragon.Viewer): void\n}>({ viewer: null, setViewer: null });\n\nexport type OpenSeadragonAnnotatorProps<E extends unknown> = AnnotoriousOpts<ImageAnnotation, E> & {\n\n children?: ReactNode;\n\n drawingEnabled?: boolean;\n\n filter?: Filter<ImageAnnotation>;\n\n style?: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle);\n\n tool?: string | null;\n\n}\n\nexport const OpenSeadragonAnnotator = <E extends unknown>(props: OpenSeadragonAnnotatorProps<E>) => {\n\n const { children, tool, ...opts } = props;\n\n const [viewer, setViewer] = useState<OpenSeadragon.Viewer>();\n\n const { anno, setAnno } = useContext(AnnotoriousContext);\n\n useEffect(() => {\n if (viewer) {\n const anno = createOSDAnnotator<E>(viewer, opts);\n\n if (props.tool)\n anno.setDrawingTool(props.tool);\n\n setAnno(anno);\n\n return () => {\n anno.destroy();\n setAnno(undefined);\n }\n }\n }, [viewer]);\n\n useEffect(() => {\n if (anno) anno.setDrawingTool(tool);\n }, [tool]);\n\n useEffect(() => {\n if (anno) anno.setDrawingEnabled(props.drawingEnabled);\n }, [props.drawingEnabled]);\n\n useEffect(() => {\n if (anno) anno.setFilter(props.filter);\n }, [props.filter]);\n\n useEffect(() => {\n if (anno) anno.setStyle(props.style);\n }, [props.style]);\n\n return (\n <OpenSeadragonAnnotatorContext.Provider value={{ viewer, setViewer }}>\n {props.children}\n </OpenSeadragonAnnotatorContext.Provider>\n )\n\n}\n\nexport const useViewer = () => {\n const { viewer } = useContext(OpenSeadragonAnnotatorContext);\n return viewer;\n}"],"names":["OpenSeadragonAnnotatorContext","createContext","OpenSeadragonAnnotator","props","children","tool","opts","viewer","setViewer","useState","anno","setAnno","useContext","AnnotoriousContext","useEffect","createOSDAnnotator","jsx","useViewer"],"mappings":";;;;AAMO,MAAMA,IAAgCC,EAG1C,EAAE,QAAQ,MAAM,WAAW,MAAM,GAgBvBC,IAAyB,CAAoBC,MAA0C;AAElG,QAAM,EAAE,UAAAC,GAAU,MAAAC,GAAM,GAAGC,MAASH,GAE9B,CAACI,GAAQC,CAAS,IAAIC,EAA+B,GAErD,EAAE,MAAAC,GAAM,SAAAC,EAAQ,IAAIC,EAAWC,CAAkB;AAEvD,SAAAC,EAAU,MAAM;AACd,QAAIP,GAAQ;AACJG,YAAAA,IAAOK,EAAsBR,GAAQD,CAAI;AAE/C,aAAIH,EAAM,QACRO,EAAK,eAAeP,EAAM,IAAI,GAEhCQ,EAAQD,CAAI,GAEL,MAAM;AACXA,QAAAA,EAAK,QAAQ,GACbC,EAAQ,MAAS;AAAA,MAAA;AAAA,IAErB;AAAA,EAAA,GACC,CAACJ,CAAM,CAAC,GAEXO,EAAU,MAAM;AACV,IAAAJ,KAAMA,EAAK,eAAeL,CAAI;AAAA,EAAA,GACjC,CAACA,CAAI,CAAC,GAETS,EAAU,MAAM;AACV,IAAAJ,KAAWA,EAAA,kBAAkBP,EAAM,cAAc;AAAA,EAAA,GACpD,CAACA,EAAM,cAAc,CAAC,GAEzBW,EAAU,MAAM;AACV,IAAAJ,KAAWA,EAAA,UAAUP,EAAM,MAAM;AAAA,EAAA,GACpC,CAACA,EAAM,MAAM,CAAC,GAEjBW,EAAU,MAAM;AACV,IAAAJ,KAAWA,EAAA,SAASP,EAAM,KAAK;AAAA,EAAA,GAClC,CAACA,EAAM,KAAK,CAAC,GAGd,gBAAAa,EAAChB,EAA8B,UAA9B,EAAuC,OAAO,EAAE,QAAAO,GAAQ,WAAAC,EACtD,GAAA,UAAAL,EAAM,SACT,CAAA;AAGJ,GAEac,IAAY,MAAM;AAC7B,QAAM,EAAE,QAAAV,EAAA,IAAWK,EAAWZ,CAA6B;AACpD,SAAAO;AACT;"}
@@ -1,42 +1,42 @@
1
- import { j as I } from "./annotorious-react.es13.js";
2
- import { createContext as O, forwardRef as R, useState as f, useImperativeHandle as U, useEffect as h, useContext as c } from "react";
3
- import { useDebounce as C } from "./annotorious-react.es14.js";
4
- const o = O({
1
+ import { jsx as U } from "./annotorious-react.es22.js";
2
+ import { createContext as j, forwardRef as E, useState as f, useImperativeHandle as H, useEffect as h, useContext as c } from "react";
3
+ import { useDebounce as C } from "./annotorious-react.es23.js";
4
+ const o = j({
5
5
  anno: void 0,
6
6
  setAnno: void 0,
7
7
  annotations: [],
8
8
  selection: { selected: [] }
9
- }), B = R((t, s) => {
10
- const [n, a] = f(null), [p, r] = f([]), [m, u] = f({ selected: [] });
11
- return U(s, () => n), h(() => {
9
+ }), B = E((t, s) => {
10
+ const [n, u] = f(null), [p, r] = f([]), [A, l] = f({ selected: [] });
11
+ return H(s, () => n), h(() => {
12
12
  if (n) {
13
- const { selection: A, store: e } = n.state;
13
+ const { selection: m, store: e } = n.state;
14
14
  e.all().length > 0 && r(e.all());
15
- const v = () => r(() => e.all());
15
+ const v = (a) => r(() => e.all());
16
16
  e.observe(v);
17
17
  let i;
18
- const b = A.subscribe(({ selected: l, pointerEvent: w }) => {
18
+ const b = m.subscribe(({ selected: a, pointerEvent: w }) => {
19
19
  i && e.unobserve(i);
20
- const j = (l || []).map(({ id: d, editable: S }) => ({ annotation: e.getAnnotation(d), editable: S }));
21
- u({ selected: j, pointerEvent: w }), i = (d) => {
20
+ const D = (a || []).map(({ id: d, editable: S }) => ({ annotation: e.getAnnotation(d), editable: S }));
21
+ l({ selected: D, pointerEvent: w }), i = (d) => {
22
22
  const { updated: S } = d.changes;
23
- u(({ selected: D }) => ({
24
- selected: D.map(({ annotation: V, editable: x }) => {
25
- const g = S.find((E) => E.oldValue.id === V.id);
26
- return g ? { annotation: g.newValue, editable: x } : { annotation: V, editable: x };
23
+ l(({ selected: I }) => ({
24
+ selected: I.map(({ annotation: V, editable: g }) => {
25
+ const x = S.find((O) => O.oldValue.id === V.id);
26
+ return x ? { annotation: x.newValue, editable: g } : { annotation: V, editable: g };
27
27
  })
28
28
  }));
29
- }, e.observe(i, { annotations: l.map(({ id: d }) => d) });
29
+ }, e.observe(i, { annotations: a.map(({ id: d }) => d) });
30
30
  });
31
31
  return () => {
32
32
  e.unobserve(v), b();
33
33
  };
34
34
  }
35
- }, [n]), /* @__PURE__ */ I.jsx(o.Provider, { value: {
35
+ }, [n]), /* @__PURE__ */ U(o.Provider, { value: {
36
36
  anno: n,
37
- setAnno: a,
37
+ setAnno: u,
38
38
  annotations: p,
39
- selection: m
39
+ selection: A
40
40
  }, children: t.children });
41
41
  }), F = () => {
42
42
  const { anno: t } = c(o);
@@ -44,13 +44,13 @@ const o = O({
44
44
  }, G = () => {
45
45
  const { anno: t } = c(o);
46
46
  return t == null ? void 0 : t.state.store;
47
- }, H = () => {
47
+ }, P = () => {
48
48
  const { annotations: t } = c(o);
49
49
  return t;
50
- }, P = (t) => {
50
+ }, R = (t) => {
51
51
  const { annotations: s } = c(o);
52
52
  return C(s, t);
53
- }, J = (t) => t ? P(t) : H(), K = () => {
53
+ }, J = (t) => t ? R(t) : P(), K = () => {
54
54
  const { selection: t } = c(o);
55
55
  return t;
56
56
  }, L = () => {
@@ -60,23 +60,23 @@ const o = O({
60
60
  const { anno: t } = c(o), [s, n] = f([]);
61
61
  return h(() => {
62
62
  if (t) {
63
- const { store: a, viewport: p } = t.state;
63
+ const { store: u, viewport: p } = t.state;
64
64
  if (!p)
65
65
  return;
66
66
  let r;
67
- const m = p.subscribe((u) => {
68
- r && a.unobserve(r);
69
- const A = u.map((e) => a.getAnnotation(e));
70
- n(A), r = (e) => {
67
+ const A = p.subscribe((l) => {
68
+ r && u.unobserve(r);
69
+ const m = l.map((e) => u.getAnnotation(e));
70
+ n(m), r = (e) => {
71
71
  const { updated: v } = e.changes;
72
72
  n((i) => i.map((b) => {
73
- const l = v.find((w) => w.oldValue.id === b.id);
74
- return l ? l.newValue : b;
73
+ const a = v.find((w) => w.oldValue.id === b.id);
74
+ return a ? a.newValue : b;
75
75
  }));
76
- }, a.observe(r, { annotations: u });
76
+ }, u.observe(r, { annotations: l });
77
77
  });
78
78
  return () => {
79
- m();
79
+ A();
80
80
  };
81
81
  }
82
82
  }, [t]), s;
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es2.js","sources":["../src/Annotorious.tsx"],"sourcesContent":["import { createContext, forwardRef, ReactNode} from 'react';\nimport { useContext, useEffect, useImperativeHandle, useState } from 'react';\nimport { Annotation, Annotator, Store, StoreChangeEvent } from '@annotorious/annotorious';\nimport { useDebounce } from './useDebounce';\n\ninterface Selection<T extends Annotation = Annotation> {\n\n selected: { annotation: T, editable?: boolean }[];\n\n pointerEvent?: PointerEvent;\n\n}\n\nexport interface AnnotoriousContextState {\n\n anno: Annotator;\n\n setAnno(anno: Annotator<Annotation, unknown>): void;\n\n annotations: Annotation[];\n\n selection: Selection;\n\n}\n\nexport const AnnotoriousContext = createContext({ \n\n anno: undefined, \n\n setAnno: undefined, \n\n annotations: [], \n\n selection: { selected: [] }\n\n});\n\nexport const Annotorious = forwardRef<Annotator, { children: ReactNode }>((props: { children: ReactNode }, ref) => {\n\n const [anno, setAnno] = useState<Annotator>(null);\n\n const [annotations, setAnnotations] = useState<Annotation[]>([]);\n\n const [selection, setSelection] = useState<Selection>({ selected: [] });\n\n useImperativeHandle(ref, () => anno);\n\n useEffect(() => {\n if (anno) {\n const { selection, store } = anno.state;\n\n // Components below <Annotorious /> may have\n // loaded annotations into the store already! \n if (store.all().length > 0)\n setAnnotations(store.all());\n\n // Keeps annotations in sync with a React state,\n // so clients can render components the usual React way.\n const onStoreChange = () => setAnnotations(() => store.all());\n\n store.observe(onStoreChange);\n\n // Keep selection in sync with a react state, and resolve them\n // from IDs to annotations automatically, for convenience\n let selectionStoreObserver: (event: StoreChangeEvent<Annotation>) => void;\n\n const unsubscribeSelection = selection.subscribe(({ selected, pointerEvent }) => {\n if (selectionStoreObserver) \n store.unobserve(selectionStoreObserver);\n\n const resolved = (selected || [])\n .map(({ id, editable }) => ({ annotation: store.getAnnotation(id), editable }));\n\n setSelection({ selected: resolved, pointerEvent });\n\n selectionStoreObserver = event => {\n const { updated } = event.changes;\n\n setSelection(({ selected }) => ({\n selected: selected.map(({ annotation, editable }) => {\n const next = updated.find(u => u.oldValue.id === annotation.id);\n return next ? { annotation: next.newValue, editable } : { annotation, editable };\n })\n }));\n }\n\n store.observe(selectionStoreObserver, { annotations: selected.map(({ id }) => id) });\n });\n\n return () => {\n store.unobserve(onStoreChange);\n unsubscribeSelection();\n }\n }\n }, [anno]);\n\n return (\n <AnnotoriousContext.Provider value={{ \n anno, \n setAnno,\n annotations, \n selection \n }}>\n {props.children}\n </AnnotoriousContext.Provider>\n )\n\n});\n\nexport const useAnnotator = <T extends unknown = Annotator<any, unknown>>() => {\n const { anno } = useContext(AnnotoriousContext);\n return anno as T;\n}\n\nexport const useAnnotationStore = <T extends unknown = Store<Annotation>>() => {\n const { anno } = useContext(AnnotoriousContext);\n return anno?.state.store as T | undefined;\n}\n\nconst _useAnnotations = <T extends Annotation>() => {\n const { annotations } = useContext(AnnotoriousContext);\n return annotations as T[];\n}\n\nconst _useAnnotationsDebounced = <T extends Annotation>(debounce: number) => {\n const { annotations } = useContext(AnnotoriousContext);\n return useDebounce(annotations, debounce) as T[];\n}\n\nexport const useAnnotations = <T extends Annotation>(debounce?: number) =>\n debounce ? _useAnnotationsDebounced<T>(debounce) : _useAnnotations<T>();\n\nexport const useSelection = <T extends Annotation>() => {\n const { selection } = useContext(AnnotoriousContext);\n return selection as Selection<T>;\n}\n\nexport const useAnnotatorUser = () => {\n const { anno } = useContext(AnnotoriousContext);\n return anno?.getUser();\n}\n\nconst _useViewportState = <T extends Annotation>() => {\n const { anno } = useContext(AnnotoriousContext);\n\n const [inViewport, setInViewport] = useState<T[]>([]);\n\n useEffect(() => {\n if (anno) {\n const { store, viewport } = anno.state;\n\n if (!viewport)\n return;\n\n // Keep viewport annotations in sync with a react state, and resolve them\n // from IDs to annotations automatically, for convenience\n let viewportStoreObserver: (event: StoreChangeEvent<T>) => void;\n\n const unsubscribeViewport = viewport.subscribe(ids => {\n if (viewportStoreObserver) \n store.unobserve(viewportStoreObserver);\n\n const resolved = ids.map(id => store.getAnnotation(id)) as T[];\n setInViewport(resolved);\n\n viewportStoreObserver = event => {\n const { updated } = event.changes;\n\n setInViewport(annotations => annotations.map(annotation => {\n const next = updated.find(u => u.oldValue.id === annotation.id);\n return next ? next.newValue : annotation;\n }));\n }\n\n store.observe(viewportStoreObserver, { annotations: ids });\n });\n\n return () => {\n unsubscribeViewport();\n }\n }\n }, [anno]);\n\n return inViewport;\n}\n\nconst _useViewportStateDebounced = <T extends Annotation>(debounce: number) => {\n const inViewport = _useViewportState();\n return useDebounce(inViewport, debounce) as T[];\n}\n\nexport const useViewportState = <T extends Annotation>(debounce?: number) =>\n debounce ? _useViewportStateDebounced<T>(debounce) : _useViewportState<T>();\n"],"names":["AnnotoriousContext","createContext","Annotorious","forwardRef","props","ref","anno","setAnno","useState","annotations","setAnnotations","selection","setSelection","useImperativeHandle","useEffect","store","onStoreChange","selectionStoreObserver","unsubscribeSelection","selected","pointerEvent","resolved","id","editable","event","updated","annotation","next","u","jsx","useAnnotator","useContext","useAnnotationStore","_useAnnotations","_useAnnotationsDebounced","debounce","useDebounce","useAnnotations","useSelection","useAnnotatorUser","_useViewportState","inViewport","setInViewport","viewport","viewportStoreObserver","unsubscribeViewport","ids","_useViewportStateDebounced","useViewportState"],"mappings":";;;AAyBO,MAAMA,IAAqBC,EAAc;AAAA,EAE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AOM,KAAA,gBAAAA,EAAM;AACf,GAEMkC,IAAoB,MAA4B;AACpD,QAAM,EAAE,MAAAlC,EAAA,IAASyB,EAAW/B,CAAkB,GAExC,CAACyC,GAAYC,CAAa,IAAIlC,EAAc,CAAE,CAAA;AAEpD,SAAAM,EAAU,MAAM;AACd,QAAIR,GAAM;AACR,YAAM,EAAE,OAAAS,GAAO,UAAA4B,MAAarC,EAAK;AAEjC,UAAI,CAACqC;AACH;AAIE,UAAAC;AAEE,YAAAC,IAAsBF,EAAS,UAAU,CAAOG,MAAA;AAChD,QAAAF,KACF7B,EAAM,UAAU6B,CAAqB;AAEvC,cAAMvB,IAAWyB,EAAI,IAAI,OAAM/B,EAAM,cAAcO,CAAE,CAAC;AACtD,QAAAoB,EAAcrB,CAAQ,GAEtBuB,IAAwB,CAASpB,MAAA;AACzB,gBAAA,EAAE,SAAAC,EAAQ,IAAID,EAAM;AAEZ,UAAAkB,EAAA,CAAAjC,MAAeA,EAAY,IAAI,CAAciB,MAAA;AACnD,kBAAAC,IAAOF,EAAQ,KAAK,CAAAG,MAAKA,EAAE,SAAS,OAAOF,EAAW,EAAE;AACvD,mBAAAC,IAAOA,EAAK,WAAWD;AAAA,UAC/B,CAAA,CAAC;AAAA,QAAA,GAGJX,EAAM,QAAQ6B,GAAuB,EAAE,aAAaE,EAAK,CAAA;AAAA,MAAA,CAC1D;AAED,aAAO,MAAM;AACS,QAAAD;MAAA;AAAA,IAExB;AAAA,EAAA,GACC,CAACvC,CAAI,CAAC,GAEFmC;AACT,GAEMM,IAA8B,CAAuBZ,MAAqB;AAC9E,QAAMM,IAAaD;AACZ,SAAAJ,EAAYK,GAAYN,CAAQ;AACzC,GAEaa,IAAoB,CAAuBb,MACtDA,IAAWY,EAA8BZ,CAAQ,IAAIK,EAAqB;"}
1
+ {"version":3,"file":"annotorious-react.es2.js","sources":["../src/Annotorious.tsx"],"sourcesContent":["import { createContext, forwardRef, ReactNode} from 'react';\nimport { useContext, useEffect, useImperativeHandle, useState } from 'react';\nimport { Annotation, Annotator, Store, StoreChangeEvent } from '@annotorious/core';\nimport { useDebounce } from './useDebounce';\n\ninterface Selection<T extends Annotation = Annotation> {\n\n selected: { annotation: T, editable?: boolean }[];\n\n pointerEvent?: PointerEvent;\n\n}\n\nexport interface AnnotoriousContextState {\n\n anno: Annotator;\n\n setAnno(anno: Annotator<Annotation, unknown>): void;\n\n annotations: Annotation[];\n\n selection: Selection;\n\n}\n\nexport const AnnotoriousContext = createContext({ \n\n anno: undefined, \n\n setAnno: undefined, \n\n annotations: [], \n\n selection: { selected: [] }\n\n});\n\nexport const Annotorious = forwardRef<Annotator, { children: ReactNode }>((props: { children: ReactNode }, ref) => {\n\n const [anno, setAnno] = useState<Annotator>(null);\n\n const [annotations, setAnnotations] = useState<Annotation[]>([]);\n\n const [selection, setSelection] = useState<Selection>({ selected: [] });\n\n useImperativeHandle(ref, () => anno);\n\n useEffect(() => {\n if (anno) {\n const { selection, store } = anno.state;\n\n // Components below <Annotorious /> may have\n // loaded annotations into the store already! \n if (store.all().length > 0)\n setAnnotations(store.all());\n\n // Keeps annotations in sync with a React state,\n // so clients can render components the usual React way.\n const onStoreChange = (event: StoreChangeEvent<Annotation>) =>\n setAnnotations(() => store.all());\n\n store.observe(onStoreChange);\n\n // Keep selection in sync with a react state, and resolve them\n // from IDs to annotations automatically, for convenience\n let selectionStoreObserver: (event: StoreChangeEvent<Annotation>) => void;\n\n const unsubscribeSelection = selection.subscribe(({ selected, pointerEvent }) => {\n if (selectionStoreObserver) \n store.unobserve(selectionStoreObserver);\n\n const resolved = (selected || [])\n .map(({ id, editable }) => ({ annotation: store.getAnnotation(id), editable }));\n\n setSelection({ selected: resolved, pointerEvent });\n\n selectionStoreObserver = event => {\n const { updated } = event.changes;\n\n setSelection(({ selected }) => ({\n selected: selected.map(({ annotation, editable }) => {\n const next = updated.find(u => u.oldValue.id === annotation.id);\n return next ? { annotation: next.newValue, editable } : { annotation, editable };\n })\n }));\n }\n\n store.observe(selectionStoreObserver, { annotations: selected.map(({ id }) => id) });\n });\n\n return () => {\n store.unobserve(onStoreChange);\n unsubscribeSelection();\n }\n }\n }, [anno]);\n\n return (\n <AnnotoriousContext.Provider value={{ \n anno, \n setAnno,\n annotations, \n selection \n }}>\n {props.children}\n </AnnotoriousContext.Provider>\n )\n\n});\n\nexport const useAnnotator = <T extends Annotator<any, unknown>>() => {\n const { anno } = useContext(AnnotoriousContext);\n return anno as T;\n}\n\nexport const useAnnotationStore = <T extends Store<Annotation>>() => {\n const { anno } = useContext(AnnotoriousContext);\n return anno?.state.store as T | undefined;\n}\n\nconst _useAnnotations = <T extends Annotation>() => {\n const { annotations } = useContext(AnnotoriousContext);\n return annotations as T[];\n}\n\nconst _useAnnotationsDebouced = <T extends Annotation>(debounce: number) => {\n const { annotations } = useContext(AnnotoriousContext);\n return useDebounce(annotations, debounce) as T[];\n}\n\nexport const useAnnotations = <T extends Annotation>(debounce?: number) =>\n debounce ? _useAnnotationsDebouced<T>(debounce) : _useAnnotations<T>();\n\nexport const useSelection = <T extends Annotation>() => {\n const { selection } = useContext(AnnotoriousContext);\n return selection as Selection<T>;\n}\n\nexport const useAnnotatorUser = () => {\n const { anno } = useContext(AnnotoriousContext);\n return anno?.getUser();\n}\n\nconst _useViewportState = <T extends Annotation>() => {\n const { anno } = useContext(AnnotoriousContext);\n\n const [inViewport, setInViewport] = useState<T[]>([]);\n\n useEffect(() => {\n if (anno) {\n const { store, viewport} = anno.state;\n\n if (!viewport)\n return;\n\n // Keep viewport annotations in sync with a react state, and resolve them\n // from IDs to annotations automatically, for convenience\n let viewportStoreObserver: (event: StoreChangeEvent<T>) => void;\n\n const unsubscribeViewport = viewport.subscribe(ids => {\n if (viewportStoreObserver) \n store.unobserve(viewportStoreObserver);\n\n const resolved = ids.map(id => store.getAnnotation(id)) as T[];\n setInViewport(resolved);\n\n viewportStoreObserver = event => {\n const { updated } = event.changes;\n\n setInViewport(annotations => annotations.map(annotation => {\n const next = updated.find(u => u.oldValue.id === annotation.id);\n return next ? next.newValue : annotation;\n }));\n }\n\n store.observe(viewportStoreObserver, { annotations: ids });\n });\n\n return () => {\n unsubscribeViewport();\n }\n }\n }, [anno]);\n\n return inViewport;\n}\n\nconst _useViewportStateDebounced = <T extends Annotation>(debounce: number) => {\n const inViewport = _useViewportState();\n return useDebounce(inViewport, debounce) as T[];\n}\n\nexport const useViewportState = <T extends Annotation>(debounce?: number) =>\n debounce ? _useViewportStateDebounced<T>(debounce) : _useViewportState<T>();\n"],"names":["AnnotoriousContext","createContext","Annotorious","forwardRef","props","ref","anno","setAnno","useState","annotations","setAnnotations","selection","setSelection","useImperativeHandle","useEffect","store","onStoreChange","event","selectionStoreObserver","unsubscribeSelection","selected","pointerEvent","resolved","id","editable","updated","annotation","next","u","jsx","useAnnotator","useContext","useAnnotationStore","_useAnnotations","_useAnnotationsDebouced","debounce","useDebounce","useAnnotations","useSelection","useAnnotatorUser","_useViewportState","inViewport","setInViewport","viewport","viewportStoreObserver","unsubscribeViewport","ids","_useViewportStateDebounced","useViewportState"],"mappings":";;;AAyBO,MAAMA,IAAqBC,EAAc;AAAA,EAE9C,MAAM;AAAA,EAEN,SAAS;AAAA,EAET,aAAa,CAAC;AAAA,EAEd,WAAW,EAAE,UAAU,GAAG;AAE5B,CAAC,GAEYC,IAAcC,EAA+C,CAACC,GAAgCC,MAAQ;AAEjH,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAoB,IAAI,GAE1C,CAACC,GAAaC,CAAc,IAAIF,EAAuB,CAAE,CAAA,GAEzD,CAACG,GAAWC,CAAY,IAAIJ,EAAoB,EAAE,UAAU,CAAC,EAAA,CAAG;AAElD,SAAAK,EAAAR,GAAK,MAAMC,CAAI,GAEnCQ,EAAU,MAAM;AACd,QAAIR,GAAM;AACR,YAAM,EAAE,WAAAK,GAAW,OAAAI,EAAA,IAAUT,EAAK;AAI9B,MAAAS,EAAM,MAAM,SAAS,KACRL,EAAAK,EAAM,KAAK;AAI5B,YAAMC,IAAg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