New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@annotorious/annotorious

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@annotorious/annotorious - npm Package Compare versions

Comparing version
3.7.14-beta
to
3.7.15
+1
-0
dist/model/w3c/fragment/FragmentSelector.d.ts

@@ -7,3 +7,4 @@ import { Rectangle, RectangleGeometry } from '../../core';

}
export declare const isFragmentSelector: (selector: any) => boolean;
export declare const parseFragmentSelector: (fragmentOrSelector: FragmentSelector | string, invertY?: boolean) => Rectangle;
export declare const serializeFragmentSelector: (geometry: RectangleGeometry) => FragmentSelector;
+1
-1

@@ -5,3 +5,3 @@ import { W3CAnnotation, W3CAnnotationTarget } from '@annotorious/core';

export interface W3CImageAnnotation extends W3CAnnotation {
target: W3CImageAnnotationTarget | W3CImageAnnotationTarget[];
target: W3CImageAnnotationTarget | W3CImageAnnotationTarget[] | string;
}

@@ -8,0 +8,0 @@ export interface W3CImageAnnotationTarget extends W3CAnnotationTarget {

{
"name": "@annotorious/annotorious",
"version": "3.7.14-beta",
"version": "3.7.15",
"description": "Add image annotation functionality to any web page with a few lines of JavaScript",

@@ -54,3 +54,3 @@ "author": "Rainer Simon",

"dependencies": {
"@annotorious/core": "3.7.14-beta",
"@annotorious/core": "3.7.15",
"dequal": "^2.0.3",

@@ -57,0 +57,0 @@ "rbush": "^4.0.1",

@@ -14,2 +14,19 @@ import type { Rectangle, RectangleGeometry } from '../../core';

export const isFragmentSelector = (
selector: any
): boolean => {
if (selector?.type === 'FragmentSelector')
return true;
if (typeof selector === 'string') {
const hashIndex = selector.indexOf("#");
if (hashIndex < 0) return false;
const xywh = /^#xywh(?:=(?:pixel:|percent:)?)\s*\d+(\.\d*)?,\s*\d+(\.\d*)?,\s*\d+(\.\d*)?,\s*\d+(\.\d*)?$/i;
return xywh.test(selector);
}
return false;
}
export const parseFragmentSelector = (

@@ -25,2 +42,5 @@ fragmentOrSelector: FragmentSelector | string,

const matches = [...fragment.matchAll(regex)][0];
if (!matches) throw new Error('Not a MediaFragment: ' + fragment);
const [_, prefix, unit, a, b, c, d] = matches;

@@ -27,0 +47,0 @@

@@ -7,3 +7,3 @@ import type { W3CAnnotation, W3CAnnotationTarget } from '@annotorious/core';

target: W3CImageAnnotationTarget | W3CImageAnnotationTarget[];
target: W3CImageAnnotationTarget | W3CImageAnnotationTarget[] | string;

@@ -10,0 +10,0 @@ }

@@ -7,3 +7,3 @@ import { v4 as uuidv4 } from 'uuid';

import type {FragmentSelector } from './fragment';
import { parseFragmentSelector, serializeFragmentSelector } from './fragment';
import { isFragmentSelector, parseFragmentSelector, serializeFragmentSelector } from './fragment';
import type { SVGSelector } from './svg';

@@ -62,3 +62,3 @@ import { parseSVGSelector, serializeSVGSelector } from './svg';

const selector =
typeof w3cSelector === 'string' || w3cSelector?.type === 'FragmentSelector' ?
isFragmentSelector(w3cSelector) ?
parseFragmentSelector(w3cSelector as FragmentSelector, opts.invertY) :

@@ -138,3 +138,3 @@ w3cSelector?.type === 'SvgSelector' ?

if ('annotation' in serialized.target)
if (typeof serialized.target !== 'string' && 'annotation' in serialized.target)
delete serialized.target.annotation;

@@ -141,0 +141,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display