triiiceratops 0.11.1 → 0.12.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 +17 -9
- package/dist/{ArrowCounterClockwise-CN8KGaI0.js → ArrowCounterClockwise-CM9mGGcp.js} +1 -1
- package/dist/X-Bn7S7vUL.js +963 -0
- package/dist/{annotation_tool_point-BpZXtX5D.js → annotation_tool_point-LoRp_nrI.js} +1 -1
- package/dist/annotorious-openseadragon.es-tb5X-LtF.js +33045 -0
- package/dist/components/AnnotationOverlay.svelte +10 -17
- package/dist/components/DemoHeader.svelte +73 -5
- package/dist/components/MetadataDialog.svelte +4 -1
- package/dist/components/OSDViewer.svelte +39 -3
- package/dist/components/SearchPanel.svelte +8 -5
- package/dist/components/ThemeToggle.svelte +1 -1
- package/dist/components/ThumbnailGallery.svelte +229 -38
- package/dist/components/Toolbar.svelte +105 -6
- package/dist/components/TriiiceratopsViewer.svelte +37 -12
- package/dist/components/TriiiceratopsViewerElement.svelte +3 -1
- package/dist/custom-element.js +1 -0
- package/dist/{image_filters_reset-CyWg622b.js → image_filters_reset-CmWuQiOc.js} +1 -1
- package/dist/paraglide/messages/_index.d.ts +9 -0
- package/dist/paraglide/messages/_index.js +10 -1
- package/dist/paraglide/messages/settings_toggle_show_viewing_mode.d.ts +4 -0
- package/dist/paraglide/messages/settings_toggle_show_viewing_mode.js +33 -0
- package/dist/paraglide/messages/show_mode_toggle.d.ts +4 -0
- package/dist/paraglide/messages/show_mode_toggle.js +33 -0
- package/dist/paraglide/messages/toggle_single_page_mode.d.ts +4 -0
- package/dist/paraglide/messages/toggle_single_page_mode.js +33 -0
- package/dist/paraglide/messages/toggle_two_page_mode.d.ts +4 -0
- package/dist/paraglide/messages/toggle_two_page_mode.js +33 -0
- package/dist/paraglide/messages/two_page_mode.d.ts +4 -0
- package/dist/paraglide/messages/two_page_mode.js +33 -0
- package/dist/paraglide/messages/viewing_mode_individuals.d.ts +4 -0
- package/dist/paraglide/messages/viewing_mode_individuals.js +33 -0
- package/dist/paraglide/messages/viewing_mode_label.d.ts +4 -0
- package/dist/paraglide/messages/viewing_mode_label.js +33 -0
- package/dist/paraglide/messages/viewing_mode_paged.d.ts +4 -0
- package/dist/paraglide/messages/viewing_mode_paged.js +33 -0
- package/dist/paraglide/messages/viewing_mode_shift_pairing.d.ts +4 -0
- package/dist/paraglide/messages/viewing_mode_shift_pairing.js +33 -0
- package/dist/plugins/annotation-editor/AnnotationEditorController.svelte +5 -3
- package/dist/plugins/annotation-editor/AnnotationEditorPanel.svelte +3 -3
- package/dist/plugins/annotation-editor/AnnotationManager.svelte.d.ts +3 -0
- package/dist/plugins/annotation-editor/AnnotationManager.svelte.js +19 -14
- package/dist/plugins/annotation-editor/loader.svelte.js +2 -2
- package/dist/plugins/annotation-editor.js +1228 -32159
- package/dist/plugins/image-manipulation/ImageManipulationController.svelte +1 -1
- package/dist/plugins/image-manipulation.js +3 -3
- package/dist/state/manifests.svelte.d.ts +2 -1
- package/dist/state/manifests.svelte.js +5 -9
- package/dist/state/manifests.test.js +52 -50
- package/dist/state/viewer.svelte.d.ts +20 -1
- package/dist/state/viewer.svelte.js +150 -16
- package/dist/triiiceratops-bundle.js +3107 -2584
- package/dist/triiiceratops-element.iife.js +26 -26
- package/dist/triiiceratops.css +1 -1
- package/dist/types/config.d.ts +33 -0
- package/dist/utils/annotationAdapter.js +2 -2
- package/dist/utils/annotationAdapter.test.js +0 -1
- package/package.json +12 -2
- package/dist/X-i_EmjXwW.js +0 -906
|
@@ -122,4 +122,13 @@ export * from './image_filters_grayscale.js'
|
|
|
122
122
|
export * from './image_filters_reset.js'
|
|
123
123
|
export * from './annotation_tool_rectangle.js'
|
|
124
124
|
export * from './annotation_tool_polygon.js'
|
|
125
|
-
export * from './annotation_tool_point.js'
|
|
125
|
+
export * from './annotation_tool_point.js'
|
|
126
|
+
export * from './viewing_mode_label.js'
|
|
127
|
+
export * from './viewing_mode_individuals.js'
|
|
128
|
+
export * from './viewing_mode_paged.js'
|
|
129
|
+
export * from './viewing_mode_shift_pairing.js'
|
|
130
|
+
export * from './settings_toggle_show_viewing_mode.js'
|
|
131
|
+
export * from './toggle_two_page_mode.js'
|
|
132
|
+
export * from './toggle_single_page_mode.js'
|
|
133
|
+
export * from './show_mode_toggle.js'
|
|
134
|
+
export * from './two_page_mode.js'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const en_settings_toggle_show_viewing_mode = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Show Viewing Mode`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const de_settings_toggle_show_viewing_mode = en_settings_toggle_show_viewing_mode;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const settings_toggle_show_viewing_mode = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.settings_toggle_show_viewing_mode(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("settings_toggle_show_viewing_mode", locale)
|
|
31
|
+
if (locale === "en") return en_settings_toggle_show_viewing_mode(inputs)
|
|
32
|
+
return de_settings_toggle_show_viewing_mode(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const de_show_mode_toggle = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Modus-Umschalter anzeigen`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const en_show_mode_toggle = () => /** @type {LocalizedString} */ ('show_mode_toggle')
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const show_mode_toggle = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.show_mode_toggle(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("show_mode_toggle", locale)
|
|
31
|
+
if (locale === "en") return en_show_mode_toggle(inputs)
|
|
32
|
+
return de_show_mode_toggle(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const de_toggle_single_page_mode = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Wechseln Sie in den Einzelseitenmodus`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const en_toggle_single_page_mode = () => /** @type {LocalizedString} */ ('toggle_single_page_mode')
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const toggle_single_page_mode = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.toggle_single_page_mode(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("toggle_single_page_mode", locale)
|
|
31
|
+
if (locale === "en") return en_toggle_single_page_mode(inputs)
|
|
32
|
+
return de_toggle_single_page_mode(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const de_toggle_two_page_mode = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Wechseln Sie in den Zwei-Seiten-Modus`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const en_toggle_two_page_mode = () => /** @type {LocalizedString} */ ('toggle_two_page_mode')
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const toggle_two_page_mode = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.toggle_two_page_mode(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("toggle_two_page_mode", locale)
|
|
31
|
+
if (locale === "en") return en_toggle_two_page_mode(inputs)
|
|
32
|
+
return de_toggle_two_page_mode(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const de_two_page_mode = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Zwei-Seiten-Modus`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const en_two_page_mode = () => /** @type {LocalizedString} */ ('two_page_mode')
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const two_page_mode = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.two_page_mode(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("two_page_mode", locale)
|
|
31
|
+
if (locale === "en") return en_two_page_mode(inputs)
|
|
32
|
+
return de_two_page_mode(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const en_viewing_mode_individuals = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Individuals`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const de_viewing_mode_individuals = en_viewing_mode_individuals;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const viewing_mode_individuals = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.viewing_mode_individuals(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("viewing_mode_individuals", locale)
|
|
31
|
+
if (locale === "en") return en_viewing_mode_individuals(inputs)
|
|
32
|
+
return de_viewing_mode_individuals(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const en_viewing_mode_label = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Viewing Mode`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const de_viewing_mode_label = en_viewing_mode_label;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const viewing_mode_label = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.viewing_mode_label(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("viewing_mode_label", locale)
|
|
31
|
+
if (locale === "en") return en_viewing_mode_label(inputs)
|
|
32
|
+
return de_viewing_mode_label(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const en_viewing_mode_paged = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Paged`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const de_viewing_mode_paged = en_viewing_mode_paged;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const viewing_mode_paged = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.viewing_mode_paged(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("viewing_mode_paged", locale)
|
|
31
|
+
if (locale === "en") return en_viewing_mode_paged(inputs)
|
|
32
|
+
return de_viewing_mode_paged(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
|
4
|
+
|
|
5
|
+
const en_viewing_mode_shift_pairing = /** @type {(inputs: {}) => LocalizedString} */ () => {
|
|
6
|
+
return /** @type {LocalizedString} */ (`Shift Page Pairing`)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** @type {(inputs: {}) => LocalizedString} */
|
|
10
|
+
const de_viewing_mode_shift_pairing = en_viewing_mode_shift_pairing;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "de" }} options
|
|
22
|
+
* @returns {LocalizedString}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const viewing_mode_shift_pairing = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.viewing_mode_shift_pairing(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("viewing_mode_shift_pairing", locale)
|
|
31
|
+
if (locale === "en") return en_viewing_mode_shift_pairing(inputs)
|
|
32
|
+
return de_viewing_mode_shift_pairing(inputs)
|
|
33
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getContext, onMount, onDestroy } from 'svelte';
|
|
2
|
+
import { getContext, onMount, onDestroy, untrack } from 'svelte';
|
|
3
3
|
import {
|
|
4
4
|
VIEWER_STATE_KEY,
|
|
5
5
|
type ViewerState,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
// Props from the plugin system
|
|
16
16
|
let {
|
|
17
|
-
isOpen = false,
|
|
17
|
+
isOpen: _isOpen = false,
|
|
18
18
|
close,
|
|
19
19
|
config,
|
|
20
20
|
}: {
|
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
|
|
28
28
|
// UI state
|
|
29
29
|
let isEditing = $state(false);
|
|
30
|
-
let activeTool = $state<DrawingTool>(
|
|
30
|
+
let activeTool = $state<DrawingTool>(
|
|
31
|
+
untrack(() => config.defaultTool ?? 'rectangle'),
|
|
32
|
+
);
|
|
31
33
|
let selectedAnnotation = $state<any>(null);
|
|
32
34
|
let showDeleteConfirm = $state(false);
|
|
33
35
|
let pendingDeleteId = $state<string | null>(null);
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
{m.annotation_editor_tool_label()}
|
|
159
159
|
</p>
|
|
160
160
|
<div class="join">
|
|
161
|
-
{#each availableTools as tool}
|
|
161
|
+
{#each availableTools as tool (tool)}
|
|
162
162
|
{@const Icon = toolIcons[tool] ?? Rectangle}
|
|
163
163
|
{@const toolName =
|
|
164
164
|
{
|
|
@@ -221,14 +221,14 @@
|
|
|
221
221
|
</div>
|
|
222
222
|
|
|
223
223
|
<div class="space-y-3 max-h-[40vh] overflow-y-auto pr-1">
|
|
224
|
-
{#each editableBodies as body, i}
|
|
224
|
+
{#each editableBodies as body, i (i)}
|
|
225
225
|
<div class="card bg-base-200 p-2 space-y-2">
|
|
226
226
|
<div class="flex items-center gap-2">
|
|
227
227
|
<select
|
|
228
228
|
class="select select-xs select-bordered flex-1"
|
|
229
229
|
bind:value={body.purpose}
|
|
230
230
|
>
|
|
231
|
-
{#each W3C_PURPOSES as purpose}
|
|
231
|
+
{#each W3C_PURPOSES as purpose (purpose)}
|
|
232
232
|
<option
|
|
233
233
|
value={purpose}
|
|
234
234
|
class="capitalize">{purpose}</option
|
|
@@ -8,6 +8,9 @@ export declare class AnnotationManager {
|
|
|
8
8
|
private adapter;
|
|
9
9
|
private annotorious;
|
|
10
10
|
private osdViewer;
|
|
11
|
+
private OSD;
|
|
12
|
+
private createOSDAnnotator;
|
|
13
|
+
private W3CImageFormat;
|
|
11
14
|
private currentManifestId;
|
|
12
15
|
private currentCanvasId;
|
|
13
16
|
private isDrawingEnabled;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { createOSDAnnotator, W3CImageFormat, } from '@annotorious/openseadragon';
|
|
2
|
-
import OpenSeadragon from 'openseadragon';
|
|
3
1
|
import { LocalStorageAdapter } from './adapters/LocalStorageAdapter';
|
|
4
2
|
/**
|
|
5
3
|
* Manages the Annotorious instance and annotation CRUD operations.
|
|
@@ -10,8 +8,11 @@ export class AnnotationManager {
|
|
|
10
8
|
adapter;
|
|
11
9
|
annotorious = null;
|
|
12
10
|
// Store reference to OSD viewer for mouse nav toggling
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
11
|
osdViewer = null;
|
|
12
|
+
// Dynamic dependencies
|
|
13
|
+
OSD = null;
|
|
14
|
+
createOSDAnnotator = null;
|
|
15
|
+
W3CImageFormat = null;
|
|
15
16
|
// Current canvas tracking
|
|
16
17
|
currentManifestId = null;
|
|
17
18
|
currentCanvasId = null;
|
|
@@ -27,7 +28,6 @@ export class AnnotationManager {
|
|
|
27
28
|
this.adapter = config.adapter ?? new LocalStorageAdapter();
|
|
28
29
|
this.activeTool = config.defaultTool ?? 'rectangle';
|
|
29
30
|
}
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
31
|
init(viewer, canvasId) {
|
|
32
32
|
if (!viewer) {
|
|
33
33
|
console.error('[AnnotationManager] Cannot init: Viewer is null');
|
|
@@ -63,16 +63,25 @@ export class AnnotationManager {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
initAnnotorious(viewer, canvasId) {
|
|
66
|
+
async initAnnotorious(viewer, canvasId) {
|
|
68
67
|
if (this.annotorious)
|
|
69
68
|
return;
|
|
70
69
|
try {
|
|
70
|
+
// Load dynamic dependencies
|
|
71
|
+
if (!this.createOSDAnnotator || !this.W3CImageFormat) {
|
|
72
|
+
const mod = await import('@annotorious/openseadragon');
|
|
73
|
+
this.createOSDAnnotator = mod.createOSDAnnotator;
|
|
74
|
+
this.W3CImageFormat = mod.W3CImageFormat;
|
|
75
|
+
}
|
|
76
|
+
if (!this.OSD) {
|
|
77
|
+
const mod = await import('openseadragon');
|
|
78
|
+
this.OSD = mod.default || mod;
|
|
79
|
+
}
|
|
71
80
|
const sourceId = canvasId ?? 'unknown';
|
|
72
81
|
// Initial drawing enabled state only if tool is NOT point (Annotorious handles others)
|
|
73
82
|
const initialDrawingEnabled = this.isDrawingEnabled && this.activeTool !== 'point';
|
|
74
83
|
const config = {
|
|
75
|
-
adapter: W3CImageFormat(sourceId),
|
|
84
|
+
adapter: this.W3CImageFormat(sourceId),
|
|
76
85
|
drawingEnabled: initialDrawingEnabled,
|
|
77
86
|
autoSave: false,
|
|
78
87
|
drawingMode: 'click',
|
|
@@ -90,7 +99,7 @@ export class AnnotationManager {
|
|
|
90
99
|
return ''; // No class for normal annotations
|
|
91
100
|
},
|
|
92
101
|
};
|
|
93
|
-
const anno = createOSDAnnotator(viewer, config);
|
|
102
|
+
const anno = this.createOSDAnnotator(viewer, config);
|
|
94
103
|
this.annotorious = anno;
|
|
95
104
|
if (this.config.user) {
|
|
96
105
|
anno.setUser(this.config.user);
|
|
@@ -104,14 +113,13 @@ export class AnnotationManager {
|
|
|
104
113
|
this.setupEvents();
|
|
105
114
|
// Apply pending state
|
|
106
115
|
this.updateDrawingMode(this.isDrawingEnabled);
|
|
107
|
-
|
|
116
|
+
anno.setVisible(true); // Always start visible
|
|
108
117
|
}
|
|
109
118
|
catch (error) {
|
|
110
119
|
console.error('[AnnotationManager] Failed to create annotator:', error);
|
|
111
120
|
}
|
|
112
121
|
}
|
|
113
122
|
// ... (injectStyles remains same) ...
|
|
114
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
115
123
|
handlePointClick(event) {
|
|
116
124
|
if (!this.osdViewer || !this.annotorious)
|
|
117
125
|
return;
|
|
@@ -128,8 +136,7 @@ export class AnnotationManager {
|
|
|
128
136
|
// Calculate width/height based on "Screen Pixels" to ensure visibility
|
|
129
137
|
// User requested a 2x2 pixel rectangle.
|
|
130
138
|
const targetScreenPixels = 2;
|
|
131
|
-
|
|
132
|
-
const OSD = OpenSeadragon;
|
|
139
|
+
const OSD = this.OSD;
|
|
133
140
|
const p1 = this.osdViewer.viewport.pointFromPixel(new OSD.Point(0, 0));
|
|
134
141
|
const p2 = this.osdViewer.viewport.pointFromPixel(new OSD.Point(targetScreenPixels, 0));
|
|
135
142
|
const imgP1 = tiledImage.viewportToImageCoordinates(p1);
|
|
@@ -175,7 +182,6 @@ export class AnnotationManager {
|
|
|
175
182
|
this.annotorious.addAnnotation(annotation);
|
|
176
183
|
// Wait for render cycle before selecting coverage
|
|
177
184
|
setTimeout(() => {
|
|
178
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
185
|
this.annotorious.setSelected(id);
|
|
180
186
|
}, 50);
|
|
181
187
|
}
|
|
@@ -223,7 +229,6 @@ export class AnnotationManager {
|
|
|
223
229
|
get availableTools() {
|
|
224
230
|
return this.config.tools ?? ['rectangle', 'polygon', 'point'];
|
|
225
231
|
}
|
|
226
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
227
232
|
injectStyles(viewer) {
|
|
228
233
|
if (!viewer.element)
|
|
229
234
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { manifestsState } from '../../state/manifests.svelte';
|
|
1
|
+
// import { manifestsState } from '../../state/manifests.svelte';
|
|
2
2
|
/**
|
|
3
3
|
* Creates a reactive loader that syncs annotations from the adapter to the viewer state.
|
|
4
4
|
* This runs independently of the Annotation Editor UI component.
|
|
@@ -21,7 +21,7 @@ export function createLoader(adapter) {
|
|
|
21
21
|
// Load annotations for this canvas
|
|
22
22
|
adapter
|
|
23
23
|
.load(manifestId, canvasId)
|
|
24
|
-
.then((
|
|
24
|
+
.then((_annotations) => {
|
|
25
25
|
// Success handling
|
|
26
26
|
})
|
|
27
27
|
.catch((err) => {
|