@annotorious/annotorious 3.7.13 → 3.7.14-beta

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.13",
3
+ "version": "3.7.14-beta",
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",
@@ -16,7 +16,9 @@
16
16
  },
17
17
  "scripts": {
18
18
  "start": "vite",
19
- "build": "vite build",
19
+ "build:es": "vite build",
20
+ "build:umd": "vite build --config vite.config.umd.js",
21
+ "build": "npm run build:es && npm run build:umd",
20
22
  "preview": "vite preview",
21
23
  "test": "vitest"
22
24
  },
@@ -49,7 +51,7 @@
49
51
  "vitest": "^3.2.4"
50
52
  },
51
53
  "dependencies": {
52
- "@annotorious/core": "3.7.13",
54
+ "@annotorious/core": "3.7.14-beta",
53
55
  "dequal": "^2.0.3",
54
56
  "rbush": "^4.0.1",
55
57
  "simplify-js": "^1.2.4",
@@ -17,7 +17,7 @@
17
17
 
18
18
  let editorComponent: SvelteComponent;
19
19
 
20
- $: computedStyle = computeStyle(annotation, style);
20
+ $: computedStyle = computeStyle(annotation, style, { selected: true, hovered: true });
21
21
 
22
22
  $: if (annotation) editorComponent?.$set({ shape: annotation.target.selector });
23
23
  $: if (editorComponent) editorComponent.$set({ transform });
@@ -1,11 +1,12 @@
1
- import type { DrawingStyleExpression } from '@annotorious/core';
1
+ import type { AnnotationState, DrawingStyleExpression } from '@annotorious/core';
2
2
  import type { ImageAnnotation } from '../../model';
3
3
 
4
4
  export const computeStyle = (
5
5
  annotation: ImageAnnotation,
6
- style?: DrawingStyleExpression<ImageAnnotation>
6
+ style?: DrawingStyleExpression<ImageAnnotation>,
7
+ state?: AnnotationState
7
8
  ) => {
8
- const computed = typeof style === 'function' ? style(annotation) : style;
9
+ const computed = typeof style === 'function' ? style(annotation, state) : style;
9
10
 
10
11
  if (computed) {
11
12
  const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity } = computed;