@annotorious/annotorious 3.0.15 → 3.0.17
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/dist/AnnotoriousOpts.d.ts +2 -1
- package/dist/annotorious.es.js +698 -696
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
- package/src/Annotorious.ts +1 -1
- package/src/AnnotoriousOpts.ts +3 -1
- package/src/annotation/SVGAnnotationLayer.svelte +1 -1
- package/src/index.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export * from './annotation/tools';
|
|
|
6
6
|
export * from './Annotorious';
|
|
7
7
|
export * from './AnnotoriousOpts';
|
|
8
8
|
export * from './keyboardCommands';
|
|
9
|
-
export type { Annotation, AnnotationBody, AnnotationTarget, Annotator, AnnotatorState, Appearance, AppearanceProvider, Color, DrawingStyle, Filter, FormatAdapter, HoverState, LifecycleEvents, ParseResult, PresentUser, Selection, SelectionState, Store, StoreChangeEvent, StoreObserver, User, W3CAnnotation, W3CAnnotationBody, W3CAnnotationTarget } from '@annotorious/core';
|
|
9
|
+
export type { Annotation, AnnotationBody, AnnotationTarget, Annotator, AnnotatorState, Appearance, AppearanceProvider, ChangeSet, Color, DrawingStyle, Filter, FormatAdapter, HoverState, LifecycleEvents, ParseResult, PresentUser, Selection, SelectionState, Store, StoreChangeEvent, StoreObserver, User, W3CAnnotation, W3CAnnotationBody, W3CAnnotationTarget } from '@annotorious/core';
|
|
10
10
|
export { chainStyles, computeStyle, createBody, defaultColorProvider, UserSelectAction } from '@annotorious/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annotorious/annotorious",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.17",
|
|
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": "^2.1.6"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@annotorious/core": "3.0.
|
|
52
|
+
"@annotorious/core": "3.0.17",
|
|
53
53
|
"rbush": "^4.0.1",
|
|
54
54
|
"uuid": "^11.0.3"
|
|
55
55
|
}
|
package/src/Annotorious.ts
CHANGED
|
@@ -64,7 +64,7 @@ export const createImageAnnotator = <I extends Annotation = ImageAnnotation, E e
|
|
|
64
64
|
|
|
65
65
|
const { selection, store } = state;
|
|
66
66
|
|
|
67
|
-
const undoStack = createUndoStack(store);
|
|
67
|
+
const undoStack = createUndoStack(store, opts.initialHistory);
|
|
68
68
|
|
|
69
69
|
const lifecycle = createLifecycleObserver<I, E>(
|
|
70
70
|
state, undoStack, opts.adapter, opts.autoSave
|
package/src/AnnotoriousOpts.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Annotation, DrawingStyleExpression, FormatAdapter, UserSelectActionExpression } from '@annotorious/core';
|
|
1
|
+
import type { Annotation, ChangeSet, DrawingStyleExpression, FormatAdapter, UserSelectActionExpression } from '@annotorious/core';
|
|
2
2
|
import type { ImageAnnotation } from './model';
|
|
3
3
|
|
|
4
4
|
export interface AnnotoriousOpts<I extends Annotation = ImageAnnotation, E extends unknown = ImageAnnotation> {
|
|
@@ -13,6 +13,8 @@ export interface AnnotoriousOpts<I extends Annotation = ImageAnnotation, E exten
|
|
|
13
13
|
// 'drag': starts drawing on drag, single click always selects
|
|
14
14
|
drawingMode?: DrawingMode;
|
|
15
15
|
|
|
16
|
+
initialHistory?: ChangeSet<I>[];
|
|
17
|
+
|
|
16
18
|
// Modal selection mode WILL NOT CHANGE OR DE-SELECT THE CURRENT SELECTION if another
|
|
17
19
|
// annotation or empty space is clicked. Warning: this means that the user is no longer
|
|
18
20
|
// able to de-select until a programmatic de-select is triggered from the host app!
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" generics="I extends Annotation, E extends unknown">
|
|
2
|
-
import { SvelteComponent, onMount } from 'svelte';
|
|
2
|
+
import { type SvelteComponent, onMount } from 'svelte';
|
|
3
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
4
4
|
import type { Annotation, DrawingStyleExpression, StoreChangeEvent, User } from '@annotorious/core';
|
|
5
5
|
import { isImageAnnotation, ShapeType } from '../model';
|