@triiiceratops/plugin-image-export 1.0.0-rc.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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The image-download plugin, authored entirely on `@triiiceratops/plugin-sdk`.
3
+ *
4
+ * `definePlugin` returns the framework-neutral factory core activates through the
5
+ * structural seam (it carries its own `activate(host)`); core never imports this
6
+ * package or its Svelte runtime. The UI is Svelte, mounted through the neutral
7
+ * `view.mount(container, context)` contract and torn down by the returned
8
+ * cleanup. Styles install through the SDK style service (root-aware), strings
9
+ * resolve through the per-viewer locale service over this package's catalog, and
10
+ * the toolbar glyph is a `svgIcon` descriptor. Export reads canvas geometry from
11
+ * the raw OSD-backed viewer model, so the plugin declares
12
+ * `requiredCapabilities: ['osd@5']`.
13
+ *
14
+ * This plugin's validation duty (SPEC.md Plugin Migration) is asynchronous
15
+ * operations and binary output: the panel runs async IIIF fetch/compositing and
16
+ * produces a download-ready `Blob` through the SDK seam.
17
+ */
18
+ import { type SdkPlugin } from '@triiiceratops/plugin-sdk';
19
+ /** The image-download plugin factory. Activate it explicitly, per viewer. */
20
+ export declare const ImageDownloadPlugin: SdkPlugin;
@@ -0,0 +1 @@
1
+ export declare function reportImageDownloadError(node: EventTarget, error: unknown, retry: () => void): void;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The plugin's package-owned global CSS + its style-service install id, shaped
3
+ * by {@link definePluginStyles} into the `STYLES` / `STYLE_ID` exports the
4
+ * activation installs. Class names are namespaced `tri-id-*` since these rules
5
+ * are not Svelte-scoped (they are installed globally into the viewer root).
6
+ *
7
+ * Core-owned-chrome path (ticket 04): core renders the toolbar button and the
8
+ * docked panel's header/title and owns open/close + docking, so this stylesheet
9
+ * carries NO toggle button and NO `position: absolute` — only the layout of the
10
+ * panel *content* (body + footer). The controls themselves are themed by the
11
+ * bundled `@triiiceratops/ui` primitives; these rules only lay out the content
12
+ * and restore `main`'s Panel look with the current `--tri-` theme tokens.
13
+ */
14
+ export declare const STYLES: string, STYLE_ID: string;
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@triiiceratops/plugin-image-export",
3
+ "version": "1.0.0-rc.0",
4
+ "type": "module",
5
+ "description": "Image download (single/composite/current-view export) plugin for the triiiceratops IIIF viewer, authored on @triiiceratops/plugin-sdk.",
6
+ "license": "MIT",
7
+ "author": "David Flood",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/d-flood/triiiceratops.git",
11
+ "directory": "packages/plugin-image-export"
12
+ },
13
+ "homepage": "https://d-flood.github.io/triiiceratops/",
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "provenance": true
17
+ },
18
+ "private": false,
19
+ "engines": {
20
+ "node": ">=22"
21
+ },
22
+ "sideEffects": [
23
+ "./dist/iife.js"
24
+ ],
25
+ "files": [
26
+ "dist",
27
+ "LICENSE"
28
+ ],
29
+ "main": "./dist/index.js",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js"
36
+ },
37
+ "./iife": "./dist/iife.js"
38
+ },
39
+ "peerDependencies": {
40
+ "triiiceratops": "^1.0.0-rc.25",
41
+ "@triiiceratops/plugin-sdk": "^1.0.0-rc.0"
42
+ },
43
+ "devDependencies": {
44
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
45
+ "@vitest/coverage-v8": "4.0.15",
46
+ "svelte": "5.45.5",
47
+ "svelte-check": "^4.3.4",
48
+ "typescript": "~5.9.3",
49
+ "vite": "^6.0.0",
50
+ "vitest": "^4.0.15",
51
+ "@triiiceratops/plugin-sdk": "1.0.0-rc.0",
52
+ "@triiiceratops/ui": "0.0.0",
53
+ "triiiceratops": "1.0.0-rc.25"
54
+ },
55
+ "scripts": {
56
+ "build": "pnpm build:esm && pnpm build:iife && pnpm build:types",
57
+ "build:esm": "BUILD_FORMAT=es vite build",
58
+ "build:iife": "BUILD_FORMAT=iife vite build",
59
+ "build:types": "tsc -p tsconfig.build.json",
60
+ "check": "svelte-check --tsconfig ./tsconfig.json --fail-on-warnings && tsc -p tsconfig.build.json --noEmit",
61
+ "test": "vitest run",
62
+ "clean": "rm -rf dist",
63
+ "test:coverage": "vitest run --coverage",
64
+ "lint": "eslint . --max-warnings 0",
65
+ "lint:fix": "eslint . --fix --max-warnings 0"
66
+ }
67
+ }