@triiiceratops/plugin-annotation-editor 1.0.0-rc.1 → 1.0.0-rc.2

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/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { User, DrawingStyle } from '@annotorious/openseadragon';
2
2
  import type { Component } from 'svelte';
3
3
  import type { PluginUiTarget } from '@triiiceratops/plugin-sdk';
4
- import type { PointStyle } from './utils/pointMarker';
4
+ import type { PointStyle } from 'triiiceratops/image-export';
5
5
  import type { W3CAnnotation, AdapterLoadResult } from './adapters/types';
6
6
  export type { PointStyle };
7
7
  export interface AnnotationEditorRuntimeContext<HostContext = unknown, TBody = W3CAnnotationBody> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triiiceratops/plugin-annotation-editor",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.2",
4
4
  "type": "module",
5
5
  "description": "Annotation editor plugin for the triiiceratops IIIF viewer, authored on @triiiceratops/plugin-sdk.",
6
6
  "license": "MIT",
@@ -53,8 +53,8 @@
53
53
  "lint:fix": "eslint . --fix --max-warnings 0"
54
54
  },
55
55
  "peerDependencies": {
56
- "triiiceratops": "workspace:^",
57
- "@triiiceratops/plugin-sdk": "workspace:^"
56
+ "triiiceratops": "^1.0.0-rc.26",
57
+ "@triiiceratops/plugin-sdk": "^1.0.0-rc.2"
58
58
  },
59
59
  "dependencies": {
60
60
  "@annotorious/annotorious": "^3.7.19",
@@ -63,14 +63,14 @@
63
63
  },
64
64
  "devDependencies": {
65
65
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
66
- "@triiiceratops/plugin-sdk": "workspace:*",
67
- "@triiiceratops/ui": "workspace:*",
66
+ "@triiiceratops/plugin-sdk": "1.0.0-rc.2",
67
+ "@triiiceratops/ui": "0.0.0",
68
68
  "@types/node": "^24.10.1",
69
69
  "@types/openseadragon": "^5.0.1",
70
70
  "@vitest/coverage-v8": "4.0.15",
71
71
  "svelte": "5.45.5",
72
72
  "svelte-check": "^4.3.4",
73
- "triiiceratops": "workspace:*",
73
+ "triiiceratops": "1.0.0-rc.26",
74
74
  "typescript": "~5.9.3",
75
75
  "vite": "^6.0.0",
76
76
  "vitest": "^4.0.15"
@@ -1,43 +0,0 @@
1
- import { getCanvasId } from 'triiiceratops/image-export';
2
- export type ChoiceGroup = {
3
- canvasId: string;
4
- choices: any[];
5
- selectedChoiceId: string | undefined;
6
- side: 'left' | 'right';
7
- };
8
- export type VisibleCanvasEntry = {
9
- canvasId: string;
10
- canvas: any;
11
- };
12
- export type PagedCanvasGroup = {
13
- startIndex: number;
14
- endIndex: number;
15
- entries: VisibleCanvasEntry[];
16
- };
17
- export type CanvasNavDirection = 'previous' | 'next';
18
- export type CanvasNavIcon = 'left' | 'right' | 'up' | 'down';
19
- export type CanvasNavLayout = {
20
- leftButton: CanvasNavDirection;
21
- rightButton: CanvasNavDirection;
22
- leftIcon: CanvasNavIcon;
23
- rightIcon: CanvasNavIcon;
24
- };
25
- export declare function shouldUseAbbreviatedChoiceLabels(viewingMode: ViewingMode, visibleChoiceGroups: ChoiceGroup[]): boolean;
26
- export declare function getCanvasNavLayout(viewingDirection: ViewingDirection): CanvasNavLayout;
27
- type ViewingMode = 'individuals' | 'paged' | 'continuous';
28
- type ViewingDirection = 'left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top';
29
- type VisibleChoiceGroupArgs = {
30
- canvases: any[];
31
- currentCanvasId: string | null;
32
- currentCanvasIndex: number;
33
- viewingMode: ViewingMode;
34
- pagedOffset: number;
35
- viewingDirection: ViewingDirection;
36
- getSelectedChoice: (canvasId: string) => string | undefined;
37
- };
38
- export { getCanvasId };
39
- export declare function getCanvasChoices(canvas: any): any;
40
- export declare function getCanvasBehaviors(canvas: any): string[];
41
- export declare function getPagedCanvasGroups(canvases: any[], pagedOffset: number): PagedCanvasGroup[];
42
- export declare function getVisibleCanvasEntries({ canvases, currentCanvasId, currentCanvasIndex, viewingMode, pagedOffset, }: Omit<VisibleChoiceGroupArgs, 'viewingDirection' | 'getSelectedChoice'>): VisibleCanvasEntry[];
43
- export declare function getVisibleChoiceGroups({ canvases, currentCanvasId, currentCanvasIndex, viewingMode, pagedOffset, viewingDirection, getSelectedChoice, }: VisibleChoiceGroupArgs): ChoiceGroup[];
@@ -1,12 +0,0 @@
1
- export type IiifTargetBounds = [number, number, number, number];
2
- export type NormalizedIiifTarget = {
3
- raw: unknown;
4
- targetId: string | null;
5
- canvasId: string | null;
6
- selectors: any[];
7
- xywh: IiifTargetBounds | null;
8
- };
9
- export declare function parseIiifXywh(value: string): IiifTargetBounds | null;
10
- export declare function getIiifCanvasId(targetId: string): string | null;
11
- export declare function extractIiifTargetId(target: unknown): string | null;
12
- export declare function normalizeIiifTargets(target: unknown): NormalizedIiifTarget[];
@@ -1,21 +0,0 @@
1
- /**
2
- * Shared utility for resolving IIIF language map values.
3
- *
4
- * IIIF v3 uses language maps: `{ "en": ["Hello"], "fr": ["Bonjour"] }`
5
- * Manifesto returns arrays of `{ value, locale/language }` objects.
6
- * IIIF v2 may use plain strings.
7
- *
8
- * This module provides a single resolution strategy used across the viewer.
9
- */
10
- /**
11
- * Resolve a IIIF language-mapped value to a single display string.
12
- *
13
- * Precedence: preferredLocale → 'en' → 'none'/unset → first available.
14
- */
15
- export declare function resolveLanguageValue(value: unknown, preferredLocale?: string): string;
16
- /**
17
- * Resolve a IIIF language-mapped value to all display strings
18
- * (for multi-value properties like metadata values with multiple entries
19
- * in a single language).
20
- */
21
- export declare function resolveAllLanguageValues(value: unknown, preferredLocale?: string): string[];
@@ -1,27 +0,0 @@
1
- /**
2
- * Shared point-marker styling for the annotation editor. A point looks the same
3
- * whether it is rendered read-only (OSDViewer overlay), selected, or edited, so
4
- * the radius/fill/stroke live in one place consumed by both the viewer overlay
5
- * and the editor's Annotorious styling (spec §3.4).
6
- */
7
- export interface PointStyle {
8
- /** Marker radius in screen (CSS) pixels. */
9
- radius?: number;
10
- /** Marker fill colour (any CSS colour the consumer renders). */
11
- fill?: string;
12
- /** Marker stroke colour. */
13
- stroke?: string;
14
- /** Marker stroke width in pixels. */
15
- strokeWidth?: number;
16
- }
17
- /**
18
- * Default marker radius in screen pixels. Chosen so the diameter (2 × radius)
19
- * equals the historical `POINT_MARKER_SIZE = 10` the read-only overlay used, so
20
- * existing viewers render unchanged when no `pointStyle` is configured.
21
- */
22
- export declare const DEFAULT_POINT_RADIUS = 5;
23
- /**
24
- * Resolve the effective marker radius (screen pixels) from a `pointStyle`
25
- * config, falling back to {@link DEFAULT_POINT_RADIUS} when unset or invalid.
26
- */
27
- export declare function resolvePointRadius(pointStyle?: PointStyle | null): number;