@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.cjs CHANGED
@@ -43,21 +43,31 @@ __export(src_exports, {
43
43
  CreateCanvasIcon: () => CreateCanvasIcon,
44
44
  CreatorGrid: () => CreatorGrid,
45
45
  DefaultTooltipContent: () => DefaultTooltipContent,
46
+ DeleteForeverIcon: () => DeleteForeverIcon,
46
47
  DownloadButton: () => DownloadButton,
47
48
  DownloadIcon: () => DownloadIcon,
48
49
  EmptyCanvasIcon: () => EmptyCanvasIcon,
49
50
  EmptyState: () => EmptyState,
51
+ ErrorMessage: () => ErrorMessage,
50
52
  Form: () => Form,
53
+ HTMLEditor: () => HTMLEditor,
51
54
  HTMLIcon: () => HTMLIcon,
55
+ HandleContainer: () => HandleContainer,
52
56
  IIIFBrowserIcon: () => IIIFBrowserIcon,
53
57
  IIIFLogo: () => IIIFLogo,
58
+ IIIFMediaPlayer: () => IIIFMediaPlayer,
59
+ IconButton: () => IconButton,
60
+ ItemWithHandle: () => ItemWithHandle,
54
61
  LazyThumbnail: () => LazyThumbnail,
62
+ MDXEditor: () => MDXEditor,
55
63
  ManifestEditorLogo: () => ManifestEditorLogo,
56
64
  ManifestOverviewEmptyState: () => ManifestOverviewEmptyState,
57
65
  MetadataContainer: () => MetadataContainer,
58
66
  Modal: () => Modal,
67
+ MoreMenu: () => MoreMenu2,
59
68
  OpaqueControls: () => OpaqueControls,
60
69
  PanelSideMenu: () => PanelSideMenu,
70
+ RenderTextualContent: () => RenderTextualContent,
61
71
  Sidebar: () => Sidebar,
62
72
  SidebarContent: () => SidebarContent,
63
73
  SidebarHeader: () => SidebarHeader,
@@ -67,6 +77,7 @@ __export(src_exports, {
67
77
  TabList: () => TabList,
68
78
  TabPanel: () => TabPanel,
69
79
  Tabs: () => Tabs,
80
+ TextIcon: () => TextIcon,
70
81
  ThumbnailGridContainer: () => ThumbnailGridContainer,
71
82
  Tooltip: () => Tooltip,
72
83
  TooltipContent: () => TooltipContent,
@@ -79,6 +90,7 @@ __export(src_exports, {
79
90
  useTooltipContext: () => useTooltipContext
80
91
  });
81
92
  module.exports = __toCommonJS(src_exports);
93
+ var import_dist = require("iiif-browser/dist/index.css");
82
94
 
83
95
  // src/ActionButton.tsx
84
96
  var import_react_aria_components = require("react-aria-components");
@@ -119,6 +131,7 @@ function ActionButton({
119
131
  var React = __toESM(require("react"), 1);
120
132
  var import_react = require("@floating-ui/react");
121
133
  var import_react_aria_components2 = require("react-aria-components");
134
+ var import_tailwind_merge2 = require("tailwind-merge");
122
135
  var import_jsx_runtime2 = require("react/jsx-runtime");
123
136
  function useTooltip({
124
137
  initialOpen = false,
@@ -173,7 +186,10 @@ var useTooltipContext = () => {
173
186
  }
174
187
  return context;
175
188
  };
176
- function Tooltip({ children, ...options }) {
189
+ function Tooltip({
190
+ children,
191
+ ...options
192
+ }) {
177
193
  const tooltip = useTooltip(options);
178
194
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipContext.Provider, { value: tooltip, children });
179
195
  }
@@ -220,7 +236,16 @@ var TooltipContent = React.forwardRef(function TooltipContent2({ style, ...props
220
236
  ) });
221
237
  });
222
238
  function DefaultTooltipContent(props) {
223
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TooltipContent, { className: "bg-me-gray-900 text-white text-sm px-3 py-2 rounded-lg opacity-90 z-50", children: props.children });
239
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
240
+ TooltipContent,
241
+ {
242
+ className: (0, import_tailwind_merge2.twMerge)(
243
+ "bg-me-gray-900 text-white text-sm px-3 py-2 rounded-lg opacity-90 z-50",
244
+ props.className
245
+ ),
246
+ children: props.children
247
+ }
248
+ );
224
249
  }
225
250
 
226
251
  // src/Sidebar.tsx
@@ -233,11 +258,11 @@ function SidebarContent({
233
258
  className: className2,
234
259
  padding
235
260
  }) {
236
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn("flex-1 min-h-0 overflow-y-auto", className2, padding && "p-3"), children });
261
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn("flex-1 min-h-0 overflow-y-auto pb-64", className2, padding && "px-3 pt-3"), children });
237
262
  }
238
263
  function SidebarHeader(props) {
239
264
  const { actions, title } = props;
240
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "bg-me-gray-100 h-12 flex items-center px-3 z-10 text-black border-b-me-gray-300 border-b", children: [
265
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "bg-me-gray-100 h-12 flex items-center px-3 z-10 text-black border-b-me-gray-300 border-b flex-shrink-0", children: [
241
266
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex-1", children: title }),
242
267
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "ml-auto flex gap-2 items-center", children: actions?.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { placement: "bottom", children: [
243
268
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -311,9 +336,10 @@ function ThumbnailGridContainer(props) {
311
336
  }
312
337
 
313
338
  // src/LazyThumbnail.tsx
314
- var import_react_lazy_load_image_component = require("react-lazy-load-image-component");
315
- var import_react_iiif_vault = require("react-iiif-vault");
316
339
  var import_react2 = require("react");
340
+ var import_react_iiif_vault = require("react-iiif-vault");
341
+ var import_react_lazy_load_image_component = require("react-lazy-load-image-component");
342
+ var import_tailwind_merge3 = require("tailwind-merge");
317
343
 
318
344
  // src/Spinner.tsx
319
345
  var import_jsx_runtime8 = require("react/jsx-runtime");
@@ -345,59 +371,118 @@ function Spinner(props) {
345
371
  );
346
372
  }
347
373
 
348
- // src/LazyThumbnail.tsx
374
+ // src/icons/TextIcon.tsx
349
375
  var import_jsx_runtime9 = require("react/jsx-runtime");
350
- function LazyThumbnail() {
351
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_lazy_load_image_component.LazyLoadComponent, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LazyThumbnailInner, {}) });
376
+ function TextIcon(props) {
377
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
378
+ "svg",
379
+ {
380
+ xmlns: "http://www.w3.org/2000/svg",
381
+ width: "1em",
382
+ height: "1em",
383
+ viewBox: "0 0 24 24",
384
+ ...props,
385
+ children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("title", { children: "Text" }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
388
+ "path",
389
+ {
390
+ fill: "currentColor",
391
+ d: "M3 21v-2h18v2zm0-4v-2h12v2zm0-4v-2h18v2zm0-4V7h12v2zm0-4V3h18v2z"
392
+ }
393
+ )
394
+ ]
395
+ }
396
+ );
397
+ }
398
+
399
+ // src/LazyThumbnail.tsx
400
+ var import_jsx_runtime10 = require("react/jsx-runtime");
401
+ function LazyThumbnail({
402
+ cover,
403
+ fade = true
404
+ }) {
405
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_lazy_load_image_component.LazyLoadComponent, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LazyThumbnailInner, { cover, fade }) });
352
406
  }
353
- function LazyThumbnailInner() {
407
+ var renderCache = /* @__PURE__ */ new Map();
408
+ function LazyThumbnailInner({
409
+ cover,
410
+ fade = true
411
+ }) {
354
412
  const img = (0, import_react2.useRef)(null);
355
- const [isLoading, setIsLoading] = (0, import_react2.useState)(false);
413
+ const canvas = (0, import_react_iiif_vault.useCanvas)();
414
+ const isCached = canvas ? !!renderCache.get(canvas?.id) : false;
415
+ const [isLoading, setIsLoading] = (0, import_react2.useState)(!isCached);
356
416
  const thumbnail = (0, import_react_iiif_vault.useThumbnail)({ height: 256, width: 256 }, true);
417
+ let thumbnailId = thumbnail?.id;
418
+ if (canvas?.id && thumbnailId) {
419
+ renderCache.set(canvas.id, thumbnailId);
420
+ } else if (canvas?.id && renderCache.get(canvas.id)) {
421
+ thumbnailId = renderCache.get(canvas?.id);
422
+ }
357
423
  (0, import_react2.useEffect)(() => {
358
- if (thumbnail?.id) {
424
+ if (thumbnailId && !isCached) {
359
425
  setIsLoading(true);
360
426
  }
361
- }, [thumbnail?.id]);
362
- (0, import_react2.useLayoutEffect)(() => {
363
- if (img.current) {
364
- if (img.current.complete || img.current.naturalWidth > 0) {
365
- setIsLoading(false);
427
+ }, [thumbnailId, isCached]);
428
+ const checkImage = (0, import_react2.useCallback)(
429
+ (node) => {
430
+ if (node && !isCached) {
431
+ if (node.complete || node.naturalWidth > 0) {
432
+ setIsLoading(false);
433
+ }
366
434
  }
367
- }
368
- }, [thumbnail?.id]);
369
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: `w-full h-full relative`, children: [
370
- thumbnail?.id ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
435
+ },
436
+ [isCached]
437
+ );
438
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `w-full h-full relative`, children: [
439
+ thumbnail?.id ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
371
440
  "img",
372
441
  {
373
442
  onLoad: () => setIsLoading(false),
374
- ref: img,
443
+ ref: checkImage,
375
444
  src: thumbnail?.id,
376
445
  alt: "",
377
- className: `w-full h-full object-contain ${!isLoading ? "animate-fadeIn" : "opacity-0"}`
446
+ className: `w-full h-full ${cover ? "object-cover" : "object-contain"} ${!isLoading ? isCached ? "" : "animate-fadeIn" : "opacity-0"}`
447
+ }
448
+ ) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ThumbnailFallback, {}),
449
+ !thumbnail?.id || isLoading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
450
+ "div",
451
+ {
452
+ className: (0, import_tailwind_merge3.twMerge)(
453
+ "absolute inset-0 flex items-center justify-center bg-me-gray-100 text-2xl z-10",
454
+ fade && "animate-fadeIn"
455
+ ),
456
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Spinner, {})
378
457
  }
379
- ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "text-black/30 flex items-center justify-center h-full bg-me-gray-100 animate-fadeInDelayed absolute inset-0 z-20", children: "No thumbnail" }),
380
- !thumbnail?.id || isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-me-gray-100 text-2xl animate-fadeIn z-10", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Spinner, {}) }) : null
458
+ ) : null
381
459
  ] });
382
460
  }
461
+ function ThumbnailFallback() {
462
+ const [strategy] = (0, import_react_iiif_vault.useRenderingStrategy)();
463
+ if (strategy.type === "textual-content") {
464
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-black/30 flex items-center justify-center h-full bg-me-gray-100 animate-fadeInDelayed absolute inset-0 z-20", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TextIcon, { className: "w-16 h-16" }) });
465
+ }
466
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "text-black/30 flex items-center justify-center h-full bg-me-gray-100 animate-fadeInDelayed absolute inset-0 z-20", children: "No thumbnail" });
467
+ }
383
468
 
384
469
  // src/CanvasThumbnailGridItem.tsx
385
470
  var import_react_iiif_vault3 = require("react-iiif-vault");
386
471
 
387
472
  // src/CanvasLabel.tsx
388
473
  var import_react_iiif_vault2 = require("react-iiif-vault");
389
- var import_jsx_runtime10 = require("react/jsx-runtime");
474
+ var import_jsx_runtime11 = require("react/jsx-runtime");
390
475
  function CanvasLabel(props) {
391
476
  const canvas = (0, import_react_iiif_vault2.useCanvas)();
392
477
  if (!canvas)
393
478
  return null;
394
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_iiif_vault2.LocaleString, { className: props.className, as: props.as, children: canvas.label });
479
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_iiif_vault2.LocaleString, { className: props.className, as: props.as, children: canvas.label });
395
480
  }
396
481
 
397
482
  // src/Card3D.tsx
398
483
  var import_react3 = require("react");
399
- var import_tailwind_merge2 = require("tailwind-merge");
400
- var import_jsx_runtime11 = require("react/jsx-runtime");
484
+ var import_tailwind_merge4 = require("tailwind-merge");
485
+ var import_jsx_runtime12 = require("react/jsx-runtime");
401
486
  function Card3D({
402
487
  className: className2,
403
488
  shouldTranslate,
@@ -468,11 +553,11 @@ function Card3D({
468
553
  outer.current.removeEventListener("mousemove", mousemove);
469
554
  };
470
555
  }, []);
471
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
556
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
472
557
  "div",
473
558
  {
474
559
  ref: outer,
475
- className: (0, import_tailwind_merge2.twMerge)(
560
+ className: (0, import_tailwind_merge4.twMerge)(
476
561
  //
477
562
  "relative transition-all hover:duration-50",
478
563
  shouldTranslate && "hover:shadow-xl",
@@ -481,7 +566,7 @@ function Card3D({
481
566
  ...props,
482
567
  children: [
483
568
  children,
484
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
569
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
485
570
  "div",
486
571
  {
487
572
  className: "pointer-events-none absolute inset-0 transition-all",
@@ -497,70 +582,94 @@ function Card3D({
497
582
  }
498
583
 
499
584
  // src/CanvasThumbnailGridItem.tsx
500
- var import_jsx_runtime12 = require("react/jsx-runtime");
585
+ var import_jsx_runtime13 = require("react/jsx-runtime");
501
586
  function CanvasThumbnailGridItem(props) {
502
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_iiif_vault3.CanvasContext, { canvas: props.id, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { onMouseDown: props.onClick, className: "flex flex-col", "data-canvas-selected": props.selected, children: [
503
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "bg-me-gray-100 w-full aspect-square flex-1 overflow-hidden rounded", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
587
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_iiif_vault3.CanvasContext, { canvas: props.id, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { onMouseDown: props.onClick, className: "flex flex-col", "data-canvas-selected": props.selected, children: [
588
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "bg-me-gray-100 w-full aspect-square flex-1 overflow-hidden rounded", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
504
589
  Card3D,
505
590
  {
591
+ "data-canvas-selected": props.active,
592
+ "aria-selected": props.active,
506
593
  className: cn(
507
594
  "border-2 border-transparent p-1 w-full h-full rounded",
508
595
  props.selected && "border-me-primary-500"
509
596
  ),
510
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LazyThumbnail, {})
597
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LazyThumbnail, {})
511
598
  }
512
599
  ) }),
513
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CanvasLabel, { className: "text-sm text-center truncate mt-1", as: "div" })
600
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CanvasLabel, { className: "text-sm text-center truncate mt-1", as: "div" })
514
601
  ] }) });
515
602
  }
516
603
 
517
604
  // src/Modal.tsx
518
605
  var import_react4 = require("@headlessui/react");
519
- var import_jsx_runtime13 = require("react/jsx-runtime");
520
- function Modal({ id, title, open = true, onClose, actions, children }) {
521
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react4.Dialog, { open, onClose, id, className: "relative z-[500]", children: [
522
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `fixed inset-0 bg-black/30 animate-fadeIn z-[501]`, "aria-hidden": "true" }),
523
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "fixed inset-0 flex w-screen items-center justify-center p-4 z-[502]", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "relative p-4 w-full max-w-3xl max-h-full", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react4.DialogPanel, { className: "relative bg-white rounded-lg overflow-hidden shadow-2xl max-h-[80vh] flex flex-col", children: [
524
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-between p-4 md:p-5 rounded-t-lg sticky top-0 bg-white", children: [
525
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react4.DialogTitle, { className: "text-xl font-semibold text-gray-900 ", children: title }),
526
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react4.CloseButton, { className: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center", children: [
527
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
528
- "svg",
529
- {
530
- className: "w-3 h-3",
531
- "aria-hidden": "true",
532
- xmlns: "http://www.w3.org/2000/svg",
533
- fill: "none",
534
- viewBox: "0 0 14 14",
535
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
536
- "path",
606
+ var import_jsx_runtime14 = require("react/jsx-runtime");
607
+ function Modal({
608
+ id,
609
+ title,
610
+ open = true,
611
+ onClose,
612
+ actions,
613
+ children
614
+ }) {
615
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
616
+ import_react4.Dialog,
617
+ {
618
+ open,
619
+ onClose,
620
+ id,
621
+ className: "relative z-[500]",
622
+ children: [
623
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
624
+ "div",
625
+ {
626
+ className: `fixed inset-0 bg-black/30 animate-fadeIn z-[501]`,
627
+ "aria-hidden": "true"
628
+ }
629
+ ),
630
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "fixed inset-0 flex w-screen items-center justify-center p-4 z-[502]", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "relative p-4 w-full max-w-4xl max-h-full", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react4.DialogPanel, { className: "relative bg-white rounded-lg overflow-hidden shadow-2xl max-h-[80vh] flex flex-col", children: [
631
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center justify-between p-4 md:p-5 rounded-t-lg sticky top-0 bg-white", children: [
632
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react4.DialogTitle, { className: "text-xl font-semibold text-gray-900 ", children: title }),
633
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react4.CloseButton, { className: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center", children: [
634
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
635
+ "svg",
537
636
  {
538
- stroke: "currentColor",
539
- strokeLinecap: "round",
540
- strokeLinejoin: "round",
541
- strokeWidth: "2",
542
- d: "m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
637
+ className: "w-3 h-3",
638
+ "aria-hidden": "true",
639
+ xmlns: "http://www.w3.org/2000/svg",
640
+ fill: "none",
641
+ viewBox: "0 0 14 14",
642
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
643
+ "path",
644
+ {
645
+ stroke: "currentColor",
646
+ strokeLinecap: "round",
647
+ strokeLinejoin: "round",
648
+ strokeWidth: "2",
649
+ d: "m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
650
+ }
651
+ )
543
652
  }
544
- )
545
- }
546
- ),
547
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
548
- ] })
549
- ] }),
550
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react4.Description, { className: "flex-1 min-h-0 overflow-y-auto", children }),
551
- actions ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b justify-end", children: actions }) : null
552
- ] }) }) })
553
- ] }) });
653
+ ),
654
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Close" })
655
+ ] })
656
+ ] }),
657
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto flex flex-col", children }),
658
+ actions ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b justify-end", children: actions }) : null
659
+ ] }) }) })
660
+ ]
661
+ }
662
+ ) });
554
663
  }
555
664
 
556
665
  // src/ControlButton.tsx
557
- var import_jsx_runtime14 = require("react/jsx-runtime");
666
+ var import_jsx_runtime15 = require("react/jsx-runtime");
558
667
  function ControlButton({
559
668
  children,
560
669
  className: className2,
561
670
  ...props
562
671
  }) {
563
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
672
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
564
673
  "button",
565
674
  {
566
675
  className: cn(
@@ -574,9 +683,9 @@ function ControlButton({
574
683
  }
575
684
 
576
685
  // src/OpaqueControls.tsx
577
- var import_jsx_runtime15 = require("react/jsx-runtime");
686
+ var import_jsx_runtime16 = require("react/jsx-runtime");
578
687
  function OpaqueControls(props) {
579
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
688
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
580
689
  "div",
581
690
  {
582
691
  className: cn("flex w-full p-0.5 opacity-0 transition-opacity duration-300 gap-2", props.active && "opacity-1"),
@@ -587,9 +696,9 @@ function OpaqueControls(props) {
587
696
 
588
697
  // src/Tabs.tsx
589
698
  var import_react_aria_components3 = require("react-aria-components");
590
- var import_jsx_runtime16 = require("react/jsx-runtime");
699
+ var import_jsx_runtime17 = require("react/jsx-runtime");
591
700
  function Tabs({ className: className2, children, ...props }) {
592
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
701
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
593
702
  import_react_aria_components3.Tabs,
594
703
  {
595
704
  className: (state) => {
@@ -606,7 +715,7 @@ function TabList({
606
715
  children,
607
716
  ...props
608
717
  }) {
609
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
718
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
610
719
  import_react_aria_components3.TabList,
611
720
  {
612
721
  className: (state) => {
@@ -619,7 +728,7 @@ function TabList({
619
728
  );
620
729
  }
621
730
  function Tab({ className: className2, children, ...props }) {
622
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
731
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
623
732
  import_react_aria_components3.Tab,
624
733
  {
625
734
  className: (state) => {
@@ -637,7 +746,7 @@ function Tab({ className: className2, children, ...props }) {
637
746
  );
638
747
  }
639
748
  function TabPanel({ className: className2, children, ...props }) {
640
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
749
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
641
750
  import_react_aria_components3.TabPanel,
642
751
  {
643
752
  className: (state) => {
@@ -652,43 +761,43 @@ function TabPanel({ className: className2, children, ...props }) {
652
761
 
653
762
  // src/CreatorGrid.tsx
654
763
  var import_react_aria_components4 = require("react-aria-components");
655
- var import_tailwind_merge3 = require("tailwind-merge");
656
- var import_jsx_runtime17 = require("react/jsx-runtime");
764
+ var import_tailwind_merge5 = require("tailwind-merge");
765
+ var import_jsx_runtime18 = require("react/jsx-runtime");
657
766
  function CreatorGrid(props) {
658
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
767
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
659
768
  import_react_aria_components4.ListBox,
660
769
  {
661
770
  orientation: "horizontal",
662
771
  "aria-label": props.label,
663
772
  selectionMode: "single",
664
773
  items: props.items,
665
- className: "grid grid-sm gap-4 p-4",
666
- children: (item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CreatorGridItem, { ...item })
774
+ className: "grid grid-sm gap-4 p-4 mb-8",
775
+ children: (item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CreatorGridItem, { ...item })
667
776
  }
668
777
  );
669
778
  }
670
779
  function CreatorGridItem(props) {
671
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
780
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
672
781
  import_react_aria_components4.ListBoxItem,
673
782
  {
674
783
  id: props.id,
675
784
  onAction: props.onClick,
676
- className: ($s) => (0, import_tailwind_merge3.twMerge)(
785
+ className: ($s) => (0, import_tailwind_merge5.twMerge)(
677
786
  "bg-white p-2 border-me-gray-300 rounded-md border hover:border-me-primary-500",
678
787
  $s.isFocused && "border-me-primary-500 outline-me-primary-500 outline-2"
679
788
  ),
680
789
  children: [
681
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "rounded bg-me-gray-300 mb-2 flex items-center justify-center py-1", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-center [&>svg]:w-16 [&>svg]:h-16", children: props.icon }) }),
682
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-center font-semibold text-sm", children: props.title }),
683
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-sm text-center text-black/50", children: props.description })
790
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "rounded bg-me-gray-300 mb-2 flex items-center justify-center py-1 aspect-square", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-center [&>svg]:w-16 [&>svg]:h-16", children: props.icon }) }),
791
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-center font-semibold text-sm", children: props.title }),
792
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm text-center text-black/50", children: props.description })
684
793
  ]
685
794
  }
686
795
  );
687
796
  }
688
797
 
689
798
  // src/icons/DownloadIcon.tsx
690
- var import_jsx_runtime18 = require("react/jsx-runtime");
691
- var DownloadIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
799
+ var import_jsx_runtime19 = require("react/jsx-runtime");
800
+ var DownloadIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
692
801
  "path",
693
802
  {
694
803
  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",
@@ -698,10 +807,10 @@ var DownloadIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg
698
807
 
699
808
  // src/DownloadButton.tsx
700
809
  var import_react_aria = require("react-aria");
701
- var import_jsx_runtime19 = require("react/jsx-runtime");
810
+ var import_jsx_runtime20 = require("react/jsx-runtime");
702
811
  function DownloadButton({ label, id: _id, getData, fileName, fileType }) {
703
812
  const id = (0, import_react_aria.useId)(_id);
704
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Tooltip, { placement: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
813
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Tooltip, { placement: "bottom", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
705
814
  TooltipTrigger,
706
815
  {
707
816
  className: "bg-me-gray-100 hover:bg-me-primary-500 hover:text-white p-1 rounded-md text-me-primary-500 text-2xl",
@@ -709,8 +818,8 @@ function DownloadButton({ label, id: _id, getData, fileName, fileType }) {
709
818
  id,
710
819
  onPress: () => createDownload(getData(), fileName, fileType),
711
820
  children: [
712
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DownloadIcon, { "aria-labelledby": _id }),
713
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DefaultTooltipContent, { children: label })
821
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DownloadIcon, { "aria-labelledby": _id }),
822
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DefaultTooltipContent, { children: label })
714
823
  ]
715
824
  }
716
825
  ) });
@@ -730,11 +839,11 @@ function createDownload(data, fileName, fileType = "text/json") {
730
839
  }
731
840
 
732
841
  // src/AtlasBanner.tsx
733
- var import_jsx_runtime20 = require("react/jsx-runtime");
842
+ var import_jsx_runtime21 = require("react/jsx-runtime");
734
843
  function AtlasBanner({ children, controlsId }) {
735
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "bg-me-gray-100 border-b text-black p-1 flex gap-4 items-center h-12", children: [
736
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "px-4", children }),
737
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { id: controlsId || "atlas-controls", className: "flex gap-2" })
844
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "bg-me-gray-100 border-b text-black p-1 flex gap-4 items-center h-12", children: [
845
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "px-4", children }),
846
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { id: controlsId || "atlas-controls", className: "flex gap-2" })
738
847
  ] });
739
848
  }
740
849
 
@@ -742,8 +851,8 @@ function AtlasBanner({ children, controlsId }) {
742
851
  var import_react_iiif_vault4 = require("react-iiif-vault");
743
852
 
744
853
  // src/icons/DrawIcon.tsx
745
- var import_jsx_runtime21 = require("react/jsx-runtime");
746
- var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
854
+ var import_jsx_runtime22 = require("react/jsx-runtime");
855
+ var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
747
856
  "svg",
748
857
  {
749
858
  xmlns: "http://www.w3.org/2000/svg",
@@ -753,8 +862,8 @@ var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_
753
862
  "aria-labelledby": titleId,
754
863
  ...props,
755
864
  children: [
756
- title ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("title", { id: titleId, children: title }) : null,
757
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
865
+ title ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("title", { id: titleId, children: title }) : null,
866
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
758
867
  "path",
759
868
  {
760
869
  fill: "currentColor",
@@ -766,8 +875,8 @@ var DrawIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_
766
875
  );
767
876
 
768
877
  // src/icons/PolygonIcon.tsx
769
- var import_jsx_runtime22 = require("react/jsx-runtime");
770
- var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
878
+ var import_jsx_runtime23 = require("react/jsx-runtime");
879
+ var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
771
880
  "svg",
772
881
  {
773
882
  xmlns: "http://www.w3.org/2000/svg",
@@ -777,8 +886,8 @@ var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_j
777
886
  "aria-labelledby": titleId,
778
887
  ...props,
779
888
  children: [
780
- title ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("title", { id: titleId, children: title }) : null,
781
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
889
+ title ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("title", { id: titleId, children: title }) : null,
890
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
782
891
  "path",
783
892
  {
784
893
  fill: "currentColor",
@@ -790,34 +899,34 @@ var PolygonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_j
790
899
  );
791
900
 
792
901
  // src/icons/LineIcon.tsx
793
- var import_jsx_runtime23 = require("react/jsx-runtime");
902
+ var import_jsx_runtime24 = require("react/jsx-runtime");
794
903
  function LineIcon({ title, titleId, ...props }) {
795
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
796
- title ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("title", { id: titleId, children: title }) : null,
797
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
798
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: 4.5, cy: 4.5, r: 2.5, fill: "currentColor" }),
799
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: 15.5, cy: 15.5, r: 2.5, fill: "currentColor" }),
800
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m13.5 13.5-9-9" })
904
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
905
+ title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("title", { id: titleId, children: title }) : null,
906
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
907
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: 4.5, cy: 4.5, r: 2.5, fill: "currentColor" }),
908
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("circle", { cx: 15.5, cy: 15.5, r: 2.5, fill: "currentColor" }),
909
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m13.5 13.5-9-9" })
801
910
  ] })
802
911
  ] });
803
912
  }
804
913
 
805
914
  // src/icons/LineBoxIcon.tsx
806
- var import_jsx_runtime24 = require("react/jsx-runtime");
915
+ var import_jsx_runtime25 = require("react/jsx-runtime");
807
916
  function LineBoxIcon({ title, titleId, ...props }) {
808
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
809
- title ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("title", { id: titleId, children: title }) : null,
810
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
811
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { d: "M0 0h20v20H0z" }),
812
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m8.5 11.5 6-6M16 4v3m0-3h-3m0 14L2 7" }),
813
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("path", { stroke: "currentColor", strokeOpacity: 0.407, strokeWidth: 2, d: "m2 7 5-5 11 11-5 5z" })
917
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", "aria-labelledby": titleId, ...props, children: [
918
+ title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("title", { id: titleId, children: title }) : null,
919
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("g", { fill: "none", fillRule: "evenodd", children: [
920
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M0 0h20v20H0z" }),
921
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { stroke: "currentColor", strokeLinecap: "square", strokeWidth: 2, d: "m8.5 11.5 6-6M16 4v3m0-3h-3m0 14L2 7" }),
922
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { stroke: "currentColor", strokeOpacity: 0.407, strokeWidth: 2, d: "m2 7 5-5 11 11-5 5z" })
814
923
  ] })
815
924
  ] });
816
925
  }
817
926
 
818
927
  // src/icons/ShapesIcon.tsx
819
- var import_jsx_runtime25 = require("react/jsx-runtime");
820
- var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
928
+ var import_jsx_runtime26 = require("react/jsx-runtime");
929
+ var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
821
930
  "svg",
822
931
  {
823
932
  xmlns: "http://www.w3.org/2000/svg",
@@ -827,8 +936,8 @@ var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_js
827
936
  "aria-labelledby": titleId,
828
937
  ...props,
829
938
  children: [
830
- title ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("title", { id: titleId, children: title }) : null,
831
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
939
+ title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("title", { id: titleId, children: title }) : null,
940
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
832
941
  "path",
833
942
  {
834
943
  fill: "currentColor",
@@ -840,8 +949,8 @@ var ShapesIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_js
840
949
  );
841
950
 
842
951
  // src/icons/SquareIcon.tsx
843
- var import_jsx_runtime26 = require("react/jsx-runtime");
844
- var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
952
+ var import_jsx_runtime27 = require("react/jsx-runtime");
953
+ var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
845
954
  "svg",
846
955
  {
847
956
  xmlns: "http://www.w3.org/2000/svg",
@@ -851,8 +960,8 @@ var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_js
851
960
  "aria-labelledby": titleId,
852
961
  ...props,
853
962
  children: [
854
- title ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("title", { id: titleId, children: title }) : null,
855
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
963
+ title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("title", { id: titleId, children: title }) : null,
964
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
856
965
  "path",
857
966
  {
858
967
  fill: "currentColor",
@@ -864,8 +973,8 @@ var SquareIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_js
864
973
  );
865
974
 
866
975
  // src/icons/TriangleIcon.tsx
867
- var import_jsx_runtime27 = require("react/jsx-runtime");
868
- var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
976
+ var import_jsx_runtime28 = require("react/jsx-runtime");
977
+ var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
869
978
  "svg",
870
979
  {
871
980
  xmlns: "http://www.w3.org/2000/svg",
@@ -875,15 +984,15 @@ var TriangleIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_
875
984
  "aria-labelledby": titleId,
876
985
  ...props,
877
986
  children: [
878
- title ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("title", { id: titleId, children: title }) : null,
879
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { d: "m80-160 400-640 400 640H80Zm144-80h512L480-650 224-240Zm256-205Z", fill: "currentColor" })
987
+ title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("title", { id: titleId, children: title }) : null,
988
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "m80-160 400-640 400 640H80Zm144-80h512L480-650 224-240Zm256-205Z", fill: "currentColor" })
880
989
  ]
881
990
  }
882
991
  );
883
992
 
884
993
  // src/icons/HexagonIcon.tsx
885
- var import_jsx_runtime28 = require("react/jsx-runtime");
886
- var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
994
+ var import_jsx_runtime29 = require("react/jsx-runtime");
995
+ var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
887
996
  "svg",
888
997
  {
889
998
  xmlns: "http://www.w3.org/2000/svg",
@@ -893,8 +1002,8 @@ var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_j
893
1002
  "aria-labelledby": titleId,
894
1003
  ...props,
895
1004
  children: [
896
- title ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("title", { id: titleId, children: title }) : null,
897
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
1005
+ title ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("title", { id: titleId, children: title }) : null,
1006
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
898
1007
  "path",
899
1008
  {
900
1009
  fill: "currentColor",
@@ -906,12 +1015,12 @@ var HexagonIcon = ({ title, titleId, ...props }) => /* @__PURE__ */ (0, import_j
906
1015
  );
907
1016
 
908
1017
  // src/icons/DeleteForeverIcon.tsx
909
- var import_jsx_runtime29 = require("react/jsx-runtime");
1018
+ var import_jsx_runtime30 = require("react/jsx-runtime");
910
1019
  function DeleteForeverIcon(props) {
911
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("svg", { height: "1em", width: "1em", viewBox: "0 0 24 24", ...props, children: [
912
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
913
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
914
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1020
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("svg", { height: "1em", width: "1em", viewBox: "0 0 24 24", ...props, children: [
1021
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
1022
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
1023
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
915
1024
  "path",
916
1025
  {
917
1026
  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",
@@ -923,18 +1032,18 @@ function DeleteForeverIcon(props) {
923
1032
 
924
1033
  // src/SvgControlBar.tsx
925
1034
  var import_react5 = require("react");
926
- var import_jsx_runtime30 = require("react/jsx-runtime");
1035
+ var import_jsx_runtime31 = require("react/jsx-runtime");
927
1036
  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';
928
1037
  var icons = {
929
- DrawIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DrawIcon, {}),
930
- PolygonIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(PolygonIcon, {}),
931
- LineIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LineIcon, {}),
932
- LineBoxIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(LineBoxIcon, {}),
933
- ShapesIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ShapesIcon, {}),
934
- SquareIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(SquareIcon, {}),
935
- TriangleIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TriangleIcon, {}),
936
- HexagonIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(HexagonIcon, {}),
937
- DeleteForeverIcon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DeleteForeverIcon, {})
1038
+ DrawIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DrawIcon, {}),
1039
+ PolygonIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PolygonIcon, {}),
1040
+ LineIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LineIcon, {}),
1041
+ LineBoxIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LineBoxIcon, {}),
1042
+ ShapesIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ShapesIcon, {}),
1043
+ SquareIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SquareIcon, {}),
1044
+ TriangleIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(TriangleIcon, {}),
1045
+ HexagonIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(HexagonIcon, {}),
1046
+ DeleteForeverIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DeleteForeverIcon, {})
938
1047
  };
939
1048
  function SvgControlBar({
940
1049
  helper,
@@ -944,7 +1053,7 @@ function SvgControlBar({
944
1053
  (0, import_react5.useEffect)(() => {
945
1054
  helper.stamps.square();
946
1055
  }, []);
947
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
1056
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
948
1057
  import_react_iiif_vault4.RenderSvgEditorControls,
949
1058
  {
950
1059
  icons,
@@ -960,17 +1069,17 @@ function SvgControlBar({
960
1069
 
961
1070
  // src/ConfirmSelectionButton.tsx
962
1071
  var import_react_aria_components5 = require("react-aria-components");
963
- var import_jsx_runtime31 = require("react/jsx-runtime");
1072
+ var import_jsx_runtime32 = require("react/jsx-runtime");
964
1073
  function ConfirmSelectionButton({ onPress, children }) {
965
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_aria_components5.Button, { className: "bg-me-primary-500 px-3 py-1 hover:bg-me-primary-600 text-white rounded", onPress, children });
1074
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components5.Button, { className: "bg-me-primary-500 px-3 py-1 hover:bg-me-primary-600 text-white rounded", onPress, children });
966
1075
  }
967
1076
 
968
1077
  // src/ManifestOverviewEmptyState.tsx
969
1078
  var import_react_aria_components6 = require("react-aria-components");
970
- var import_jsx_runtime32 = require("react/jsx-runtime");
1079
+ var import_jsx_runtime33 = require("react/jsx-runtime");
971
1080
  function ManifestOverviewEmptyState({ onCreate, canCreate }) {
972
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center flex-col gap-5 py-16", children: [
973
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1081
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center flex-col gap-5 py-16", children: [
1082
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
974
1083
  Card3D,
975
1084
  {
976
1085
  shouldTranslate: true,
@@ -978,9 +1087,9 @@ function ManifestOverviewEmptyState({ onCreate, canCreate }) {
978
1087
  className: "border-2 border-dotted bg-black/5 aspect-[3/4] rounded w-32 border-black"
979
1088
  }
980
1089
  ),
981
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "font-bold text-lg", children: "Good to go!" }),
982
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "max-w-xl px-5", children: "Add a title and top level information for this manifest using the editing panel, and then add some canvases and content." }),
983
- canCreate ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
1090
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "font-bold text-lg", children: "Let's get started!" }),
1091
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("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." }),
1092
+ canCreate ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
984
1093
  import_react_aria_components6.Button,
985
1094
  {
986
1095
  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",
@@ -995,13 +1104,23 @@ function ManifestOverviewEmptyState({ onCreate, canCreate }) {
995
1104
  var import_react6 = require("react");
996
1105
  var import_react_aria_components7 = require("react-aria-components");
997
1106
  var import_collections = require("@react-aria/collections");
998
- var import_jsx_runtime33 = require("react/jsx-runtime");
999
- function SidebarTabs({ menu, menuId, selectedKey, onSelectionChange }) {
1107
+ var import_react_dom = require("react-dom");
1108
+ var import_jsx_runtime34 = require("react/jsx-runtime");
1109
+ function SidebarTabs({
1110
+ menu,
1111
+ menuId,
1112
+ selectedKey,
1113
+ onSelectionChange
1114
+ }) {
1000
1115
  const ref = (0, import_react6.useRef)(null);
1001
1116
  const [hidden, setHidden] = (0, import_react6.useState)(0);
1117
+ const [hiddenMenu, setHiddenMenu] = (0, import_react6.useState)(null);
1002
1118
  const widths = (0, import_react6.useRef)([]);
1003
1119
  const itemsRef = (0, import_react6.useRef)([]);
1004
- const selectedIndex = (0, import_react6.useMemo)(() => menu.findIndex((item) => item.id === selectedKey), [menu, selectedKey]);
1120
+ const selectedIndex = (0, import_react6.useMemo)(
1121
+ () => menu.findIndex((item) => item.id === selectedKey),
1122
+ [menu, selectedKey]
1123
+ );
1005
1124
  (0, import_react6.useLayoutEffect)(() => {
1006
1125
  const cb = () => {
1007
1126
  if (widths.current.length === 0) {
@@ -1035,53 +1154,74 @@ function SidebarTabs({ menu, menuId, selectedKey, onSelectionChange }) {
1035
1154
  };
1036
1155
  }, []);
1037
1156
  const menuHidden = menu.filter((item, idx) => hidden >= menu.length - idx);
1038
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
1039
- import_react_aria_components7.Tabs,
1040
- {
1041
- className: "w-full flex-1 overflow-hidden flex flex-col",
1042
- selectedKey,
1043
- onSelectionChange,
1044
- children: [
1045
- /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center w-full tab-shadow", children: [
1046
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.TabList, { ref, className: "flex-1 overflow-hidden w-full flex text-sm whitespace-nowrap", children: menu.map((item, idx) => {
1047
- const isHidden = hidden >= menu.length - idx;
1048
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1049
- import_react_aria_components7.Tab,
1157
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
1158
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
1159
+ import_react_aria_components7.Tabs,
1160
+ {
1161
+ className: "w-full flex-1 overflow-hidden flex flex-col",
1162
+ selectedKey,
1163
+ onSelectionChange,
1164
+ children: [
1165
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center w-full tab-shadow", children: [
1166
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1167
+ import_react_aria_components7.TabList,
1050
1168
  {
1051
- ref: (el) => itemsRef.current[idx] = el,
1052
- id: item.id,
1053
- className: (state) => cn(
1054
- //
1055
- "border-b-2 px-2 py-1 text-sm text-gray-400 select-none hover:text-black focus:ring-0 focus:outline-none",
1056
- state.isSelected && "border-me-primary-500 text-black",
1057
- state.isFocusVisible && "ring-0 bg-me-gray-100",
1058
- isHidden && "hidden"
1059
- ),
1060
- children: item.label
1061
- },
1062
- item.id
1063
- );
1064
- }) }),
1065
- hidden > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1066
- MoreMenu,
1169
+ ref,
1170
+ className: "flex-1 overflow-hidden w-full flex text-sm whitespace-nowrap",
1171
+ children: menu.map((item, idx) => {
1172
+ const isHidden = hidden >= menu.length - idx;
1173
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1174
+ import_react_aria_components7.Tab,
1175
+ {
1176
+ ref: (el) => itemsRef.current[idx] = el,
1177
+ id: item.id,
1178
+ className: (state) => cn(
1179
+ //
1180
+ "border-b-2 px-2 py-1 text-sm text-gray-400 select-none hover:text-black focus:ring-0 focus:outline-none",
1181
+ state.isSelected && "border-me-primary-500 text-black",
1182
+ state.isFocusVisible && "ring-0 bg-me-gray-100",
1183
+ isHidden && "hidden"
1184
+ ),
1185
+ children: item.label
1186
+ },
1187
+ item.id
1188
+ );
1189
+ })
1190
+ }
1191
+ ),
1192
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: setHiddenMenu, id: "hidden-menu" })
1193
+ ] }),
1194
+ menu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1195
+ import_react_aria_components7.TabPanel,
1067
1196
  {
1068
- hidden,
1069
- menuHidden,
1070
- selectedIndex,
1071
- selectedKey,
1072
- onSelectionChange
1073
- }
1074
- )
1075
- ] }),
1076
- menu.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.TabPanel, { id: item.id, className: "flex-1 overflow-y-auto h-full", children: item.renderComponent }, item.id))
1077
- ]
1078
- },
1079
- menuId
1080
- );
1197
+ id: item.id,
1198
+ className: "flex-1 overflow-y-auto h-full",
1199
+ children: item.renderComponent
1200
+ },
1201
+ item.id
1202
+ ))
1203
+ ]
1204
+ },
1205
+ menuId
1206
+ ),
1207
+ hiddenMenu && hidden > 0 ? (0, import_react_dom.createPortal)(
1208
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1209
+ MoreMenu,
1210
+ {
1211
+ hidden,
1212
+ menuHidden,
1213
+ selectedIndex,
1214
+ selectedKey,
1215
+ onSelectionChange
1216
+ }
1217
+ ),
1218
+ hiddenMenu
1219
+ ) : null
1220
+ ] });
1081
1221
  }
1082
1222
  var MoreMenu = (0, import_collections.createHideableComponent)(({ selectedIndex, hidden, menuHidden, selectedKey, onSelectionChange }) => {
1083
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_aria_components7.MenuTrigger, { children: [
1084
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1223
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_aria_components7.MenuTrigger, { children: [
1224
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1085
1225
  import_react_aria_components7.Button,
1086
1226
  {
1087
1227
  className: cn(
@@ -1091,33 +1231,39 @@ var MoreMenu = (0, import_collections.createHideableComponent)(({ selectedIndex,
1091
1231
  children: "MORE"
1092
1232
  }
1093
1233
  ),
1094
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.Popover, { children: menuHidden.length ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_aria_components7.Menu, { className: "bg-white rounded shadow-lg flex flex-col gap-0.5 p-0.5 min-w-28", children: menuHidden.map((item, idx) => {
1095
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
1096
- import_react_aria_components7.MenuItem,
1097
- {
1098
- className: (state) => cn(
1099
- "hover:bg-me-gray-100 p-1 rounded-sm text-sm",
1100
- selectedKey === item.id && "ring ring-me-primary-500"
1101
- ),
1102
- onAction: () => onSelectionChange?.(item.id),
1103
- children: item.label
1104
- },
1105
- item.id
1106
- );
1107
- }) }, menuHidden.length) : null })
1234
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_aria_components7.Popover, { children: menuHidden.length ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1235
+ import_react_aria_components7.Menu,
1236
+ {
1237
+ className: "bg-white rounded shadow-lg flex flex-col gap-0.5 p-0.5 min-w-28",
1238
+ children: menuHidden.map((item) => {
1239
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
1240
+ import_react_aria_components7.MenuItem,
1241
+ {
1242
+ className: (state) => cn(
1243
+ "hover:bg-me-gray-100 p-1 rounded-sm text-sm",
1244
+ selectedKey === item.id && "ring ring-me-primary-500"
1245
+ ),
1246
+ onAction: () => onSelectionChange?.(item.id),
1247
+ children: item.label
1248
+ },
1249
+ item.id
1250
+ );
1251
+ })
1252
+ }
1253
+ ) : null })
1108
1254
  ] });
1109
1255
  });
1110
1256
 
1111
1257
  // src/MetadataContainer.tsx
1112
1258
  var import_react_iiif_vault5 = require("react-iiif-vault");
1113
- var import_jsx_runtime34 = require("react/jsx-runtime");
1259
+ var import_jsx_runtime35 = require("react/jsx-runtime");
1114
1260
  function MetadataContainer({
1115
1261
  className: className2,
1116
1262
  label,
1117
1263
  children,
1118
1264
  ...props
1119
1265
  }) {
1120
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
1266
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
1121
1267
  "div",
1122
1268
  {
1123
1269
  className: cn(
@@ -1126,7 +1272,7 @@ function MetadataContainer({
1126
1272
  ),
1127
1273
  ...props,
1128
1274
  children: [
1129
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_iiif_vault5.LocaleString, { className: "text-lg font-bold text-[#333] mb-2", as: "h3", children: label }),
1275
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_iiif_vault5.LocaleString, { className: "text-lg font-bold text-[#333] mb-2", as: "h3", children: label }),
1130
1276
  children
1131
1277
  ]
1132
1278
  }
@@ -1134,9 +1280,9 @@ function MetadataContainer({
1134
1280
  }
1135
1281
 
1136
1282
  // src/EmptyState.tsx
1137
- var import_jsx_runtime35 = require("react/jsx-runtime");
1283
+ var import_jsx_runtime36 = require("react/jsx-runtime");
1138
1284
  function EmptyState(props) {
1139
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
1285
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
1140
1286
  "div",
1141
1287
  {
1142
1288
  className: cn(
@@ -1150,9 +1296,9 @@ function EmptyState(props) {
1150
1296
  }
1151
1297
 
1152
1298
  // src/ManifestEditorLogo.tsx
1153
- var import_jsx_runtime36 = require("react/jsx-runtime");
1299
+ var import_jsx_runtime37 = require("react/jsx-runtime");
1154
1300
  function ManifestEditorLogo(props) {
1155
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
1301
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1156
1302
  "svg",
1157
1303
  {
1158
1304
  width: "1em",
@@ -1161,17 +1307,17 @@ function ManifestEditorLogo(props) {
1161
1307
  xmlns: "http://www.w3.org/2000/svg",
1162
1308
  className: "me-logo h-[23px] w-[176px]",
1163
1309
  ...props,
1164
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("g", { fill: "none", children: [
1165
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
1310
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("g", { fill: "none", children: [
1311
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1166
1312
  "path",
1167
1313
  {
1168
1314
  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",
1169
1315
  fill: "#000"
1170
1316
  }
1171
1317
  ),
1172
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { fill: "#E94581", className: "me-logo-1", d: "M0 13.343 13.343 0l13.343 13.343-13.343 13.343z" }),
1173
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { fill: "#E94581", className: "me-logo-2", d: "M12.137 13.346 25.48.003l13.343 13.343L25.48 26.69z" }),
1174
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { fill: "#C63E75", className: "me-logo-3", d: "m12.104 13.348 7.311-7.311 7.312 7.311-7.312 7.312z" })
1318
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { fill: "#E94581", className: "me-logo-1", d: "M0 13.343 13.343 0l13.343 13.343-13.343 13.343z" }),
1319
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { fill: "#E94581", className: "me-logo-2", d: "M12.137 13.346 25.48.003l13.343 13.343L25.48 26.69z" }),
1320
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { fill: "#C63E75", className: "me-logo-3", d: "m12.104 13.348 7.311-7.311 7.312 7.311-7.312 7.312z" })
1175
1321
  ] })
1176
1322
  }
1177
1323
  );
@@ -1179,9 +1325,9 @@ function ManifestEditorLogo(props) {
1179
1325
 
1180
1326
  // src/Forms.tsx
1181
1327
  var import_react_aria_components8 = require("react-aria-components");
1182
- var import_jsx_runtime37 = require("react/jsx-runtime");
1328
+ var import_jsx_runtime38 = require("react/jsx-runtime");
1183
1329
  function MeLabel({ className: className2, ...props }) {
1184
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1330
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1185
1331
  import_react_aria_components8.Label,
1186
1332
  {
1187
1333
  className: cn(
@@ -1194,7 +1340,7 @@ function MeLabel({ className: className2, ...props }) {
1194
1340
  );
1195
1341
  }
1196
1342
  function MeRadioGroup({ className: className2, ...props }) {
1197
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1343
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1198
1344
  import_react_aria_components8.RadioGroup,
1199
1345
  {
1200
1346
  className: cn(
@@ -1207,7 +1353,7 @@ function MeRadioGroup({ className: className2, ...props }) {
1207
1353
  );
1208
1354
  }
1209
1355
  function MeRadio({ className: className2, ...props }) {
1210
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1356
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1211
1357
  import_react_aria_components8.Radio,
1212
1358
  {
1213
1359
  className: (state) => cn(
@@ -1220,7 +1366,7 @@ function MeRadio({ className: className2, ...props }) {
1220
1366
  );
1221
1367
  }
1222
1368
  function MeForm({ className: className2, ...props }) {
1223
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1369
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1224
1370
  import_react_aria_components8.Form,
1225
1371
  {
1226
1372
  className: cn(
@@ -1233,7 +1379,7 @@ function MeForm({ className: className2, ...props }) {
1233
1379
  );
1234
1380
  }
1235
1381
  function MeInput({ className: className2, ...props }) {
1236
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1382
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1237
1383
  import_react_aria_components8.Input,
1238
1384
  {
1239
1385
  className: cn(
@@ -1251,7 +1397,7 @@ function MeInputContainer({
1251
1397
  className: className2,
1252
1398
  ...props
1253
1399
  }) {
1254
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
1400
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1255
1401
  "div",
1256
1402
  {
1257
1403
  className: cn(
@@ -1273,12 +1419,172 @@ var Form = {
1273
1419
  Radio: MeRadio
1274
1420
  };
1275
1421
 
1422
+ // src/HTMLEditor.tsx
1423
+ var import_react8 = require("react");
1424
+ var import_showdown = require("showdown");
1425
+ var import_tiny_use_debounce = require("tiny-use-debounce");
1426
+ var import_turndown = __toESM(require("turndown"), 1);
1427
+
1428
+ // src/MDXEditor.tsx
1429
+ var import_style = require("@mdxeditor/editor/style.css");
1430
+ var import_editor = require("@mdxeditor/editor");
1431
+ var import_react7 = require("react");
1432
+ var import_jsx_runtime39 = require("react/jsx-runtime");
1433
+ function MDXEditor({
1434
+ editorRef,
1435
+ ...props
1436
+ }) {
1437
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
1438
+ import_editor.MDXEditor,
1439
+ {
1440
+ plugins: (0, import_react7.useMemo)(
1441
+ () => [
1442
+ // Example Plugin Usage
1443
+ (0, import_editor.headingsPlugin)(),
1444
+ (0, import_editor.listsPlugin)(),
1445
+ (0, import_editor.linkPlugin)(),
1446
+ (0, import_editor.quotePlugin)(),
1447
+ (0, import_editor.thematicBreakPlugin)(),
1448
+ (0, import_editor.headingsPlugin)(),
1449
+ // linkDialogPlugin(),
1450
+ (0, import_editor.markdownShortcutPlugin)(),
1451
+ (0, import_editor.imagePlugin)(),
1452
+ (0, import_editor.toolbarPlugin)({
1453
+ toolbarClassName: "mdx-toolbar",
1454
+ toolbarContents: () => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
1455
+ " ",
1456
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor.UndoRedo, {}),
1457
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor.BlockTypeSelect, {}),
1458
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor.ListsToggle, {}),
1459
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor.InsertImage, {})
1460
+ ] })
1461
+ })
1462
+ ],
1463
+ []
1464
+ ),
1465
+ ...props,
1466
+ ref: editorRef
1467
+ }
1468
+ );
1469
+ }
1470
+
1471
+ // src/HTMLEditor.tsx
1472
+ var import_jsx_runtime40 = require("react/jsx-runtime");
1473
+ var converter = new import_showdown.Converter();
1474
+ converter.setFlavor("github");
1475
+ var turndownService = new import_turndown.default();
1476
+ function HTMLEditor({
1477
+ value,
1478
+ onChange,
1479
+ disabled
1480
+ }) {
1481
+ const editorRef = (0, import_react8.useRef)(null);
1482
+ const [_value, _setValue] = (0, import_react8.useState)(void 0);
1483
+ const internalOnChange = (0, import_react8.useCallback)(() => {
1484
+ if (editorRef.current) {
1485
+ onChange(converter.makeHtml(editorRef.current.getMarkdown()));
1486
+ }
1487
+ }, []);
1488
+ const debounceSave = (0, import_tiny_use_debounce.useDebounce)(internalOnChange, 400);
1489
+ const memoState = (0, import_react8.useMemo)(() => {
1490
+ return turndownService.turndown(value);
1491
+ }, []);
1492
+ (0, import_react8.useEffect)(() => {
1493
+ const ref = editorRef.current;
1494
+ return () => {
1495
+ if (ref) {
1496
+ onChange(converter.makeHtml(ref.getMarkdown()));
1497
+ }
1498
+ };
1499
+ }, []);
1500
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1501
+ MDXEditor,
1502
+ {
1503
+ editorRef,
1504
+ onBlur: internalOnChange,
1505
+ readOnly: disabled,
1506
+ className: "bg-white prose-sm text-sm border rounded-lg p-0.5 focus-within:outline-none focus-within:border-me-primary-500",
1507
+ markdown: memoState,
1508
+ suppressHtmlProcessing: true,
1509
+ onError: (err) => {
1510
+ console.log("err", err);
1511
+ },
1512
+ onChange: (value2) => {
1513
+ _setValue(value2);
1514
+ debounceSave();
1515
+ }
1516
+ }
1517
+ );
1518
+ }
1519
+
1520
+ // src/IconButton.tsx
1521
+ var import_tailwind_merge6 = require("tailwind-merge");
1522
+ var import_jsx_runtime41 = require("react/jsx-runtime");
1523
+ function IconButton({
1524
+ children,
1525
+ active,
1526
+ label,
1527
+ disabled,
1528
+ onPress
1529
+ }) {
1530
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Tooltip, { placement: "top", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
1531
+ TooltipTrigger,
1532
+ {
1533
+ onClick: onPress,
1534
+ className: (0, import_tailwind_merge6.twMerge)(
1535
+ "rounded flex items-center bg-white justify-center p-2 hover:bg-gray-100 text-2xl",
1536
+ active ? "bg-me-primary-500 bg-opacity-40 hover:bg-opacity-70 hover:bg-me-primary-500" : "",
1537
+ disabled ? "opacity-50 pointer-events-none" : ""
1538
+ ),
1539
+ children: [
1540
+ children,
1541
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DefaultTooltipContent, { className: "translate-x-3", children: label })
1542
+ ]
1543
+ }
1544
+ ) });
1545
+ }
1546
+
1547
+ // src/ItemWithHandle.tsx
1548
+ var import_jsx_runtime42 = require("react/jsx-runtime");
1549
+ function ItemWithHandle({
1550
+ children,
1551
+ handle,
1552
+ actions,
1553
+ grid
1554
+ }) {
1555
+ const gridStyleClassName = grid ? (
1556
+ // Tailwind
1557
+ "absolute flex p-1 gap-1 bg-white z-1 right-1 top-1 rounded"
1558
+ ) : "flex-shrink-0 flex items-center gap-1 px-1";
1559
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: grid ? "relative flex flex-col" : "flex items-center", children: [
1560
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-1 min-w-0", style: { flex: 1, minWidth: 0 }, children }),
1561
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: gridStyleClassName, children: [
1562
+ actions,
1563
+ handle
1564
+ ] })
1565
+ ] });
1566
+ }
1567
+
1568
+ // src/HandleContainer.tsx
1569
+ var import_react9 = require("react");
1570
+ var import_jsx_runtime43 = require("react/jsx-runtime");
1571
+ var HandleContainer = (0, import_react9.forwardRef)(function HandleContainer2({ className: className2, ...props }, ref) {
1572
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
1573
+ "div",
1574
+ {
1575
+ ref,
1576
+ 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 || ""}`,
1577
+ ...props
1578
+ }
1579
+ );
1580
+ });
1581
+
1276
1582
  // src/icons/CreateCanvasIcon.tsx
1277
- var import_jsx_runtime38 = require("react/jsx-runtime");
1583
+ var import_jsx_runtime44 = require("react/jsx-runtime");
1278
1584
  function CreateCanvasIcon() {
1279
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
1280
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
1281
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
1585
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", children: [
1586
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M0 0h24v24H0V0z", fill: "none" }),
1587
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
1282
1588
  "path",
1283
1589
  {
1284
1590
  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",
@@ -1289,8 +1595,8 @@ function CreateCanvasIcon() {
1289
1595
  }
1290
1596
 
1291
1597
  // src/icons/AddImageIcon.tsx
1292
- var import_jsx_runtime39 = require("react/jsx-runtime");
1293
- var AddImageIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
1598
+ var import_jsx_runtime45 = require("react/jsx-runtime");
1599
+ var AddImageIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
1294
1600
  "path",
1295
1601
  {
1296
1602
  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",
@@ -1299,8 +1605,8 @@ var AddImageIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg
1299
1605
  ) });
1300
1606
 
1301
1607
  // src/icons/IIIFLogo.tsx
1302
- var import_jsx_runtime40 = require("react/jsx-runtime");
1303
- var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
1608
+ var import_jsx_runtime46 = require("react/jsx-runtime");
1609
+ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
1304
1610
  "svg",
1305
1611
  {
1306
1612
  xmlns: "http://www.w3.org/2000/svg",
@@ -1310,7 +1616,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_run
1310
1616
  ...props,
1311
1617
  viewBox: "0 0 493.36 441.333",
1312
1618
  children: [
1313
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1619
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1314
1620
  "path",
1315
1621
  {
1316
1622
  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",
@@ -1323,7 +1629,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_run
1323
1629
  transform: "matrix(.13333 0 0 -.13333 0 441.333)"
1324
1630
  }
1325
1631
  ),
1326
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1632
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1327
1633
  "path",
1328
1634
  {
1329
1635
  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",
@@ -1336,7 +1642,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_run
1336
1642
  transform: "matrix(.13333 0 0 -.13333 0 441.333)"
1337
1643
  }
1338
1644
  ),
1339
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1645
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1340
1646
  "path",
1341
1647
  {
1342
1648
  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",
@@ -1349,7 +1655,7 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_run
1349
1655
  transform: "matrix(.13333 0 0 -.13333 0 441.333)"
1350
1656
  }
1351
1657
  ),
1352
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
1658
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1353
1659
  "path",
1354
1660
  {
1355
1661
  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",
@@ -1367,8 +1673,8 @@ var IIIFLogo = ({ mono = true, ...props }) => /* @__PURE__ */ (0, import_jsx_run
1367
1673
  );
1368
1674
 
1369
1675
  // src/icons/HTMLIcon.tsx
1370
- var import_jsx_runtime41 = require("react/jsx-runtime");
1371
- var HTMLIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
1676
+ var import_jsx_runtime47 = require("react/jsx-runtime");
1677
+ var HTMLIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
1372
1678
  "path",
1373
1679
  {
1374
1680
  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",
@@ -1377,8 +1683,8 @@ var HTMLIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", {
1377
1683
  ) });
1378
1684
 
1379
1685
  // src/icons/IIIFBrowserIcon.tsx
1380
- var import_jsx_runtime42 = require("react/jsx-runtime");
1381
- var IIIFBrowserIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
1686
+ var import_jsx_runtime48 = require("react/jsx-runtime");
1687
+ var IIIFBrowserIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
1382
1688
  "path",
1383
1689
  {
1384
1690
  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",
@@ -1387,8 +1693,8 @@ var IIIFBrowserIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("
1387
1693
  ) });
1388
1694
 
1389
1695
  // src/icons/YouTubeIcon.tsx
1390
- var import_jsx_runtime43 = require("react/jsx-runtime");
1391
- var YouTubeIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
1696
+ var import_jsx_runtime49 = require("react/jsx-runtime");
1697
+ var YouTubeIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
1392
1698
  "path",
1393
1699
  {
1394
1700
  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",
@@ -1397,8 +1703,8 @@ var YouTubeIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg"
1397
1703
  ) });
1398
1704
 
1399
1705
  // src/icons/VideoIcon.tsx
1400
- var import_jsx_runtime44 = require("react/jsx-runtime");
1401
- var VideoIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
1706
+ var import_jsx_runtime50 = require("react/jsx-runtime");
1707
+ var VideoIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
1402
1708
  "path",
1403
1709
  {
1404
1710
  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",
@@ -1407,8 +1713,8 @@ var VideoIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("svg",
1407
1713
  ) });
1408
1714
 
1409
1715
  // src/icons/AudioIcon.tsx
1410
- var import_jsx_runtime45 = require("react/jsx-runtime");
1411
- var AudioIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
1716
+ var import_jsx_runtime51 = require("react/jsx-runtime");
1717
+ var AudioIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
1412
1718
  "path",
1413
1719
  {
1414
1720
  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",
@@ -1417,8 +1723,8 @@ var AudioIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("svg",
1417
1723
  ) });
1418
1724
 
1419
1725
  // src/icons/EmptyCanvasIcon.tsx
1420
- var import_jsx_runtime46 = require("react/jsx-runtime");
1421
- var EmptyCanvasIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
1726
+ var import_jsx_runtime52 = require("react/jsx-runtime");
1727
+ var EmptyCanvasIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "#5f6368", viewBox: "0 -960 960 960", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
1422
1728
  "path",
1423
1729
  {
1424
1730
  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",
@@ -1427,14 +1733,14 @@ var EmptyCanvasIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("
1427
1733
  ) });
1428
1734
 
1429
1735
  // src/icons/AddIcon.tsx
1430
- var import_jsx_runtime47 = require("react/jsx-runtime");
1736
+ var import_jsx_runtime53 = require("react/jsx-runtime");
1431
1737
  function AddIcon({
1432
1738
  className: className2,
1433
1739
  inline,
1434
1740
  height = 16,
1435
1741
  color = "black"
1436
1742
  }) {
1437
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
1743
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
1438
1744
  "svg",
1439
1745
  {
1440
1746
  xmlns: "http://www.w3.org/2000/svg",
@@ -1445,18 +1751,61 @@ function AddIcon({
1445
1751
  style: { verticalAlign: inline ? "bottom" : void 0 },
1446
1752
  className: className2,
1447
1753
  children: [
1448
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
1449
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", fill: "currentColor" })
1754
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
1755
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", fill: "currentColor" })
1756
+ ]
1757
+ }
1758
+ );
1759
+ }
1760
+
1761
+ // src/icons/MoreMenu.tsx
1762
+ var import_jsx_runtime54 = require("react/jsx-runtime");
1763
+ function MoreMenu2() {
1764
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
1765
+ "svg",
1766
+ {
1767
+ xmlns: "http://www.w3.org/2000/svg",
1768
+ height: "1em",
1769
+ viewBox: "0 0 24 24",
1770
+ width: "1em",
1771
+ children: [
1772
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" }),
1773
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
1774
+ "path",
1775
+ {
1776
+ 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",
1777
+ fill: "currentColor"
1778
+ }
1779
+ )
1450
1780
  ]
1451
1781
  }
1452
1782
  );
1453
1783
  }
1454
1784
 
1785
+ // src/ErrorMessage.tsx
1786
+ var import_tailwind_merge7 = require("tailwind-merge");
1787
+ var import_jsx_runtime55 = require("react/jsx-runtime");
1788
+ function ErrorMessage({ children, small = false, className: className2 }) {
1789
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
1790
+ "div",
1791
+ {
1792
+ className: (0, import_tailwind_merge7.twMerge)(
1793
+ "bg-red-500 text-white",
1794
+ "border-1 drop-shadow border-red-700 w-full rounded-md py-2 px-4 leading-[1.9em] flex items-center",
1795
+ "has-[a]:text-white",
1796
+ small && "text-xs whitespace-nowrap py-1 px-2 leading-[1.6em] w-fit",
1797
+ className2
1798
+ ),
1799
+ children
1800
+ }
1801
+ );
1802
+ }
1803
+
1455
1804
  // src/hooks.ts
1456
- var import_react7 = require("react");
1805
+ var import_react10 = require("react");
1457
1806
  function useFastList(list, firstRender = 24) {
1458
- const [isMounted, setIsMounted] = (0, import_react7.useState)(false);
1459
- (0, import_react7.useLayoutEffect)(() => {
1807
+ const [isMounted, setIsMounted] = (0, import_react10.useState)(false);
1808
+ (0, import_react10.useLayoutEffect)(() => {
1460
1809
  if (list) {
1461
1810
  setTimeout(() => {
1462
1811
  setIsMounted(true);
@@ -1471,3 +1820,123 @@ function useFastList(list, firstRender = 24) {
1471
1820
  }
1472
1821
  return list.slice(0, firstRender);
1473
1822
  }
1823
+
1824
+ // src/RenderTextualContent.tsx
1825
+ var import_react11 = require("react");
1826
+ var import_react_aria_components9 = require("react-aria-components");
1827
+ var import_react_iiif_vault6 = require("react-iiif-vault");
1828
+ var import_jsx_runtime56 = require("react/jsx-runtime");
1829
+ function RenderTextualContent(props) {
1830
+ const languages = props.strategy.items.map(
1831
+ (item) => Object.keys(item.text)[0]
1832
+ );
1833
+ const [langauge, setLanguage] = (0, import_react11.useState)(languages[0]);
1834
+ const selected = props.strategy.items.find(
1835
+ (item) => Object.keys(item.text)[0] === langauge
1836
+ );
1837
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "overflow-y-auto bg-white shadow", children: [
1838
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex gap-2 border-b", children: languages.map((language) => {
1839
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
1840
+ import_react_aria_components9.Button,
1841
+ {
1842
+ className: `py-1 px-3 ${langauge === language ? "bg-me-500 text-white" : "bg-white text-black"}`,
1843
+ onPress: () => setLanguage(language),
1844
+ children: language
1845
+ },
1846
+ language
1847
+ );
1848
+ }) }),
1849
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "p-4 prose", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
1850
+ import_react_iiif_vault6.LocaleString,
1851
+ {
1852
+ enableDangerouslySetInnerHTML: true,
1853
+ defaultText: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-gray-500 my-8", children: "No content available" }),
1854
+ children: selected?.text
1855
+ }
1856
+ ) })
1857
+ ] });
1858
+ }
1859
+
1860
+ // src/IIIFMediaPlayer.tsx
1861
+ var import_base = require("@vidstack/react/player/styles/base.css");
1862
+ var import_theme = require("@vidstack/react/player/styles/default/theme.css");
1863
+ var import_captions = require("@vidstack/react/player/styles/default/captions.css");
1864
+ var import_video = require("@vidstack/react/player/styles/default/layouts/video.css");
1865
+ var import_react12 = require("@vidstack/react");
1866
+ var import_default = require("@vidstack/react/player/layouts/default");
1867
+ var import_helpers = require("@iiif/helpers");
1868
+ var import_react13 = require("react");
1869
+ var import_jsx_runtime57 = require("react/jsx-runtime");
1870
+ function IIIFMediaPlayer(props) {
1871
+ const mediaPlayer = (0, import_react13.useRef)(null);
1872
+ const captions = props.captions || [];
1873
+ const language = props.language;
1874
+ const timeRef = (0, import_react13.useRef)(props.startTime || 0);
1875
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
1876
+ import_react12.MediaPlayer,
1877
+ {
1878
+ onTimeUpdate: (time) => {
1879
+ const newT = Math.round(time.currentTime);
1880
+ if (timeRef.current === newT)
1881
+ return;
1882
+ timeRef.current = newT;
1883
+ },
1884
+ ref: mediaPlayer,
1885
+ lang: language,
1886
+ className: "h-full w-full min-w-[275px] flex radius-0",
1887
+ playsInline: true,
1888
+ currentTime: props.startTime,
1889
+ duration: props.media.duration,
1890
+ src: [
1891
+ {
1892
+ src: props.media.url,
1893
+ type: props.media.format
1894
+ }
1895
+ ],
1896
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_react12.MediaProvider, { className: "w-full h-full [&>video]:w-full [&>video]:h-full [&>video]:object-contain", children: [
1897
+ captions.map((caption) => {
1898
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
1899
+ import_react12.Track,
1900
+ {
1901
+ src: caption.id,
1902
+ kind: "subtitles",
1903
+ label: (0, import_helpers.getValue)(caption.label),
1904
+ default: caption.language === language,
1905
+ language: caption.language
1906
+ },
1907
+ caption.id
1908
+ );
1909
+ }),
1910
+ props.poster ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
1911
+ import_react12.Poster,
1912
+ {
1913
+ className: "absolute inset-0 bg-black block h-full w-full opacity-0 transition-opacity data-[visible]:opacity-100 object-contain",
1914
+ src: props.poster
1915
+ }
1916
+ ) : null,
1917
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Gestures, {}),
1918
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
1919
+ import_default.DefaultVideoLayout,
1920
+ {
1921
+ className: "z-1",
1922
+ noGestures: true,
1923
+ icons: import_default.defaultLayoutIcons
1924
+ }
1925
+ )
1926
+ ] })
1927
+ }
1928
+ );
1929
+ }
1930
+ function Gestures() {
1931
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
1932
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
1933
+ import_react12.Gesture,
1934
+ {
1935
+ className: "pointer-coarse:hidden absolute top-0 start-12 bottom-20 right-0 -z-1 block",
1936
+ event: "pointerup",
1937
+ action: "toggle:paused"
1938
+ }
1939
+ ),
1940
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_react12.Gesture, { className: "absolute inset-0 z-0 block h-full w-full", event: "dblpointerup", action: "toggle:fullscreen" })
1941
+ ] });
1942
+ }