triiiceratops 0.1.0 → 0.2.0
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/README.md +9 -6
- package/dist/src/lib/state/viewer.svelte.d.ts +0 -5
- package/dist/src/lib/utils/annotationAdapter.d.ts +27 -5
- package/dist/triiiceratops-element.css +1 -1
- package/dist/triiiceratops-element.iife.js +30 -1162
- package/dist/triiiceratops-element.js +11091 -41716
- package/dist/triiiceratops.js +819 -870
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
# Triiiceratops IIIF Viewer
|
|
2
2
|
|
|
3
|
-
A modern
|
|
3
|
+
A modern IIIF viewer with a small footprint (despite the name) distributed as a web component that can be dropped into any HTML page or frontend framework.
|
|
4
4
|
|
|
5
|
-
This is a work in progress and does not support all
|
|
5
|
+
This is a work in progress and does not support all required IIIF client features (_yet_).
|
|
6
|
+
|
|
7
|
+
This project is heavily inspired by Mirador 4, which I still view as the premier IIIF viewer.
|
|
6
8
|
|
|
7
9
|
## Features
|
|
8
10
|
|
|
9
11
|
- Explore all canvases in a manfifest in a flexible thumbnail gallery that can be a floating window or docked to any of the four sides of the viewer.
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
+
- Renders IIIF annotations.
|
|
13
|
+
- Flexible theme support using Tailwind CSS and DaisyUI.
|
|
12
14
|
- IIIF Search support.
|
|
13
15
|
|
|
14
16
|
## Current Limitations (but actively working on supporting)
|
|
15
17
|
|
|
16
|
-
- Does not fully support multiple images per canvas.
|
|
18
|
+
- Does not fully support multiple images per canvas (either multiple images in the same canvas or the `choice` property).
|
|
17
19
|
- Does not support IIIF collection navigation.
|
|
18
20
|
- Other IIIF client features are missing.
|
|
19
|
-
|
|
21
|
+
|
|
22
|
+
The goal is to support all IIIF client mandatory features with pluggable optional features. The footprint of Triiiceratops, despite the name, is intended to remain considerably small than other fully featured viewers while attaining feature parity.
|
|
20
23
|
|
|
21
24
|
## Usage
|
|
22
25
|
|
|
@@ -9,8 +9,6 @@ export declare class ViewerState {
|
|
|
9
9
|
showMetadataDialog: boolean;
|
|
10
10
|
dockSide: string;
|
|
11
11
|
visibleAnnotationIds: Set<string>;
|
|
12
|
-
createdAnnotations: Record<string, any[]>;
|
|
13
|
-
isCreatingAnnotation: boolean;
|
|
14
12
|
constructor(initialManifestId?: string | null);
|
|
15
13
|
get manifest(): any;
|
|
16
14
|
get canvases(): any;
|
|
@@ -21,9 +19,6 @@ export declare class ViewerState {
|
|
|
21
19
|
previousCanvas(): void;
|
|
22
20
|
setManifest(manifestId: string): void;
|
|
23
21
|
setCanvas(canvasId: string): void;
|
|
24
|
-
toggleCreationMode(enable?: boolean): void;
|
|
25
|
-
loadAnnotationsFromStorage(canvasId: string): void;
|
|
26
|
-
addAnnotation(annotation: any, canvasId: string): void;
|
|
27
22
|
toggleAnnotations(): void;
|
|
28
23
|
toggleThumbnailGallery(): void;
|
|
29
24
|
toggleFullScreen(): void;
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
import { ImageAnnotation } from '@annotorious/annotorious';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
2
|
+
* Parsed annotation interface for custom rendering
|
|
4
3
|
*/
|
|
5
|
-
export
|
|
4
|
+
export interface ParsedAnnotation {
|
|
5
|
+
id: string;
|
|
6
|
+
geometry: RectangleGeometry | PolygonGeometry;
|
|
7
|
+
body: {
|
|
8
|
+
value: string;
|
|
9
|
+
isHtml: boolean;
|
|
10
|
+
};
|
|
11
|
+
isSearchHit: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface RectangleGeometry {
|
|
14
|
+
type: 'RECTANGLE';
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
w: number;
|
|
18
|
+
h: number;
|
|
19
|
+
}
|
|
20
|
+
export interface PolygonGeometry {
|
|
21
|
+
type: 'POLYGON';
|
|
22
|
+
points: [number, number][];
|
|
23
|
+
}
|
|
6
24
|
/**
|
|
7
|
-
*
|
|
25
|
+
* Parse Manifesto/IIIF annotation to internal format
|
|
8
26
|
*/
|
|
9
|
-
export declare function
|
|
27
|
+
export declare function parseAnnotation(annotation: any, index: number, isSearchHit?: boolean): ParsedAnnotation | null;
|
|
28
|
+
/**
|
|
29
|
+
* Batch parse annotations
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseAnnotations(annotations: any[], searchHitIds?: Set<string>): ParsedAnnotation[];
|