@annotorious/core 3.0.0-rc.9 → 3.0.1
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/annotorious-core.es.js +555 -500
- package/dist/annotorious-core.es.js.map +1 -1
- package/dist/lifecycle/Lifecycle.d.ts +8 -8
- package/dist/lifecycle/Lifecycle.d.ts.map +1 -1
- package/dist/lifecycle/LifecycleEvents.d.ts +1 -1
- package/dist/model/Annotation.d.ts +4 -3
- package/dist/model/Annotation.d.ts.map +1 -1
- package/dist/model/AnnotationState.d.ts +8 -0
- package/dist/model/AnnotationState.d.ts.map +1 -0
- package/dist/model/Annotator.d.ts +27 -24
- package/dist/model/Annotator.d.ts.map +1 -1
- package/dist/model/DrawingStyle.d.ts +4 -0
- package/dist/model/DrawingStyle.d.ts.map +1 -1
- package/dist/model/Filter.d.ts +1 -1
- package/dist/model/FormatAdapter.d.ts +3 -3
- package/dist/model/FormatAdapter.d.ts.map +1 -1
- package/dist/model/W3CAnnotation.d.ts +17 -13
- package/dist/model/W3CAnnotation.d.ts.map +1 -1
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/presence/AppearanceProvider.d.ts +4 -4
- package/dist/presence/PresenceEvents.d.ts +1 -1
- package/dist/presence/PresenceProvider.d.ts +1 -1
- package/dist/presence/PresenceState.d.ts +5 -5
- package/dist/presence/PresentUser.d.ts +2 -2
- package/dist/state/Hover.d.ts +6 -31
- package/dist/state/Hover.d.ts.map +1 -1
- package/dist/state/Selection.d.ts +20 -41
- package/dist/state/Selection.d.ts.map +1 -1
- package/dist/state/Store.d.ts +21 -17
- package/dist/state/Store.d.ts.map +1 -1
- package/dist/state/StoreObserver.d.ts +1 -1
- package/dist/state/StoreObserver.d.ts.map +1 -1
- package/dist/state/SvelteStore.d.ts +3 -29
- package/dist/state/SvelteStore.d.ts.map +1 -1
- package/dist/state/UndoStack.d.ts +5 -31
- package/dist/state/UndoStack.d.ts.map +1 -1
- package/dist/state/Viewport.d.ts +1 -1
- package/dist/utils/annotationUtils.d.ts +3 -3
- package/dist/utils/annotationUtils.d.ts.map +1 -1
- package/dist/utils/diffAnnotations.d.ts +2 -2
- package/dist/utils/diffAnnotations.d.ts.map +1 -1
- package/package.json +16 -14
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type { StoreChangeEvent } from './StoreObserver';
|
|
1
|
+
import { Annotation, Annotator, AnnotatorState } from '../model';
|
|
2
|
+
import { Store } from './Store';
|
|
4
3
|
type Subscriber<T extends Annotation> = (annotation: T[]) => void;
|
|
5
4
|
export interface SvelteStore<T extends Annotation> extends Store<T> {
|
|
6
5
|
subscribe(onChange: Subscriber<T>): void;
|
|
@@ -18,31 +17,6 @@ export interface SvelteAnnotator<T extends Annotation> extends Annotator<T> {
|
|
|
18
17
|
* convenient for everyone using Svelte, as well as for the
|
|
19
18
|
* basic (Svelte-based) Annotorious standard implementation.
|
|
20
19
|
*/
|
|
21
|
-
export declare const toSvelteStore: <T extends Annotation>(store:
|
|
22
|
-
addAnnotation: (annotation: T, origin?: import("./StoreObserver").Origin) => void;
|
|
23
|
-
addBody: (body: import("../model").AnnotationBody, origin?: import("./StoreObserver").Origin) => void;
|
|
24
|
-
all: () => T[];
|
|
25
|
-
bulkAddAnnotation: (annotations: T[], replace?: boolean, origin?: import("./StoreObserver").Origin) => void;
|
|
26
|
-
bulkDeleteAnnotation: (annotationsOrIds: (string | T)[], origin?: import("./StoreObserver").Origin) => void;
|
|
27
|
-
bulkUpdateAnnotation: (annotations: T[], origin?: import("./StoreObserver").Origin) => void;
|
|
28
|
-
bulkUpdateBodies: (bodies: import("../model").AnnotationBody[], origin?: import("./StoreObserver").Origin) => void;
|
|
29
|
-
bulkUpdateTargets: (targets: import("../model").AnnotationTarget[], origin?: import("./StoreObserver").Origin) => void;
|
|
30
|
-
clear: (origin?: import("./StoreObserver").Origin) => void;
|
|
31
|
-
deleteAnnotation: (annotationOrId: string | T, origin?: import("./StoreObserver").Origin) => void;
|
|
32
|
-
deleteBody: (body: {
|
|
33
|
-
id: string;
|
|
34
|
-
annotation: string;
|
|
35
|
-
}, origin?: import("./StoreObserver").Origin) => void;
|
|
36
|
-
getAnnotation: (id: string) => T;
|
|
37
|
-
getBody: (id: string) => import("../model").AnnotationBody;
|
|
38
|
-
observe: (onChange: (event: StoreChangeEvent<T>) => void, options?: import("./StoreObserver").StoreObserveOptions) => number;
|
|
39
|
-
unobserve: (onChange: (event: StoreChangeEvent<T>) => void) => void;
|
|
40
|
-
updateAnnotation: (arg1: string | T, arg2?: import("./StoreObserver").Origin | T, arg3?: import("./StoreObserver").Origin) => void;
|
|
41
|
-
updateBody: (oldBodyId: {
|
|
42
|
-
id: string;
|
|
43
|
-
annotation: string;
|
|
44
|
-
}, newBody: import("../model").AnnotationBody, origin?: import("./StoreObserver").Origin) => void;
|
|
45
|
-
updateTarget: (target: import("../model").AnnotationTarget, origin?: import("./StoreObserver").Origin) => void;
|
|
46
|
-
}) => SvelteStore<T>;
|
|
20
|
+
export declare const toSvelteStore: <T extends Annotation = Annotation>(store: Store<T>) => SvelteStore<T>;
|
|
47
21
|
export {};
|
|
48
22
|
//# sourceMappingURL=SvelteStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvelteStore.d.ts","sourceRoot":"","sources":["../../src/state/SvelteStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SvelteStore.d.ts","sourceRoot":"","sources":["../../src/state/SvelteStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,KAAK,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;AAElE,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IAEjE,SAAS,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAE1C;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IAEnF,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CAEtB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,UAAU,CAAE,SAAQ,SAAS,CAAC,CAAC,CAAC;IAEzE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAE/B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,UAAU,sBAAsB,KAAK,CAAC,CAAC,CAAC,KAAG,WAAW,CAAC,CAAC,CAsB/F,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { type ChangeSet, type StoreChangeEvent } from './StoreObserver';
|
|
1
|
+
import { Unsubscribe } from 'nanoevents';
|
|
2
|
+
import { Annotation } from '../model';
|
|
3
|
+
import { Store } from './Store';
|
|
4
|
+
import { ChangeSet } from './StoreObserver';
|
|
6
5
|
export interface UndoStack<T extends Annotation> {
|
|
7
6
|
canRedo(): boolean;
|
|
8
7
|
canUndo(): boolean;
|
|
@@ -15,30 +14,5 @@ export interface UndoStackEvents<T extends Annotation> {
|
|
|
15
14
|
redo(change: ChangeSet<T>): void;
|
|
16
15
|
undo(change: ChangeSet<T>): void;
|
|
17
16
|
}
|
|
18
|
-
export declare const createUndoStack: <T extends Annotation>(store:
|
|
19
|
-
addAnnotation: (annotation: T, origin?: Origin) => void;
|
|
20
|
-
addBody: (body: import("../model").AnnotationBody, origin?: Origin) => void;
|
|
21
|
-
all: () => T[];
|
|
22
|
-
bulkAddAnnotation: (annotations: T[], replace?: boolean, origin?: Origin) => void;
|
|
23
|
-
bulkDeleteAnnotation: (annotationsOrIds: (string | T)[], origin?: Origin) => void;
|
|
24
|
-
bulkUpdateAnnotation: (annotations: T[], origin?: Origin) => void;
|
|
25
|
-
bulkUpdateBodies: (bodies: import("../model").AnnotationBody[], origin?: Origin) => void;
|
|
26
|
-
bulkUpdateTargets: (targets: import("../model").AnnotationTarget[], origin?: Origin) => void;
|
|
27
|
-
clear: (origin?: Origin) => void;
|
|
28
|
-
deleteAnnotation: (annotationOrId: string | T, origin?: Origin) => void;
|
|
29
|
-
deleteBody: (body: {
|
|
30
|
-
id: string;
|
|
31
|
-
annotation: string;
|
|
32
|
-
}, origin?: Origin) => void;
|
|
33
|
-
getAnnotation: (id: string) => T;
|
|
34
|
-
getBody: (id: string) => import("../model").AnnotationBody;
|
|
35
|
-
observe: (onChange: (event: StoreChangeEvent<T>) => void, options?: import("./StoreObserver").StoreObserveOptions) => number;
|
|
36
|
-
unobserve: (onChange: (event: StoreChangeEvent<T>) => void) => void;
|
|
37
|
-
updateAnnotation: (arg1: string | T, arg2?: Origin | T, arg3?: Origin) => void;
|
|
38
|
-
updateBody: (oldBodyId: {
|
|
39
|
-
id: string;
|
|
40
|
-
annotation: string;
|
|
41
|
-
}, newBody: import("../model").AnnotationBody, origin?: Origin) => void;
|
|
42
|
-
updateTarget: (target: import("../model").AnnotationTarget, origin?: Origin) => void;
|
|
43
|
-
}) => UndoStack<T>;
|
|
17
|
+
export declare const createUndoStack: <T extends Annotation>(store: Store<T>) => UndoStack<T>;
|
|
44
18
|
//# sourceMappingURL=UndoStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UndoStack.d.ts","sourceRoot":"","sources":["../../src/state/U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6 +1,6 @@
|
|
|
1
1
|
export type ViewportState = ReturnType<typeof createViewportState>;
|
|
2
2
|
export declare const createViewportState: () => {
|
|
3
|
-
subscribe: (this: void, run: import(
|
|
3
|
+
subscribe: (this: void, run: import('svelte/store').Subscriber<string[]>, invalidate?: import('svelte/store').Invalidator<string[]> | undefined) => import('svelte/store').Unsubscriber;
|
|
4
4
|
set: (this: void, value: string[]) => void;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=Viewport.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Annotation, AnnotationBody } from '../model/Annotation';
|
|
2
|
+
import { User } from '../model/User';
|
|
3
3
|
/**
|
|
4
4
|
* Returns all users listed as creators or updaters in any parts of this
|
|
5
5
|
* annotation.
|
|
6
6
|
*/
|
|
7
7
|
export declare const getContributors: (annotation: Annotation) => User[];
|
|
8
|
-
export declare const createBody: (
|
|
8
|
+
export declare const createBody: (annotationOrId: string | Annotation, payload: {
|
|
9
9
|
[key: string]: any;
|
|
10
10
|
}, created?: Date, creator?: User) => AnnotationBody;
|
|
11
11
|
//# sourceMappingURL=annotationUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotationUtils.d.ts","sourceRoot":"","sources":["../../src/utils/annotationUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAG,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C;;;GAGG;AACH,eAAO,MAAM,eAAe,eAAgB,UAAU,KAAG,IAAI,EAY5D,CAAA;AAED,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"annotationUtils.d.ts","sourceRoot":"","sources":["../../src/utils/annotationUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAG,IAAI,EAAE,MAAM,eAAe,CAAC;AAC3C;;;GAGG;AACH,eAAO,MAAM,eAAe,eAAgB,UAAU,KAAG,IAAI,EAY5D,CAAA;AAED,eAAO,MAAM,UAAU,mBACL,MAAM,GAAG,UAAU,WAC1B;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,YACrB,IAAI,YACJ,IAAI,KACb,cAMD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Update } from '../state/StoreObserver';
|
|
2
|
+
import { Annotation } from '../model/Annotation';
|
|
3
3
|
export declare const diffAnnotations: <T extends Annotation = Annotation>(oldValue: T, newValue: T) => Update<T>;
|
|
4
4
|
//# sourceMappingURL=diffAnnotations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diffAnnotations.d.ts","sourceRoot":"","sources":["../../src/utils/diffAnnotations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"diffAnnotations.d.ts","sourceRoot":"","sources":["../../src/utils/diffAnnotations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAwBtD,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,UAAU,yBAAyB,CAAC,YAAY,CAAC,KAAG,MAAM,CAAC,CAAC,CAarG,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annotorious/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Annotorious core types and functions",
|
|
5
5
|
"author": "Rainer Simon",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
|
-
"homepage": "https://annotorious.
|
|
7
|
+
"homepage": "https://annotorious.dev",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -25,19 +25,21 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@types/
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
28
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
|
29
|
+
"@tsconfig/svelte": "^5.0.4",
|
|
30
|
+
"@types/deep-equal": "^1.0.4",
|
|
31
|
+
"@types/uuid": "^10.0.0",
|
|
32
|
+
"svelte": "^4.2.19",
|
|
33
|
+
"svelte-preprocess": "^6.0.2",
|
|
34
|
+
"typescript": "5.5.4",
|
|
35
|
+
"vite": "^5.4.2",
|
|
36
|
+
"vite-plugin-dts": "^4.0.3",
|
|
37
|
+
"vitest": "^2.0.5"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
40
|
"dequal": "^2.0.3",
|
|
39
|
-
"nanoevents": "^
|
|
40
|
-
"nanoid": "^5.0.
|
|
41
|
-
"uuid": "^
|
|
41
|
+
"nanoevents": "^9.0.0",
|
|
42
|
+
"nanoid": "^5.0.7",
|
|
43
|
+
"uuid": "^10.0.0"
|
|
42
44
|
}
|
|
43
|
-
}
|
|
45
|
+
}
|