@annotorious/annotorious 3.0.0-rc.2 → 3.0.0-rc.20

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 (81) hide show
  1. package/dist/Annotorious.d.ts +7 -2
  2. package/dist/Annotorious.d.ts.map +1 -1
  3. package/dist/AnnotoriousOpts.d.ts +4 -3
  4. package/dist/AnnotoriousOpts.d.ts.map +1 -1
  5. package/dist/annotation/SVGAnnotationLayerPointerEvent.d.ts.map +1 -1
  6. package/dist/annotation/Transform.d.ts.map +1 -1
  7. package/dist/annotation/editors/Handle.svelte.d.ts +1 -0
  8. package/dist/annotation/editors/editorsRegistry.d.ts +1 -1
  9. package/dist/annotation/editors/editorsRegistry.d.ts.map +1 -1
  10. package/dist/annotation/editors/index.d.ts +1 -1
  11. package/dist/annotation/editors/index.d.ts.map +1 -1
  12. package/dist/annotation/tools/drawingToolsRegistry.d.ts +4 -4
  13. package/dist/annotation/tools/drawingToolsRegistry.d.ts.map +1 -1
  14. package/dist/annotation/utils/responsive.d.ts +2 -1
  15. package/dist/annotation/utils/responsive.d.ts.map +1 -1
  16. package/dist/annotation/utils/styling.d.ts +1 -1
  17. package/dist/annotation/utils/styling.d.ts.map +1 -1
  18. package/dist/annotation/utils/touch.d.ts.map +1 -1
  19. package/dist/annotorious.css +1 -1
  20. package/dist/annotorious.es.js +2370 -1991
  21. package/dist/annotorious.es.js.map +1 -1
  22. package/dist/annotorious.js +1 -1
  23. package/dist/annotorious.js.map +1 -1
  24. package/dist/index.d.ts +2 -4
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/keyboardCommands.d.ts +5 -0
  27. package/dist/keyboardCommands.d.ts.map +1 -0
  28. package/dist/model/w3c/W3CImageAnnotation.d.ts +11 -0
  29. package/dist/model/w3c/W3CImageAnnotation.d.ts.map +1 -0
  30. package/dist/model/w3c/W3CImageFormatAdapter.d.ts +3 -2
  31. package/dist/model/w3c/W3CImageFormatAdapter.d.ts.map +1 -1
  32. package/dist/model/w3c/fragment/FragmentSelector.d.ts +1 -2
  33. package/dist/model/w3c/fragment/FragmentSelector.d.ts.map +1 -1
  34. package/dist/model/w3c/index.d.ts +1 -0
  35. package/dist/model/w3c/index.d.ts.map +1 -1
  36. package/dist/model/w3c/svg/SVG.d.ts.map +1 -1
  37. package/dist/model/w3c/svg/SVGSelector.d.ts +1 -2
  38. package/dist/model/w3c/svg/SVGSelector.d.ts.map +1 -1
  39. package/dist/state/ImageAnnotatorState.d.ts.map +1 -1
  40. package/dist/state/spatialTree.d.ts +1 -1
  41. package/dist/state/spatialTree.d.ts.map +1 -1
  42. package/dist/themes/smart/setTheme.d.ts +3 -1
  43. package/dist/themes/smart/setTheme.d.ts.map +1 -1
  44. package/package.json +13 -13
  45. package/src/Annotorious.css +5 -5
  46. package/src/Annotorious.ts +44 -29
  47. package/src/AnnotoriousOpts.ts +11 -6
  48. package/src/annotation/SVGAnnotationLayer.svelte +21 -15
  49. package/src/annotation/SVGAnnotationLayerPointerEvent.ts +1 -2
  50. package/src/annotation/Transform.ts +5 -3
  51. package/src/annotation/editors/Editor.svelte +10 -11
  52. package/src/annotation/editors/EditorMount.svelte +3 -3
  53. package/src/annotation/editors/Handle.svelte +66 -0
  54. package/src/annotation/editors/index.ts +2 -2
  55. package/src/annotation/editors/polygon/PolygonEditor.svelte +16 -16
  56. package/src/annotation/editors/rectangle/RectangleEditor.svelte +46 -43
  57. package/src/annotation/shapes/Ellipse.svelte +2 -2
  58. package/src/annotation/shapes/Polygon.svelte +2 -2
  59. package/src/annotation/shapes/Rectangle.svelte +3 -3
  60. package/src/annotation/tools/ToolMount.svelte +3 -3
  61. package/src/annotation/tools/drawingToolsRegistry.ts +2 -1
  62. package/src/annotation/tools/polygon/RubberbandPolygon.svelte +58 -32
  63. package/src/annotation/tools/rectangle/RubberbandRectangle.svelte +17 -16
  64. package/src/annotation/utils/responsive.ts +1 -1
  65. package/src/annotation/utils/touch.ts +4 -1
  66. package/src/index.ts +25 -8
  67. package/src/keyboardCommands.ts +50 -0
  68. package/src/model/w3c/W3CImageAnnotation.ts +17 -0
  69. package/src/model/w3c/W3CImageFormatAdapter.ts +54 -20
  70. package/src/model/w3c/fragment/FragmentSelector.ts +5 -6
  71. package/src/model/w3c/index.ts +1 -0
  72. package/src/model/w3c/svg/SVG.ts +1 -2
  73. package/src/model/w3c/svg/SVGSelector.ts +11 -13
  74. package/src/state/ImageAnnotatorState.ts +3 -3
  75. package/src/state/spatialTree.ts +3 -2
  76. package/src/themes/dark/index.css +2 -2
  77. package/src/themes/light/index.css +2 -2
  78. package/src/themes/smart/setTheme.ts +10 -6
  79. package/dist/annotation/editors/Handle.d.ts +0 -14
  80. package/dist/annotation/editors/Handle.d.ts.map +0 -1
  81. package/src/annotation/editors/Handle.ts +0 -21
package/src/index.ts CHANGED
@@ -5,16 +5,33 @@ export * from './themes';
5
5
  export * from './annotation/tools';
6
6
  export * from './Annotorious';
7
7
  export * from './AnnotoriousOpts';
8
+ export * from './keyboardCommands';
8
9
 
9
- // Re-export essentials from @annotorious/core utilities for convenience
10
- export * from '@annotorious/core/src/model';
11
- export * from '@annotorious/core/src/presence';
12
- export * from '@annotorious/core/src/utils';
13
-
14
- export type {
10
+ // Essential re-exports from @annotorious/core
11
+ export type {
12
+ Annotation,
13
+ AnnotationBody,
14
+ AnnotationTarget,
15
+ Annotator,
16
+ AnnotatorState,
17
+ Appearance,
18
+ AppearanceProvider,
19
+ Color,
20
+ DrawingStyle,
21
+ Filter,
22
+ FormatAdapter,
15
23
  HoverState,
24
+ LifecycleEvents,
25
+ ParseResult,
26
+ PresentUser,
27
+ Purpose,
16
28
  Selection,
17
29
  SelectionState,
18
30
  Store,
19
- StoreObserver
20
- } from '@annotorious/core/src/state';
31
+ StoreChangeEvent,
32
+ StoreObserver,
33
+ User,
34
+ W3CAnnotation,
35
+ W3CAnnotationBody,
36
+ W3CAnnotationTarget
37
+ } from '@annotorious/core';
@@ -0,0 +1,50 @@
1
+ import type { Annotation, UndoStack } from '@annotorious/core';
2
+
3
+ const isMac = navigator.userAgent.indexOf('Mac OS X') !== -1;
4
+
5
+ export const initKeyboardCommands = <T extends Annotation>(
6
+ undoStack: UndoStack<T>,
7
+ container?: Element
8
+ ) => {
9
+
10
+ const el = container || document;
11
+
12
+ const onWinKeyDown = (evt: Event) => {
13
+ const event = evt as KeyboardEvent;
14
+
15
+ if (event.key === 'z' && event.ctrlKey) {
16
+ undoStack.undo();
17
+ } else if (event.key === 'y' && event.ctrlKey) {
18
+ undoStack.redo()
19
+ }
20
+ };
21
+
22
+ const onMacKeyDown = (evt: Event) => {
23
+ const event = evt as KeyboardEvent;
24
+
25
+ if (event.key === 'z' && event.metaKey) {
26
+ if (event.shiftKey) {
27
+ undoStack.redo()
28
+ } else {
29
+ undoStack.undo();
30
+ }
31
+ }
32
+ }
33
+
34
+ const destroy = () => {
35
+ if (isMac) {
36
+ el.removeEventListener('keydown', onMacKeyDown);
37
+ } else {
38
+ el.removeEventListener('keydown', onWinKeyDown);
39
+ }
40
+ }
41
+
42
+ if (isMac)
43
+ el.addEventListener('keydown', onMacKeyDown);
44
+ else
45
+ el.addEventListener('keydown', onWinKeyDown);
46
+
47
+ return {
48
+ destroy
49
+ }
50
+ }
@@ -0,0 +1,17 @@
1
+ import type { W3CAnnotation, W3CAnnotationTarget } from '@annotorious/core';
2
+ import type { FragmentSelector } from './fragment';
3
+ import type { SVGSelector } from './svg';
4
+
5
+ export interface W3CImageAnnotation extends W3CAnnotation {
6
+
7
+ target: W3CImageAnnotationTarget | W3CImageAnnotationTarget[];
8
+
9
+ }
10
+
11
+ export interface W3CImageAnnotationTarget extends W3CAnnotationTarget {
12
+
13
+ selector: W3CImageSelector | W3CImageSelector[];
14
+
15
+ }
16
+
17
+ export type W3CImageSelector = FragmentSelector | SVGSelector;
@@ -1,14 +1,15 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
- import { parseW3CBodies, serializeW3CBodies } from '@annotorious/core';
2
+ import { parseW3CUser, parseW3CBodies, serializeW3CBodies } from '@annotorious/core';
3
3
  import type { FormatAdapter, ParseResult, W3CAnnotation } from '@annotorious/core';
4
4
  import { ShapeType } from '../core';
5
5
  import type { ImageAnnotation, RectangleGeometry } from '../core';
6
- import type { FragmentSelector } from './fragment';
6
+ import type {FragmentSelector } from './fragment';
7
7
  import { parseFragmentSelector, serializeFragmentSelector } from './fragment';
8
8
  import type { SVGSelector } from './svg';
9
9
  import { parseSVGSelector, serializeSVGSelector } from './svg';
10
+ import type { W3CImageAnnotation } from './W3CImageAnnotation';
10
11
 
11
- export type W3CImageFormatAdapter = FormatAdapter<ImageAnnotation, W3CAnnotation>;
12
+ export type W3CImageFormatAdapter = FormatAdapter<ImageAnnotation, W3CImageAnnotation>;
12
13
 
13
14
  export const W3CImageFormat = (
14
15
  source: string,
@@ -30,30 +31,44 @@ export const parseW3CImageAnnotation = (
30
31
  ): ParseResult<ImageAnnotation> => {
31
32
  const annotationId = annotation.id || uuidv4();
32
33
 
33
- const bodies = parseW3CBodies(annotation.body, annotationId);
34
+ const {
35
+ creator,
36
+ created,
37
+ modified,
38
+ body,
39
+ ...rest
40
+ } = annotation;
34
41
 
35
- const target = Array.isArray(annotation.target) ? annotation.target[0] : annotation.target;
42
+ const bodies = parseW3CBodies(body, annotationId);
36
43
 
37
- const w3cSelector = Array.isArray(target.selector) ? target.selector[0] : target.selector;
44
+ const w3cTarget = Array.isArray(annotation.target)
45
+ ? annotation.target[0] : annotation.target;
46
+
47
+ const w3cSelector = Array.isArray(w3cTarget.selector)
48
+ ? w3cTarget.selector[0] : w3cTarget.selector;
38
49
 
39
50
  const selector =
40
- w3cSelector.type === 'FragmentSelector' ?
51
+ w3cSelector?.type === 'FragmentSelector' ?
41
52
  parseFragmentSelector(w3cSelector as FragmentSelector, invertY) :
42
- w3cSelector.type === 'SvgSelector' ?
53
+ w3cSelector?.type === 'SvgSelector' ?
43
54
  parseSVGSelector(w3cSelector as SVGSelector) : undefined;
44
55
 
45
56
  return selector ? {
46
57
  parsed: {
47
- ...annotation,
58
+ ...rest,
48
59
  id: annotationId,
49
60
  bodies,
50
61
  target: {
62
+ created: created ? new Date(created) : undefined,
63
+ creator: parseW3CUser(creator),
64
+ updated: modified ? new Date(modified) : undefined,
65
+ ...(Array.isArray(rest.target) ? rest.target[0] : rest.target),
51
66
  annotation: annotationId,
52
67
  selector
53
68
  }
54
69
  }
55
70
  } : {
56
- error: Error(`Unknown selector type: ${selector.type}`)
71
+ error: Error(`Invalid selector: ${JSON.stringify(w3cSelector)}`)
57
72
  };
58
73
 
59
74
  }
@@ -61,23 +76,42 @@ export const parseW3CImageAnnotation = (
61
76
  export const serializeW3CImageAnnotation = (
62
77
  annotation: ImageAnnotation,
63
78
  source: string
64
- ): W3CAnnotation => {
65
- const shape = annotation.target.selector;
79
+ ): W3CImageAnnotation => {
80
+ const {
81
+ selector,
82
+ creator,
83
+ created,
84
+ updated,
85
+ updatedBy, // Excluded from serialization
86
+ ...rest
87
+ } = annotation.target;
66
88
 
67
- const selector =
68
- shape.type == ShapeType.RECTANGLE ?
69
- serializeFragmentSelector(shape.geometry as RectangleGeometry) :
70
- serializeSVGSelector(shape);
89
+ const w3CSelector =
90
+ selector.type == ShapeType.RECTANGLE ?
91
+ serializeFragmentSelector(selector.geometry as RectangleGeometry) :
92
+ serializeSVGSelector(selector);
71
93
 
72
- return {
94
+ const serialized = {
73
95
  ...annotation,
74
96
  '@context': 'http://www.w3.org/ns/anno.jsonld',
75
97
  id: annotation.id,
76
98
  type: 'Annotation',
77
99
  body: serializeW3CBodies(annotation.bodies),
100
+ created: created?.toISOString(),
101
+ creator,
102
+ modified: updated?.toISOString(),
78
103
  target: {
104
+ ...rest,
79
105
  source,
80
- selector
106
+ selector: w3CSelector
81
107
  }
82
- };
83
- };
108
+ } as W3CImageAnnotation;
109
+
110
+ // Remove core properties that should not appear in the W3C annotation
111
+ delete serialized.bodies;
112
+
113
+ if ('annotation' in serialized.target)
114
+ delete serialized.target.annotation;
115
+
116
+ return serialized;
117
+ }
@@ -1,15 +1,14 @@
1
- import type { W3CSelector } from '@annotorious/core';
2
- import { ShapeType } from '../../core';
3
1
  import type { Rectangle, RectangleGeometry } from '../../core';
2
+ import { ShapeType } from '../../core';
4
3
 
5
- export interface FragmentSelector extends W3CSelector {
4
+ export interface FragmentSelector {
6
5
 
7
6
  type: 'FragmentSelector';
8
7
 
9
8
  conformsTo: 'http://www.w3.org/TR/media-frags/',
10
9
 
11
10
  value: string;
12
-
11
+
13
12
  }
14
13
 
15
14
  export const parseFragmentSelector = (
@@ -46,7 +45,7 @@ export const parseFragmentSelector = (
46
45
  }
47
46
  }
48
47
  }
49
- };
48
+ }
50
49
 
51
50
  export const serializeFragmentSelector = (geometry: RectangleGeometry): FragmentSelector => {
52
51
  const { x, y, w, h } = geometry;
@@ -56,4 +55,4 @@ export const serializeFragmentSelector = (geometry: RectangleGeometry): Fragment
56
55
  conformsTo: 'http://www.w3.org/TR/media-frags/',
57
56
  value: `xywh=pixel:${x},${y},${w},${h}`
58
57
  };
59
- };
58
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './fragment';
2
2
  export * from './svg';
3
+ export * from './W3CImageAnnotation';
3
4
  export * from './W3CImageFormatAdapter';
@@ -13,8 +13,7 @@ export const sanitize = (doc: Element | Document) => {
13
13
  // Remove script tags
14
14
  const scripts = doc.getElementsByTagName('script');
15
15
 
16
- Array.from(scripts).reverse().forEach(el =>
17
- el.parentNode.removeChild(el));
16
+ Array.from(scripts).reverse().forEach(el => el.parentNode!.removeChild(el));
18
17
 
19
18
  Array.from(doc.querySelectorAll('*')).forEach(cleanEl);
20
19
 
@@ -1,14 +1,13 @@
1
- import type { W3CSelector } from '@annotorious/core';
2
- import { boundsFromPoints, ShapeType } from '../../core';
3
1
  import type { Ellipse, EllipseGeometry, Polygon, PolygonGeometry, Shape } from '../../core';
4
- import { SVG_NAMESPACE, insertSVGNamespace, sanitize } from './SVG';
2
+ import { boundsFromPoints, ShapeType } from '../../core';
3
+ import { insertSVGNamespace, sanitize, SVG_NAMESPACE } from './SVG';
5
4
 
6
- export interface SVGSelector extends W3CSelector {
5
+ export interface SVGSelector {
7
6
 
8
7
  type: 'SvgSelector';
9
8
 
10
9
  value: string;
11
-
10
+
12
11
  }
13
12
 
14
13
  const parseSVGXML = (value: string): Element => {
@@ -29,9 +28,6 @@ const parseSVGXML = (value: string): Element => {
29
28
 
30
29
  const parseSVGPolygon = (value: string): Polygon => {
31
30
  const [a, b, str] = value.match(/(<polygon points=["|'])([^("|')]*)/) || [];
32
-
33
- if (!str) return;
34
-
35
31
  const points = str.split(' ').map((p) => p.split(',').map(parseFloat));
36
32
 
37
33
  return {
@@ -46,10 +42,10 @@ const parseSVGPolygon = (value: string): Polygon => {
46
42
  const parseSVGEllipse = (value: string): Ellipse => {
47
43
  const doc = parseSVGXML(value);
48
44
 
49
- const cx = parseFloat(doc.getAttribute('cx'));
50
- const cy = parseFloat(doc.getAttribute('cy'));
51
- const rx = parseFloat(doc.getAttribute('rx'));
52
- const ry = parseFloat(doc.getAttribute('ry'));
45
+ const cx = parseFloat(doc.getAttribute('cx')!);
46
+ const cy = parseFloat(doc.getAttribute('cy')!);
47
+ const rx = parseFloat(doc.getAttribute('rx')!);
48
+ const ry = parseFloat(doc.getAttribute('ry')!);
53
49
 
54
50
  const bounds = {
55
51
  minX: cx - rx,
@@ -77,10 +73,12 @@ export const parseSVGSelector = <T extends Shape>(valueOrSelector: SVGSelector |
77
73
  return parseSVGPolygon(value) as unknown as T;
78
74
  else if (value.includes('<ellipse '))
79
75
  return parseSVGEllipse(value) as unknown as T;
76
+ else
77
+ throw 'Unsupported SVG shape: ' + value;
80
78
  }
81
79
 
82
80
  export const serializeSVGSelector = (shape: Shape): SVGSelector => {
83
- let value: string;
81
+ let value: string | undefined;
84
82
 
85
83
  if (shape.type === ShapeType.POLYGON) {
86
84
  const geom = shape.geometry as PolygonGeometry;
@@ -44,11 +44,11 @@ export const createImageAnnotatorState = <E extends unknown>(
44
44
  const viewport = createViewportState();
45
45
 
46
46
  store.observe(({ changes }) => {
47
- tree.set(changes.created.map(a => a.target as ImageAnnotationTarget), false);
47
+ tree.set((changes.created || []).map(a => a.target as ImageAnnotationTarget), false);
48
48
 
49
- changes.deleted.forEach(a => tree.remove(a.target as ImageAnnotationTarget));
49
+ (changes.deleted || []).forEach(a => tree.remove(a.target as ImageAnnotationTarget));
50
50
 
51
- changes.updated.forEach(({ oldValue, newValue }) =>
51
+ (changes.updated || []).forEach(({ oldValue, newValue }) =>
52
52
  tree.update(oldValue.target, newValue.target));
53
53
  });
54
54
 
@@ -40,7 +40,8 @@ export const createSpatialTree = () => {
40
40
 
41
41
  const remove = (target: ImageAnnotationTarget) => {
42
42
  const item = index.get(target.annotation);
43
- tree.remove(item);
43
+ if (item)
44
+ tree.remove(item);
44
45
  index.delete(target.annotation);
45
46
  };
46
47
 
@@ -62,7 +63,7 @@ export const createSpatialTree = () => {
62
63
  tree.load(indexedTargets);
63
64
  };
64
65
 
65
- const getAt = (x: number, y: number): ImageAnnotationTarget | null => {
66
+ const getAt = (x: number, y: number): ImageAnnotationTarget | undefined => {
66
67
  const idxHits = tree.search({
67
68
  minX: x,
68
69
  minY: y,
@@ -11,8 +11,8 @@ div[data-theme="dark"] .a9s-annotationlayer .a9s-inner {
11
11
  stroke-width: 1px;
12
12
  }
13
13
 
14
- rect.a9s-corner-handle,
15
- div[data-theme="dark"] rect.a9s-corner-handle {
14
+ rect.a9s-handle,
15
+ div[data-theme="dark"] rect.a9s-handle {
16
16
  fill: #000;
17
17
  rx: 2px;
18
18
  }
@@ -13,8 +13,8 @@ div[data-theme="light"] .a9s-annotationlayer .a9s-inner {
13
13
  stroke-width: 1.5px;
14
14
  }
15
15
 
16
- rect.a9s-corner-handle,
17
- div[data-theme="light"] rect.a9s-corner-handle {
16
+ rect.a9s-handle,
17
+ div[data-theme="light"] rect.a9s-handle {
18
18
  fill: #fff;
19
19
  rx: 1px;
20
20
  stroke: rgba(0, 0, 0, 0.45);
@@ -1,3 +1,5 @@
1
+ import type { Theme } from '../../AnnotoriousOpts';
2
+
1
3
  export const sampleBrightness = (imageOrCanvas: HTMLElement) => {
2
4
 
3
5
  let canvas: HTMLCanvasElement;
@@ -6,7 +8,7 @@ export const sampleBrightness = (imageOrCanvas: HTMLElement) => {
6
8
 
7
9
  if (imageOrCanvas.nodeName === 'CANVAS') {
8
10
  canvas = imageOrCanvas as HTMLCanvasElement;
9
- context = canvas.getContext('2d', { willReadFrequently: true });
11
+ context = canvas.getContext('2d', { willReadFrequently: true })!;
10
12
  } else {
11
13
  const img = imageOrCanvas as HTMLImageElement;
12
14
  // Copy image to in-memory canvas for processing
@@ -14,7 +16,7 @@ export const sampleBrightness = (imageOrCanvas: HTMLElement) => {
14
16
  canvas.width = img.width;
15
17
  canvas.height = img.height;
16
18
 
17
- context = canvas.getContext('2d', { willReadFrequently: true });
19
+ context = canvas.getContext('2d', { willReadFrequently: true })!;
18
20
  context.drawImage(img, 0, 0, img.width, img.height);
19
21
  }
20
22
 
@@ -35,12 +37,14 @@ export const sampleBrightness = (imageOrCanvas: HTMLElement) => {
35
37
  return totalBrightness / 81;
36
38
  }
37
39
 
38
- export const setTheme = (imageOrCanvas: HTMLElement, container: HTMLElement) => {
40
+ export const detectTheme = (imageOrCanvas: HTMLElement) => {
39
41
  const brightness = sampleBrightness(imageOrCanvas);
40
-
41
42
  const theme = brightness > 0.6 ? 'dark' : 'light'
42
43
 
43
44
  console.log(`[Annotorious] Image brightness: ${brightness.toFixed(1)}. Setting ${theme} theme.`);
44
45
 
45
- container.setAttribute('data-theme', theme);
46
- }
46
+ return theme;
47
+ }
48
+
49
+ export const setTheme = (imageOrCanvas: HTMLElement, container: HTMLElement, theme: Theme) =>
50
+ container.setAttribute('data-theme', theme === 'auto' ? detectTheme(imageOrCanvas) : theme);
@@ -1,14 +0,0 @@
1
- export type Handle = string;
2
- export declare const Handle: {
3
- (value: string | number): string;
4
- SHAPE: string;
5
- TOP: string;
6
- RIGHT: string;
7
- BOTTOM: string;
8
- LEFT: string;
9
- TOP_LEFT: string;
10
- TOP_RIGHT: string;
11
- BOTTOM_RIGHT: string;
12
- BOTTOM_LEFT: string;
13
- };
14
- //# sourceMappingURL=Handle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Handle.d.ts","sourceRoot":"","sources":["../../../src/annotation/editors/Handle.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,eAAO,MAAM,MAAM;YAAW,MAAM,GAAG,MAAM;;;;;;;;;;CAAsB,CAAC"}
@@ -1,21 +0,0 @@
1
- export type Handle = string;
2
-
3
- export const Handle = (value: string | number) => `HANDLE-${value}`;
4
-
5
- Handle.SHAPE = 'SHAPE';
6
-
7
- Handle.TOP = 'TOP';
8
-
9
- Handle.RIGHT = 'RIGHT';
10
-
11
- Handle.BOTTOM = 'BOTTOM';
12
-
13
- Handle.LEFT = 'LEFT';
14
-
15
- Handle.TOP_LEFT = 'TOP_LEFT';
16
-
17
- Handle.TOP_RIGHT = 'TOP_RIGHT';
18
-
19
- Handle.BOTTOM_RIGHT = 'BOTTOM_RIGHT';
20
-
21
- Handle.BOTTOM_LEFT = 'BOTTOM_LEFT';