@samvera/bloom-iiif
Advanced tools
Comparing version 0.3.4 to 0.3.5-rc.0
@@ -1,2 +0,2 @@ | ||
"use strict";var $e=Object.create;var $=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var Ae=(o,e)=>{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},W=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Pe(e))!Fe.call(o,n)&&n!==t&&$(o,n,{get:()=>e[n],enumerable:!(r=Ie(e,n))||r.enumerable});return o};var m=(o,e,t)=>(t=o!=null?$e(ke(o)):{},W(e||!o||!o.__esModule?$(t,"default",{value:o,enumerable:!0}):t,o)),Me=o=>W($({},"__esModule",{value:!0}),o);var qe={};Ae(qe,{default:()=>Ue});module.exports=Me(qe);var c=m(require("react"));var g=m(require("react")),O=require("@iiif/vault"),z={isLoaded:!1,vault:new O.Vault},R=g.default.createContext(z),De=g.default.createContext(z);function He(o,e){switch(e.type){case"updateIsLoaded":return{...o,isLoaded:e.isLoaded};default:throw new Error(`Unhandled action type: ${e.type}`)}}var U=({initialState:o=z,children:e})=>{let[t,r]=g.default.useReducer(He,o);return g.default.createElement(R.Provider,{value:t},g.default.createElement(De.Provider,{value:r},e))};function I(){let o=g.default.useContext(R);if(o===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return o}var s=m(require("react"));var J=require("@stitches/react"),p=o=>1.618**o;var q={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${p(2)})`,6:`calc(1rem * ${p(3)})`,7:`calc(1rem * ${p(4)})`,8:`calc(1rem * ${p(5)})`,9:`calc(1rem * ${p(6)})`,10:`calc(1rem * ${p(7)})`,11:`calc(1rem * ${p(8)})`,12:`calc(1rem * ${p(9)})`},ze={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${p(1)})`,8:`calc(1rem * ${p(2)})`,9:`calc(1rem * ${p(3)})`},sizes:{...q},space:{...q},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},Le={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:i,css:Qe,keyframes:Xe,createTheme:Ye}=(0,J.createStitches)({theme:ze,media:Le});var K=i("div",{display:"flex",flexDirection:"column"}),Q=i("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),X=i("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});var C=require("@samvera/nectar-iiif");var P=m(require("react")),k=()=>P.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},P.default.createElement("title",null,"Next"),P.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));var F=m(require("react")),A=()=>F.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},F.default.createElement("title",null,"Previous"),F.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var S=i("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),L=i("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${S}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${S}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Be=({homepage:o,instance:e,label:t,summary:r})=>{let[n,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{o.length>0&&d(!0)},[o]),s.default.createElement(X,null,s.default.createElement(K,null,n?s.default.createElement(C.Homepage,{homepage:o,className:"bloom-header-homepage"},s.default.createElement(C.Label,{label:t,as:"span",className:"bloom-header-label"})):s.default.createElement(C.Label,{label:t,as:"span",className:"bloom-header-label"}),r&&s.default.createElement(C.Summary,{summary:r,as:"span",className:"bloom-header-summary"})),s.default.createElement(Q,null,s.default.createElement(L,{className:`bloom-previous-${e}`,"aria-label":"previous"},s.default.createElement(S,null,s.default.createElement(A,null))),s.default.createElement(L,{className:`bloom-next-${e}`,"aria-label":"next"},s.default.createElement(S,null,s.default.createElement(k,null)))))},Y=Be;var y=m(require("react"));var l=m(require("react"));var u=m(require("react"));var M=require("@samvera/nectar-iiif");var Z=i("div",{position:"absolute",width:"100%",backgroundColor:"green"}),_=i("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),ee=i("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),oe=i(M.Label,{fontSize:"$3",fontWeight:"700"}),te=i(M.Summary,{fontSize:"$2",marginTop:"$1",color:"$primary"});var re=m(require("@radix-ui/react-aspect-ratio")),ne=require("@samvera/nectar-iiif"),Ne=({isFocused:o,label:e,summary:t,thumbnail:r})=>{let n=(0,u.useRef)(null);return u.default.createElement(_,{isFocused:o},u.default.createElement(re.Root,{ratio:1/1},u.default.createElement(Z,{ref:n}),u.default.createElement(ee,null,r&&u.default.createElement(ne.Thumbnail,{altAsLabel:e,thumbnail:r}))),u.default.createElement("figcaption",null,u.default.createElement(oe,{label:e}),t&&u.default.createElement(te,{summary:t})))},ie=Ne;var se=i("a",{color:"black",textDecoration:"none"}),ae=i("div",{position:"relative",zIndex:"0",borderRadius:"3px"});var a=m(require("react"));var le=i("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),ce=i("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),de=i("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),me=i("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});var pe=m(require("@radix-ui/react-aspect-ratio"));var Ee=({activeCanvas:o,handleActiveCanvas:e,isFocused:t,manifest:r})=>{let[n,d]=(0,a.useState)(!1),[h,x]=(0,a.useState)(!1),w=o+1,v=0;return r&&(v=r.items.length),(0,a.useEffect)(()=>{w<=1?d(!1):d(!0),w>=v?x(!1):x(!0)},[o,r]),a.default.createElement(le,{isFocused:t},a.default.createElement(pe.Root,{ratio:1/1},r&&a.default.createElement(ce,null,a.default.createElement(de,{onClick:f=>f.preventDefault()},a.default.createElement("button",{onClick:()=>e(-1),disabled:!n},a.default.createElement(A,null)),a.default.createElement("button",{onClick:()=>e(1),disabled:!h},a.default.createElement(k,null))),a.default.createElement(me,{onClick:f=>f.preventDefault()},w," of ",v))))},ue=Ee;var fe=(o,e)=>{if(o.thumbnail.length!==0)return o.thumbnail;let t=e.get(o.items[0]);return e.get(t.items[0]).body};var Te=({index:o,item:e})=>{var V;let t=I(),{vault:r}=t,[n,d]=(0,l.useState)(!1),[h,x]=(0,l.useState)(0),[w,v]=(0,l.useState)(e.thumbnail),[f,Ce]=(0,l.useState)(),[ye,ve]=(0,l.useState)(e.id);(0,l.useEffect)(()=>{n&&setTimeout(()=>{f||r.load(e.id).then(b=>Ce(b)).catch(b=>{console.error(`Manifest failed to load: ${b}`)})},1e3)},[n]),(0,l.useEffect)(()=>{if(!(e!=null&&e.thumbnail))return;let b=r.get(e.thumbnail);v(b)},[]);let B=()=>d(!0),N=()=>d(!1),E=b=>{if(!f)return;let j=h+b,G=r.get(f.items[j]),we=fe(G,r),Se=r.get(we);ve(G.id),v(Se),x(j)};(0,l.useEffect)(()=>{f&&E(0)},[f]);let T;return((V=e.homepage)==null?void 0:V.length)>0&&(T=e.homepage[0].id),l.default.createElement(ae,null,l.default.createElement(se,{href:T,tabIndex:0,onFocus:B,onBlur:N,onMouseEnter:B,onMouseLeave:N},l.default.createElement(ie,{index:o,isFocused:n,key:ye,label:e.label,summary:e.summary,thumbnail:w}),l.default.createElement(ue,{manifest:f,activeCanvas:h,handleActiveCanvas:E,isFocused:n})))},xe=Te;var he=i("div",{"& .swiper-slide":{}});var D=require("swiper"),H=require("swiper/react"),Ve={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},je=({breakpoints:o=Ve,instance:e,items:t})=>{let r=(0,y.useRef)(null);return y.default.createElement(he,{ref:r},y.default.createElement(H.Swiper,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[D.Navigation,D.A11y],navigation:{nextEl:`.bloom-next-${e}`,prevEl:`.bloom-previous-${e}`},slidesPerView:2,slidesPerGroup:2,breakpoints:o},t.map((n,d)=>y.default.createElement(H.SwiperSlide,{key:`${n.id}-${d}`},y.default.createElement(xe,{index:d,item:n})))))},be=je;var Ge=o=>{var e=0,t=o.length,r=0;if(t>0)for(;r<t;)e=(e<<5)-e+o.charCodeAt(r++)|0;return e},ge=Ge;var We=o=>c.default.createElement(U,null,c.default.createElement(Oe,{...o})),Oe=({collectionId:o,options:e={}})=>{let t=I(),{vault:r}=t,[n,d]=(0,c.useState)();if((0,c.useEffect)(()=>{r.loadCollection(o).then(x=>d(x)).catch(x=>{console.error(`Collection failed to load: ${x}`)}).finally(()=>{})},[]),!n||!n.items)return console.log(`The IIIF Collection ${o} failed to load.`),c.default.createElement(c.default.Fragment,null);if(n.items.length===0)return console.log(`The IIIF collection ${o} does not contain items.`),c.default.createElement(c.default.Fragment,null);let h=ge(o);return c.default.createElement(Re,null,c.default.createElement(Y,{label:n.label,summary:n.summary,homepage:n.homepage,instance:h}),c.default.createElement(be,{items:n.items,instance:h,breakpoints:Boolean(e.breakpoints)?e.breakpoints:void 0}))},Re=i("div",{padding:"$4 0"}),Ue=We; | ||
"use strict";var we=Object.create;var $=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Ie=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty;var ke=(o,e)=>{for(var t in e)$(o,t,{get:e[t],enumerable:!0})},W=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of $e(e))!Pe.call(o,n)&&n!==t&&$(o,n,{get:()=>e[n],enumerable:!(r=Se(e,n))||r.enumerable});return o};var m=(o,e,t)=>(t=o!=null?we(Ie(o)):{},W(e||!o||!o.__esModule?$(t,"default",{value:o,enumerable:!0}):t,o)),Fe=o=>W($({},"__esModule",{value:!0}),o);var Re={};ke(Re,{default:()=>Oe});module.exports=Fe(Re);var c=m(require("react"));var b=m(require("react")),O=require("@iiif/vault"),H={isLoaded:!1,vault:new O.Vault},R=b.default.createContext(H),Ae=b.default.createContext(H);function Me(o,e){switch(e.type){case"updateIsLoaded":return{...o,isLoaded:e.isLoaded};default:throw new Error(`Unhandled action type: ${e.type}`)}}var U=({initialState:o=H,children:e})=>{let[t,r]=b.default.useReducer(Me,o);return b.default.createElement(R.Provider,{value:t},b.default.createElement(Ae.Provider,{value:r},e))};function I(){let o=b.default.useContext(R);if(o===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return o}var s=m(require("react"));var J=require("@stitches/react"),p=o=>1.618**o;var q={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${p(2)})`,6:`calc(1rem * ${p(3)})`,7:`calc(1rem * ${p(4)})`,8:`calc(1rem * ${p(5)})`,9:`calc(1rem * ${p(6)})`,10:`calc(1rem * ${p(7)})`,11:`calc(1rem * ${p(8)})`,12:`calc(1rem * ${p(9)})`},ze={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${p(1)})`,8:`calc(1rem * ${p(2)})`,9:`calc(1rem * ${p(3)})`},sizes:{...q},space:{...q},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},De={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:i,css:Je,keyframes:Ke,createTheme:Qe}=(0,J.createStitches)({theme:ze,media:De});var K=i("div",{display:"flex",flexDirection:"column"}),Q=i("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),X=i("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});var g=require("@samvera/nectar-iiif");var P=m(require("react")),k=()=>P.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},P.default.createElement("title",null,"Next"),P.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));var F=m(require("react")),A=()=>F.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},F.default.createElement("title",null,"Previous"),F.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var S=i("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),L=i("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${S}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${S}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var He=({homepage:o,instance:e,label:t,summary:r})=>{let[n,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{o.length>0&&d(!0)},[o]),s.default.createElement(X,null,s.default.createElement(K,null,n?s.default.createElement(g.Homepage,{homepage:o,className:"bloom-header-homepage"},s.default.createElement(g.Label,{label:t,as:"span",className:"bloom-header-label"})):s.default.createElement(g.Label,{label:t,as:"span",className:"bloom-header-label"}),r&&s.default.createElement(g.Summary,{summary:r,as:"span",className:"bloom-header-summary"})),s.default.createElement(Q,null,s.default.createElement(L,{className:`bloom-previous-${e}`,"aria-label":"previous"},s.default.createElement(S,null,s.default.createElement(A,null))),s.default.createElement(L,{className:`bloom-next-${e}`,"aria-label":"next"},s.default.createElement(S,null,s.default.createElement(k,null)))))},Y=He;var C=m(require("react"));var a=m(require("react"));var u=m(require("react"));var M=require("@samvera/nectar-iiif");var Z=i("div",{position:"absolute",width:"100%",backgroundColor:"green"}),_=i("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),ee=i("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),oe=i(M.Label,{fontSize:"$3",fontWeight:"700"}),te=i(M.Summary,{fontSize:"$2",marginTop:"$1",color:"$primary"});var re=m(require("@radix-ui/react-aspect-ratio")),ne=require("@samvera/nectar-iiif"),Le=({isFocused:o,label:e,summary:t,thumbnail:r})=>{let n=(0,u.useRef)(null);return u.default.createElement(_,{isFocused:o},u.default.createElement(re.Root,{ratio:1/1},u.default.createElement(Z,{ref:n}),u.default.createElement(ee,null,r&&u.default.createElement(ne.Thumbnail,{altAsLabel:e,thumbnail:r}))),u.default.createElement("figcaption",null,u.default.createElement(oe,{label:e}),t&&u.default.createElement(te,{summary:t})))},ie=Le;var se=i("a",{color:"black",textDecoration:"none"}),le=i("div",{position:"relative",zIndex:"0",borderRadius:"3px"});var l=m(require("react"));var ae=i("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),ce=i("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),de=i("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),me=i("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});var pe=m(require("@radix-ui/react-aspect-ratio"));var Ne=({activeResource:o,handleActiveResource:e,isFocused:t,resource:r})=>{let[n,d]=(0,l.useState)(!1),[h,x]=(0,l.useState)(!1),v=o+1,y=0;return r&&(y=r.items.length),(0,l.useEffect)(()=>{v<=1?d(!1):d(!0),v>=y?x(!1):x(!0)},[o,r]),l.default.createElement(ae,{isFocused:t},l.default.createElement(pe.Root,{ratio:1/1},r&&l.default.createElement(ce,null,l.default.createElement(de,{onClick:f=>f.preventDefault()},l.default.createElement("button",{onClick:()=>e(-1),disabled:!n},l.default.createElement(A,null)),l.default.createElement("button",{onClick:()=>e(1),disabled:!h},l.default.createElement(k,null))),l.default.createElement(me,{onClick:f=>f.preventDefault()},v," of ",y))))},ue=Ne;var Be=({index:o,item:e})=>{var V;let t=I(),{vault:r}=t,[n,d]=(0,a.useState)(!1),[h,x]=(0,a.useState)(0),[v,y]=(0,a.useState)(e.thumbnail),[f,ge]=(0,a.useState)(),[Ce,ye]=(0,a.useState)(e.id);(0,a.useEffect)(()=>{n&&!f&&r.load(e.id).then(w=>ge(w))},[n]),(0,a.useEffect)(()=>{if(!(e!=null&&e.thumbnail))return;let w=r.get(e.thumbnail);y(w)},[]);let N=()=>d(!0),B=()=>d(!1),E=w=>{if(!f)return;let j=h+w,G=r.get(f.items[j]),ve=r.get(G.thumbnail);x(j),ye(G.id),y(ve)};(0,a.useEffect)(()=>{f&&E(0)},[f]);let T;return((V=e.homepage)==null?void 0:V.length)>0&&(T=e.homepage[0].id),a.default.createElement(le,null,a.default.createElement(se,{href:T,tabIndex:0,onFocus:N,onBlur:B,onMouseEnter:N,onMouseLeave:B},a.default.createElement(ie,{index:o,isFocused:n,key:Ce,label:e.label,summary:e.summary,thumbnail:v}),a.default.createElement(ue,{resource:f,activeResource:h,handleActiveResource:E,isFocused:n})))},fe=Be;var xe=i("div",{"& .swiper-slide":{}});var z=require("swiper"),D=require("swiper/react"),Ee={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},Te=({breakpoints:o=Ee,instance:e,items:t})=>{let r=(0,C.useRef)(null);return C.default.createElement(xe,{ref:r},C.default.createElement(D.Swiper,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[z.Navigation,z.A11y],navigation:{nextEl:`.bloom-next-${e}`,prevEl:`.bloom-previous-${e}`},slidesPerView:2,slidesPerGroup:2,breakpoints:o},t.map((n,d)=>C.default.createElement(D.SwiperSlide,{key:`${n.id}-${d}`},C.default.createElement(fe,{index:d,item:n})))))},he=Te;var Ve=o=>{var e=0,t=o.length,r=0;if(t>0)for(;r<t;)e=(e<<5)-e+o.charCodeAt(r++)|0;return e},be=Ve;var je=o=>c.default.createElement(U,null,c.default.createElement(Ge,{...o})),Ge=({collectionId:o,options:e={}})=>{let t=I(),{vault:r}=t,[n,d]=(0,c.useState)();if((0,c.useEffect)(()=>{r.loadCollection(o).then(x=>d(x)).catch(x=>{console.error(`Collection failed to load: ${x}`)}).finally(()=>{})},[]),!n||!n.items)return console.log(`The IIIF Collection ${o} failed to load.`),c.default.createElement(c.default.Fragment,null);if(n.items.length===0)return console.log(`The IIIF collection ${o} does not contain items.`),c.default.createElement(c.default.Fragment,null);let h=be(o);return c.default.createElement(We,null,c.default.createElement(Y,{label:n.label,summary:n.summary,homepage:n.homepage,instance:h}),c.default.createElement(he,{items:n.items,instance:h,breakpoints:Boolean(e.breakpoints)?e.breakpoints:void 0}))},We=i("div",{padding:"$4 0"}),Oe=je; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import m,{useEffect as Ue,useState as qe}from"react";import b from"react";import{Vault as ge}from"@iiif/vault";var P={isLoaded:!1,vault:new ge},T=b.createContext(P),Ce=b.createContext(P);function ye(o,e){switch(e.type){case"updateIsLoaded":return{...o,isLoaded:e.isLoaded};default:throw new Error(`Unhandled action type: ${e.type}`)}}var V=({initialState:o=P,children:e})=>{let[i,t]=b.useReducer(ye,o);return b.createElement(T.Provider,{value:i},b.createElement(Ce.Provider,{value:t},e))};function v(){let o=b.useContext(T);if(o===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return o}import s,{useEffect as $e,useState as Ie}from"react";import{createStitches as ve}from"@stitches/react";var l=o=>1.618**o;var j={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${l(2)})`,6:`calc(1rem * ${l(3)})`,7:`calc(1rem * ${l(4)})`,8:`calc(1rem * ${l(5)})`,9:`calc(1rem * ${l(6)})`,10:`calc(1rem * ${l(7)})`,11:`calc(1rem * ${l(8)})`,12:`calc(1rem * ${l(9)})`},we={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${l(1)})`,8:`calc(1rem * ${l(2)})`,9:`calc(1rem * ${l(3)})`},sizes:{...j},space:{...j},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},Se={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:r,css:eo,keyframes:oo,createTheme:to}=ve({theme:we,media:Se});var G=r("div",{display:"flex",flexDirection:"column"}),W=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),O=r("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});import{Homepage as Pe,Label as R,Summary as ke}from"@samvera/nectar-iiif";import k from"react";var w=()=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},k.createElement("title",null,"Next"),k.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));import F from"react";var S=()=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},F.createElement("title",null,"Previous"),F.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var C=r("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),A=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${C}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${C}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Fe=({homepage:o,instance:e,label:i,summary:t})=>{let[n,a]=Ie(!1);return $e(()=>{o.length>0&&a(!0)},[o]),s.createElement(O,null,s.createElement(G,null,n?s.createElement(Pe,{homepage:o,className:"bloom-header-homepage"},s.createElement(R,{label:i,as:"span",className:"bloom-header-label"})):s.createElement(R,{label:i,as:"span",className:"bloom-header-label"}),t&&s.createElement(ke,{summary:t,as:"span",className:"bloom-header-summary"})),s.createElement(W,null,s.createElement(A,{className:`bloom-previous-${e}`,"aria-label":"previous"},s.createElement(C,null,s.createElement(S,null))),s.createElement(A,{className:`bloom-next-${e}`,"aria-label":"next"},s.createElement(C,null,s.createElement(w,null)))))},U=Fe;import I,{useRef as Ee}from"react";import $,{useEffect as M,useState as y}from"react";import u,{useRef as De}from"react";import{Label as Ae,Summary as Me}from"@samvera/nectar-iiif";var q=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),J=r("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),K=r("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),Q=r(Ae,{fontSize:"$3",fontWeight:"700"}),X=r(Me,{fontSize:"$2",marginTop:"$1",color:"$primary"});import*as Y from"@radix-ui/react-aspect-ratio";import{Thumbnail as He}from"@samvera/nectar-iiif";var ze=({isFocused:o,label:e,summary:i,thumbnail:t})=>{let n=De(null);return u.createElement(J,{isFocused:o},u.createElement(Y.Root,{ratio:1/1},u.createElement(q,{ref:n}),u.createElement(K,null,t&&u.createElement(He,{altAsLabel:e,thumbnail:t}))),u.createElement("figcaption",null,u.createElement(Q,{label:e}),i&&u.createElement(X,{summary:i})))},Z=ze;var _=r("a",{color:"black",textDecoration:"none"}),ee=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});import d,{useEffect as Le,useState as ie}from"react";var oe=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),te=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),re=r("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),ne=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});import*as se from"@radix-ui/react-aspect-ratio";var Be=({activeCanvas:o,handleActiveCanvas:e,isFocused:i,manifest:t})=>{let[n,a]=ie(!1),[f,p]=ie(!1),g=o+1,h=0;return t&&(h=t.items.length),Le(()=>{g<=1?a(!1):a(!0),g>=h?p(!1):p(!0)},[o,t]),d.createElement(oe,{isFocused:i},d.createElement(se.Root,{ratio:1/1},t&&d.createElement(te,null,d.createElement(re,{onClick:c=>c.preventDefault()},d.createElement("button",{onClick:()=>e(-1),disabled:!n},d.createElement(S,null)),d.createElement("button",{onClick:()=>e(1),disabled:!f},d.createElement(w,null))),d.createElement(ne,{onClick:c=>c.preventDefault()},g," of ",h))))},ae=Be;var le=(o,e)=>{if(o.thumbnail.length!==0)return o.thumbnail;let i=e.get(o.items[0]);return e.get(i.items[0]).body};var Ne=({index:o,item:e})=>{var B;let i=v(),{vault:t}=i,[n,a]=y(!1),[f,p]=y(0),[g,h]=y(e.thumbnail),[c,ue]=y(),[fe,xe]=y(e.id);M(()=>{n&&setTimeout(()=>{c||t.load(e.id).then(x=>ue(x)).catch(x=>{console.error(`Manifest failed to load: ${x}`)})},1e3)},[n]),M(()=>{if(!(e!=null&&e.thumbnail))return;let x=t.get(e.thumbnail);h(x)},[]);let D=()=>a(!0),H=()=>a(!1),z=x=>{if(!c)return;let N=f+x,E=t.get(c.items[N]),he=le(E,t),be=t.get(he);xe(E.id),h(be),p(N)};M(()=>{c&&z(0)},[c]);let L;return((B=e.homepage)==null?void 0:B.length)>0&&(L=e.homepage[0].id),$.createElement(ee,null,$.createElement(_,{href:L,tabIndex:0,onFocus:D,onBlur:H,onMouseEnter:D,onMouseLeave:H},$.createElement(Z,{index:o,isFocused:n,key:fe,label:e.label,summary:e.summary,thumbnail:g}),$.createElement(ae,{manifest:c,activeCanvas:f,handleActiveCanvas:z,isFocused:n})))},ce=Ne;var de=r("div",{"& .swiper-slide":{}});import{Navigation as Te,A11y as Ve}from"swiper";import{Swiper as je,SwiperSlide as Ge}from"swiper/react";var We={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},Oe=({breakpoints:o=We,instance:e,items:i})=>{let t=Ee(null);return I.createElement(de,{ref:t},I.createElement(je,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[Te,Ve],navigation:{nextEl:`.bloom-next-${e}`,prevEl:`.bloom-previous-${e}`},slidesPerView:2,slidesPerGroup:2,breakpoints:o},i.map((n,a)=>I.createElement(Ge,{key:`${n.id}-${a}`},I.createElement(ce,{index:a,item:n})))))},me=Oe;var Re=o=>{var e=0,i=o.length,t=0;if(i>0)for(;t<i;)e=(e<<5)-e+o.charCodeAt(t++)|0;return e},pe=Re;var Je=o=>m.createElement(V,null,m.createElement(Ke,{...o})),Ke=({collectionId:o,options:e={}})=>{let i=v(),{vault:t}=i,[n,a]=qe();if(Ue(()=>{t.loadCollection(o).then(p=>a(p)).catch(p=>{console.error(`Collection failed to load: ${p}`)}).finally(()=>{})},[]),!n||!n.items)return console.log(`The IIIF Collection ${o} failed to load.`),m.createElement(m.Fragment,null);if(n.items.length===0)return console.log(`The IIIF collection ${o} does not contain items.`),m.createElement(m.Fragment,null);let f=pe(o);return m.createElement(Qe,null,m.createElement(U,{label:n.label,summary:n.summary,homepage:n.homepage,instance:f}),m.createElement(me,{items:n.items,instance:f,breakpoints:Boolean(e.breakpoints)?e.breakpoints:void 0}))},Qe=r("div",{padding:"$4 0"}),pt=Je;export{pt as default}; | ||
import m,{useEffect as Oe,useState as Re}from"react";import h from"react";import{Vault as he}from"@iiif/vault";var P={isLoaded:!1,vault:new he},T=h.createContext(P),be=h.createContext(P);function ge(o,e){switch(e.type){case"updateIsLoaded":return{...o,isLoaded:e.isLoaded};default:throw new Error(`Unhandled action type: ${e.type}`)}}var V=({initialState:o=P,children:e})=>{let[i,r]=h.useReducer(ge,o);return h.createElement(T.Provider,{value:i},h.createElement(be.Provider,{value:r},e))};function v(){let o=h.useContext(T);if(o===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return o}import s,{useEffect as we,useState as Se}from"react";import{createStitches as Ce}from"@stitches/react";var a=o=>1.618**o;var j={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${a(2)})`,6:`calc(1rem * ${a(3)})`,7:`calc(1rem * ${a(4)})`,8:`calc(1rem * ${a(5)})`,9:`calc(1rem * ${a(6)})`,10:`calc(1rem * ${a(7)})`,11:`calc(1rem * ${a(8)})`,12:`calc(1rem * ${a(9)})`},ye={colors:{primary:"#1a1d1e",primaryMuted:"#26292b",primaryAlt:"#151718",accent:"#006adc",accentMuted:"#5eb0ef",accentAlt:"#00254d",secondary:"#FFFFFF",secondaryMuted:"#e6e8eb",secondaryAlt:"#c1c8cd"},fonts:{sans:"'Inter', Arial, sans-serif",display:"'Calistoga', 'Inter', Arial, sans-serif"},fontSizes:{1:"0.611rem",2:"0.722rem",3:"0.833rem",4:"1rem",5:"1.177rem",6:"1.318rem",7:`calc(1rem * ${a(1)})`,8:`calc(1rem * ${a(2)})`,9:`calc(1rem * ${a(3)})`},sizes:{...j},space:{...j},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},ve={xxs:"(max-width: 349px)",xs:"(max-width: 575px)",sm:"(max-width: 767px)",md:"(max-width: 991px)",xl:"(max-width: 1199px)",lg:"(min-width: 1200px)"},{styled:t,css:Ze,keyframes:_e,createTheme:eo}=Ce({theme:ye,media:ve});var G=t("div",{display:"flex",flexDirection:"column"}),W=t("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),O=t("div",{display:"flex",flexDirection:"row",justifyContent:"space-between",paddingBottom:"$4",margin:"0",color:"$primary",lineHeight:"1.4em",alignItems:"flex-end","@xs":{flexDirection:"column"},".bloom-header-homepage":{color:"$accent",textDecoration:"none"},".bloom-header-label":{fontSize:"$6",fontWeight:"400",fontFamily:"$display"},".bloom-header-summary":{fontSize:"$4",marginTop:"$2"}});import{Homepage as $e,Label as R,Summary as Ie}from"@samvera/nectar-iiif";import k from"react";var w=()=>k.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},k.createElement("title",null,"Next"),k.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));import F from"react";var S=()=>F.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},F.createElement("title",null,"Previous"),F.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var C=t("div",{display:"flex",background:"none",border:"none",width:"2rem !important",height:"2rem !important",padding:"0",margin:"0",borderRadius:"2rem",backgroundColor:"$accent",color:"$secondary",cursor:"pointer",boxSizing:"content-box !important",transition:"$all",justifyContent:"center",alignItems:"center",svg:{height:"60%",width:"60%",fill:"$secondary",stroke:"$secondary",opacity:"1",filter:"drop-shadow(5px 5px 5px #000D)",transition:"$all"}}),A=t("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${C}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${C}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Pe=({homepage:o,instance:e,label:i,summary:r})=>{let[n,l]=Se(!1);return we(()=>{o.length>0&&l(!0)},[o]),s.createElement(O,null,s.createElement(G,null,n?s.createElement($e,{homepage:o,className:"bloom-header-homepage"},s.createElement(R,{label:i,as:"span",className:"bloom-header-label"})):s.createElement(R,{label:i,as:"span",className:"bloom-header-label"}),r&&s.createElement(Ie,{summary:r,as:"span",className:"bloom-header-summary"})),s.createElement(W,null,s.createElement(A,{className:`bloom-previous-${e}`,"aria-label":"previous"},s.createElement(C,null,s.createElement(S,null))),s.createElement(A,{className:`bloom-next-${e}`,"aria-label":"next"},s.createElement(C,null,s.createElement(w,null)))))},U=Pe;import I,{useRef as Ne}from"react";import $,{useEffect as M,useState as y}from"react";import u,{useRef as Ae}from"react";import{Label as ke,Summary as Fe}from"@samvera/nectar-iiif";var q=t("div",{position:"absolute",width:"100%",backgroundColor:"green"}),J=t("figure",{display:"flex",flexDirection:"column",margin:"0 0 $2",flexGrow:"0",flexShrink:"0",borderRadius:"3px",transition:"$all",img:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"0",width:"100%",height:"100%",color:"transparent"},video:{position:"absolute",display:"flex",flexDirection:"column",objectFit:"cover",zIndex:"1",width:"100%",height:"100%",color:"transparent",opacity:"0",transition:"$load",borderRadius:"3px"},figcaption:{display:"flex",flexDirection:"column",padding:"$2 0",color:"$primary",transition:"$all"},variants:{isFocused:{true:{video:{opacity:"1"},figcaption:{color:"$accent"}}}}}),K=t("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),Q=t(ke,{fontSize:"$3",fontWeight:"700"}),X=t(Fe,{fontSize:"$2",marginTop:"$1",color:"$primary"});import*as Y from"@radix-ui/react-aspect-ratio";import{Thumbnail as Me}from"@samvera/nectar-iiif";var ze=({isFocused:o,label:e,summary:i,thumbnail:r})=>{let n=Ae(null);return u.createElement(J,{isFocused:o},u.createElement(Y.Root,{ratio:1/1},u.createElement(q,{ref:n}),u.createElement(K,null,r&&u.createElement(Me,{altAsLabel:e,thumbnail:r}))),u.createElement("figcaption",null,u.createElement(Q,{label:e}),i&&u.createElement(X,{summary:i})))},Z=ze;var _=t("a",{color:"black",textDecoration:"none"}),ee=t("div",{position:"relative",zIndex:"0",borderRadius:"3px"});import d,{useEffect as De,useState as ie}from"react";var oe=t("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),te=t("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),re=t("div",{display:"flex",justifyContent:"center",padding:"$2 $2 0",background:"linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%)",cursor:"default",button:{width:"$4",height:"$4",display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"center",borderRadious:"100%",backgroundColor:"transparent",border:"none",cursor:"pointer","&:disabled":{opacity:"0.2"},svg:{width:"100%",fill:"$secondary",stroke:"$secondary",color:"$secondary"}}}),ne=t("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});import*as se from"@radix-ui/react-aspect-ratio";var He=({activeResource:o,handleActiveResource:e,isFocused:i,resource:r})=>{let[n,l]=ie(!1),[f,p]=ie(!1),b=o+1,x=0;return r&&(x=r.items.length),De(()=>{b<=1?l(!1):l(!0),b>=x?p(!1):p(!0)},[o,r]),d.createElement(oe,{isFocused:i},d.createElement(se.Root,{ratio:1/1},r&&d.createElement(te,null,d.createElement(re,{onClick:c=>c.preventDefault()},d.createElement("button",{onClick:()=>e(-1),disabled:!n},d.createElement(S,null)),d.createElement("button",{onClick:()=>e(1),disabled:!f},d.createElement(w,null))),d.createElement(ne,{onClick:c=>c.preventDefault()},b," of ",x))))},le=He;var Le=({index:o,item:e})=>{var N;let i=v(),{vault:r}=i,[n,l]=y(!1),[f,p]=y(0),[b,x]=y(e.thumbnail),[c,pe]=y(),[ue,fe]=y(e.id);M(()=>{n&&!c&&r.load(e.id).then(g=>pe(g))},[n]),M(()=>{if(!(e!=null&&e.thumbnail))return;let g=r.get(e.thumbnail);x(g)},[]);let z=()=>l(!0),D=()=>l(!1),H=g=>{if(!c)return;let B=f+g,E=r.get(c.items[B]),xe=r.get(E.thumbnail);p(B),fe(E.id),x(xe)};M(()=>{c&&H(0)},[c]);let L;return((N=e.homepage)==null?void 0:N.length)>0&&(L=e.homepage[0].id),$.createElement(ee,null,$.createElement(_,{href:L,tabIndex:0,onFocus:z,onBlur:D,onMouseEnter:z,onMouseLeave:D},$.createElement(Z,{index:o,isFocused:n,key:ue,label:e.label,summary:e.summary,thumbnail:b}),$.createElement(le,{resource:c,activeResource:f,handleActiveResource:H,isFocused:n})))},ae=Le;var ce=t("div",{"& .swiper-slide":{}});import{Navigation as Be,A11y as Ee}from"swiper";import{Swiper as Te,SwiperSlide as Ve}from"swiper/react";var je={640:{slidesPerView:2,slidesPerGroup:2,spaceBetween:20},768:{slidesPerView:3,slidesPerGroup:3,spaceBetween:30},1024:{slidesPerView:4,slidesPerGroup:4,spaceBetween:40},1366:{slidesPerView:5,slidesPerGroup:5,spaceBetween:50},1920:{slidesPerView:6,slidesPerGroup:6,spaceBetween:60}},Ge=({breakpoints:o=je,instance:e,items:i})=>{let r=Ne(null);return I.createElement(ce,{ref:r},I.createElement(Te,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[Be,Ee],navigation:{nextEl:`.bloom-next-${e}`,prevEl:`.bloom-previous-${e}`},slidesPerView:2,slidesPerGroup:2,breakpoints:o},i.map((n,l)=>I.createElement(Ve,{key:`${n.id}-${l}`},I.createElement(ae,{index:l,item:n})))))},de=Ge;var We=o=>{var e=0,i=o.length,r=0;if(i>0)for(;r<i;)e=(e<<5)-e+o.charCodeAt(r++)|0;return e},me=We;var Ue=o=>m.createElement(V,null,m.createElement(qe,{...o})),qe=({collectionId:o,options:e={}})=>{let i=v(),{vault:r}=i,[n,l]=Re();if(Oe(()=>{r.loadCollection(o).then(p=>l(p)).catch(p=>{console.error(`Collection failed to load: ${p}`)}).finally(()=>{})},[]),!n||!n.items)return console.log(`The IIIF Collection ${o} failed to load.`),m.createElement(m.Fragment,null);if(n.items.length===0)return console.log(`The IIIF collection ${o} does not contain items.`),m.createElement(m.Fragment,null);let f=me(o);return m.createElement(Je,null,m.createElement(U,{label:n.label,summary:n.summary,homepage:n.homepage,instance:f}),m.createElement(de,{items:n.items,instance:f,breakpoints:Boolean(e.breakpoints)?e.breakpoints:void 0}))},Je=t("div",{padding:"$4 0"}),st=Ue;export{st as default}; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@samvera/bloom-iiif", | ||
"version": "0.3.4", | ||
"version": "0.3.5-rc.0", | ||
"description": "<img src=\"https://user-images.githubusercontent.com/7376450/160845852-39bf8942-1db4-41ee-881f-889ba2a4f61e.png\" class=\"bloom-screenshot\" alt=\"Bloom screenshot\"/>", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
99046
88