triiiceratops 0.6.0 → 0.7.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/dist/chunks/{TriiiceratopsViewer-CuHkgof3.js → TriiiceratopsViewer-BLPYh18n.js} +7129 -6740
- package/dist/index.js +1380 -1142
- package/dist/plugin-DMqSBxJD.js +400 -0
- package/dist/plugins/image-manipulation.js +1 -1
- package/dist/src/lib/index.d.ts +1 -0
- package/dist/src/lib/paraglide/messages/de.d.ts +41 -0
- package/dist/src/lib/paraglide/messages/en.d.ts +41 -0
- package/dist/src/lib/paraglide/messages.d.ts +123 -0
- package/dist/src/lib/state/viewer.svelte.d.ts +48 -1
- package/dist/src/lib/types/config.d.ts +129 -0
- package/dist/triiiceratops-element-image.js +317 -286
- package/dist/triiiceratops-element.js +65 -34
- package/dist/triiiceratops.css +1 -1
- package/package.json +1 -1
- package/dist/plugin-COh2S4OT.js +0 -236
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
import { ViewerConfig } from '../types/config';
|
|
1
2
|
import { TriiiceratopsPlugin, PluginMenuButton, PluginPanel } from '../types/plugin';
|
|
3
|
+
/**
|
|
4
|
+
* Snapshot of viewer state for external consumers.
|
|
5
|
+
* Used by web component events to expose state without Svelte reactivity.
|
|
6
|
+
*/
|
|
7
|
+
export interface ViewerStateSnapshot {
|
|
8
|
+
manifestId: string | null;
|
|
9
|
+
canvasId: string | null;
|
|
10
|
+
currentCanvasIndex: number;
|
|
11
|
+
showAnnotations: boolean;
|
|
12
|
+
showThumbnailGallery: boolean;
|
|
13
|
+
showSearchPanel: boolean;
|
|
14
|
+
isFullScreen: boolean;
|
|
15
|
+
dockSide: string;
|
|
16
|
+
}
|
|
2
17
|
export declare class ViewerState {
|
|
3
18
|
manifestId: string | null;
|
|
4
19
|
canvasId: string | null;
|
|
@@ -10,6 +25,10 @@ export declare class ViewerState {
|
|
|
10
25
|
showMetadataDialog: boolean;
|
|
11
26
|
dockSide: string;
|
|
12
27
|
visibleAnnotationIds: Set<string>;
|
|
28
|
+
config: ViewerConfig;
|
|
29
|
+
get showRightMenu(): boolean;
|
|
30
|
+
get showLeftMenu(): boolean;
|
|
31
|
+
get showCanvasNav(): boolean;
|
|
13
32
|
galleryPosition: {
|
|
14
33
|
x: number;
|
|
15
34
|
y: number;
|
|
@@ -23,7 +42,34 @@ export declare class ViewerState {
|
|
|
23
42
|
x: number;
|
|
24
43
|
y: number;
|
|
25
44
|
};
|
|
26
|
-
dragOverSide: "left" | "right" | "
|
|
45
|
+
dragOverSide: "left" | "right" | "top" | "bottom" | null;
|
|
46
|
+
galleryCenterPanelRect: DOMRect | null;
|
|
47
|
+
/**
|
|
48
|
+
* Event target for dispatching CustomEvents.
|
|
49
|
+
* Only set by TriiiceratopsViewerElement (web component build).
|
|
50
|
+
* Remains null for Svelte component usage → no events dispatched.
|
|
51
|
+
*/
|
|
52
|
+
private eventTarget;
|
|
53
|
+
/**
|
|
54
|
+
* Set the event target for dispatching state change events.
|
|
55
|
+
* Called by TriiiceratopsViewerElement to enable event-driven API.
|
|
56
|
+
*/
|
|
57
|
+
setEventTarget(target: EventTarget): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get current state as a plain object snapshot.
|
|
60
|
+
* Safe to use outside Svelte's reactive system.
|
|
61
|
+
* NOTE: We calculate currentCanvasIndex inline to avoid triggering the canvases getter
|
|
62
|
+
* which can cause infinite loops when it auto-sets canvasId.
|
|
63
|
+
*/
|
|
64
|
+
getSnapshot(): ViewerStateSnapshot;
|
|
65
|
+
/**
|
|
66
|
+
* Dispatch a state change event to the web component.
|
|
67
|
+
* No-op if eventTarget is null (Svelte component usage).
|
|
68
|
+
*
|
|
69
|
+
* Uses queueMicrotask to dispatch asynchronously AFTER the current
|
|
70
|
+
* reactive cycle completes, preventing infinite update loops.
|
|
71
|
+
*/
|
|
72
|
+
private dispatchStateChange;
|
|
27
73
|
constructor(initialManifestId?: string | null, initialCanvasId?: string | null, initialPlugins?: TriiiceratopsPlugin[]);
|
|
28
74
|
get manifest(): any;
|
|
29
75
|
get canvases(): any;
|
|
@@ -34,6 +80,7 @@ export declare class ViewerState {
|
|
|
34
80
|
previousCanvas(): void;
|
|
35
81
|
setManifest(manifestId: string): void;
|
|
36
82
|
setCanvas(canvasId: string): void;
|
|
83
|
+
updateConfig(newConfig: ViewerConfig): void;
|
|
37
84
|
toggleAnnotations(): void;
|
|
38
85
|
toggleThumbnailGallery(): void;
|
|
39
86
|
toggleFullScreen(): void;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export interface RequestConfig {
|
|
2
|
+
/**
|
|
3
|
+
* Extra headers to send with the IIIF manifest request
|
|
4
|
+
*/
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Whether to use credentials (cookies) for the request
|
|
8
|
+
*/
|
|
9
|
+
withCredentials?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface GalleryConfig {
|
|
12
|
+
/**
|
|
13
|
+
* Where the gallery should be docked by default if shown.
|
|
14
|
+
* @default 'bottom'
|
|
15
|
+
*/
|
|
16
|
+
dockPosition?: 'left' | 'right' | 'top' | 'bottom' | 'none';
|
|
17
|
+
/**
|
|
18
|
+
* Whether the gallery can be dragged/moved by the user.
|
|
19
|
+
* @default true
|
|
20
|
+
*/
|
|
21
|
+
draggable?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the gallery is currently open/visible.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
open?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether to show the close button on the gallery.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
showCloseButton?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface SearchConfig {
|
|
34
|
+
/**
|
|
35
|
+
* Where the search panel should appear.
|
|
36
|
+
* @default 'right'
|
|
37
|
+
*/
|
|
38
|
+
position?: 'left' | 'right';
|
|
39
|
+
/**
|
|
40
|
+
* Whether the search panel is currently open.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
open?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether to show the close button.
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
showCloseButton?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface AnnotationsConfig {
|
|
51
|
+
/**
|
|
52
|
+
* Whether the annotations panel/list is open.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
open?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether annotations are currently visible on the canvas.
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
visible?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface MenuConfig {
|
|
63
|
+
/**
|
|
64
|
+
* Whether the Search button is shown in this menu.
|
|
65
|
+
* @default true
|
|
66
|
+
*/
|
|
67
|
+
showSearch?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the Gallery toggle button is shown in this menu.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
showGallery?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether the Annotations toggle button is shown in this menu.
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
77
|
+
showAnnotations?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the Info/Metadata button is shown in this menu.
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
showInfo?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the Fullscreen button is shown in this menu.
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
87
|
+
showFullscreen?: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface ViewerConfig {
|
|
90
|
+
/**
|
|
91
|
+
* Whether the right floating menu is visible.
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
showRightMenu?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Configuration for the right menu items.
|
|
97
|
+
*/
|
|
98
|
+
rightMenu?: MenuConfig;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the left FAB (plugins menu) is visible.
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
103
|
+
showLeftMenu?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Configuration for the left menu items.
|
|
106
|
+
*/
|
|
107
|
+
leftMenu?: MenuConfig;
|
|
108
|
+
/**
|
|
109
|
+
* Whether to show the canvas navigation arrows/controls.
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
showCanvasNav?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Configuration for the thumbnail gallery pane.
|
|
115
|
+
*/
|
|
116
|
+
gallery?: GalleryConfig;
|
|
117
|
+
/**
|
|
118
|
+
* Configuration for the search pane.
|
|
119
|
+
*/
|
|
120
|
+
search?: SearchConfig;
|
|
121
|
+
/**
|
|
122
|
+
* Configuration for annotations.
|
|
123
|
+
*/
|
|
124
|
+
annotations?: AnnotationsConfig;
|
|
125
|
+
/**
|
|
126
|
+
* Configuration for network requests (manifests, etc)
|
|
127
|
+
*/
|
|
128
|
+
requests?: RequestConfig;
|
|
129
|
+
}
|