@manifest-editor/manifest-preset 1.0.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/LICENSE +21 -0
- package/dist/index.cjs +343 -0
- package/dist/index.d.cts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +335 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 digirati-co-uk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.tsx
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
centerPanels: () => centerPanels,
|
|
24
|
+
creators: () => creators,
|
|
25
|
+
default: () => src_default,
|
|
26
|
+
editors: () => editors,
|
|
27
|
+
leftPanels: () => leftPanels,
|
|
28
|
+
modals: () => modals,
|
|
29
|
+
resources: () => resources,
|
|
30
|
+
rightPanels: () => rightPanels
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(src_exports);
|
|
33
|
+
var import_editors2 = require("@manifest-editor/editors");
|
|
34
|
+
var import_creators = require("@manifest-editor/creators");
|
|
35
|
+
var import_shell4 = require("@manifest-editor/shell");
|
|
36
|
+
|
|
37
|
+
// src/left-panels/canvas-listing.tsx
|
|
38
|
+
var import_editors = require("@manifest-editor/editors");
|
|
39
|
+
var import_shell = require("@manifest-editor/shell");
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
var import_components = require("@manifest-editor/components");
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
var ListingIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
|
+
"svg",
|
|
45
|
+
{
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
viewBox: "0 0 24 24",
|
|
48
|
+
width: "1em",
|
|
49
|
+
height: "1em",
|
|
50
|
+
"aria-labelledby": titleId,
|
|
51
|
+
...props,
|
|
52
|
+
children: [
|
|
53
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("title", { id: titleId, children: title }) : null,
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "none", children: [
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M0 0h24v24H0V0z" }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M0 0h24v24H0V0z", opacity: ".87" })
|
|
57
|
+
] }),
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
"path",
|
|
60
|
+
{
|
|
61
|
+
d: "M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z",
|
|
62
|
+
fill: "currentColor"
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
var canvasListing = {
|
|
69
|
+
id: "canvas-listing",
|
|
70
|
+
label: "Canvases",
|
|
71
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListingIcon, {}),
|
|
72
|
+
render: (state, ctx, app) => {
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
CanvasListing,
|
|
75
|
+
{
|
|
76
|
+
gridView: state.gridView || false,
|
|
77
|
+
onChangeGridView: (gridView) => ctx.actions.change("canvas-listing", { gridView })
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
function CanvasListing({
|
|
83
|
+
gridView,
|
|
84
|
+
onChangeGridView
|
|
85
|
+
}) {
|
|
86
|
+
const { edit, open } = (0, import_shell.useLayoutActions)();
|
|
87
|
+
const { structural, technical } = (0, import_shell.useManifestEditor)();
|
|
88
|
+
const [toggled, toggle] = (0, import_editors.useToggleList)();
|
|
89
|
+
const canvas = (0, import_editors.useInStack)("Canvas");
|
|
90
|
+
const { items } = structural;
|
|
91
|
+
const manifestId = technical.id.get();
|
|
92
|
+
const manifest = { id: manifestId, type: "Manifest" };
|
|
93
|
+
const [canCreateCanvas, canvasActions] = (0, import_shell.useCreator)(manifest, "items", "Canvas");
|
|
94
|
+
const canvases = (0, import_components.useFastList)(items.get(), 24);
|
|
95
|
+
(0, import_react.useEffect)(() => {
|
|
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
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (items.get().length) {
|
|
105
|
+
open({ id: "current-canvas" });
|
|
106
|
+
canvasActions.edit(items.get()[0]);
|
|
107
|
+
}
|
|
108
|
+
}, []);
|
|
109
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
110
|
+
const selected = document.querySelector('[data-canvas-selected="true"]');
|
|
111
|
+
if (selected) {
|
|
112
|
+
selected.scrollIntoView({ block: "center" });
|
|
113
|
+
}
|
|
114
|
+
}, [canvases, gridView]);
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_components.Sidebar, { children: [
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
117
|
+
import_components.SidebarHeader,
|
|
118
|
+
{
|
|
119
|
+
title: "Canvases",
|
|
120
|
+
actions: [
|
|
121
|
+
{
|
|
122
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: gridView ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListingIcon, { width: 24, height: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CanvasThumbnailsIcon, {}) }),
|
|
123
|
+
title: gridView ? "List view" : "Grid view",
|
|
124
|
+
onClick: () => {
|
|
125
|
+
onChangeGridView(!gridView);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListEditIcon, {}),
|
|
130
|
+
title: "Edit canvases",
|
|
131
|
+
disabled: gridView,
|
|
132
|
+
toggled: toggled.items,
|
|
133
|
+
onClick: () => toggle("items")
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CreateCanvasIcon, {}),
|
|
137
|
+
title: "Add new canvas",
|
|
138
|
+
onClick: () => canvasActions.create(),
|
|
139
|
+
disabled: !canCreateCanvas
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
gridView ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.SidebarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ThumbnailGridContainer, { children: canvases.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
145
|
+
import_components.CanvasThumbnailGridItem,
|
|
146
|
+
{
|
|
147
|
+
id: item.id,
|
|
148
|
+
selected: canvas?.resource.source.id === item.id,
|
|
149
|
+
onClick: () => {
|
|
150
|
+
open({ id: "current-canvas" });
|
|
151
|
+
canvasActions.edit(item);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
item.id
|
|
155
|
+
)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.SidebarContent, { className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_editors.InputContainer, { $wide: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
|
+
import_editors.CanvasList,
|
|
157
|
+
{
|
|
158
|
+
id: items.focusId(),
|
|
159
|
+
list: items.get() || [],
|
|
160
|
+
inlineHandle: false,
|
|
161
|
+
activeId: canvas?.resource.source.id,
|
|
162
|
+
reorder: toggled.items ? (t) => items.reorder(t.startIndex, t.endIndex) : void 0,
|
|
163
|
+
onSelect: (item, idx) => {
|
|
164
|
+
open({ id: "current-canvas" });
|
|
165
|
+
canvasActions.edit(item, idx);
|
|
166
|
+
},
|
|
167
|
+
createActions: (0, import_editors.createAppActions)(items)
|
|
168
|
+
}
|
|
169
|
+
) }) })
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
172
|
+
function ListEditIcon() {
|
|
173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z" })
|
|
176
|
+
] });
|
|
177
|
+
}
|
|
178
|
+
function CanvasThumbnailsIcon() {
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
182
|
+
"path",
|
|
183
|
+
{
|
|
184
|
+
d: "M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z",
|
|
185
|
+
fill: "currentColor"
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/left-panels/manifest.tsx
|
|
192
|
+
var import_shell2 = require("@manifest-editor/shell");
|
|
193
|
+
var import_react2 = require("react");
|
|
194
|
+
var import_react_iiif_vault = require("react-iiif-vault");
|
|
195
|
+
var import_components2 = require("@manifest-editor/components");
|
|
196
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
197
|
+
function ManifestIcon({ title, titleId, ...props }) {
|
|
198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
|
|
199
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { id: titleId, children: title }) : null,
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
202
|
+
"path",
|
|
203
|
+
{
|
|
204
|
+
d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z",
|
|
205
|
+
fill: "currentColor"
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
] });
|
|
209
|
+
}
|
|
210
|
+
var manifestPanel = {
|
|
211
|
+
id: "left-panel-manifest",
|
|
212
|
+
label: "Manifest summary",
|
|
213
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ManifestIcon, {}),
|
|
214
|
+
render: (state, ctx, app) => {
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ManifestPanel, {});
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
function ManifestPanel() {
|
|
219
|
+
const { edit, open } = (0, import_shell2.useLayoutActions)();
|
|
220
|
+
const { descriptive, technical } = (0, import_shell2.useManifestEditor)();
|
|
221
|
+
const manifestId = technical.id.get();
|
|
222
|
+
const manifest = { id: manifestId, type: "Manifest" };
|
|
223
|
+
const label = descriptive.label.get();
|
|
224
|
+
const summary = descriptive.summary.get();
|
|
225
|
+
const requiredStatement = descriptive.requiredStatement.get();
|
|
226
|
+
const metadata = descriptive.metadata.get();
|
|
227
|
+
(0, import_react2.useEffect)(() => {
|
|
228
|
+
edit(manifest);
|
|
229
|
+
open({ id: "overview" });
|
|
230
|
+
}, []);
|
|
231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.Sidebar, { children: [
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.SidebarHeader, { title: "Manifest summary" }),
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.SidebarContent, { className: "p-4", children: [
|
|
234
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_iiif_vault.LocaleString, { as: "h2", className: "text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400", children: label }) : null,
|
|
235
|
+
summary ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_iiif_vault.LocaleString, { as: "p", className: "text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2", children: summary }) : null,
|
|
236
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", {}),
|
|
237
|
+
requiredStatement ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "py-2 text-black", children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
240
|
+
import_react_iiif_vault.LocaleString,
|
|
241
|
+
{
|
|
242
|
+
as: "h4",
|
|
243
|
+
className: "font-bold text-black w-full text-sm font-semibold mb-0 [&>a]:underline [&>a]:hover:text-slate-400",
|
|
244
|
+
children: requiredStatement.label
|
|
245
|
+
}
|
|
246
|
+
),
|
|
247
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
248
|
+
import_react_iiif_vault.LocaleString,
|
|
249
|
+
{
|
|
250
|
+
enableDangerouslySetInnerHTML: true,
|
|
251
|
+
className: "text-sm [&>a]:underline [&>a]:hover:text-slate-400",
|
|
252
|
+
children: requiredStatement.value
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] }),
|
|
256
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("hr", {})
|
|
257
|
+
] }) : null,
|
|
258
|
+
metadata && metadata.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "py-2 text-gray-400", children: "You can add some descriptive metadata for this manifest using the editing panel on the right" }) : null,
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
260
|
+
import_react_iiif_vault.ManifestMetadata,
|
|
261
|
+
{
|
|
262
|
+
allowHtml: true,
|
|
263
|
+
classes: {
|
|
264
|
+
container: "w-full",
|
|
265
|
+
row: "border-b border-gray-200 flex flex-col flex-wrap py-2",
|
|
266
|
+
label: "font-bold text-black w-full text-sm font-semibold mb-1",
|
|
267
|
+
value: "text-sm text-black block [&>span>a]:underline [&>span>a]:hover:text-slate-400",
|
|
268
|
+
empty: "text-gray-400"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
] })
|
|
273
|
+
] });
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/center-panels/manifest-overview.tsx
|
|
277
|
+
var import_components3 = require("@manifest-editor/components");
|
|
278
|
+
var import_shell3 = require("@manifest-editor/shell");
|
|
279
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
280
|
+
var manifestOverview = {
|
|
281
|
+
id: "overview",
|
|
282
|
+
label: "Overview",
|
|
283
|
+
icon: "",
|
|
284
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ManifestOverview, {})
|
|
285
|
+
};
|
|
286
|
+
function ManifestOverview() {
|
|
287
|
+
const { edit, open } = (0, import_shell3.useLayoutActions)();
|
|
288
|
+
const { structural, technical } = (0, import_shell3.useManifestEditor)();
|
|
289
|
+
const { items } = structural;
|
|
290
|
+
const manifestId = technical.id.get();
|
|
291
|
+
const manifest = { id: manifestId, type: "Manifest" };
|
|
292
|
+
const [canCreateCanvas, canvasActions] = (0, import_shell3.useCreator)(manifest, "items", "Canvas");
|
|
293
|
+
const canvases = (0, import_components3.useFastList)(items.get(), 24);
|
|
294
|
+
if (!canvases || canvases.length === 0) {
|
|
295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components3.ManifestOverviewEmptyState, { onCreate: canvasActions.create, canCreate: canCreateCanvas }) });
|
|
296
|
+
}
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components3.ThumbnailGridContainer, { wide: true, children: canvases.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
298
|
+
import_components3.CanvasThumbnailGridItem,
|
|
299
|
+
{
|
|
300
|
+
id: item.id,
|
|
301
|
+
onClick: () => {
|
|
302
|
+
open({ id: "current-canvas" });
|
|
303
|
+
open({ id: "canvas-listing", state: { gridView: true } });
|
|
304
|
+
canvasActions.edit(item);
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
item.id
|
|
308
|
+
)) });
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// src/index.tsx
|
|
312
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
313
|
+
var src_default = { id: "manifest-editor", title: "Manifest Editor", project: true, projectType: "Manifest" };
|
|
314
|
+
var centerPanels = [
|
|
315
|
+
manifestOverview,
|
|
316
|
+
{
|
|
317
|
+
id: "current-canvas",
|
|
318
|
+
label: "Current canvas",
|
|
319
|
+
icon: "",
|
|
320
|
+
render: (state, { actions }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_editors2.CanvasPanelEditor, {})
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: "export",
|
|
324
|
+
label: "Export",
|
|
325
|
+
icon: "",
|
|
326
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_shell4.ExportPanel, {})
|
|
327
|
+
}
|
|
328
|
+
];
|
|
329
|
+
var leftPanels = [
|
|
330
|
+
manifestPanel,
|
|
331
|
+
canvasListing
|
|
332
|
+
// @todo we will come back to the image grid
|
|
333
|
+
// {
|
|
334
|
+
// id: "image-grid",
|
|
335
|
+
// label: "Image grid",
|
|
336
|
+
// render: () => <ManifestItemsGrid />,
|
|
337
|
+
// },
|
|
338
|
+
];
|
|
339
|
+
var rightPanels = [import_shell4.baseEditor];
|
|
340
|
+
var modals = [import_shell4.baseCreator];
|
|
341
|
+
var editors = import_editors2.allEditors;
|
|
342
|
+
var creators = import_creators.allCreators;
|
|
343
|
+
var resources = ["Manifest", "Canvas", "ContentResource", "Agent", "AnnotationPage", "Annotation", "Range"];
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as _manifest_editor_creator_api from '@manifest-editor/creator-api';
|
|
2
|
+
import * as _manifest_editor_shell from '@manifest-editor/shell';
|
|
3
|
+
import { LayoutPanel } from '@manifest-editor/shell';
|
|
4
|
+
|
|
5
|
+
declare const _default: {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
project: boolean;
|
|
9
|
+
projectType: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare const centerPanels: LayoutPanel[];
|
|
13
|
+
declare const leftPanels: LayoutPanel[];
|
|
14
|
+
declare const rightPanels: LayoutPanel[];
|
|
15
|
+
declare const modals: LayoutPanel[];
|
|
16
|
+
declare const editors: _manifest_editor_shell.EditorDefinition[];
|
|
17
|
+
declare const creators: _manifest_editor_creator_api.CreatorDefinition[];
|
|
18
|
+
declare const resources: string[];
|
|
19
|
+
|
|
20
|
+
export { centerPanels, creators, _default as default, editors, leftPanels, modals, resources, rightPanels };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as _manifest_editor_creator_api from '@manifest-editor/creator-api';
|
|
2
|
+
import * as _manifest_editor_shell from '@manifest-editor/shell';
|
|
3
|
+
import { LayoutPanel } from '@manifest-editor/shell';
|
|
4
|
+
|
|
5
|
+
declare const _default: {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
project: boolean;
|
|
9
|
+
projectType: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare const centerPanels: LayoutPanel[];
|
|
13
|
+
declare const leftPanels: LayoutPanel[];
|
|
14
|
+
declare const rightPanels: LayoutPanel[];
|
|
15
|
+
declare const modals: LayoutPanel[];
|
|
16
|
+
declare const editors: _manifest_editor_shell.EditorDefinition[];
|
|
17
|
+
declare const creators: _manifest_editor_creator_api.CreatorDefinition[];
|
|
18
|
+
declare const resources: string[];
|
|
19
|
+
|
|
20
|
+
export { centerPanels, creators, _default as default, editors, leftPanels, modals, resources, rightPanels };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
// src/index.tsx
|
|
2
|
+
import { CanvasPanelEditor, allEditors } from "@manifest-editor/editors";
|
|
3
|
+
import { allCreators } from "@manifest-editor/creators";
|
|
4
|
+
import { ExportPanel, baseCreator, baseEditor } from "@manifest-editor/shell";
|
|
5
|
+
|
|
6
|
+
// src/left-panels/canvas-listing.tsx
|
|
7
|
+
import { InputContainer, useInStack, useToggleList, CanvasList, createAppActions } from "@manifest-editor/editors";
|
|
8
|
+
import { useCreator, useLayoutActions, useManifestEditor } from "@manifest-editor/shell";
|
|
9
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
10
|
+
import {
|
|
11
|
+
CanvasThumbnailGridItem,
|
|
12
|
+
CreateCanvasIcon,
|
|
13
|
+
Sidebar,
|
|
14
|
+
SidebarContent,
|
|
15
|
+
SidebarHeader,
|
|
16
|
+
ThumbnailGridContainer,
|
|
17
|
+
useFastList
|
|
18
|
+
} from "@manifest-editor/components";
|
|
19
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var ListingIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs(
|
|
21
|
+
"svg",
|
|
22
|
+
{
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
viewBox: "0 0 24 24",
|
|
25
|
+
width: "1em",
|
|
26
|
+
height: "1em",
|
|
27
|
+
"aria-labelledby": titleId,
|
|
28
|
+
...props,
|
|
29
|
+
children: [
|
|
30
|
+
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
31
|
+
/* @__PURE__ */ jsxs("g", { fill: "none", children: [
|
|
32
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0V0z" }),
|
|
33
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0V0z", opacity: ".87" })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"path",
|
|
37
|
+
{
|
|
38
|
+
d: "M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7zm-4 6h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z",
|
|
39
|
+
fill: "currentColor"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
var canvasListing = {
|
|
46
|
+
id: "canvas-listing",
|
|
47
|
+
label: "Canvases",
|
|
48
|
+
icon: /* @__PURE__ */ jsx(ListingIcon, {}),
|
|
49
|
+
render: (state, ctx, app) => {
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
CanvasListing,
|
|
52
|
+
{
|
|
53
|
+
gridView: state.gridView || false,
|
|
54
|
+
onChangeGridView: (gridView) => ctx.actions.change("canvas-listing", { gridView })
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function CanvasListing({
|
|
60
|
+
gridView,
|
|
61
|
+
onChangeGridView
|
|
62
|
+
}) {
|
|
63
|
+
const { edit, open } = useLayoutActions();
|
|
64
|
+
const { structural, technical } = useManifestEditor();
|
|
65
|
+
const [toggled, toggle] = useToggleList();
|
|
66
|
+
const canvas = useInStack("Canvas");
|
|
67
|
+
const { items } = structural;
|
|
68
|
+
const manifestId = technical.id.get();
|
|
69
|
+
const manifest = { id: manifestId, type: "Manifest" };
|
|
70
|
+
const [canCreateCanvas, canvasActions] = useCreator(manifest, "items", "Canvas");
|
|
71
|
+
const canvases = useFastList(items.get(), 24);
|
|
72
|
+
useEffect(() => {
|
|
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
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (items.get().length) {
|
|
82
|
+
open({ id: "current-canvas" });
|
|
83
|
+
canvasActions.edit(items.get()[0]);
|
|
84
|
+
}
|
|
85
|
+
}, []);
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
const selected = document.querySelector('[data-canvas-selected="true"]');
|
|
88
|
+
if (selected) {
|
|
89
|
+
selected.scrollIntoView({ block: "center" });
|
|
90
|
+
}
|
|
91
|
+
}, [canvases, gridView]);
|
|
92
|
+
return /* @__PURE__ */ jsxs(Sidebar, { children: [
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
SidebarHeader,
|
|
95
|
+
{
|
|
96
|
+
title: "Canvases",
|
|
97
|
+
actions: [
|
|
98
|
+
{
|
|
99
|
+
icon: /* @__PURE__ */ jsx(Fragment, { children: gridView ? /* @__PURE__ */ jsx(ListingIcon, { width: 24, height: 24 }) : /* @__PURE__ */ jsx(CanvasThumbnailsIcon, {}) }),
|
|
100
|
+
title: gridView ? "List view" : "Grid view",
|
|
101
|
+
onClick: () => {
|
|
102
|
+
onChangeGridView(!gridView);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
icon: /* @__PURE__ */ jsx(ListEditIcon, {}),
|
|
107
|
+
title: "Edit canvases",
|
|
108
|
+
disabled: gridView,
|
|
109
|
+
toggled: toggled.items,
|
|
110
|
+
onClick: () => toggle("items")
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
icon: /* @__PURE__ */ jsx(CreateCanvasIcon, {}),
|
|
114
|
+
title: "Add new canvas",
|
|
115
|
+
onClick: () => canvasActions.create(),
|
|
116
|
+
disabled: !canCreateCanvas
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
gridView ? /* @__PURE__ */ jsx(SidebarContent, { children: /* @__PURE__ */ jsx(ThumbnailGridContainer, { children: canvases.map((item) => /* @__PURE__ */ jsx(
|
|
122
|
+
CanvasThumbnailGridItem,
|
|
123
|
+
{
|
|
124
|
+
id: item.id,
|
|
125
|
+
selected: canvas?.resource.source.id === item.id,
|
|
126
|
+
onClick: () => {
|
|
127
|
+
open({ id: "current-canvas" });
|
|
128
|
+
canvasActions.edit(item);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
item.id
|
|
132
|
+
)) }) }) : /* @__PURE__ */ jsx(SidebarContent, { className: "p-3", children: /* @__PURE__ */ jsx(InputContainer, { $wide: true, children: /* @__PURE__ */ jsx(
|
|
133
|
+
CanvasList,
|
|
134
|
+
{
|
|
135
|
+
id: items.focusId(),
|
|
136
|
+
list: items.get() || [],
|
|
137
|
+
inlineHandle: false,
|
|
138
|
+
activeId: canvas?.resource.source.id,
|
|
139
|
+
reorder: toggled.items ? (t) => items.reorder(t.startIndex, t.endIndex) : void 0,
|
|
140
|
+
onSelect: (item, idx) => {
|
|
141
|
+
open({ id: "current-canvas" });
|
|
142
|
+
canvasActions.edit(item, idx);
|
|
143
|
+
},
|
|
144
|
+
createActions: createAppActions(items)
|
|
145
|
+
}
|
|
146
|
+
) }) })
|
|
147
|
+
] });
|
|
148
|
+
}
|
|
149
|
+
function ListEditIcon() {
|
|
150
|
+
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
|
|
151
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
152
|
+
/* @__PURE__ */ jsx("path", { d: "M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z" })
|
|
153
|
+
] });
|
|
154
|
+
}
|
|
155
|
+
function CanvasThumbnailsIcon() {
|
|
156
|
+
return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
|
|
157
|
+
/* @__PURE__ */ jsx("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
"path",
|
|
160
|
+
{
|
|
161
|
+
d: "M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z",
|
|
162
|
+
fill: "currentColor"
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] });
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/left-panels/manifest.tsx
|
|
169
|
+
import { useLayoutActions as useLayoutActions2, useManifestEditor as useManifestEditor2 } from "@manifest-editor/shell";
|
|
170
|
+
import { useEffect as useEffect2 } from "react";
|
|
171
|
+
import { LocaleString, ManifestMetadata } from "react-iiif-vault";
|
|
172
|
+
import { Sidebar as Sidebar2, SidebarContent as SidebarContent2, SidebarHeader as SidebarHeader2 } from "@manifest-editor/components";
|
|
173
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
174
|
+
function ManifestIcon({ title, titleId, ...props }) {
|
|
175
|
+
return /* @__PURE__ */ jsxs2("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
|
|
176
|
+
title ? /* @__PURE__ */ jsx2("title", { id: titleId, children: title }) : null,
|
|
177
|
+
/* @__PURE__ */ jsx2("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
178
|
+
/* @__PURE__ */ jsx2(
|
|
179
|
+
"path",
|
|
180
|
+
{
|
|
181
|
+
d: "M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z",
|
|
182
|
+
fill: "currentColor"
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
187
|
+
var manifestPanel = {
|
|
188
|
+
id: "left-panel-manifest",
|
|
189
|
+
label: "Manifest summary",
|
|
190
|
+
icon: /* @__PURE__ */ jsx2(ManifestIcon, {}),
|
|
191
|
+
render: (state, ctx, app) => {
|
|
192
|
+
return /* @__PURE__ */ jsx2(ManifestPanel, {});
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
function ManifestPanel() {
|
|
196
|
+
const { edit, open } = useLayoutActions2();
|
|
197
|
+
const { descriptive, technical } = useManifestEditor2();
|
|
198
|
+
const manifestId = technical.id.get();
|
|
199
|
+
const manifest = { id: manifestId, type: "Manifest" };
|
|
200
|
+
const label = descriptive.label.get();
|
|
201
|
+
const summary = descriptive.summary.get();
|
|
202
|
+
const requiredStatement = descriptive.requiredStatement.get();
|
|
203
|
+
const metadata = descriptive.metadata.get();
|
|
204
|
+
useEffect2(() => {
|
|
205
|
+
edit(manifest);
|
|
206
|
+
open({ id: "overview" });
|
|
207
|
+
}, []);
|
|
208
|
+
return /* @__PURE__ */ jsxs2(Sidebar2, { children: [
|
|
209
|
+
/* @__PURE__ */ jsx2(SidebarHeader2, { title: "Manifest summary" }),
|
|
210
|
+
/* @__PURE__ */ jsxs2(SidebarContent2, { className: "p-4", children: [
|
|
211
|
+
label ? /* @__PURE__ */ jsx2(LocaleString, { as: "h2", className: "text-lg font-semibold mb-2 [&>a]:underline [&>a]:hover:text-slate-400", children: label }) : null,
|
|
212
|
+
summary ? /* @__PURE__ */ jsx2(LocaleString, { as: "p", className: "text-sm text-slate-800 block [&>a]:underline [&>a]:hover:text-slate-400 mb-2", children: summary }) : null,
|
|
213
|
+
/* @__PURE__ */ jsx2("hr", {}),
|
|
214
|
+
requiredStatement ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
215
|
+
/* @__PURE__ */ jsxs2("div", { className: "py-2 text-black", children: [
|
|
216
|
+
/* @__PURE__ */ jsx2(
|
|
217
|
+
LocaleString,
|
|
218
|
+
{
|
|
219
|
+
as: "h4",
|
|
220
|
+
className: "font-bold text-black w-full text-sm font-semibold mb-0 [&>a]:underline [&>a]:hover:text-slate-400",
|
|
221
|
+
children: requiredStatement.label
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ jsx2(
|
|
225
|
+
LocaleString,
|
|
226
|
+
{
|
|
227
|
+
enableDangerouslySetInnerHTML: true,
|
|
228
|
+
className: "text-sm [&>a]:underline [&>a]:hover:text-slate-400",
|
|
229
|
+
children: requiredStatement.value
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
] }),
|
|
233
|
+
/* @__PURE__ */ jsx2("hr", {})
|
|
234
|
+
] }) : null,
|
|
235
|
+
metadata && metadata.length === 0 ? /* @__PURE__ */ jsx2("div", { className: "py-2 text-gray-400", children: "You can add some descriptive metadata for this manifest using the editing panel on the right" }) : null,
|
|
236
|
+
/* @__PURE__ */ jsx2(
|
|
237
|
+
ManifestMetadata,
|
|
238
|
+
{
|
|
239
|
+
allowHtml: true,
|
|
240
|
+
classes: {
|
|
241
|
+
container: "w-full",
|
|
242
|
+
row: "border-b border-gray-200 flex flex-col flex-wrap py-2",
|
|
243
|
+
label: "font-bold text-black w-full text-sm font-semibold mb-1",
|
|
244
|
+
value: "text-sm text-black block [&>span>a]:underline [&>span>a]:hover:text-slate-400",
|
|
245
|
+
empty: "text-gray-400"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
] })
|
|
250
|
+
] });
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/center-panels/manifest-overview.tsx
|
|
254
|
+
import {
|
|
255
|
+
CanvasThumbnailGridItem as CanvasThumbnailGridItem2,
|
|
256
|
+
ManifestOverviewEmptyState,
|
|
257
|
+
ThumbnailGridContainer as ThumbnailGridContainer2,
|
|
258
|
+
useFastList as useFastList2
|
|
259
|
+
} from "@manifest-editor/components";
|
|
260
|
+
import { useCreator as useCreator2, useLayoutActions as useLayoutActions3, useManifestEditor as useManifestEditor3 } from "@manifest-editor/shell";
|
|
261
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
262
|
+
var manifestOverview = {
|
|
263
|
+
id: "overview",
|
|
264
|
+
label: "Overview",
|
|
265
|
+
icon: "",
|
|
266
|
+
render: () => /* @__PURE__ */ jsx3(ManifestOverview, {})
|
|
267
|
+
};
|
|
268
|
+
function ManifestOverview() {
|
|
269
|
+
const { edit, open } = useLayoutActions3();
|
|
270
|
+
const { structural, technical } = useManifestEditor3();
|
|
271
|
+
const { items } = structural;
|
|
272
|
+
const manifestId = technical.id.get();
|
|
273
|
+
const manifest = { id: manifestId, type: "Manifest" };
|
|
274
|
+
const [canCreateCanvas, canvasActions] = useCreator2(manifest, "items", "Canvas");
|
|
275
|
+
const canvases = useFastList2(items.get(), 24);
|
|
276
|
+
if (!canvases || canvases.length === 0) {
|
|
277
|
+
return /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(ManifestOverviewEmptyState, { onCreate: canvasActions.create, canCreate: canCreateCanvas }) });
|
|
278
|
+
}
|
|
279
|
+
return /* @__PURE__ */ jsx3(ThumbnailGridContainer2, { wide: true, children: canvases.map((item) => /* @__PURE__ */ jsx3(
|
|
280
|
+
CanvasThumbnailGridItem2,
|
|
281
|
+
{
|
|
282
|
+
id: item.id,
|
|
283
|
+
onClick: () => {
|
|
284
|
+
open({ id: "current-canvas" });
|
|
285
|
+
open({ id: "canvas-listing", state: { gridView: true } });
|
|
286
|
+
canvasActions.edit(item);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
item.id
|
|
290
|
+
)) });
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// src/index.tsx
|
|
294
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
295
|
+
var src_default = { id: "manifest-editor", title: "Manifest Editor", project: true, projectType: "Manifest" };
|
|
296
|
+
var centerPanels = [
|
|
297
|
+
manifestOverview,
|
|
298
|
+
{
|
|
299
|
+
id: "current-canvas",
|
|
300
|
+
label: "Current canvas",
|
|
301
|
+
icon: "",
|
|
302
|
+
render: (state, { actions }) => /* @__PURE__ */ jsx4(CanvasPanelEditor, {})
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "export",
|
|
306
|
+
label: "Export",
|
|
307
|
+
icon: "",
|
|
308
|
+
render: () => /* @__PURE__ */ jsx4(ExportPanel, {})
|
|
309
|
+
}
|
|
310
|
+
];
|
|
311
|
+
var leftPanels = [
|
|
312
|
+
manifestPanel,
|
|
313
|
+
canvasListing
|
|
314
|
+
// @todo we will come back to the image grid
|
|
315
|
+
// {
|
|
316
|
+
// id: "image-grid",
|
|
317
|
+
// label: "Image grid",
|
|
318
|
+
// render: () => <ManifestItemsGrid />,
|
|
319
|
+
// },
|
|
320
|
+
];
|
|
321
|
+
var rightPanels = [baseEditor];
|
|
322
|
+
var modals = [baseCreator];
|
|
323
|
+
var editors = allEditors;
|
|
324
|
+
var creators = allCreators;
|
|
325
|
+
var resources = ["Manifest", "Canvas", "ContentResource", "Agent", "AnnotationPage", "Annotation", "Range"];
|
|
326
|
+
export {
|
|
327
|
+
centerPanels,
|
|
328
|
+
creators,
|
|
329
|
+
src_default as default,
|
|
330
|
+
editors,
|
|
331
|
+
leftPanels,
|
|
332
|
+
modals,
|
|
333
|
+
resources,
|
|
334
|
+
rightPanels
|
|
335
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@manifest-editor/manifest-preset",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"bugs": "https://github.com/digirati-co-uk/iiif-manifest-editor/issues",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/digirati-co-uk/iiif-manifest-editor.git",
|
|
9
|
+
"directory": "packages/manifest-preset"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18.14.1"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"iiif",
|
|
16
|
+
"editor",
|
|
17
|
+
"typescript"
|
|
18
|
+
],
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"require": "./dist/index.cjs",
|
|
29
|
+
"types": "./dist/index.d.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup src/index.tsx",
|
|
34
|
+
"dev": "tsup src/index.tsx --watch",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"prepack": "tsup src/index.tsx"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@iiif/helpers": "^1.2.12",
|
|
40
|
+
"@iiif/parser": "^2.1.2",
|
|
41
|
+
"@iiif/presentation-3": "^2.2.3",
|
|
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",
|
|
49
|
+
"react-iiif-vault": "^1.2.1",
|
|
50
|
+
"styled-components": "6.1.8"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@manifest-editor/ui": "1.0.0",
|
|
54
|
+
"@repo/eslint-config": "0.0.0",
|
|
55
|
+
"@types/react": "^18.2.74",
|
|
56
|
+
"@types/react-dom": "^18.2.24",
|
|
57
|
+
"tiny-invariant": "^1.3.3",
|
|
58
|
+
"tsup": "^8.0.2"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"gitHead": "083fd2ce7d40755fb1857490e006e9854906d031"
|
|
64
|
+
}
|