triiiceratops 0.5.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-BLPYh18n.js +22698 -0
- package/dist/index.js +1766 -1423
- package/dist/plugin-DMqSBxJD.js +400 -0
- package/dist/plugins/image-manipulation.js +51 -47
- package/dist/src/lib/index.d.ts +5 -0
- package/dist/src/lib/paraglide/messages/de.d.ts +51 -0
- package/dist/src/lib/paraglide/messages/en.d.ts +51 -0
- package/dist/src/lib/paraglide/messages.d.ts +153 -0
- package/dist/src/lib/plugins/image-manipulation/filters.d.ts +1 -1
- package/dist/src/lib/state/viewer.svelte.d.ts +48 -1
- package/dist/src/lib/theme/colorUtils.d.ts +36 -0
- package/dist/src/lib/theme/index.d.ts +51 -0
- package/dist/src/lib/theme/themeManager.d.ts +39 -0
- package/dist/src/lib/theme/types.d.ts +73 -0
- package/dist/src/lib/types/config.d.ts +129 -0
- package/dist/triiiceratops-element-image.js +338 -268
- package/dist/triiiceratops-element.js +86 -20
- package/dist/{triiiceratops-element.css → triiiceratops.css} +1 -1
- package/package.json +8 -3
- package/dist/chunks/TriiiceratopsViewer-BardJ3c3.js +0 -22029
- package/dist/plugin-DqOSV8lm.js +0 -30
|
@@ -43,3 +43,54 @@ export function iiif_manifest_label(): string;
|
|
|
43
43
|
export function manifest_placeholder(): string;
|
|
44
44
|
export function load(): string;
|
|
45
45
|
export function github(): string;
|
|
46
|
+
export function viewer_variant_core(): string;
|
|
47
|
+
export function viewer_variant_full(): string;
|
|
48
|
+
export function viewer_variant_custom_theme(): string;
|
|
49
|
+
export function viewer_variant_tooltip_core(): string;
|
|
50
|
+
export function viewer_variant_tooltip_full(): string;
|
|
51
|
+
export function viewer_variant_tooltip_custom_theme(): string;
|
|
52
|
+
export function plugins_tooltip(): string;
|
|
53
|
+
export function demo_header_external_controls(): string;
|
|
54
|
+
export function demo_header_active_canvas(): string;
|
|
55
|
+
export function image_adjustments(): string;
|
|
56
|
+
export function close_menu(): string;
|
|
57
|
+
export function gallery(): string;
|
|
58
|
+
export function close_gallery(): string;
|
|
59
|
+
export function close_search(): string;
|
|
60
|
+
export function settings_label(): string;
|
|
61
|
+
export function settings_category_general(): string;
|
|
62
|
+
export function settings_toggle_left_menu(): string;
|
|
63
|
+
export function settings_toggle_right_menu(): string;
|
|
64
|
+
export function settings_toggle_canvas_nav(): string;
|
|
65
|
+
export function settings_category_configuration(): string;
|
|
66
|
+
export function settings_submenu_right_menu_items(): string;
|
|
67
|
+
export function settings_toggle_show_search(): string;
|
|
68
|
+
export function settings_toggle_show_gallery(): string;
|
|
69
|
+
export function settings_toggle_show_annotations(): string;
|
|
70
|
+
export function settings_toggle_show_fullscreen(): string;
|
|
71
|
+
export function settings_toggle_show_info(): string;
|
|
72
|
+
export function settings_submenu_gallery(): string;
|
|
73
|
+
export function settings_toggle_open(): string;
|
|
74
|
+
export function settings_toggle_draggable(): string;
|
|
75
|
+
export function settings_toggle_close_button(): string;
|
|
76
|
+
export function settings_select_dock_position(): string;
|
|
77
|
+
export function settings_position_bottom(): string;
|
|
78
|
+
export function settings_position_top(): string;
|
|
79
|
+
export function settings_position_left(): string;
|
|
80
|
+
export function settings_position_right(): string;
|
|
81
|
+
export function settings_position_floating(): string;
|
|
82
|
+
export function settings_submenu_search(): string;
|
|
83
|
+
export function settings_submenu_annotations(): string;
|
|
84
|
+
export function settings_toggle_panel_open(): string;
|
|
85
|
+
export function settings_toggle_visible_by_default(): string;
|
|
86
|
+
export function copy_config(): string;
|
|
87
|
+
export function copied(): string;
|
|
88
|
+
export function viewer_variant_svelte_component_tooltip(): string;
|
|
89
|
+
export function viewer_variant_svelte(): string;
|
|
90
|
+
export function language_select_label(): string;
|
|
91
|
+
export function no_canvases_loaded(): string;
|
|
92
|
+
export function try_your_own(): string;
|
|
93
|
+
export function change_theme_label(): string;
|
|
94
|
+
export function theme_menu_title(): string;
|
|
95
|
+
export function error_prefix(): string;
|
|
96
|
+
export function no_image_found(): string;
|
|
@@ -43,3 +43,54 @@ export function iiif_manifest_label(): string;
|
|
|
43
43
|
export function manifest_placeholder(): string;
|
|
44
44
|
export function load(): string;
|
|
45
45
|
export function github(): string;
|
|
46
|
+
export function viewer_variant_core(): string;
|
|
47
|
+
export function viewer_variant_full(): string;
|
|
48
|
+
export function viewer_variant_custom_theme(): string;
|
|
49
|
+
export function viewer_variant_tooltip_core(): string;
|
|
50
|
+
export function viewer_variant_tooltip_full(): string;
|
|
51
|
+
export function viewer_variant_tooltip_custom_theme(): string;
|
|
52
|
+
export function plugins_tooltip(): string;
|
|
53
|
+
export function demo_header_external_controls(): string;
|
|
54
|
+
export function demo_header_active_canvas(): string;
|
|
55
|
+
export function image_adjustments(): string;
|
|
56
|
+
export function close_menu(): string;
|
|
57
|
+
export function gallery(): string;
|
|
58
|
+
export function close_gallery(): string;
|
|
59
|
+
export function close_search(): string;
|
|
60
|
+
export function settings_label(): string;
|
|
61
|
+
export function settings_category_general(): string;
|
|
62
|
+
export function settings_toggle_left_menu(): string;
|
|
63
|
+
export function settings_toggle_right_menu(): string;
|
|
64
|
+
export function settings_toggle_canvas_nav(): string;
|
|
65
|
+
export function settings_category_configuration(): string;
|
|
66
|
+
export function settings_submenu_right_menu_items(): string;
|
|
67
|
+
export function settings_toggle_show_search(): string;
|
|
68
|
+
export function settings_toggle_show_gallery(): string;
|
|
69
|
+
export function settings_toggle_show_annotations(): string;
|
|
70
|
+
export function settings_toggle_show_fullscreen(): string;
|
|
71
|
+
export function settings_toggle_show_info(): string;
|
|
72
|
+
export function settings_submenu_gallery(): string;
|
|
73
|
+
export function settings_toggle_open(): string;
|
|
74
|
+
export function settings_toggle_draggable(): string;
|
|
75
|
+
export function settings_toggle_close_button(): string;
|
|
76
|
+
export function settings_select_dock_position(): string;
|
|
77
|
+
export function settings_position_bottom(): string;
|
|
78
|
+
export function settings_position_top(): string;
|
|
79
|
+
export function settings_position_left(): string;
|
|
80
|
+
export function settings_position_right(): string;
|
|
81
|
+
export function settings_position_floating(): string;
|
|
82
|
+
export function settings_submenu_search(): string;
|
|
83
|
+
export function settings_submenu_annotations(): string;
|
|
84
|
+
export function settings_toggle_panel_open(): string;
|
|
85
|
+
export function settings_toggle_visible_by_default(): string;
|
|
86
|
+
export function copy_config(): string;
|
|
87
|
+
export function copied(): string;
|
|
88
|
+
export function viewer_variant_svelte_component_tooltip(): string;
|
|
89
|
+
export function viewer_variant_svelte(): string;
|
|
90
|
+
export function language_select_label(): string;
|
|
91
|
+
export function no_canvases_loaded(): string;
|
|
92
|
+
export function try_your_own(): string;
|
|
93
|
+
export function change_theme_label(): string;
|
|
94
|
+
export function theme_menu_title(): string;
|
|
95
|
+
export function error_prefix(): string;
|
|
96
|
+
export function no_image_found(): string;
|
|
@@ -117,3 +117,156 @@ export function load(params?: {}, options?: {
|
|
|
117
117
|
export function github(params?: {}, options?: {
|
|
118
118
|
languageTag?: "en" | "de";
|
|
119
119
|
}): string;
|
|
120
|
+
export function viewer_variant_core(params?: {}, options?: {
|
|
121
|
+
languageTag?: "en" | "de";
|
|
122
|
+
}): string;
|
|
123
|
+
export function viewer_variant_full(params?: {}, options?: {
|
|
124
|
+
languageTag?: "en" | "de";
|
|
125
|
+
}): string;
|
|
126
|
+
export function viewer_variant_custom_theme(params?: {}, options?: {
|
|
127
|
+
languageTag?: "en" | "de";
|
|
128
|
+
}): string;
|
|
129
|
+
export function viewer_variant_tooltip_core(params?: {}, options?: {
|
|
130
|
+
languageTag?: "en" | "de";
|
|
131
|
+
}): string;
|
|
132
|
+
export function viewer_variant_tooltip_full(params?: {}, options?: {
|
|
133
|
+
languageTag?: "en" | "de";
|
|
134
|
+
}): string;
|
|
135
|
+
export function viewer_variant_tooltip_custom_theme(params?: {}, options?: {
|
|
136
|
+
languageTag?: "en" | "de";
|
|
137
|
+
}): string;
|
|
138
|
+
export function plugins_tooltip(params?: {}, options?: {
|
|
139
|
+
languageTag?: "en" | "de";
|
|
140
|
+
}): string;
|
|
141
|
+
export function demo_header_external_controls(params?: {}, options?: {
|
|
142
|
+
languageTag?: "en" | "de";
|
|
143
|
+
}): string;
|
|
144
|
+
export function demo_header_active_canvas(params?: {}, options?: {
|
|
145
|
+
languageTag?: "en" | "de";
|
|
146
|
+
}): string;
|
|
147
|
+
export function image_adjustments(params?: {}, options?: {
|
|
148
|
+
languageTag?: "en" | "de";
|
|
149
|
+
}): string;
|
|
150
|
+
export function close_menu(params?: {}, options?: {
|
|
151
|
+
languageTag?: "en" | "de";
|
|
152
|
+
}): string;
|
|
153
|
+
export function gallery(params?: {}, options?: {
|
|
154
|
+
languageTag?: "en" | "de";
|
|
155
|
+
}): string;
|
|
156
|
+
export function close_gallery(params?: {}, options?: {
|
|
157
|
+
languageTag?: "en" | "de";
|
|
158
|
+
}): string;
|
|
159
|
+
export function close_search(params?: {}, options?: {
|
|
160
|
+
languageTag?: "en" | "de";
|
|
161
|
+
}): string;
|
|
162
|
+
export function settings_label(params?: {}, options?: {
|
|
163
|
+
languageTag?: "en" | "de";
|
|
164
|
+
}): string;
|
|
165
|
+
export function settings_category_general(params?: {}, options?: {
|
|
166
|
+
languageTag?: "en" | "de";
|
|
167
|
+
}): string;
|
|
168
|
+
export function settings_toggle_left_menu(params?: {}, options?: {
|
|
169
|
+
languageTag?: "en" | "de";
|
|
170
|
+
}): string;
|
|
171
|
+
export function settings_toggle_right_menu(params?: {}, options?: {
|
|
172
|
+
languageTag?: "en" | "de";
|
|
173
|
+
}): string;
|
|
174
|
+
export function settings_toggle_canvas_nav(params?: {}, options?: {
|
|
175
|
+
languageTag?: "en" | "de";
|
|
176
|
+
}): string;
|
|
177
|
+
export function settings_category_configuration(params?: {}, options?: {
|
|
178
|
+
languageTag?: "en" | "de";
|
|
179
|
+
}): string;
|
|
180
|
+
export function settings_submenu_right_menu_items(params?: {}, options?: {
|
|
181
|
+
languageTag?: "en" | "de";
|
|
182
|
+
}): string;
|
|
183
|
+
export function settings_toggle_show_search(params?: {}, options?: {
|
|
184
|
+
languageTag?: "en" | "de";
|
|
185
|
+
}): string;
|
|
186
|
+
export function settings_toggle_show_gallery(params?: {}, options?: {
|
|
187
|
+
languageTag?: "en" | "de";
|
|
188
|
+
}): string;
|
|
189
|
+
export function settings_toggle_show_annotations(params?: {}, options?: {
|
|
190
|
+
languageTag?: "en" | "de";
|
|
191
|
+
}): string;
|
|
192
|
+
export function settings_toggle_show_fullscreen(params?: {}, options?: {
|
|
193
|
+
languageTag?: "en" | "de";
|
|
194
|
+
}): string;
|
|
195
|
+
export function settings_toggle_show_info(params?: {}, options?: {
|
|
196
|
+
languageTag?: "en" | "de";
|
|
197
|
+
}): string;
|
|
198
|
+
export function settings_submenu_gallery(params?: {}, options?: {
|
|
199
|
+
languageTag?: "en" | "de";
|
|
200
|
+
}): string;
|
|
201
|
+
export function settings_toggle_open(params?: {}, options?: {
|
|
202
|
+
languageTag?: "en" | "de";
|
|
203
|
+
}): string;
|
|
204
|
+
export function settings_toggle_draggable(params?: {}, options?: {
|
|
205
|
+
languageTag?: "en" | "de";
|
|
206
|
+
}): string;
|
|
207
|
+
export function settings_toggle_close_button(params?: {}, options?: {
|
|
208
|
+
languageTag?: "en" | "de";
|
|
209
|
+
}): string;
|
|
210
|
+
export function settings_select_dock_position(params?: {}, options?: {
|
|
211
|
+
languageTag?: "en" | "de";
|
|
212
|
+
}): string;
|
|
213
|
+
export function settings_position_bottom(params?: {}, options?: {
|
|
214
|
+
languageTag?: "en" | "de";
|
|
215
|
+
}): string;
|
|
216
|
+
export function settings_position_top(params?: {}, options?: {
|
|
217
|
+
languageTag?: "en" | "de";
|
|
218
|
+
}): string;
|
|
219
|
+
export function settings_position_left(params?: {}, options?: {
|
|
220
|
+
languageTag?: "en" | "de";
|
|
221
|
+
}): string;
|
|
222
|
+
export function settings_position_right(params?: {}, options?: {
|
|
223
|
+
languageTag?: "en" | "de";
|
|
224
|
+
}): string;
|
|
225
|
+
export function settings_position_floating(params?: {}, options?: {
|
|
226
|
+
languageTag?: "en" | "de";
|
|
227
|
+
}): string;
|
|
228
|
+
export function settings_submenu_search(params?: {}, options?: {
|
|
229
|
+
languageTag?: "en" | "de";
|
|
230
|
+
}): string;
|
|
231
|
+
export function settings_submenu_annotations(params?: {}, options?: {
|
|
232
|
+
languageTag?: "en" | "de";
|
|
233
|
+
}): string;
|
|
234
|
+
export function settings_toggle_panel_open(params?: {}, options?: {
|
|
235
|
+
languageTag?: "en" | "de";
|
|
236
|
+
}): string;
|
|
237
|
+
export function settings_toggle_visible_by_default(params?: {}, options?: {
|
|
238
|
+
languageTag?: "en" | "de";
|
|
239
|
+
}): string;
|
|
240
|
+
export function copy_config(params?: {}, options?: {
|
|
241
|
+
languageTag?: "en" | "de";
|
|
242
|
+
}): string;
|
|
243
|
+
export function copied(params?: {}, options?: {
|
|
244
|
+
languageTag?: "en" | "de";
|
|
245
|
+
}): string;
|
|
246
|
+
export function viewer_variant_svelte_component_tooltip(params?: {}, options?: {
|
|
247
|
+
languageTag?: "en" | "de";
|
|
248
|
+
}): string;
|
|
249
|
+
export function viewer_variant_svelte(params?: {}, options?: {
|
|
250
|
+
languageTag?: "en" | "de";
|
|
251
|
+
}): string;
|
|
252
|
+
export function language_select_label(params?: {}, options?: {
|
|
253
|
+
languageTag?: "en" | "de";
|
|
254
|
+
}): string;
|
|
255
|
+
export function no_canvases_loaded(params?: {}, options?: {
|
|
256
|
+
languageTag?: "en" | "de";
|
|
257
|
+
}): string;
|
|
258
|
+
export function try_your_own(params?: {}, options?: {
|
|
259
|
+
languageTag?: "en" | "de";
|
|
260
|
+
}): string;
|
|
261
|
+
export function change_theme_label(params?: {}, options?: {
|
|
262
|
+
languageTag?: "en" | "de";
|
|
263
|
+
}): string;
|
|
264
|
+
export function theme_menu_title(params?: {}, options?: {
|
|
265
|
+
languageTag?: "en" | "de";
|
|
266
|
+
}): string;
|
|
267
|
+
export function error_prefix(params?: {}, options?: {
|
|
268
|
+
languageTag?: "en" | "de";
|
|
269
|
+
}): string;
|
|
270
|
+
export function no_image_found(params?: {}, options?: {
|
|
271
|
+
languageTag?: "en" | "de";
|
|
272
|
+
}): string;
|
|
@@ -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,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color conversion utilities for DaisyUI theming.
|
|
3
|
+
* DaisyUI v5 uses oklch color format for all theme colors.
|
|
4
|
+
* The conversion functions were largely generated by Opus 4.5
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Check if a string is already in oklch format
|
|
8
|
+
*/
|
|
9
|
+
export declare function isOklch(value: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if a string is a hex color
|
|
12
|
+
*/
|
|
13
|
+
export declare function isHex(value: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Check if a string is an rgb() or rgba() color
|
|
16
|
+
*/
|
|
17
|
+
export declare function isRgb(value: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Convert hex color to oklch format for DaisyUI
|
|
20
|
+
* @param hex - Color in hex format (#rgb, #rrggbb, or #rrggbbaa)
|
|
21
|
+
* @returns oklch string like "oklch(65.00% 0.2000 250.00)"
|
|
22
|
+
*/
|
|
23
|
+
export declare function hexToOklch(hex: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Convert rgb() color to oklch format for DaisyUI
|
|
26
|
+
* @param rgb - Color in rgb(r, g, b) or rgba(r, g, b, a) format
|
|
27
|
+
* @returns oklch string like "oklch(65.00% 0.2000 250.00)"
|
|
28
|
+
*/
|
|
29
|
+
export declare function rgbToOklchString(rgb: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Normalize color input - accepts hex, rgb(), or oklch()
|
|
32
|
+
* Converts hex and rgb to oklch format for DaisyUI compatibility.
|
|
33
|
+
* @param color - Color in any supported format
|
|
34
|
+
* @returns oklch string or original value if already oklch
|
|
35
|
+
*/
|
|
36
|
+
export declare function normalizeColor(color: string): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme customization for Triiiceratops viewer.
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for customizing DaisyUI themes.
|
|
5
|
+
*
|
|
6
|
+
* @example Setting a built-in theme
|
|
7
|
+
* ```html
|
|
8
|
+
* <triiiceratops-viewer manifest-id="..." theme="dark"></triiiceratops-viewer>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @example Custom theme configuration (web component)
|
|
12
|
+
* ```html
|
|
13
|
+
* <triiiceratops-viewer
|
|
14
|
+
* manifest-id="..."
|
|
15
|
+
* theme="light"
|
|
16
|
+
* theme-config='{"primary":"#3b82f6","radiusBox":"0.5rem"}'
|
|
17
|
+
* ></triiiceratops-viewer>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @example Custom theme configuration (JavaScript)
|
|
21
|
+
* ```javascript
|
|
22
|
+
* const viewer = document.querySelector('triiiceratops-viewer');
|
|
23
|
+
* viewer.theme = 'dark';
|
|
24
|
+
* viewer.themeConfig = {
|
|
25
|
+
* primary: '#3b82f6',
|
|
26
|
+
* secondary: '#8b5cf6',
|
|
27
|
+
* radiusBox: '0.75rem',
|
|
28
|
+
* border: '2px',
|
|
29
|
+
* };
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @example Svelte component
|
|
33
|
+
* ```svelte
|
|
34
|
+
* <script>
|
|
35
|
+
* import { TriiiceratopsViewer } from 'triiiceratops';
|
|
36
|
+
* import { MediaQuery } from 'svelte/reactivity';
|
|
37
|
+
*
|
|
38
|
+
* const prefersDark = new MediaQuery('(prefers-color-scheme: dark)');
|
|
39
|
+
* </script>
|
|
40
|
+
*
|
|
41
|
+
* <TriiiceratopsViewer
|
|
42
|
+
* manifestId="..."
|
|
43
|
+
* theme={prefersDark.current ? 'dark' : 'light'}
|
|
44
|
+
* themeConfig={{ primary: '#0ea5e9' }}
|
|
45
|
+
* />
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export type { ThemeConfig, DaisyUITheme } from './types';
|
|
49
|
+
export { DAISYUI_THEMES } from './types';
|
|
50
|
+
export { applyTheme, applyBuiltInTheme, applyThemeConfig, clearThemeConfig, isBuiltInTheme, parseThemeConfig, getThemeCssVariables, getThemePropertyNames, } from './themeManager';
|
|
51
|
+
export { hexToOklch, normalizeColor, isOklch, isHex, isRgb, } from './colorUtils';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ThemeConfig, DaisyUITheme } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if a string is a valid built-in DaisyUI theme name
|
|
4
|
+
*/
|
|
5
|
+
export declare function isBuiltInTheme(theme: string): theme is DaisyUITheme;
|
|
6
|
+
/**
|
|
7
|
+
* Apply a built-in theme to an element by setting data-theme attribute
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyBuiltInTheme(element: HTMLElement, theme: DaisyUITheme): void;
|
|
10
|
+
/**
|
|
11
|
+
* Apply custom theme configuration as CSS custom properties on an element.
|
|
12
|
+
* These override the base theme's values.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyThemeConfig(element: HTMLElement, config: ThemeConfig): void;
|
|
15
|
+
/**
|
|
16
|
+
* Clear all custom theme CSS variables from an element
|
|
17
|
+
*/
|
|
18
|
+
export declare function clearThemeConfig(element: HTMLElement): void;
|
|
19
|
+
/**
|
|
20
|
+
* Parse a theme config from a JSON string (for HTML attribute usage)
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseThemeConfig(json: string): ThemeConfig | null;
|
|
23
|
+
/**
|
|
24
|
+
* Apply theme to an element.
|
|
25
|
+
*
|
|
26
|
+
* @param element - The HTML element to apply the theme to
|
|
27
|
+
* @param theme - Built-in theme name (defaults to light/dark based on prefers-color-scheme)
|
|
28
|
+
* @param config - Optional custom theme configuration to override the base theme
|
|
29
|
+
* @param prefersDark - Whether the user prefers dark mode (from media query)
|
|
30
|
+
*/
|
|
31
|
+
export declare function applyTheme(element: HTMLElement, theme: DaisyUITheme | undefined, config: ThemeConfig | undefined): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get all CSS variable names that can be customized
|
|
34
|
+
*/
|
|
35
|
+
export declare function getThemeCssVariables(): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Get all customizable theme property names
|
|
38
|
+
*/
|
|
39
|
+
export declare function getThemePropertyNames(): (keyof ThemeConfig)[];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in DaisyUI theme names
|
|
3
|
+
*/
|
|
4
|
+
export type DaisyUITheme = 'light' | 'dark' | 'cupcake' | 'bumblebee' | 'emerald' | 'corporate' | 'synthwave' | 'retro' | 'cyberpunk' | 'valentine' | 'halloween' | 'garden' | 'forest' | 'aqua' | 'lofi' | 'pastel' | 'fantasy' | 'wireframe' | 'black' | 'luxury' | 'dracula' | 'cmyk' | 'autumn' | 'business' | 'acid' | 'lemonade' | 'night' | 'coffee' | 'winter' | 'dim' | 'nord' | 'sunset' | 'caramellatte' | 'abyss' | 'silk';
|
|
5
|
+
/**
|
|
6
|
+
* List of all built-in DaisyUI themes for runtime validation
|
|
7
|
+
*/
|
|
8
|
+
export declare const DAISYUI_THEMES: DaisyUITheme[];
|
|
9
|
+
/**
|
|
10
|
+
* Custom theme configuration with friendly property names.
|
|
11
|
+
* All color values accept hex (#rrggbb), rgb(r,g,b), or oklch() strings.
|
|
12
|
+
* This is used to override the base theme's values.
|
|
13
|
+
*/
|
|
14
|
+
export interface ThemeConfig {
|
|
15
|
+
/** Primary brand color (hex, rgb, or oklch) */
|
|
16
|
+
primary?: string;
|
|
17
|
+
/** Text color for content on primary background */
|
|
18
|
+
primaryContent?: string;
|
|
19
|
+
/** Secondary brand color (hex, rgb, or oklch) */
|
|
20
|
+
secondary?: string;
|
|
21
|
+
/** Text color for content on secondary background */
|
|
22
|
+
secondaryContent?: string;
|
|
23
|
+
/** Accent brand color (hex, rgb, or oklch) */
|
|
24
|
+
accent?: string;
|
|
25
|
+
/** Text color for content on accent background */
|
|
26
|
+
accentContent?: string;
|
|
27
|
+
/** Neutral dark color (hex, rgb, or oklch) */
|
|
28
|
+
neutral?: string;
|
|
29
|
+
/** Text color for content on neutral background */
|
|
30
|
+
neutralContent?: string;
|
|
31
|
+
/** Main background color (base-100) */
|
|
32
|
+
base100?: string;
|
|
33
|
+
/** Slightly darker background (base-200) */
|
|
34
|
+
base200?: string;
|
|
35
|
+
/** Even darker background (base-300) */
|
|
36
|
+
base300?: string;
|
|
37
|
+
/** Default text color on base backgrounds */
|
|
38
|
+
baseContent?: string;
|
|
39
|
+
/** Info state color */
|
|
40
|
+
info?: string;
|
|
41
|
+
/** Text color for content on info background */
|
|
42
|
+
infoContent?: string;
|
|
43
|
+
/** Success state color */
|
|
44
|
+
success?: string;
|
|
45
|
+
/** Text color for content on success background */
|
|
46
|
+
successContent?: string;
|
|
47
|
+
/** Warning state color */
|
|
48
|
+
warning?: string;
|
|
49
|
+
/** Text color for content on warning background */
|
|
50
|
+
warningContent?: string;
|
|
51
|
+
/** Error state color */
|
|
52
|
+
error?: string;
|
|
53
|
+
/** Text color for content on error background */
|
|
54
|
+
errorContent?: string;
|
|
55
|
+
/** Border radius for large components like cards, modals (e.g., '1rem') */
|
|
56
|
+
radiusBox?: string;
|
|
57
|
+
/** Border radius for medium components like inputs, buttons (e.g., '0.5rem') */
|
|
58
|
+
radiusField?: string;
|
|
59
|
+
/** Border radius for small components like checkboxes, toggles (e.g., '0.25rem') */
|
|
60
|
+
radiusSelector?: string;
|
|
61
|
+
/** Base size for small components like checkboxes (e.g., '0.25rem') */
|
|
62
|
+
sizeSelector?: string;
|
|
63
|
+
/** Base size for form fields (e.g., '0.25rem') */
|
|
64
|
+
sizeField?: string;
|
|
65
|
+
/** Border width for components (e.g., '1px') */
|
|
66
|
+
border?: string;
|
|
67
|
+
/** Enable depth effect for components (0 or 1) */
|
|
68
|
+
depth?: 0 | 1;
|
|
69
|
+
/** Enable noise background effect for components (0 or 1) */
|
|
70
|
+
noise?: 0 | 1;
|
|
71
|
+
/** Color scheme hint for browser-provided UI elements */
|
|
72
|
+
colorScheme?: 'light' | 'dark';
|
|
73
|
+
}
|
|
@@ -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
|
+
}
|