@annotorious/annotorious 3.7.20 → 3.7.22

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.20",
3
+ "version": "3.7.22",
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",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@sveltejs/vite-plugin-svelte": "^3.1.2",
47
- "@tsconfig/svelte": "^5.0.7",
47
+ "@tsconfig/svelte": "^5.0.8",
48
48
  "@types/rbush": "^4.0.0",
49
49
  "jsdom": "^28.1.0",
50
50
  "svelte": "^4.2.20",
@@ -55,7 +55,7 @@
55
55
  "vitest": "^3.2.4"
56
56
  },
57
57
  "dependencies": {
58
- "@annotorious/core": "3.7.20",
58
+ "@annotorious/core": "3.7.22",
59
59
  "dequal": "^2.0.3",
60
60
  "rbush": "^4.0.1",
61
61
  "simplify-js": "^1.2.4",
@@ -21,7 +21,7 @@ export const isFragmentSelector = (
21
21
  const hashIndex = selector.indexOf('#');
22
22
  if (hashIndex < 0) return false;
23
23
 
24
- const xywh = /^#xywh(?:=(?:pixel:|percent:)?)\s*\d+(\.\d*)?,\s*\d+(\.\d*)?,\s*\d+(\.\d*)?,\s*\d+(\.\d*)?$/i;
24
+ const xywh = /#xywh(?:=(?:pixel:|percent:)?)(.+?),(.+?),(.+?),(.+)$/i;
25
25
  return xywh.test(selector);
26
26
  }
27
27
 
@@ -35,8 +35,7 @@ export const parseFragmentSelector = (
35
35
  const fragment =
36
36
  typeof fragmentOrSelector === 'string' ? fragmentOrSelector : fragmentOrSelector.value;
37
37
 
38
- const regex = /(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g;
39
-
38
+ const regex = /(xywh)=(?:(pixel|percent):)?:?(.+?),(.+?),(.+?),(.+)*/g;
40
39
  const matches = [...fragment.matchAll(regex)][0];
41
40
 
42
41
  if (!matches) throw new Error('Not a MediaFragment: ' + fragment);