@manifest-editor/exhibition-preset 1.3.0 → 1.4.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
@@ -623,13 +623,7 @@ var import_jsx_runtime7 = require("react/jsx-runtime");
623
623
  var youtubeMainEdtior = {
624
624
  id: "youtube-main-editor",
625
625
  label: "YouTube main editor",
626
- component: (strategy) => strategy.type === "media" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
627
- YouTubeEditor,
628
- {
629
- strategy,
630
- video: strategy.media
631
- }
632
- ) : null,
626
+ component: (strategy) => strategy.type === "media" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(YouTubeEditor, { strategy, video: strategy.media }) : null,
633
627
  supports: {
634
628
  strategy: (strategy, resource, vault) => {
635
629
  console.log(strategy);
@@ -643,10 +637,7 @@ var youtubeMainEdtior = {
643
637
  }
644
638
  }
645
639
  };
646
- function YouTubeEditor({
647
- strategy,
648
- video
649
- }) {
640
+ function YouTubeEditor({ strategy, video }) {
650
641
  const { edit } = (0, import_shell4.useLayoutActions)();
651
642
  const canvas = (0, import_react_iiif_vault5.useCanvas)();
652
643
  const annotationRef = (0, import_react_iiif_vault5.useVaultSelector)((_2, v2) => {
@@ -658,26 +649,19 @@ function YouTubeEditor({
658
649
  const annotation = (0, import_shell4.useGenericEditor)(annotationRef);
659
650
  const media = video;
660
651
  const ar = (canvas.width || 1) / (canvas.height || 1);
661
- const ytThumbnail = `https://img.youtube.com/vi/${media.youTubeId}/0.jpg`;
652
+ const ytThumbnail = `https://img.youtube.com/vi/${media.youTubeId}/maxresdefault.jpg`;
662
653
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "overflow-y-auto", children: [
663
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-8", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
664
- "div",
654
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-8", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "bg-black z-20 flex p-8 rounded-lg max-w-full max-h-[70vh] mx-auto", style: { aspectRatio: ar }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
655
+ "iframe",
665
656
  {
666
- className: "bg-black z-20 flex p-8 rounded-lg max-w-full max-h-[70vh] mx-auto",
667
- style: { aspectRatio: ar },
668
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
669
- "iframe",
670
- {
671
- title: "YouTube video",
672
- className: "border-none w-full h-full object-contain",
673
- ref: player,
674
- src: `https://www.youtube.com/embed/${media.youTubeId}?enablejsapi=1&origin=${window.location.host}`,
675
- referrerPolicy: "no-referrer",
676
- sandbox: "allow-scripts allow-same-origin allow-presentation"
677
- }
678
- )
657
+ title: "YouTube video",
658
+ className: "border-none w-full h-full object-contain",
659
+ ref: player,
660
+ src: `https://www.youtube.com/embed/${media.youTubeId}?enablejsapi=1&origin=${window.location.host}`,
661
+ referrerPolicy: "no-referrer",
662
+ sandbox: "allow-scripts allow-same-origin allow-presentation"
679
663
  }
680
- ) }),
664
+ ) }) }),
681
665
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "bg-white shadow w-full p-8 flex gap-8", children: [
682
666
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
683
667
  "div",
@@ -712,49 +696,160 @@ function YouTubeEditor({
712
696
  ] });
713
697
  }
714
698
 
699
+ // src/creators/image-browser-slide-creator.tsx
700
+ var import_creator_api = require("@manifest-editor/creator-api");
701
+ var import_creators = require("@manifest-editor/creators");
702
+ var imageBrowserSlideCreator = (0, import_creator_api.defineCreator)({
703
+ ...import_creators.iiifBrowserCreator,
704
+ id: "@exhibitions/browser-creator",
705
+ create: createBrowser,
706
+ tags: ["image", "exhibition-slide"],
707
+ label: "IIIF Browser",
708
+ summary: "Browse IIIF Resources"
709
+ });
710
+ async function createBrowser(data, ctx) {
711
+ const canvasId = ctx.generateId("canvas");
712
+ const pageId = ctx.generateId("annotation-page", {
713
+ id: canvasId,
714
+ type: "Canvas"
715
+ });
716
+ const dimensions = { width: 0, height: 0 };
717
+ const createBrowserAnnotation = (0, import_creator_api.creatorHelper)(
718
+ ctx,
719
+ { id: pageId, type: "AnnotationPage" },
720
+ "items",
721
+ "@manifest-editor/iiif-browser-creator"
722
+ );
723
+ const annotation = await createBrowserAnnotation(
724
+ {
725
+ ...data,
726
+ trackSize({ width, height }) {
727
+ dimensions.height = height;
728
+ dimensions.width = width;
729
+ }
730
+ },
731
+ {
732
+ targetType: "Annotation",
733
+ target: {
734
+ id: canvasId,
735
+ type: "Canvas"
736
+ }
737
+ }
738
+ );
739
+ const createSlide = (0, import_creator_api.creatorHelper)(ctx, "Manifest", "items", "@exhibitions/image-slide-creator");
740
+ return await createSlide({
741
+ canvasId,
742
+ width: dimensions.width,
743
+ height: dimensions.height,
744
+ type: "default",
745
+ // default / left / right / bottom
746
+ items: annotation
747
+ });
748
+ }
749
+
750
+ // src/creators/image-service-slide-creator.tsx
751
+ var import_creator_api2 = require("@manifest-editor/creator-api");
752
+ var import_creators2 = require("@manifest-editor/creators");
753
+ var imageServiceSlideCreator = (0, import_creator_api2.defineCreator)({
754
+ ...import_creators2.imageServiceCreator,
755
+ id: "@exhibitions/image-service-creator",
756
+ create: createImageService,
757
+ tags: ["image", "exhibition-slide"],
758
+ label: "IIIF Image",
759
+ summary: "IIIF Image service",
760
+ resourceType: "Canvas",
761
+ supports: {
762
+ parentTypes: ["Manifest"],
763
+ parentFields: ["items"]
764
+ }
765
+ });
766
+ async function createImageService(data, ctx) {
767
+ const canvasId = ctx.generateId("canvas");
768
+ const pageId = ctx.generateId("annotation-page", {
769
+ id: canvasId,
770
+ type: "Canvas"
771
+ });
772
+ const annotationId = ctx.generateId("annotation");
773
+ const createImageService2 = (0, import_creator_api2.creatorHelper)(
774
+ ctx,
775
+ { id: annotationId, type: "Annotation" },
776
+ "body",
777
+ "@manifest-editor/image-service-creator"
778
+ );
779
+ const resource = await createImageService2(data, {
780
+ target: {
781
+ id: canvasId,
782
+ type: "Canvas"
783
+ }
784
+ });
785
+ const { width, height } = resource.get();
786
+ const annotation = ctx.embed({
787
+ id: ctx.generateId("annotation"),
788
+ type: "Annotation",
789
+ motivation: "painting",
790
+ body: [resource],
791
+ target: {
792
+ type: "SpecificResource",
793
+ source: { id: canvasId, type: "Canvas" }
794
+ }
795
+ });
796
+ const createSlide = (0, import_creator_api2.creatorHelper)(ctx, "Manifest", "items", "@exhibitions/image-slide-creator");
797
+ return await createSlide({
798
+ canvasId,
799
+ width,
800
+ height,
801
+ type: "default",
802
+ // default / left / right / bottom
803
+ items: [annotation]
804
+ });
805
+ }
806
+
715
807
  // src/creators/image-slide-creator.tsx
716
808
  var import_parser = require("@iiif/parser");
809
+ var import_components5 = require("@manifest-editor/components");
810
+ var import_creator_api3 = require("@manifest-editor/creator-api");
717
811
  var import_jsx_runtime8 = require("react/jsx-runtime");
718
- var imageSlideCreator = {
812
+ var imageSlideCreator = (0, import_creator_api3.defineCreator)({
719
813
  id: "@exhibitions/image-slide-creator",
720
814
  create: createImageSlide,
721
- label: "Image",
722
- summary: "An image with text.",
723
- icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "IMAGE" }),
815
+ label: "Empty slide",
816
+ summary: "An empty image slide.",
817
+ icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components5.EmptyCanvasIcon, {}),
724
818
  tags: ["exhibition-slide"],
819
+ // No tag, so it doesn't appear, it's just called.
725
820
  resourceType: "Canvas",
726
821
  resourceFields: ["id", "type", "label", "height", "width", "items"],
727
822
  supports: {
728
823
  parentTypes: ["Manifest"],
729
824
  parentFields: ["items"]
730
825
  }
731
- };
732
- var imageSlideLeftCreator = {
826
+ });
827
+ var imageSlideLeftCreator = (0, import_creator_api3.defineCreator)({
733
828
  ...imageSlideCreator,
734
829
  id: "@exhibitions/image-slide-creator-left",
735
830
  label: "Image (Left)",
736
831
  summary: "An image with text on the left.",
737
832
  icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "IMAGE (LEFT)" }),
738
833
  create: (payload, ctx) => createImageSlide({ ...payload, type: "left" }, ctx)
739
- };
740
- var imageSlideRightCreator = {
834
+ });
835
+ var imageSlideRightCreator = (0, import_creator_api3.defineCreator)({
741
836
  ...imageSlideCreator,
742
837
  id: "@exhibitions/image-slide-creator-right",
743
838
  label: "Image (Right)",
744
839
  summary: "An image with text on the right.",
745
840
  icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "IMAGE (RIGHT)" }),
746
841
  create: (payload, ctx) => createImageSlide({ ...payload, type: "right" }, ctx)
747
- };
748
- var imageSlideBottomCreator = {
842
+ });
843
+ var imageSlideBottomCreator = (0, import_creator_api3.defineCreator)({
749
844
  ...imageSlideCreator,
750
845
  id: "@exhibitions/image-slide-creator-bottom",
751
846
  label: "Image (Bottom)",
752
847
  summary: "An image with text at the bottom.",
753
848
  icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "IMAGE (BOTTOM)" }),
754
849
  create: (payload, ctx) => createImageSlide({ ...payload, type: "bottom" }, ctx)
755
- };
850
+ });
756
851
  function createImageSlide(payload, ctx) {
757
- const canvasId = ctx.generateId("Canvas");
852
+ const canvasId = payload.canvasId || ctx.generateId("Canvas");
758
853
  const itemsPageId = ctx.generateId("AnnotationPage", {
759
854
  id: canvasId,
760
855
  type: "Canvas"
@@ -763,8 +858,23 @@ function createImageSlide(payload, ctx) {
763
858
  id: canvasId,
764
859
  type: "Canvas"
765
860
  });
766
- const behavior = ["w-12", "h-4"];
861
+ const behavior = [];
767
862
  let width = 6e3;
863
+ if (payload.width && payload.height) {
864
+ if (payload.width > payload.height) {
865
+ const gridSize = payload.width / 12;
866
+ const heightColumns = Math.floor(payload.height / gridSize);
867
+ const hClass = `h-${heightColumns}`;
868
+ behavior.push("w-12", hClass);
869
+ } else {
870
+ const gridSize = payload.height / 12;
871
+ const widthColumns = Math.floor(payload.width / gridSize);
872
+ const wClass = `w-${widthColumns}`;
873
+ behavior.push(wClass, "h-12");
874
+ }
875
+ } else {
876
+ behavior.push("w-12", "h-4");
877
+ }
768
878
  switch (payload.type) {
769
879
  case "left":
770
880
  behavior.push("left");
@@ -778,6 +888,9 @@ function createImageSlide(payload, ctx) {
778
888
  behavior.push("bottom");
779
889
  break;
780
890
  }
891
+ if (!payload.items?.length) {
892
+ behavior.push("multi-image");
893
+ }
781
894
  return ctx.embed({
782
895
  ...import_parser.emptyCanvas,
783
896
  id: canvasId,
@@ -790,7 +903,7 @@ function createImageSlide(payload, ctx) {
790
903
  ...import_parser.emptyAnnotationPage,
791
904
  id: itemsPageId,
792
905
  type: "AnnotationPage",
793
- items: []
906
+ items: payload.items ? payload.items : []
794
907
  })
795
908
  ],
796
909
  annotations: [
@@ -804,30 +917,83 @@ function createImageSlide(payload, ctx) {
804
917
  });
805
918
  }
806
919
 
920
+ // src/creators/image-url-slide.tsx
921
+ var import_creator_api4 = require("@manifest-editor/creator-api");
922
+ var import_creators3 = require("@manifest-editor/creators");
923
+ var imageUrlSlideCreator = (0, import_creator_api4.defineCreator)({
924
+ ...import_creators3.imageUrlCreator,
925
+ id: "@exhibitions/image-url-creator",
926
+ create: createUrlSlide,
927
+ tags: ["exhibition-slide"],
928
+ label: "Image",
929
+ summary: "Image from URL",
930
+ resourceType: "Canvas",
931
+ supports: {
932
+ parentTypes: ["Manifest"],
933
+ parentFields: ["items"]
934
+ }
935
+ });
936
+ async function createUrlSlide(data, ctx) {
937
+ const canvasId = ctx.generateId("canvas");
938
+ const pageId = ctx.generateId("annotation-page", {
939
+ id: canvasId,
940
+ type: "Canvas"
941
+ });
942
+ const annotationId = ctx.generateId("annotation");
943
+ const createImageUrl = (0, import_creator_api4.creatorHelper)(
944
+ ctx,
945
+ { id: annotationId, type: "Annotation" },
946
+ "body",
947
+ "@manifest-editor/image-url-creator"
948
+ );
949
+ const resource = await createImageUrl(data, {
950
+ target: {
951
+ id: canvasId,
952
+ type: "Canvas"
953
+ },
954
+ targetType: "Annotation"
955
+ });
956
+ const { width, height } = resource.get();
957
+ const annotation = ctx.embed({
958
+ id: annotationId,
959
+ type: "Annotation",
960
+ motivation: "painting",
961
+ body: [resource],
962
+ target: {
963
+ type: "SpecificResource",
964
+ source: { id: canvasId, type: "Canvas" }
965
+ }
966
+ });
967
+ const createSlide = (0, import_creator_api4.creatorHelper)(ctx, "Manifest", "items", "@exhibitions/image-slide-creator");
968
+ return await createSlide({
969
+ canvasId,
970
+ width,
971
+ height,
972
+ type: "default",
973
+ // default / left / right / bottom
974
+ items: [annotation]
975
+ });
976
+ }
977
+
807
978
  // src/creators/info-box-creator.tsx
808
979
  var import_parser2 = require("@iiif/parser");
980
+ var import_creator_api5 = require("@manifest-editor/creator-api");
809
981
  var import_jsx_runtime9 = require("react/jsx-runtime");
810
- var infoBoxCreator = {
982
+ var infoBoxCreator = (0, import_creator_api5.defineCreator)({
811
983
  id: "@exhibitions/info-box-creator",
812
984
  create: createInfoBox,
813
985
  label: "Info box",
814
986
  summary: "A text panel for an exhibition",
815
- icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
816
- "svg",
817
- {
818
- xmlns: "http://www.w3.org/2000/svg",
819
- width: "1em",
820
- height: "1em",
821
- viewBox: "0 0 24 24",
822
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
823
- "path",
824
- {
825
- fill: "currentColor",
826
- d: "M11 17h2v-6h-2zm1-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22"
827
- }
828
- )
829
- }
830
- ),
987
+ icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: [
988
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("title", { children: "Info box" }),
989
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
990
+ "path",
991
+ {
992
+ fill: "currentColor",
993
+ d: "M11 17h2v-6h-2zm1-8q.425 0 .713-.288T13 8t-.288-.712T12 7t-.712.288T11 8t.288.713T12 9m0 13q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12t.788-3.9t2.137-3.175T8.1 2.788T12 2t3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22"
994
+ }
995
+ )
996
+ ] }),
831
997
  tags: ["exhibition-slide"],
832
998
  resourceType: "Canvas",
833
999
  resourceFields: ["id", "type", "label", "height", "width", "items"],
@@ -835,7 +1001,7 @@ var infoBoxCreator = {
835
1001
  parentTypes: ["Manifest"],
836
1002
  parentFields: ["items"]
837
1003
  }
838
- };
1004
+ });
839
1005
  async function createInfoBox(data, ctx) {
840
1006
  const canvasId = ctx.generateId("canvas");
841
1007
  const pageId = ctx.generateId("annotation-page", {
@@ -914,7 +1080,7 @@ async function createInfoBox(data, ctx) {
914
1080
  id: canvasId,
915
1081
  type: "Canvas",
916
1082
  behavior: ["w-4", "h-4", "info"],
917
- label: data.label || { en: ["Untitled info box"] },
1083
+ label: data.label || void 0,
918
1084
  height: data.height || 1e3,
919
1085
  width: data.width || 1e3,
920
1086
  items: [page],
@@ -924,16 +1090,17 @@ async function createInfoBox(data, ctx) {
924
1090
 
925
1091
  // src/creators/youtube-slide-creator.tsx
926
1092
  var import_parser3 = require("@iiif/parser");
927
- var import_creators = require("@manifest-editor/creators");
1093
+ var import_creator_api6 = require("@manifest-editor/creator-api");
1094
+ var import_creators4 = require("@manifest-editor/creators");
928
1095
  var import_editors3 = require("@manifest-editor/editors");
929
- var youtubeSlideCreator = {
930
- ...import_creators.youTubeBodyCreator,
1096
+ var youtubeSlideCreator = (0, import_creator_api6.defineCreator)({
1097
+ ...import_creators4.youTubeBodyCreator,
931
1098
  id: "@exhibitions/youtube-creator",
932
1099
  create: createYoutube,
933
1100
  tags: ["video", "exhibition-slide"],
934
1101
  label: "YouTube",
935
1102
  summary: "A YouTube for an exhibition"
936
- };
1103
+ });
937
1104
  async function createYoutube(data, ctx) {
938
1105
  const ytId = (0, import_editors3.getYouTubeId)(data.youtubeUrl);
939
1106
  const canvasId = ctx.generateId("canvas");
@@ -958,10 +1125,10 @@ async function createYoutube(data, ctx) {
958
1125
  items: [annotation]
959
1126
  });
960
1127
  const thumbnail = ctx.embed({
961
- id: `https://img.youtube.com/vi/${ytId}/0.jpg`,
1128
+ id: `https://img.youtube.com/vi/${ytId}/maxresdefault.jpg`,
962
1129
  type: "Image",
963
1130
  format: "image/jpeg",
964
- width: 480,
1131
+ width: 640,
965
1132
  height: 360
966
1133
  });
967
1134
  return ctx.embed({
@@ -979,9 +1146,9 @@ async function createYoutube(data, ctx) {
979
1146
  }
980
1147
 
981
1148
  // src/left-panels/ExhibitionGrid.tsx
982
- var import_components6 = require("@manifest-editor/components");
1149
+ var import_components7 = require("@manifest-editor/components");
983
1150
  var import_editors5 = require("@manifest-editor/editors");
984
- var import_components7 = require("@manifest-editor/manifest-preset/components");
1151
+ var import_components8 = require("@manifest-editor/manifest-preset/components");
985
1152
  var import_shell8 = require("@manifest-editor/shell");
986
1153
 
987
1154
  // src/components/ExhibitionGrid.tsx
@@ -1012,7 +1179,7 @@ function ExhibitionContainer({
1012
1179
  }
1013
1180
 
1014
1181
  // src/components/ExhibitionItem.tsx
1015
- var import_components5 = require("@manifest-editor/components");
1182
+ var import_components6 = require("@manifest-editor/components");
1016
1183
  var import_editors4 = require("@manifest-editor/editors");
1017
1184
  var import_react3 = require("react");
1018
1185
  var import_react_iiif_vault7 = require("react-iiif-vault");
@@ -1041,7 +1208,7 @@ var ExhibitionItem = (0, import_react3.forwardRef)(
1041
1208
  isLeft ? "flex-row-reverse" : isBottom ? "flex-col" : "flex-row"
1042
1209
  ),
1043
1210
  children: [
1044
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-1 overflow-hidden relative justify-self-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components5.LazyThumbnail, { cover: true, fade: false }) }) }),
1211
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-1 overflow-hidden relative justify-self-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components6.LazyThumbnail, { cover: true, fade: false }) }) }),
1045
1212
  isImage ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1046
1213
  "div",
1047
1214
  {
@@ -1243,14 +1410,14 @@ function ExhibitionGridLeftPanel() {
1243
1410
  const manifest = { id: manifestId, type: "Manifest" };
1244
1411
  const [canCreateCanvas, canvasActions] = (0, import_shell8.useCreator)(manifest, "items", "Canvas");
1245
1412
  const [toggled, toggle] = (0, import_editors5.useToggleList)();
1246
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_components6.Sidebar, { children: [
1413
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_components7.Sidebar, { children: [
1247
1414
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1248
- import_components6.SidebarHeader,
1415
+ import_components7.SidebarHeader,
1249
1416
  {
1250
1417
  title: "Exhibition",
1251
1418
  actions: [
1252
1419
  {
1253
- icon: toggled.list ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.CanvasListingIcon, { className: "text-2xl" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ExhibitionGridIcon, {}),
1420
+ icon: toggled.list ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components8.CanvasListingIcon, { className: "text-2xl" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ExhibitionGridIcon, {}),
1254
1421
  title: toggled.list ? "List view" : "Grid view",
1255
1422
  onClick: () => toggle("list")
1256
1423
  },
@@ -1269,7 +1436,7 @@ function ExhibitionGridLeftPanel() {
1269
1436
  ]
1270
1437
  }
1271
1438
  ),
1272
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components6.SidebarContent, { children: toggled.list ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.CanvasListView, { isEditing: toggled.editing }) : toggled.editing ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SortableExhibitionGrid, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ExhibitionGrid, {}) })
1439
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.SidebarContent, { children: toggled.list ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components8.CanvasListView, { isEditing: toggled.editing }) : toggled.editing ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SortableExhibitionGrid, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ExhibitionGrid, {}) })
1273
1440
  ] });
1274
1441
  }
1275
1442
  function ExhibitionGridIcon() {
@@ -1292,208 +1459,19 @@ function NewSlideIcon() {
1292
1459
  ] });
1293
1460
  }
1294
1461
 
1295
- // src/right-panels/SlideBehaviours.tsx
1296
- var import_components8 = require("@manifest-editor/components");
1297
- var import_editors6 = require("@manifest-editor/editors");
1298
- var import_shell9 = require("@manifest-editor/shell");
1299
- var import_react5 = require("react");
1300
-
1301
- // src/components/AspectRatioWarning.tsx
1302
- var import_react_iiif_vault10 = require("react-iiif-vault");
1303
- var import_tiny_invariant2 = __toESM(require("tiny-invariant"), 1);
1304
- var import_jsx_runtime17 = require("react/jsx-runtime");
1305
- function AspectRatioWarning() {
1306
- const canvas = (0, import_react_iiif_vault10.useCanvas)();
1307
- (0, import_tiny_invariant2.default)(canvas);
1308
- const ratio = canvas.width && canvas.height ? canvas.width / canvas.height : 0;
1309
- const target = getHeightWidthRatio(canvas.behavior || []);
1310
- if (Math.abs(ratio - target.ratio) < 0.01)
1311
- return null;
1312
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "p-2 rounded bg-me-100", children: [
1313
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-me-700-500", children: "Aspect ratio warning" }),
1314
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "text-sm text-black/60", children: [
1315
- "The aspect ratio of this canvas is ",
1316
- ratio.toFixed(2),
1317
- " but the target aspect ratio is ",
1318
- target.ratio.toFixed(2),
1319
- ". Some parts of this image may be cropped.",
1320
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "relative h-32 w-full mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1321
- "div",
1322
- {
1323
- className: "bg-[red] left-0 top-0 z-2 opacity-50 max-w-32 max-h-32",
1324
- style: { aspectRatio: ratio.toFixed(2) },
1325
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1326
- "div",
1327
- {
1328
- className: "asbolute bg-[white] left-0 top-0 z-1 opacity-50 max-w-32 max-h-32",
1329
- style: { aspectRatio: target.ratio }
1330
- }
1331
- )
1332
- }
1333
- ) })
1334
- ] })
1335
- ] });
1336
- }
1337
-
1338
- // src/right-panels/SlideBehaviours.tsx
1339
- var import_jsx_runtime18 = require("react/jsx-runtime");
1340
- var customBehaviourEditor = {
1341
- component: () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SlideBehavioursPanel, {}),
1342
- supports: {
1343
- edit: true,
1344
- resourceTypes: ["Canvas"],
1345
- properties: ["behavior"]
1346
- },
1347
- id: "slide-behaviors",
1348
- label: "Layout",
1349
- tabs: {
1350
- showTitle: true
1351
- }
1352
- };
1353
- var exhibitionConfigs = [
1354
- {
1355
- id: "layout",
1356
- type: "choice",
1357
- label: { en: ["Layout"] },
1358
- initialOpen: true,
1359
- items: [
1360
- {
1361
- label: { en: ["Text on left"] },
1362
- value: "left"
1363
- },
1364
- {
1365
- label: { en: ["Text on right"] },
1366
- value: "right"
1367
- },
1368
- {
1369
- label: { en: ["Text on bottom"] },
1370
- value: "bottom"
1371
- },
1372
- {
1373
- label: { en: ["Only image"] },
1374
- value: "image"
1375
- }
1376
- ]
1377
- },
1378
- {
1379
- id: "size",
1380
- component: (existing, setBehaviors) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EditSize, { behaviors: existing, setBehaviors }),
1381
- label: { en: ["Size"] },
1382
- type: "custom",
1383
- initialOpen: true,
1384
- supports: (b) => b.startsWith("w-") || b.startsWith("h-")
1385
- }
1386
- ];
1387
- function parseBehaviors(items) {
1388
- let width = 0;
1389
- let height = 0;
1390
- for (const item of items) {
1391
- if (item.startsWith("w-")) {
1392
- width = Number.parseInt(item.slice(2));
1393
- }
1394
- if (item.startsWith("h-")) {
1395
- height = Number.parseInt(item.slice(2));
1396
- }
1397
- }
1398
- return {
1399
- width,
1400
- height
1401
- };
1402
- }
1403
- function EditSize({ behaviors, setBehaviors }) {
1404
- const { width, height } = parseBehaviors(behaviors);
1405
- const [hoverPosition, setHoverPosition] = (0, import_react5.useState)({ x: -1, y: -1 });
1406
- const setBehavior = (w2, h) => {
1407
- const newBehaviors = behaviors.filter((b) => {
1408
- return !b.startsWith("w-") && !b.startsWith("h-");
1409
- });
1410
- newBehaviors.push(`w-${w2}`);
1411
- newBehaviors.push(`h-${h}`);
1412
- setBehaviors(newBehaviors);
1413
- };
1414
- const cells = Array.from({ length: 144 }, (_2, i2) => {
1415
- const x2 = i2 % 12;
1416
- const y2 = Math.floor(i2 / 12);
1417
- const hovered = hoverPosition.x >= x2 && hoverPosition.y >= y2;
1418
- const selected = x2 < width && y2 < height;
1419
- const hoveredAndSelected = hovered && selected;
1420
- let bgClass = "bg-gray-200";
1421
- if (hovered) {
1422
- bgClass = "bg-me-200";
1423
- }
1424
- if (selected) {
1425
- bgClass = "bg-me-500";
1426
- }
1427
- if (hoveredAndSelected) {
1428
- bgClass = "bg-me-400";
1429
- }
1430
- return (
1431
- // biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
1432
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1433
- "div",
1434
- {
1435
- className: `flex aspect-square rounded cursor-se-resize items-center justify-center ${bgClass}`,
1436
- onClick: () => setBehavior(x2 + 1, y2 + 1),
1437
- onMouseUp: () => setBehavior(x2 + 1, y2 + 1),
1438
- onMouseEnter: () => setHoverPosition({ x: x2, y: y2 })
1439
- },
1440
- i2
1441
- )
1442
- );
1443
- });
1444
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "grid grid-cols-12 grid-rows-12 gap-1", onMouseLeave: () => setHoverPosition({ x: -1, y: -1 }), children: cells });
1445
- }
1446
- function SlideBehavioursPanel() {
1447
- const canvas = (0, import_editors6.useInStack)("Canvas");
1448
- const editor = (0, import_shell9.useEditor)();
1449
- const { width, height } = editor.technical;
1450
- if (!canvas || editor.technical.type !== "Canvas") {
1451
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_components8.Sidebar, { children: [
1452
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.SidebarHeader, { title: "Slide behaviors" }),
1453
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: "Please select canvas" })
1454
- ] });
1455
- }
1456
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components8.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_components8.SidebarContent, { children: [
1457
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_editors6.InputContainer, { $wide: true, children: [
1458
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1459
- import_editors6.DimensionsTriplet,
1460
- {
1461
- widthId: width.containerId(),
1462
- width: width.get() || 0,
1463
- changeWidth: (v2) => width.set(v2),
1464
- heightId: height.containerId(),
1465
- height: height.get() || 0,
1466
- changeHeight: (v2) => height.set(v2)
1467
- }
1468
- ),
1469
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AspectRatioWarning, {}) })
1470
- ] }) }),
1471
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1472
- import_editors6.BehaviorEditor,
1473
- {
1474
- behavior: editor.technical.behavior.get() || [],
1475
- onChange: (v2) => {
1476
- editor.technical.behavior.set(v2);
1477
- },
1478
- configs: exhibitionConfigs
1479
- }
1480
- )
1481
- ] }) });
1482
- }
1483
-
1484
1462
  // src/right-panels/ExhibitionCanvasEditor.tsx
1485
1463
  var import_components10 = require("@manifest-editor/components");
1486
- var import_editors7 = require("@manifest-editor/editors");
1487
- var import_shell11 = require("@manifest-editor/shell");
1488
- var import_react_iiif_vault11 = require("react-iiif-vault");
1464
+ var import_editors6 = require("@manifest-editor/editors");
1465
+ var import_shell10 = require("@manifest-editor/shell");
1466
+ var import_react_iiif_vault10 = require("react-iiif-vault");
1489
1467
 
1490
1468
  // src/components/ExhibitionItemConversion.tsx
1491
- var import_helpers4 = require("@iiif/helpers");
1469
+ var import_helpers3 = require("@iiif/helpers");
1492
1470
  var import_components9 = require("@manifest-editor/components");
1493
- var import_shell10 = require("@manifest-editor/shell");
1494
- var import_jsx_runtime19 = require("react/jsx-runtime");
1471
+ var import_shell9 = require("@manifest-editor/shell");
1472
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1495
1473
  function ExhibitionItemConversion() {
1496
- const editor = (0, import_shell10.useEditor)();
1474
+ const editor = (0, import_shell9.useEditor)();
1497
1475
  const applyDefaultSettings = () => {
1498
1476
  const canvasWidth = editor.technical.width.get();
1499
1477
  const canvasHeight = editor.technical.height.get();
@@ -1503,19 +1481,19 @@ function ExhibitionItemConversion() {
1503
1481
  behaviorsToAdd.push("w-12");
1504
1482
  const height = Math.max(1, Math.min(12, Math.round(canvasWidth / canvasHeight * 12)));
1505
1483
  behaviorsToAdd.push(`h-${height}`);
1506
- if (!(0, import_helpers4.getValue)(summary.get())) {
1484
+ if (!(0, import_helpers3.getValue)(summary.get())) {
1507
1485
  summary.set({ en: ["Summary of image"] });
1508
1486
  }
1509
1487
  editor.technical.behavior.set(behaviorsToAdd);
1510
1488
  };
1511
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-center gap-4 border-me-100 border-2 p-4 rounded", children: [
1489
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex flex-col items-center gap-4 border-me-100 border-2 p-4 rounded", children: [
1512
1490
  "This canvas was not created in the exhibition editor. Do you want to apply default settings?",
1513
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components9.ActionButton, { onPress: () => applyDefaultSettings(), children: "Apply defaults" })
1491
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components9.ActionButton, { onPress: () => applyDefaultSettings(), children: "Apply defaults" })
1514
1492
  ] });
1515
1493
  }
1516
1494
 
1517
1495
  // src/right-panels/ExhibitionCanvasEditor.tsx
1518
- var import_jsx_runtime20 = require("react/jsx-runtime");
1496
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1519
1497
  var exhibitionCanvasEditor = {
1520
1498
  id: "@exhibition/right-panel-editor",
1521
1499
  supports: {
@@ -1532,12 +1510,12 @@ var exhibitionCanvasEditor = {
1532
1510
  }
1533
1511
  },
1534
1512
  label: "Exhibition",
1535
- component: () => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExhibitionRightPanel, {})
1513
+ component: () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ExhibitionRightPanel, {})
1536
1514
  };
1537
1515
  function ExhibitionRightPanel() {
1538
- const canvas = (0, import_react_iiif_vault11.useCanvas)();
1539
- const resource = (0, import_shell11.useEditingResource)();
1540
- const { structural, technical, descriptive } = (0, import_shell11.useEditor)();
1516
+ const canvas = (0, import_react_iiif_vault10.useCanvas)();
1517
+ const resource = (0, import_shell10.useEditingResource)();
1518
+ const { structural, technical, descriptive } = (0, import_shell10.useEditor)();
1541
1519
  const { items } = structural;
1542
1520
  const { thumbnail } = descriptive;
1543
1521
  const { width, height } = technical;
@@ -1545,12 +1523,12 @@ function ExhibitionRightPanel() {
1545
1523
  const page = pages[0];
1546
1524
  const isAnExhibitionCanvas = isExhibitionItem(canvas);
1547
1525
  if (!canvas || !page || !resource)
1548
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "p-8", children: "Canvas, page, or resource not found" });
1549
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components10.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components10.SidebarContent, { padding: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_shell11.ResourceEditingProvider, { resource: canvas, children: [
1550
- !isAnExhibitionCanvas ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExhibitionItemConversion, {}) : null,
1551
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_editors7.LanguageMapEditor, { dispatchType: "label", disableMultiline: true, disallowHTML: true }),
1552
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1553
- import_editors7.LinkingPropertyList,
1526
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-8", children: "Canvas, page, or resource not found" });
1527
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components10.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components10.SidebarContent, { padding: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_shell10.ResourceEditingProvider, { resource: canvas, children: [
1528
+ !isAnExhibitionCanvas ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ExhibitionItemConversion, {}) : null,
1529
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_editors6.LanguageMapEditor, { dispatchType: "label", disableMultiline: true, disallowHTML: true }),
1530
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1531
+ import_editors6.LinkingPropertyList,
1554
1532
  {
1555
1533
  containerId: thumbnail.containerId(),
1556
1534
  label: "Thumbnail",
@@ -1558,22 +1536,22 @@ function ExhibitionRightPanel() {
1558
1536
  items: thumbnail.get(),
1559
1537
  singleMode: true,
1560
1538
  reorder: (ctx) => thumbnail.reorder(ctx.startIndex, ctx.endIndex),
1561
- createActions: (0, import_editors7.createAppActions)(thumbnail),
1539
+ createActions: (0, import_editors6.createAppActions)(thumbnail),
1562
1540
  creationType: "ContentResource",
1563
1541
  emptyLabel: "No thumbnail",
1564
1542
  parent: resource?.resource
1565
1543
  }
1566
1544
  ),
1567
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_iiif_vault11.AnnotationPageContext, { annotationPage: page.id, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_editors7.PaintingAnnotationList, { createFilter: "image" }) })
1545
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_iiif_vault10.AnnotationPageContext, { annotationPage: page.id, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_editors6.PaintingAnnotationList, { createFilter: "image" }) })
1568
1546
  ] }) }) });
1569
1547
  }
1570
1548
 
1571
1549
  // src/right-panels/ExhibitionSummaryEditor.tsx
1572
1550
  var import_components11 = require("@manifest-editor/components");
1573
- var import_editors8 = require("@manifest-editor/editors");
1574
- var import_shell12 = require("@manifest-editor/shell");
1575
- var import_react_iiif_vault12 = require("react-iiif-vault");
1576
- var import_jsx_runtime21 = require("react/jsx-runtime");
1551
+ var import_editors7 = require("@manifest-editor/editors");
1552
+ var import_shell11 = require("@manifest-editor/shell");
1553
+ var import_react_iiif_vault11 = require("react-iiif-vault");
1554
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1577
1555
  var exhibitionSummaryEdtior = {
1578
1556
  id: "@exhibition/summary-editor",
1579
1557
  supports: {
@@ -1590,41 +1568,41 @@ var exhibitionSummaryEdtior = {
1590
1568
  }
1591
1569
  },
1592
1570
  label: "Summary",
1593
- component: () => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ExhibitionRightPanel2, {})
1571
+ component: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ExhibitionRightPanel2, {})
1594
1572
  };
1595
1573
  function ExhibitionRightPanel2() {
1596
- const canvas = (0, import_react_iiif_vault12.useCanvas)();
1574
+ const canvas = (0, import_react_iiif_vault11.useCanvas)();
1597
1575
  if (!canvas)
1598
1576
  return null;
1599
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components11.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components11.SidebarContent, { padding: true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_shell12.ResourceEditingProvider, { resource: canvas, children: [
1600
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_editors8.LanguageMapEditor, { dispatchType: "label" }),
1601
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_editors8.LanguageMapEditor, { dispatchType: "summary" })
1577
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components11.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components11.SidebarContent, { padding: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_shell11.ResourceEditingProvider, { resource: canvas, children: [
1578
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_editors7.LanguageMapEditor, { dispatchType: "label" }),
1579
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_editors7.LanguageMapEditor, { dispatchType: "summary" })
1602
1580
  ] }) }) });
1603
1581
  }
1604
1582
 
1605
1583
  // src/right-panels/ExhibitionTourSteps.tsx
1606
1584
  var import_components17 = require("@manifest-editor/components");
1607
- var import_editors12 = require("@manifest-editor/editors");
1608
- var import_shell18 = require("@manifest-editor/shell");
1609
- var import_react10 = require("react");
1610
- var import_react_aria_components2 = require("react-aria-components");
1611
- var import_react_iiif_vault19 = require("react-iiif-vault");
1612
-
1613
- // src/components/TourAnnotationPageEditor.tsx
1614
1585
  var import_editors11 = require("@manifest-editor/editors");
1615
1586
  var import_shell17 = require("@manifest-editor/shell");
1587
+ var import_react9 = require("react");
1588
+ var import_react_aria_components2 = require("react-aria-components");
1616
1589
  var import_react_iiif_vault18 = require("react-iiif-vault");
1617
1590
 
1618
- // src/components/TourAnnotationEditor.tsx
1591
+ // src/components/TourAnnotationPageEditor.tsx
1619
1592
  var import_editors10 = require("@manifest-editor/editors");
1620
1593
  var import_shell16 = require("@manifest-editor/shell");
1621
- var import_react9 = require("react");
1622
1594
  var import_react_iiif_vault17 = require("react-iiif-vault");
1623
1595
 
1596
+ // src/components/TourAnnotationEditor.tsx
1597
+ var import_editors9 = require("@manifest-editor/editors");
1598
+ var import_shell15 = require("@manifest-editor/shell");
1599
+ var import_react8 = require("react");
1600
+ var import_react_iiif_vault16 = require("react-iiif-vault");
1601
+
1624
1602
  // src/components/TourNormalAnnotationEditor.tsx
1625
1603
  var import_components13 = require("@manifest-editor/components");
1626
1604
  var import_components14 = require("@manifest-editor/manifest-preset/components");
1627
- var import_shell14 = require("@manifest-editor/shell");
1605
+ var import_shell13 = require("@manifest-editor/shell");
1628
1606
 
1629
1607
  // ../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.es6.js
1630
1608
  var __assign = function() {
@@ -1671,7 +1649,7 @@ var isPropValid = /* @__PURE__ */ memoize(
1671
1649
  );
1672
1650
 
1673
1651
  // ../../node_modules/.pnpm/styled-components@6.1.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/styled-components/dist/styled-components.browser.esm.js
1674
- var import_react6 = __toESM(require("react"));
1652
+ var import_react5 = __toESM(require("react"));
1675
1653
  var import_shallowequal = __toESM(require_shallowequal());
1676
1654
 
1677
1655
  // ../../node_modules/.pnpm/stylis@4.3.1/node_modules/stylis/src/Enum.js
@@ -2289,7 +2267,7 @@ var P = function(t, n) {
2289
2267
  for (var n2 = [], o3 = 1; o3 < arguments.length; o3++)
2290
2268
  n2[o3 - 1] = arguments[o3];
2291
2269
  E.test(t2) ? (a2 = false, N.delete(s2)) : i2.apply(void 0, __spreadArray([t2], n2, false));
2292
- }, (0, import_react6.useRef)(), a2 && !N.has(s2) && (console.warn(s2), N.add(s2));
2270
+ }, (0, import_react5.useRef)(), a2 && !N.has(s2) && (console.warn(s2), N.add(s2));
2293
2271
  } catch (e) {
2294
2272
  E.test(e.message) && N.delete(s2);
2295
2273
  } finally {
@@ -2654,26 +2632,26 @@ function xe(e) {
2654
2632
  }
2655
2633
  var Ve = new Re();
2656
2634
  var Fe = xe();
2657
- var Me = import_react6.default.createContext({ shouldForwardProp: void 0, styleSheet: Ve, stylis: Fe });
2635
+ var Me = import_react5.default.createContext({ shouldForwardProp: void 0, styleSheet: Ve, stylis: Fe });
2658
2636
  var $e = Me.Consumer;
2659
- var ze = import_react6.default.createContext(void 0);
2637
+ var ze = import_react5.default.createContext(void 0);
2660
2638
  function Be() {
2661
- return (0, import_react6.useContext)(Me);
2639
+ return (0, import_react5.useContext)(Me);
2662
2640
  }
2663
2641
  function Le(e) {
2664
- var t = (0, import_react6.useState)(e.stylisPlugins), n = t[0], r2 = t[1], c2 = Be().styleSheet, l2 = (0, import_react6.useMemo)(function() {
2642
+ var t = (0, import_react5.useState)(e.stylisPlugins), n = t[0], r2 = t[1], c2 = Be().styleSheet, l2 = (0, import_react5.useMemo)(function() {
2665
2643
  var t2 = c2;
2666
2644
  return e.sheet ? t2 = e.sheet : e.target && (t2 = t2.reconstructWithOptions({ target: e.target }, false)), e.disableCSSOMInjection && (t2 = t2.reconstructWithOptions({ useCSSOMInjection: false })), t2;
2667
- }, [e.disableCSSOMInjection, e.sheet, e.target, c2]), u2 = (0, import_react6.useMemo)(function() {
2645
+ }, [e.disableCSSOMInjection, e.sheet, e.target, c2]), u2 = (0, import_react5.useMemo)(function() {
2668
2646
  return xe({ options: { namespace: e.namespace, prefix: e.enableVendorPrefixes }, plugins: n });
2669
2647
  }, [e.enableVendorPrefixes, e.namespace, n]);
2670
- (0, import_react6.useEffect)(function() {
2648
+ (0, import_react5.useEffect)(function() {
2671
2649
  (0, import_shallowequal.default)(n, e.stylisPlugins) || r2(e.stylisPlugins);
2672
2650
  }, [e.stylisPlugins]);
2673
- var d = (0, import_react6.useMemo)(function() {
2651
+ var d = (0, import_react5.useMemo)(function() {
2674
2652
  return { shouldForwardProp: e.shouldForwardProp, styleSheet: l2, stylis: u2 };
2675
2653
  }, [e.shouldForwardProp, l2, u2]);
2676
- return import_react6.default.createElement(Me.Provider, { value: d }, import_react6.default.createElement(ze.Provider, { value: u2 }, e.children));
2654
+ return import_react5.default.createElement(Me.Provider, { value: d }, import_react5.default.createElement(ze.Provider, { value: u2 }, e.children));
2677
2655
  }
2678
2656
  var Ge = function() {
2679
2657
  function e(e2, t) {
@@ -2773,7 +2751,7 @@ var Ze = function() {
2773
2751
  return o2;
2774
2752
  }, e;
2775
2753
  }();
2776
- var Ke = import_react6.default.createContext(void 0);
2754
+ var Ke = import_react5.default.createContext(void 0);
2777
2755
  var Qe = Ke.Consumer;
2778
2756
  var nt = {};
2779
2757
  var ot = /* @__PURE__ */ new Set();
@@ -2799,8 +2777,8 @@ function rt(e, r2, s2) {
2799
2777
  var N2 = new Ze(s2, g2, i2 ? a2.componentStyle : void 0);
2800
2778
  function O2(e2, r3) {
2801
2779
  return function(e3, r4, s3) {
2802
- var i3 = e3.attrs, a3 = e3.componentStyle, c3 = e3.defaultProps, p3 = e3.foldedComponentIds, d2 = e3.styledComponentId, h2 = e3.target, f3 = import_react6.default.useContext(Ke), m3 = Be(), y3 = e3.shouldForwardProp || m3.shouldForwardProp;
2803
- (0, import_react6.useDebugValue)(d2);
2780
+ var i3 = e3.attrs, a3 = e3.componentStyle, c3 = e3.defaultProps, p3 = e3.foldedComponentIds, d2 = e3.styledComponentId, h2 = e3.target, f3 = import_react5.default.useContext(Ke), m3 = Be(), y3 = e3.shouldForwardProp || m3.shouldForwardProp;
2781
+ (0, import_react5.useDebugValue)(d2);
2804
2782
  var v2 = I(r4, f3, c3) || C, g3 = function(e4, n, o2) {
2805
2783
  for (var r5, s4 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i4 = 0; i4 < e4.length; i4 += 1) {
2806
2784
  var a4 = re(r5 = e4[i4]) ? r5(s4) : r5;
@@ -2813,15 +2791,15 @@ function rt(e, r2, s2) {
2813
2791
  void 0 === g3[b2] || "$" === b2[0] || "as" === b2 || "theme" === b2 && g3.theme === v2 || ("forwardedAs" === b2 ? w3.as = g3.forwardedAs : y3 && !y3(b2, S3) || (w3[b2] = g3[b2], y3 || false || isPropValid(b2) || ot.has(b2) || !A.has(S3) || (ot.add(b2), console.warn('styled-components: it looks like an unknown prop "'.concat(b2, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
2814
2792
  var E3 = function(e4, t) {
2815
2793
  var n = Be(), o2 = e4.generateAndInjectStyles(t, n.styleSheet, n.stylis);
2816
- return (0, import_react6.useDebugValue)(o2), o2;
2794
+ return (0, import_react5.useDebugValue)(o2), o2;
2817
2795
  }(a3, g3);
2818
2796
  e3.warnTooManyClasses && e3.warnTooManyClasses(E3);
2819
2797
  var N3 = ie(p3, d2);
2820
- return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, w3.ref = s3, (0, import_react6.createElement)(S3, w3);
2798
+ return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[L(S3) && !A.has(S3) ? "class" : "className"] = N3, w3.ref = s3, (0, import_react5.createElement)(S3, w3);
2821
2799
  }(D2, e2, r3);
2822
2800
  }
2823
2801
  O2.displayName = y2;
2824
- var D2 = import_react6.default.forwardRef(O2);
2802
+ var D2 = import_react5.default.forwardRef(O2);
2825
2803
  return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i2 ? ie(a2.foldedComponentIds, a2.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i2 ? a2.target : e, Object.defineProperty(D2, "defaultProps", { get: function() {
2826
2804
  return this._foldedDefaultProps;
2827
2805
  }, set: function(e2) {
@@ -2909,7 +2887,7 @@ var mt = function() {
2909
2887
  if (e2.sealed)
2910
2888
  throw he(2);
2911
2889
  var r2 = ((n = {})[f] = "", n[y] = v, n.dangerouslySetInnerHTML = { __html: e2.instance.toString() }, n), s2 = Pe();
2912
- return s2 && (r2.nonce = s2), [import_react6.default.createElement("style", __assign({}, r2, { key: "sc-0-0" }))];
2890
+ return s2 && (r2.nonce = s2), [import_react5.default.createElement("style", __assign({}, r2, { key: "sc-0-0" }))];
2913
2891
  }, this.seal = function() {
2914
2892
  e2.sealed = true;
2915
2893
  }, this.instance = new Re({ isServer: true }), this.sealed = false;
@@ -2917,7 +2895,7 @@ var mt = function() {
2917
2895
  return e.prototype.collectStyles = function(e2) {
2918
2896
  if (this.sealed)
2919
2897
  throw he(2);
2920
- return import_react6.default.createElement(Le, { sheet: this.instance }, e2);
2898
+ return import_react5.default.createElement(Le, { sheet: this.instance }, e2);
2921
2899
  }, e.prototype.interleaveWithNodeStream = function(e2) {
2922
2900
  throw he(3);
2923
2901
  }, e;
@@ -2927,10 +2905,10 @@ var vt = "__sc-".concat(f, "__");
2927
2905
  "undefined" != typeof window && (window[vt] || (window[vt] = 0), 1 === window[vt] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."), window[vt] += 1);
2928
2906
 
2929
2907
  // ../../packages/ui/madoc/components/icons/CloseIcon.tsx
2930
- var import_jsx_runtime22 = require("react/jsx-runtime");
2931
- var CloseIcon = ut((props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", ...props, children: [
2932
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }),
2933
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" })
2908
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2909
+ var CloseIcon = ut((props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", viewBox: "0 0 24 24", width: "24", ...props, children: [
2910
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }),
2911
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("path", { d: "M0 0h24v24H0z", fill: "none" })
2934
2912
  ] }))`
2935
2913
  fill: rgba(0, 0, 0, 0.5);
2936
2914
  cursor: pointer;
@@ -2948,50 +2926,40 @@ var CloseIcon = ut((props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("sv
2948
2926
  `;
2949
2927
 
2950
2928
  // src/components/TourNormalAnnotationEditor.tsx
2951
- var import_react7 = require("react");
2952
- var import_react_iiif_vault15 = require("react-iiif-vault");
2929
+ var import_react6 = require("react");
2930
+ var import_react_iiif_vault14 = require("react-iiif-vault");
2953
2931
 
2954
2932
  // src/components/HTMLAnnotationBodyRender.tsx
2955
- var import_react_iiif_vault13 = require("react-iiif-vault");
2956
- var import_jsx_runtime23 = require("react/jsx-runtime");
2957
- function HTMLAnnotationBodyRender({
2958
- className,
2959
- locale
2960
- }) {
2961
- const annotation = (0, import_react_iiif_vault13.useAnnotation)();
2933
+ var import_react_iiif_vault12 = require("react-iiif-vault");
2934
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2935
+ function HTMLAnnotationBodyRender({ className, locale }) {
2936
+ const annotation = (0, import_react_iiif_vault12.useAnnotation)();
2962
2937
  const filteredBodies = locale && annotation ? annotation?.body.filter((body) => {
2963
2938
  const language = Array.isArray(body.language) ? body.language[0] : body.language;
2964
2939
  return language === locale;
2965
2940
  }) : annotation?.body || [];
2966
2941
  const bodiesToRender = filteredBodies.length ? filteredBodies : locale ? [(annotation?.body || [])[0]] : annotation?.body || [];
2967
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className, children: bodiesToRender.map((body, idx) => {
2968
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2969
- "div",
2970
- {
2971
- className: "prose-headings:mt-1 prose-headings:mb-1 prose-sm leading-normal",
2972
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { dangerouslySetInnerHTML: { __html: body.value } })
2973
- },
2974
- idx
2975
- );
2942
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className, children: bodiesToRender.map((body, idx) => {
2943
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "prose-headings:mt-1 prose-headings:mb-1 prose-sm leading-normal", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { dangerouslySetInnerHTML: { __html: body.value } }) }, idx);
2976
2944
  }) });
2977
2945
  }
2978
2946
 
2979
2947
  // src/components/HTMLAnnotationEditor.tsx
2980
2948
  var import_components12 = require("@manifest-editor/components");
2981
- var import_shell13 = require("@manifest-editor/shell");
2982
- var import_react_iiif_vault14 = require("react-iiif-vault");
2983
- var import_jsx_runtime24 = require("react/jsx-runtime");
2949
+ var import_shell12 = require("@manifest-editor/shell");
2950
+ var import_react_iiif_vault13 = require("react-iiif-vault");
2951
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2984
2952
  function HTMLAnnotationEditor() {
2985
- const annotation = (0, import_react_iiif_vault14.useAnnotation)();
2986
- const creator = (0, import_shell13.useInlineCreator)();
2953
+ const annotation = (0, import_react_iiif_vault13.useAnnotation)();
2954
+ const creator = (0, import_shell12.useInlineCreator)();
2987
2955
  const bodies = annotation?.body || [];
2988
- const editor = (0, import_shell13.useGenericEditor)(annotation);
2956
+ const editor = (0, import_shell12.useGenericEditor)(annotation);
2989
2957
  if (!annotation) {
2990
2958
  return null;
2991
2959
  }
2992
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex flex-col gap-4", children: [
2960
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-4", children: [
2993
2961
  bodies.map((body, n) => {
2994
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2962
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2995
2963
  AnnotationBodyEditor,
2996
2964
  {
2997
2965
  resourceId: body.id,
@@ -3000,7 +2968,7 @@ function HTMLAnnotationEditor() {
3000
2968
  n
3001
2969
  );
3002
2970
  }),
3003
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2971
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3004
2972
  import_components12.ActionButton,
3005
2973
  {
3006
2974
  primary: true,
@@ -3028,15 +2996,15 @@ function HTMLAnnotationEditor() {
3028
2996
  }
3029
2997
 
3030
2998
  // src/components/TourNormalAnnotationEditor.tsx
3031
- var import_jsx_runtime25 = require("react/jsx-runtime");
2999
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3032
3000
  function TourNormalAnnotationEditor({
3033
3001
  highlightProps
3034
3002
  }) {
3035
- const annotation = (0, import_react_iiif_vault15.useAnnotation)();
3036
- const editor = (0, import_shell14.useGenericEditor)(annotation);
3037
- const pageEditor = (0, import_shell14.useGenericEditor)((0, import_react_iiif_vault15.useAnnotationPage)());
3003
+ const annotation = (0, import_react_iiif_vault14.useAnnotation)();
3004
+ const editor = (0, import_shell13.useGenericEditor)(annotation);
3005
+ const pageEditor = (0, import_shell13.useGenericEditor)((0, import_react_iiif_vault14.useAnnotationPage)());
3038
3006
  const target = editor.annotation.target.getParsedSelector();
3039
- const { requestAnnotation, isPending, cancelRequest, busy } = (0, import_shell14.useRequestAnnotation)({
3007
+ const { requestAnnotation, isPending, cancelRequest, busy } = (0, import_shell13.useRequestAnnotation)({
3040
3008
  onSuccess: (resp) => {
3041
3009
  if (resp.target) {
3042
3010
  editor.annotation.target.setSelector(resp.target);
@@ -3081,29 +3049,29 @@ function TourNormalAnnotationEditor({
3081
3049
  pageEditor.structural.items.deleteAtIndex(index);
3082
3050
  }
3083
3051
  };
3084
- const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
3085
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
3052
+ const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
3053
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3086
3054
  "div",
3087
3055
  {
3088
3056
  ...highlightProps,
3089
3057
  className: "border border-gray-300 p-3 hover:border-me-500 shadow-sm rounded bg-white relative",
3090
3058
  children: [
3091
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "absolute top-1 right-1 z-20 flex gap-2", children: [
3092
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.ActionButton, { onPress: () => deleteAnnotation(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.DeleteForeverIcon, {}) }),
3093
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.ActionButton, { onPress: () => setIsOpen((o2) => !o2), children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CloseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components14.ListEditIcon, {}) })
3059
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "absolute top-1 right-1 z-20 flex gap-2", children: [
3060
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components13.ActionButton, { onPress: () => deleteAnnotation(), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components13.DeleteForeverIcon, {}) }),
3061
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components13.ActionButton, { onPress: () => setIsOpen((o2) => !o2), children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CloseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components14.ListEditIcon, {}) })
3094
3062
  ] }),
3095
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "mb-2 relative", children: [
3096
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
3097
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h3", { className: "text-lg font-semibold border-b pt-1 pb-2 mb-2", children: "Edit step" }),
3098
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(HTMLAnnotationEditor, {})
3099
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3063
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "mb-2 relative", children: [
3064
+ isOpen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
3065
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h3", { className: "text-lg font-semibold border-b pt-1 pb-2 mb-2", children: "Edit step" }),
3066
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(HTMLAnnotationEditor, {})
3067
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3100
3068
  HTMLAnnotationBodyRender,
3101
3069
  {
3102
3070
  className: "line-clamp-3 prose-p:text-slate-600",
3103
3071
  locale: "en"
3104
3072
  }
3105
3073
  ) }),
3106
- !isOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components13.ActionButton, { onPress: cancelRequest, children: "Discard changes" }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3074
+ !isOpen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: isPending ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components13.ActionButton, { onPress: cancelRequest, children: "Discard changes" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3107
3075
  import_components13.ActionButton,
3108
3076
  {
3109
3077
  isDisabled: busy,
@@ -3112,7 +3080,7 @@ function TourNormalAnnotationEditor({
3112
3080
  }
3113
3081
  ) }) : null
3114
3082
  ] }),
3115
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute -bottom-5 h-5 border-l-2 border-gray-300 w-0" })
3083
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "absolute -bottom-5 h-5 border-l-2 border-gray-300 w-0" })
3116
3084
  ]
3117
3085
  }
3118
3086
  );
@@ -3120,52 +3088,52 @@ function TourNormalAnnotationEditor({
3120
3088
 
3121
3089
  // src/components/TourPaintingAnnotationEditor.tsx
3122
3090
  var import_components15 = require("@manifest-editor/components");
3123
- var import_editors9 = require("@manifest-editor/editors");
3091
+ var import_editors8 = require("@manifest-editor/editors");
3124
3092
  var import_components16 = require("@manifest-editor/manifest-preset/components");
3125
- var import_shell15 = require("@manifest-editor/shell");
3126
- var import_react8 = require("react");
3127
- var import_react_iiif_vault16 = require("react-iiif-vault");
3128
- var import_jsx_runtime26 = require("react/jsx-runtime");
3093
+ var import_shell14 = require("@manifest-editor/shell");
3094
+ var import_react7 = require("react");
3095
+ var import_react_iiif_vault15 = require("react-iiif-vault");
3096
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3129
3097
  function TourPaintingAnnotationEditor({
3130
3098
  originalAnnotationId,
3131
3099
  highlightProps
3132
3100
  }) {
3133
- const page = (0, import_react_iiif_vault16.useAnnotationPage)();
3134
- const pageEditor = (0, import_shell15.useGenericEditor)(page);
3135
- const annotation = (0, import_react_iiif_vault16.useAnnotation)();
3136
- const { edit } = (0, import_shell15.useLayoutActions)();
3137
- const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
3101
+ const page = (0, import_react_iiif_vault15.useAnnotationPage)();
3102
+ const pageEditor = (0, import_shell14.useGenericEditor)(page);
3103
+ const annotation = (0, import_react_iiif_vault15.useAnnotation)();
3104
+ const { edit } = (0, import_shell14.useLayoutActions)();
3105
+ const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
3138
3106
  const deleteAnnotation = () => {
3139
3107
  if (originalAnnotationId && confirm("Are you sure you want to delete this annotation?")) {
3140
3108
  const index = pageEditor.structural.items.getWithoutTracking().findIndex((item) => item.id === originalAnnotationId);
3141
3109
  pageEditor.structural.items.deleteAtIndex(index);
3142
3110
  }
3143
3111
  };
3144
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3112
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3145
3113
  "div",
3146
3114
  {
3147
3115
  ...highlightProps,
3148
3116
  className: "border border-gray-300 hover:border-me-500 shadow-sm rounded p-3 bg-white relative",
3149
3117
  children: [
3150
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "absolute top-1 right-1 z-20 flex gap-2", children: [
3151
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components15.ActionButton, { onPress: () => deleteAnnotation(), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components15.DeleteForeverIcon, {}) }),
3152
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components15.ActionButton, { onPress: () => setIsOpen((o2) => !o2), children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CloseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components16.ListEditIcon, {}) })
3118
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "absolute top-1 right-1 z-20 flex gap-2", children: [
3119
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components15.ActionButton, { onPress: () => deleteAnnotation(), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components15.DeleteForeverIcon, {}) }),
3120
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components15.ActionButton, { onPress: () => setIsOpen((o2) => !o2), children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CloseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components16.ListEditIcon, {}) })
3153
3121
  ] }),
3154
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex gap-2 mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex-1 min-w-0", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
3155
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "text-lg font-semibold border-b pt-1 pb-2 mb-2", children: "Edit step" }),
3156
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_editors9.LanguageMapEditor, { dispatchType: "label" }),
3157
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_editors9.LanguageMapEditor, { dispatchType: "summary" })
3158
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
3159
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3160
- import_react_iiif_vault16.LocaleString,
3122
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex gap-2 mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-1 min-w-0", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
3123
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h3", { className: "text-lg font-semibold border-b pt-1 pb-2 mb-2", children: "Edit step" }),
3124
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editors8.LanguageMapEditor, { dispatchType: "label" }),
3125
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_editors8.LanguageMapEditor, { dispatchType: "summary" })
3126
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
3127
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3128
+ import_react_iiif_vault15.LocaleString,
3161
3129
  {
3162
3130
  as: "div",
3163
3131
  className: "whitespace-nowrap overflow-ellipsis w-full overflow-x-hidden",
3164
3132
  children: annotation?.label
3165
3133
  }
3166
3134
  ),
3167
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3168
- import_react_iiif_vault16.LocaleString,
3135
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3136
+ import_react_iiif_vault15.LocaleString,
3169
3137
  {
3170
3138
  className: "text-gray-500 text-sm bg-white line-clamp-2",
3171
3139
  as: "div",
@@ -3173,25 +3141,25 @@ function TourPaintingAnnotationEditor({
3173
3141
  }
3174
3142
  )
3175
3143
  ] }) }) }),
3176
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components15.ActionButton, { onPress: () => edit(annotation), children: "Edit target annotation" }),
3177
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute -bottom-5 h-8 -z-10 border-l-2 border-gray-300 w-0" })
3144
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components15.ActionButton, { onPress: () => edit(annotation), children: "Edit target annotation" }),
3145
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "absolute -bottom-5 h-8 -z-10 border-l-2 border-gray-300 w-0" })
3178
3146
  ]
3179
3147
  }
3180
3148
  );
3181
3149
  }
3182
3150
 
3183
3151
  // src/components/TourAnnotationEditor.tsx
3184
- var import_jsx_runtime27 = require("react/jsx-runtime");
3152
+ var import_jsx_runtime25 = require("react/jsx-runtime");
3185
3153
  function TourAnnotationEditor() {
3186
- const [annotation, { annotationTarget, highlightProps }] = (0, import_editors10.useAnnotationInfo)();
3187
- const resource = (0, import_react9.useMemo)(() => {
3154
+ const [annotation, { annotationTarget, highlightProps }] = (0, import_editors9.useAnnotationInfo)();
3155
+ const resource = (0, import_react8.useMemo)(() => {
3188
3156
  if (annotationTarget) {
3189
3157
  return { id: annotationTarget, type: "Annotation" };
3190
3158
  }
3191
3159
  return { id: annotation?.id, type: "Annotation" };
3192
3160
  }, [annotation?.id, annotationTarget]);
3193
3161
  if (annotationTarget) {
3194
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_shell16.ResourceEditingProvider, { resource, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_iiif_vault17.AnnotationContext, { annotation: annotationTarget, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3162
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_shell15.ResourceEditingProvider, { resource, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_iiif_vault16.AnnotationContext, { annotation: annotationTarget, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3195
3163
  TourPaintingAnnotationEditor,
3196
3164
  {
3197
3165
  originalAnnotationId: annotation?.id,
@@ -3199,37 +3167,37 @@ function TourAnnotationEditor() {
3199
3167
  }
3200
3168
  ) }) });
3201
3169
  }
3202
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_shell16.ResourceEditingProvider, { resource, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TourNormalAnnotationEditor, { highlightProps }) });
3170
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_shell15.ResourceEditingProvider, { resource, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TourNormalAnnotationEditor, { highlightProps }) });
3203
3171
  }
3204
3172
 
3205
3173
  // src/components/TourAnnotationPageEditor.tsx
3206
- var import_jsx_runtime28 = require("react/jsx-runtime");
3174
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3207
3175
  function TourAnnotationPageEditor({
3208
3176
  reorderable = false
3209
3177
  }) {
3210
- const page = (0, import_react_iiif_vault18.useAnnotationPage)();
3211
- const editor = (0, import_shell17.useGenericEditor)(page);
3178
+ const page = (0, import_react_iiif_vault17.useAnnotationPage)();
3179
+ const editor = (0, import_shell16.useGenericEditor)(page);
3212
3180
  if (!page) {
3213
3181
  return null;
3214
3182
  }
3215
3183
  if (!reorderable) {
3216
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: page.items.map((annotation) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_iiif_vault18.AnnotationContext, { annotation: annotation.id, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TourAnnotationEditor, {}) }, annotation.id)) });
3184
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: page.items.map((annotation) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_iiif_vault17.AnnotationContext, { annotation: annotation.id, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TourAnnotationEditor, {}) }, annotation.id)) });
3217
3185
  }
3218
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3219
- import_editors11.ReorderList,
3186
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_jsx_runtime26.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3187
+ import_editors10.ReorderList,
3220
3188
  {
3221
3189
  id: page.id,
3222
3190
  marginBottom: "0.5em",
3223
3191
  items: page.items || [],
3224
3192
  inlineHandle: false,
3225
3193
  reorder: ({ startIndex, endIndex }) => editor.structural.items.reorder(startIndex, endIndex),
3226
- renderItem: (ref, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_iiif_vault18.AnnotationContext, { annotation: ref.id, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TourAnnotationEditor, {}) })
3194
+ renderItem: (ref, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_iiif_vault17.AnnotationContext, { annotation: ref.id, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TourAnnotationEditor, {}) })
3227
3195
  }
3228
3196
  ) });
3229
3197
  }
3230
3198
 
3231
3199
  // src/right-panels/ExhibitionTourSteps.tsx
3232
- var import_jsx_runtime29 = require("react/jsx-runtime");
3200
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3233
3201
  var exhibitionTourSteps = {
3234
3202
  id: "@exhibition/tour-steps",
3235
3203
  supports: {
@@ -3246,20 +3214,20 @@ var exhibitionTourSteps = {
3246
3214
  }
3247
3215
  },
3248
3216
  label: "Tour steps",
3249
- component: () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ExhibitionRightPanelOptionalPage, {})
3217
+ component: () => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ExhibitionRightPanelOptionalPage, {})
3250
3218
  };
3251
3219
  function ExhibitionRightPanelOptionalPage() {
3252
- const canvas = (0, import_react_iiif_vault19.useCanvas)();
3220
+ const canvas = (0, import_react_iiif_vault18.useCanvas)();
3253
3221
  const firstAnnotationPage = canvas?.annotations[0];
3254
3222
  const itemsAnnotationPage = canvas?.items[0];
3255
3223
  if (!firstAnnotationPage || !canvas || !itemsAnnotationPage) {
3256
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(PromptCreationOfTourSteps, {});
3224
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(PromptCreationOfTourSteps, {});
3257
3225
  }
3258
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ExhibitionRightPanel3, {});
3226
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ExhibitionRightPanel3, {});
3259
3227
  }
3260
3228
  function PromptCreationOfTourSteps() {
3261
- const canvas = (0, import_react_iiif_vault19.useCanvas)();
3262
- const creator = (0, import_shell18.useInlineCreator)();
3229
+ const canvas = (0, import_react_iiif_vault18.useCanvas)();
3230
+ const creator = (0, import_shell17.useInlineCreator)();
3263
3231
  const createEmptyAnnotationPage = () => {
3264
3232
  if (!canvas)
3265
3233
  return;
@@ -3284,9 +3252,9 @@ function PromptCreationOfTourSteps() {
3284
3252
  }
3285
3253
  );
3286
3254
  };
3287
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col items-center justify-center p-4", children: [
3288
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "p-4 opacity-50 text-center", children: "This image does not yet have a tour." }),
3289
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3255
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col items-center justify-center p-4", children: [
3256
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "p-4 opacity-50 text-center", children: "This image does not yet have a tour." }),
3257
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3290
3258
  import_react_aria_components2.Button,
3291
3259
  {
3292
3260
  className: "border w-full disabled:opacity-50 border-gray-300 hover:border-me-500 hover:bg-me-50 cursor-pointer shadow-sm rounded p-4 bg-white relative text-black/40 hover:text-me-500",
@@ -3297,13 +3265,13 @@ function PromptCreationOfTourSteps() {
3297
3265
  ] });
3298
3266
  }
3299
3267
  function ExhibitionRightPanel3() {
3300
- const canvas = (0, import_react_iiif_vault19.useCanvas)();
3268
+ const canvas = (0, import_react_iiif_vault18.useCanvas)();
3301
3269
  const firstAnnotationPage = canvas?.annotations[0];
3302
3270
  const itemsAnnotationPage = canvas?.items[0];
3303
- const editor = (0, import_shell18.useGenericEditor)(firstAnnotationPage);
3304
- const creator = (0, import_shell18.useInlineCreator)();
3305
- const [reorderable, setReorderable] = (0, import_react10.useState)(false);
3306
- const { requestAnnotation, isPending, busy, cancelRequest, completeRequest } = (0, import_shell18.useRequestAnnotation)({
3271
+ const editor = (0, import_shell17.useGenericEditor)(firstAnnotationPage);
3272
+ const creator = (0, import_shell17.useInlineCreator)();
3273
+ const [reorderable, setReorderable] = (0, import_react9.useState)(false);
3274
+ const { requestAnnotation, isPending, busy, cancelRequest, completeRequest } = (0, import_shell17.useRequestAnnotation)({
3307
3275
  onSuccess: (resp) => {
3308
3276
  if (!resp.cancelled && resp.target && firstAnnotationPage) {
3309
3277
  creator.create(
@@ -3340,18 +3308,18 @@ function ExhibitionRightPanel3() {
3340
3308
  if (!canvas)
3341
3309
  return null;
3342
3310
  if (!firstAnnotationPage) {
3343
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: "No annotation page - create one?" });
3311
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: "No annotation page - create one?" });
3344
3312
  }
3345
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_components17.SidebarContent, { padding: true, children: [
3346
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex gap-4 border-b pt-4 pb-2 mb-2", children: [
3347
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h2", { className: "text-lg font-semibold flex-1", children: "Tour steps" }),
3348
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components17.ActionButton, { onPress: () => setReorderable((r2) => !r2), children: reorderable ? "Done" : "Reorder" })
3313
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components17.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_components17.SidebarContent, { padding: true, children: [
3314
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex gap-4 border-b pt-4 pb-2 mb-2", children: [
3315
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className: "text-lg font-semibold flex-1", children: "Tour steps" }),
3316
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components17.ActionButton, { onPress: () => setReorderable((r2) => !r2), children: reorderable ? "Done" : "Reorder" })
3349
3317
  ] }),
3350
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_shell18.ResourceEditingProvider, { resource: canvas, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react_iiif_vault19.AnnotationPageContext, { annotationPage: firstAnnotationPage.id, children: [
3351
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col gap-4", children: [
3352
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TourAnnotationPageEditor, { reorderable }),
3353
- !busy ? isPending ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "border grid grid-cols-2 gap-2 disabled:opacity-50 border-gray-300 shadow-sm rounded p-1 bg-white relative text-black/40", children: [
3354
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3318
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_shell17.ResourceEditingProvider, { resource: canvas, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react_iiif_vault18.AnnotationPageContext, { annotationPage: firstAnnotationPage.id, children: [
3319
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col gap-4", children: [
3320
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TourAnnotationPageEditor, { reorderable }),
3321
+ !busy ? isPending ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "border grid grid-cols-2 gap-2 disabled:opacity-50 border-gray-300 shadow-sm rounded p-1 bg-white relative text-black/40", children: [
3322
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3355
3323
  import_react_aria_components2.Button,
3356
3324
  {
3357
3325
  onPress: cancelRequest,
@@ -3359,7 +3327,7 @@ function ExhibitionRightPanel3() {
3359
3327
  children: "Cancel"
3360
3328
  }
3361
3329
  ),
3362
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3330
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3363
3331
  import_react_aria_components2.Button,
3364
3332
  {
3365
3333
  onPress: completeRequest,
@@ -3367,7 +3335,7 @@ function ExhibitionRightPanel3() {
3367
3335
  children: "Save changes"
3368
3336
  }
3369
3337
  )
3370
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3338
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3371
3339
  import_react_aria_components2.Button,
3372
3340
  {
3373
3341
  onPress: () => requestAnnotation({ type: "polygon" }),
@@ -3376,10 +3344,10 @@ function ExhibitionRightPanel3() {
3376
3344
  }
3377
3345
  ) : null
3378
3346
  ] }),
3379
- itemsAnnotationPage ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
3380
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h3", { className: "text-md border-b pt-4 pb-2 mb-2", children: "Available tour steps from images" }),
3381
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3382
- import_editors12.PromptToAddPaintingAnnotations,
3347
+ itemsAnnotationPage ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
3348
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className: "text-md border-b pt-4 pb-2 mb-2", children: "Available tour steps from images" }),
3349
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3350
+ import_editors11.PromptToAddPaintingAnnotations,
3383
3351
  {
3384
3352
  painting: itemsAnnotationPage,
3385
3353
  page: editor.ref(),
@@ -3391,6 +3359,195 @@ function ExhibitionRightPanel3() {
3391
3359
  ] }) });
3392
3360
  }
3393
3361
 
3362
+ // src/right-panels/SlideBehaviours.tsx
3363
+ var import_components18 = require("@manifest-editor/components");
3364
+ var import_editors12 = require("@manifest-editor/editors");
3365
+ var import_shell18 = require("@manifest-editor/shell");
3366
+ var import_react10 = require("react");
3367
+
3368
+ // src/components/AspectRatioWarning.tsx
3369
+ var import_react_iiif_vault19 = require("react-iiif-vault");
3370
+ var import_tiny_invariant2 = __toESM(require("tiny-invariant"), 1);
3371
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3372
+ function AspectRatioWarning() {
3373
+ const canvas = (0, import_react_iiif_vault19.useCanvas)();
3374
+ (0, import_tiny_invariant2.default)(canvas);
3375
+ const ratio = canvas.width && canvas.height ? canvas.width / canvas.height : 0;
3376
+ const target = getHeightWidthRatio(canvas.behavior || []);
3377
+ if (Math.abs(ratio - target.ratio) < 0.01)
3378
+ return null;
3379
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "p-2 rounded bg-me-100", children: [
3380
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-me-700-500", children: "Aspect ratio warning" }),
3381
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "text-sm text-black/60", children: [
3382
+ "The aspect ratio of this canvas is ",
3383
+ ratio.toFixed(2),
3384
+ " but the target aspect ratio is ",
3385
+ target.ratio.toFixed(2),
3386
+ ". Some parts of this image may be cropped.",
3387
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "relative h-32 w-full mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3388
+ "div",
3389
+ {
3390
+ className: "bg-[red] left-0 top-0 z-2 opacity-50 max-w-32 max-h-32",
3391
+ style: { aspectRatio: ratio.toFixed(2) },
3392
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3393
+ "div",
3394
+ {
3395
+ className: "asbolute bg-[white] left-0 top-0 z-1 opacity-50 max-w-32 max-h-32",
3396
+ style: { aspectRatio: target.ratio }
3397
+ }
3398
+ )
3399
+ }
3400
+ ) })
3401
+ ] })
3402
+ ] });
3403
+ }
3404
+
3405
+ // src/right-panels/SlideBehaviours.tsx
3406
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3407
+ var customBehaviourEditor = {
3408
+ component: () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SlideBehavioursPanel, {}),
3409
+ supports: {
3410
+ edit: true,
3411
+ resourceTypes: ["Canvas"],
3412
+ properties: ["behavior"]
3413
+ },
3414
+ id: "slide-behaviors",
3415
+ label: "Layout",
3416
+ tabs: {
3417
+ showTitle: true
3418
+ }
3419
+ };
3420
+ var exhibitionConfigs = [
3421
+ {
3422
+ id: "layout",
3423
+ type: "choice",
3424
+ label: { en: ["Layout"] },
3425
+ initialOpen: true,
3426
+ items: [
3427
+ {
3428
+ label: { en: ["Text on left"] },
3429
+ value: "left"
3430
+ },
3431
+ {
3432
+ label: { en: ["Text on right"] },
3433
+ value: "right"
3434
+ },
3435
+ {
3436
+ label: { en: ["Text on bottom"] },
3437
+ value: "bottom"
3438
+ },
3439
+ {
3440
+ label: { en: ["Only image"] },
3441
+ value: "image"
3442
+ }
3443
+ ]
3444
+ },
3445
+ {
3446
+ id: "size",
3447
+ component: (existing, setBehaviors) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(EditSize, { behaviors: existing, setBehaviors }),
3448
+ label: { en: ["Size"] },
3449
+ type: "custom",
3450
+ initialOpen: true,
3451
+ supports: (b) => b.startsWith("w-") || b.startsWith("h-")
3452
+ }
3453
+ ];
3454
+ function parseBehaviors(items) {
3455
+ let width = 0;
3456
+ let height = 0;
3457
+ for (const item of items) {
3458
+ if (item.startsWith("w-")) {
3459
+ width = Number.parseInt(item.slice(2));
3460
+ }
3461
+ if (item.startsWith("h-")) {
3462
+ height = Number.parseInt(item.slice(2));
3463
+ }
3464
+ }
3465
+ return {
3466
+ width,
3467
+ height
3468
+ };
3469
+ }
3470
+ function EditSize({ behaviors, setBehaviors }) {
3471
+ const { width, height } = parseBehaviors(behaviors);
3472
+ const [hoverPosition, setHoverPosition] = (0, import_react10.useState)({ x: -1, y: -1 });
3473
+ const setBehavior = (w2, h) => {
3474
+ const newBehaviors = behaviors.filter((b) => {
3475
+ return !b.startsWith("w-") && !b.startsWith("h-");
3476
+ });
3477
+ newBehaviors.push(`w-${w2}`);
3478
+ newBehaviors.push(`h-${h}`);
3479
+ setBehaviors(newBehaviors);
3480
+ };
3481
+ const cells = Array.from({ length: 144 }, (_2, i2) => {
3482
+ const x2 = i2 % 12;
3483
+ const y2 = Math.floor(i2 / 12);
3484
+ const hovered = hoverPosition.x >= x2 && hoverPosition.y >= y2;
3485
+ const selected = x2 < width && y2 < height;
3486
+ const hoveredAndSelected = hovered && selected;
3487
+ let bgClass = "bg-gray-200";
3488
+ if (hovered) {
3489
+ bgClass = "bg-me-200";
3490
+ }
3491
+ if (selected) {
3492
+ bgClass = "bg-me-500";
3493
+ }
3494
+ if (hoveredAndSelected) {
3495
+ bgClass = "bg-me-400";
3496
+ }
3497
+ return (
3498
+ // biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
3499
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3500
+ "div",
3501
+ {
3502
+ className: `flex aspect-square rounded cursor-se-resize items-center justify-center ${bgClass}`,
3503
+ onClick: () => setBehavior(x2 + 1, y2 + 1),
3504
+ onMouseUp: () => setBehavior(x2 + 1, y2 + 1),
3505
+ onMouseEnter: () => setHoverPosition({ x: x2, y: y2 })
3506
+ },
3507
+ i2
3508
+ )
3509
+ );
3510
+ });
3511
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "grid grid-cols-12 grid-rows-12 gap-1", onMouseLeave: () => setHoverPosition({ x: -1, y: -1 }), children: cells });
3512
+ }
3513
+ function SlideBehavioursPanel() {
3514
+ const canvas = (0, import_editors12.useInStack)("Canvas");
3515
+ const editor = (0, import_shell18.useEditor)();
3516
+ const { width, height } = editor.technical;
3517
+ if (!canvas || editor.technical.type !== "Canvas") {
3518
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_components18.Sidebar, { children: [
3519
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components18.SidebarHeader, { title: "Slide behaviors" }),
3520
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: "Please select canvas" })
3521
+ ] });
3522
+ }
3523
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components18.Sidebar, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_components18.SidebarContent, { children: [
3524
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_editors12.InputContainer, { $wide: true, children: [
3525
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3526
+ import_editors12.DimensionsTriplet,
3527
+ {
3528
+ widthId: width.containerId(),
3529
+ width: width.get() || 0,
3530
+ changeWidth: (v2) => width.set(v2),
3531
+ heightId: height.containerId(),
3532
+ height: height.get() || 0,
3533
+ changeHeight: (v2) => height.set(v2)
3534
+ }
3535
+ ),
3536
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AspectRatioWarning, {}) })
3537
+ ] }) }),
3538
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3539
+ import_editors12.BehaviorEditor,
3540
+ {
3541
+ behavior: editor.technical.behavior.get() || [],
3542
+ onChange: (v2) => {
3543
+ editor.technical.behavior.set(v2);
3544
+ },
3545
+ configs: exhibitionConfigs
3546
+ }
3547
+ )
3548
+ ] }) });
3549
+ }
3550
+
3394
3551
  // src/index.tsx
3395
3552
  var exhibitionEditorPreset = (0, import_shell19.extendApp)(
3396
3553
  (0, import_shell19.mapApp)(ManifestPreset),
@@ -3432,14 +3589,19 @@ var exhibitionEditorPreset = (0, import_shell19.extendApp)(
3432
3589
  youtubeMainEdtior,
3433
3590
  infoBlockEditor
3434
3591
  ],
3435
- editors: [exhibitionCanvasEditor, customBehaviourEditor, exhibitionSummaryEdtior, exhibitionTourSteps],
3592
+ editors: [
3593
+ exhibitionCanvasEditor,
3594
+ customBehaviourEditor,
3595
+ exhibitionSummaryEdtior,
3596
+ exhibitionTourSteps
3597
+ ],
3436
3598
  creators: [
3437
3599
  infoBoxCreator,
3438
- imageSlideBottomCreator,
3600
+ youtubeSlideCreator,
3601
+ imageServiceSlideCreator,
3602
+ imageBrowserSlideCreator,
3439
3603
  imageSlideCreator,
3440
- imageSlideLeftCreator,
3441
- imageSlideRightCreator,
3442
- youtubeSlideCreator
3604
+ imageUrlSlideCreator
3443
3605
  ]
3444
3606
  }
3445
3607
  );