@manifest-editor/components 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +746 -271
- package/dist/index.css +906 -5
- package/dist/index.d.cts +80 -13
- package/dist/index.d.ts +80 -13
- package/dist/index.js +799 -274
- package/package.json +18 -8
package/dist/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
// src/index.tsx
|
|
4
|
+
import "iiif-browser/dist/index.css";
|
|
5
|
+
|
|
3
6
|
// src/ActionButton.tsx
|
|
4
7
|
import { Button } from "react-aria-components";
|
|
5
8
|
|
|
@@ -52,6 +55,7 @@ import {
|
|
|
52
55
|
FloatingPortal
|
|
53
56
|
} from "@floating-ui/react";
|
|
54
57
|
import { Button as Button2 } from "react-aria-components";
|
|
58
|
+
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
55
59
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
56
60
|
function useTooltip({
|
|
57
61
|
initialOpen = false,
|
|
@@ -106,7 +110,10 @@ var useTooltipContext = () => {
|
|
|
106
110
|
}
|
|
107
111
|
return context;
|
|
108
112
|
};
|
|
109
|
-
function Tooltip({
|
|
113
|
+
function Tooltip({
|
|
114
|
+
children,
|
|
115
|
+
...options
|
|
116
|
+
}) {
|
|
110
117
|
const tooltip = useTooltip(options);
|
|
111
118
|
return /* @__PURE__ */ jsx2(TooltipContext.Provider, { value: tooltip, children });
|
|
112
119
|
}
|
|
@@ -153,7 +160,16 @@ var TooltipContent = React.forwardRef(function TooltipContent2({ style, ...props
|
|
|
153
160
|
) });
|
|
154
161
|
});
|
|
155
162
|
function DefaultTooltipContent(props) {
|
|
156
|
-
return /* @__PURE__ */ jsx2(
|
|
163
|
+
return /* @__PURE__ */ jsx2(
|
|
164
|
+
TooltipContent,
|
|
165
|
+
{
|
|
166
|
+
className: twMerge2(
|
|
167
|
+
"bg-me-gray-900 text-white text-sm px-3 py-2 rounded-lg opacity-90 z-50",
|
|
168
|
+
props.className
|
|
169
|
+
),
|
|
170
|
+
children: props.children
|
|
171
|
+
}
|
|
172
|
+
);
|
|
157
173
|
}
|
|
158
174
|
|
|
159
175
|
// src/Sidebar.tsx
|
|
@@ -166,11 +182,11 @@ function SidebarContent({
|
|
|
166
182
|
className: className2,
|
|
167
183
|
padding
|
|
168
184
|
}) {
|
|
169
|
-
return /* @__PURE__ */ jsx3("div", { className: cn("flex-1 min-h-0 overflow-y-auto", className2, padding && "
|
|
185
|
+
return /* @__PURE__ */ jsx3("div", { className: cn("flex-1 min-h-0 overflow-y-auto pb-64", className2, padding && "px-3 pt-3"), children });
|
|
170
186
|
}
|
|
171
187
|
function SidebarHeader(props) {
|
|
172
188
|
const { actions, title } = props;
|
|
173
|
-
return /* @__PURE__ */ 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: [
|
|
189
|
+
return /* @__PURE__ */ 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 flex-shrink-0", children: [
|
|
174
190
|
/* @__PURE__ */ jsx3("div", { className: "flex-1", children: title }),
|
|
175
191
|
/* @__PURE__ */ jsx3("div", { className: "ml-auto flex gap-2 items-center", children: actions?.map((action, index) => /* @__PURE__ */ jsxs(Tooltip, { placement: "bottom", children: [
|
|
176
192
|
/* @__PURE__ */ jsx3(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx3(
|
|
@@ -207,6 +223,7 @@ function PanelSideMenuItem(props) {
|
|
|
207
223
|
"border-none aspect-square w-full flex justify-center items-center hover:bg-me-primary-100 hover:text-black [&>svg]:text-2xl cursor-default",
|
|
208
224
|
props.selected ? "bg-me-primary-500 hover:bg-me-primary-600 hover:text-white text-white" : "text-me-gray-700"
|
|
209
225
|
),
|
|
226
|
+
"aria-label": props.label,
|
|
210
227
|
onMouseDown: props.onClick,
|
|
211
228
|
children: [
|
|
212
229
|
props.icon,
|
|
@@ -244,9 +261,19 @@ function ThumbnailGridContainer(props) {
|
|
|
244
261
|
}
|
|
245
262
|
|
|
246
263
|
// src/LazyThumbnail.tsx
|
|
264
|
+
import {
|
|
265
|
+
useCallback,
|
|
266
|
+
useEffect,
|
|
267
|
+
useRef,
|
|
268
|
+
useState as useState2
|
|
269
|
+
} from "react";
|
|
270
|
+
import {
|
|
271
|
+
useCanvas,
|
|
272
|
+
useRenderingStrategy,
|
|
273
|
+
useThumbnail
|
|
274
|
+
} from "react-iiif-vault";
|
|
247
275
|
import { LazyLoadComponent } from "react-lazy-load-image-component";
|
|
248
|
-
import {
|
|
249
|
-
import { useEffect, useLayoutEffect, useRef, useState as useState2 } from "react";
|
|
276
|
+
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
250
277
|
|
|
251
278
|
// src/Spinner.tsx
|
|
252
279
|
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -278,59 +305,118 @@ function Spinner(props) {
|
|
|
278
305
|
);
|
|
279
306
|
}
|
|
280
307
|
|
|
281
|
-
// src/
|
|
308
|
+
// src/icons/TextIcon.tsx
|
|
282
309
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
283
|
-
function
|
|
284
|
-
return /* @__PURE__ */
|
|
310
|
+
function TextIcon(props) {
|
|
311
|
+
return /* @__PURE__ */ jsxs5(
|
|
312
|
+
"svg",
|
|
313
|
+
{
|
|
314
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
315
|
+
width: "1em",
|
|
316
|
+
height: "1em",
|
|
317
|
+
viewBox: "0 0 24 24",
|
|
318
|
+
...props,
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ jsx8("title", { children: "Text" }),
|
|
321
|
+
/* @__PURE__ */ jsx8(
|
|
322
|
+
"path",
|
|
323
|
+
{
|
|
324
|
+
fill: "currentColor",
|
|
325
|
+
d: "M3 21v-2h18v2zm0-4v-2h12v2zm0-4v-2h18v2zm0-4V7h12v2zm0-4V3h18v2z"
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// src/LazyThumbnail.tsx
|
|
334
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
335
|
+
function LazyThumbnail({
|
|
336
|
+
cover,
|
|
337
|
+
fade = true
|
|
338
|
+
}) {
|
|
339
|
+
return /* @__PURE__ */ jsx9(LazyLoadComponent, { children: /* @__PURE__ */ jsx9(LazyThumbnailInner, { cover, fade }) });
|
|
285
340
|
}
|
|
286
|
-
|
|
341
|
+
var renderCache = /* @__PURE__ */ new Map();
|
|
342
|
+
function LazyThumbnailInner({
|
|
343
|
+
cover,
|
|
344
|
+
fade = true
|
|
345
|
+
}) {
|
|
287
346
|
const img = useRef(null);
|
|
288
|
-
const
|
|
347
|
+
const canvas = useCanvas();
|
|
348
|
+
const isCached = canvas ? !!renderCache.get(canvas?.id) : false;
|
|
349
|
+
const [isLoading, setIsLoading] = useState2(!isCached);
|
|
289
350
|
const thumbnail = useThumbnail({ height: 256, width: 256 }, true);
|
|
351
|
+
let thumbnailId = thumbnail?.id;
|
|
352
|
+
if (canvas?.id && thumbnailId) {
|
|
353
|
+
renderCache.set(canvas.id, thumbnailId);
|
|
354
|
+
} else if (canvas?.id && renderCache.get(canvas.id)) {
|
|
355
|
+
thumbnailId = renderCache.get(canvas?.id);
|
|
356
|
+
}
|
|
290
357
|
useEffect(() => {
|
|
291
|
-
if (
|
|
358
|
+
if (thumbnailId && !isCached) {
|
|
292
359
|
setIsLoading(true);
|
|
293
360
|
}
|
|
294
|
-
}, [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
if (
|
|
298
|
-
|
|
361
|
+
}, [thumbnailId, isCached]);
|
|
362
|
+
const checkImage = useCallback(
|
|
363
|
+
(node) => {
|
|
364
|
+
if (node && !isCached) {
|
|
365
|
+
if (node.complete || node.naturalWidth > 0) {
|
|
366
|
+
setIsLoading(false);
|
|
367
|
+
}
|
|
299
368
|
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
369
|
+
},
|
|
370
|
+
[isCached]
|
|
371
|
+
);
|
|
372
|
+
return /* @__PURE__ */ jsxs6("div", { className: `w-full h-full relative`, children: [
|
|
373
|
+
thumbnail?.id ? /* @__PURE__ */ jsx9(
|
|
304
374
|
"img",
|
|
305
375
|
{
|
|
306
376
|
onLoad: () => setIsLoading(false),
|
|
307
|
-
ref:
|
|
377
|
+
ref: checkImage,
|
|
308
378
|
src: thumbnail?.id,
|
|
309
379
|
alt: "",
|
|
310
|
-
className: `w-full h-full object-contain ${!isLoading ? "animate-fadeIn" : "opacity-0"}`
|
|
380
|
+
className: `w-full h-full ${cover ? "object-cover" : "object-contain"} ${!isLoading ? isCached ? "" : "animate-fadeIn" : "opacity-0"}`
|
|
381
|
+
}
|
|
382
|
+
) : /* @__PURE__ */ jsx9(ThumbnailFallback, {}),
|
|
383
|
+
!thumbnail?.id || isLoading ? /* @__PURE__ */ jsx9(
|
|
384
|
+
"div",
|
|
385
|
+
{
|
|
386
|
+
className: twMerge3(
|
|
387
|
+
"absolute inset-0 flex items-center justify-center bg-me-gray-100 text-2xl z-10",
|
|
388
|
+
fade && "animate-fadeIn"
|
|
389
|
+
),
|
|
390
|
+
children: /* @__PURE__ */ jsx9(Spinner, {})
|
|
311
391
|
}
|
|
312
|
-
) :
|
|
313
|
-
!thumbnail?.id || isLoading ? /* @__PURE__ */ jsx8("div", { className: "absolute inset-0 flex items-center justify-center bg-me-gray-100 text-2xl animate-fadeIn z-10", children: /* @__PURE__ */ jsx8(Spinner, {}) }) : null
|
|
392
|
+
) : null
|
|
314
393
|
] });
|
|
315
394
|
}
|
|
395
|
+
function ThumbnailFallback() {
|
|
396
|
+
const [strategy] = useRenderingStrategy();
|
|
397
|
+
if (strategy.type === "textual-content") {
|
|
398
|
+
return /* @__PURE__ */ jsx9("div", { className: "text-black/30 flex items-center justify-center h-full bg-me-gray-100 animate-fadeInDelayed absolute inset-0 z-20", children: /* @__PURE__ */ jsx9(TextIcon, { className: "w-16 h-16" }) });
|
|
399
|
+
}
|
|
400
|
+
return /* @__PURE__ */ jsx9("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" });
|
|
401
|
+
}
|
|
316
402
|
|
|
317
403
|
// src/CanvasThumbnailGridItem.tsx
|
|
318
404
|
import { CanvasContext } from "react-iiif-vault";
|
|
319
405
|
|
|
320
406
|
// src/CanvasLabel.tsx
|
|
321
407
|
import { LocaleString, useCanvas as useCanvas2 } from "react-iiif-vault";
|
|
322
|
-
import { jsx as
|
|
408
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
323
409
|
function CanvasLabel(props) {
|
|
324
410
|
const canvas = useCanvas2();
|
|
325
411
|
if (!canvas)
|
|
326
412
|
return null;
|
|
327
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ jsx10(LocaleString, { className: props.className, as: props.as, children: canvas.label });
|
|
328
414
|
}
|
|
329
415
|
|
|
330
416
|
// src/Card3D.tsx
|
|
331
417
|
import { useLayoutEffect as useLayoutEffect2, useRef as useRef2 } from "react";
|
|
332
|
-
import { twMerge as
|
|
333
|
-
import { jsx as
|
|
418
|
+
import { twMerge as twMerge4 } from "tailwind-merge";
|
|
419
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
334
420
|
function Card3D({
|
|
335
421
|
className: className2,
|
|
336
422
|
shouldTranslate,
|
|
@@ -401,11 +487,11 @@ function Card3D({
|
|
|
401
487
|
outer.current.removeEventListener("mousemove", mousemove);
|
|
402
488
|
};
|
|
403
489
|
}, []);
|
|
404
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsxs7(
|
|
405
491
|
"div",
|
|
406
492
|
{
|
|
407
493
|
ref: outer,
|
|
408
|
-
className:
|
|
494
|
+
className: twMerge4(
|
|
409
495
|
//
|
|
410
496
|
"relative transition-all hover:duration-50",
|
|
411
497
|
shouldTranslate && "hover:shadow-xl",
|
|
@@ -414,7 +500,7 @@ function Card3D({
|
|
|
414
500
|
...props,
|
|
415
501
|
children: [
|
|
416
502
|
children,
|
|
417
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ jsx11(
|
|
418
504
|
"div",
|
|
419
505
|
{
|
|
420
506
|
className: "pointer-events-none absolute inset-0 transition-all",
|
|
@@ -430,70 +516,99 @@ function Card3D({
|
|
|
430
516
|
}
|
|
431
517
|
|
|
432
518
|
// src/CanvasThumbnailGridItem.tsx
|
|
433
|
-
import { jsx as
|
|
519
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
434
520
|
function CanvasThumbnailGridItem(props) {
|
|
435
|
-
return /* @__PURE__ */
|
|
436
|
-
/* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ jsx12(CanvasContext, { canvas: props.id, children: /* @__PURE__ */ jsxs8("div", { onMouseDown: props.onClick, className: "flex flex-col", "data-canvas-selected": props.selected, children: [
|
|
522
|
+
/* @__PURE__ */ jsx12("div", { className: "bg-me-gray-100 w-full aspect-square flex-1 overflow-hidden rounded", children: /* @__PURE__ */ jsx12(
|
|
437
523
|
Card3D,
|
|
438
524
|
{
|
|
525
|
+
"data-canvas-selected": props.active,
|
|
526
|
+
"aria-selected": props.active,
|
|
439
527
|
className: cn(
|
|
440
528
|
"border-2 border-transparent p-1 w-full h-full rounded",
|
|
441
529
|
props.selected && "border-me-primary-500"
|
|
442
530
|
),
|
|
443
|
-
children: /* @__PURE__ */
|
|
531
|
+
children: /* @__PURE__ */ jsx12(LazyThumbnail, {})
|
|
444
532
|
}
|
|
445
533
|
) }),
|
|
446
|
-
/* @__PURE__ */
|
|
534
|
+
/* @__PURE__ */ jsx12(CanvasLabel, { className: "text-sm text-center truncate mt-1", as: "div" })
|
|
447
535
|
] }) });
|
|
448
536
|
}
|
|
449
537
|
|
|
450
538
|
// src/Modal.tsx
|
|
451
|
-
import {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
539
|
+
import {
|
|
540
|
+
CloseButton,
|
|
541
|
+
Dialog,
|
|
542
|
+
DialogPanel,
|
|
543
|
+
DialogTitle
|
|
544
|
+
} from "@headlessui/react";
|
|
545
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
546
|
+
function Modal({
|
|
547
|
+
id,
|
|
548
|
+
title,
|
|
549
|
+
open = true,
|
|
550
|
+
onClose,
|
|
551
|
+
actions,
|
|
552
|
+
children
|
|
553
|
+
}) {
|
|
554
|
+
return /* @__PURE__ */ jsx13(Fragment2, { children: /* @__PURE__ */ jsxs9(
|
|
555
|
+
Dialog,
|
|
556
|
+
{
|
|
557
|
+
open,
|
|
558
|
+
onClose,
|
|
559
|
+
id,
|
|
560
|
+
className: "relative z-[500]",
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ jsx13(
|
|
563
|
+
"div",
|
|
564
|
+
{
|
|
565
|
+
className: `fixed inset-0 bg-black/30 animate-fadeIn z-[501]`,
|
|
566
|
+
"aria-hidden": "true"
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
/* @__PURE__ */ jsx13("div", { className: "fixed inset-0 flex w-screen items-center justify-center p-4 z-[502]", children: /* @__PURE__ */ jsx13("div", { className: "relative p-4 w-full max-w-4xl max-h-full", children: /* @__PURE__ */ jsxs9(DialogPanel, { className: "relative bg-white rounded-lg overflow-hidden shadow-2xl max-h-[80vh] flex flex-col", children: [
|
|
570
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between p-4 md:p-5 rounded-t-lg sticky top-0 bg-white", children: [
|
|
571
|
+
/* @__PURE__ */ jsx13(DialogTitle, { className: "text-xl font-semibold text-gray-900 ", children: title }),
|
|
572
|
+
/* @__PURE__ */ jsxs9(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", children: [
|
|
573
|
+
/* @__PURE__ */ jsx13(
|
|
574
|
+
"svg",
|
|
470
575
|
{
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
576
|
+
className: "w-3 h-3",
|
|
577
|
+
"aria-hidden": "true",
|
|
578
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
579
|
+
fill: "none",
|
|
580
|
+
viewBox: "0 0 14 14",
|
|
581
|
+
children: /* @__PURE__ */ jsx13(
|
|
582
|
+
"path",
|
|
583
|
+
{
|
|
584
|
+
stroke: "currentColor",
|
|
585
|
+
strokeLinecap: "round",
|
|
586
|
+
strokeLinejoin: "round",
|
|
587
|
+
strokeWidth: "2",
|
|
588
|
+
d: "m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
|
|
589
|
+
}
|
|
590
|
+
)
|
|
476
591
|
}
|
|
477
|
-
)
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
592
|
+
),
|
|
593
|
+
/* @__PURE__ */ jsx13("span", { className: "sr-only", children: "Close" })
|
|
594
|
+
] })
|
|
595
|
+
] }),
|
|
596
|
+
/* @__PURE__ */ jsx13("div", { className: "flex-1 min-h-0 overflow-y-auto flex flex-col", children }),
|
|
597
|
+
actions ? /* @__PURE__ */ jsx13("div", { className: "flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b justify-end", children: actions }) : null
|
|
598
|
+
] }) }) })
|
|
599
|
+
]
|
|
600
|
+
}
|
|
601
|
+
) });
|
|
487
602
|
}
|
|
488
603
|
|
|
489
604
|
// src/ControlButton.tsx
|
|
490
|
-
import { jsx as
|
|
605
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
491
606
|
function ControlButton({
|
|
492
607
|
children,
|
|
493
608
|
className: className2,
|
|
494
609
|
...props
|
|
495
610
|
}) {
|
|
496
|
-
return /* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */ jsx14(
|
|
497
612
|
"button",
|
|
498
613
|
{
|
|
499
614
|
className: cn(
|
|
@@ -507,9 +622,9 @@ function ControlButton({
|
|
|
507
622
|
}
|
|
508
623
|
|
|
509
624
|
// src/OpaqueControls.tsx
|
|
510
|
-
import { jsx as
|
|
625
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
511
626
|
function OpaqueControls(props) {
|
|
512
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ jsx15(
|
|
513
628
|
"div",
|
|
514
629
|
{
|
|
515
630
|
className: cn("flex w-full p-0.5 opacity-0 transition-opacity duration-300 gap-2", props.active && "opacity-1"),
|
|
@@ -525,9 +640,9 @@ import {
|
|
|
525
640
|
Tab as BaseTab,
|
|
526
641
|
TabPanel as BaseTabPanel
|
|
527
642
|
} from "react-aria-components";
|
|
528
|
-
import { jsx as
|
|
643
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
529
644
|
function Tabs({ className: className2, children, ...props }) {
|
|
530
|
-
return /* @__PURE__ */
|
|
645
|
+
return /* @__PURE__ */ jsx16(
|
|
531
646
|
BaseTabs,
|
|
532
647
|
{
|
|
533
648
|
className: (state) => {
|
|
@@ -544,7 +659,7 @@ function TabList({
|
|
|
544
659
|
children,
|
|
545
660
|
...props
|
|
546
661
|
}) {
|
|
547
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ jsx16(
|
|
548
663
|
BaseTabList,
|
|
549
664
|
{
|
|
550
665
|
className: (state) => {
|
|
@@ -557,7 +672,7 @@ function TabList({
|
|
|
557
672
|
);
|
|
558
673
|
}
|
|
559
674
|
function Tab({ className: className2, children, ...props }) {
|
|
560
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx16(
|
|
561
676
|
BaseTab,
|
|
562
677
|
{
|
|
563
678
|
className: (state) => {
|
|
@@ -575,7 +690,7 @@ function Tab({ className: className2, children, ...props }) {
|
|
|
575
690
|
);
|
|
576
691
|
}
|
|
577
692
|
function TabPanel({ className: className2, children, ...props }) {
|
|
578
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ jsx16(
|
|
579
694
|
BaseTabPanel,
|
|
580
695
|
{
|
|
581
696
|
className: (state) => {
|
|
@@ -590,43 +705,43 @@ function TabPanel({ className: className2, children, ...props }) {
|
|
|
590
705
|
|
|
591
706
|
// src/CreatorGrid.tsx
|
|
592
707
|
import { ListBox, ListBoxItem } from "react-aria-components";
|
|
593
|
-
import { twMerge as
|
|
594
|
-
import { jsx as
|
|
708
|
+
import { twMerge as twMerge5 } from "tailwind-merge";
|
|
709
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
595
710
|
function CreatorGrid(props) {
|
|
596
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsx17(
|
|
597
712
|
ListBox,
|
|
598
713
|
{
|
|
599
714
|
orientation: "horizontal",
|
|
600
715
|
"aria-label": props.label,
|
|
601
716
|
selectionMode: "single",
|
|
602
717
|
items: props.items,
|
|
603
|
-
className: "grid grid-sm gap-4 p-4",
|
|
604
|
-
children: (item) => /* @__PURE__ */
|
|
718
|
+
className: "grid grid-sm gap-4 p-4 mb-8",
|
|
719
|
+
children: (item) => /* @__PURE__ */ jsx17(CreatorGridItem, { ...item })
|
|
605
720
|
}
|
|
606
721
|
);
|
|
607
722
|
}
|
|
608
723
|
function CreatorGridItem(props) {
|
|
609
|
-
return /* @__PURE__ */
|
|
724
|
+
return /* @__PURE__ */ jsxs10(
|
|
610
725
|
ListBoxItem,
|
|
611
726
|
{
|
|
612
727
|
id: props.id,
|
|
613
728
|
onAction: props.onClick,
|
|
614
|
-
className: ($s) =>
|
|
729
|
+
className: ($s) => twMerge5(
|
|
615
730
|
"bg-white p-2 border-me-gray-300 rounded-md border hover:border-me-primary-500",
|
|
616
731
|
$s.isFocused && "border-me-primary-500 outline-me-primary-500 outline-2"
|
|
617
732
|
),
|
|
618
733
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ jsx17("div", { className: "rounded bg-me-gray-300 mb-2 flex items-center justify-center py-1 aspect-square", children: /* @__PURE__ */ jsx17("div", { className: "text-center [&>svg]:w-16 [&>svg]:h-16", children: props.icon }) }),
|
|
735
|
+
/* @__PURE__ */ jsx17("div", { className: "text-center font-semibold text-sm", children: props.title }),
|
|
736
|
+
/* @__PURE__ */ jsx17("div", { className: "text-sm text-center text-black/50", children: props.description })
|
|
622
737
|
]
|
|
623
738
|
}
|
|
624
739
|
);
|
|
625
740
|
}
|
|
626
741
|
|
|
627
742
|
// src/icons/DownloadIcon.tsx
|
|
628
|
-
import { jsx as
|
|
629
|
-
var DownloadIcon = (props) => /* @__PURE__ */
|
|
743
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
744
|
+
var DownloadIcon = (props) => /* @__PURE__ */ jsx18("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx18(
|
|
630
745
|
"path",
|
|
631
746
|
{
|
|
632
747
|
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",
|
|
@@ -636,10 +751,10 @@ var DownloadIcon = (props) => /* @__PURE__ */ jsx17("svg", { xmlns: "http://www.
|
|
|
636
751
|
|
|
637
752
|
// src/DownloadButton.tsx
|
|
638
753
|
import { useId } from "react-aria";
|
|
639
|
-
import { jsx as
|
|
754
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
640
755
|
function DownloadButton({ label, id: _id, getData, fileName, fileType }) {
|
|
641
756
|
const id = useId(_id);
|
|
642
|
-
return /* @__PURE__ */
|
|
757
|
+
return /* @__PURE__ */ jsx19(Tooltip, { placement: "bottom", children: /* @__PURE__ */ jsxs11(
|
|
643
758
|
TooltipTrigger,
|
|
644
759
|
{
|
|
645
760
|
className: "bg-me-gray-100 hover:bg-me-primary-500 hover:text-white p-1 rounded-md text-me-primary-500 text-2xl",
|
|
@@ -647,8 +762,8 @@ function DownloadButton({ label, id: _id, getData, fileName, fileType }) {
|
|
|
647
762
|
id,
|
|
648
763
|
onPress: () => createDownload(getData(), fileName, fileType),
|
|
649
764
|
children: [
|
|
650
|
-
/* @__PURE__ */
|
|
651
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ jsx19(DownloadIcon, { "aria-labelledby": _id }),
|
|
766
|
+
/* @__PURE__ */ jsx19(DefaultTooltipContent, { children: label })
|
|
652
767
|
]
|
|
653
768
|
}
|
|
654
769
|
) });
|
|
@@ -668,11 +783,11 @@ function createDownload(data, fileName, fileType = "text/json") {
|
|
|
668
783
|
}
|
|
669
784
|
|
|
670
785
|
// src/AtlasBanner.tsx
|
|
671
|
-
import { jsx as
|
|
786
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
672
787
|
function AtlasBanner({ children, controlsId }) {
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ jsxs12("div", { className: "bg-me-gray-100 border-b text-black p-1 flex gap-4 items-center h-12", children: [
|
|
789
|
+
/* @__PURE__ */ jsx20("div", { className: "px-4", children }),
|
|
790
|
+
/* @__PURE__ */ jsx20("div", { id: controlsId || "atlas-controls", className: "flex gap-2" })
|
|
676
791
|
] });
|
|
677
792
|
}
|
|
678
793
|
|
|
@@ -680,8 +795,8 @@ function AtlasBanner({ children, controlsId }) {
|
|
|
680
795
|
import { RenderSvgEditorControls } from "react-iiif-vault";
|
|
681
796
|
|
|
682
797
|
// src/icons/DrawIcon.tsx
|
|
683
|
-
import { jsx as
|
|
684
|
-
var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */
|
|
798
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
799
|
+
var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs13(
|
|
685
800
|
"svg",
|
|
686
801
|
{
|
|
687
802
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -691,8 +806,8 @@ var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs12(
|
|
|
691
806
|
"aria-labelledby": titleId,
|
|
692
807
|
...props,
|
|
693
808
|
children: [
|
|
694
|
-
title ? /* @__PURE__ */
|
|
695
|
-
/* @__PURE__ */
|
|
809
|
+
title ? /* @__PURE__ */ jsx21("title", { id: titleId, children: title }) : null,
|
|
810
|
+
/* @__PURE__ */ jsx21(
|
|
696
811
|
"path",
|
|
697
812
|
{
|
|
698
813
|
fill: "currentColor",
|
|
@@ -704,8 +819,8 @@ var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs12(
|
|
|
704
819
|
);
|
|
705
820
|
|
|
706
821
|
// src/icons/PolygonIcon.tsx
|
|
707
|
-
import { jsx as
|
|
708
|
-
var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */
|
|
822
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
823
|
+
var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs14(
|
|
709
824
|
"svg",
|
|
710
825
|
{
|
|
711
826
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -715,8 +830,8 @@ var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs13(
|
|
|
715
830
|
"aria-labelledby": titleId,
|
|
716
831
|
...props,
|
|
717
832
|
children: [
|
|
718
|
-
title ? /* @__PURE__ */
|
|
719
|
-
/* @__PURE__ */
|
|
833
|
+
title ? /* @__PURE__ */ jsx22("title", { id: titleId, children: title }) : null,
|
|
834
|
+
/* @__PURE__ */ jsx22(
|
|
720
835
|
"path",
|
|
721
836
|
{
|
|
722
837
|
fill: "currentColor",
|
|
@@ -728,34 +843,34 @@ var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs13(
|
|
|
728
843
|
);
|
|
729
844
|
|
|
730
845
|
// src/icons/LineIcon.tsx
|
|
731
|
-
import { jsx as
|
|
846
|
+
import { jsx as jsx23, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
732
847
|
function LineIcon({ title, titleId, ...props }) {
|
|
733
|
-
return /* @__PURE__ */
|
|
734
|
-
title ? /* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ jsxs15("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
|
|
849
|
+
title ? /* @__PURE__ */ jsx23("title", { id: titleId, children: title }) : null,
|
|
850
|
+
/* @__PURE__ */ jsxs15("g", { fill: "none", fillRule: "evenodd", children: [
|
|
851
|
+
/* @__PURE__ */ jsx23("circle", { cx: 4.5, cy: 4.5, r: 2.5, fill: "currentColor" }),
|
|
852
|
+
/* @__PURE__ */ jsx23("circle", { cx: 15.5, cy: 15.5, r: 2.5, fill: "currentColor" }),
|
|
853
|
+
/* @__PURE__ */ jsx23("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m13.5 13.5-9-9" })
|
|
739
854
|
] })
|
|
740
855
|
] });
|
|
741
856
|
}
|
|
742
857
|
|
|
743
858
|
// src/icons/LineBoxIcon.tsx
|
|
744
|
-
import { jsx as
|
|
859
|
+
import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
745
860
|
function LineBoxIcon({ title, titleId, ...props }) {
|
|
746
|
-
return /* @__PURE__ */
|
|
747
|
-
title ? /* @__PURE__ */
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ jsxs16("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
|
|
862
|
+
title ? /* @__PURE__ */ jsx24("title", { id: titleId, children: title }) : null,
|
|
863
|
+
/* @__PURE__ */ jsxs16("g", { fill: "none", fillRule: "evenodd", children: [
|
|
864
|
+
/* @__PURE__ */ jsx24("path", { d: "M0 0h20v20H0z" }),
|
|
865
|
+
/* @__PURE__ */ jsx24("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m8.5 11.5 6-6M16 4v3m0-3h-3m0 14L2 7" }),
|
|
866
|
+
/* @__PURE__ */ jsx24("path", { stroke: "currentColor", strokeOpacity: 0.407, strokeWidth: 2, d: "m2 7 5-5 11 11-5 5z" })
|
|
752
867
|
] })
|
|
753
868
|
] });
|
|
754
869
|
}
|
|
755
870
|
|
|
756
871
|
// src/icons/ShapesIcon.tsx
|
|
757
|
-
import { jsx as
|
|
758
|
-
var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */
|
|
872
|
+
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
873
|
+
var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs17(
|
|
759
874
|
"svg",
|
|
760
875
|
{
|
|
761
876
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -765,8 +880,8 @@ var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs16(
|
|
|
765
880
|
"aria-labelledby": titleId,
|
|
766
881
|
...props,
|
|
767
882
|
children: [
|
|
768
|
-
title ? /* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
883
|
+
title ? /* @__PURE__ */ jsx25("title", { id: titleId, children: title }) : null,
|
|
884
|
+
/* @__PURE__ */ jsx25(
|
|
770
885
|
"path",
|
|
771
886
|
{
|
|
772
887
|
fill: "currentColor",
|
|
@@ -778,8 +893,8 @@ var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs16(
|
|
|
778
893
|
);
|
|
779
894
|
|
|
780
895
|
// src/icons/SquareIcon.tsx
|
|
781
|
-
import { jsx as
|
|
782
|
-
var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */
|
|
896
|
+
import { jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
897
|
+
var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs18(
|
|
783
898
|
"svg",
|
|
784
899
|
{
|
|
785
900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -789,8 +904,8 @@ var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs17(
|
|
|
789
904
|
"aria-labelledby": titleId,
|
|
790
905
|
...props,
|
|
791
906
|
children: [
|
|
792
|
-
title ? /* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
907
|
+
title ? /* @__PURE__ */ jsx26("title", { id: titleId, children: title }) : null,
|
|
908
|
+
/* @__PURE__ */ jsx26(
|
|
794
909
|
"path",
|
|
795
910
|
{
|
|
796
911
|
fill: "currentColor",
|
|
@@ -802,8 +917,8 @@ var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs17(
|
|
|
802
917
|
);
|
|
803
918
|
|
|
804
919
|
// src/icons/TriangleIcon.tsx
|
|
805
|
-
import { jsx as
|
|
806
|
-
var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */
|
|
920
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
921
|
+
var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs19(
|
|
807
922
|
"svg",
|
|
808
923
|
{
|
|
809
924
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -813,15 +928,15 @@ var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs18(
|
|
|
813
928
|
"aria-labelledby": titleId,
|
|
814
929
|
...props,
|
|
815
930
|
children: [
|
|
816
|
-
title ? /* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */
|
|
931
|
+
title ? /* @__PURE__ */ jsx27("title", { id: titleId, children: title }) : null,
|
|
932
|
+
/* @__PURE__ */ jsx27("path", { d: "m80-160 400-640 400 640H80Zm144-80h512L480-650 224-240Zm256-205Z", fill: "currentColor" })
|
|
818
933
|
]
|
|
819
934
|
}
|
|
820
935
|
);
|
|
821
936
|
|
|
822
937
|
// src/icons/HexagonIcon.tsx
|
|
823
|
-
import { jsx as
|
|
824
|
-
var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */
|
|
938
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
939
|
+
var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs20(
|
|
825
940
|
"svg",
|
|
826
941
|
{
|
|
827
942
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -831,8 +946,8 @@ var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs19(
|
|
|
831
946
|
"aria-labelledby": titleId,
|
|
832
947
|
...props,
|
|
833
948
|
children: [
|
|
834
|
-
title ? /* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
949
|
+
title ? /* @__PURE__ */ jsx28("title", { id: titleId, children: title }) : null,
|
|
950
|
+
/* @__PURE__ */ jsx28(
|
|
836
951
|
"path",
|
|
837
952
|
{
|
|
838
953
|
fill: "currentColor",
|
|
@@ -844,12 +959,12 @@ var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ jsxs19(
|
|
|
844
959
|
);
|
|
845
960
|
|
|
846
961
|
// src/icons/DeleteForeverIcon.tsx
|
|
847
|
-
import { jsx as
|
|
962
|
+
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
848
963
|
function DeleteForeverIcon(props) {
|
|
849
|
-
return /* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
/* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsxs21("svg", { height: "1em", width: "1em", viewBox: "0 0 24 24", ...props, children: [
|
|
965
|
+
/* @__PURE__ */ jsx29("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
966
|
+
/* @__PURE__ */ jsx29("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
967
|
+
/* @__PURE__ */ jsx29(
|
|
853
968
|
"path",
|
|
854
969
|
{
|
|
855
970
|
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",
|
|
@@ -861,18 +976,18 @@ function DeleteForeverIcon(props) {
|
|
|
861
976
|
|
|
862
977
|
// src/SvgControlBar.tsx
|
|
863
978
|
import { useEffect as useEffect2 } from "react";
|
|
864
|
-
import { jsx as
|
|
979
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
865
980
|
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';
|
|
866
981
|
var icons = {
|
|
867
|
-
DrawIcon: /* @__PURE__ */
|
|
868
|
-
PolygonIcon: /* @__PURE__ */
|
|
869
|
-
LineIcon: /* @__PURE__ */
|
|
870
|
-
LineBoxIcon: /* @__PURE__ */
|
|
871
|
-
ShapesIcon: /* @__PURE__ */
|
|
872
|
-
SquareIcon: /* @__PURE__ */
|
|
873
|
-
TriangleIcon: /* @__PURE__ */
|
|
874
|
-
HexagonIcon: /* @__PURE__ */
|
|
875
|
-
DeleteForeverIcon: /* @__PURE__ */
|
|
982
|
+
DrawIcon: /* @__PURE__ */ jsx30(DrawIcon, {}),
|
|
983
|
+
PolygonIcon: /* @__PURE__ */ jsx30(PolygonIcon, {}),
|
|
984
|
+
LineIcon: /* @__PURE__ */ jsx30(LineIcon, {}),
|
|
985
|
+
LineBoxIcon: /* @__PURE__ */ jsx30(LineBoxIcon, {}),
|
|
986
|
+
ShapesIcon: /* @__PURE__ */ jsx30(ShapesIcon, {}),
|
|
987
|
+
SquareIcon: /* @__PURE__ */ jsx30(SquareIcon, {}),
|
|
988
|
+
TriangleIcon: /* @__PURE__ */ jsx30(TriangleIcon, {}),
|
|
989
|
+
HexagonIcon: /* @__PURE__ */ jsx30(HexagonIcon, {}),
|
|
990
|
+
DeleteForeverIcon: /* @__PURE__ */ jsx30(DeleteForeverIcon, {})
|
|
876
991
|
};
|
|
877
992
|
function SvgControlBar({
|
|
878
993
|
helper,
|
|
@@ -882,7 +997,7 @@ function SvgControlBar({
|
|
|
882
997
|
useEffect2(() => {
|
|
883
998
|
helper.stamps.square();
|
|
884
999
|
}, []);
|
|
885
|
-
return /* @__PURE__ */
|
|
1000
|
+
return /* @__PURE__ */ jsx30(
|
|
886
1001
|
RenderSvgEditorControls,
|
|
887
1002
|
{
|
|
888
1003
|
icons,
|
|
@@ -898,17 +1013,17 @@ function SvgControlBar({
|
|
|
898
1013
|
|
|
899
1014
|
// src/ConfirmSelectionButton.tsx
|
|
900
1015
|
import { Button as Button3 } from "react-aria-components";
|
|
901
|
-
import { jsx as
|
|
1016
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
902
1017
|
function ConfirmSelectionButton({ onPress, children }) {
|
|
903
|
-
return /* @__PURE__ */
|
|
1018
|
+
return /* @__PURE__ */ jsx31(Button3, { className: "bg-me-primary-500 px-3 py-1 hover:bg-me-primary-600 text-white rounded", onPress, children });
|
|
904
1019
|
}
|
|
905
1020
|
|
|
906
1021
|
// src/ManifestOverviewEmptyState.tsx
|
|
907
1022
|
import { Button as Button4 } from "react-aria-components";
|
|
908
|
-
import { jsx as
|
|
1023
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
909
1024
|
function ManifestOverviewEmptyState({ onCreate, canCreate }) {
|
|
910
|
-
return /* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex items-center flex-col gap-5 py-16", children: [
|
|
1026
|
+
/* @__PURE__ */ jsx32(
|
|
912
1027
|
Card3D,
|
|
913
1028
|
{
|
|
914
1029
|
shouldTranslate: true,
|
|
@@ -916,9 +1031,9 @@ function ManifestOverviewEmptyState({ onCreate, canCreate }) {
|
|
|
916
1031
|
className: "border-2 border-dotted bg-black/5 aspect-[3/4] rounded w-32 border-black"
|
|
917
1032
|
}
|
|
918
1033
|
),
|
|
919
|
-
/* @__PURE__ */
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
canCreate ? /* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ jsx32("div", { className: "font-bold text-lg", children: "Let's get started!" }),
|
|
1035
|
+
/* @__PURE__ */ jsx32("div", { className: "max-w-xl px-5 my-4", children: "Add a title and top level information for this manifest using the editing panel on the right, and then add some canvases and content." }),
|
|
1036
|
+
canCreate ? /* @__PURE__ */ jsx32(
|
|
922
1037
|
Button4,
|
|
923
1038
|
{
|
|
924
1039
|
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",
|
|
@@ -930,16 +1045,41 @@ function ManifestOverviewEmptyState({ onCreate, canCreate }) {
|
|
|
930
1045
|
}
|
|
931
1046
|
|
|
932
1047
|
// src/SidebarTabs.tsx
|
|
933
|
-
import {
|
|
934
|
-
|
|
1048
|
+
import {
|
|
1049
|
+
useLayoutEffect as useLayoutEffect3,
|
|
1050
|
+
useMemo as useMemo2,
|
|
1051
|
+
useRef as useRef3,
|
|
1052
|
+
useState as useState3
|
|
1053
|
+
} from "react";
|
|
1054
|
+
import {
|
|
1055
|
+
Button as Button5,
|
|
1056
|
+
Menu,
|
|
1057
|
+
MenuItem,
|
|
1058
|
+
MenuTrigger,
|
|
1059
|
+
Popover,
|
|
1060
|
+
Tab as Tab2,
|
|
1061
|
+
TabList as TabList2,
|
|
1062
|
+
TabPanel as TabPanel2,
|
|
1063
|
+
Tabs as Tabs2
|
|
1064
|
+
} from "react-aria-components";
|
|
935
1065
|
import { createHideableComponent } from "@react-aria/collections";
|
|
936
|
-
import {
|
|
937
|
-
|
|
1066
|
+
import { createPortal } from "react-dom";
|
|
1067
|
+
import { Fragment as Fragment3, jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1068
|
+
function SidebarTabs({
|
|
1069
|
+
menu,
|
|
1070
|
+
menuId,
|
|
1071
|
+
selectedKey,
|
|
1072
|
+
onSelectionChange
|
|
1073
|
+
}) {
|
|
938
1074
|
const ref = useRef3(null);
|
|
939
1075
|
const [hidden, setHidden] = useState3(0);
|
|
1076
|
+
const [hiddenMenu, setHiddenMenu] = useState3(null);
|
|
940
1077
|
const widths = useRef3([]);
|
|
941
1078
|
const itemsRef = useRef3([]);
|
|
942
|
-
const selectedIndex = useMemo2(
|
|
1079
|
+
const selectedIndex = useMemo2(
|
|
1080
|
+
() => menu.findIndex((item) => item.id === selectedKey),
|
|
1081
|
+
[menu, selectedKey]
|
|
1082
|
+
);
|
|
943
1083
|
useLayoutEffect3(() => {
|
|
944
1084
|
const cb = () => {
|
|
945
1085
|
if (widths.current.length === 0) {
|
|
@@ -973,53 +1113,74 @@ function SidebarTabs({ menu, menuId, selectedKey, onSelectionChange }) {
|
|
|
973
1113
|
};
|
|
974
1114
|
}, []);
|
|
975
1115
|
const menuHidden = menu.filter((item, idx) => hidden >= menu.length - idx);
|
|
976
|
-
return /* @__PURE__ */
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
Tab2,
|
|
1116
|
+
return /* @__PURE__ */ jsxs23(Fragment3, { children: [
|
|
1117
|
+
/* @__PURE__ */ jsxs23(
|
|
1118
|
+
Tabs2,
|
|
1119
|
+
{
|
|
1120
|
+
className: "w-full flex-1 overflow-hidden flex flex-col",
|
|
1121
|
+
selectedKey,
|
|
1122
|
+
onSelectionChange,
|
|
1123
|
+
children: [
|
|
1124
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center w-full tab-shadow", children: [
|
|
1125
|
+
/* @__PURE__ */ jsx33(
|
|
1126
|
+
TabList2,
|
|
988
1127
|
{
|
|
989
|
-
ref
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1128
|
+
ref,
|
|
1129
|
+
className: "flex-1 overflow-hidden w-full flex text-sm whitespace-nowrap",
|
|
1130
|
+
children: menu.map((item, idx) => {
|
|
1131
|
+
const isHidden = hidden >= menu.length - idx;
|
|
1132
|
+
return /* @__PURE__ */ jsx33(
|
|
1133
|
+
Tab2,
|
|
1134
|
+
{
|
|
1135
|
+
ref: (el) => itemsRef.current[idx] = el,
|
|
1136
|
+
id: item.id,
|
|
1137
|
+
className: (state) => cn(
|
|
1138
|
+
//
|
|
1139
|
+
"border-b-2 px-2 py-1 text-sm text-gray-400 select-none hover:text-black focus:ring-0 focus:outline-none",
|
|
1140
|
+
state.isSelected && "border-me-primary-500 text-black",
|
|
1141
|
+
state.isFocusVisible && "ring-0 bg-me-gray-100",
|
|
1142
|
+
isHidden && "hidden"
|
|
1143
|
+
),
|
|
1144
|
+
children: item.label
|
|
1145
|
+
},
|
|
1146
|
+
item.id
|
|
1147
|
+
);
|
|
1148
|
+
})
|
|
1149
|
+
}
|
|
1150
|
+
),
|
|
1151
|
+
/* @__PURE__ */ jsx33("div", { ref: setHiddenMenu, id: "hidden-menu" })
|
|
1152
|
+
] }),
|
|
1153
|
+
menu.map((item) => /* @__PURE__ */ jsx33(
|
|
1154
|
+
TabPanel2,
|
|
1005
1155
|
{
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1156
|
+
id: item.id,
|
|
1157
|
+
className: "flex-1 overflow-y-auto h-full",
|
|
1158
|
+
children: item.renderComponent
|
|
1159
|
+
},
|
|
1160
|
+
item.id
|
|
1161
|
+
))
|
|
1162
|
+
]
|
|
1163
|
+
},
|
|
1164
|
+
menuId
|
|
1165
|
+
),
|
|
1166
|
+
hiddenMenu && hidden > 0 ? createPortal(
|
|
1167
|
+
/* @__PURE__ */ jsx33(
|
|
1168
|
+
MoreMenu,
|
|
1169
|
+
{
|
|
1170
|
+
hidden,
|
|
1171
|
+
menuHidden,
|
|
1172
|
+
selectedIndex,
|
|
1173
|
+
selectedKey,
|
|
1174
|
+
onSelectionChange
|
|
1175
|
+
}
|
|
1176
|
+
),
|
|
1177
|
+
hiddenMenu
|
|
1178
|
+
) : null
|
|
1179
|
+
] });
|
|
1019
1180
|
}
|
|
1020
1181
|
var MoreMenu = createHideableComponent(({ selectedIndex, hidden, menuHidden, selectedKey, onSelectionChange }) => {
|
|
1021
|
-
return /* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1182
|
+
return /* @__PURE__ */ jsxs23(MenuTrigger, { children: [
|
|
1183
|
+
/* @__PURE__ */ jsx33(
|
|
1023
1184
|
Button5,
|
|
1024
1185
|
{
|
|
1025
1186
|
className: cn(
|
|
@@ -1029,33 +1190,39 @@ var MoreMenu = createHideableComponent(({ selectedIndex, hidden, menuHidden, sel
|
|
|
1029
1190
|
children: "MORE"
|
|
1030
1191
|
}
|
|
1031
1192
|
),
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1193
|
+
/* @__PURE__ */ jsx33(Popover, { children: menuHidden.length ? /* @__PURE__ */ jsx33(
|
|
1194
|
+
Menu,
|
|
1195
|
+
{
|
|
1196
|
+
className: "bg-white rounded shadow-lg flex flex-col gap-0.5 p-0.5 min-w-28",
|
|
1197
|
+
children: menuHidden.map((item) => {
|
|
1198
|
+
return /* @__PURE__ */ jsx33(
|
|
1199
|
+
MenuItem,
|
|
1200
|
+
{
|
|
1201
|
+
className: (state) => cn(
|
|
1202
|
+
"hover:bg-me-gray-100 p-1 rounded-sm text-sm",
|
|
1203
|
+
selectedKey === item.id && "ring ring-me-primary-500"
|
|
1204
|
+
),
|
|
1205
|
+
onAction: () => onSelectionChange?.(item.id),
|
|
1206
|
+
children: item.label
|
|
1207
|
+
},
|
|
1208
|
+
item.id
|
|
1209
|
+
);
|
|
1210
|
+
})
|
|
1211
|
+
}
|
|
1212
|
+
) : null })
|
|
1046
1213
|
] });
|
|
1047
1214
|
});
|
|
1048
1215
|
|
|
1049
1216
|
// src/MetadataContainer.tsx
|
|
1050
|
-
import { LocaleString as
|
|
1051
|
-
import { jsx as
|
|
1217
|
+
import { LocaleString as LocaleString2 } from "react-iiif-vault";
|
|
1218
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1052
1219
|
function MetadataContainer({
|
|
1053
1220
|
className: className2,
|
|
1054
1221
|
label,
|
|
1055
1222
|
children,
|
|
1056
1223
|
...props
|
|
1057
1224
|
}) {
|
|
1058
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ jsxs24(
|
|
1059
1226
|
"div",
|
|
1060
1227
|
{
|
|
1061
1228
|
className: cn(
|
|
@@ -1064,7 +1231,7 @@ function MetadataContainer({
|
|
|
1064
1231
|
),
|
|
1065
1232
|
...props,
|
|
1066
1233
|
children: [
|
|
1067
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ jsx34(LocaleString2, { className: "text-lg font-bold text-[#333] mb-2", as: "h3", children: label }),
|
|
1068
1235
|
children
|
|
1069
1236
|
]
|
|
1070
1237
|
}
|
|
@@ -1072,9 +1239,9 @@ function MetadataContainer({
|
|
|
1072
1239
|
}
|
|
1073
1240
|
|
|
1074
1241
|
// src/EmptyState.tsx
|
|
1075
|
-
import { jsx as
|
|
1242
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1076
1243
|
function EmptyState(props) {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ jsx35(
|
|
1078
1245
|
"div",
|
|
1079
1246
|
{
|
|
1080
1247
|
className: cn(
|
|
@@ -1088,9 +1255,9 @@ function EmptyState(props) {
|
|
|
1088
1255
|
}
|
|
1089
1256
|
|
|
1090
1257
|
// src/ManifestEditorLogo.tsx
|
|
1091
|
-
import { jsx as
|
|
1258
|
+
import { jsx as jsx36, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1092
1259
|
function ManifestEditorLogo(props) {
|
|
1093
|
-
return /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ jsx36(
|
|
1094
1261
|
"svg",
|
|
1095
1262
|
{
|
|
1096
1263
|
width: "1em",
|
|
@@ -1099,17 +1266,17 @@ function ManifestEditorLogo(props) {
|
|
|
1099
1266
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1100
1267
|
className: "me-logo h-[23px] w-[176px]",
|
|
1101
1268
|
...props,
|
|
1102
|
-
children: /* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1269
|
+
children: /* @__PURE__ */ jsxs25("g", { fill: "none", children: [
|
|
1270
|
+
/* @__PURE__ */ jsx36(
|
|
1104
1271
|
"path",
|
|
1105
1272
|
{
|
|
1106
1273
|
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",
|
|
1107
1274
|
fill: "#000"
|
|
1108
1275
|
}
|
|
1109
1276
|
),
|
|
1110
|
-
/* @__PURE__ */
|
|
1111
|
-
/* @__PURE__ */
|
|
1112
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ jsx36("path", { fill: "#E94581", className: "me-logo-1", d: "M0 13.343 13.343 0l13.343 13.343-13.343 13.343z" }),
|
|
1278
|
+
/* @__PURE__ */ jsx36("path", { fill: "#E94581", className: "me-logo-2", d: "M12.137 13.346 25.48.003l13.343 13.343L25.48 26.69z" }),
|
|
1279
|
+
/* @__PURE__ */ jsx36("path", { fill: "#C63E75", className: "me-logo-3", d: "m12.104 13.348 7.311-7.311 7.312 7.311-7.312 7.312z" })
|
|
1113
1280
|
] })
|
|
1114
1281
|
}
|
|
1115
1282
|
);
|
|
@@ -1117,9 +1284,9 @@ function ManifestEditorLogo(props) {
|
|
|
1117
1284
|
|
|
1118
1285
|
// src/Forms.tsx
|
|
1119
1286
|
import { Label, Form as RAForm, Input, RadioGroup, Radio } from "react-aria-components";
|
|
1120
|
-
import { jsx as
|
|
1287
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1121
1288
|
function MeLabel({ className: className2, ...props }) {
|
|
1122
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ jsx37(
|
|
1123
1290
|
Label,
|
|
1124
1291
|
{
|
|
1125
1292
|
className: cn(
|
|
@@ -1132,7 +1299,7 @@ function MeLabel({ className: className2, ...props }) {
|
|
|
1132
1299
|
);
|
|
1133
1300
|
}
|
|
1134
1301
|
function MeRadioGroup({ className: className2, ...props }) {
|
|
1135
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ jsx37(
|
|
1136
1303
|
RadioGroup,
|
|
1137
1304
|
{
|
|
1138
1305
|
className: cn(
|
|
@@ -1145,7 +1312,7 @@ function MeRadioGroup({ className: className2, ...props }) {
|
|
|
1145
1312
|
);
|
|
1146
1313
|
}
|
|
1147
1314
|
function MeRadio({ className: className2, ...props }) {
|
|
1148
|
-
return /* @__PURE__ */
|
|
1315
|
+
return /* @__PURE__ */ jsx37(
|
|
1149
1316
|
Radio,
|
|
1150
1317
|
{
|
|
1151
1318
|
className: (state) => cn(
|
|
@@ -1158,7 +1325,7 @@ function MeRadio({ className: className2, ...props }) {
|
|
|
1158
1325
|
);
|
|
1159
1326
|
}
|
|
1160
1327
|
function MeForm({ className: className2, ...props }) {
|
|
1161
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ jsx37(
|
|
1162
1329
|
RAForm,
|
|
1163
1330
|
{
|
|
1164
1331
|
className: cn(
|
|
@@ -1171,7 +1338,7 @@ function MeForm({ className: className2, ...props }) {
|
|
|
1171
1338
|
);
|
|
1172
1339
|
}
|
|
1173
1340
|
function MeInput({ className: className2, ...props }) {
|
|
1174
|
-
return /* @__PURE__ */
|
|
1341
|
+
return /* @__PURE__ */ jsx37(
|
|
1175
1342
|
Input,
|
|
1176
1343
|
{
|
|
1177
1344
|
className: cn(
|
|
@@ -1189,7 +1356,7 @@ function MeInputContainer({
|
|
|
1189
1356
|
className: className2,
|
|
1190
1357
|
...props
|
|
1191
1358
|
}) {
|
|
1192
|
-
return /* @__PURE__ */
|
|
1359
|
+
return /* @__PURE__ */ jsx37(
|
|
1193
1360
|
"div",
|
|
1194
1361
|
{
|
|
1195
1362
|
className: cn(
|
|
@@ -1211,12 +1378,194 @@ var Form = {
|
|
|
1211
1378
|
Radio: MeRadio
|
|
1212
1379
|
};
|
|
1213
1380
|
|
|
1381
|
+
// src/HTMLEditor.tsx
|
|
1382
|
+
import { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo4, useRef as useRef4, useState as useState4 } from "react";
|
|
1383
|
+
import { Converter } from "showdown";
|
|
1384
|
+
import { useDebounce } from "tiny-use-debounce";
|
|
1385
|
+
import TurndownService from "turndown";
|
|
1386
|
+
|
|
1387
|
+
// src/MDXEditor.tsx
|
|
1388
|
+
import "@mdxeditor/editor/style.css";
|
|
1389
|
+
import {
|
|
1390
|
+
MDXEditor as BaseMDXEditor,
|
|
1391
|
+
BlockTypeSelect,
|
|
1392
|
+
BoldItalicUnderlineToggles,
|
|
1393
|
+
CreateLink,
|
|
1394
|
+
InsertImage,
|
|
1395
|
+
ListsToggle,
|
|
1396
|
+
UndoRedo,
|
|
1397
|
+
diffSourcePlugin,
|
|
1398
|
+
headingsPlugin,
|
|
1399
|
+
imagePlugin,
|
|
1400
|
+
linkDialogPlugin,
|
|
1401
|
+
linkPlugin,
|
|
1402
|
+
listsPlugin,
|
|
1403
|
+
quotePlugin,
|
|
1404
|
+
thematicBreakPlugin,
|
|
1405
|
+
toolbarPlugin
|
|
1406
|
+
} from "@mdxeditor/editor";
|
|
1407
|
+
import { useMemo as useMemo3 } from "react";
|
|
1408
|
+
import { Fragment as Fragment4, jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1409
|
+
function MDXEditor({
|
|
1410
|
+
editorRef,
|
|
1411
|
+
...props
|
|
1412
|
+
}) {
|
|
1413
|
+
return /* @__PURE__ */ jsx38(
|
|
1414
|
+
BaseMDXEditor,
|
|
1415
|
+
{
|
|
1416
|
+
plugins: useMemo3(
|
|
1417
|
+
() => [
|
|
1418
|
+
// Example Plugin Usage
|
|
1419
|
+
headingsPlugin({ allowedHeadingLevels: [2, 3] }),
|
|
1420
|
+
listsPlugin(),
|
|
1421
|
+
linkPlugin(),
|
|
1422
|
+
quotePlugin(),
|
|
1423
|
+
thematicBreakPlugin(),
|
|
1424
|
+
linkDialogPlugin(),
|
|
1425
|
+
imagePlugin(),
|
|
1426
|
+
diffSourcePlugin(),
|
|
1427
|
+
toolbarPlugin({
|
|
1428
|
+
toolbarClassName: "mdx-toolbar",
|
|
1429
|
+
toolbarContents: () => /* @__PURE__ */ jsxs26(Fragment4, { children: [
|
|
1430
|
+
" ",
|
|
1431
|
+
/* @__PURE__ */ jsx38(UndoRedo, {}),
|
|
1432
|
+
/* @__PURE__ */ jsx38(BoldItalicUnderlineToggles, {}),
|
|
1433
|
+
/* @__PURE__ */ jsx38(BlockTypeSelect, {}),
|
|
1434
|
+
/* @__PURE__ */ jsx38(ListsToggle, { options: ["bullet", "number"] }),
|
|
1435
|
+
/* @__PURE__ */ jsx38(CreateLink, {}),
|
|
1436
|
+
/* @__PURE__ */ jsx38(InsertImage, {})
|
|
1437
|
+
] })
|
|
1438
|
+
})
|
|
1439
|
+
],
|
|
1440
|
+
[]
|
|
1441
|
+
),
|
|
1442
|
+
...props,
|
|
1443
|
+
ref: editorRef
|
|
1444
|
+
}
|
|
1445
|
+
);
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
// src/HTMLEditor.tsx
|
|
1449
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1450
|
+
var converter = new Converter();
|
|
1451
|
+
converter.setFlavor("github");
|
|
1452
|
+
var turndownService = new TurndownService();
|
|
1453
|
+
function HTMLEditor({
|
|
1454
|
+
value,
|
|
1455
|
+
onChange,
|
|
1456
|
+
disabled
|
|
1457
|
+
}) {
|
|
1458
|
+
const editorRef = useRef4(null);
|
|
1459
|
+
const [_value, _setValue] = useState4(void 0);
|
|
1460
|
+
const internalOnChange = useCallback2(() => {
|
|
1461
|
+
if (editorRef.current) {
|
|
1462
|
+
onChange(converter.makeHtml(editorRef.current.getMarkdown()));
|
|
1463
|
+
}
|
|
1464
|
+
}, []);
|
|
1465
|
+
const debounceSave = useDebounce(internalOnChange, 400);
|
|
1466
|
+
const memoState = useMemo4(() => {
|
|
1467
|
+
return turndownService.turndown(value);
|
|
1468
|
+
}, []);
|
|
1469
|
+
useEffect3(() => {
|
|
1470
|
+
const ref = editorRef.current;
|
|
1471
|
+
return () => {
|
|
1472
|
+
if (ref) {
|
|
1473
|
+
onChange(converter.makeHtml(ref.getMarkdown()));
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
}, []);
|
|
1477
|
+
return /* @__PURE__ */ jsx39(
|
|
1478
|
+
MDXEditor,
|
|
1479
|
+
{
|
|
1480
|
+
editorRef,
|
|
1481
|
+
onBlur: internalOnChange,
|
|
1482
|
+
readOnly: disabled,
|
|
1483
|
+
className: [
|
|
1484
|
+
"bg-white prose-sm text-sm border rounded-lg prose-a:text-me-primary-500 prose-a:underline prose-ul:list-disc p-0.5",
|
|
1485
|
+
"prose-ol:list-decimal",
|
|
1486
|
+
"focus-within:outline-none focus-within:border-me-primary-500 z-50 relative"
|
|
1487
|
+
].join(" "),
|
|
1488
|
+
markdown: memoState,
|
|
1489
|
+
suppressHtmlProcessing: true,
|
|
1490
|
+
onError: (err) => {
|
|
1491
|
+
console.log("err", err);
|
|
1492
|
+
},
|
|
1493
|
+
onChange: (value2) => {
|
|
1494
|
+
_setValue(value2);
|
|
1495
|
+
debounceSave();
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
// src/IconButton.tsx
|
|
1502
|
+
import { twMerge as twMerge6 } from "tailwind-merge";
|
|
1503
|
+
import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1504
|
+
function IconButton({
|
|
1505
|
+
children,
|
|
1506
|
+
active,
|
|
1507
|
+
label,
|
|
1508
|
+
disabled,
|
|
1509
|
+
onPress
|
|
1510
|
+
}) {
|
|
1511
|
+
return /* @__PURE__ */ jsx40(Tooltip, { placement: "top", children: /* @__PURE__ */ jsxs27(
|
|
1512
|
+
TooltipTrigger,
|
|
1513
|
+
{
|
|
1514
|
+
onClick: onPress,
|
|
1515
|
+
className: twMerge6(
|
|
1516
|
+
"rounded flex items-center bg-white justify-center p-2 hover:bg-gray-100 text-2xl",
|
|
1517
|
+
active ? "bg-me-primary-500 bg-opacity-40 hover:bg-opacity-70 hover:bg-me-primary-500" : "",
|
|
1518
|
+
disabled ? "opacity-50 pointer-events-none" : ""
|
|
1519
|
+
),
|
|
1520
|
+
children: [
|
|
1521
|
+
children,
|
|
1522
|
+
/* @__PURE__ */ jsx40(DefaultTooltipContent, { className: "translate-x-3", children: label })
|
|
1523
|
+
]
|
|
1524
|
+
}
|
|
1525
|
+
) });
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
// src/ItemWithHandle.tsx
|
|
1529
|
+
import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1530
|
+
function ItemWithHandle({
|
|
1531
|
+
children,
|
|
1532
|
+
handle,
|
|
1533
|
+
actions,
|
|
1534
|
+
grid
|
|
1535
|
+
}) {
|
|
1536
|
+
const gridStyleClassName = grid ? (
|
|
1537
|
+
// Tailwind
|
|
1538
|
+
"absolute flex p-1 gap-1 bg-white z-1 right-1 top-1 rounded"
|
|
1539
|
+
) : "flex-shrink-0 flex items-center gap-1 px-1";
|
|
1540
|
+
return /* @__PURE__ */ jsxs28("div", { className: grid ? "relative flex flex-col" : "flex items-center", children: [
|
|
1541
|
+
/* @__PURE__ */ jsx41("div", { className: "flex-1 min-w-0", style: { flex: 1, minWidth: 0 }, children }),
|
|
1542
|
+
/* @__PURE__ */ jsxs28("div", { className: gridStyleClassName, children: [
|
|
1543
|
+
actions,
|
|
1544
|
+
handle
|
|
1545
|
+
] })
|
|
1546
|
+
] });
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
// src/HandleContainer.tsx
|
|
1550
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
1551
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1552
|
+
var HandleContainer = forwardRef2(function HandleContainer2({ className: className2, ...props }, ref) {
|
|
1553
|
+
return /* @__PURE__ */ jsx42(
|
|
1554
|
+
"div",
|
|
1555
|
+
{
|
|
1556
|
+
ref,
|
|
1557
|
+
className: `relative text-2xl flex p-0.5 rounded-sm aspect-square hover:bg-me-primary-100 aria-expanded:bg-me-primary-500 aria-expanded:text-white ${className2 || ""}`,
|
|
1558
|
+
...props
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1214
1563
|
// src/icons/CreateCanvasIcon.tsx
|
|
1215
|
-
import { jsx as
|
|
1564
|
+
import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1216
1565
|
function CreateCanvasIcon() {
|
|
1217
|
-
return /* @__PURE__ */
|
|
1218
|
-
/* @__PURE__ */
|
|
1219
|
-
/* @__PURE__ */
|
|
1566
|
+
return /* @__PURE__ */ jsxs29("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
|
|
1567
|
+
/* @__PURE__ */ jsx43("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
|
|
1568
|
+
/* @__PURE__ */ jsx43(
|
|
1220
1569
|
"path",
|
|
1221
1570
|
{
|
|
1222
1571
|
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",
|
|
@@ -1227,8 +1576,8 @@ function CreateCanvasIcon() {
|
|
|
1227
1576
|
}
|
|
1228
1577
|
|
|
1229
1578
|
// src/icons/AddImageIcon.tsx
|
|
1230
|
-
import { jsx as
|
|
1231
|
-
var AddImageIcon = (props) => /* @__PURE__ */
|
|
1579
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1580
|
+
var AddImageIcon = (props) => /* @__PURE__ */ jsx44("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx44(
|
|
1232
1581
|
"path",
|
|
1233
1582
|
{
|
|
1234
1583
|
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",
|
|
@@ -1237,8 +1586,8 @@ var AddImageIcon = (props) => /* @__PURE__ */ jsx38("svg", { xmlns: "http://www.
|
|
|
1237
1586
|
) });
|
|
1238
1587
|
|
|
1239
1588
|
// src/icons/IIIFLogo.tsx
|
|
1240
|
-
import { jsx as
|
|
1241
|
-
var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */
|
|
1589
|
+
import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1590
|
+
var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ jsxs30(
|
|
1242
1591
|
"svg",
|
|
1243
1592
|
{
|
|
1244
1593
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1248,7 +1597,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ jsxs26(
|
|
|
1248
1597
|
...props,
|
|
1249
1598
|
viewBox: "0 0 493.36 441.333",
|
|
1250
1599
|
children: [
|
|
1251
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx45(
|
|
1252
1601
|
"path",
|
|
1253
1602
|
{
|
|
1254
1603
|
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",
|
|
@@ -1261,7 +1610,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ jsxs26(
|
|
|
1261
1610
|
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1262
1611
|
}
|
|
1263
1612
|
),
|
|
1264
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ jsx45(
|
|
1265
1614
|
"path",
|
|
1266
1615
|
{
|
|
1267
1616
|
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",
|
|
@@ -1274,7 +1623,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ jsxs26(
|
|
|
1274
1623
|
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1275
1624
|
}
|
|
1276
1625
|
),
|
|
1277
|
-
/* @__PURE__ */
|
|
1626
|
+
/* @__PURE__ */ jsx45(
|
|
1278
1627
|
"path",
|
|
1279
1628
|
{
|
|
1280
1629
|
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",
|
|
@@ -1287,7 +1636,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ jsxs26(
|
|
|
1287
1636
|
transform: "matrix(.13333 0 0 -.13333 0 441.333)"
|
|
1288
1637
|
}
|
|
1289
1638
|
),
|
|
1290
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ jsx45(
|
|
1291
1640
|
"path",
|
|
1292
1641
|
{
|
|
1293
1642
|
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",
|
|
@@ -1305,8 +1654,8 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ jsxs26(
|
|
|
1305
1654
|
);
|
|
1306
1655
|
|
|
1307
1656
|
// src/icons/HTMLIcon.tsx
|
|
1308
|
-
import { jsx as
|
|
1309
|
-
var HTMLIcon = (props) => /* @__PURE__ */
|
|
1657
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1658
|
+
var HTMLIcon = (props) => /* @__PURE__ */ jsx46("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx46(
|
|
1310
1659
|
"path",
|
|
1311
1660
|
{
|
|
1312
1661
|
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",
|
|
@@ -1315,8 +1664,8 @@ var HTMLIcon = (props) => /* @__PURE__ */ jsx40("svg", { xmlns: "http://www.w3.o
|
|
|
1315
1664
|
) });
|
|
1316
1665
|
|
|
1317
1666
|
// src/icons/IIIFBrowserIcon.tsx
|
|
1318
|
-
import { jsx as
|
|
1319
|
-
var IIIFBrowserIcon = (props) => /* @__PURE__ */
|
|
1667
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1668
|
+
var IIIFBrowserIcon = (props) => /* @__PURE__ */ jsx47("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx47(
|
|
1320
1669
|
"path",
|
|
1321
1670
|
{
|
|
1322
1671
|
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",
|
|
@@ -1325,8 +1674,8 @@ var IIIFBrowserIcon = (props) => /* @__PURE__ */ jsx41("svg", { xmlns: "http://w
|
|
|
1325
1674
|
) });
|
|
1326
1675
|
|
|
1327
1676
|
// src/icons/YouTubeIcon.tsx
|
|
1328
|
-
import { jsx as
|
|
1329
|
-
var YouTubeIcon = (props) => /* @__PURE__ */
|
|
1677
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1678
|
+
var YouTubeIcon = (props) => /* @__PURE__ */ jsx48("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx48(
|
|
1330
1679
|
"path",
|
|
1331
1680
|
{
|
|
1332
1681
|
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",
|
|
@@ -1335,8 +1684,8 @@ var YouTubeIcon = (props) => /* @__PURE__ */ jsx42("svg", { xmlns: "http://www.w
|
|
|
1335
1684
|
) });
|
|
1336
1685
|
|
|
1337
1686
|
// src/icons/VideoIcon.tsx
|
|
1338
|
-
import { jsx as
|
|
1339
|
-
var VideoIcon = (props) => /* @__PURE__ */
|
|
1687
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
1688
|
+
var VideoIcon = (props) => /* @__PURE__ */ jsx49("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx49(
|
|
1340
1689
|
"path",
|
|
1341
1690
|
{
|
|
1342
1691
|
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",
|
|
@@ -1345,8 +1694,8 @@ var VideoIcon = (props) => /* @__PURE__ */ jsx43("svg", { xmlns: "http://www.w3.
|
|
|
1345
1694
|
) });
|
|
1346
1695
|
|
|
1347
1696
|
// src/icons/AudioIcon.tsx
|
|
1348
|
-
import { jsx as
|
|
1349
|
-
var AudioIcon = (props) => /* @__PURE__ */
|
|
1697
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1698
|
+
var AudioIcon = (props) => /* @__PURE__ */ jsx50("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx50(
|
|
1350
1699
|
"path",
|
|
1351
1700
|
{
|
|
1352
1701
|
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",
|
|
@@ -1355,8 +1704,8 @@ var AudioIcon = (props) => /* @__PURE__ */ jsx44("svg", { xmlns: "http://www.w3.
|
|
|
1355
1704
|
) });
|
|
1356
1705
|
|
|
1357
1706
|
// src/icons/EmptyCanvasIcon.tsx
|
|
1358
|
-
import { jsx as
|
|
1359
|
-
var EmptyCanvasIcon = (props) => /* @__PURE__ */
|
|
1707
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
1708
|
+
var EmptyCanvasIcon = (props) => /* @__PURE__ */ jsx51("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ jsx51(
|
|
1360
1709
|
"path",
|
|
1361
1710
|
{
|
|
1362
1711
|
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",
|
|
@@ -1365,14 +1714,14 @@ var EmptyCanvasIcon = (props) => /* @__PURE__ */ jsx45("svg", { xmlns: "http://w
|
|
|
1365
1714
|
) });
|
|
1366
1715
|
|
|
1367
1716
|
// src/icons/AddIcon.tsx
|
|
1368
|
-
import { jsx as
|
|
1717
|
+
import { jsx as jsx52, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1369
1718
|
function AddIcon({
|
|
1370
1719
|
className: className2,
|
|
1371
1720
|
inline,
|
|
1372
1721
|
height = 16,
|
|
1373
1722
|
color = "black"
|
|
1374
1723
|
}) {
|
|
1375
|
-
return /* @__PURE__ */
|
|
1724
|
+
return /* @__PURE__ */ jsxs31(
|
|
1376
1725
|
"svg",
|
|
1377
1726
|
{
|
|
1378
1727
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1383,17 +1732,60 @@ function AddIcon({
|
|
|
1383
1732
|
style: { verticalAlign: inline ? "bottom" : void 0 },
|
|
1384
1733
|
className: className2,
|
|
1385
1734
|
children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsx52("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1736
|
+
/* @__PURE__ */ jsx52("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", fill: "currentColor" })
|
|
1388
1737
|
]
|
|
1389
1738
|
}
|
|
1390
1739
|
);
|
|
1391
1740
|
}
|
|
1392
1741
|
|
|
1742
|
+
// src/icons/MoreMenu.tsx
|
|
1743
|
+
import { jsx as jsx53, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1744
|
+
function MoreMenu2() {
|
|
1745
|
+
return /* @__PURE__ */ jsxs32(
|
|
1746
|
+
"svg",
|
|
1747
|
+
{
|
|
1748
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1749
|
+
height: "1em",
|
|
1750
|
+
viewBox: "0 0 24 24",
|
|
1751
|
+
width: "1em",
|
|
1752
|
+
children: [
|
|
1753
|
+
/* @__PURE__ */ jsx53("path", { d: "M0 0h24v24H0z", fill: "none" }),
|
|
1754
|
+
/* @__PURE__ */ jsx53(
|
|
1755
|
+
"path",
|
|
1756
|
+
{
|
|
1757
|
+
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",
|
|
1758
|
+
fill: "currentColor"
|
|
1759
|
+
}
|
|
1760
|
+
)
|
|
1761
|
+
]
|
|
1762
|
+
}
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
// src/ErrorMessage.tsx
|
|
1767
|
+
import { twMerge as twMerge7 } from "tailwind-merge";
|
|
1768
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
1769
|
+
function ErrorMessage({ children, small = false, className: className2 }) {
|
|
1770
|
+
return /* @__PURE__ */ jsx54(
|
|
1771
|
+
"div",
|
|
1772
|
+
{
|
|
1773
|
+
className: twMerge7(
|
|
1774
|
+
"bg-red-500 text-white",
|
|
1775
|
+
"border-1 drop-shadow border-red-700 w-full rounded-md py-2 px-4 leading-[1.9em] flex items-center",
|
|
1776
|
+
"has-[a]:text-white",
|
|
1777
|
+
small && "text-xs whitespace-nowrap py-1 px-2 leading-[1.6em] w-fit",
|
|
1778
|
+
className2
|
|
1779
|
+
),
|
|
1780
|
+
children
|
|
1781
|
+
}
|
|
1782
|
+
);
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1393
1785
|
// src/hooks.ts
|
|
1394
|
-
import { useLayoutEffect as useLayoutEffect4, useState as
|
|
1786
|
+
import { useLayoutEffect as useLayoutEffect4, useState as useState5 } from "react";
|
|
1395
1787
|
function useFastList(list, firstRender = 24) {
|
|
1396
|
-
const [isMounted, setIsMounted] =
|
|
1788
|
+
const [isMounted, setIsMounted] = useState5(false);
|
|
1397
1789
|
useLayoutEffect4(() => {
|
|
1398
1790
|
if (list) {
|
|
1399
1791
|
setTimeout(() => {
|
|
@@ -1409,6 +1801,128 @@ function useFastList(list, firstRender = 24) {
|
|
|
1409
1801
|
}
|
|
1410
1802
|
return list.slice(0, firstRender);
|
|
1411
1803
|
}
|
|
1804
|
+
|
|
1805
|
+
// src/RenderTextualContent.tsx
|
|
1806
|
+
import { useState as useState6 } from "react";
|
|
1807
|
+
import { Button as Button6 } from "react-aria-components";
|
|
1808
|
+
import {
|
|
1809
|
+
LocaleString as LocaleString3
|
|
1810
|
+
} from "react-iiif-vault";
|
|
1811
|
+
import { jsx as jsx55, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
1812
|
+
function RenderTextualContent(props) {
|
|
1813
|
+
const languages = props.strategy.items.map(
|
|
1814
|
+
(item) => Object.keys(item.text)[0]
|
|
1815
|
+
);
|
|
1816
|
+
const [langauge, setLanguage] = useState6(languages[0]);
|
|
1817
|
+
const selected = props.strategy.items.find(
|
|
1818
|
+
(item) => Object.keys(item.text)[0] === langauge
|
|
1819
|
+
);
|
|
1820
|
+
return /* @__PURE__ */ jsxs33("div", { className: "overflow-y-auto bg-white shadow", children: [
|
|
1821
|
+
/* @__PURE__ */ jsx55("div", { className: "flex gap-2 border-b", children: languages.map((language) => {
|
|
1822
|
+
return /* @__PURE__ */ jsx55(
|
|
1823
|
+
Button6,
|
|
1824
|
+
{
|
|
1825
|
+
className: `py-1 px-3 ${langauge === language ? "bg-me-500 text-white" : "bg-white text-black"}`,
|
|
1826
|
+
onPress: () => setLanguage(language),
|
|
1827
|
+
children: language
|
|
1828
|
+
},
|
|
1829
|
+
language
|
|
1830
|
+
);
|
|
1831
|
+
}) }),
|
|
1832
|
+
/* @__PURE__ */ jsx55("div", { className: "p-4 prose", children: /* @__PURE__ */ jsx55(
|
|
1833
|
+
LocaleString3,
|
|
1834
|
+
{
|
|
1835
|
+
enableDangerouslySetInnerHTML: true,
|
|
1836
|
+
defaultText: /* @__PURE__ */ jsx55("span", { className: "text-gray-500 my-8", children: "No content available" }),
|
|
1837
|
+
children: selected?.text
|
|
1838
|
+
}
|
|
1839
|
+
) })
|
|
1840
|
+
] });
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
// src/IIIFMediaPlayer.tsx
|
|
1844
|
+
import "@vidstack/react/player/styles/base.css";
|
|
1845
|
+
import "@vidstack/react/player/styles/default/theme.css";
|
|
1846
|
+
import "@vidstack/react/player/styles/default/captions.css";
|
|
1847
|
+
import "@vidstack/react/player/styles/default/layouts/video.css";
|
|
1848
|
+
import { MediaPlayer, MediaProvider, Poster, Gesture, Track } from "@vidstack/react";
|
|
1849
|
+
import { defaultLayoutIcons, DefaultVideoLayout } from "@vidstack/react/player/layouts/default";
|
|
1850
|
+
import { getValue } from "@iiif/helpers";
|
|
1851
|
+
import { useRef as useRef5 } from "react";
|
|
1852
|
+
import { Fragment as Fragment5, jsx as jsx56, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
1853
|
+
function IIIFMediaPlayer(props) {
|
|
1854
|
+
const mediaPlayer = useRef5(null);
|
|
1855
|
+
const captions = props.captions || [];
|
|
1856
|
+
const language = props.language;
|
|
1857
|
+
const timeRef = useRef5(props.startTime || 0);
|
|
1858
|
+
return /* @__PURE__ */ jsx56(
|
|
1859
|
+
MediaPlayer,
|
|
1860
|
+
{
|
|
1861
|
+
onTimeUpdate: (time) => {
|
|
1862
|
+
const newT = Math.round(time.currentTime);
|
|
1863
|
+
if (timeRef.current === newT)
|
|
1864
|
+
return;
|
|
1865
|
+
timeRef.current = newT;
|
|
1866
|
+
},
|
|
1867
|
+
ref: mediaPlayer,
|
|
1868
|
+
lang: language,
|
|
1869
|
+
className: "h-full w-full min-w-[275px] flex radius-0",
|
|
1870
|
+
playsInline: true,
|
|
1871
|
+
currentTime: props.startTime,
|
|
1872
|
+
duration: props.media.duration,
|
|
1873
|
+
src: [
|
|
1874
|
+
{
|
|
1875
|
+
src: props.media.url,
|
|
1876
|
+
type: props.media.format
|
|
1877
|
+
}
|
|
1878
|
+
],
|
|
1879
|
+
children: /* @__PURE__ */ jsxs34(MediaProvider, { className: "w-full h-full [&>video]:w-full [&>video]:h-full [&>video]:object-contain", children: [
|
|
1880
|
+
captions.map((caption) => {
|
|
1881
|
+
return /* @__PURE__ */ jsx56(
|
|
1882
|
+
Track,
|
|
1883
|
+
{
|
|
1884
|
+
src: caption.id,
|
|
1885
|
+
kind: "subtitles",
|
|
1886
|
+
label: getValue(caption.label),
|
|
1887
|
+
default: caption.language === language,
|
|
1888
|
+
language: caption.language
|
|
1889
|
+
},
|
|
1890
|
+
caption.id
|
|
1891
|
+
);
|
|
1892
|
+
}),
|
|
1893
|
+
props.poster ? /* @__PURE__ */ jsx56(
|
|
1894
|
+
Poster,
|
|
1895
|
+
{
|
|
1896
|
+
className: "absolute inset-0 bg-black block h-full w-full opacity-0 transition-opacity data-[visible]:opacity-100 object-contain",
|
|
1897
|
+
src: props.poster
|
|
1898
|
+
}
|
|
1899
|
+
) : null,
|
|
1900
|
+
/* @__PURE__ */ jsx56(Gestures, {}),
|
|
1901
|
+
/* @__PURE__ */ jsx56(
|
|
1902
|
+
DefaultVideoLayout,
|
|
1903
|
+
{
|
|
1904
|
+
className: "z-1",
|
|
1905
|
+
noGestures: true,
|
|
1906
|
+
icons: defaultLayoutIcons
|
|
1907
|
+
}
|
|
1908
|
+
)
|
|
1909
|
+
] })
|
|
1910
|
+
}
|
|
1911
|
+
);
|
|
1912
|
+
}
|
|
1913
|
+
function Gestures() {
|
|
1914
|
+
return /* @__PURE__ */ jsxs34(Fragment5, { children: [
|
|
1915
|
+
/* @__PURE__ */ jsx56(
|
|
1916
|
+
Gesture,
|
|
1917
|
+
{
|
|
1918
|
+
className: "pointer-coarse:hidden absolute top-0 start-12 bottom-20 right-0 -z-1 block",
|
|
1919
|
+
event: "pointerup",
|
|
1920
|
+
action: "toggle:paused"
|
|
1921
|
+
}
|
|
1922
|
+
),
|
|
1923
|
+
/* @__PURE__ */ jsx56(Gesture, { className: "absolute inset-0 z-0 block h-full w-full", event: "dblpointerup", action: "toggle:fullscreen" })
|
|
1924
|
+
] });
|
|
1925
|
+
}
|
|
1412
1926
|
export {
|
|
1413
1927
|
ActionButton,
|
|
1414
1928
|
AddIcon,
|
|
@@ -1422,21 +1936,31 @@ export {
|
|
|
1422
1936
|
CreateCanvasIcon,
|
|
1423
1937
|
CreatorGrid,
|
|
1424
1938
|
DefaultTooltipContent,
|
|
1939
|
+
DeleteForeverIcon,
|
|
1425
1940
|
DownloadButton,
|
|
1426
1941
|
DownloadIcon,
|
|
1427
1942
|
EmptyCanvasIcon,
|
|
1428
1943
|
EmptyState,
|
|
1944
|
+
ErrorMessage,
|
|
1429
1945
|
Form,
|
|
1946
|
+
HTMLEditor,
|
|
1430
1947
|
HTMLIcon,
|
|
1948
|
+
HandleContainer,
|
|
1431
1949
|
IIIFBrowserIcon,
|
|
1432
1950
|
IIIFLogo,
|
|
1951
|
+
IIIFMediaPlayer,
|
|
1952
|
+
IconButton,
|
|
1953
|
+
ItemWithHandle,
|
|
1433
1954
|
LazyThumbnail,
|
|
1955
|
+
MDXEditor,
|
|
1434
1956
|
ManifestEditorLogo,
|
|
1435
1957
|
ManifestOverviewEmptyState,
|
|
1436
1958
|
MetadataContainer,
|
|
1437
1959
|
Modal,
|
|
1960
|
+
MoreMenu2 as MoreMenu,
|
|
1438
1961
|
OpaqueControls,
|
|
1439
1962
|
PanelSideMenu,
|
|
1963
|
+
RenderTextualContent,
|
|
1440
1964
|
Sidebar,
|
|
1441
1965
|
SidebarContent,
|
|
1442
1966
|
SidebarHeader,
|
|
@@ -1446,6 +1970,7 @@ export {
|
|
|
1446
1970
|
TabList,
|
|
1447
1971
|
TabPanel,
|
|
1448
1972
|
Tabs,
|
|
1973
|
+
TextIcon,
|
|
1449
1974
|
ThumbnailGridContainer,
|
|
1450
1975
|
Tooltip,
|
|
1451
1976
|
TooltipContent,
|