@manifest-editor/projects 2.2.1-next.0.eefc2e3 → 2.2.1

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.
Files changed (2) hide show
  1. package/README.md +81 -0
  2. package/package.json +5 -5
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ <p align="center">
2
+ <a href="https://github.com/digirati-co-uk/iiif-manifest-editor"><img src="https://raw.githubusercontent.com/digirati-co-uk/iiif-manifest-editor/main/apps/docs/content/img/logo.svg" width="360" alt="Manifest Editor"></a>
3
+ </p>
4
+ <p align="center">
5
+ <a href="https://www.npmjs.com/package/@manifest-editor/projects"><img src="https://img.shields.io/npm/v/%40manifest-editor%2Fprojects" alt="npm version"></a>
6
+ <a href="https://github.com/digirati-co-uk/iiif-manifest-editor/actions/workflows/build-test.yml"><img src="https://img.shields.io/github/actions/workflow/status/digirati-co-uk/iiif-manifest-editor/build-test.yml?branch=main&amp;label=build" alt="Build status"></a>
7
+ <a href="https://manifest-editor-docs.netlify.app/"><img src="https://img.shields.io/badge/docs-Manifest_Editor-blue" alt="Documentation"></a>
8
+ </p>
9
+
10
+ # @manifest-editor/projects
11
+
12
+ ## Getting started with Manifest Editor
13
+
14
+ For the complete editor, start with [`manifest-editor`](https://www.npmjs.com/package/manifest-editor) and its [installation and integration guide](https://github.com/digirati-co-uk/iiif-manifest-editor/tree/main/packages/manifest-editor#readme). It combines the editor UI, presets, creators, and editing APIs. This package is one part of that workspace.
15
+
16
+ ## About
17
+
18
+ Internal project state and backend integration for host applications that manage drafts, loading, and saving. Embedding the basic `ManifestEditor` component does not require this package.
19
+
20
+ ## Quick start
21
+
22
+ ```sh
23
+ npm install @manifest-editor/projects
24
+ ```
25
+
26
+ ```tsx
27
+ import { useOptionalCurrentProject } from "@manifest-editor/projects";
28
+
29
+ export function ProjectStatus() {
30
+ const project = useOptionalCurrentProject();
31
+ return <p>{project ? "Project open" : "No project selected"}</p>;
32
+ }
33
+ ```
34
+
35
+ Render under the host’s configured `ProjectProvider`. The provider also needs the shell’s multi-app context. It defaults to local-storage backend/loader implementations and accepts custom storage and backend adapters; it does not provide a hosted project service.
36
+
37
+ ## Projects, resources, and storage
38
+
39
+ A project record wraps a root Manifest/Collection reference with a name, optional filename/thumbnail, storage information, previews, publications, and created/modified timestamps. The record is not the manifest JSON. A backend manages project records; a storage loader supplies the project's Vault and resource data.
40
+
41
+ `ProjectProvider` combines these pieces and defaults to local-storage implementations. It requires the shell's multi-app context so selecting a project can select the appropriate app. Supply custom `backend` and `storage` props for another host environment; the storage lifecycle includes creating and closing Vault instances.
42
+
43
+ ## Create and navigate projects
44
+
45
+ Inside the provider tree:
46
+
47
+ ```tsx
48
+ import { useProjectCreators } from "@manifest-editor/projects";
49
+
50
+ export function NewProjectButton() {
51
+ const { createBlankManifest } = useProjectCreators();
52
+ return <button onClick={() => createBlankManifest()}>New manifest project</button>;
53
+ }
54
+ ```
55
+
56
+ `useProjectCreators()` also exposes `createProjectFromManifestId` and `createProjectFromCollectionId` for importing an external resource. The loading helpers fetch and normalise the supplied IIIF content before creating its project record.
57
+
58
+ `useProjectContext()` exposes `current`, `allProjects`, nullable `loadingStatus`, `canDelete`, and `actions`. `useCurrentProject()` requires a selection; use `useOptionalCurrentProject()` for launchers and empty states. Check nullable values before reading project fields.
59
+
60
+ ## Project actions
61
+
62
+ | Actions | Purpose |
63
+ | --- | --- |
64
+ | `switchProject`, `deselectProject` | Change the active selection. |
65
+ | `createProject`, `forkProject`, `deleteProject` | Manage records through the configured backend. |
66
+ | `saveProject` | Request a project-record save; resource persistence also depends on the storage loader. |
67
+ | `updateDetails`, `updateThumbnail`, `updateSettings`, `updateStorage` | Update record details. |
68
+ | `setPreview`, `removePreview` | Associate viewer instances with a project. |
69
+ | `createPublication`, `updatePublication`, `removePublication` | Manage publication records; these do not themselves deploy a website or publish to a repository. |
70
+ | `load`, `setLoadingStatus` | Internal state integration for host loaders. |
71
+
72
+ The earlier shell README's project section belongs here. App/panel navigation remains in the shell, while the project backend and storage lifecycle are owned by this package.
73
+
74
+ ## API overview
75
+
76
+ - `ProjectProvider`, `ProjectReactContext`, and loading context.
77
+ - `useProjectContext`, `useCurrentProject`, `useOptionalCurrentProject`, and `useProjectLoading`.
78
+ - Backend/action/loading hooks for connecting a host's project storage.
79
+ - `AppMenu` and `DraftTitleEditor` UI components.
80
+
81
+ See the [source exports](https://github.com/digirati-co-uk/iiif-manifest-editor/tree/main/packages/projects/src) for the complete API and TypeScript definitions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifest-editor/projects",
3
- "version": "2.2.1-next.0.eefc2e3",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "@iiif/parser": "4.0.1",
43
43
  "@iiif/presentation-3": "^2.2.3",
44
44
  "@iiif/presentation-3-normalized": "^0.9.7",
45
- "@manifest-editor/client-vault": "2.2.1-next.0.eefc2e3",
46
- "@manifest-editor/shell": "2.2.1-next.0.eefc2e3",
45
+ "@manifest-editor/client-vault": "2.2.1",
46
+ "@manifest-editor/shell": "2.2.1",
47
47
  "immer": "^10.0.4",
48
48
  "localforage": "^1.10.0",
49
49
  "react": "19.2.8",
@@ -54,7 +54,7 @@
54
54
  "tiny-use-debounce": "^1.0.4"
55
55
  },
56
56
  "devDependencies": {
57
- "@manifest-editor/ui": "2.2.0",
57
+ "@manifest-editor/ui": "2.2.1",
58
58
  "@types/react": "19.2.18",
59
59
  "@types/react-dom": "19.2.4",
60
60
  "@types/shallowequal": "^1.1.5",
@@ -66,7 +66,7 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "eefc2e321c6da5d194285621f4d26376088f2bb2",
69
+ "gitHead": "903673e7c35feed673fc100cb0efe34733057c91",
70
70
  "inlinedDependencies": {
71
71
  "react-accessible-dropdown-menu-hook": "4.0.0",
72
72
  "shallowequal": "1.1.0",