@manifest-editor/components 1.2.0 → 1.3.0

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