@annotorious/react 3.0.0-rc.9 → 3.0.0

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 (62) hide show
  1. package/dist/Annotorious.d.ts +11 -40
  2. package/dist/Annotorious.d.ts.map +1 -1
  3. package/dist/AnnotoriousPlugin.d.ts +9 -6
  4. package/dist/AnnotoriousPlugin.d.ts.map +1 -1
  5. package/dist/AnnotoriousPopup.d.ts +2 -2
  6. package/dist/AnnotoriousPopup.d.ts.map +1 -1
  7. package/dist/ImageAnnotator.d.ts +1 -2
  8. package/dist/ImageAnnotator.d.ts.map +1 -1
  9. package/dist/annotorious-react.css +1 -1
  10. package/dist/annotorious-react.es.js +35 -32
  11. package/dist/annotorious-react.es.js.map +1 -1
  12. package/dist/annotorious-react.es10.js +15 -35
  13. package/dist/annotorious-react.es10.js.map +1 -1
  14. package/dist/annotorious-react.es11.js +6 -16
  15. package/dist/annotorious-react.es11.js.map +1 -1
  16. package/dist/annotorious-react.es12.js +8 -4
  17. package/dist/annotorious-react.es12.js.map +1 -1
  18. package/dist/annotorious-react.es13.js +134 -8
  19. package/dist/annotorious-react.es13.js.map +1 -1
  20. package/dist/annotorious-react.es14.js +31 -152
  21. package/dist/annotorious-react.es14.js.map +1 -1
  22. package/dist/annotorious-react.es15.js +2 -6
  23. package/dist/annotorious-react.es15.js.map +1 -1
  24. package/dist/annotorious-react.es16.js +20 -22149
  25. package/dist/annotorious-react.es16.js.map +1 -1
  26. package/dist/annotorious-react.es17.js +606 -32
  27. package/dist/annotorious-react.es17.js.map +1 -1
  28. package/dist/annotorious-react.es18.js +2 -2
  29. package/dist/annotorious-react.es19.js +2 -30
  30. package/dist/annotorious-react.es19.js.map +1 -1
  31. package/dist/annotorious-react.es2.js +87 -68
  32. package/dist/annotorious-react.es2.js.map +1 -1
  33. package/dist/annotorious-react.es3.js +12 -13
  34. package/dist/annotorious-react.es3.js.map +1 -1
  35. package/dist/annotorious-react.es4.js +8 -8
  36. package/dist/annotorious-react.es4.js.map +1 -1
  37. package/dist/annotorious-react.es5.js +19 -20
  38. package/dist/annotorious-react.es5.js.map +1 -1
  39. package/dist/annotorious-react.es8.js +27 -80
  40. package/dist/annotorious-react.es8.js.map +1 -1
  41. package/dist/annotorious-react.es9.js +34 -28
  42. package/dist/annotorious-react.es9.js.map +1 -1
  43. package/dist/index.d.ts +8 -9
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/openseadragon/OpenSeadragonAnnotator.d.ts +3 -3
  46. package/dist/openseadragon/OpenSeadragonAnnotator.d.ts.map +1 -1
  47. package/dist/openseadragon/OpenSeadragonPopup.d.ts +1 -1
  48. package/dist/openseadragon/OpenSeadragonViewer.d.ts +2 -3
  49. package/dist/openseadragon/OpenSeadragonViewer.d.ts.map +1 -1
  50. package/dist/openseadragon/setPosition.d.ts +1 -1
  51. package/dist/openseadragon/setPosition.d.ts.map +1 -1
  52. package/package.json +14 -12
  53. package/dist/annotorious-react.es20.js +0 -602
  54. package/dist/annotorious-react.es20.js.map +0 -1
  55. package/dist/annotorious-react.es21.js +0 -5
  56. package/dist/annotorious-react.es21.js.map +0 -1
  57. package/dist/annotorious-react.es22.js +0 -5
  58. package/dist/annotorious-react.es22.js.map +0 -1
  59. package/dist/annotorious-react.es6.js +0 -5
  60. package/dist/annotorious-react.es6.js.map +0 -1
  61. package/dist/annotorious-react.es7.js +0 -5
  62. package/dist/annotorious-react.es7.js.map +0 -1
@@ -1,19 +1,13 @@
1
+ import { StoreObserveOptions, UserSelectActionExpression } from '@annotorious/core';
1
2
  import { ReactNode } from 'react';
2
- import { Annotation, Annotator, StoreChangeEvent } from '.';
3
- interface Selection<T extends Annotation = Annotation> {
3
+ import { Annotation, Annotator, Selection as CoreSelection, Store, User } from '@annotorious/annotorious';
4
+ interface Selection<T extends Annotation = Annotation> extends Omit<CoreSelection, 'selected'> {
4
5
  selected: {
5
6
  annotation: T;
6
7
  editable?: boolean;
7
8
  }[];
8
- pointerEvent?: PointerEvent;
9
9
  }
10
- export interface AnnotoriousContextState {
11
- anno: Annotator;
12
- setAnno(anno: Annotator<Annotation, unknown>): void;
13
- annotations: Annotation[];
14
- selection: Selection;
15
- }
16
- export declare const AnnotoriousContext: import("react").Context<{
10
+ export declare const AnnotoriousContext: import('react').Context<{
17
11
  anno: any;
18
12
  setAnno: any;
19
13
  annotations: any[];
@@ -21,39 +15,16 @@ export declare const AnnotoriousContext: import("react").Context<{
21
15
  selected: any[];
22
16
  };
23
17
  }>;
24
- export declare const Annotorious: import("react").ForwardRefExoticComponent<{
18
+ export declare const Annotorious: import('react').ForwardRefExoticComponent<{
25
19
  children: ReactNode;
26
- } & import("react").RefAttributes<Annotator<Annotation, Annotation>>>;
27
- export declare const useAnnotator: <T extends Annotator<any, unknown>>() => T;
28
- export declare const useAnnotationStore: <T extends {
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
- all: () => Annotation[];
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
- deleteBody: (body: {
40
- id: string;
41
- annotation: string;
42
- }, origin?: import("@annotorious/core/dist/state/StoreObserver").Origin) => void;
43
- getAnnotation: (id: string) => Annotation;
44
- getBody: (id: string) => import("@annotorious/core/dist/model/Annotation").AnnotationBody;
45
- observe: (onChange: (event: StoreChangeEvent<Annotation>) => void, options?: import("@annotorious/core").StoreObserveOptions) => number;
46
- unobserve: (onChange: (event: StoreChangeEvent<Annotation>) => void) => 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
- updateBody: (oldBodyId: {
49
- id: string;
50
- annotation: string;
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
- }>() => T;
20
+ } & import('react').RefAttributes<Annotator<Annotation, Annotation>>>;
21
+ export declare const useAnnotator: <T extends unknown = Annotator<any, unknown>>() => T;
22
+ export declare const useAnnotationStore: <T extends unknown = Store<Annotation>>() => T | undefined;
54
23
  export declare const useAnnotations: <T extends Annotation>(debounce?: number) => T[];
24
+ export declare const useAnnotation: <T extends Annotation>(id: string, options?: Omit<StoreObserveOptions, "annotations">) => T;
25
+ export declare const useAnnotationSelectAction: <T extends Annotation>(id: string, action: UserSelectActionExpression<T>) => import('@annotorious/core').UserSelectAction;
55
26
  export declare const useSelection: <T extends Annotation>() => Selection<T>;
56
- export declare const useAnnotatorUser: () => any;
27
+ export declare const useAnnotatorUser: () => User;
57
28
  export declare const useViewportState: <T extends Annotation>(debounce?: number) => T[];
58
29
  export {};
59
30
  //# sourceMappingURL=Annotorious.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Ann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AK,EAEL,IAAI,EACL,MAAM,0BAA0B,CAAC;AAElC,UAAU,SAAS,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,CAAE,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IAE5F,QAAQ,EAAE;QAAE,UAAU,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAEnD;AAED,eAAO,MAAM,kBAAkB;;;;;;;EAU7B,CAAC;AAEH,eAAO,MAAM,WAAW;cAAqC,SAAS;qEAuEpE,CAAC;AAEH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,OAAO,iCAE7B,CAChB,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,OAAO,2BAEtB,CAAC,GAAG,SACjC,CAAA;AAYD,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,UAAU,aAAa,MAAM,QACG,CAAC;AAE1E,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,MAAM,MAAM,YAAY,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,MAsBjH,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,CAAC,SAAS,UAAU,MAAM,MAAM,UAAU,0BAA0B,CAAC,CAAC,CAAC,iDAGhH,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,OAE3B,SAAS,CAAC,CAAC,CAChC,CAAA;AAED,eAAO,MAAM,gBAAgB,QAAO,IAGnC,CAAA;AAmDD,eAAO,MAAM,gBAAgB,GAAK,CAAC,SAAS,UAAU,aAAa,MAAM,QACI,CAAC"}
@@ -1,9 +1,12 @@
1
- import { Annotation, Annotator } from '..';
2
- export interface AnnotoriousPluginProps<I extends Annotation, E extends unknown> {
3
- plugin: (anno: Annotator<I, E>, opts?: Object) => ({
4
- unmount?: () => void;
5
- }) | void;
1
+ import { Annotator } from '@annotorious/annotorious';
2
+ export type AnnotatorPlugin<T extends unknown = Annotator<any, unknown>> = (anno: T, opts?: Object) => ({
3
+ unmount?: () => void;
4
+ }) | void;
5
+ export interface AnnotoriousPluginProps<T extends unknown = Annotator<any, unknown>> {
6
+ plugin: AnnotatorPlugin<T>;
6
7
  opts?: Object;
7
8
  }
8
- export declare const AnnotoriousPlugin: <I extends Annotation = Annotation, E extends unknown = unknown>(props: AnnotoriousPluginProps<I, E>) => any;
9
+ export declare const AnnotoriousPlugin: import('react').ForwardRefExoticComponent<AnnotoriousPluginProps<unknown> & import('react').RefAttributes<void | {
10
+ unmount?: () => void;
11
+ }>>;
9
12
  //# sourceMappingURL=AnnotoriousPlugin.d.ts.map
@@ -1 +1 @@
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
+ {"version":3,"file":"AnnotoriousPlugin.d.ts","sourceRoot":"","sources":["../src/AnnotoriousPlugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,IACrE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,CAAC;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC;AAEhE,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC;IAEjF,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAE3B,IAAI,CAAC,EAAE,MAAM,CAAC;CAEf;AAID,eAAO,MAAM,iBAAiB;cAZa,MAAM,IAAI;GAwCnD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { ImageAnnotation } from '.';
2
+ import { ImageAnnotation } from '@annotorious/annotorious';
3
3
  export interface AnnotoriousPopupProps {
4
4
  selected: {
5
5
  annotation: ImageAnnotation;
@@ -12,5 +12,5 @@ export interface DraggableProps {
12
12
  onDragStart?(): void;
13
13
  onDragEnd?(): void;
14
14
  }
15
- export declare const Draggable: import("react").ForwardRefExoticComponent<DraggableProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ export declare const Draggable: import('react').ForwardRefExoticComponent<DraggableProps & import('react').RefAttributes<HTMLDivElement>>;
16
16
  //# sourceMappingURL=AnnotoriousPopup.d.ts.map
@@ -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,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"}
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,0BAA0B,CAAC;AAG3D,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"}
@@ -1,6 +1,5 @@
1
1
  import { ReactElement } from 'react';
2
- import { AnnotoriousOpts } from '.';
3
- import type { DrawingStyle, DrawingTool, Filter, ImageAnnotation } from '.';
2
+ import { AnnotoriousOpts, DrawingStyle, DrawingTool, Filter, ImageAnnotation } from '@annotorious/annotorious';
4
3
  export interface ImageAnnotatorProps<E extends unknown> extends AnnotoriousOpts<ImageAnnotation, E> {
5
4
  children: ReactElement<HTMLImageElement>;
6
5
  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,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
+ {"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,0BAA0B,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGnG,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,CAAC;CAEpB;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,OAAO,SAAS,mBAAmB,CAAC,CAAC,CAAC,4CAmC9E,CAAA"}
@@ -1 +1 @@
1
- canvas.a9s-gl-canvas{height:100%;left:0;position:absolute;top:0;width:100%}canvas.a9s-gl-canvas.hover{cursor:pointer!important}svg.svelte-190cqdf.svelte-190cqdf{pointer-events:none}svg.drawing.svelte-190cqdf.svelte-190cqdf{pointer-events:all}svg.svelte-190cqdf .svelte-190cqdf{pointer-events:all}text.svelte-1rehw2p{fill:#fff;font-family:Arial,Helvetica,sans-serif;font-weight:600}rect.svelte-1rehw2p{stroke-width:1.2;vector-effect:non-scaling-stroke}polygon.svelte-fgq4n0{stroke-width:1.2;vector-effect:non-scaling-stroke}rect.svelte-gze948{stroke-width:1.2;vector-effect:non-scaling-stroke}svg.svelte-1krwc4m{position:absolute;top:0;left:0;width:100%;height:100%;outline:none;pointer-events:none}.a9s-annotationlayer{box-sizing:border-box;height:100%;left:0;outline:none;position:absolute;top:0;touch-action:none;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-annotationlayer ellipse,.a9s-annotationlayer polygon,.a9s-annotationlayer rect{fill:transparent;shape-rendering:geometricPrecision;vector-effect:non-scaling-stroke}.a9s-edge-handle{fill:transparent;stroke:transparent;stroke-width:6px}.a9s-shape-handle,.a9s-corner-handle{cursor:move}.a9s-edge-handle-top{cursor:n-resize}.a9s-edge-handle-right{cursor:e-resize}.a9s-edge-handle-bottom{cursor:s-resize}.a9s-edge-handle-left{cursor:w-resize}.a9s-corner-handle.a9s-corner-handle-topleft{cursor:nw-resize}.a9s-corner-handle.a9s-corner-handle-topright{cursor:ne-resize}.a9s-corner-handle.a9s-corner-handle-bottomright{cursor:se-resize}.a9s-corner-handle.a9s-corner-handle-bottomleft{cursor:sw-resize}.a9s-annotationlayer .a9s-outer,div[data-theme=dark] .a9s-annotationlayer .a9s-outer{display:none}.a9s-annotationlayer .a9s-inner,div[data-theme=dark] .a9s-annotationlayer .a9s-inner{fill:#0000001f;stroke:#000;stroke-width:1px}rect.a9s-corner-handle,div[data-theme=dark] rect.a9s-corner-handle{fill:#000;rx:2px}rect.a9s-close-polygon-handle,div[data-theme=dark] rect.a9s-close-polygon-handle{fill:#000;rx:1px}.a9s-annotationlayer .a9s-outer,div[data-theme=light] .a9s-annotationlayer .a9s-outer{display:block;stroke:#00000040;stroke-width:3.5px}.a9s-annotationlayer .a9s-inner,div[data-theme=light] .a9s-annotationlayer .a9s-inner{fill:#ffffff26;stroke:#fff;stroke-width:1.5px}rect.a9s-corner-handle,div[data-theme=light] rect.a9s-corner-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px}rect.a9s-close-polygon-handle,div[data-theme=light] rect.a9s-close-polygon-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px}
1
+ canvas.a9s-gl-canvas{height:100%;left:0;position:absolute;top:0;width:100%}canvas.a9s-gl-canvas.hidden{display:none}canvas.a9s-gl-canvas.hover{cursor:pointer!important}svg.svelte-190cqdf.svelte-190cqdf{pointer-events:none}svg.drawing.svelte-190cqdf.svelte-190cqdf{pointer-events:all}svg.svelte-190cqdf .svelte-190cqdf{pointer-events:all}text.svelte-1rehw2p{fill:#fff;font-family:Arial,Helvetica,sans-serif;font-weight:600}rect.svelte-1rehw2p{stroke-width:1.2;vector-effect:non-scaling-stroke}polygon.svelte-fgq4n0{stroke-width:1.2;vector-effect:non-scaling-stroke}rect.svelte-gze948{stroke-width:1.2;vector-effect:non-scaling-stroke}svg.svelte-1krwc4m{position:absolute;top:0;left:0;width:100%;height:100%;outline:none;pointer-events:none}.a9s-touch-halo.svelte-1sgkh33{fill:transparent;stroke-width:0}.a9s-touch-halo.touched.svelte-1sgkh33{fill:#ffffff40}.a9s-annotationlayer{box-sizing:border-box;height:100%;left:0;outline:none;position:absolute;top:0;touch-action:none;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-annotationlayer.hidden{display:none}.a9s-annotationlayer .a9s-annotation{cursor:pointer}.a9s-annotationlayer ellipse,.a9s-annotationlayer polygon,.a9s-annotationlayer rect{fill:transparent;shape-rendering:geometricPrecision;vector-effect:non-scaling-stroke}.a9s-edge-handle{fill:transparent;stroke:transparent;stroke-width:6px}.a9s-shape-handle,.a9s-handle{cursor:move}.a9s-edge-handle-top{cursor:n-resize}.a9s-edge-handle-right{cursor:e-resize}.a9s-edge-handle-bottom{cursor:s-resize}.a9s-edge-handle-left{cursor:w-resize}.a9s-handle.a9s-corner-handle-topleft{cursor:nw-resize}.a9s-handle.a9s-corner-handle-topright{cursor:ne-resize}.a9s-handle.a9s-corner-handle-bottomright{cursor:se-resize}.a9s-handle.a9s-corner-handle-bottomleft{cursor:sw-resize}.a9s-annotationlayer .a9s-outer,div[data-theme=dark] .a9s-annotationlayer .a9s-outer{display:none}.a9s-annotationlayer .a9s-inner,div[data-theme=dark] .a9s-annotationlayer .a9s-inner{fill:#0000001f;stroke:#000;stroke-width:1px}rect.a9s-handle,div[data-theme=dark] rect.a9s-handle{fill:#000;rx:2px}rect.a9s-close-polygon-handle,div[data-theme=dark] rect.a9s-close-polygon-handle{fill:#000;rx:1px}.a9s-annotationlayer .a9s-outer,div[data-theme=light] .a9s-annotationlayer .a9s-outer{display:block;stroke:#00000040;stroke-width:3.5px}.a9s-annotationlayer .a9s-inner,div[data-theme=light] .a9s-annotationlayer .a9s-inner{fill:#ffffff26;stroke:#fff;stroke-width:1.5px}rect.a9s-handle,div[data-theme=light] rect.a9s-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px}rect.a9s-close-polygon-handle,div[data-theme=light] rect.a9s-close-polygon-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px}
@@ -1,37 +1,40 @@
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
- import "./annotorious-react.es6.js";
6
- import "./annotorious-react.es7.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/annotorious";
9
- import { OpenSeadragonAnnotator as B, useViewer as D } from "./annotorious-react.es9.js";
10
- import { OpenSeadragonPopup as G } from "./annotorious-react.es10.js";
11
- import { OpenSeadragonViewer as U } from "./annotorious-react.es11.js";
1
+ import { Annotorious as A, AnnotoriousContext as g, useAnnotation as c, useAnnotationSelectAction as S, useAnnotationStore as f, useAnnotations as x, useAnnotator as l, useAnnotatorUser as I, useSelection as d, useViewportState as y } from "./annotorious-react.es2.js";
2
+ import { AnnotoriousPlugin as O } from "./annotorious-react.es3.js";
3
+ import { Draggable as w } from "./annotorious-react.es4.js";
4
+ import { ImageAnnotator as P } from "./annotorious-react.es5.js";
5
+ /* empty css */
6
+ /* empty css */
7
+ import { Origin as V, UserSelectAction as W, createAnonymousGuest as $, createBody as U, defaultColorProvider as b } from "@annotorious/core";
8
+ import { createImageAnnotator as o, ShapeType as e, W3CImageFormat as t } from "@annotorious/annotorious";
9
+ import { OpenSeadragonAnnotator as B, useViewer as D } from "./annotorious-react.es8.js";
10
+ import { OpenSeadragonPopup as j } from "./annotorious-react.es9.js";
11
+ import { OpenSeadragonViewer as q } from "./annotorious-react.es10.js";
12
+ const p = o, m = e, s = t;
12
13
  export {
13
- n as Annotorious,
14
- a as AnnotoriousContext,
15
- g as AnnotoriousPlugin,
16
- S as Draggable,
17
- d as ImageAnnotator,
14
+ A as Annotorious,
15
+ g as AnnotoriousContext,
16
+ O as AnnotoriousPlugin,
17
+ w as Draggable,
18
+ P as ImageAnnotator,
18
19
  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,
25
- w as createAnonymousGuest,
26
- y as createBody,
27
- h as createImageAnnotator,
28
- C as defaultColorProvider,
29
- p as useAnnotationStore,
30
- i as useAnnotations,
31
- m as useAnnotator,
32
- u as useAnnotatorUser,
33
- s as useSelection,
20
+ j as OpenSeadragonPopup,
21
+ q as OpenSeadragonViewer,
22
+ V as Origin,
23
+ m as ShapeType,
24
+ W as UserSelectAction,
25
+ s as W3CImageFormat,
26
+ $ as createAnonymousGuest,
27
+ U as createBody,
28
+ p as createImageAnnotator,
29
+ b as defaultColorProvider,
30
+ c as useAnnotation,
31
+ S as useAnnotationSelectAction,
32
+ f as useAnnotationStore,
33
+ x as useAnnotations,
34
+ l as useAnnotator,
35
+ I as useAnnotatorUser,
36
+ d as useSelection,
34
37
  D as useViewer,
35
- A as useViewportState
38
+ y as useViewportState
36
39
  };
37
40
  //# 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":["../src/index.ts"],"sourcesContent":["export * from './Annotorious';\nexport * from './AnnotoriousPlugin';\nexport * from './AnnotoriousPopup';\nexport * from './ImageAnnotator';\n\nexport * from './openseadragon';\n\n// This ensures the Annotorious stylesheet gets packaged into annotorious-react\nimport '@annotorious/annotorious/annotorious.css';\nimport '@annotorious/openseadragon/annotorious-openseadragon.css';\n\n// Essential re-exports from @annotorious/core\nexport type {\n Annotation,\n AnnotationBody,\n AnnotationState,\n AnnotationTarget,\n Annotator,\n AnnotatorState,\n Appearance,\n AppearanceProvider,\n Color,\n DrawingStyle,\n DrawingStyleExpression,\n Filter,\n FormatAdapter,\n HoverState,\n LifecycleEvents,\n ParseResult,\n PresentUser,\n Selection,\n SelectionState,\n Store,\n StoreChangeEvent,\n StoreObserver,\n User,\n W3CAnnotation,\n W3CAnnotationBody,\n W3CAnnotationTarget\n} from '@annotorious/core';\n\nimport {\n createAnonymousGuest as _createAnonymousGuest, \n createBody as _createBody,\n defaultColorProvider as _defaultColorProvider,\n Origin as _Origin,\n UserSelectAction as _UserSelectAction\n} from '@annotorious/core';\n\nexport { _createAnonymousGuest as createAnonymousGuest };\nexport { _createBody as createBody };\nexport { _defaultColorProvider as defaultColorProvider };\nexport { _Origin as Origin };\nexport { _UserSelectAction as UserSelectAction };\n\n// Essential re-exports from @annotorious/annotorious \nexport type {\n AnnotoriousOpts,\n DrawingMode,\n DrawingTool,\n FragmentSelector,\n ImageAnnotator as AnnotoriousImageAnnotator,\n ImageAnnotation,\n ImageAnnotatorState,\n Polygon,\n PolygonGeometry,\n Rectangle,\n RectangleGeometry,\n Shape,\n SVGSelector,\n W3CImageAnnotation,\n W3CImageAnnotationTarget,\n W3CImageFormatAdapter, \n W3CImageFormatAdapterOpts\n} from '@annotorious/annotorious';\n\nimport { \n createImageAnnotator as _createImageAnnotator,\n ShapeType as _ShapeType,\n W3CImageFormat as _W3CImageFormat\n} from '@annotorious/annotorious';\n\nexport const createImageAnnotator = _createImageAnnotator;\nexport const ShapeType = _ShapeType;\nexport const W3CImageFormat = _W3CImageFormat;\n\n// Essential re-exports from @annotorious/openseadragon \nexport type {\n OpenSeadragonAnnotator as AnnotoriousOpenSeadragonAnnotator\n} from '@annotorious/openseadragon';\n\nexport type { Viewer } from 'openseadragon';\n"],"names":["createImageAnnotator","_createImageAnnotator","ShapeType","_ShapeType","W3CImageFormat","_W3CImageFormat"],"mappings":";;;;;;;;;;;AAkFO,MAAMA,IAAuBC,GACvBC,IAAYC,GACZC,IAAiBC;"}
@@ -1,39 +1,19 @@
1
- import { jsx as v } from "./annotorious-react.es12.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.es9.js";
5
- import { useSelection as D } from "./annotorious-react.es2.js";
6
- import { setPosition as I } from "./annotorious-react.es17.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));
1
+ import { j as a } from "./annotorious-react.es11.js";
2
+ import { forwardRef as m, useRef as p, useContext as u, useEffect as c, useImperativeHandle as d } from "react";
3
+ import l from "openseadragon";
4
+ import { OpenSeadragonAnnotatorContext as x } from "./annotorious-react.es8.js";
5
+ const S = m((n, s) => {
6
+ const { className: i, options: t } = n, r = p(null), { viewer: f, setViewer: e } = u(x);
12
7
  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
- };
8
+ if (r.current) {
9
+ const o = l({ ...t, element: r.current });
10
+ return e && e(o), () => {
11
+ e && e(void 0), o.destroy();
12
+ };
13
+ }
14
+ }, [JSON.stringify(t)]), d(s, () => f), /* @__PURE__ */ a.jsx("div", { className: i, ref: r });
15
+ });
36
16
  export {
37
- q as OpenSeadragonPopup
17
+ S as OpenSeadragonViewer
38
18
  };
39
19
  //# sourceMappingURL=annotorious-react.es10.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es10.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,IAAI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cesContent":["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 if (setViewer)\n setViewer(undefined);\n\n v.destroy();\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;AACP,QAAAJ,KACFA,EAAU,MAAS,GAErBI,EAAE,QAAQ;AAAA,MAAA;AAAA,IAEd;AAAA,KACC,CAAC,KAAK,UAAUR,CAAO,CAAC,CAAC,GAERU,EAAAZ,GAAK,MAAMK,CAAM,GAGlCQ,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAAZ,GAAsB,KAAKE,EAAS,CAAA;AAG7C,CAAC;"}
@@ -1,19 +1,9 @@
1
- import { jsx as m } from "./annotorious-react.es12.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.es9.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
- });
1
+ import { __module as e } from "./annotorious-react.es15.js";
2
+ import { __require as r } from "./annotorious-react.es16.js";
3
+ import { __require as o } from "./annotorious-react.es17.js";
4
+ process.env.NODE_ENV === "production" ? e.exports = r() : e.exports = o();
5
+ var m = e.exports;
16
6
  export {
17
- S as OpenSeadragonViewer
7
+ m as j
18
8
  };
19
9
  //# sourceMappingURL=annotorious-react.es11.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es11.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
+ {"version":3,"file":"annotorious-react.es11.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;AAEI,QAAQ,IAAI,aAAa,eAC3BA,EAAA,UAAiBC,MAEjBD,EAAA,UAAiBE;;","x_google_ignoreList":[0]}
@@ -1,7 +1,11 @@
1
- import { j as t } from "./annotorious-react.es15.js";
2
- const o = t.Fragment, r = t.jsx;
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
+ };
3
8
  export {
4
- o as Fragment,
5
- r as jsx
9
+ m as useDebounce
6
10
  };
7
11
  //# sourceMappingURL=annotorious-react.es12.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es12.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"annotorious-react.es12.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;"}
@@ -1,11 +1,137 @@
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
- };
1
+ import { useRef as pe, useState as ie, useEffect as se } from "react";
2
+ var Q = { dragStart: !0 }, he = (e, t = {}) => {
3
+ let o, l, { bounds: c, axis: m = "both", gpuAcceleration: f = !0, legacyTranslate: R = !0, transform: M, applyUserSelectHack: N = !0, disabled: $ = !1, ignoreMultitouch: B = !1, recomputeBounds: b = Q, grid: H, position: u, cancel: D, handle: S, defaultClass: E = "neodrag", defaultClassDragging: i = "neodrag-dragging", defaultClassDragged: g = "neodrag-dragged", defaultPosition: U = { x: 0, y: 0 }, onDragStart: ce, onDrag: ue, onDragEnd: fe } = t, Y = !1, x = 0, A = 0, L = 0, T = 0, W = 0, j = 0, { x: q, y: P } = u ? { x: (u == null ? void 0 : u.x) ?? 0, y: (u == null ? void 0 : u.y) ?? 0 } : U;
4
+ J(q, P);
5
+ let y, C, X, F, ee, ne = "", ge = !!u;
6
+ b = { ...Q, ...b };
7
+ let k = /* @__PURE__ */ new Set();
8
+ const G = document.body.style, v = e.classList;
9
+ function J(n = x, a = A) {
10
+ if (!M) {
11
+ if (R) {
12
+ let d = `${+n}px, ${+a}px`;
13
+ return z(e, "transform", f ? `translate3d(${d}, 0)` : `translate(${d})`);
14
+ }
15
+ return z(e, "translate", `${+n}px ${+a}px ${f ? "1px" : ""}`);
16
+ }
17
+ const s = M({ offsetX: n, offsetY: a, rootNode: e });
18
+ V(s) && z(e, "transform", s);
19
+ }
20
+ const K = (n, a) => {
21
+ const s = { offsetX: x, offsetY: A, rootNode: e, currentNode: ee };
22
+ e.dispatchEvent(new CustomEvent(n, { detail: s })), a == null || a(s);
23
+ }, O = addEventListener;
24
+ O("pointerdown", te, !1), O("pointerup", oe, !1), O("pointermove", ae, !1), z(e, "touch-action", "none");
25
+ const re = () => {
26
+ let n = e.offsetWidth / C.width;
27
+ return isNaN(n) && (n = 1), n;
28
+ };
29
+ function te(n) {
30
+ if ($ || n.button === 2) return;
31
+ if (k.add(n.pointerId), B && k.size > 1) return n.preventDefault();
32
+ if (b.dragStart && (y = Z(c, e)), V(S) && V(D) && S === D) throw new Error("`handle` selector can't be same as `cancel` selector");
33
+ if (v.add(E), X = function(r, h) {
34
+ if (!r) return [h];
35
+ if (_(r)) return [r];
36
+ if (Array.isArray(r)) return r;
37
+ const w = h.querySelectorAll(r);
38
+ if (w === null) throw new Error("Selector passed for `handle` option should be child of the element on which the action is applied");
39
+ return Array.from(w.values());
40
+ }(S, e), F = function(r, h) {
41
+ if (!r) return [];
42
+ if (_(r)) return [r];
43
+ if (Array.isArray(r)) return r;
44
+ const w = h.querySelectorAll(r);
45
+ if (w === null) throw new Error("Selector passed for `cancel` option should be child of the element on which the action is applied");
46
+ return Array.from(w.values());
47
+ }(D, e), o = /(both|x)/.test(m), l = /(both|y)/.test(m), le(F, X)) throw new Error("Element being dragged can't be a child of the element on which `cancel` is applied");
48
+ const a = n.composedPath()[0];
49
+ if (!X.some((r) => {
50
+ var h;
51
+ return r.contains(a) || ((h = r.shadowRoot) == null ? void 0 : h.contains(a));
52
+ }) || le(F, [a])) return;
53
+ ee = X.length === 1 ? e : X.find((r) => r.contains(a)), Y = !0, C = e.getBoundingClientRect(), N && (ne = G.userSelect, G.userSelect = "none"), K("neodrag:start", ce);
54
+ const { clientX: s, clientY: d } = n, p = re();
55
+ o && (L = s - q / p), l && (T = d - P / p), y && (W = s - C.left, j = d - C.top);
56
+ }
57
+ function oe(n) {
58
+ k.delete(n.pointerId), Y && (b.dragEnd && (y = Z(c, e)), v.remove(i), v.add(g), N && (G.userSelect = ne), K("neodrag:end", fe), o && (L = x), l && (T = A), Y = !1);
59
+ }
60
+ function ae(n) {
61
+ if (!Y || B && k.size > 1) return;
62
+ b.drag && (y = Z(c, e)), v.add(i), n.preventDefault(), C = e.getBoundingClientRect();
63
+ let a = n.clientX, s = n.clientY;
64
+ const d = re();
65
+ if (y) {
66
+ const p = { left: y.left + W, top: y.top + j, right: y.right + W - C.width, bottom: y.bottom + j - C.height };
67
+ a = de(a, p.left, p.right), s = de(s, p.top, p.bottom);
68
+ }
69
+ if (Array.isArray(H)) {
70
+ let [p, r] = H;
71
+ if (isNaN(+p) || p < 0) throw new Error("1st argument of `grid` must be a valid positive number");
72
+ if (isNaN(+r) || r < 0) throw new Error("2nd argument of `grid` must be a valid positive number");
73
+ let h = a - L, w = s - T;
74
+ [h, w] = me([p / d, r / d], h, w), a = L + h, s = T + w;
75
+ }
76
+ o && (x = Math.round((a - L) * d)), l && (A = Math.round((s - T) * d)), q = x, P = A, K("neodrag", ue), J();
77
+ }
78
+ return { destroy: () => {
79
+ const n = removeEventListener;
80
+ n("pointerdown", te, !1), n("pointerup", oe, !1), n("pointermove", ae, !1);
81
+ }, update: (n) => {
82
+ var s, d;
83
+ m = n.axis || "both", $ = n.disabled ?? !1, B = n.ignoreMultitouch ?? !1, S = n.handle, c = n.bounds, b = n.recomputeBounds ?? Q, D = n.cancel, N = n.applyUserSelectHack ?? !0, H = n.grid, f = n.gpuAcceleration ?? !0, R = n.legacyTranslate ?? !0, M = n.transform;
84
+ const a = v.contains(g);
85
+ v.remove(E, g), E = n.defaultClass ?? "neodrag", i = n.defaultClassDragging ?? "neodrag-dragging", g = n.defaultClassDragged ?? "neodrag-dragged", v.add(E), a && v.add(g), ge && (q = x = ((s = n.position) == null ? void 0 : s.x) ?? x, P = A = ((d = n.position) == null ? void 0 : d.y) ?? A, J());
86
+ } };
87
+ }, de = (e, t, o) => Math.min(Math.max(e, t), o), V = (e) => typeof e == "string", me = ([e, t], o, l) => {
88
+ const c = (m, f) => f === 0 ? 0 : Math.ceil(m / f) * f;
89
+ return [c(o, e), c(l, t)];
90
+ }, le = (e, t) => e.some((o) => t.some((l) => o.contains(l)));
91
+ function Z(e, t) {
92
+ if (e === void 0) return;
93
+ if (_(e)) return e.getBoundingClientRect();
94
+ if (typeof e == "object") {
95
+ const { top: l = 0, left: c = 0, right: m = 0, bottom: f = 0 } = e;
96
+ return { top: l, right: window.innerWidth - m, bottom: window.innerHeight - f, left: c };
97
+ }
98
+ if (e === "parent") return t.parentNode.getBoundingClientRect();
99
+ const o = document.querySelector(e);
100
+ if (o === null) throw new Error("The selector provided for bound doesn't exists in the document.");
101
+ return o.getBoundingClientRect();
102
+ }
103
+ var z = (e, t, o) => e.style.setProperty(t, o), _ = (e) => e instanceof HTMLElement;
104
+ function I(e) {
105
+ return e == null || typeof e == "string" || e instanceof HTMLElement ? e : "current" in e ? e.current : Array.isArray(e) ? e.map((t) => t instanceof HTMLElement ? t : t.current) : void 0;
106
+ }
107
+ function we(e, t = {}) {
108
+ const o = pe(), [l, c] = ie(!1), [m, f] = ie();
109
+ let { onDragStart: R, onDrag: M, onDragEnd: N, handle: $, cancel: B } = t, b = I($), H = I(B);
110
+ function u(i, g) {
111
+ f(i), g == null || g(i);
112
+ }
113
+ function D(i) {
114
+ c(!0), u(i, R);
115
+ }
116
+ function S(i) {
117
+ u(i, M);
118
+ }
119
+ function E(i) {
120
+ c(!1), u(i, N);
121
+ }
122
+ return se(() => {
123
+ if (typeof window > "u") return;
124
+ const i = e.current;
125
+ if (!i) return;
126
+ ({ onDragStart: R, onDrag: M, onDragEnd: N } = t);
127
+ const { update: g, destroy: U } = he(i, { ...t, handle: b, cancel: H, onDragStart: D, onDrag: S, onDragEnd: E });
128
+ return o.current = g, U;
129
+ }, []), se(() => {
130
+ var i;
131
+ (i = o.current) == null || i.call(o, { ...t, handle: I($), cancel: I(B), onDragStart: D, onDrag: S, onDragEnd: E });
132
+ }, [t]), { isDragging: l, dragState: m };
133
+ }
8
134
  export {
9
- m as useDebounce
135
+ we as useDraggable
10
136
  };
11
137
  //# sourceMappingURL=annotorious-react.es13.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotorious-react.es13.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;"}
1
+ {"version":3,"file":"annotorious-react.es13.js","sources":["../../../node_modules/@neodrag/react/dist/min/index.js"],"sourcesContent":["import{useRef as t,useState as e,useEffect as n}from\"react\";var r={dragStart:!0},o=(t,e={})=>{let n,o,{bounds:f,axis:g=\"both\",gpuAcceleration:p=!0,legacyTranslate:h=!0,transform:m,applyUserSelectHack:y=!0,disabled:w=!1,ignoreMultitouch:b=!1,recomputeBounds:v=r,grid:D,position:E,cancel:S,handle:x,defaultClass:A=\"neodrag\",defaultClassDragging:C=\"neodrag-dragging\",defaultClassDragged:M=\"neodrag-dragged\",defaultPosition:N={x:0,y:0},onDragStart:B,onDrag:$,onDragEnd:H}=e,L=!1,R=0,T=0,X=0,Y=0,q=0,P=0,{x:k,y:z}=E?{x:E?.x??0,y:E?.y??0}:N;V(k,z);let I,U,W,j,F,G=\"\",J=!!E;v={...r,...v};let K=new Set;const O=document.body.style,Q=t.classList;function V(e=R,n=T){if(!m){if(h){let r=`${+e}px, ${+n}px`;return c(t,\"transform\",p?`translate3d(${r}, 0)`:`translate(${r})`)}return c(t,\"translate\",`${+e}px ${+n}px ${p?\"1px\":\"\"}`)}const r=m({offsetX:e,offsetY:n,rootNode:t});i(r)&&c(t,\"transform\",r)}const Z=(e,n)=>{const r={offsetX:R,offsetY:T,rootNode:t,currentNode:F};t.dispatchEvent(new CustomEvent(e,{detail:r})),n?.(r)};const _=addEventListener;_(\"pointerdown\",et,!1),_(\"pointerup\",nt,!1),_(\"pointermove\",rt,!1),c(t,\"touch-action\",\"none\");const tt=()=>{let e=t.offsetWidth/U.width;return isNaN(e)&&(e=1),e};function et(e){if(w)return;if(2===e.button)return;if(K.add(e.pointerId),b&&K.size>1)return e.preventDefault();if(v.dragStart&&(I=l(f,t)),i(x)&&i(S)&&x===S)throw new Error(\"`handle` selector can't be same as `cancel` selector\");if(Q.add(A),W=function(t,e){if(!t)return[e];if(u(t))return[t];if(Array.isArray(t))return t;const n=e.querySelectorAll(t);if(null===n)throw new Error(\"Selector passed for `handle` option should be child of the element on which the action is applied\");return Array.from(n.values())}(x,t),j=function(t,e){if(!t)return[];if(u(t))return[t];if(Array.isArray(t))return t;const n=e.querySelectorAll(t);if(null===n)throw new Error(\"Selector passed for `cancel` option should be child of the element on which the action is applied\");return Array.from(n.values())}(S,t),n=/(both|x)/.test(g),o=/(both|y)/.test(g),s(j,W))throw new Error(\"Element being dragged can't be a child of the element on which `cancel` is applied\");const r=e.composedPath()[0];if(!W.some((t=>t.contains(r)||t.shadowRoot?.contains(r)))||s(j,[r]))return;F=1===W.length?t:W.find((t=>t.contains(r))),L=!0,U=t.getBoundingClientRect(),y&&(G=O.userSelect,O.userSelect=\"none\"),Z(\"neodrag:start\",B);const{clientX:a,clientY:d}=e,c=tt();n&&(X=a-k/c),o&&(Y=d-z/c),I&&(q=a-U.left,P=d-U.top)}function nt(e){K.delete(e.pointerId),L&&(v.dragEnd&&(I=l(f,t)),Q.remove(C),Q.add(M),y&&(O.userSelect=G),Z(\"neodrag:end\",H),n&&(X=R),o&&(Y=T),L=!1)}function rt(e){if(!L||b&&K.size>1)return;v.drag&&(I=l(f,t)),Q.add(C),e.preventDefault(),U=t.getBoundingClientRect();let r=e.clientX,i=e.clientY;const s=tt();if(I){const t={left:I.left+q,top:I.top+P,right:I.right+q-U.width,bottom:I.bottom+P-U.height};r=a(r,t.left,t.right),i=a(i,t.top,t.bottom)}if(Array.isArray(D)){let[t,e]=D;if(isNaN(+t)||t<0)throw new Error(\"1st argument of `grid` must be a valid positive number\");if(isNaN(+e)||e<0)throw new Error(\"2nd argument of `grid` must be a valid positive number\");let n=r-X,o=i-Y;[n,o]=d([t/s,e/s],n,o),r=X+n,i=Y+o}n&&(R=Math.round((r-X)*s)),o&&(T=Math.round((i-Y)*s)),k=R,z=T,Z(\"neodrag\",$),V()}return{destroy:()=>{const t=removeEventListener;t(\"pointerdown\",et,!1),t(\"pointerup\",nt,!1),t(\"pointermove\",rt,!1)},update:t=>{g=t.axis||\"both\",w=t.disabled??!1,b=t.ignoreMultitouch??!1,x=t.handle,f=t.bounds,v=t.recomputeBounds??r,S=t.cancel,y=t.applyUserSelectHack??!0,D=t.grid,p=t.gpuAcceleration??!0,h=t.legacyTranslate??!0,m=t.transform;const e=Q.contains(M);Q.remove(A,M),A=t.defaultClass??\"neodrag\",C=t.defaultClassDragging??\"neodrag-dragging\",M=t.defaultClassDragged??\"neodrag-dragged\",Q.add(A),e&&Q.add(M),J&&(k=R=t.position?.x??R,z=T=t.position?.y??T,V())}}},a=(t,e,n)=>Math.min(Math.max(t,e),n),i=t=>\"string\"==typeof t,d=([t,e],n,r)=>{const o=(t,e)=>0===e?0:Math.ceil(t/e)*e;return[o(n,t),o(r,e)]};var s=(t,e)=>t.some((t=>e.some((e=>t.contains(e)))));function l(t,e){if(void 0===t)return;if(u(t))return t.getBoundingClientRect();if(\"object\"==typeof t){const{top:e=0,left:n=0,right:r=0,bottom:o=0}=t;return{top:e,right:window.innerWidth-r,bottom:window.innerHeight-o,left:n}}if(\"parent\"===t)return e.parentNode.getBoundingClientRect();const n=document.querySelector(t);if(null===n)throw new Error(\"The selector provided for bound doesn't exists in the document.\");return n.getBoundingClientRect()}var c=(t,e,n)=>t.style.setProperty(e,n),u=t=>t instanceof HTMLElement;function f(t){return null==t||\"string\"==typeof t||t instanceof HTMLElement?t:\"current\"in t?t.current:Array.isArray(t)?t.map((t=>t instanceof HTMLElement?t:t.current)):void 0}function g(r,a={}){const i=t(),[d,s]=e(!1),[l,c]=e();let{onDragStart:u,onDrag:g,onDragEnd:p,handle:h,cancel:m}=a,y=f(h),w=f(m);function b(t,e){c(t),e?.(t)}function v(t){s(!0),b(t,u)}function D(t){b(t,g)}function E(t){s(!1),b(t,p)}return n((()=>{if(\"undefined\"==typeof window)return;const t=r.current;if(!t)return;({onDragStart:u,onDrag:g,onDragEnd:p}=a);const{update:e,destroy:n}=o(t,{...a,handle:y,cancel:w,onDragStart:v,onDrag:D,onDragEnd:E});return i.current=e,n}),[]),n((()=>{i.current?.({...a,handle:f(h),cancel:f(m),onDragStart:v,onDrag:D,onDragEnd:E})}),[a]),{isDragging:d,dragState:l}}export{g as useDraggable};"],"names":["r","o","t","e","n","f","g","p","h","m","y","w","b","v","D","E","S","x","A","C","M","N","B","$","H","L","R","T","X","Y","q","P","k","z","V","I","U","W","j","F","G","J","K","O","Q","c","i","Z","_","et","nt","rt","tt","l","u","s","_a","a","d","_b"],"mappings":";AAA4D,IAAIA,IAAE,EAAC,WAAU,GAAE,GAAEC,KAAE,CAACC,GAAEC,IAAE,CAAA,MAAK;AAAC,MAAIC,GAAEH,GAAE,EAAC,QAAOI,GAAE,MAAKC,IAAE,QAAO,iBAAgBC,IAAE,IAAG,iBAAgBC,IAAE,IAAG,WAAUC,GAAE,qBAAoBC,IAAE,IAAG,UAASC,IAAE,IAAG,kBAAiBC,IAAE,IAAG,iBAAgBC,IAAEb,GAAE,MAAKc,GAAE,UAASC,GAAE,QAAOC,GAAE,QAAOC,GAAE,cAAaC,IAAE,WAAU,sBAAqBC,IAAE,oBAAmB,qBAAoBC,IAAE,mBAAkB,iBAAgBC,IAAE,EAAC,GAAE,GAAE,GAAE,E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