@manifest-editor/manifest-preset 1.0.2 → 1.0.5

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/index.cjs CHANGED
@@ -94,12 +94,7 @@ function CanvasListing({
94
94
  const canvases = (0, import_components.useFastList)(items.get(), 24);
95
95
  (0, import_react.useEffect)(() => {
96
96
  if (canvas?.resource.source.id) {
97
- const key = items.get().findIndex((c) => c.id === canvas.resource.source.id);
98
- if (key !== -1) {
99
- open({ id: "current-canvas" });
100
- canvasActions.edit({ id: canvas.resource.source.id, type: "Canvas" }, key);
101
- return;
102
- }
97
+ return;
103
98
  }
104
99
  if (items.get().length) {
105
100
  open({ id: "current-canvas" });
@@ -217,9 +212,11 @@ var manifestPanel = {
217
212
  };
218
213
  function ManifestPanel() {
219
214
  const { edit, open } = (0, import_shell2.useLayoutActions)();
215
+ const current = (0, import_shell2.useEditingResource)();
220
216
  const { descriptive, technical } = (0, import_shell2.useManifestEditor)();
221
217
  const manifestId = technical.id.get();
222
218
  const manifest = { id: manifestId, type: "Manifest" };
219
+ const isInitial = (0, import_react2.useRef)(true);
223
220
  const label = descriptive.label.get();
224
221
  const summary = descriptive.summary.get();
225
222
  const requiredStatement = descriptive.requiredStatement.get();
@@ -227,6 +224,7 @@ function ManifestPanel() {
227
224
  (0, import_react2.useEffect)(() => {
228
225
  edit(manifest);
229
226
  open({ id: "overview" });
227
+ isInitial.current = false;
230
228
  }, []);
231
229
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.Sidebar, { children: [
232
230
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.SidebarHeader, { title: "Manifest summary" }),
package/dist/index.js CHANGED
@@ -71,12 +71,7 @@ function CanvasListing({
71
71
  const canvases = useFastList(items.get(), 24);
72
72
  useEffect(() => {
73
73
  if (canvas?.resource.source.id) {
74
- const key = items.get().findIndex((c) => c.id === canvas.resource.source.id);
75
- if (key !== -1) {
76
- open({ id: "current-canvas" });
77
- canvasActions.edit({ id: canvas.resource.source.id, type: "Canvas" }, key);
78
- return;
79
- }
74
+ return;
80
75
  }
81
76
  if (items.get().length) {
82
77
  open({ id: "current-canvas" });
@@ -166,8 +161,8 @@ function CanvasThumbnailsIcon() {
166
161
  }
167
162
 
168
163
  // src/left-panels/manifest.tsx
169
- import { useLayoutActions as useLayoutActions2, useManifestEditor as useManifestEditor2 } from "@manifest-editor/shell";
170
- import { useEffect as useEffect2 } from "react";
164
+ import { useEditingResource, useLayoutActions as useLayoutActions2, useManifestEditor as useManifestEditor2 } from "@manifest-editor/shell";
165
+ import { useEffect as useEffect2, useRef } from "react";
171
166
  import { LocaleString, ManifestMetadata } from "react-iiif-vault";
172
167
  import { Sidebar as Sidebar2, SidebarContent as SidebarContent2, SidebarHeader as SidebarHeader2 } from "@manifest-editor/components";
173
168
  import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -194,9 +189,11 @@ var manifestPanel = {
194
189
  };
195
190
  function ManifestPanel() {
196
191
  const { edit, open } = useLayoutActions2();
192
+ const current = useEditingResource();
197
193
  const { descriptive, technical } = useManifestEditor2();
198
194
  const manifestId = technical.id.get();
199
195
  const manifest = { id: manifestId, type: "Manifest" };
196
+ const isInitial = useRef(true);
200
197
  const label = descriptive.label.get();
201
198
  const summary = descriptive.summary.get();
202
199
  const requiredStatement = descriptive.requiredStatement.get();
@@ -204,6 +201,7 @@ function ManifestPanel() {
204
201
  useEffect2(() => {
205
202
  edit(manifest);
206
203
  open({ id: "overview" });
204
+ isInitial.current = false;
207
205
  }, []);
208
206
  return /* @__PURE__ */ jsxs2(Sidebar2, { children: [
209
207
  /* @__PURE__ */ jsx2(SidebarHeader2, { title: "Manifest summary" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifest-editor/manifest-preset",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
6
6
  "repository": {
@@ -40,25 +40,25 @@
40
40
  "@iiif/parser": "^2.1.2",
41
41
  "@iiif/presentation-3": "^2.2.3",
42
42
  "@iiif/presentation-3-normalized": "^0.9.7",
43
- "@manifest-editor/components": "^1.0.2",
44
- "@manifest-editor/creators": "^1.0.2",
45
- "@manifest-editor/editors": "^1.0.2",
46
- "@manifest-editor/shell": "^1.0.2",
47
- "react": "^18.2.0",
48
- "react-dom": "^18.2.0",
43
+ "@manifest-editor/components": "1.0.3",
44
+ "@manifest-editor/creators": "^1.0.5",
45
+ "@manifest-editor/editors": "^1.0.5",
46
+ "@manifest-editor/shell": "^1.0.5",
47
+ "react": "^18.3.1",
48
+ "react-dom": "^18.3.1",
49
49
  "react-iiif-vault": "^1.2.1",
50
50
  "styled-components": "6.1.8"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@manifest-editor/ui": "1.0.0",
54
54
  "@repo/eslint-config": "0.0.0",
55
- "@types/react": "^18.2.74",
56
- "@types/react-dom": "^18.2.24",
55
+ "@types/react": "^18.3.3",
56
+ "@types/react-dom": "^18.3.0",
57
57
  "tiny-invariant": "^1.3.3",
58
58
  "tsup": "^8.0.2"
59
59
  },
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "083fd2ce7d40755fb1857490e006e9854906d031"
63
+ "gitHead": "acdc6453683e4e8a9b40d59dfba94c5dfe203d1d"
64
64
  }