@manifest-editor/components 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 +1457 -0
- package/dist/index.css +812 -0
- package/dist/index.d.cts +250 -0
- package/dist/index.d.ts +250 -0
- package/dist/index.js +1443 -0
- package/package.json +80 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,1457 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/index.tsx
|
|
32
|
+
var src_exports = {};
|
|
33
|
+
__export(src_exports, {
|
|
34
|
+
ActionButton: () => ActionButton,
|
|
35
|
+
AddIcon: () => AddIcon,
|
|
36
|
+
AddImageIcon: () => AddImageIcon,
|
|
37
|
+
AtlasBanner: () => AtlasBanner,
|
|
38
|
+
AudioIcon: () => AudioIcon,
|
|
39
|
+
CanvasThumbnailGridItem: () => CanvasThumbnailGridItem,
|
|
40
|
+
Card3D: () => Card3D,
|
|
41
|
+
ConfirmSelectionButton: () => ConfirmSelectionButton,
|
|
42
|
+
ControlButton: () => ControlButton,
|
|
43
|
+
CreateCanvasIcon: () => CreateCanvasIcon,
|
|
44
|
+
CreatorGrid: () => CreatorGrid,
|
|
45
|
+
DefaultTooltipContent: () => DefaultTooltipContent,
|
|
46
|
+
DownloadButton: () => DownloadButton,
|
|
47
|
+
DownloadIcon: () => DownloadIcon,
|
|
48
|
+
EmptyCanvasIcon: () => EmptyCanvasIcon,
|
|
49
|
+
EmptyState: () => EmptyState,
|
|
50
|
+
Form: () => Form,
|
|
51
|
+
HTMLIcon: () => HTMLIcon,
|
|
52
|
+
IIIFBrowserIcon: () => IIIFBrowserIcon,
|
|
53
|
+
IIIFLogo: () => IIIFLogo,
|
|
54
|
+
LazyThumbnail: () => LazyThumbnail,
|
|
55
|
+
ManifestEditorLogo: () => ManifestEditorLogo,
|
|
56
|
+
ManifestOverviewEmptyState: () => ManifestOverviewEmptyState,
|
|
57
|
+
MetadataContainer: () => MetadataContainer,
|
|
58
|
+
Modal: () => Modal,
|
|
59
|
+
OpaqueControls: () => OpaqueControls,
|
|
60
|
+
PanelSideMenu: () => PanelSideMenu,
|
|
61
|
+
Sidebar: () => Sidebar,
|
|
62
|
+
SidebarContent: () => SidebarContent,
|
|
63
|
+
SidebarHeader: () => SidebarHeader,
|
|
64
|
+
SidebarTabs: () => SidebarTabs,
|
|
65
|
+
SvgControlBar: () => SvgControlBar,
|
|
66
|
+
Tab: () => Tab,
|
|
67
|
+
TabList: () => TabList,
|
|
68
|
+
TabPanel: () => TabPanel,
|
|
69
|
+
Tabs: () => Tabs,
|
|
70
|
+
ThumbnailGridContainer: () => ThumbnailGridContainer,
|
|
71
|
+
Tooltip: () => Tooltip,
|
|
72
|
+
TooltipContent: () => TooltipContent,
|
|
73
|
+
TooltipTrigger: () => TooltipTrigger,
|
|
74
|
+
VideoIcon: () => VideoIcon,
|
|
75
|
+
YouTubeIcon: () => YouTubeIcon,
|
|
76
|
+
createDownload: () => createDownload,
|
|
77
|
+
useFastList: () => useFastList,
|
|
78
|
+
useTooltip: () => useTooltip,
|
|
79
|
+
useTooltipContext: () => useTooltipContext
|
|
80
|
+
});
|
|
81
|
+
module.exports = __toCommonJS(src_exports);
|
|
82
|
+
|
|
83
|
+
// src/ActionButton.tsx
|
|
84
|
+
var import_react_aria_components = require("react-aria-components");
|
|
85
|
+
|
|
86
|
+
// src/utils.ts
|
|
87
|
+
var import_clsx = require("clsx");
|
|
88
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
89
|
+
var cn = (...inputs) => {
|
|
90
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// src/ActionButton.tsx
|
|
94
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
95
|
+
function ActionButton({
|
|
96
|
+
className: className2,
|
|
97
|
+
primary,
|
|
98
|
+
center,
|
|
99
|
+
children,
|
|
100
|
+
...props
|
|
101
|
+
}) {
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
import_react_aria_components.Button,
|
|
104
|
+
{
|
|
105
|
+
className: cn(
|
|
106
|
+
//
|
|
107
|
+
"flex gap-1 items-center px-2 py-1 bg-gray-100 text-me-primary-500 text-sm rounded hover:bg-gray-200",
|
|
108
|
+
primary ? "bg-me-primary-500 text-white hover:bg-me-primary-600" : "",
|
|
109
|
+
center ? "place-content-center" : "",
|
|
110
|
+
className2
|
|
111
|
+
),
|
|
112
|
+
...props,
|
|
113
|
+
children
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/Tooltip.tsx
|
|
119
|
+
var React = __toESM(require("react"), 1);
|
|
120
|
+
var import_react = require("@floating-ui/react");
|
|
121
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
122
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
123
|
+
function useTooltip({
|
|
124
|
+
initialOpen = false,
|
|
125
|
+
placement = "top",
|
|
126
|
+
open: controlledOpen,
|
|
127
|
+
onOpenChange: setControlledOpen
|
|
128
|
+
} = {}) {
|
|
129
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(initialOpen);
|
|
130
|
+
const open = controlledOpen ?? uncontrolledOpen;
|
|
131
|
+
const setOpen = setControlledOpen ?? setUncontrolledOpen;
|
|
132
|
+
const data = (0, import_react.useFloating)({
|
|
133
|
+
placement,
|
|
134
|
+
open,
|
|
135
|
+
onOpenChange: setOpen,
|
|
136
|
+
whileElementsMounted: import_react.autoUpdate,
|
|
137
|
+
middleware: [
|
|
138
|
+
(0, import_react.offset)(5),
|
|
139
|
+
(0, import_react.flip)({
|
|
140
|
+
crossAxis: placement.includes("-"),
|
|
141
|
+
fallbackAxisSideDirection: "start",
|
|
142
|
+
padding: 5
|
|
143
|
+
}),
|
|
144
|
+
(0, import_react.shift)({ padding: 5 })
|
|
145
|
+
]
|
|
146
|
+
});
|
|
147
|
+
const context = data.context;
|
|
148
|
+
const hover = (0, import_react.useHover)(context, {
|
|
149
|
+
move: false,
|
|
150
|
+
enabled: controlledOpen == null
|
|
151
|
+
});
|
|
152
|
+
const focus = (0, import_react.useFocus)(context, {
|
|
153
|
+
enabled: controlledOpen == null
|
|
154
|
+
});
|
|
155
|
+
const dismiss = (0, import_react.useDismiss)(context);
|
|
156
|
+
const role = (0, import_react.useRole)(context, { role: "tooltip" });
|
|
157
|
+
const interactions = (0, import_react.useInteractions)([hover, focus, dismiss, role]);
|
|
158
|
+
return React.useMemo(
|
|
159
|
+
() => ({
|
|
160
|
+
open,
|
|
161
|
+
setOpen,
|
|
162
|
+
...interactions,
|
|
163
|
+
...data
|
|
164
|
+
}),
|
|
165
|
+
[open, setOpen, interactions, data]
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
var TooltipContext = React.createContext(null);
|
|
169
|
+
var useTooltipContext = () => {
|
|
170
|
+
const context = React.useContext(TooltipContext);
|
|
171
|
+
if (context == null) {
|
|
172
|
+
throw new Error("Tooltip components must be wrapped in <Tooltip />");
|
|
173
|
+
}
|
|
174
|
+
return context;
|
|
175
|
+
};
|
|
176
|
+
function Tooltip({ children, ...options }) {
|
|
177
|
+
const tooltip = useTooltip(options);
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipContext.Provider, { value: tooltip, children });
|
|
179
|
+
}
|
|
180
|
+
var TooltipTrigger = React.forwardRef(function TooltipTrigger2({ children, asChild = false, ...props }, propRef) {
|
|
181
|
+
const context = useTooltipContext();
|
|
182
|
+
const childrenRef = children.ref;
|
|
183
|
+
const ref = (0, import_react.useMergeRefs)([context.refs.setReference, propRef, childrenRef]);
|
|
184
|
+
if (asChild && React.isValidElement(children)) {
|
|
185
|
+
return React.cloneElement(
|
|
186
|
+
children,
|
|
187
|
+
context.getReferenceProps({
|
|
188
|
+
ref,
|
|
189
|
+
...props,
|
|
190
|
+
...children.props,
|
|
191
|
+
"data-state": context.open ? "open" : "closed"
|
|
192
|
+
})
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
196
|
+
import_react_aria_components2.Button,
|
|
197
|
+
{
|
|
198
|
+
ref,
|
|
199
|
+
"data-state": context.open ? "open" : "closed",
|
|
200
|
+
...context.getReferenceProps(props),
|
|
201
|
+
children
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
var TooltipContent = React.forwardRef(function TooltipContent2({ style, ...props }, propRef) {
|
|
206
|
+
const context = useTooltipContext();
|
|
207
|
+
const ref = (0, import_react.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
208
|
+
if (!context.open)
|
|
209
|
+
return null;
|
|
210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
ref,
|
|
214
|
+
style: {
|
|
215
|
+
...context.floatingStyles,
|
|
216
|
+
...style
|
|
217
|
+
},
|
|
218
|
+
...context.getFloatingProps(props)
|
|
219
|
+
}
|
|
220
|
+
) });
|
|
221
|
+
});
|
|
222
|
+
function DefaultTooltipContent(props) {
|
|
223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipContent, { className: "bg-me-gray-900 text-white text-sm px-3 py-2 rounded-lg opacity-90 z-50", children: props.children });
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// src/Sidebar.tsx
|
|
227
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
228
|
+
function Sidebar({ children }) {
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-full h-full flex flex-col overflow-hidden", children });
|
|
230
|
+
}
|
|
231
|
+
function SidebarContent({ children, className: className2 }) {
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn("flex-1 min-h-0 overflow-y-auto", className2), children });
|
|
233
|
+
}
|
|
234
|
+
function SidebarHeader(props) {
|
|
235
|
+
const { actions, title } = props;
|
|
236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "bg-me-gray-100 h-12 flex items-center px-3 z-10 text-black border-b-me-gray-300 border-b", children: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex-1", children: title }),
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "ml-auto flex gap-2 items-center", children: actions?.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { placement: "bottom", children: [
|
|
239
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
240
|
+
"button",
|
|
241
|
+
{
|
|
242
|
+
className: cn(
|
|
243
|
+
//
|
|
244
|
+
`p-1 rounded hover:bg-me-gray-300`,
|
|
245
|
+
action.toggled && "bg-me-gray-300",
|
|
246
|
+
action.disabled && "opacity-50 cursor-not-allowed"
|
|
247
|
+
),
|
|
248
|
+
onClick: action.onClick,
|
|
249
|
+
title: action.title,
|
|
250
|
+
disabled: action.disabled,
|
|
251
|
+
children: action.icon
|
|
252
|
+
},
|
|
253
|
+
index
|
|
254
|
+
) }),
|
|
255
|
+
!action.disabled ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DefaultTooltipContent, { children: action.title }) : null
|
|
256
|
+
] }, index)) })
|
|
257
|
+
] });
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// src/PanelSideMenu.tsx
|
|
261
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
262
|
+
|
|
263
|
+
// src/PanelSideMenuItem.tsx
|
|
264
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
265
|
+
function PanelSideMenuItem(props) {
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Tooltip, { placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
267
|
+
"button",
|
|
268
|
+
{
|
|
269
|
+
className: cn(
|
|
270
|
+
"aspect-square w-full flex justify-center items-center hover:bg-me-primary-100 hover:text-black [&>svg]:text-2xl cursor-default",
|
|
271
|
+
props.selected ? "bg-me-primary-500 hover:bg-me-primary-600 hover:text-white text-white" : "text-me-gray-700"
|
|
272
|
+
),
|
|
273
|
+
onMouseDown: props.onClick,
|
|
274
|
+
children: [
|
|
275
|
+
props.icon,
|
|
276
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipContent, { className: "bg-me-gray-900 text-white text-sm px-3 py-2 rounded-lg opacity-90 z-50", children: props.label })
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
) }) });
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// src/PanelSideMenu.tsx
|
|
283
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
284
|
+
function PanelSideMenu(props) {
|
|
285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "bg-white border-t border-r flex flex-col w-12 pb-2", "data-open": props.open, children: props.items.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
286
|
+
panel.divide ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-1 block w-2 min-h-1" }) : null,
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
288
|
+
PanelSideMenuItem,
|
|
289
|
+
{
|
|
290
|
+
label: panel.label,
|
|
291
|
+
selected: panel.id === props.current && props.open,
|
|
292
|
+
icon: panel.icon,
|
|
293
|
+
onClick: panel.onClick
|
|
294
|
+
},
|
|
295
|
+
panel.id
|
|
296
|
+
)
|
|
297
|
+
] }, panel.id)) });
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// src/ThumbnailGridContainer.tsx
|
|
301
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
302
|
+
function ThumbnailGridContainer(props) {
|
|
303
|
+
if (props.wide) {
|
|
304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "grid grid-md gap-4 p-4 overflow-y-auto", children: props.children });
|
|
305
|
+
}
|
|
306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "grid grid-cols-2 gap-4 p-4", children: props.children });
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// src/LazyThumbnail.tsx
|
|
310
|
+
var import_react_lazy_load_image_component = require("react-lazy-load-image-component");
|
|
311
|
+
var import_react_iiif_vault = require("react-iiif-vault");
|
|
312
|
+
var import_react2 = require("react");
|
|
313
|
+
|
|
314
|
+
// src/Spinner.tsx
|
|
315
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
316
|
+
function Spinner(props) {
|
|
317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
318
|
+
"svg",
|
|
319
|
+
{
|
|
320
|
+
width: "1em",
|
|
321
|
+
height: "1em",
|
|
322
|
+
viewBox: "0 0 42 42",
|
|
323
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
324
|
+
stroke: "currentColor",
|
|
325
|
+
...props,
|
|
326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("g", { transform: "translate(2 2)", strokeWidth: 5, fill: "none", fillRule: "evenodd", children: [
|
|
327
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("circle", { strokeOpacity: 0.5, cx: 18, cy: 18, r: 18 }),
|
|
328
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M36 18c0-9.94-8.06-18-18-18", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
329
|
+
"animateTransform",
|
|
330
|
+
{
|
|
331
|
+
attributeName: "transform",
|
|
332
|
+
type: "rotate",
|
|
333
|
+
from: "0 18 18",
|
|
334
|
+
to: "360 18 18",
|
|
335
|
+
dur: "1s",
|
|
336
|
+
repeatCount: "indefinite"
|
|
337
|
+
}
|
|
338
|
+
) })
|
|
339
|
+
] })
|
|
340
|
+
}
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// src/LazyThumbnail.tsx
|
|
345
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
346
|
+
function LazyThumbnail() {
|
|
347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_lazy_load_image_component.LazyLoadComponent, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LazyThumbnailInner, {}) });
|
|
348
|
+
}
|
|
349
|
+
function LazyThumbnailInner() {
|
|
350
|
+
const img = (0, import_react2.useRef)(null);
|
|
351
|
+
const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
|
|
352
|
+
const thumbnail = (0, import_react_iiif_vault.useThumbnail)({ height: 256, width: 256 }, true);
|
|
353
|
+
(0, import_react2.useEffect)(() => {
|
|
354
|
+
if (thumbnail?.id) {
|
|
355
|
+
setIsLoading(true);
|
|
356
|
+
}
|
|
357
|
+
}, [thumbnail?.id]);
|
|
358
|
+
(0, import_react2.useLayoutEffect)(() => {
|
|
359
|
+
if (img.current) {
|
|
360
|
+
if (img.current.complete || img.current.naturalWidth > 0) {
|
|
361
|
+
setIsLoading(false);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}, [thumbnail?.id]);
|
|
365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `w-full h-full relative`, children: [
|
|
366
|
+
thumbnail?.id ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
367
|
+
"img",
|
|
368
|
+
{
|
|
369
|
+
onLoad: () => setIsLoading(false),
|
|
370
|
+
ref: img,
|
|
371
|
+
src: thumbnail?.id,
|
|
372
|
+
alt: "",
|
|
373
|
+
className: `w-full h-full object-contain ${!isLoading ? "animate-fadeIn" : "opacity-0"}`
|
|
374
|
+
}
|
|
375
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-black/30 flex items-center justify-center h-full bg-me-gray-100 animate-fadeInDelayed absolute inset-0 z-20", children: "No thumbnail" }),
|
|
376
|
+
!thumbnail?.id || isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-me-gray-100 text-2xl animate-fadeIn z-10", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Spinner, {}) }) : null
|
|
377
|
+
] });
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// src/CanvasThumbnailGridItem.tsx
|
|
381
|
+
var import_react_iiif_vault3 = require("react-iiif-vault");
|
|
382
|
+
|
|
383
|
+
// src/CanvasLabel.tsx
|
|
384
|
+
var import_react_iiif_vault2 = require("react-iiif-vault");
|
|
385
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
386
|
+
function CanvasLabel(props) {
|
|
387
|
+
const canvas = (0, import_react_iiif_vault2.useCanvas)();
|
|
388
|
+
if (!canvas)
|
|
389
|
+
return null;
|
|
390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_iiif_vault2.LocaleString, { className: props.className, as: props.as, children: canvas.label });
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// src/Card3D.tsx
|
|
394
|
+
var import_react3 = require("react");
|
|
395
|
+
var import_tailwind_merge2 = require("tailwind-merge");
|
|
396
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
397
|
+
function Card3D({
|
|
398
|
+
className: className2,
|
|
399
|
+
shouldTranslate,
|
|
400
|
+
children,
|
|
401
|
+
...props
|
|
402
|
+
}) {
|
|
403
|
+
const outer = (0, import_react3.useRef)(null);
|
|
404
|
+
const inner = (0, import_react3.useRef)(null);
|
|
405
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
406
|
+
if (!outer.current || !inner.current)
|
|
407
|
+
return;
|
|
408
|
+
let bounds;
|
|
409
|
+
function rotateToMouse(e) {
|
|
410
|
+
const mouseX = e.clientX;
|
|
411
|
+
const mouseY = e.clientY;
|
|
412
|
+
const leftX = mouseX - bounds.x;
|
|
413
|
+
const topY = mouseY - bounds.y;
|
|
414
|
+
const center = {
|
|
415
|
+
x: leftX - bounds.width / 2,
|
|
416
|
+
y: topY - bounds.height / 2
|
|
417
|
+
};
|
|
418
|
+
const distance = Math.sqrt(center.x ** 2 + center.y ** 2);
|
|
419
|
+
if (shouldTranslate) {
|
|
420
|
+
outer.current.style.transform = `
|
|
421
|
+
scale3d(1.07, 1.07, 1.07)
|
|
422
|
+
rotate3d(
|
|
423
|
+
${center.y / 100},
|
|
424
|
+
${-center.x / 100},
|
|
425
|
+
0,
|
|
426
|
+
${Math.log(distance) * 2}deg
|
|
427
|
+
)
|
|
428
|
+
`;
|
|
429
|
+
}
|
|
430
|
+
inner.current.style.backgroundImage = `
|
|
431
|
+
radial-gradient(
|
|
432
|
+
circle at
|
|
433
|
+
${center.x * 2 + bounds.width / 2}px
|
|
434
|
+
${center.y * 2 + bounds.height / 2}px,
|
|
435
|
+
#ffffff66,
|
|
436
|
+
#ffffff00
|
|
437
|
+
)
|
|
438
|
+
`;
|
|
439
|
+
}
|
|
440
|
+
function reset() {
|
|
441
|
+
outer.current.style.transform = "";
|
|
442
|
+
inner.current.style.backgroundImage = "";
|
|
443
|
+
}
|
|
444
|
+
let isActive = false;
|
|
445
|
+
const mouseenter = () => {
|
|
446
|
+
bounds = outer.current.getBoundingClientRect();
|
|
447
|
+
isActive = true;
|
|
448
|
+
};
|
|
449
|
+
const mouseleave = () => {
|
|
450
|
+
isActive = false;
|
|
451
|
+
reset();
|
|
452
|
+
};
|
|
453
|
+
const mousemove = (e) => {
|
|
454
|
+
if (!isActive)
|
|
455
|
+
return;
|
|
456
|
+
rotateToMouse(e);
|
|
457
|
+
};
|
|
458
|
+
outer.current.addEventListener("mouseenter", mouseenter);
|
|
459
|
+
outer.current.addEventListener("mouseleave", mouseleave);
|
|
460
|
+
outer.current.addEventListener("mousemove", mousemove);
|
|
461
|
+
return () => {
|
|
462
|
+
outer.current.removeEventListener("mouseenter", mouseenter);
|
|
463
|
+
outer.current.removeEventListener("mouseleave", mouseleave);
|
|
464
|
+
outer.current.removeEventListener("mousemove", mousemove);
|
|
465
|
+
};
|
|
466
|
+
}, []);
|
|
467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
ref: outer,
|
|
471
|
+
className: (0, import_tailwind_merge2.twMerge)(
|
|
472
|
+
//
|
|
473
|
+
"relative transition-all hover:duration-50",
|
|
474
|
+
shouldTranslate && "hover:shadow-xl",
|
|
475
|
+
className2
|
|
476
|
+
),
|
|
477
|
+
...props,
|
|
478
|
+
children: [
|
|
479
|
+
children,
|
|
480
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
481
|
+
"div",
|
|
482
|
+
{
|
|
483
|
+
className: "pointer-events-none absolute inset-0 transition-all",
|
|
484
|
+
style: {
|
|
485
|
+
backgroundImage: "radial-gradient(circle at 50% -20%, #ffffff00, #ffffff00)"
|
|
486
|
+
},
|
|
487
|
+
ref: inner
|
|
488
|
+
}
|
|
489
|
+
)
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
// src/CanvasThumbnailGridItem.tsx
|
|
496
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
497
|
+
function CanvasThumbnailGridItem(props) {
|
|
498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_iiif_vault3.CanvasContext, { canvas: props.id, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { onMouseDown: props.onClick, className: "flex flex-col", "data-canvas-selected": props.selected, children: [
|
|
499
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "bg-me-gray-100 w-full aspect-square flex-1 overflow-hidden rounded", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
500
|
+
Card3D,
|
|
501
|
+
{
|
|
502
|
+
className: cn(
|
|
503
|
+
"border-2 border-transparent p-1 w-full h-full rounded",
|
|
504
|
+
props.selected && "border-me-primary-500"
|
|
505
|
+
),
|
|
506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LazyThumbnail, {})
|
|
507
|
+
}
|
|
508
|
+
) }),
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CanvasLabel, { className: "text-sm text-center truncate mt-1", as: "div" })
|
|
510
|
+
] }) });
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// src/Modal.tsx
|
|
514
|
+
var import_react4 = require("@headlessui/react");
|
|
515
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
516
|
+
function Modal({ id, title, open = true, onClose, actions, children }) {
|
|
517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react4.Dialog, { open, onClose, id, className: "relative z-[500]", children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `fixed inset-0 bg-black/30 animate-fadeIn z-[501]`, "aria-hidden": "true" }),
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "fixed inset-0 flex w-screen items-center justify-center p-4 z-[502]", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "relative p-4 w-full max-w-3xl max-h-full", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react4.DialogPanel, { className: "relative bg-white rounded-lg overflow-hidden shadow-2xl dark:bg-gray-700 max-h-[80vh] flex flex-col", children: [
|
|
520
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between p-4 md:p-5 rounded-t-lg dark:border-gray-600 sticky top-0 bg-white", children: [
|
|
521
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react4.DialogTitle, { className: "text-xl font-semibold text-gray-900 dark:text-white", children: title }),
|
|
522
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react4.CloseButton, { className: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white", children: [
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
524
|
+
"svg",
|
|
525
|
+
{
|
|
526
|
+
className: "w-3 h-3",
|
|
527
|
+
"aria-hidden": "true",
|
|
528
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
529
|
+
fill: "none",
|
|
530
|
+
viewBox: "0 0 14 14",
|
|
531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
532
|
+
"path",
|
|
533
|
+
{
|
|
534
|
+
stroke: "currentColor",
|
|
535
|
+
strokeLinecap: "round",
|
|
536
|
+
strokeLinejoin: "round",
|
|
537
|
+
strokeWidth: "2",
|
|
538
|
+
d: "m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
|
|
539
|
+
}
|
|
540
|
+
)
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
|
|
544
|
+
] })
|
|
545
|
+
] }),
|
|
546
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react4.Description, { className: "flex-1 min-h-0 overflow-y-auto", children }),
|
|
547
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600 justify-end", children: actions }) : null
|
|
548
|
+
] }) }) })
|
|
549
|
+
] }) });
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// src/ControlButton.tsx
|
|
553
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
554
|
+
function ControlButton({
|
|
555
|
+
children,
|
|
556
|
+
className: className2,
|
|
557
|
+
...props
|
|
558
|
+
}) {
|
|
559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
560
|
+
"button",
|
|
561
|
+
{
|
|
562
|
+
className: cn(
|
|
563
|
+
"bg-white border border-me-primary-500 text-xs py-1 px-2 rounded text-me-primary-600 hover:bg-me-primary-50",
|
|
564
|
+
className2
|
|
565
|
+
),
|
|
566
|
+
...props,
|
|
567
|
+
children
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// src/OpaqueControls.tsx
|
|
573
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
574
|
+
function OpaqueControls(props) {
|
|
575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
576
|
+
"div",
|
|
577
|
+
{
|
|
578
|
+
className: cn("flex w-full p-0.5 opacity-0 transition-opacity duration-300 gap-2", props.active && "opacity-1"),
|
|
579
|
+
children: props.children
|
|
580
|
+
}
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// src/Tabs.tsx
|
|
585
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
586
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
587
|
+
function Tabs({ className: className2, children, ...props }) {
|
|
588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
589
|
+
import_react_aria_components3.Tabs,
|
|
590
|
+
{
|
|
591
|
+
className: (state) => {
|
|
592
|
+
const cs = typeof className2 === "function" ? className2(state) : className2;
|
|
593
|
+
return cn("", cs);
|
|
594
|
+
},
|
|
595
|
+
...props,
|
|
596
|
+
children
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
}
|
|
600
|
+
function TabList({
|
|
601
|
+
className: className2,
|
|
602
|
+
children,
|
|
603
|
+
...props
|
|
604
|
+
}) {
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
606
|
+
import_react_aria_components3.TabList,
|
|
607
|
+
{
|
|
608
|
+
className: (state) => {
|
|
609
|
+
const cs = typeof className2 === "function" ? className2(state) : className2;
|
|
610
|
+
return cn("flex gap-4", cs);
|
|
611
|
+
},
|
|
612
|
+
...props,
|
|
613
|
+
children
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
function Tab({ className: className2, children, ...props }) {
|
|
618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
619
|
+
import_react_aria_components3.Tab,
|
|
620
|
+
{
|
|
621
|
+
className: (state) => {
|
|
622
|
+
const cs = typeof className2 === "function" ? className2(state) : className2;
|
|
623
|
+
return cn(
|
|
624
|
+
"cursor-default outline-none group py-1 font-semibold px-2 border-b-2 text-me-gray-700",
|
|
625
|
+
state.isSelected && "border-b-me-primary-600 text-black",
|
|
626
|
+
state.isFocusVisible && "focus-visible:bg-me-primary-100",
|
|
627
|
+
cs
|
|
628
|
+
);
|
|
629
|
+
},
|
|
630
|
+
...props,
|
|
631
|
+
children
|
|
632
|
+
}
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
function TabPanel({ className: className2, children, ...props }) {
|
|
636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
637
|
+
import_react_aria_components3.TabPanel,
|
|
638
|
+
{
|
|
639
|
+
className: (state) => {
|
|
640
|
+
const cs = typeof className2 === "function" ? className2(state) : className2;
|
|
641
|
+
return cn("", cs);
|
|
642
|
+
},
|
|
643
|
+
...props,
|
|
644
|
+
children
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// src/CreatorGrid.tsx
|
|
650
|
+
var import_react_aria_components4 = require("react-aria-components");
|
|
651
|
+
var import_tailwind_merge3 = require("tailwind-merge");
|
|
652
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
653
|
+
function CreatorGrid(props) {
|
|
654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
655
|
+
import_react_aria_components4.ListBox,
|
|
656
|
+
{
|
|
657
|
+
orientation: "horizontal",
|
|
658
|
+
"aria-label": props.label,
|
|
659
|
+
selectionMode: "single",
|
|
660
|
+
items: props.items,
|
|
661
|
+
className: "grid grid-sm gap-4 p-4",
|
|
662
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CreatorGridItem, { ...item })
|
|
663
|
+
}
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
function CreatorGridItem(props) {
|
|
667
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
668
|
+
import_react_aria_components4.ListBoxItem,
|
|
669
|
+
{
|
|
670
|
+
id: props.id,
|
|
671
|
+
onAction: props.onClick,
|
|
672
|
+
className: ($s) => (0, import_tailwind_merge3.twMerge)(
|
|
673
|
+
"bg-white p-2 rounded-md border hover:border-me-primary-500",
|
|
674
|
+
$s.isFocused && "border-me-primary-500 outline-me-primary-500 outline-2"
|
|
675
|
+
),
|
|
676
|
+
children: [
|
|
677
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rounded bg-me-gray-300 mb-2 flex items-center justify-center py-1", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-center [&>svg]:w-16 [&>svg]:h-16", children: props.icon }) }),
|
|
678
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-center font-semibold text-sm", children: props.title }),
|
|
679
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-sm text-center text-black/50", children: props.description })
|
|
680
|
+
]
|
|
681
|
+
}
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// src/icons/DownloadIcon.tsx
|
|
686
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
687
|
+
var DownloadIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
688
|
+
"path",
|
|
689
|
+
{
|
|
690
|
+
d: "M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z",
|
|
691
|
+
fill: "currentColor"
|
|
692
|
+
}
|
|
693
|
+
) });
|
|
694
|
+
|
|
695
|
+
// src/DownloadButton.tsx
|
|
696
|
+
var import_react_aria = require("react-aria");
|
|
697
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
698
|
+
function DownloadButton({ label, id: _id, getData, fileName, fileType }) {
|
|
699
|
+
const id = (0, import_react_aria.useId)(_id);
|
|
700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Tooltip, { placement: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
701
|
+
TooltipTrigger,
|
|
702
|
+
{
|
|
703
|
+
className: "bg-me-gray-100 hover:bg-me-primary-500 hover:text-white p-1 rounded-md text-me-primary-500 text-2xl",
|
|
704
|
+
"aria-label": label,
|
|
705
|
+
id,
|
|
706
|
+
onPress: () => createDownload(getData(), fileName, fileType),
|
|
707
|
+
children: [
|
|
708
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DownloadIcon, { "aria-labelledby": _id }),
|
|
709
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DefaultTooltipContent, { children: label })
|
|
710
|
+
]
|
|
711
|
+
}
|
|
712
|
+
) });
|
|
713
|
+
}
|
|
714
|
+
function createDownload(data, fileName, fileType = "text/json") {
|
|
715
|
+
const blob = data instanceof Blob ? data : new Blob([data], { type: fileType });
|
|
716
|
+
const a = document.createElement("a");
|
|
717
|
+
a.download = fileName;
|
|
718
|
+
a.href = window.URL.createObjectURL(blob);
|
|
719
|
+
const clickEvt = new MouseEvent("click", {
|
|
720
|
+
view: window,
|
|
721
|
+
bubbles: true,
|
|
722
|
+
cancelable: true
|
|
723
|
+
});
|
|
724
|
+
a.dispatchEvent(clickEvt);
|
|
725
|
+
a.remove();
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// src/AtlasBanner.tsx
|
|
729
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
730
|
+
function AtlasBanner({ children, controlsId }) {
|
|
731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "bg-me-gray-100 border-b text-black p-1 flex gap-4 items-center h-12", children: [
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "px-4", children }),
|
|
733
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { id: controlsId || "atlas-controls", className: "flex gap-2" })
|
|
734
|
+
] });
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// src/SvgControlBar.tsx
|
|
738
|
+
var import_react_iiif_vault4 = require("react-iiif-vault");
|
|
739
|
+
|
|
740
|
+
// src/icons/DrawIcon.tsx
|
|
741
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
742
|
+
var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
743
|
+
"svg",
|
|
744
|
+
{
|
|
745
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
746
|
+
width: "1em",
|
|
747
|
+
height: "1em",
|
|
748
|
+
viewBox: "0 -960 960 960",
|
|
749
|
+
"aria-labelledby": titleId,
|
|
750
|
+
...props,
|
|
751
|
+
children: [
|
|
752
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("title", { id: titleId, children: title }) : null,
|
|
753
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
754
|
+
"path",
|
|
755
|
+
{
|
|
756
|
+
fill: "currentColor",
|
|
757
|
+
d: "M160-120v-170l527-526q12-12 27-18t30-6q16 0 30.5 6t25.5 18l56 56q12 11 18 25.5t6 30.5q0 15-6 30t-18 27L330-120H160Zm80-80h56l393-392-28-29-29-28-392 393v56Zm560-503-57-57 57 57Zm-139 82-29-28 57 57-28-29ZM560-120q74 0 137-37t63-103q0-36-19-62t-51-45l-59 59q23 10 36 22t13 26q0 23-36.5 41.5T560-200q-17 0-28.5 11.5T520-160q0 17 11.5 28.5T560-120ZM183-426l60-60q-20-8-31.5-16.5T200-520q0-12 18-24t76-37q88-38 117-69t29-70q0-55-44-87.5T280-840q-45 0-80.5 16T145-785q-11 13-9 29t15 26q13 11 29 9t27-13q14-14 31-20t42-6q41 0 60.5 12t19.5 28q0 14-17.5 25.5T262-654q-80 35-111 63.5T120-520q0 32 17 54.5t46 39.5Z"
|
|
758
|
+
}
|
|
759
|
+
)
|
|
760
|
+
]
|
|
761
|
+
}
|
|
762
|
+
);
|
|
763
|
+
|
|
764
|
+
// src/icons/PolygonIcon.tsx
|
|
765
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
766
|
+
var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
767
|
+
"svg",
|
|
768
|
+
{
|
|
769
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
770
|
+
width: "1em",
|
|
771
|
+
height: "1em",
|
|
772
|
+
viewBox: "0 -960 960 960",
|
|
773
|
+
"aria-labelledby": titleId,
|
|
774
|
+
...props,
|
|
775
|
+
children: [
|
|
776
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("title", { id: titleId, children: title }) : null,
|
|
777
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
778
|
+
"path",
|
|
779
|
+
{
|
|
780
|
+
fill: "currentColor",
|
|
781
|
+
d: "M600-80v-100L320-320H120v-240h172l108-124v-196h240v240H468L360-516v126l240 120v-50h240v240H600ZM480-720h80v-80h-80v80ZM200-400h80v-80h-80v80Zm480 240h80v-80h-80v80ZM520-760ZM240-440Zm480 240Z"
|
|
782
|
+
}
|
|
783
|
+
)
|
|
784
|
+
]
|
|
785
|
+
}
|
|
786
|
+
);
|
|
787
|
+
|
|
788
|
+
// src/icons/LineIcon.tsx
|
|
789
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
790
|
+
function LineIcon({ title, titleId, ...props }) {
|
|
791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
|
|
792
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("title", { id: titleId, children: title }) : null,
|
|
793
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
|
|
794
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: 4.5, cy: 4.5, r: 2.5, fill: "currentColor" }),
|
|
795
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: 15.5, cy: 15.5, r: 2.5, fill: "currentColor" }),
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m13.5 13.5-9-9" })
|
|
797
|
+
] })
|
|
798
|
+
] });
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
// src/icons/LineBoxIcon.tsx
|
|
802
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
803
|
+
function LineBoxIcon({ title, titleId, ...props }) {
|
|
804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
|
|
805
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("title", { id: titleId, children: title }) : null,
|
|
806
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
|
|
807
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M0 0h20v20H0z" }),
|
|
808
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m8.5 11.5 6-6M16 4v3m0-3h-3m0 14L2 7" }),
|
|
809
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { stroke: "currentColor", strokeOpacity: 0.407, strokeWidth: 2, d: "m2 7 5-5 11 11-5 5z" })
|
|
810
|
+
] })
|
|
811
|
+
] });
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// src/icons/ShapesIcon.tsx
|
|
815
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
816
|
+
var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
817
|
+
"svg",
|
|
818
|
+
{
|
|
819
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
820
|
+
width: "1em",
|
|
821
|
+
height: "1em",
|
|
822
|
+
viewBox: "0 -960 960 960",
|
|
823
|
+
"aria-labelledby": titleId,
|
|
824
|
+
...props,
|
|
825
|
+
children: [
|
|
826
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("title", { id: titleId, children: title }) : null,
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
828
|
+
"path",
|
|
829
|
+
{
|
|
830
|
+
fill: "currentColor",
|
|
831
|
+
d: "M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"
|
|
832
|
+
}
|
|
833
|
+
)
|
|
834
|
+
]
|
|
835
|
+
}
|
|
836
|
+
);
|
|
837
|
+
|
|
838
|
+
// src/icons/SquareIcon.tsx
|
|
839
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
840
|
+
var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
841
|
+
"svg",
|
|
842
|
+
{
|
|
843
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
844
|
+
width: "1em",
|
|
845
|
+
height: "1em",
|
|
846
|
+
viewBox: "0 -960 960 960",
|
|
847
|
+
"aria-labelledby": titleId,
|
|
848
|
+
...props,
|
|
849
|
+
children: [
|
|
850
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("title", { id: titleId, children: title }) : null,
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
852
|
+
"path",
|
|
853
|
+
{
|
|
854
|
+
fill: "currentColor",
|
|
855
|
+
d: "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0 0v-560 560Z"
|
|
856
|
+
}
|
|
857
|
+
)
|
|
858
|
+
]
|
|
859
|
+
}
|
|
860
|
+
);
|
|
861
|
+
|
|
862
|
+
// src/icons/TriangleIcon.tsx
|
|
863
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
864
|
+
var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
865
|
+
"svg",
|
|
866
|
+
{
|
|
867
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
868
|
+
width: "1em",
|
|
869
|
+
height: "1em",
|
|
870
|
+
viewBox: "0 -960 960 960",
|
|
871
|
+
"aria-labelledby": titleId,
|
|
872
|
+
...props,
|
|
873
|
+
children: [
|
|
874
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("title", { id: titleId, children: title }) : null,
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { d: "m80-160 400-640 400 640H80Zm144-80h512L480-650 224-240Zm256-205Z", fill: "currentColor" })
|
|
876
|
+
]
|
|
877
|
+
}
|
|
878
|
+
);
|
|
879
|
+
|
|
880
|
+
// src/icons/HexagonIcon.tsx
|
|
881
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
882
|
+
var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
883
|
+
"svg",
|
|
884
|
+
{
|
|
885
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
886
|
+
width: "1em",
|
|
887
|
+
height: "1em",
|
|
888
|
+
viewBox: "0 -960 960 960",
|
|
889
|
+
"aria-labelledby": titleId,
|
|
890
|
+
...props,
|
|
891
|
+
children: [
|
|
892
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("title", { id: titleId, children: title }) : null,
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
894
|
+
"path",
|
|
895
|
+
{
|
|
896
|
+
fill: "currentColor",
|
|
897
|
+
d: "M272-120 64-480l208-360h416l208 360-208 360H272Zm46-80h324l161-280-161-280H318L156-480l162 280Zm162-280Z"
|
|
898
|
+
}
|
|
899
|
+
)
|
|
900
|
+
]
|
|
901
|
+
}
|
|
902
|
+
);
|
|
903
|
+
|
|
904
|
+
// src/icons/DeleteForeverIcon.tsx
|
|
905
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
906
|
+
function DeleteForeverIcon(props) {
|
|
907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("svg", { height: "1em", width: "1em", viewBox: "0 0 24 24", ...props, children: [
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
911
|
+
"path",
|
|
912
|
+
{
|
|
913
|
+
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z",
|
|
914
|
+
fill: "currentColor"
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
] });
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
// src/SvgControlBar.tsx
|
|
921
|
+
var import_react5 = require("react");
|
|
922
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
923
|
+
var className = 'bg-me-gray-100 border hover:bg-me-gray-300 rounded p-1 text-2xl text-me-primary-500 data-[active="true"]:border-me-primary-600';
|
|
924
|
+
var icons = {
|
|
925
|
+
DrawIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DrawIcon, {}),
|
|
926
|
+
PolygonIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PolygonIcon, {}),
|
|
927
|
+
LineIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LineIcon, {}),
|
|
928
|
+
LineBoxIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LineBoxIcon, {}),
|
|
929
|
+
ShapesIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ShapesIcon, {}),
|
|
930
|
+
SquareIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SquareIcon, {}),
|
|
931
|
+
TriangleIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TriangleIcon, {}),
|
|
932
|
+
HexagonIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HexagonIcon, {}),
|
|
933
|
+
DeleteForeverIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DeleteForeverIcon, {})
|
|
934
|
+
};
|
|
935
|
+
function SvgControlBar({
|
|
936
|
+
helper,
|
|
937
|
+
state,
|
|
938
|
+
showShapes
|
|
939
|
+
}) {
|
|
940
|
+
(0, import_react5.useEffect)(() => {
|
|
941
|
+
helper.stamps.square();
|
|
942
|
+
}, []);
|
|
943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
944
|
+
import_react_iiif_vault4.RenderSvgEditorControls,
|
|
945
|
+
{
|
|
946
|
+
icons,
|
|
947
|
+
helper,
|
|
948
|
+
state,
|
|
949
|
+
showShapes,
|
|
950
|
+
classNames: {
|
|
951
|
+
button: className
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// src/ConfirmSelectionButton.tsx
|
|
958
|
+
var import_react_aria_components5 = require("react-aria-components");
|
|
959
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
960
|
+
function ConfirmSelectionButton({ onPress, children }) {
|
|
961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_aria_components5.Button, { className: "bg-me-primary-500 px-3 py-1 hover:bg-me-primary-600 text-white rounded", onPress, children });
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
// src/ManifestOverviewEmptyState.tsx
|
|
965
|
+
var import_react_aria_components6 = require("react-aria-components");
|
|
966
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
967
|
+
function ManifestOverviewEmptyState({ onCreate, canCreate }) {
|
|
968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center flex-col gap-5 py-16", children: [
|
|
969
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
970
|
+
Card3D,
|
|
971
|
+
{
|
|
972
|
+
shouldTranslate: true,
|
|
973
|
+
onClick: canCreate ? onCreate : void 0,
|
|
974
|
+
className: "border-2 border-dotted bg-black/5 aspect-[3/4] rounded w-32 border-black"
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "font-bold text-lg", children: "Good to go!" }),
|
|
978
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "max-w-xl px-5", children: "Add a title and top level information for this manifest using the editing panel, and then add some canvases and content." }),
|
|
979
|
+
canCreate ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
980
|
+
import_react_aria_components6.Button,
|
|
981
|
+
{
|
|
982
|
+
className: "px-8 font-bold py-2 border rounded-lg border-me-primary-500 text-me-primary-500 hover:border-me-primary-600 hover:text-me-primary-600",
|
|
983
|
+
onPress: onCreate,
|
|
984
|
+
children: "Start adding content"
|
|
985
|
+
}
|
|
986
|
+
) : null
|
|
987
|
+
] });
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// src/SidebarTabs.tsx
|
|
991
|
+
var import_react6 = require("react");
|
|
992
|
+
var import_react_aria_components7 = require("react-aria-components");
|
|
993
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
994
|
+
function SidebarTabs({ menu, menuId, selectedKey, onSelectionChange }) {
|
|
995
|
+
const ref = (0, import_react6.useRef)(null);
|
|
996
|
+
const [hidden, setHidden] = (0, import_react6.useState)(0);
|
|
997
|
+
const widths = (0, import_react6.useRef)([]);
|
|
998
|
+
const itemsRef = (0, import_react6.useRef)([]);
|
|
999
|
+
const selectedIndex = (0, import_react6.useMemo)(() => menu.findIndex((item) => item.id === selectedKey), [menu, selectedKey]);
|
|
1000
|
+
(0, import_react6.useLayoutEffect)(() => {
|
|
1001
|
+
const cb = () => {
|
|
1002
|
+
if (widths.current.length === 0) {
|
|
1003
|
+
widths.current = [];
|
|
1004
|
+
for (const item of itemsRef.current) {
|
|
1005
|
+
if (item) {
|
|
1006
|
+
widths.current.push(item.getBoundingClientRect().width);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
const fullWidth = widths.current.reduce((a, b) => a + b, 0);
|
|
1011
|
+
if (fullWidth && ref.current) {
|
|
1012
|
+
const el = ref.current;
|
|
1013
|
+
const width = el.getBoundingClientRect().width - 20;
|
|
1014
|
+
let hidden2 = 0;
|
|
1015
|
+
let total = 0;
|
|
1016
|
+
for (let i = widths.current.length - 1; i >= 0; i--) {
|
|
1017
|
+
total += widths.current[i];
|
|
1018
|
+
if (total > width) {
|
|
1019
|
+
hidden2 = i + 1;
|
|
1020
|
+
break;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
setHidden(hidden2);
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
cb();
|
|
1027
|
+
const interval = setInterval(cb, 500);
|
|
1028
|
+
return () => {
|
|
1029
|
+
clearInterval(interval);
|
|
1030
|
+
};
|
|
1031
|
+
}, []);
|
|
1032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1033
|
+
import_react_aria_components7.Tabs,
|
|
1034
|
+
{
|
|
1035
|
+
className: "w-full flex-1 overflow-hidden flex flex-col",
|
|
1036
|
+
selectedKey,
|
|
1037
|
+
onSelectionChange,
|
|
1038
|
+
children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center w-full tab-shadow", children: [
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.TabList, { ref, className: "flex-1 overflow-hidden w-full flex text-sm whitespace-nowrap", children: menu.map((item, idx) => {
|
|
1041
|
+
const isHidden = hidden >= menu.length - idx;
|
|
1042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1043
|
+
import_react_aria_components7.Tab,
|
|
1044
|
+
{
|
|
1045
|
+
ref: (el) => itemsRef.current[idx] = el,
|
|
1046
|
+
id: item.id,
|
|
1047
|
+
className: (state) => cn(
|
|
1048
|
+
//
|
|
1049
|
+
"border-b-2 px-2 py-1 text-sm text-gray-400 select-none hover:text-black focus:ring-0 focus:outline-none",
|
|
1050
|
+
state.isSelected && "border-me-primary-500 text-black",
|
|
1051
|
+
state.isFocusVisible && "ring-0 bg-me-gray-100",
|
|
1052
|
+
isHidden && "hidden"
|
|
1053
|
+
),
|
|
1054
|
+
children: item.label
|
|
1055
|
+
},
|
|
1056
|
+
item.id
|
|
1057
|
+
);
|
|
1058
|
+
}) }),
|
|
1059
|
+
hidden > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_aria_components7.MenuTrigger, { children: [
|
|
1060
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1061
|
+
import_react_aria_components7.Button,
|
|
1062
|
+
{
|
|
1063
|
+
className: cn(
|
|
1064
|
+
"rounded bg-gray-100 px-1.5 py-1 mr-2 mb-1 text-me-primary-500 semibold uppercase text-[10px]",
|
|
1065
|
+
selectedIndex > hidden && "bg-me-primary-500 text-white rounded"
|
|
1066
|
+
),
|
|
1067
|
+
children: "MORE"
|
|
1068
|
+
}
|
|
1069
|
+
),
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.Menu, { className: "bg-white rounded shadow-lg flex flex-col gap-0.5 p-0.5 min-w-28", children: menu.map((item, idx) => {
|
|
1071
|
+
if (idx < menu.length - hidden)
|
|
1072
|
+
return null;
|
|
1073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1074
|
+
import_react_aria_components7.MenuItem,
|
|
1075
|
+
{
|
|
1076
|
+
className: (state) => cn(
|
|
1077
|
+
"hover:bg-me-gray-100 p-1 rounded-sm text-sm",
|
|
1078
|
+
selectedKey === item.id && "ring ring-me-primary-500"
|
|
1079
|
+
),
|
|
1080
|
+
onAction: () => onSelectionChange?.(item.id),
|
|
1081
|
+
children: item.label
|
|
1082
|
+
},
|
|
1083
|
+
item.id
|
|
1084
|
+
);
|
|
1085
|
+
}) }) })
|
|
1086
|
+
] })
|
|
1087
|
+
] }),
|
|
1088
|
+
menu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.TabPanel, { id: item.id, className: "flex-1 overflow-y-auto h-full", children: item.renderComponent }, item.id))
|
|
1089
|
+
]
|
|
1090
|
+
},
|
|
1091
|
+
menuId
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// src/MetadataContainer.tsx
|
|
1096
|
+
var import_react_iiif_vault5 = require("react-iiif-vault");
|
|
1097
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1098
|
+
function MetadataContainer({
|
|
1099
|
+
className: className2,
|
|
1100
|
+
label,
|
|
1101
|
+
children,
|
|
1102
|
+
...props
|
|
1103
|
+
}) {
|
|
1104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1105
|
+
"div",
|
|
1106
|
+
{
|
|
1107
|
+
className: cn(
|
|
1108
|
+
"hover:ring ring-gray-200 focus-within:ring-me-primary-500 focus-within:ring p-2 rounded mb-2",
|
|
1109
|
+
className2
|
|
1110
|
+
),
|
|
1111
|
+
...props,
|
|
1112
|
+
children: [
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_iiif_vault5.LocaleString, { className: "text-lg font-bold text-[#333] mb-2", as: "h3", children: label }),
|
|
1114
|
+
children
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
// src/EmptyState.tsx
|
|
1121
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1122
|
+
function EmptyState(props) {
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1124
|
+
"div",
|
|
1125
|
+
{
|
|
1126
|
+
className: cn(
|
|
1127
|
+
"flex items-center justify-center text-gray-400 text-md",
|
|
1128
|
+
props.$noMargin ? "" : "m-4",
|
|
1129
|
+
props.$box ? "p-4 border border-gray-200 rounded" : ""
|
|
1130
|
+
),
|
|
1131
|
+
children: props.children
|
|
1132
|
+
}
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// src/ManifestEditorLogo.tsx
|
|
1137
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1138
|
+
function ManifestEditorLogo(props) {
|
|
1139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1140
|
+
"svg",
|
|
1141
|
+
{
|
|
1142
|
+
width: "1em",
|
|
1143
|
+
height: "1em",
|
|
1144
|
+
viewBox: "0 0 206 27",
|
|
1145
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1146
|
+
className: "me-logo h-[23px] w-[176px]",
|
|
1147
|
+
...props,
|
|
1148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("g", { fill: "none", children: [
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1150
|
+
"path",
|
|
1151
|
+
{
|
|
1152
|
+
d: "M62.558 5.41v14.873h-2.983v-9.675l-3.985 9.675h-2.26l-4.006-9.675v9.675H46.34V5.41h3.388l4.73 11.06L59.19 5.41zm2.173 8.928c0-1.194.238-2.252.714-3.176.476-.923 1.123-1.633 1.94-2.13.816-.498 1.73-.746 2.738-.746.88 0 1.651.177 2.312.532.66.355 1.19.803 1.588 1.343V8.477h3.004v11.806h-3.004v-1.726c-.384.554-.913 1.012-1.588 1.374-.675.363-1.453.544-2.334.544-.994 0-1.9-.256-2.717-.767-.816-.512-1.463-1.233-1.939-2.163-.476-.93-.714-2-.714-3.207Zm9.292.042c0-.724-.143-1.346-.427-1.864a3.005 3.005 0 0 0-1.15-1.194 3.076 3.076 0 0 0-1.556-.415c-.554 0-1.066.135-1.534.405-.47.27-.85.664-1.14 1.182-.292.519-.437 1.133-.437 1.844 0 .71.145 1.331.437 1.864.29.533.674.941 1.15 1.226.476.284.984.426 1.524.426.554 0 1.073-.139 1.556-.416a3.005 3.005 0 0 0 1.15-1.193c.284-.519.427-1.14.427-1.865Zm12.466-6.073c1.406 0 2.543.444 3.41 1.332.866.888 1.3 2.127 1.3 3.718v6.926h-2.984v-6.52c0-.938-.234-1.66-.703-2.164-.47-.504-1.108-.756-1.918-.756-.824 0-1.474.252-1.95.756-.476.505-.714 1.226-.714 2.163v6.521h-2.983V8.477h2.983v1.47a4.121 4.121 0 0 1 1.524-1.203 4.713 4.713 0 0 1 2.035-.437Zm9.057-1.237c-.526 0-.963-.166-1.311-.5a1.657 1.657 0 0 1-.522-1.247c0-.497.174-.912.522-1.246.348-.334.785-.5 1.31-.5.526 0 .963.166 1.311.5.348.334.522.75.522 1.246 0 .498-.174.913-.522 1.247-.348.334-.785.5-1.31.5Zm1.47 1.407v11.806h-2.983V8.477h2.983Zm8.354 2.451h-2.068v9.355h-3.026v-9.355h-1.342v-2.45h1.342V7.88c0-1.45.412-2.515 1.236-3.197.824-.682 2.067-1.001 3.73-.959V6.24c-.725-.014-1.23.106-1.513.362-.284.256-.427.718-.427 1.385v.49h2.068v2.451Zm12.913 3.197c0 .426-.028.81-.085 1.15h-8.63c.07.853.369 1.52.895 2.003.525.483 1.172.725 1.939.725 1.108 0 1.896-.476 2.365-1.428h3.218c-.34 1.137-.994 2.07-1.96 2.802-.967.732-2.153 1.098-3.56 1.098-1.136 0-2.155-.252-3.057-.757a5.325 5.325 0 0 1-2.11-2.141c-.504-.924-.756-1.99-.756-3.197 0-1.222.248-2.294.745-3.218a5.204 5.204 0 0 1 2.089-2.13c.895-.498 1.925-.746 3.09-.746 1.122 0 2.127.241 3.015.724a5.1 5.1 0 0 1 2.067 2.057c.49.887.735 1.907.735 3.058Zm-3.09-.853c-.014-.767-.29-1.381-.83-1.843-.54-.462-1.201-.693-1.982-.693-.74 0-1.36.224-1.865.671-.504.448-.813 1.07-.927 1.865h5.604Zm9.782 7.203c-.966 0-1.833-.174-2.6-.522-.767-.348-1.375-.82-1.822-1.417a3.591 3.591 0 0 1-.735-1.982h3.004c.057.454.281.83.672 1.13.39.298.877.447 1.46.447.568 0 1.012-.114 1.331-.341.32-.227.48-.519.48-.874 0-.383-.196-.671-.586-.863-.391-.192-1.012-.401-1.865-.629-.88-.213-1.602-.433-2.163-.66a3.755 3.755 0 0 1-1.449-1.044c-.405-.47-.607-1.101-.607-1.897 0-.653.188-1.25.564-1.79.377-.54.917-.966 1.62-1.279.703-.312 1.53-.468 2.483-.468 1.406 0 2.528.351 3.367 1.054.838.704 1.3 1.652 1.385 2.845h-2.856c-.042-.469-.238-.841-.586-1.118-.348-.277-.813-.416-1.396-.416-.54 0-.955.1-1.246.298a.951.951 0 0 0-.437.831c0 .398.199.7.597.906.397.206 1.015.416 1.854.629.852.213 1.555.433 2.11.66a3.727 3.727 0 0 1 1.438 1.055c.405.476.614 1.105.628 1.886 0 .682-.188 1.293-.564 1.833-.377.54-.917.962-1.62 1.268-.703.305-1.524.458-2.461.458Zm10.569-9.547v5.711c0 .398.096.686.288.863.192.178.515.267.97.267h1.385v2.514h-1.875c-2.515 0-3.772-1.222-3.772-3.665v-5.69h-1.407v-2.45h1.407v-2.92h3.004v2.92h2.643v2.45h-2.643Zm12.851-3.111v3.73h5.007v2.364h-5.007v3.943h5.647v2.43h-8.631V5.386h8.63v2.43zm7.585 6.521c0-1.194.239-2.252.715-3.176.476-.923 1.126-1.633 1.95-2.13.824-.498 1.74-.746 2.749-.746.767 0 1.498.167 2.194.5.697.334 1.25.778 1.663 1.332V4.514h3.026v15.77h-3.026v-1.748c-.37.582-.888 1.051-1.556 1.406s-1.442.533-2.323.533a5.07 5.07 0 0 1-2.727-.767c-.824-.512-1.474-1.233-1.95-2.163-.476-.93-.714-2-.714-3.207Zm9.292.042c0-.724-.142-1.346-.426-1.864a3.005 3.005 0 0 0-1.151-1.194 3.076 3.076 0 0 0-1.556-.415 3.02 3.02 0 0 0-1.534.405c-.469.27-.849.664-1.14 1.182-.291.519-.437 1.133-.437 1.844 0 .71.146 1.331.437 1.864.291.533.675.941 1.15 1.226a2.93 2.93 0 0 0 1.524.426c.554 0 1.073-.139 1.556-.416a3.005 3.005 0 0 0 1.15-1.193c.285-.519.427-1.14.427-1.865Zm7.438-7.31c-.527 0-.963-.166-1.311-.5a1.657 1.657 0 0 1-.523-1.247c0-.497.174-.912.523-1.246.348-.334.784-.5 1.31-.5s.963.166 1.31.5c.349.334.523.75.523 1.246 0 .498-.174.913-.522 1.247-.348.334-.785.5-1.31.5Zm1.47 1.407v11.806h-2.984V8.477h2.984Zm6.414 2.451v5.711c0 .398.096.686.287.863.192.178.515.267.97.267h1.385v2.514h-1.875c-2.515 0-3.772-1.222-3.772-3.665v-5.69h-1.406v-2.45h1.406v-2.92h3.005v2.92h2.642v2.45h-2.642Zm10.036 9.547c-1.136 0-2.159-.252-3.068-.757a5.447 5.447 0 0 1-2.141-2.141c-.519-.924-.778-1.99-.778-3.197s.266-2.273.799-3.196a5.553 5.553 0 0 1 2.184-2.142c.924-.504 1.954-.756 3.09-.756 1.137 0 2.167.252 3.09.756a5.553 5.553 0 0 1 2.184 2.142c.533.923.8 1.989.8 3.196 0 1.208-.274 2.273-.821 3.197a5.681 5.681 0 0 1-2.216 2.141c-.93.505-1.971.757-3.122.757Zm0-2.6a3.1 3.1 0 0 0 1.524-.394c.476-.263.856-.657 1.14-1.183.285-.526.427-1.165.427-1.918 0-1.122-.295-1.985-.885-2.589a2.907 2.907 0 0 0-2.163-.906c-.852 0-1.566.302-2.141.906-.576.604-.863 1.467-.863 2.59 0 1.122.28 1.985.841 2.588.562.604 1.268.906 2.12.906Zm11.338-7.565a4.194 4.194 0 0 1 1.502-1.47c.618-.356 1.325-.533 2.12-.533v3.132h-.788c-.938 0-1.644.22-2.12.661-.476.44-.714 1.208-.714 2.302v5.881h-2.984V8.477h2.984v1.833Z",
|
|
1153
|
+
fill: "#000"
|
|
1154
|
+
}
|
|
1155
|
+
),
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { fill: "#E94581", className: "me-logo-1", d: "M0 13.343 13.343 0l13.343 13.343-13.343 13.343z" }),
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { fill: "#E94581", className: "me-logo-2", d: "M12.137 13.346 25.48.003l13.343 13.343L25.48 26.69z" }),
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { fill: "#C63E75", className: "me-logo-3", d: "m12.104 13.348 7.311-7.311 7.312 7.311-7.312 7.312z" })
|
|
1159
|
+
] })
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// src/Forms.tsx
|
|
1165
|
+
var import_react_aria_components8 = require("react-aria-components");
|
|
1166
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1167
|
+
function MeLabel({ className: className2, ...props }) {
|
|
1168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1169
|
+
import_react_aria_components8.Label,
|
|
1170
|
+
{
|
|
1171
|
+
className: cn(
|
|
1172
|
+
//
|
|
1173
|
+
"font-semibold text-sm",
|
|
1174
|
+
className2
|
|
1175
|
+
),
|
|
1176
|
+
...props
|
|
1177
|
+
}
|
|
1178
|
+
);
|
|
1179
|
+
}
|
|
1180
|
+
function MeRadioGroup({ className: className2, ...props }) {
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1182
|
+
import_react_aria_components8.RadioGroup,
|
|
1183
|
+
{
|
|
1184
|
+
className: cn(
|
|
1185
|
+
//
|
|
1186
|
+
"",
|
|
1187
|
+
className2
|
|
1188
|
+
),
|
|
1189
|
+
...props
|
|
1190
|
+
}
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
function MeRadio({ className: className2, ...props }) {
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1195
|
+
import_react_aria_components8.Radio,
|
|
1196
|
+
{
|
|
1197
|
+
className: (state) => cn(
|
|
1198
|
+
//
|
|
1199
|
+
"outline outline-me-primary-500 outline-offset-2 w-5 h-5 rounded-full bg-white transition-all border-[7px] border-gray-700 group-pressed:border-gray-800 outline-0",
|
|
1200
|
+
className2
|
|
1201
|
+
),
|
|
1202
|
+
...props
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
function MeForm({ className: className2, ...props }) {
|
|
1207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1208
|
+
import_react_aria_components8.Form,
|
|
1209
|
+
{
|
|
1210
|
+
className: cn(
|
|
1211
|
+
//
|
|
1212
|
+
"",
|
|
1213
|
+
className2
|
|
1214
|
+
),
|
|
1215
|
+
...props
|
|
1216
|
+
}
|
|
1217
|
+
);
|
|
1218
|
+
}
|
|
1219
|
+
function MeInput({ className: className2, ...props }) {
|
|
1220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1221
|
+
import_react_aria_components8.Input,
|
|
1222
|
+
{
|
|
1223
|
+
className: cn(
|
|
1224
|
+
//
|
|
1225
|
+
"p-2 bg-me-gray-100 border-b border-b-me-gray-500",
|
|
1226
|
+
"focus:ring-0 outline-0 focus:border-me-primary-500 focus:bg-[#ECEEF5]",
|
|
1227
|
+
className2
|
|
1228
|
+
),
|
|
1229
|
+
...props
|
|
1230
|
+
}
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
function MeInputContainer({
|
|
1234
|
+
horizontal,
|
|
1235
|
+
className: className2,
|
|
1236
|
+
...props
|
|
1237
|
+
}) {
|
|
1238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1239
|
+
"div",
|
|
1240
|
+
{
|
|
1241
|
+
className: cn(
|
|
1242
|
+
//
|
|
1243
|
+
"flex flex-col gap-2",
|
|
1244
|
+
horizontal && "flex-row",
|
|
1245
|
+
className2
|
|
1246
|
+
),
|
|
1247
|
+
...props
|
|
1248
|
+
}
|
|
1249
|
+
);
|
|
1250
|
+
}
|
|
1251
|
+
var Form = {
|
|
1252
|
+
Input: MeInput,
|
|
1253
|
+
Form: MeForm,
|
|
1254
|
+
Label: MeLabel,
|
|
1255
|
+
InputContainer: MeInputContainer,
|
|
1256
|
+
RadioGroup: MeRadioGroup,
|
|
1257
|
+
Radio: MeRadio
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
// src/icons/CreateCanvasIcon.tsx
|
|
1261
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1262
|
+
function CreateCanvasIcon() {
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1266
|
+
"path",
|
|
1267
|
+
{
|
|
1268
|
+
d: "M13 11h-2v3H8v2h3v3h2v-3h3v-2h-3zm1-9H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z",
|
|
1269
|
+
fill: "currentColor"
|
|
1270
|
+
}
|
|
1271
|
+
)
|
|
1272
|
+
] });
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
// src/icons/AddImageIcon.tsx
|
|
1276
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1277
|
+
var AddImageIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1278
|
+
"path",
|
|
1279
|
+
{
|
|
1280
|
+
d: "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h360v80H200v560h560v-360h80v360q0 33-23.5 56.5T760-120H200Zm480-480v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80ZM240-280h480L570-480 450-320l-90-120-120 160Zm-40-480v560-560Z",
|
|
1281
|
+
fill: "currentColor"
|
|
1282
|
+
}
|
|
1283
|
+
) });
|
|
1284
|
+
|
|
1285
|
+
// src/icons/IIIFLogo.tsx
|
|
1286
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1287
|
+
var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
1288
|
+
"svg",
|
|
1289
|
+
{
|
|
1290
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1291
|
+
xmlSpace: "preserve",
|
|
1292
|
+
width: "1em",
|
|
1293
|
+
height: "1em",
|
|
1294
|
+
...props,
|
|
1295
|
+
viewBox: "0 0 493.36 441.333",
|
|
1296
|
+
children: [
|
|
1297
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1298
|
+
"path",
|
|
1299
|
+
{
|
|
1300
|
+
d: "m65.242 2178.75 710-263.75-1.25-1900-708.75 261.25v1902.5m738.903 461.34c81.441-240.91-26.473-436.2-241.04-436.2-214.558 0-454.511 195.29-535.953 436.2-81.433 240.89 26.48 436.18 241.039 436.18 214.567 0 454.512-195.29 535.954-436.18",
|
|
1301
|
+
style: {
|
|
1302
|
+
fill: mono ? "currentColor" : "#2873ab",
|
|
1303
|
+
fillOpacity: 1,
|
|
1304
|
+
fillRule: "nonzero",
|
|
1305
|
+
stroke: "none"
|
|
1306
|
+
},
|
|
1307
|
+
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1308
|
+
}
|
|
1309
|
+
),
|
|
1310
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1311
|
+
"path",
|
|
1312
|
+
{
|
|
1313
|
+
d: "M1678.58 2178.75 968.578 1915l1.25-1900 708.752 261.25v1902.5m-743.498 461.34c-81.437-240.91 26.477-436.2 241.038-436.2 214.56 0 454.51 195.29 535.96 436.2 81.43 240.89-26.48 436.18-241.04 436.18-214.57 0-454.52-195.29-535.958-436.18",
|
|
1314
|
+
style: {
|
|
1315
|
+
fill: mono ? "currentColor" : "#ed1d33",
|
|
1316
|
+
fillOpacity: 1,
|
|
1317
|
+
fillRule: "nonzero",
|
|
1318
|
+
stroke: "none"
|
|
1319
|
+
},
|
|
1320
|
+
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1321
|
+
}
|
|
1322
|
+
),
|
|
1323
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1324
|
+
"path",
|
|
1325
|
+
{
|
|
1326
|
+
d: "m1860.24 2178.75 710-263.75-1.25-1900-708.75 261.25v1902.5m743.5 461.34c81.45-240.91-26.47-436.2-241.03-436.2-214.58 0-454.52 195.29-535.96 436.2-81.44 240.89 26.48 436.18 241.03 436.18 214.57 0 454.51-195.29 535.96-436.18",
|
|
1327
|
+
style: {
|
|
1328
|
+
fill: mono ? "currentColor" : "#2873ab",
|
|
1329
|
+
fillOpacity: 1,
|
|
1330
|
+
fillRule: "nonzero",
|
|
1331
|
+
stroke: "none"
|
|
1332
|
+
},
|
|
1333
|
+
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1334
|
+
}
|
|
1335
|
+
),
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1337
|
+
"path",
|
|
1338
|
+
{
|
|
1339
|
+
d: "M3700.24 3310v-652.5s-230 90-257.5-142.5c-2.5-247.5 0-336.25 0-336.25l257.5 83.75V1690l-258.61-92.5v-1335L2735.24 0v2360s-15 850 965 950",
|
|
1340
|
+
style: {
|
|
1341
|
+
fill: mono ? "currentColor" : "#ed1d33",
|
|
1342
|
+
fillOpacity: 1,
|
|
1343
|
+
fillRule: "nonzero",
|
|
1344
|
+
stroke: "none"
|
|
1345
|
+
},
|
|
1346
|
+
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1347
|
+
}
|
|
1348
|
+
)
|
|
1349
|
+
]
|
|
1350
|
+
}
|
|
1351
|
+
);
|
|
1352
|
+
|
|
1353
|
+
// src/icons/HTMLIcon.tsx
|
|
1354
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1355
|
+
var HTMLIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1356
|
+
"path",
|
|
1357
|
+
{
|
|
1358
|
+
d: "M0-360v-240h60v80h80v-80h60v240h-60v-100H60v100H0Zm310 0v-180h-70v-60h200v60h-70v180h-60Zm170 0v-200q0-17 11.5-28.5T520-600h180q17 0 28.5 11.5T740-560v200h-60v-180h-40v140h-60v-140h-40v180h-60Zm320 0v-240h60v180h100v60H800Z",
|
|
1359
|
+
fill: "currentColor"
|
|
1360
|
+
}
|
|
1361
|
+
) });
|
|
1362
|
+
|
|
1363
|
+
// src/icons/IIIFBrowserIcon.tsx
|
|
1364
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1365
|
+
var IIIFBrowserIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1366
|
+
"path",
|
|
1367
|
+
{
|
|
1368
|
+
d: "M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h200v80H200v560h560v-214l80 80v134q0 33-23.5 56.5T760-120H200Zm40-160 120-160 90 120 120-160 150 200H240Zm622-144L738-548q-21 14-45 21t-51 7q-74 0-126-52.5T464-700q0-75 52.5-127.5T644-880q75 0 127.5 52.5T824-700q0 27-8 52t-20 46l122 122-56 56ZM644-600q42 0 71-29t29-71q0-42-29-71t-71-29q-42 0-71 29t-29 71q0 42 29 71t71 29Z",
|
|
1369
|
+
fill: "currentColor"
|
|
1370
|
+
}
|
|
1371
|
+
) });
|
|
1372
|
+
|
|
1373
|
+
// src/icons/YouTubeIcon.tsx
|
|
1374
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1375
|
+
var YouTubeIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1376
|
+
"path",
|
|
1377
|
+
{
|
|
1378
|
+
d: "M616-242q-27 1-51.5 1.5t-43.5.5h-41q-71 0-133-2-53-2-104.5-5.5T168-257q-26-7-45-26t-26-45q-6-23-9.5-56T82-447q-2-36-2-73t2-73q2-30 5.5-63t9.5-56q7-26 26-45t45-26q23-6 74.5-9.5T347-798q62-2 133-2t133 2q53 2 104.5 5.5T792-783q26 7 45 26t26 45q6 23 9.5 56t5.5 63q2 36 2 73v17q-19-8-39-12.5t-41-4.5q-83 0-141.5 58.5T600-320q0 21 4 40.5t12 37.5ZM400-400l208-120-208-120v240Zm360 200v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Z",
|
|
1379
|
+
fill: "currentColor"
|
|
1380
|
+
}
|
|
1381
|
+
) });
|
|
1382
|
+
|
|
1383
|
+
// src/icons/VideoIcon.tsx
|
|
1384
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1385
|
+
var VideoIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
1386
|
+
"path",
|
|
1387
|
+
{
|
|
1388
|
+
d: "M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h480q33 0 56.5 23.5T720-720v180l160-160v440L720-420v180q0 33-23.5 56.5T640-160H160Zm0-80h480v-480H160v480Zm0 0v-480 480Z",
|
|
1389
|
+
fill: "currentColor"
|
|
1390
|
+
}
|
|
1391
|
+
) });
|
|
1392
|
+
|
|
1393
|
+
// src/icons/AudioIcon.tsx
|
|
1394
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1395
|
+
var AudioIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1396
|
+
"path",
|
|
1397
|
+
{
|
|
1398
|
+
d: "M480-400q-50 0-85-35t-35-85v-240q0-50 35-85t85-35q50 0 85 35t35 85v240q0 50-35 85t-85 35Zm0-240Zm-40 520v-123q-104-14-172-93t-68-184h80q0 83 58.5 141.5T480-320q83 0 141.5-58.5T680-520h80q0 105-68 184t-172 93v123h-80Zm40-360q17 0 28.5-11.5T520-520v-240q0-17-11.5-28.5T480-800q-17 0-28.5 11.5T440-760v240q0 17 11.5 28.5T480-480Z",
|
|
1399
|
+
fill: "currentColor"
|
|
1400
|
+
}
|
|
1401
|
+
) });
|
|
1402
|
+
|
|
1403
|
+
// src/icons/EmptyCanvasIcon.tsx
|
|
1404
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1405
|
+
var EmptyCanvasIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
1406
|
+
"path",
|
|
1407
|
+
{
|
|
1408
|
+
d: "M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z",
|
|
1409
|
+
fill: "currentColor"
|
|
1410
|
+
}
|
|
1411
|
+
) });
|
|
1412
|
+
|
|
1413
|
+
// src/icons/AddIcon.tsx
|
|
1414
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1415
|
+
function AddIcon({
|
|
1416
|
+
className: className2,
|
|
1417
|
+
inline,
|
|
1418
|
+
height = 16,
|
|
1419
|
+
color = "black"
|
|
1420
|
+
}) {
|
|
1421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
1422
|
+
"svg",
|
|
1423
|
+
{
|
|
1424
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1425
|
+
height: `${height}px`,
|
|
1426
|
+
viewBox: "0 0 24 24",
|
|
1427
|
+
width: "24px",
|
|
1428
|
+
fill: color,
|
|
1429
|
+
style: { verticalAlign: inline ? "bottom" : void 0 },
|
|
1430
|
+
className: className2,
|
|
1431
|
+
children: [
|
|
1432
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1433
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", fill: "currentColor" })
|
|
1434
|
+
]
|
|
1435
|
+
}
|
|
1436
|
+
);
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
// src/hooks.ts
|
|
1440
|
+
var import_react7 = require("react");
|
|
1441
|
+
function useFastList(list, firstRender = 24) {
|
|
1442
|
+
const [isMounted, setIsMounted] = (0, import_react7.useState)(false);
|
|
1443
|
+
(0, import_react7.useLayoutEffect)(() => {
|
|
1444
|
+
if (list) {
|
|
1445
|
+
setTimeout(() => {
|
|
1446
|
+
setIsMounted(true);
|
|
1447
|
+
}, 0);
|
|
1448
|
+
}
|
|
1449
|
+
}, [list]);
|
|
1450
|
+
if (!list) {
|
|
1451
|
+
return [];
|
|
1452
|
+
}
|
|
1453
|
+
if (isMounted) {
|
|
1454
|
+
return list;
|
|
1455
|
+
}
|
|
1456
|
+
return list.slice(0, firstRender);
|
|
1457
|
+
}
|