@annotorious/annotorious
Advanced tools
@@ -1,4 +0,4 @@ | ||
| import type { DrawingStyle } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression } from '@annotorious/core'; | ||
| import type { ImageAnnotation } from '../../model'; | ||
| export declare const computeStyle: (annotation: ImageAnnotation, style?: DrawingStyle | ((a: ImageAnnotation) => DrawingStyle) | undefined) => string | undefined; | ||
| export declare const computeStyle: (annotation: ImageAnnotation, style?: DrawingStyleExpression<ImageAnnotation>) => string | undefined; | ||
| //# sourceMappingURL=styling.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"styling.d.ts","sourceRoot":"","sources":["../../../src/annotation/utils/styling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,YAAY,eAAgB,eAAe,8BAA8B,eAAe,KAAK,YAAY,oCAerH,CAAA"} | ||
| {"version":3,"file":"styling.d.ts","sourceRoot":"","sources":["../../../src/annotation/utils/styling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,YAAY,eACX,eAAe,UACnB,uBAAuB,eAAe,CAAC,uBAgBhD,CAAA"} |
@@ -1,1 +0,1 @@ | ||
| .a9s-touch-halo.svelte-1sgkh33{fill:transparent;stroke-width:0}.a9s-touch-halo.touched.svelte-1sgkh33{fill:#ffffff40}.a9s-annotationlayer{box-sizing:border-box;height:100%;left:0;outline:none;position:absolute;top:0;touch-action:none;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-annotationlayer ellipse,.a9s-annotationlayer polygon,.a9s-annotationlayer rect{fill:transparent;shape-rendering:geometricPrecision;vector-effect:non-scaling-stroke}.a9s-edge-handle{fill:transparent;stroke:transparent;stroke-width:6px}.a9s-shape-handle,.a9s-handle{cursor:move}.a9s-edge-handle-top{cursor:n-resize}.a9s-edge-handle-right{cursor:e-resize}.a9s-edge-handle-bottom{cursor:s-resize}.a9s-edge-handle-left{cursor:w-resize}.a9s-handle.a9s-corner-handle-topleft{cursor:nw-resize}.a9s-handle.a9s-corner-handle-topright{cursor:ne-resize}.a9s-handle.a9s-corner-handle-bottomright{cursor:se-resize}.a9s-handle.a9s-corner-handle-bottomleft{cursor:sw-resize}.a9s-annotationlayer .a9s-outer,div[data-theme=dark] .a9s-annotationlayer .a9s-outer{display:none}.a9s-annotationlayer .a9s-inner,div[data-theme=dark] .a9s-annotationlayer .a9s-inner{fill:#0000001f;stroke:#000;stroke-width:1px}rect.a9s-handle,div[data-theme=dark] rect.a9s-handle{fill:#000;rx:2px}rect.a9s-close-polygon-handle,div[data-theme=dark] rect.a9s-close-polygon-handle{fill:#000;rx:1px}.a9s-annotationlayer .a9s-outer,div[data-theme=light] .a9s-annotationlayer .a9s-outer{display:block;stroke:#00000040;stroke-width:3.5px}.a9s-annotationlayer .a9s-inner,div[data-theme=light] .a9s-annotationlayer .a9s-inner{fill:#ffffff26;stroke:#fff;stroke-width:1.5px}rect.a9s-handle,div[data-theme=light] rect.a9s-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px}rect.a9s-close-polygon-handle,div[data-theme=light] rect.a9s-close-polygon-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px} | ||
| .a9s-touch-halo.svelte-1sgkh33{fill:transparent;stroke-width:0}.a9s-touch-halo.touched.svelte-1sgkh33{fill:#ffffff40}.a9s-annotationlayer{box-sizing:border-box;height:100%;left:0;outline:none;position:absolute;top:0;touch-action:none;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.a9s-annotationlayer.hidden{display:none}.a9s-annotationlayer ellipse,.a9s-annotationlayer polygon,.a9s-annotationlayer rect{fill:transparent;shape-rendering:geometricPrecision;vector-effect:non-scaling-stroke}.a9s-edge-handle{fill:transparent;stroke:transparent;stroke-width:6px}.a9s-shape-handle,.a9s-handle{cursor:move}.a9s-edge-handle-top{cursor:n-resize}.a9s-edge-handle-right{cursor:e-resize}.a9s-edge-handle-bottom{cursor:s-resize}.a9s-edge-handle-left{cursor:w-resize}.a9s-handle.a9s-corner-handle-topleft{cursor:nw-resize}.a9s-handle.a9s-corner-handle-topright{cursor:ne-resize}.a9s-handle.a9s-corner-handle-bottomright{cursor:se-resize}.a9s-handle.a9s-corner-handle-bottomleft{cursor:sw-resize}.a9s-annotationlayer .a9s-outer,div[data-theme=dark] .a9s-annotationlayer .a9s-outer{display:none}.a9s-annotationlayer .a9s-inner,div[data-theme=dark] .a9s-annotationlayer .a9s-inner{fill:#0000001f;stroke:#000;stroke-width:1px}rect.a9s-handle,div[data-theme=dark] rect.a9s-handle{fill:#000;rx:2px}rect.a9s-close-polygon-handle,div[data-theme=dark] rect.a9s-close-polygon-handle{fill:#000;rx:1px}.a9s-annotationlayer .a9s-outer,div[data-theme=light] .a9s-annotationlayer .a9s-outer{display:block;stroke:#00000040;stroke-width:3.5px}.a9s-annotationlayer .a9s-inner,div[data-theme=light] .a9s-annotationlayer .a9s-inner{fill:#ffffff26;stroke:#fff;stroke-width:1.5px}rect.a9s-handle,div[data-theme=light] rect.a9s-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px}rect.a9s-close-polygon-handle,div[data-theme=light] rect.a9s-close-polygon-handle{fill:#fff;rx:1px;stroke:#00000073;stroke-width:1px} |
| import type { SvelteComponent } from 'svelte'; | ||
| import { type Annotator } from '@annotorious/core'; | ||
| import type { Annotator } from '@annotorious/core'; | ||
| import { type DrawingTool } from './annotation/tools'; | ||
@@ -4,0 +4,0 @@ import type { DrawingToolOpts } from './annotation'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"Annotorious.d.ts","sourceRoot":"","sources":["../src/Annotorious.ts"],"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version": "3.0.0-rc.21", | ||
| "version": "3.0.0-rc.22", | ||
| "description": "Add image annotation functionality to any web page with a few lines of JavaScript", | ||
@@ -40,3 +40,3 @@ "author": "Rainer Simon", | ||
| "@sveltejs/vite-plugin-svelte": "^3.0.2", | ||
| "@tsconfig/svelte": "^5.0.2", | ||
| "@tsconfig/svelte": "^5.0.4", | ||
| "@types/rbush": "^3.0.3", | ||
@@ -46,4 +46,4 @@ "jsdom": "^24.0.0", | ||
| "svelte-preprocess": "^5.1.3", | ||
| "typescript": "^5.3.3", | ||
| "vite": "^5.2.2", | ||
| "typescript": "^5.4.3", | ||
| "vite": "^5.2.6", | ||
| "vite-plugin-dts": "^3.7.3", | ||
@@ -53,6 +53,6 @@ "vitest": "^1.4.0" | ||
| "dependencies": { | ||
| "@annotorious/core": "^3.0.0-rc.20", | ||
| "@annotorious/core": "3.0.0-rc.22", | ||
| "rbush": "^3.0.1", | ||
| "uuid": "^9.0.1" | ||
| } | ||
| } | ||
| } |
| <script lang="ts"> | ||
| import type { DrawingStyle } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression } from '@annotorious/core'; | ||
| import { createEventDispatcher, onMount, type SvelteComponent } from 'svelte'; | ||
@@ -13,3 +13,3 @@ import type { ImageAnnotation, Shape } from '../../model'; | ||
| export let editor: typeof SvelteComponent; | ||
| export let style: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle) | undefined; | ||
| export let style: DrawingStyleExpression<ImageAnnotation> | undefined; | ||
| export let target: SVGGElement; | ||
@@ -16,0 +16,0 @@ export let transform: Transform; |
| <script lang="ts"> | ||
| import type { DrawingStyle } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression } from '@annotorious/core'; | ||
| import type { Geometry, EllipseGeometry, ImageAnnotation } from '../../model'; | ||
@@ -9,3 +9,3 @@ import { computeStyle } from '../utils/styling'; | ||
| export let geom: Geometry; | ||
| export let style: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle) | undefined; | ||
| export let style: DrawingStyleExpression<ImageAnnotation> | undefined; | ||
@@ -12,0 +12,0 @@ $: computedStyle = computeStyle(annotation, style); |
| <script lang="ts"> | ||
| import type { DrawingStyle } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression } from '@annotorious/core'; | ||
| import type { Geometry, ImageAnnotation, PolygonGeometry } from '../../model'; | ||
@@ -9,3 +9,3 @@ import { computeStyle } from '../utils/styling'; | ||
| export let geom: Geometry; | ||
| export let style: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle) | undefined; | ||
| export let style: DrawingStyleExpression<ImageAnnotation> | undefined; | ||
@@ -12,0 +12,0 @@ $: computedStyle = computeStyle(annotation, style); |
| <script lang="ts"> | ||
| import type { DrawingStyle } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression } from '@annotorious/core'; | ||
| import type { Geometry, ImageAnnotation, RectangleGeometry } from '../../model'; | ||
@@ -9,3 +9,3 @@ import { computeStyle } from '../utils/styling'; | ||
| export let geom: Geometry; | ||
| export let style: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle) | undefined; | ||
| export let style: DrawingStyleExpression<ImageAnnotation> | undefined; | ||
@@ -12,0 +12,0 @@ $: computedStyle = computeStyle(annotation, style); |
| <script lang="ts"> | ||
| import { SvelteComponent, onMount } from 'svelte'; | ||
| import { v4 as uuidv4 } from 'uuid'; | ||
| import type { DrawingStyle, StoreChangeEvent, User } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression, StoreChangeEvent, User } from '@annotorious/core'; | ||
| import { ShapeType } from '../model'; | ||
@@ -21,5 +21,6 @@ import type { ImageAnnotation, Shape} from '../model'; | ||
| export let state: SvelteImageAnnotatorState; | ||
| export let style: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle) | undefined = undefined; | ||
| export let style: DrawingStyleExpression<ImageAnnotation> | undefined = undefined; | ||
| export let toolName: string = listDrawingTools()[0]; | ||
| export let user: User; | ||
| export let visible = true; | ||
@@ -126,2 +127,3 @@ $: ({ tool, opts } = getTool(toolName) || { tool: undefined, opts: undefined }); | ||
| class:drawing={tool} | ||
| class:hidden={!visible} | ||
| on:pointerup={onPointerUp} | ||
@@ -128,0 +130,0 @@ on:pointerdown={onPointerDown}> |
@@ -1,5 +0,8 @@ | ||
| import type { DrawingStyle } from '@annotorious/core'; | ||
| import type { DrawingStyleExpression } from '@annotorious/core'; | ||
| import type { ImageAnnotation } from '../../model'; | ||
| export const computeStyle = (annotation: ImageAnnotation, style?: DrawingStyle | ((a: ImageAnnotation) => DrawingStyle)) => { | ||
| export const computeStyle = ( | ||
| annotation: ImageAnnotation, | ||
| style?: DrawingStyleExpression<ImageAnnotation> | ||
| ) => { | ||
| const computed = typeof style === 'function' ? style(annotation) : style; | ||
@@ -6,0 +9,0 @@ |
@@ -22,2 +22,6 @@ /** | ||
| .a9s-annotationlayer.hidden { | ||
| display: none; | ||
| } | ||
| .a9s-annotationlayer ellipse, | ||
@@ -24,0 +28,0 @@ .a9s-annotationlayer polygon, |
| import type { SvelteComponent } from 'svelte'; | ||
| import { PointerSelectAction, type Annotator, type DrawingStyle, type Filter, type User } from '@annotorious/core'; | ||
| import { PointerSelectAction } from '@annotorious/core'; | ||
| import type { Annotator, DrawingStyleExpression, Filter, User } from '@annotorious/core'; | ||
| import { createAnonymousGuest, createBaseAnnotator, createLifecyleObserver, createUndoStack } from '@annotorious/core'; | ||
@@ -145,3 +146,3 @@ import { registerEditor } from './annotation/editors'; | ||
| const setStyle = (style: DrawingStyle | ((annotation: ImageAnnotation) => DrawingStyle) | undefined) => | ||
| const setStyle = (style: DrawingStyleExpression<ImageAnnotation> | undefined) => | ||
| annotationLayer.$set({ style }); | ||
@@ -156,2 +157,6 @@ | ||
| const setVisible = (visible: boolean) => | ||
| // @ts-ignore | ||
| annotationLayer.$set({ visible }); | ||
| return { | ||
@@ -172,2 +177,3 @@ ...base, | ||
| setUser, | ||
| setVisible, | ||
| state | ||
@@ -174,0 +180,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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
884846
0.15%6017
0.37%+ Added
- Removed
- Removed
- Removed