@annotorious/annotorious 3.7.1 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/annotorious",
3
- "version": "3.7.1",
3
+ "version": "3.7.3",
4
4
  "description": "Add image annotation functionality to any web page with a few lines of JavaScript",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -49,7 +49,7 @@
49
49
  "vitest": "^3.2.4"
50
50
  },
51
51
  "dependencies": {
52
- "@annotorious/core": "3.7.1",
52
+ "@annotorious/core": "3.7.3",
53
53
  "dequal": "^2.0.3",
54
54
  "rbush": "^4.0.1",
55
55
  "simplify-js": "^1.2.4",
@@ -1,6 +1,7 @@
1
1
  import { createEventDispatcher } from 'svelte';
2
- import type { SvelteImageAnnotationStore } from '../state';
3
2
  import type { Annotation } from '@annotorious/core';
3
+ import type { SvelteImageAnnotationStore } from '../state';
4
+ import { isTouch } from './utils';
4
5
 
5
6
  export interface SVGAnnotationLayerPointerEvent<T extends Annotation> {
6
7
 
@@ -27,7 +28,8 @@ export const addEventListeners = <T extends Annotation>(svg: SVGSVGElement, stor
27
28
  if (duration < MAX_CLICK_DURATION) {
28
29
  const { x, y } = getSVGPoint(evt, svg);
29
30
 
30
- const annotation = store.getAt(x, y, undefined, 2) as T | undefined;
31
+ const buffer = isTouch ? 10 : 2;
32
+ const annotation = store.getAt(x, y, undefined, buffer) as T | undefined;
31
33
 
32
34
  if (annotation)
33
35
  dispatch('click', { originalEvent: evt, annotation });
@@ -30,13 +30,16 @@
30
30
  class:touched={touched} />
31
31
 
32
32
  <circle
33
- cx={x}
33
+ cx={x}
34
34
  cy={y}
35
35
  r={handleRadius + 10 / scale}
36
36
  class="a9s-handle-buffer"
37
+ role="button"
38
+ tabindex="0"
39
+ on:dblclick
37
40
  on:pointerdown
38
- on:pointerup
39
41
  on:pointerdown={onPointerDown}
42
+ on:pointerup
40
43
  on:pointerup={onPointerUp} />
41
44
 
42
45
  <circle
@@ -76,4 +79,15 @@
76
79
  cy={y}
77
80
  r={handleRadius} />
78
81
  </g>
79
- {/if}
82
+ {/if}
83
+
84
+ <style>
85
+ circle.a9s-handle-buffer:focus {
86
+ outline: none;
87
+ }
88
+
89
+ circle.a9s-handle-buffer:focus-visible {
90
+ stroke: rgba(255, 255, 255, 0.8);
91
+ stroke-width: 3px;
92
+ }
93
+ </style>