New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@samvera/bloom-iiif

Package Overview
Dependencies
Maintainers
4
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@samvera/bloom-iiif - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

2

dist/index.cjs.js

@@ -1,2 +0,2 @@

"use strict";var we=Object.create;var I=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Fe=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var Me=(e,t)=>{for(var r in t)I(e,r,{get:t[r],enumerable:!0})},G=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Pe(t))!ke.call(e,n)&&n!==r&&I(e,n,{get:()=>t[n],enumerable:!(o=Ie(t,n))||o.enumerable});return e};var f=(e,t,r)=>(r=e!=null?we(Fe(e)):{},G(t||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e)),Ae=e=>G(I({},"__esModule",{value:!0}),e);var Ue={};Me(Ue,{default:()=>Re});module.exports=Ae(Ue);var c=f(require("react"));var v=f(require("react")),R=require("@iiif/vault"),L={isLoaded:!1,vault:new R.Vault},U=v.default.createContext(L),ze=v.default.createContext(L);function De(e,t){switch(t.type){case"updateIsLoaded":return{...e,isLoaded:t.isLoaded};default:throw new Error(`Unhandled action type: ${t.type}`)}}var q=({initialState:e=L,children:t})=>{let[r,o]=v.default.useReducer(De,e);return v.default.createElement(U.Provider,{value:r},v.default.createElement(ze.Provider,{value:o},t))};function P(){let e=v.default.useContext(U);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}var x=f(require("react"));var a=f(require("react"));var u=f(require("react"));var F=require("@samvera/nectar-iiif");var K=require("@stitches/react"),h=e=>1.618**e;var J={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${h(2)})`,6:`calc(1rem * ${h(3)})`,7:`calc(1rem * ${h(4)})`,8:`calc(1rem * ${h(5)})`,9:`calc(1rem * ${h(6)})`,10:`calc(1rem * ${h(7)})`,11:`calc(1rem * ${h(8)})`,12:`calc(1rem * ${h(9)})`},He={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 * ${h(1)})`,8:`calc(1rem * ${h(2)})`,9:`calc(1rem * ${h(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)"}},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:Ke,keyframes:Qe,createTheme:Xe}=(0,K.createStitches)({theme:He,media:Le});var Q=i("div",{position:"absolute",width:"100%",backgroundColor:"green"}),X=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"}}}}}),Y=i("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),Z=i(F.Label,{fontSize:"$3",fontWeight:"700"}),_=i(F.Summary,{fontSize:"$2",marginTop:"$1",color:"$primary"});var ee=f(require("@radix-ui/react-aspect-ratio")),te=require("@samvera/nectar-iiif"),Ne=({isFocused:e,label:t,summary:r,thumbnail:o})=>{let n=(0,u.useRef)(null);return o[0].type==="ContentResource"?u.default.createElement(u.default.Fragment,null):u.default.createElement(X,{isFocused:e},u.default.createElement(ee.Root,{ratio:1/1},u.default.createElement(Q,{ref:n}),u.default.createElement(Y,null,u.default.createElement(te.Thumbnail,{altAsLabel:t,thumbnail:o}))),u.default.createElement("figcaption",null,u.default.createElement(Z,{label:t}),r&&u.default.createElement(_,{summary:r})))},oe=Ne;var re=i("a",{color:"black",textDecoration:"none"}),ne=i("div",{position:"relative",zIndex:"0",borderRadius:"3px"});var l=f(require("react"));var ie=i("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",variants:{isFocused:{true:{opacity:"1"}}}}),se=i("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),le=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"}}}),ae=i("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});var ce=f(require("@radix-ui/react-aspect-ratio"));var k=f(require("react")),M=()=>k.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},k.default.createElement("title",null,"Next"),k.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));var A=f(require("react")),z=()=>A.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},A.default.createElement("title",null,"Previous"),A.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var Ee=({activeCanvas:e,handleActiveCanvas:t,isFocused:r,manifest:o})=>{let[n,d]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),b=e+1,C=0;return o&&(C=o.items.length),(0,l.useEffect)(()=>{b<=1?d(!1):d(!0),b>=C?g(!1):g(!0)},[e,o]),l.default.createElement(ie,{isFocused:r},l.default.createElement(ce.Root,{ratio:1/1},o&&l.default.createElement(se,null,l.default.createElement(le,{onClick:p=>p.preventDefault()},l.default.createElement("button",{onClick:()=>t(-1),disabled:!n},l.default.createElement(z,null)),l.default.createElement("button",{onClick:()=>t(1),disabled:!m},l.default.createElement(M,null))),l.default.createElement(ae,{onClick:p=>p.preventDefault()},b," of ",C))))},de=Ee;var me=(e,t)=>{if(e.thumbnail.length!==0)return e.thumbnail;let r=t.get(e.items[0]);return t.get(r.items[0]).body};var Te=({index:e,item:t})=>{var W;let r=P(),{vault:o}=r,[n,d]=(0,a.useState)(!1),[m,g]=(0,a.useState)(0),[b,C]=(0,a.useState)(t.thumbnail),[p,w]=(0,a.useState)(),[ye,ve]=(0,a.useState)(t.id);(0,a.useEffect)(()=>{n&&setTimeout(()=>{p||o.loadManifest(t.id).then(y=>w(y)).catch(y=>{console.error(`Manifest failed to load: ${y}`)})},1e3)},[n]),(0,a.useEffect)(()=>{let y=o.get(t.thumbnail);C(y)},[]);let E=()=>d(!0),T=()=>d(!1),j=y=>{if(!p)return;let V=m+y,O=o.get(p.items[V]),Se=me(O,o),$e=o.get(Se);ve(O.id),C($e),g(V)};(0,a.useEffect)(()=>{p&&j(0)},[p]);let B;return((W=t.homepage)==null?void 0:W.length)>0&&(B=t.homepage[0].id),a.default.createElement(ne,null,a.default.createElement(re,{href:B,tabIndex:0,onFocus:E,onBlur:T,onMouseEnter:E,onMouseLeave:T},a.default.createElement(oe,{index:e,isFocused:n,key:ye,label:t.label,summary:t.summary,thumbnail:b}),a.default.createElement(de,{manifest:p,activeCanvas:m,handleActiveCanvas:j,isFocused:n})))},ue=Te;var pe=i("div",{position:"relative",display:"flex",flexDirection:"row"});var D=require("swiper"),H=require("swiper/react"),je=({instance:e,items:t})=>{let[r,o]=(0,x.useState)(3),n=(0,x.useRef)(null),d=t.length;return(0,x.useEffect)(()=>{let m=new ResizeObserver(g=>{var b,C;for(let p of g)if(p&&((b=n.current)==null?void 0:b.clientWidth)){let w=Math.ceil(((C=n.current)==null?void 0:C.clientWidth)/290);w<=d?o(w):o(d)}});n.current&&m.observe(n.current)},[n.current]),x.default.createElement(pe,{ref:n},x.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}`},slidesPerGroup:r,slidesPerView:r},t.map((m,g)=>x.default.createElement(H.SwiperSlide,{key:`${m.id}-${g}`},x.default.createElement(ue,{index:g,item:m})))))},fe=je;var s=f(require("react"));var he=i("div",{display:"flex",flexDirection:"column"}),xe=i("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),ge=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 S=require("@samvera/nectar-iiif");var $=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"}}),N=i("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${$}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${$}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Be=({homepage:e,instance:t,label:r,summary:o})=>{let[n,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e.length>0&&d(!0)},[e]),s.default.createElement(ge,null,s.default.createElement(he,null,n?s.default.createElement(S.Homepage,{homepage:e,className:"bloom-header-homepage"},s.default.createElement(S.Label,{label:r,as:"span",className:"bloom-header-label"})):s.default.createElement(S.Label,{label:r,as:"span",className:"bloom-header-label"}),o&&s.default.createElement(S.Summary,{summary:o,as:"span",className:"bloom-header-summary"})),s.default.createElement(xe,null,s.default.createElement(N,{className:`bloom-previous-${t}`,"aria-label":"previous"},s.default.createElement($,null,s.default.createElement(z,null))),s.default.createElement(N,{className:`bloom-next-${t}`,"aria-label":"next"},s.default.createElement($,null,s.default.createElement(M,null)))))},Ce=Be;var We=e=>{var t=0,r=e.length,o=0;if(r>0)for(;o<r;)t=(t<<5)-t+e.charCodeAt(o++)|0;return t},be=We;var Ve=e=>c.default.createElement(q,null,c.default.createElement(Oe,{...e})),Oe=({collectionId:e})=>{let t=P(),{vault:r}=t,[o,n]=(0,c.useState)();if((0,c.useEffect)(()=>{r.loadCollection(e).then(m=>n(m)).catch(m=>{console.error(`Collection failed to load: ${m}`)}).finally(()=>{})},[]),!o||!o.items)return console.log(`The IIIF Collection ${e} failed to load.`),c.default.createElement(c.default.Fragment,null);if(o.items.length===0)return console.log(`The IIIF collection ${e} does not contain items.`),c.default.createElement(c.default.Fragment,null);let d=be(e);return c.default.createElement(Ge,null,c.default.createElement(Ce,{label:o.label,summary:o.summary,homepage:o.homepage,instance:d}),c.default.createElement(fe,{items:o.items,instance:d}))},Ge=i("div",{padding:"$4 0"}),Re=Ve;
"use strict";var we=Object.create;var I=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Fe=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var Ae=(e,o)=>{for(var r in o)I(e,r,{get:o[r],enumerable:!0})},R=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of Pe(o))!ke.call(e,n)&&n!==r&&I(e,n,{get:()=>o[n],enumerable:!(t=Ie(o,n))||t.enumerable});return e};var p=(e,o,r)=>(r=e!=null?we(Fe(e)):{},R(o||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e)),Me=e=>R(I({},"__esModule",{value:!0}),e);var Ue={};Ae(Ue,{default:()=>Ge});module.exports=Me(Ue);var c=p(require("react"));var v=p(require("react")),G=require("@iiif/vault"),L={isLoaded:!1,vault:new G.Vault},U=v.default.createContext(L),ze=v.default.createContext(L);function De(e,o){switch(o.type){case"updateIsLoaded":return{...e,isLoaded:o.isLoaded};default:throw new Error(`Unhandled action type: ${o.type}`)}}var q=({initialState:e=L,children:o})=>{let[r,t]=v.default.useReducer(De,e);return v.default.createElement(U.Provider,{value:r},v.default.createElement(ze.Provider,{value:t},o))};function P(){let e=v.default.useContext(U);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}var x=p(require("react"));var a=p(require("react"));var h=p(require("react"));var F=require("@samvera/nectar-iiif");var K=require("@stitches/react"),f=e=>1.618**e;var J={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${f(2)})`,6:`calc(1rem * ${f(3)})`,7:`calc(1rem * ${f(4)})`,8:`calc(1rem * ${f(5)})`,9:`calc(1rem * ${f(6)})`,10:`calc(1rem * ${f(7)})`,11:`calc(1rem * ${f(8)})`,12:`calc(1rem * ${f(9)})`},He={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 * ${f(1)})`,8:`calc(1rem * ${f(2)})`,9:`calc(1rem * ${f(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)"}},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:Ke,keyframes:Qe,createTheme:Xe}=(0,K.createStitches)({theme:He,media:Le});var Q=i("div",{position:"absolute",width:"100%",backgroundColor:"green"}),X=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"}}}}}),Y=i("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),Z=i(F.Label,{fontSize:"$3",fontWeight:"700"}),_=i(F.Summary,{fontSize:"$2",marginTop:"$1",color:"$primary"});var ee=p(require("@radix-ui/react-aspect-ratio")),oe=require("@samvera/nectar-iiif"),Ne=({isFocused:e,label:o,summary:r,thumbnail:t})=>{let n=(0,h.useRef)(null);return h.default.createElement(X,{isFocused:e},h.default.createElement(ee.Root,{ratio:1/1},h.default.createElement(Q,{ref:n}),h.default.createElement(Y,null,t&&h.default.createElement(oe.Thumbnail,{altAsLabel:o,thumbnail:t}))),h.default.createElement("figcaption",null,h.default.createElement(Z,{label:o}),r&&h.default.createElement(_,{summary:r})))},te=Ne;var re=i("a",{color:"black",textDecoration:"none"}),ne=i("div",{position:"relative",zIndex:"0",borderRadius:"3px"});var l=p(require("react"));var ie=i("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),se=i("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),le=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"}}}),ae=i("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});var ce=p(require("@radix-ui/react-aspect-ratio"));var k=p(require("react")),A=()=>k.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},k.default.createElement("title",null,"Next"),k.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M268 112l144 144-144 144M392 256H100"}));var M=p(require("react")),z=()=>M.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},M.default.createElement("title",null,"Previous"),M.default.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var Ee=({activeCanvas:e,handleActiveCanvas:o,isFocused:r,manifest:t})=>{let[n,d]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),C=e+1,b=0;return t&&(b=t.items.length),(0,l.useEffect)(()=>{C<=1?d(!1):d(!0),C>=b?g(!1):g(!0)},[e,t]),l.default.createElement(ie,{isFocused:r},l.default.createElement(ce.Root,{ratio:1/1},t&&l.default.createElement(se,null,l.default.createElement(le,{onClick:u=>u.preventDefault()},l.default.createElement("button",{onClick:()=>o(-1),disabled:!n},l.default.createElement(z,null)),l.default.createElement("button",{onClick:()=>o(1),disabled:!m},l.default.createElement(A,null))),l.default.createElement(ae,{onClick:u=>u.preventDefault()},C," of ",b))))},de=Ee;var me=(e,o)=>{if(e.thumbnail.length!==0)return e.thumbnail;let r=o.get(e.items[0]);return o.get(r.items[0]).body};var Te=({index:e,item:o})=>{var W;let r=P(),{vault:t}=r,[n,d]=(0,a.useState)(!1),[m,g]=(0,a.useState)(0),[C,b]=(0,a.useState)(o.thumbnail),[u,w]=(0,a.useState)(),[ye,ve]=(0,a.useState)(o.id);(0,a.useEffect)(()=>{n&&setTimeout(()=>{u||t.load(o.id).then(y=>w(y)).catch(y=>{console.error(`Manifest failed to load: ${y}`)})},1e3)},[n]),(0,a.useEffect)(()=>{if(!(o!=null&&o.thumbnail))return;let y=t.get(o.thumbnail);b(y)},[]);let E=()=>d(!0),T=()=>d(!1),j=y=>{if(!u)return;let V=m+y,O=t.get(u.items[V]),Se=me(O,t),$e=t.get(Se);ve(O.id),b($e),g(V)};(0,a.useEffect)(()=>{u&&j(0)},[u]);let B;return((W=o.homepage)==null?void 0:W.length)>0&&(B=o.homepage[0].id),a.default.createElement(ne,null,a.default.createElement(re,{href:B,tabIndex:0,onFocus:E,onBlur:T,onMouseEnter:E,onMouseLeave:T},a.default.createElement(te,{index:e,isFocused:n,key:ye,label:o.label,summary:o.summary,thumbnail:C}),a.default.createElement(de,{manifest:u,activeCanvas:m,handleActiveCanvas:j,isFocused:n})))},ue=Te;var pe=i("div",{position:"relative",display:"flex",flexDirection:"row"});var D=require("swiper"),H=require("swiper/react"),je=({instance:e,items:o})=>{let[r,t]=(0,x.useState)(3),n=(0,x.useRef)(null),d=o.length;return(0,x.useEffect)(()=>{let m=new ResizeObserver(g=>{var C,b;for(let u of g)if(u&&((C=n.current)==null?void 0:C.clientWidth)){let w=Math.ceil(((b=n.current)==null?void 0:b.clientWidth)/290);w<=d?t(w):t(d)}});n.current&&m.observe(n.current)},[n.current]),x.default.createElement(pe,{ref:n},x.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}`},slidesPerGroup:r,slidesPerView:r},o.map((m,g)=>x.default.createElement(H.SwiperSlide,{key:`${m.id}-${g}`},x.default.createElement(ue,{index:g,item:m})))))},fe=je;var s=p(require("react"));var he=i("div",{display:"flex",flexDirection:"column"}),xe=i("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),ge=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 S=require("@samvera/nectar-iiif");var $=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"}}),N=i("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${$}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${$}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Be=({homepage:e,instance:o,label:r,summary:t})=>{let[n,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e.length>0&&d(!0)},[e]),s.default.createElement(ge,null,s.default.createElement(he,null,n?s.default.createElement(S.Homepage,{homepage:e,className:"bloom-header-homepage"},s.default.createElement(S.Label,{label:r,as:"span",className:"bloom-header-label"})):s.default.createElement(S.Label,{label:r,as:"span",className:"bloom-header-label"}),t&&s.default.createElement(S.Summary,{summary:t,as:"span",className:"bloom-header-summary"})),s.default.createElement(xe,null,s.default.createElement(N,{className:`bloom-previous-${o}`,"aria-label":"previous"},s.default.createElement($,null,s.default.createElement(z,null))),s.default.createElement(N,{className:`bloom-next-${o}`,"aria-label":"next"},s.default.createElement($,null,s.default.createElement(A,null)))))},be=Be;var We=e=>{var o=0,r=e.length,t=0;if(r>0)for(;t<r;)o=(o<<5)-o+e.charCodeAt(t++)|0;return o},Ce=We;var Ve=e=>c.default.createElement(q,null,c.default.createElement(Oe,{...e})),Oe=({collectionId:e})=>{let o=P(),{vault:r}=o,[t,n]=(0,c.useState)();if((0,c.useEffect)(()=>{r.loadCollection(e).then(m=>n(m)).catch(m=>{console.error(`Collection failed to load: ${m}`)}).finally(()=>{})},[]),!t||!t.items)return console.log(`The IIIF Collection ${e} failed to load.`),c.default.createElement(c.default.Fragment,null);if(t.items.length===0)return console.log(`The IIIF collection ${e} does not contain items.`),c.default.createElement(c.default.Fragment,null);let d=Ce(e);return c.default.createElement(Re,null,c.default.createElement(be,{label:t.label,summary:t.summary,homepage:t.homepage,instance:d}),c.default.createElement(fe,{items:t.items,instance:d}))},Re=i("div",{padding:"$4 0"}),Ge=Ve;
//# sourceMappingURL=index.cjs.js.map

@@ -1,2 +0,2 @@

import h,{useEffect as qe,useState as Je}from"react";import C from"react";import{Vault as Ce}from"@iiif/vault";var F={isLoaded:!1,vault:new Ce},B=C.createContext(F),be=C.createContext(F);function ye(e,t){switch(t.type){case"updateIsLoaded":return{...e,isLoaded:t.isLoaded};default:throw new Error(`Unhandled action type: ${t.type}`)}}var W=({initialState:e=F,children:t})=>{let[n,o]=C.useReducer(ye,e);return C.createElement(B.Provider,{value:n},C.createElement(be.Provider,{value:o},t))};function S(){let e=C.useContext(B);if(e===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return e}import P,{useEffect as De,useRef as He,useState as Le}from"react";import I,{useEffect as A,useState as b}from"react";import m,{useRef as Pe}from"react";import{Label as we,Summary as Ie}from"@samvera/nectar-iiif";import{createStitches as ve}from"@stitches/react";var d=e=>1.618**e;var V={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${d(2)})`,6:`calc(1rem * ${d(3)})`,7:`calc(1rem * ${d(4)})`,8:`calc(1rem * ${d(5)})`,9:`calc(1rem * ${d(6)})`,10:`calc(1rem * ${d(7)})`,11:`calc(1rem * ${d(8)})`,12:`calc(1rem * ${d(9)})`},Se={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 * ${d(1)})`,8:`calc(1rem * ${d(2)})`,9:`calc(1rem * ${d(3)})`},sizes:{...V},space:{...V},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},$e={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:tt,keyframes:ot,createTheme:rt}=ve({theme:Se,media:$e});var O=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),G=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"}}}}}),R=r("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),U=r(we,{fontSize:"$3",fontWeight:"700"}),q=r(Ie,{fontSize:"$2",marginTop:"$1",color:"$primary"});import*as J from"@radix-ui/react-aspect-ratio";import{Thumbnail as Fe}from"@samvera/nectar-iiif";var ke=({isFocused:e,label:t,summary:n,thumbnail:o})=>{let i=Pe(null);return o[0].type==="ContentResource"?m.createElement(m.Fragment,null):m.createElement(G,{isFocused:e},m.createElement(J.Root,{ratio:1/1},m.createElement(O,{ref:i}),m.createElement(R,null,m.createElement(Fe,{altAsLabel:t,thumbnail:o}))),m.createElement("figcaption",null,m.createElement(U,{label:t}),n&&m.createElement(q,{summary:n})))},K=ke;var Q=r("a",{color:"black",textDecoration:"none"}),X=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});import f,{useEffect as Me,useState as te}from"react";var Y=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",variants:{isFocused:{true:{opacity:"1"}}}}),Z=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),_=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"}}}),ee=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});import*as oe from"@radix-ui/react-aspect-ratio";import k from"react";var $=()=>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 M from"react";var w=()=>M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},M.createElement("title",null,"Previous"),M.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var Ae=({activeCanvas:e,handleActiveCanvas:t,isFocused:n,manifest:o})=>{let[i,s]=te(!1),[l,u]=te(!1),x=e+1,p=0;return o&&(p=o.items.length),Me(()=>{x<=1?s(!1):s(!0),x>=p?u(!1):u(!0)},[e,o]),f.createElement(Y,{isFocused:n},f.createElement(oe.Root,{ratio:1/1},o&&f.createElement(Z,null,f.createElement(_,{onClick:c=>c.preventDefault()},f.createElement("button",{onClick:()=>t(-1),disabled:!i},f.createElement(w,null)),f.createElement("button",{onClick:()=>t(1),disabled:!l},f.createElement($,null))),f.createElement(ee,{onClick:c=>c.preventDefault()},x," of ",p))))},re=Ae;var ne=(e,t)=>{if(e.thumbnail.length!==0)return e.thumbnail;let n=t.get(e.items[0]);return t.get(n.items[0]).body};var ze=({index:e,item:t})=>{var E;let n=S(),{vault:o}=n,[i,s]=b(!1),[l,u]=b(0),[x,p]=b(t.thumbnail),[c,v]=b(),[fe,he]=b(t.id);A(()=>{i&&setTimeout(()=>{c||o.loadManifest(t.id).then(g=>v(g)).catch(g=>{console.error(`Manifest failed to load: ${g}`)})},1e3)},[i]),A(()=>{let g=o.get(t.thumbnail);p(g)},[]);let D=()=>s(!0),H=()=>s(!1),L=g=>{if(!c)return;let T=l+g,j=o.get(c.items[T]),xe=ne(j,o),ge=o.get(xe);he(j.id),p(ge),u(T)};A(()=>{c&&L(0)},[c]);let N;return((E=t.homepage)==null?void 0:E.length)>0&&(N=t.homepage[0].id),I.createElement(X,null,I.createElement(Q,{href:N,tabIndex:0,onFocus:D,onBlur:H,onMouseEnter:D,onMouseLeave:H},I.createElement(K,{index:e,isFocused:i,key:fe,label:t.label,summary:t.summary,thumbnail:x}),I.createElement(re,{manifest:c,activeCanvas:l,handleActiveCanvas:L,isFocused:i})))},ie=ze;var se=r("div",{position:"relative",display:"flex",flexDirection:"row"});import{Navigation as Ne,A11y as Ee}from"swiper";import{Swiper as Te,SwiperSlide as je}from"swiper/react";var Be=({instance:e,items:t})=>{let[n,o]=Le(3),i=He(null),s=t.length;return De(()=>{let l=new ResizeObserver(u=>{var x,p;for(let c of u)if(c&&((x=i.current)==null?void 0:x.clientWidth)){let v=Math.ceil(((p=i.current)==null?void 0:p.clientWidth)/290);v<=s?o(v):o(s)}});i.current&&l.observe(i.current)},[i.current]),P.createElement(se,{ref:i},P.createElement(Te,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[Ne,Ee],navigation:{nextEl:`.bloom-next-${e}`,prevEl:`.bloom-previous-${e}`},slidesPerGroup:n,slidesPerView:n},t.map((l,u)=>P.createElement(je,{key:`${l.id}-${u}`},P.createElement(ie,{index:u,item:l})))))},le=Be;import a,{useEffect as We,useState as Ve}from"react";var ae=r("div",{display:"flex",flexDirection:"column"}),ce=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),de=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 Oe,Label as me,Summary as Ge}from"@samvera/nectar-iiif";var y=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"}}),z=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${y}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${y}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Re=({homepage:e,instance:t,label:n,summary:o})=>{let[i,s]=Ve(!1);return We(()=>{e.length>0&&s(!0)},[e]),a.createElement(de,null,a.createElement(ae,null,i?a.createElement(Oe,{homepage:e,className:"bloom-header-homepage"},a.createElement(me,{label:n,as:"span",className:"bloom-header-label"})):a.createElement(me,{label:n,as:"span",className:"bloom-header-label"}),o&&a.createElement(Ge,{summary:o,as:"span",className:"bloom-header-summary"})),a.createElement(ce,null,a.createElement(z,{className:`bloom-previous-${t}`,"aria-label":"previous"},a.createElement(y,null,a.createElement(w,null))),a.createElement(z,{className:`bloom-next-${t}`,"aria-label":"next"},a.createElement(y,null,a.createElement($,null)))))},ue=Re;var Ue=e=>{var t=0,n=e.length,o=0;if(n>0)for(;o<n;)t=(t<<5)-t+e.charCodeAt(o++)|0;return t},pe=Ue;var Ke=e=>h.createElement(W,null,h.createElement(Qe,{...e})),Qe=({collectionId:e})=>{let t=S(),{vault:n}=t,[o,i]=Je();if(qe(()=>{n.loadCollection(e).then(l=>i(l)).catch(l=>{console.error(`Collection failed to load: ${l}`)}).finally(()=>{})},[]),!o||!o.items)return console.log(`The IIIF Collection ${e} failed to load.`),h.createElement(h.Fragment,null);if(o.items.length===0)return console.log(`The IIIF collection ${e} does not contain items.`),h.createElement(h.Fragment,null);let s=pe(e);return h.createElement(Xe,null,h.createElement(ue,{label:o.label,summary:o.summary,homepage:o.homepage,instance:s}),h.createElement(le,{items:o.items,instance:s}))},Xe=r("div",{padding:"$4 0"}),mo=Ke;export{mo as default};
import f,{useEffect as qe,useState as Je}from"react";import b from"react";import{Vault as be}from"@iiif/vault";var F={isLoaded:!1,vault:new be},B=b.createContext(F),Ce=b.createContext(F);function ye(o,e){switch(e.type){case"updateIsLoaded":return{...o,isLoaded:e.isLoaded};default:throw new Error(`Unhandled action type: ${e.type}`)}}var W=({initialState:o=F,children:e})=>{let[n,t]=b.useReducer(ye,o);return b.createElement(B.Provider,{value:n},b.createElement(Ce.Provider,{value:t},e))};function S(){let o=b.useContext(B);if(o===void 0)throw new Error("useViewerState must be used within a ViewerProvider");return o}import P,{useEffect as De,useRef as He,useState as Le}from"react";import I,{useEffect as M,useState as C}from"react";import x,{useRef as Pe}from"react";import{Label as we,Summary as Ie}from"@samvera/nectar-iiif";import{createStitches as ve}from"@stitches/react";var d=o=>1.618**o;var V={1:"0.382rem",2:"0.618rem",3:"1rem",4:"1.618rem",5:`calc(1rem * ${d(2)})`,6:`calc(1rem * ${d(3)})`,7:`calc(1rem * ${d(4)})`,8:`calc(1rem * ${d(5)})`,9:`calc(1rem * ${d(6)})`,10:`calc(1rem * ${d(7)})`,11:`calc(1rem * ${d(8)})`,12:`calc(1rem * ${d(9)})`},Se={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 * ${d(1)})`,8:`calc(1rem * ${d(2)})`,9:`calc(1rem * ${d(3)})`},sizes:{...V},space:{...V},transitions:{all:"all 250ms cubic-bezier(0.16, 1, 0.3, 1)",load:"all 1.25s cubic-bezier(0.16, 1, 0.3, 1)"}},$e={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:oo,keyframes:to,createTheme:ro}=ve({theme:Se,media:$e});var O=r("div",{position:"absolute",width:"100%",backgroundColor:"green"}),R=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"}}}}}),G=r("span",{display:"flex",position:"relative",backgroundColor:"$secondaryAlt",width:"100%",height:"100%",overflow:"hidden",borderRadius:"3px",boxShadow:"none",transition:"$all"}),U=r(we,{fontSize:"$3",fontWeight:"700"}),q=r(Ie,{fontSize:"$2",marginTop:"$1",color:"$primary"});import*as J from"@radix-ui/react-aspect-ratio";import{Thumbnail as Fe}from"@samvera/nectar-iiif";var ke=({isFocused:o,label:e,summary:n,thumbnail:t})=>{let i=Pe(null);return x.createElement(R,{isFocused:o},x.createElement(J.Root,{ratio:1/1},x.createElement(O,{ref:i}),x.createElement(G,null,t&&x.createElement(Fe,{altAsLabel:e,thumbnail:t}))),x.createElement("figcaption",null,x.createElement(U,{label:e}),n&&x.createElement(q,{summary:n})))},K=ke;var Q=r("a",{color:"black",textDecoration:"none"}),X=r("div",{position:"relative",zIndex:"0",borderRadius:"3px"});import p,{useEffect as Ae,useState as oe}from"react";var Y=r("div",{position:"absolute",zIndex:"2",width:"100%",opacity:"0",top:"0",variants:{isFocused:{true:{opacity:"1"}}}}),Z=r("div",{width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",zIndex:"1"}),_=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"}}}),ee=r("div",{display:"flex",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.7)",color:"$secondaryAlt",fontSize:"$1",padding:"$1",cursor:"default"});import*as te from"@radix-ui/react-aspect-ratio";import k from"react";var $=()=>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 A from"react";var w=()=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},A.createElement("title",null,"Previous"),A.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"}));var Me=({activeCanvas:o,handleActiveCanvas:e,isFocused:n,manifest:t})=>{let[i,s]=oe(!1),[l,m]=oe(!1),h=o+1,u=0;return t&&(u=t.items.length),Ae(()=>{h<=1?s(!1):s(!0),h>=u?m(!1):m(!0)},[o,t]),p.createElement(Y,{isFocused:n},p.createElement(te.Root,{ratio:1/1},t&&p.createElement(Z,null,p.createElement(_,{onClick:c=>c.preventDefault()},p.createElement("button",{onClick:()=>e(-1),disabled:!i},p.createElement(w,null)),p.createElement("button",{onClick:()=>e(1),disabled:!l},p.createElement($,null))),p.createElement(ee,{onClick:c=>c.preventDefault()},h," of ",u))))},re=Me;var ne=(o,e)=>{if(o.thumbnail.length!==0)return o.thumbnail;let n=e.get(o.items[0]);return e.get(n.items[0]).body};var ze=({index:o,item:e})=>{var E;let n=S(),{vault:t}=n,[i,s]=C(!1),[l,m]=C(0),[h,u]=C(e.thumbnail),[c,v]=C(),[fe,he]=C(e.id);M(()=>{i&&setTimeout(()=>{c||t.load(e.id).then(g=>v(g)).catch(g=>{console.error(`Manifest failed to load: ${g}`)})},1e3)},[i]),M(()=>{if(!(e!=null&&e.thumbnail))return;let g=t.get(e.thumbnail);u(g)},[]);let D=()=>s(!0),H=()=>s(!1),L=g=>{if(!c)return;let T=l+g,j=t.get(c.items[T]),xe=ne(j,t),ge=t.get(xe);he(j.id),u(ge),m(T)};M(()=>{c&&L(0)},[c]);let N;return((E=e.homepage)==null?void 0:E.length)>0&&(N=e.homepage[0].id),I.createElement(X,null,I.createElement(Q,{href:N,tabIndex:0,onFocus:D,onBlur:H,onMouseEnter:D,onMouseLeave:H},I.createElement(K,{index:o,isFocused:i,key:fe,label:e.label,summary:e.summary,thumbnail:h}),I.createElement(re,{manifest:c,activeCanvas:l,handleActiveCanvas:L,isFocused:i})))},ie=ze;var se=r("div",{position:"relative",display:"flex",flexDirection:"row"});import{Navigation as Ne,A11y as Ee}from"swiper";import{Swiper as Te,SwiperSlide as je}from"swiper/react";var Be=({instance:o,items:e})=>{let[n,t]=Le(3),i=He(null),s=e.length;return De(()=>{let l=new ResizeObserver(m=>{var h,u;for(let c of m)if(c&&((h=i.current)==null?void 0:h.clientWidth)){let v=Math.ceil(((u=i.current)==null?void 0:u.clientWidth)/290);v<=s?t(v):t(s)}});i.current&&l.observe(i.current)},[i.current]),P.createElement(se,{ref:i},P.createElement(Te,{a11y:{prevSlideMessage:"previous item",nextSlideMessage:"next item"},spaceBetween:31,modules:[Ne,Ee],navigation:{nextEl:`.bloom-next-${o}`,prevEl:`.bloom-previous-${o}`},slidesPerGroup:n,slidesPerView:n},e.map((l,m)=>P.createElement(je,{key:`${l.id}-${m}`},P.createElement(ie,{index:m,item:l})))))},le=Be;import a,{useEffect as We,useState as Ve}from"react";var ae=r("div",{display:"flex",flexDirection:"column"}),ce=r("div",{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:"$5",paddingRight:"$4","@xs":{width:"100%",justifyContent:"center",padding:"$4 $1 0 0"}}),de=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 Oe,Label as me,Summary as Re}from"@samvera/nectar-iiif";var y=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"}}),z=r("button",{zIndex:"1",border:"none",cursor:"pointer",background:"transparent",marginLeft:"$2",padding:"0",["&:disabled"]:{[`> ${y}`]:{backgroundColor:"$secondaryAlt",boxShadow:"none",svg:{fill:"$secondaryMuted",stroke:"$secondaryMuted",filter:"unset"}}},["&:hover:enabled"]:{[`> ${y}`]:{backgroundColor:"$accentAlt",boxShadow:"3px 3px 11px #0003",["&:disabled"]:{boxShadow:"unset"}}}});var Ge=({homepage:o,instance:e,label:n,summary:t})=>{let[i,s]=Ve(!1);return We(()=>{o.length>0&&s(!0)},[o]),a.createElement(de,null,a.createElement(ae,null,i?a.createElement(Oe,{homepage:o,className:"bloom-header-homepage"},a.createElement(me,{label:n,as:"span",className:"bloom-header-label"})):a.createElement(me,{label:n,as:"span",className:"bloom-header-label"}),t&&a.createElement(Re,{summary:t,as:"span",className:"bloom-header-summary"})),a.createElement(ce,null,a.createElement(z,{className:`bloom-previous-${e}`,"aria-label":"previous"},a.createElement(y,null,a.createElement(w,null))),a.createElement(z,{className:`bloom-next-${e}`,"aria-label":"next"},a.createElement(y,null,a.createElement($,null)))))},ue=Ge;var Ue=o=>{var e=0,n=o.length,t=0;if(n>0)for(;t<n;)e=(e<<5)-e+o.charCodeAt(t++)|0;return e},pe=Ue;var Ke=o=>f.createElement(W,null,f.createElement(Qe,{...o})),Qe=({collectionId:o})=>{let e=S(),{vault:n}=e,[t,i]=Je();if(qe(()=>{n.loadCollection(o).then(l=>i(l)).catch(l=>{console.error(`Collection failed to load: ${l}`)}).finally(()=>{})},[]),!t||!t.items)return console.log(`The IIIF Collection ${o} failed to load.`),f.createElement(f.Fragment,null);if(t.items.length===0)return console.log(`The IIIF collection ${o} does not contain items.`),f.createElement(f.Fragment,null);let s=pe(o);return f.createElement(Xe,null,f.createElement(ue,{label:t.label,summary:t.summary,homepage:t.homepage,instance:s}),f.createElement(le,{items:t.items,instance:s}))},Xe=r("div",{padding:"$4 0"}),mt=Ke;export{mt as default};
//# sourceMappingURL=index.esm.js.map
{
"name": "@samvera/bloom-iiif",
"version": "0.3.2",
"version": "0.3.3",
"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",

@@ -1,2 +0,2 @@

<img src="https://user-images.githubusercontent.com/7376450/160845852-39bf8942-1db4-41ee-881f-889ba2a4f61e.png" class="bloom-screenshot" alt="Bloom screenshot"/>
<img src="https://user-images.githubusercontent.com/7376450/189417239-0dcf980a-5551-4ebd-923d-5e33bc37bd59.png" class="bloom-screenshot" alt="Bloom screenshot"/>

@@ -9,3 +9,3 @@ # Bloom IIIF

_Bloom is still in alpha development. It is not recommend adding this into production projects yet._
_Note, Bloom is still in early development._

@@ -18,3 +18,3 @@ ---

- [Basic Usage](#basic-usage)
- [Collection Anatomy](#collection-anatomy)
- [IIIF Collection Anatomy](#collection-anatomy)
- [Development](#development)

@@ -32,4 +32,2 @@

**OR** if you prefer Yarn, use `yarn add`.
```shell

@@ -39,2 +37,4 @@ yarn add @samvera/bloom-iiif

**OR** if you prefer Yarn, use `yarn add`.
---

@@ -58,5 +58,22 @@

<h3>Next.js</h3>
Usage with Next.js requires a dynamic import using `next/dynamic`
```jsx
import dynamic from "next/dynamic";
const BloomIIIF = dynamic(() => import("@samvera/bloom-iiif"), {
ssr: false,
});
return <BloomIIIF collectionId={collectionId} />
```
---
<h2 id="collection-anatomy">Collection Anatomy</h2>
<h2 id="collection-anatomy">IIIF Collection Anatomy</h2>

@@ -63,0 +80,0 @@ Bloom accepts both Presentation API 2.x and Presentation API 3.0 Collections.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc