@annotorious/react 3.0.0-rc.6 → 3.0.0-rc.8
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.
- package/dist/Annotorious.d.ts +15 -15
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/AnnotoriousPlugin.d.ts +1 -1
- package/dist/AnnotoriousPlugin.d.ts.map +1 -1
- package/dist/AnnotoriousPopup.d.ts +1 -1
- package/dist/AnnotoriousPopup.d.ts.map +1 -1
- package/dist/ImageAnnotator.d.ts +2 -2
- package/dist/ImageAnnotator.d.ts.map +1 -1
- package/dist/annotorious-react.es.js +26 -44
- package/dist/annotorious-react.es.js.map +1 -1
- package/dist/annotorious-react.es10.js +29 -3
- package/dist/annotorious-react.es10.js.map +1 -1
- package/dist/annotorious-react.es11.js +36 -27
- package/dist/annotorious-react.es11.js.map +1 -1
- package/dist/annotorious-react.es12.js +16 -20
- package/dist/annotorious-react.es12.js.map +1 -1
- package/dist/annotorious-react.es13.js +4 -54
- package/dist/annotorious-react.es13.js.map +1 -1
- package/dist/annotorious-react.es14.js +8 -17
- package/dist/annotorious-react.es14.js.map +1 -1
- package/dist/annotorious-react.es15.js +152 -21
- package/dist/annotorious-react.es15.js.map +1 -1
- package/dist/annotorious-react.es16.js +6 -2
- package/dist/annotorious-react.es16.js.map +1 -1
- package/dist/annotorious-react.es17.js +20708 -2
- package/dist/annotorious-react.es17.js.map +1 -1
- package/dist/annotorious-react.es18.js +30 -3924
- package/dist/annotorious-react.es18.js.map +1 -1
- package/dist/annotorious-react.es19.js +2 -29
- package/dist/annotorious-react.es19.js.map +1 -1
- package/dist/annotorious-react.es2.js +2 -2
- package/dist/annotorious-react.es2.js.map +1 -1
- package/dist/annotorious-react.es20.js +30 -36
- package/dist/annotorious-react.es20.js.map +1 -1
- package/dist/annotorious-react.es21.js +597 -14
- package/dist/annotorious-react.es21.js.map +1 -1
- package/dist/annotorious-react.es22.js +2 -4
- package/dist/annotorious-react.es22.js.map +1 -1
- package/dist/annotorious-react.es23.js +2 -8
- package/dist/annotorious-react.es23.js.map +1 -1
- package/dist/annotorious-react.es3.js.map +1 -1
- package/dist/annotorious-react.es4.js +2 -2
- package/dist/annotorious-react.es4.js.map +1 -1
- package/dist/annotorious-react.es5.js +12 -9
- package/dist/annotorious-react.es5.js.map +1 -1
- package/dist/annotorious-react.es8.js +79 -57
- package/dist/annotorious-react.es8.js.map +1 -1
- package/dist/annotorious-react.es9.js +3922 -10
- package/dist/annotorious-react.es9.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts +1 -1
- package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
- package/package.json +1 -2
- package/dist/annotorious-react.es24.js +0 -156
- package/dist/annotorious-react.es24.js.map +0 -1
- package/dist/annotorious-react.es25.js +0 -9
- package/dist/annotorious-react.es25.js.map +0 -1
- package/dist/annotorious-react.es26.js +0 -5
- package/dist/annotorious-react.es26.js.map +0 -1
- package/dist/annotorious-react.es27.js +0 -33
- package/dist/annotorious-react.es27.js.map +0 -1
- package/dist/annotorious-react.es28.js +0 -602
- package/dist/annotorious-react.es28.js.map +0 -1
- package/dist/annotorious-react.es29.js +0 -20133
- package/dist/annotorious-react.es29.js.map +0 -1
- package/dist/annotorious-react.es30.js +0 -35
- package/dist/annotorious-react.es30.js.map +0 -1
- package/dist/annotorious-react.es31.js +0 -5
- package/dist/annotorious-react.es31.js.map +0 -1
- package/dist/annotorious-react.es32.js +0 -5
- package/dist/annotorious-react.es32.js.map +0 -1
- package/dist/annotorious-react.es33.js +0 -19
- package/dist/annotorious-react.es33.js.map +0 -1
- package/dist/annotorious-react.es34.js +0 -20
- package/dist/annotorious-react.es34.js.map +0 -1
- package/dist/annotorious-react.es35.js +0 -30
- package/dist/annotorious-react.es35.js.map +0 -1
- package/dist/annotorious-react.es36.js +0 -24
- package/dist/annotorious-react.es36.js.map +0 -1
- package/dist/annotorious-react.es37.js +0 -19
- package/dist/annotorious-react.es37.js.map +0 -1
- package/dist/annotorious-react.es38.js +0 -7
- package/dist/annotorious-react.es38.js.map +0 -1
- package/dist/annotorious-react.es39.js +0 -11
- package/dist/annotorious-react.es39.js.map +0 -1
- package/dist/annotorious-react.es40.js +0 -10
- package/dist/annotorious-react.es40.js.map +0 -1
package/dist/Annotorious.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { Annotation, Annotator, StoreChangeEvent } from '
|
|
2
|
+
import { Annotation, Annotator, StoreChangeEvent } from '.';
|
|
3
3
|
interface Selection<T extends Annotation = Annotation> {
|
|
4
4
|
selected: {
|
|
5
5
|
annotation: T;
|
|
@@ -26,30 +26,30 @@ export declare const Annotorious: import("react").ForwardRefExoticComponent<{
|
|
|
26
26
|
} & import("react").RefAttributes<Annotator<Annotation, Annotation>>>;
|
|
27
27
|
export declare const useAnnotator: <T extends Annotator<any, unknown>>() => T;
|
|
28
28
|
export declare const useAnnotationStore: <T extends {
|
|
29
|
-
addAnnotation: (annotation: Annotation, origin?: import("@annotorious/core").Origin) => void;
|
|
30
|
-
addBody: (body: import("@annotorious/core").AnnotationBody, origin?: import("@annotorious/core").Origin) => void;
|
|
29
|
+
addAnnotation: (annotation: Annotation, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
30
|
+
addBody: (body: import("@annotorious/core/dist/model/Annotation").AnnotationBody, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
31
31
|
all: () => Annotation[];
|
|
32
|
-
bulkAddAnnotation: (annotations: Annotation[], replace?: boolean, origin?: import("@annotorious/core").Origin) => void;
|
|
33
|
-
bulkDeleteAnnotation: (annotationsOrIds: (string | Annotation)[], origin?: import("@annotorious/core").Origin) => void;
|
|
34
|
-
bulkUpdateAnnotation: (annotations: Annotation[], origin?: import("@annotorious/core").Origin) => void;
|
|
35
|
-
bulkUpdateBodies: (bodies: import("@annotorious/core").AnnotationBody[], origin?: import("@annotorious/core").Origin) => void;
|
|
36
|
-
bulkUpdateTargets: (targets: import("@annotorious/core").AnnotationTarget[], origin?: import("@annotorious/core").Origin) => void;
|
|
37
|
-
clear: (origin?: import("@annotorious/core").Origin) => void;
|
|
38
|
-
deleteAnnotation: (annotationOrId: string | Annotation, origin?: import("@annotorious/core").Origin) => void;
|
|
32
|
+
bulkAddAnnotation: (annotations: Annotation[], replace?: boolean, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
33
|
+
bulkDeleteAnnotation: (annotationsOrIds: (string | Annotation)[], origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
34
|
+
bulkUpdateAnnotation: (annotations: Annotation[], origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
35
|
+
bulkUpdateBodies: (bodies: import("@annotorious/core/dist/model/Annotation").AnnotationBody[], origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
36
|
+
bulkUpdateTargets: (targets: import("@annotorious/core/dist/model/Annotation").AnnotationTarget[], origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
37
|
+
clear: (origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
38
|
+
deleteAnnotation: (annotationOrId: string | Annotation, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
39
39
|
deleteBody: (body: {
|
|
40
40
|
id: string;
|
|
41
41
|
annotation: string;
|
|
42
|
-
}, origin?: import("@annotorious/core").Origin) => void;
|
|
42
|
+
}, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
43
43
|
getAnnotation: (id: string) => Annotation;
|
|
44
|
-
getBody: (id: string) => import("@annotorious/core").AnnotationBody;
|
|
44
|
+
getBody: (id: string) => import("@annotorious/core/dist/model/Annotation").AnnotationBody;
|
|
45
45
|
observe: (onChange: (event: StoreChangeEvent<Annotation>) => void, options?: import("@annotorious/core").StoreObserveOptions) => number;
|
|
46
46
|
unobserve: (onChange: (event: StoreChangeEvent<Annotation>) => void) => void;
|
|
47
|
-
updateAnnotation: (arg1: string | Annotation, arg2?: Annotation | import("@annotorious/core").Origin, arg3?: import("@annotorious/core").Origin) => void;
|
|
47
|
+
updateAnnotation: (arg1: string | Annotation, arg2?: Annotation | import("@annotorious/core/dist/state/StoreObserver").Origin, arg3?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
48
48
|
updateBody: (oldBodyId: {
|
|
49
49
|
id: string;
|
|
50
50
|
annotation: string;
|
|
51
|
-
}, newBody: import("@annotorious/core").AnnotationBody, origin?: import("@annotorious/core").Origin) => void;
|
|
52
|
-
updateTarget: (target: import("@annotorious/core").AnnotationTarget, origin?: import("@annotorious/core").Origin) => void;
|
|
51
|
+
}, newBody: import("@annotorious/core/dist/model/Annotation").AnnotationBody, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
52
|
+
updateTarget: (target: import("@annotorious/core/dist/model/Annotation").AnnotationTarget, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
|
|
53
53
|
}>() => T;
|
|
54
54
|
export declare const useAnnotations: <T extends Annotation>(debounce?: number) => T[];
|
|
55
55
|
export declare const useSelection: <T extends Annotation>() => Selection<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAS,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,SAAS,EAAC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAS,gBAAgB,EAAE,MAAM,GAAG,CAAC;AAGnE,UAAU,SAAS,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU;IAEnD,QAAQ,EAAE;QAAE,UAAU,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAElD,YAAY,CAAC,EAAE,YAAY,CAAC;CAE7B;AAED,MAAM,WAAW,uBAAuB;IAEtC,IAAI,EAAE,SAAS,CAAC;IAEhB,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEpD,WAAW,EAAE,UAAU,EAAE,CAAC;IAE1B,SAAS,EAAE,SAAS,CAAC;CAEtB;AAED,eAAO,MAAM,kBAAkB;;;;;;;EAU7B,CAAC;AAEH,eAAO,MAAM,WAAW;cAAqC,SAAS;qEAuEpE,CAAC;AAEH,eAAO,MAAM,YAAY,4CAGxB,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;SAG9B,CAAA;AAYD,eAAO,MAAM,cAAc,oCAAqC,MAAM,QACE,CAAC;AAEzE,eAAO,MAAM,YAAY,0CAGxB,CAAA;AAED,eAAO,MAAM,gBAAgB,WAG5B,CAAA;AAmDD,eAAO,MAAM,gBAAgB,oCAAsC,MAAM,QACI,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Annotation, Annotator } from '
|
|
1
|
+
import { Annotation, Annotator } from '..';
|
|
2
2
|
export interface AnnotoriousPluginProps<I extends Annotation, E extends unknown> {
|
|
3
3
|
plugin: (anno: Annotator<I, E>, opts?: Object) => ({
|
|
4
4
|
unmount?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotoriousPlugin.d.ts","sourceRoot":"","sources":["../src/AnnotoriousPlugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AnnotoriousPlugin.d.ts","sourceRoot":"","sources":["../src/AnnotoriousPlugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAG3C,MAAM,WAAW,sBAAsB,CAAE,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,OAAO;IAE9E,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;IAEpF,IAAI,CAAC,EAAE,MAAM,CAAC;CAEf;AAED,eAAO,MAAM,iBAAiB,8GAkB7B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotoriousPopup.d.ts","sourceRoot":"","sources":["../src/AnnotoriousPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AnnotoriousPopup.d.ts","sourceRoot":"","sources":["../src/AnnotoriousPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAGpC,MAAM,WAAW,qBAAqB;IAEpC,QAAQ,EAAE;QAAE,UAAU,EAAE,eAAe,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAEjE;AAED,MAAM,WAAW,cAAc;IAE7B,QAAQ,EAAE,SAAS,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,IAAI,IAAI,CAAC;IAErB,SAAS,CAAC,IAAI,IAAI,CAAC;CAEpB;AAED,eAAO,MAAM,SAAS,2GAepB,CAAC"}
|
package/dist/ImageAnnotator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
|
-
import { AnnotoriousOpts } from '
|
|
3
|
-
import type { DrawingStyle, DrawingTool, Filter, ImageAnnotation } from '
|
|
2
|
+
import { AnnotoriousOpts } from '.';
|
|
3
|
+
import type { DrawingStyle, DrawingTool, Filter, ImageAnnotation } from '.';
|
|
4
4
|
export interface ImageAnnotatorProps<E extends unknown> extends AnnotoriousOpts<ImageAnnotation, E> {
|
|
5
5
|
children: ReactElement<HTMLImageElement>;
|
|
6
6
|
filter?: Filter<ImageAnnotation>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageAnnotator.d.ts","sourceRoot":"","sources":["../src/ImageAnnotator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAuC,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,
|
|
1
|
+
{"version":3,"file":"ImageAnnotator.d.ts","sourceRoot":"","sources":["../src/ImageAnnotator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAuC,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,GAAG,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,CAAC;AAG5E,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,OAAO,CAAE,SAAQ,eAAe,CAAC,eAAe,EAAE,CAAC,CAAC;IAEjG,QAAQ,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAEzC,MAAM,CAAC,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IAEjC,KAAK,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,UAAU,EAAE,eAAe,KAAK,YAAY,CAAC,CAAC;IAEvE,IAAI,CAAC,EAAE,WAAW,CAAA;CAEnB;AAED,eAAO,MAAM,cAAc,+FA+B1B,CAAA"}
|
|
@@ -1,55 +1,37 @@
|
|
|
1
|
-
import { Annotorious as n, AnnotoriousContext as a, useAnnotationStore as p, useAnnotations as i, useAnnotator as m, useAnnotatorUser as
|
|
2
|
-
import { AnnotoriousPlugin as
|
|
3
|
-
import { Draggable as
|
|
4
|
-
import { ImageAnnotator as
|
|
1
|
+
import { Annotorious as n, AnnotoriousContext as a, useAnnotationStore as p, useAnnotations as i, useAnnotator as m, useAnnotatorUser as u, useSelection as s, useViewportState as A } from "./annotorious-react.es2.js";
|
|
2
|
+
import { AnnotoriousPlugin as g } from "./annotorious-react.es3.js";
|
|
3
|
+
import { Draggable as S } from "./annotorious-react.es4.js";
|
|
4
|
+
import { ImageAnnotator as d } from "./annotorious-react.es5.js";
|
|
5
5
|
import "./annotorious-react.es6.js";
|
|
6
6
|
import "./annotorious-react.es7.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { PRESENCE_KEY as I, createPresenceState as h } from "./annotorious-react.es13.js";
|
|
13
|
-
import { createBody as G, getContributors as K } from "./annotorious-react.es14.js";
|
|
14
|
-
import { diffAnnotations as R } from "./annotorious-react.es15.js";
|
|
15
|
-
import { PointerSelectAction as U } from "./annotorious-react.es16.js";
|
|
16
|
-
import { Origin as _ } from "./annotorious-react.es17.js";
|
|
17
|
-
import { ShapeType as k, W3CImageFormat as q } from "./annotorious-react.es18.js";
|
|
18
|
-
import { OpenSeadragonAnnotator as J, useViewer as L } from "./annotorious-react.es19.js";
|
|
19
|
-
import { OpenSeadragonPopup as Q } from "./annotorious-react.es20.js";
|
|
20
|
-
import { OpenSeadragonViewer as Z } from "./annotorious-react.es21.js";
|
|
7
|
+
import { Origin as O, PointerSelectAction as P, createAnonymousGuest as w, createBody as y, defaultColorProvider as C } from "./annotorious-react.es8.js";
|
|
8
|
+
import { ShapeType as V, W3CImageFormat as b, createImageAnnotator as h } from "./annotorious-react.es9.js";
|
|
9
|
+
import { OpenSeadragonAnnotator as B, useViewer as D } from "./annotorious-react.es10.js";
|
|
10
|
+
import { OpenSeadragonPopup as G } from "./annotorious-react.es11.js";
|
|
11
|
+
import { OpenSeadragonViewer as U } from "./annotorious-react.es12.js";
|
|
21
12
|
export {
|
|
22
13
|
n as Annotorious,
|
|
23
14
|
a as AnnotoriousContext,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
q as W3CImageFormat,
|
|
15
|
+
g as AnnotoriousPlugin,
|
|
16
|
+
S as Draggable,
|
|
17
|
+
d as ImageAnnotator,
|
|
18
|
+
B as OpenSeadragonAnnotator,
|
|
19
|
+
G as OpenSeadragonPopup,
|
|
20
|
+
U as OpenSeadragonViewer,
|
|
21
|
+
O as Origin,
|
|
22
|
+
P as PointerSelectAction,
|
|
23
|
+
V as ShapeType,
|
|
24
|
+
b as W3CImageFormat,
|
|
35
25
|
w as createAnonymousGuest,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
h as createPresenceState,
|
|
40
|
-
z as defaultColorProvider,
|
|
41
|
-
R as diffAnnotations,
|
|
42
|
-
K as getContributors,
|
|
43
|
-
B as parseAll,
|
|
44
|
-
V as parseW3CBodies,
|
|
45
|
-
E as serializeAll,
|
|
46
|
-
W as serializeW3CBodies,
|
|
26
|
+
y as createBody,
|
|
27
|
+
h as createImageAnnotator,
|
|
28
|
+
C as defaultColorProvider,
|
|
47
29
|
p as useAnnotationStore,
|
|
48
30
|
i as useAnnotations,
|
|
49
31
|
m as useAnnotator,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
u as useAnnotatorUser,
|
|
33
|
+
s as useSelection,
|
|
34
|
+
D as useViewer,
|
|
35
|
+
A as useViewportState
|
|
54
36
|
};
|
|
55
37
|
//# sourceMappingURL=annotorious-react.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"annotorious-react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsx as d } from "./annotorious-react.es13.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.es17.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
|
+
};
|
|
3
27
|
export {
|
|
4
|
-
|
|
28
|
+
y as OpenSeadragonAnnotator,
|
|
29
|
+
s as OpenSeadragonAnnotatorContext,
|
|
30
|
+
C as useViewer
|
|
5
31
|
};
|
|
6
32
|
//# sourceMappingURL=annotorious-react.es10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es10.js","sources":["
|
|
1
|
+
{"version":3,"file":"annotorious-react.es10.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 '..';\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,30 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
annotation:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
1
|
+
import { jsx as v } from "./annotorious-react.es13.js";
|
|
2
|
+
import { useRef as w, useState as d, useEffect as c } from "react";
|
|
3
|
+
import { Draggable as S } from "./annotorious-react.es4.js";
|
|
4
|
+
import { useViewer as x } from "./annotorious-react.es10.js";
|
|
5
|
+
import { useSelection as D } from "./annotorious-react.es2.js";
|
|
6
|
+
import { setPosition as I } from "./annotorious-react.es18.js";
|
|
7
|
+
const q = (u) => {
|
|
8
|
+
const n = w(null), o = x(), { selected: t } = D(), [l, f] = d([]), [s, i] = d(!1), m = () => i(!0), p = () => {
|
|
9
|
+
const e = t[0].annotation;
|
|
10
|
+
I(o, e, n.current);
|
|
11
|
+
}, g = (e, r) => e.every((a) => r.includes(a)) && r.every((a) => e.includes(a));
|
|
12
|
+
return c(() => {
|
|
13
|
+
const e = t.map(({ annotation: r }) => r.id);
|
|
14
|
+
g(l, e) || (i(!1), f(e));
|
|
15
|
+
}, [t]), c(() => {
|
|
16
|
+
if (!n.current)
|
|
17
|
+
return;
|
|
18
|
+
s || p();
|
|
19
|
+
const e = () => {
|
|
20
|
+
s || p();
|
|
21
|
+
};
|
|
22
|
+
return o.addHandler("update-viewport", e), () => {
|
|
23
|
+
o.removeHandler("update-viewport", e);
|
|
24
|
+
};
|
|
25
|
+
}, [t, s]), t.length > 0 ? /* @__PURE__ */ v(
|
|
26
|
+
S,
|
|
27
|
+
{
|
|
28
|
+
ref: n,
|
|
29
|
+
className: "a9s-popup a9s-osd-popup",
|
|
30
|
+
onDragStart: m,
|
|
31
|
+
children: u.popup({ viewer: o, selected: t })
|
|
32
|
+
},
|
|
33
|
+
t.map(({ annotation: e }) => e.id).join("-")
|
|
34
|
+
) : null;
|
|
35
|
+
};
|
|
26
36
|
export {
|
|
27
|
-
|
|
28
|
-
h as serializeW3CBodies
|
|
37
|
+
q as OpenSeadragonPopup
|
|
29
38
|
};
|
|
30
39
|
//# sourceMappingURL=annotorious-react.es11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es11.js","sources":["
|
|
1
|
+
{"version":3,"file":"annotorious-react.es11.js","sources":["../src/openseadragon/OpenSeadragonPopup.tsx"],"sourcesContent":["import { ReactNode, useEffect, useRef, useState } from 'react';\nimport { ImageAnnotation } from '@annotorious/annotorious';\nimport OpenSeadragon from 'openseadragon';\nimport { AnnotoriousPopupProps, Draggable } from '../AnnotoriousPopup';\nimport { useViewer } from './OpenSeadragonAnnotator';\nimport { useSelection } from '../Annotorious';\nimport { setPosition } from './setPosition';\n\nexport type OpenSeadragonPopupProps = AnnotoriousPopupProps & {\n\n viewer: OpenSeadragon.Viewer\n\n}\n\nexport type OpenSeadragonPopupContainerProps = {\n\n popup(props: OpenSeadragonPopupProps): ReactNode\n\n}\n\nexport const OpenSeadragonPopup = (props: OpenSeadragonPopupContainerProps) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n const viewer = useViewer();\n\n const { selected } = useSelection<ImageAnnotation>();\n\n const [selectedIds, setSelectedIds] = useState<string[]>([]);\n\n const [dragged, setDragged] = useState(false);\n\n const onDragStart = () => setDragged(true);\n\n const updatePosition = () => {\n // Note: this popup only supports a single selection\n const annotation = selected[0].annotation;\n setPosition(viewer, annotation, el.current);\n }\n\n const equal = (a: string[], b: string[]) => \n a.every(str => b.includes(str)) && b.every(str => a.includes(str));\n\n useEffect(() => {\n // Reset drag flag if selected IDs have changed\n const nextIds = selected.map(({ annotation }) => annotation.id);\n\n if (!equal(selectedIds, nextIds)) {\n setDragged(false);\n setSelectedIds(nextIds);\n }\n }, [selected]);\n\n useEffect(() => {\n if (!el.current) return;\n\n if (!dragged) updatePosition();\n\n const onUpdateViewport = () => {\n if (!dragged) updatePosition();\n }\n\n viewer.addHandler('update-viewport', onUpdateViewport);\n\n return () => {\n viewer.removeHandler('update-viewport', onUpdateViewport);\n }\n }, [selected, dragged]);\n \n return selected.length > 0 ? (\n <Draggable \n ref={el} \n key={selected.map(({ annotation }) => annotation.id).join('-')} \n className=\"a9s-popup a9s-osd-popup\" \n onDragStart={onDragStart}>\n\n {props.popup({ viewer, selected })}\n \n </Draggable>\n ) : null;\n\n}"],"names":["OpenSeadragonPopup","props","el","useRef","viewer","useViewer","selected","useSelection","selectedIds","setSelectedIds","useState","dragged","setDragged","onDragStart","updatePosition","annotation","setPosition","equal","a","b","str","useEffect","nextIds","onUpdateViewport","jsx","Draggable"],"mappings":";;;;;;AAoBa,MAAAA,IAAqB,CAACC,MAA4C;AAEvE,QAAAC,IAAKC,EAAuB,IAAI,GAEhCC,IAASC,KAET,EAAE,UAAAC,MAAaC,KAEf,CAACC,GAAaC,CAAc,IAAIC,EAAmB,CAAE,CAAA,GAErD,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GAEtCG,IAAc,MAAMD,EAAW,EAAI,GAEnCE,IAAiB,MAAM;AAErB,UAAAC,IAAaT,EAAS,CAAC,EAAE;AACnB,IAAAU,EAAAZ,GAAQW,GAAYb,EAAG,OAAO;AAAA,EAAA,GAGtCe,IAAQ,CAACC,GAAaC,MAC1BD,EAAE,MAAM,OAAOC,EAAE,SAASC,CAAG,CAAC,KAAKD,EAAE,MAAM,OAAOD,EAAE,SAASE,CAAG,CAAC;AAEnE,SAAAC,EAAU,MAAM;AAER,UAAAC,IAAUhB,EAAS,IAAI,CAAC,EAAE,YAAAS,QAAiBA,EAAW,EAAE;AAE9D,IAAKE,EAAMT,GAAac,CAAO,MAC7BV,EAAW,EAAK,GAChBH,EAAea,CAAO;AAAA,EACxB,GACC,CAAChB,CAAQ,CAAC,GAEbe,EAAU,MAAM;AACd,QAAI,CAACnB,EAAG;AAAS;AAEjB,IAAKS,KAAwBG;AAE7B,UAAMS,IAAmB,MAAM;AAC7B,MAAKZ,KAAwBG;IAAA;AAGxB,WAAAV,EAAA,WAAW,mBAAmBmB,CAAgB,GAE9C,MAAM;AACJ,MAAAnB,EAAA,cAAc,mBAAmBmB,CAAgB;AAAA,IAAA;AAAA,EAC1D,GACC,CAACjB,GAAUK,CAAO,CAAC,GAEfL,EAAS,SAAS,IACvB,gBAAAkB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAKvB;AAAA,MAEL,WAAU;AAAA,MACV,aAAAW;AAAA,MAEC,UAAMZ,EAAA,MAAM,EAAE,QAAAG,GAAQ,UAAAE,GAAU;AAAA,IAAA;AAAA,IAJ5BA,EAAS,IAAI,CAAC,EAAE,YAAAS,EAAA,MAAiBA,EAAW,EAAE,EAAE,KAAK,GAAG;AAAA,EAO7D,IAAA;AAEN;"}
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
}, removeUser: (r) => o.releaseColor(r.appearance.color) };
|
|
18
|
-
};
|
|
1
|
+
import { jsx as m } from "./annotorious-react.es13.js";
|
|
2
|
+
import { forwardRef as a, useRef as c, useContext as p, useEffect as u, useImperativeHandle as d } from "react";
|
|
3
|
+
import l from "openseadragon";
|
|
4
|
+
import { OpenSeadragonAnnotatorContext as v } from "./annotorious-react.es10.js";
|
|
5
|
+
const S = a((n, i) => {
|
|
6
|
+
const { className: s, options: t } = n, r = c(null), { viewer: f, setViewer: e } = p(v);
|
|
7
|
+
return u(() => {
|
|
8
|
+
if (r.current) {
|
|
9
|
+
const o = l({ ...t, element: r.current });
|
|
10
|
+
return e && e(o), () => {
|
|
11
|
+
o.destroy(), e && e(void 0);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}, [JSON.stringify(t)]), d(i, () => f), /* @__PURE__ */ m("div", { className: s, ref: r });
|
|
15
|
+
});
|
|
19
16
|
export {
|
|
20
|
-
|
|
21
|
-
l as defaultColorProvider
|
|
17
|
+
S as OpenSeadragonViewer
|
|
22
18
|
};
|
|
23
19
|
//# sourceMappingURL=annotorious-react.es12.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es12.js","sources":["
|
|
1
|
+
{"version":3,"file":"annotorious-react.es12.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 setViewer(v);\n\n return () => {\n v.destroy();\n\n if (setViewer) \n setViewer(undefined);\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;AAI3D,aAAAG,KACFA,EAAUI,CAAC,GAEN,MAAM;AACX,QAAAA,EAAE,QAAQ,GAENJ,KACFA,EAAU,MAAS;AAAA,MAAA;AAAA,IAEzB;AAAA,KACC,CAAC,KAAK,UAAUJ,CAAO,CAAC,CAAC,GAERU,EAAAZ,GAAK,MAAMK,CAAM,GAGlC,gBAAAQ,EAAA,OAAA,EAAI,WAAAZ,GAAsB,KAAKE,EAAS,CAAA;AAG7C,CAAC;"}
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { createDefaultAppearenceProvider as E } from "./annotorious-react.es12.js";
|
|
4
|
-
const w = (c, r) => c.every((o) => c.includes(o)) && r.every((o) => c.includes(o)), P = v(), y = (c = E()) => {
|
|
5
|
-
const r = p(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), m = (t, e) => {
|
|
6
|
-
if (o.has(t)) {
|
|
7
|
-
console.warn("Attempt to add user that is already present", t, e);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const n = c.addUser(t, e);
|
|
11
|
-
o.set(t, {
|
|
12
|
-
...e,
|
|
13
|
-
presenceKey: t,
|
|
14
|
-
appearance: n
|
|
15
|
-
});
|
|
16
|
-
}, u = (t) => {
|
|
17
|
-
const e = o.get(t);
|
|
18
|
-
if (!e) {
|
|
19
|
-
console.warn("Attempt to remove user that is not present", t);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
c.removeUser(e), o.delete(t);
|
|
23
|
-
}, h = (t) => {
|
|
24
|
-
const e = new Set(t.map((s) => s.presenceKey)), n = t.filter(({ presenceKey: s }) => !o.has(s)), i = Array.from(o.values()).filter((s) => !e.has(s.presenceKey));
|
|
25
|
-
n.forEach(({ presenceKey: s, user: f }) => m(s, f)), i.forEach((s) => {
|
|
26
|
-
const { presenceKey: f } = s;
|
|
27
|
-
a.has(f) && r.emit("selectionChange", s, null), u(f);
|
|
28
|
-
}), (n.length > 0 || i.length > 0) && r.emit("presence", l());
|
|
29
|
-
}, d = (t, e) => {
|
|
30
|
-
const n = o.get(t);
|
|
31
|
-
if (!n) {
|
|
32
|
-
console.warn("Activity notification from user that is not present");
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const i = a.get(t);
|
|
36
|
-
(!i || !w(i, e)) && (a.set(t, e), r.emit("selectionChange", n, e));
|
|
37
|
-
}, g = (t, e) => {
|
|
38
|
-
const n = o.get(t);
|
|
39
|
-
if (!n) {
|
|
40
|
-
console.warn("Selection change for user that is not present", t);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
e ? a.set(t, e) : a.delete(t), r.emit("selectionChange", n, e);
|
|
44
|
-
}, l = () => [...Array.from(o.values())];
|
|
45
|
-
return {
|
|
46
|
-
getPresentUsers: l,
|
|
47
|
-
notifyActivity: d,
|
|
48
|
-
on: (t, e) => r.on(t, e),
|
|
49
|
-
syncUsers: h,
|
|
50
|
-
updateSelection: g
|
|
51
|
-
};
|
|
52
|
-
};
|
|
1
|
+
import { j as t } from "./annotorious-react.es16.js";
|
|
2
|
+
const o = t.Fragment, r = t.jsx;
|
|
53
3
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
4
|
+
o as Fragment,
|
|
5
|
+
r as jsx
|
|
56
6
|
};
|
|
57
7
|
//# sourceMappingURL=annotorious-react.es13.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es13.js","sources":[
|
|
1
|
+
{"version":3,"file":"annotorious-react.es13.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import c from "
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
].filter((a) => a);
|
|
9
|
-
}, i = (t, e, r, o) => ({
|
|
10
|
-
id: c(),
|
|
11
|
-
annotation: t.id,
|
|
12
|
-
created: r || /* @__PURE__ */ new Date(),
|
|
13
|
-
creator: o,
|
|
14
|
-
...e
|
|
15
|
-
});
|
|
1
|
+
import { useState as c, useRef as n, useEffect as s } from "react";
|
|
2
|
+
const m = (e, t) => {
|
|
3
|
+
const [u, o] = c(e), r = n();
|
|
4
|
+
return s(() => (r.current = setTimeout(() => o(e), t), () => {
|
|
5
|
+
clearTimeout(r.current);
|
|
6
|
+
}), [e, t]), u;
|
|
7
|
+
};
|
|
16
8
|
export {
|
|
17
|
-
|
|
18
|
-
s as getContributors
|
|
9
|
+
m as useDebounce
|
|
19
10
|
};
|
|
20
11
|
//# sourceMappingURL=annotorious-react.es14.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotorious-react.es14.js","sources":["
|
|
1
|
+
{"version":3,"file":"annotorious-react.es14.js","sources":["../src/useDebounce.ts"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nexport const useDebounce = (value: any, delay: number) => {\n const [debouncedValue, setDebouncedValue] = useState<any>(value);\n\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n\n useEffect(() => {\n timerRef.current = \n setTimeout(() => setDebouncedValue(value), delay);\n\n return () => {\n clearTimeout(timerRef.current);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","timerRef","useRef","useEffect"],"mappings":";AAEa,MAAAA,IAAc,CAACC,GAAYC,MAAkB;AACxD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAcJ,CAAK,GAEzDK,IAAWC;AAEjB,SAAAC,EAAU,OACRF,EAAS,UACP,WAAW,MAAMF,EAAkBH,CAAK,GAAGC,CAAK,GAE3C,MAAM;AACX,iBAAaI,EAAS,OAAO;AAAA,EAAA,IAE9B,CAACL,GAAOC,CAAK,CAAC,GAEVC;AACT;"}
|