react-iiif-vault 1.5.10 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +1015 -494
- package/dist/bundle.global.js +53 -86
- package/dist/canvas-panel.cjs +5 -5
- package/dist/canvas-panel.d.cts +8 -5
- package/dist/canvas-panel.d.ts +8 -5
- package/dist/canvas-panel.js +1 -1
- package/dist/chunk-5VWTU5L4.js +48 -0
- package/dist/{chunk-XNDN34SQ.js → chunk-OTG27VBE.js} +1 -1
- package/dist/index-CawyvZZf.d.cts +643 -0
- package/dist/index-yy_738ck.d.ts +643 -0
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +478 -378
- package/dist/index.d.ts +478 -378
- package/dist/index.js +1 -1
- package/dist/{useRenderingStrategy-BiuSDiXu.d.cts → useRenderingStrategy-PvoNjiMV.d.cts} +10 -10
- package/dist/{useRenderingStrategy-BiuSDiXu.d.ts → useRenderingStrategy-PvoNjiMV.d.ts} +10 -10
- package/dist/{utils-CvRzsfRK.d.cts → utils-BVhGgVd5.d.cts} +18 -18
- package/dist/{utils-C-h4SU3S.d.ts → utils-DyrEcegR.d.ts} +18 -18
- package/dist/utils.cjs +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/package.json +6 -5
- package/dist/chunk-2ATWK7I4.js +0 -48
- package/dist/index-BJveLrlu.d.cts +0 -214
- package/dist/index-CrfymD6m.d.ts +0 -214
package/dist/chunk-2ATWK7I4.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import{c as bt,l as At}from"./chunk-XNDN34SQ.js";import{forwardRef as Pr,useImperativeHandle as Fa,useMemo as Da}from"react";import pn,{useCallback as ot,useMemo as gn,useState as Pe}from"react";import{AtlasAuto as Ko,ModeContext as jo}from"@atlas-viewer/atlas";import{ErrorBoundary as Wo}from"react-error-boundary";import{useContext as D,useMemo as Po}from"react";import wr,{useContext as Mr,useMemo as Er}from"react";import{jsx as kr}from"react/jsx-runtime";var Vr={collection:void 0,manifest:void 0,range:void 0,canvas:void 0,annotation:void 0,annotationPage:void 0},Ce=wr.createContext(Vr),O=()=>Mr(Ce);function W({value:e,children:n}){let t=O(),r=Er(()=>({...t,...e}),[e,t]);return kr(Ce.Provider,{value:r,children:n})}import Nr,{useState as Lr}from"react";import{Vault as Pt,globalVault as zr}from"@iiif/helpers/vault";import{jsx as Tt}from"react/jsx-runtime";var Y=Nr.createContext({vault:null,setVaultInstance:e=>{}});function X({vault:e,vaultOptions:n,useGlobal:t,resources:r,children:o}){let[s,i]=Lr(()=>e||(t?zr(n):n?new Pt(n):new Pt));return Tt(Y.Provider,{value:{vault:s,setVaultInstance:i},children:Tt(W,{value:r||{},children:o})})}import{useContext as go}from"react";import{createContext as vo,useMemo as ho}from"react";import{globalVault as Or}from"@iiif/helpers/vault";import{useContext as Hr}from"react";function J(e){let n=Hr(Y);return e||(n&&n.vault?n.vault:Or())}import{useEffect as Fr,useMemo as Dr,useState as Ke}from"react";function It(e,{noCache:n=!1}={}){let t=typeof e=="string"?e:e.id,r=J(),[o,s]=Ke(t),[i,a]=Ke(void 0),c=Dr(()=>r.get(t,{skipSelfReturn:!0})||void 0,[t,r]),[u,l]=Ke(c);return Fr(()=>{(async()=>{try{let d=c&&!n?c:await r.load(t),v=d?d.id||d["@id"]:null;d&&o!==v&&s(v),l(d)}catch(d){a(d)}})()},[t,n]),{isLoaded:!!u,id:o,requestId:t,error:i,resource:u,cached:!!(u&&u===c)}}function wt(e,n){let{id:t,isLoaded:r,error:o,resource:s,requestId:i,cached:a}=It(e,n);return{id:t,isLoaded:r,error:o,manifest:s,requestId:i,cached:a}}import{jsx as $r}from"react/jsx-runtime";function Mt({manifest:e,children:n}){return $r(W,{value:{manifest:e},children:n})}import{jsx as Br}from"react/jsx-runtime";function _({canvas:e,children:n}){return Br(W,{value:{canvas:e},children:n})}import{useContext as Kr}from"react";import jr from"react";import{useContext as Ur}from"react";var A=()=>{let{vault:e}=Ur(Y);if(e===null)throw new Error("Vault not found. Ensure you have your provider set up correctly.");return e};import{useEffect as qr,useState as _r}from"react";function T(e,n=[]){let t=A(),[r,o]=_r(()=>e(t.getState(),t));return qr(()=>t.subscribe(s=>e(s,t),s=>{o(s)},!1),n),r}var ee=jr.createContext([]);function xe(){let e=Kr(ee);return T(n=>e.map(t=>n.iiif.entities.Canvas[t]).filter(Boolean),[e])}import{useMemo as Wr}from"react";function M(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=A(),i=t||o.manifest,a=T(c=>i?c.iiif.entities.Manifest[i]:void 0,[i]);return Wr(()=>{if(a)return r?r(a):a},[a,r,...n])}import{jsx as Yr}from"react/jsx-runtime";function Et({range:e,children:n}){return Yr(W,{value:{range:e},children:n})}function Qr(e,n){for(let t of n.items){if(t.type==="Canvas")return t;if(t.type==="SpecificResource")return t.source;if(t.type==="Range"){let r=Qr(e,e.get(t));if(r)return r}}return null}function je(e,n){let t=[];for(let r of n.items)if(r.type==="SpecificResource"&&r.source?.type==="Canvas"&&(r.source.id.indexOf("#")!==-1?t.push({id:r.source.id.split("#")[0],type:"Canvas"}):t.push(r.source)),r.type==="Range"&&t.push(...je(e,e.get(r))),r.type==="SpecificResource"){let o=typeof r.source=="string"?r.source:r.source.id;t.push({id:o,type:"Canvas"})}return t}function Fs(e,n,t){for(let r of n.structures){let o=Vt(e,e.get(r),t);if(o)return o}return null}function Vt(e,n,t){for(let r of n.items){let o=r?.source?.id?.split("#")[0];if(r.type==="SpecificResource"&&r.source===t||r.type==="SpecificResource"&&r.source?.type==="Canvas"&&t===o)return n;if(r.type==="Range"){let s=Vt(e,e.get(r),t);if(s)return s}}return null}function Bs(e,n,t,r=!1){let o=n.behavior,s=t?e.get(t):null;if(!s)return[];let i=s.behavior,a=r?!1:o.includes("paged"),c=a?!1:o.includes("continuous"),u=a||c?!1:o.includes("individuals"),l=i.includes("facing-pages"),d=i.includes("non-paged");if(l||d||u||r)return[{id:s.id,type:"Canvas"}];let[v,y]=We(e,n);if(c)return v;let p=v.findIndex(m=>m.id===t);if(p===-1)return[];for(let m of y)if(m.includes(p))return m.map(S=>v[S]);return[{id:s.id,type:"Canvas"}]}function We(e,n,{disablePaging:t,skipNonPaged:r}={}){let o=n.behavior,s=o.includes("paged"),i=s?!1:o.includes("continuous"),a=s||i?!1:o.includes("individuals"),c=n.type==="Manifest"?n.items:je(e,n);if(i)return[c,[c.map((p,m)=>m)]];if(a||!s||t)return[c,c.map((p,m)=>[m])];let u=[],l=[],d=()=>{l.length&&(u.push([...l]),l=[])},v=0,y=!1;for(let p=0;p<c.length;p++){let m=e.get(c[p]);if(m.behavior.includes("non-paged")){p===v&&v++,r||(d(),u.push([p]),d());continue}if(p===v||m.behavior.includes("facing-pages")){l.length&&(y=!0),d(),u.push([p]),d();continue}if(l.push(p),y){d(),y=!1;continue}l.length>1&&d()}return l.length&&d(),[c,u]}import{useCallback as Re,useMemo as Zr,useRef as Xr,useState as Jr}from"react";import{useMemo as Gr}from"react";function kt(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=t||o.range,i=T(a=>s?a.iiif.entities.Range[s]:void 0,[s]);return Gr(()=>{if(i)return r?r(i):i},[i,r,...n])}function Nt({startCanvas:e,disablePaging:n}){let t=A(),r=M(),o=kt(),[s,i]=Jr(void 0),a=o||r;if(!a)throw new Error("Nothing selected");let[c,u]=Zr(()=>We(t,a,{disablePaging:n}),[t,a,n]),l=Xr(u);if(l.current!==u){let S=l.current[s][0],g=u.findIndex(h=>h.includes(S));l.current=u,i(g)}let d=Re(m=>{let S=u.findIndex(g=>g.includes(m));i(S===-1?0:S)},[c,u]),v=Re(m=>{let S=c.findIndex(g=>g.id===m);S!==-1?d(S):i(0)},[c,u]),y=Re(()=>{i(m=>m>=u.length-1?m:m+1)},[u]),p=Re(()=>{i(m=>m<=0?0:m-1)},[u]);return typeof s>"u"&&(e?v(e):i(0)),{visibleItems:u[s]?.map(m=>c[m].id)||[],cursor:s,items:c,sequence:u,hasPrevious:s>0,hasNext:s<u.length-1,setSequenceIndex:i,setCanvasIndex:d,setCanvasId:v,next:y,previous:p}}import{createContext as Ge,useContext as _t,useEffect as to,useMemo as no}from"react";import{useStore as le}from"zustand";import{createStore as zt}from"zustand/vanilla";function ec(e){let n=e.service||e.services||[];for(let t of n)if(t.type==="AuthProbeService2")return!0;return!1}function H(e,n,t){let r=n.findIndex(i=>i.service.id===e);if(r===-1)return n;let o=[...n],s=t(o[r]);return s===o[r]?n:(o[r]=s,o)}var Ot=()=>zt((e,n)=>({currentAuth:-1,authItems:[],login:()=>{let t=n().authItems[n().currentAuth];if(!t||t.isPending||t.isLoggedIn)return;if(t.type!=="active")throw new Error("Cannot login to non-active service");let r=t.service.service.find(o=>o.type==="AuthAccessTokenService2");if(!r)throw new Error("Token service not found");e(()=>({authItems:H(t.id,n().authItems,o=>({...o,isPending:!0}))})),Lt(t.service).then(()=>{Ye(r).then(o=>{let s=o.expiresIn,i=Date.now()+s*1e3;e(()=>({authItems:H(t.id,n().authItems,a=>({...a,isLoggedIn:!0,isPending:!1,session:{token:o.accessToken,expires:i}}))}))}).catch(o=>{e(()=>({authItems:H(t.id,n().authItems,s=>({...s,isLoggedIn:!1,isPending:!1,error:o.message}))}))})})},logout:()=>{let t=n().authItems[n().currentAuth];if(!t||t.isPending||!t.isLoggedIn)return;if(t.type!=="active")throw new Error("Cannot logout of non-active service");let r=t.service.service.find(i=>i.type==="AuthLogoutService2");if(!r)return;let o=`${r.id}?origin=${Dt()}`,s=window.open(o);e(()=>({authItems:H(t.id,n().authItems,i=>({...i,isLoggedIn:!1,session:null,isPending:!1}))}))},nextAuth:()=>{let t=n().authItems.length,r=n().currentAuth+1;r>=t||e(()=>({currentAuth:r}))},previousAuth:()=>{let t=n().currentAuth-1;t<0||e(()=>({currentAuth:t}))},setAuth:t=>{t!==-1&&(t<0||t>=n().authItems.length)||e(()=>({currentAuth:t}))},addService:(t,r)=>{if(!t.service)return;let o=t.service.find(a=>a.type==="AuthAccessTokenService2"),s=t;if(n().authItems.find(a=>a.service.id===t.id)){e(()=>({authItems:H(t.id,n().authItems,a=>({...a,instances:a.instances+1}))}));return}if(e(()=>({currentAuth:s.profile==="active"?0:n().currentAuth,authItems:[{id:t.id,type:t.profile,service:t,probeId:r,canAuthenticate:!0,instances:1,isPending:!1,isLoggedIn:!1,session:null},...n().authItems]})),t.profile==="external"){if(!o)throw new Error("Token service not found");Ye(o).then(a=>{e(()=>({authItems:H(t.id,n().authItems,c=>({...c,isLoggedIn:!0,isPending:!1,session:{token:a.accessToken,expires:a.expiresIn}}))}))}).catch(a=>{e(()=>({authItems:H(t.id,n().authItems,c=>({...c,isLoggedIn:!1,isPending:!1,canAuthenticate:!1,error:a.message}))}))})}if(t.profile==="kiosk"){if(!o)throw new Error("Token service not found");e(()=>({authItems:H(t.id,n().authItems,a=>({...a,isPending:!0}))})),Lt(s).then(()=>{Ye(o).then(a=>{e(()=>({authItems:H(t.id,n().authItems,c=>({...c,isLoggedIn:!0,isPending:!1,session:{token:a.accessToken,expires:a.expiresIn}}))}))}).catch(a=>{e(()=>({authItems:H(t.id,n().authItems,c=>({...c,isLoggedIn:!1,isPending:!1,error:a.message}))}))})})}t.profile},removeService:(t,r)=>{let o=n().currentAuth===n().authItems.findIndex(i=>i.service.id===t.id),s=n().currentAuth;if(o){let i=n().authItems.find(c=>c.service.id===t.id);i&&i.instances>1||(s=n().authItems.findIndex(u=>u.service.id!==t.id&&u.instances>0))}e(()=>({authItems:H(t.id,n().authItems,i=>({...i,instances:i.instances-1})),currentAuth:s}))}})),Ht=(e,n)=>zt((t,r)=>({service:e,status:e?"unknown":"success",shouldRedirect:!1,redirectResource:null,shouldSubstitute:!1,substituteResource:null,error:null,errorHeading:null,errorNote:null,shouldDisplayResource:!1,token:n||null,async probe(){if(!r().service)return;let o=r().service?.id;if(!o){t({status:"error",error:"Service ID not found",errorHeading:{en:["Service ID not found"]}});return}t({status:"probing"});let s=r().token;try{let i=await fetch(o,{headers:s?{Authorization:`Bearer ${r().token}`,Accept:"application/json"}:{Accept:"application/json"}}).then(a=>a.json());if(i.status===200)t({status:"success",shouldDisplayResource:!0,error:null,errorHeading:null,errorNote:null,shouldSubstitute:!1,shouldRedirect:!1});else if(i.status<400&&i.status>=300){if(!i.location)throw new Error("Redirect location not found");t({status:"error",shouldDisplayResource:!1,shouldRedirect:!0,redirectResource:i.location||null})}else if(i.status===401)t({status:"error",shouldDisplayResource:!1,shouldRedirect:!1,shouldSubstitute:!!i.substitute,substituteResource:i.substitute||null,error:"Unauthorized",errorHeading:i.heading||{en:["Unauthorized"]},errorNote:i.note||null});else throw new Error("Unknown error")}catch(i){t({status:"error",error:i.message,errorHeading:{en:["Unknown error"]}})}},setToken(o){t({token:o})}}));function Ft(e){let n=e.service||e.services||[],t={hasAuth:!1,services:{}};for(let r of n)if(r.type==="AuthProbeService2"){t.services.probe=r,t.hasAuth=!0;let o=r.service.filter(s=>s.type==="AuthAccessService2");o[0]&&(t.services.access=o[0])}return t}async function Ye(e,{strict:n=!0}={}){return new Promise((t,r)=>{let o=Math.random().toString(36).substring(7),s=`${e.id}?messageId=${o}&origin=${window.location.origin}`,i=u=>{let l=u.data;if(l.messageId===o){if(n&&l.type!=="AuthAccessToken2"){a(),r("Invalid response, expected type=AuthAccessToken2");return}if(!l.accessToken){a(),r("Invalid response, expected accessToken");return}a(),t(l)}},a=()=>window.removeEventListener("message",i),c=document.createElement("iframe");c.src=s,c.style.display="none",document.body.appendChild(c),window.addEventListener("message",i)})}function Dt(e){let n=window.location;if(e){let t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname+(t.port?":"+t.port:"")}return n.protocol+"//"+n.hostname+(n.port?":"+n.port:"")}async function Lt(e){let n=`${e.id}?origin=${Dt()}`,t=window.open(n);if(!t)throw new Error("Failed to open window");return new Promise((r,o)=>{let s=setInterval(()=>{t.closed&&(clearInterval(s),r())},500)})}import{useEffect as $t,useMemo as Bt}from"react";import{useStore as eo}from"zustand";function Ut(e){let n=Bt(()=>Ft(e),[e]),t=qt(n.services.access?.id),r=Bt(()=>Ht(n.services.probe,t),[n.services.probe]),o=eo(r);return $t(()=>{o.status==="unknown"&&!t&&o.probe()},[n.services.probe,o.status]),$t(()=>{t&&(o.setToken(t),o.probe())},[t]),[e,o,n.hasAuth]}import{jsx as be}from"react/jsx-runtime";var te=Ge(null),ro=Ge(null);ro.displayName="CurrentAuth";var oo=Ge(null);oo.displayName="AuthActions";function Kt({children:e}){let n=no(()=>Ot(),[]);return be(te.Provider,{value:n,children:e})}function jt(){return!!_t(te)}function de(){let e=_t(te);if(!e)throw new Error("useAuthActions must be used within a AuthProvider");return e}function io(){let e=de();return le(e,t=>({login:t.login,logout:t.logout,nextAuth:t.nextAuth,previousAuth:t.previousAuth,setAuth:t.setAuth,addService:t.addService,removeService:t.removeService}))}function yc(){let e=de();return le(e,n=>n)}function ao(e){let n=de();return le(n,r=>r.authItems.find(o=>o.service.id===e))}function qt(e){let n=de();return le(n,r=>r.authItems.find(o=>o.id===e)?.session?.token)}function Sc(e){let n=de();return le(n,r=>{let o=r.authItems.find(s=>s.service.id===e);return!o||!o.isLoggedIn||!o.session?null:o.session?.token||null})}function so(e){let n=io(),t=ao(e.service.id);return to(()=>(n?.addService(e.service,e.probeId),()=>{n?.removeService(e.service,e.probeId)}),[e.service]),t?(t.error||!t.isLoggedIn,e.children):null}function Qe(){return null}function Wt(e){let[n,t,r]=Ut(e.resource),o=e.fallbackComponent||Qe,s=e.loadingComponent||Qe,i=e.errorComponent||Qe,a=t.service,c=null;if(!r||!a)return e.children(n);let u=a.service.filter(l=>l.type==="AuthAccessService2");t.status==="error"&&(c=be(i,{resource:e.resource,error:t.error||"",heading:t.errorHeading,note:t.errorNote,extra:e.extra})),(t.status==="unknown"||t.status==="probing")&&(c=be(s,{})),t.status==="success"&&(c=e.children(n));for(let l of u)c=be(so,{service:l,probeId:a.id,children:c},l.id);return c}import{createContext as mo,useContext as wc,useMemo as fo}from"react";import{createStore as co}from"zustand/vanilla";var uo=e=>e.id||e["@id"];function lo(e){return(Array.isArray(e.service)?e.service:[e.service]).find(t=>t.profile==="http://iiif.io/api/search/0/autocomplete"||t.profile==="http://iiif.io/api/search/1/autocomplete"||t.profile==="AutoCompleteService1")}var Yt=e=>{let n;typeof e=="string"?n={"@context":"http://iiif.io/api/search/1/context.json",profile:"http://iiif.io/api/search/1/search","@id":e,id:e,service:[]}:n=e;let t=n?uo(n):void 0,r=null;return co((o,s)=>({service:n,resources:[],lastQuery:{},loading:!1,error:!1,highlight:null,hasSearch:!!n,hasAutocomplete:n?!!lo(n):!1,errorMessage:"",search(i,a={}){if(!t)throw new Error("No search service found.");r&&!r.signal.aborted&&r.abort(),r=new AbortController;let c=new URLSearchParams;i.q&&c.set("q",i.q),i.motivation&&c.set("motivation",i.motivation),i.date&&c.set("date",i.date),i.user&&c.set("user",i.user),o({loading:!0}),fetch(`${t}?${c.toString()}`,{signal:r.signal,headers:{"Content-Type":"application/json",Accept:"application/json",...a.headers||{}}}).then(async u=>{if(!r?.signal.aborted)if(u.ok){let l=await u.json();o({resources:l.resources,error:!1,errorMessage:""})}else o({resources:[],error:!0,errorMessage:u.statusText})})},clearSearch(){o({resources:[],error:!1,errorMessage:""})},highlightResult(i){let a=s().resources.find(c=>c["@id"]===i);o({highlight:a})},nextResult(){let i=s().resources,a=s().highlight;if(!a){o({highlight:i[0]||null});return}let c=i.findIndex(u=>u["@id"]===a["@id"]);if(c===-1){o({highlight:i[0]||null});return}o({highlight:i[c+1]||i[0]||null})},previousResult(){let i=s().resources,a=s().highlight;if(!a){o({highlight:i[i.length-1]||null});return}let c=i.findIndex(u=>u["@id"]===a["@id"]);if(c===-1){o({highlight:i[i.length-1]||null});return}if(c===0){o({highlight:i[i.length-1]||null});return}o({highlight:i[c-1]||i[i.length-1]||null})}}))};import{useStore as Nc}from"zustand";function Qt(){let e=M();return e?e.service.find(n=>n.profile==="SearchService1"||n.profile==="http://iiif.io/api/search/1/search"):void 0}import{jsx as Ze}from"react/jsx-runtime";var ne=mo(null);ne.displayName="Search";function Gt(e){let n=Qt();return e.store?Ze(ne.Provider,{value:e.store,children:e.children}):Ze(po,{service:n,children:e.children})}function po({service:e,children:n}){let t=fo(()=>Yt(e),[e]);return Ze(ne.Provider,{value:t,children:n})}import{jsx as z}from"react/jsx-runtime";var me=()=>{},fe=vo({setCurrentCanvasId:me,setCurrentCanvasIndex:me,nextCanvas:me,previousCanvas:me,items:[],sequence:[],setSequenceIndex:me,currentSequenceIndex:0,hasNext:!1,hasPrevious:!1});function yo(e){let n=M(),{cursor:t,visibleItems:r,next:o,sequence:s,items:i,setCanvasIndex:a,setCanvasId:c,previous:u,setSequenceIndex:l,hasNext:d,hasPrevious:v}=Nt({startCanvas:e.startCanvas,disablePaging:e.pagingEnabled===!1}),y=ho(()=>({sequence:s,items:i,setCurrentCanvasId:c,nextCanvas:o,previousCanvas:u,totalCanvases:i.length,setCurrentCanvasIndex:a,setSequenceIndex:l,currentSequenceIndex:t,hasNext:d,hasPrevious:v}),[s,i,c,o,u,i,a,l,t]);return n?r.length===0?null:z(fe.Provider,{value:y,children:z(ee.Provider,{value:r,children:z(_,{canvas:r[0],children:e.children})})}):(console.warn("The manifest passed to the provider is not a valid IIIF manifest."),z("div",{children:"Sorry, something went wrong."}))}function Zt(e){let n=J(e.vault),t=wt(e.manifest);if(!t)return console.warn("The manifest passed to the provider is not a valid IIIF manifest."),z("div",{children:"Sorry, something went wrong."});if(t.error)return z("div",{children:t.error.toString()});if(!t.isLoaded)return z("div",{children:"Loading..."});let r=z(yo,{...e,children:e.children});return z(X,{vault:n,children:z(Mt,{manifest:t.id,children:z(Kt,{children:z(Gt,{children:e.rangeId?z(Et,{range:e.rangeId,children:r}):r})})})})}function Xt(){return go(fe)}import So from"react";import{createContext as Co,useMemo as xo}from"react";import Ro from"mitt";import{jsx as Ao}from"react/jsx-runtime";var bo=Ro(),re=Co({emitter:bo});re.displayName="Events";function Jt(){return So.useContext(re).emitter}function lu({emitter:e,children:n}){return Ao(re.Provider,{value:xo(()=>({emitter:e}),[e]),children:n})}import To from"react";import{jsx as K}from"react/jsx-runtime";var Xe=To.createContext({});function en(){let e=D(Xe),n=Object.keys(e),t={};for(let r of n)e[r].Provider&&(t[r]={value:D(e[r]),Provider:e[r].Provider});return t}function Io(e){let n=Object.keys(e),t=e.children;for(let r of n){if(r==="children")continue;let{value:o,Provider:s}=e[r];t=K(s,{value:o,children:t})}return t}function Au(e){let n=D(Xe),t=Po(()=>({...n,...e.providers}),[e.providers]);return K(Xe.Provider,{value:t,children:e.children})}function tn(){return{VaultContext:D(Y),ResourceContext:D(Ce),SimpleViewerReactContext:D(fe),VisibleCanvasReactContext:D(ee),AuthRContext:D(te),SearchReactContext:D(ne),ReactEventContext:D(re)}}function nn(e){return K(X,{vault:e.bridge.VaultContext.vault||void 0,resources:e.bridge.ResourceContext,children:K(ee.Provider,{value:e.bridge.VisibleCanvasReactContext,children:K(fe.Provider,{value:e.bridge.SimpleViewerReactContext,children:K(re.Provider,{value:e.bridge.ReactEventContext,children:K(te.Provider,{value:e.bridge.AuthRContext,children:K(ne.Provider,{value:e.bridge.SearchReactContext,children:e.custom?K(Io,{...e.custom,children:e.children}):e.children})})})})})})}import{createContext as ko,useContext as No,useMemo as Lo}from"react";import{useCallback as on,useLayoutEffect as Mo,useMemo as Eo,useRef as Vo}from"react";import{entityActions as Je}from"@iiif/helpers/vault/actions";import{useMemo as wo}from"react";function rn(){let n=A().getStore();return wo(()=>t=>n.dispatch(t),[n])}function an(e){return typeof e!="string"&&e&&e.bindToVault}function sn(){let e=A(),n=Vo([]),t=rn(),r=Eo(()=>`vault://annotation-page/${new Date().getTime()}/${Math.round(Math.random()*1e9).toString(16)}`,[]);Mo(()=>{let a={id:r,type:"AnnotationPage",behavior:[],label:null,thumbnail:[],summary:null,requiredStatement:null,metadata:[],rights:null,provider:[],items:[],seeAlso:[],homepage:[],rendering:[],service:[]};t(Je.importEntities({entities:{AnnotationPage:{[a.id]:a}}}))},[r]);let o=T(a=>r&&a.iiif.entities.AnnotationPage[r]||null,[r]),s=on((a,c)=>{if(r){if(an(a)){let d=a;d.__vault||d.bindToVault(e),a=typeof d.source=="string"?d.source:d.source.id,n.current[a]=d}else typeof a!="string"&&(a=a.id);let u=e.get({id:r,type:"AnnotationPage"}),l=e.get({id:a,type:"Annotation"});u&&l&&(u.items.find(d=>d.id===l.id)||t(Je.addReference({id:r,type:"AnnotationPage",key:"items",reference:{id:a,type:"Annotation"},index:c})))}},[r]),i=on(a=>{r&&(an(a)?a=typeof a.source=="string"?a.source:a.source.id:typeof a!="string"&&(a=a.id),n.current[a]&&n.current[a].beforeRemove(),e.get({id:r,type:"AnnotationPage"})&&t(Je.removeReference({id:r,type:"AnnotationPage",key:"items",reference:{id:a,type:"Annotation"}})))},[r]);return[o,{addAnnotation:s,removeAnnotation:i}]}import{jsx as zo}from"react/jsx-runtime";var cn=ko(null);function un(){let e=No(cn);return[e.fullPage,{addAnnotation:e.addAnnotation,removeAnnotation:e.removeAnnotation}]}function ln({children:e}){let[n,{addAnnotation:t,removeAnnotation:r}]=sn();return zo(cn.Provider,{value:Lo(()=>({fullPage:n,addAnnotation:t,removeAnnotation:r}),[n]),children:e})}import{jsx as et,jsxs as Oo}from"react/jsx-runtime";function dn({width:e,style:n,height:t,error:r,resetErrorBoundary:o}){return Oo("div",{style:{width:e,height:t,minHeight:500,...n||{},background:"#f9f9f9"},children:[et("h3",{children:"Error occurred"}),et("p",{children:r.message}),et("button",{type:"button",onClick:o,children:"Reset"})]})}import{createContext as Ho,useContext as Fo}from"react";var Q=Ho(null);function Ae(){return Fo(Q)}import{createContext as mn,useContext as Do,useEffect as $o}from"react";var tt=mn(()=>{}),nt=mn(()=>{});function E(e,n,t,r,o=[]){let s=Do(e==="portal"?nt:tt);$o(()=>(e!=="none"&&s(n,t,r),()=>{s(n,null)}),[n,e,s,...o])}import{createContext as Uo,useContext as qo,useEffect as _o}from"react";import{useMemo as Bo}from"react";function b(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=t||o.canvas,i=T(a=>s?a.iiif.entities.Canvas[s]:void 0,[s]);return Bo(()=>{if(i)return r?r(i):i},[i,r,...n])}var rt=Uo(()=>{});function fn(e){let n=b(),t=qo(rt);_o(()=>n&&n.id?(t(n.id,e),()=>t(n.id,-1)):()=>{},[n,e])}import{Fragment as Yo,jsx as V,jsxs as Qo}from"react/jsx-runtime";function vn({children:e,errorFallback:n,outerContainerProps:t={},worldScale:r,...o}){let[s,i]=Pe(),a=en(),c=tn(),u=n||dn,[l,d]=Pe({}),v=Object.entries(l),[y,p]=Pe({}),m=Object.entries(y),[S,g]=Pe({}),h=gn(()=>r||Math.max(...Object.values(S)),[S]),f=gn(()=>({maxOverZoom:h||1,...o.runtimeOptions||{}}),[h,o.runtimeOptions]),C=ot((R,x)=>{g(N=>{if(x===-1){let{[R]:he,...F}=N;return F}return{...N,[R]:x}})},[]),P=ot((R,x,N)=>{d(({[R]:he,...F})=>x?{...F,[R]:{element:x,props:N}}:F)},[]),I=ot((R,x,N)=>{p(({[R]:he,...F})=>x?{...F,[R]:{element:x,props:N}}:F)},[]);return Qo(Wo,{resetKeys:[],fallbackRender:R=>V(u,{...o,...R}),children:[V(Ko,{...o,containerProps:{style:{position:"relative"},...o.containerProps||{}},htmlChildren:V(Yo,{children:v.map(([R,{element:x,props:N}])=>V(pn.Fragment,{children:V(x,{...N||{}})},R))}),onCreated:R=>{i(R),o.onCreated&&o.onCreated(R)},runtimeOptions:f,children:V(Q.Provider,{value:s,children:V(rt.Provider,{value:C,children:V(tt.Provider,{value:P,children:V(nt.Provider,{value:I,children:V(nn,{bridge:c,custom:a,children:V(jo.Provider,{value:o.mode||"explore",children:V(ln,{children:e})})})})})})})}),V("div",{children:m.map(([R,{element:x,props:N}])=>V(pn.Fragment,{children:V(x,{...N||{}})},R))})]})}import{mergeStyles as ti,RegionHighlight as ni}from"@atlas-viewer/atlas";import{useMemo as hn}from"react";import{createEventsHelper as Go}from"@iiif/helpers/events";function Te(e,n){let t=A(),r=hn(()=>Go(t),[t]),o=T(()=>e&&e.id?t.getResourceMeta(e.id,"eventManager"):null,[e]);return hn(()=>e?r.getListenersAsProps(e,n):{},[o,e,t,n])}import{useMemo as Zo}from"react";import{createStylesHelper as Xo}from"@iiif/helpers/styles";function oe(e,n){let t=A(),r=Zo(()=>Xo(t),[t]);return T(()=>{if(!e)return null;let o=r.getAppliedStyles(e.id);return o?n?o[n]:o:void 0},[e,n])}import{useMemo as ri}from"react";import{useMemo as Jo}from"react";import{expandTarget as ei}from"@iiif/helpers/annotation-targets";function Ie(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=A(),i=t||o.annotation,a=T(u=>i?u.iiif.entities.Annotation[i]:void 0,[i]),c=T(u=>a&&a.body?a.body.map(l=>l?l.type==="SpecificResource"?{...l,source:s.get(l)}:l?u.iiif.entities[l.type][l.id]:null:null).filter(Boolean):[],[a]);return Jo(()=>{if(!a)return;let u={...a,body:c,target:ei(a.target,{typeMap:s.getState().iiif.mapping})};return r?r(u):u},[a,r,c,...n])}import{jsx as oi}from"react/jsx-runtime";var we=({id:e,style:n,className:t,interactive:r})=>{let o=Ie({id:e}),s=oe(o,"atlas"),i=oe(o,"html"),a=Te(o,["atlas"]),c=b(),u=ri(()=>ti(n,s),[n,s]);return c&&o&&o.target&&o.target.selector&&o.target.selector.type==="BoxSelector"&&o.target.source&&(o.target.source.id===c.id||o.target.source===c.id)?oi(ni,{id:o.id,isEditing:!0,region:o.target.selector.spatial,style:u,className:i?.className||t,interactive:!!(i?.href||r),href:i?.href||null,title:i?.title||null,hrefTarget:i?.target||null,onClick:()=>{},...a}):null};import{Fragment as ai}from"react";import{useMemo as ii}from"react";function yn(e={},n=[]){let{id:t,selector:r}=e,o=O(),s=t||o.annotationPage,i=T(a=>s?a.iiif.entities.AnnotationPage[s]:void 0,[s]);return ii(()=>{if(i)return r?r(i):i},[i,...n])}import{jsx as Sn}from"react/jsx-runtime";var pe=({className:e,page:n})=>{let t=yn({id:n.id})||n,r=oe(t,"atlas"),o=oe(t,"html");return T(s=>t.id?s.iiif.entities.AnnotationPage[t.id]:null,[]),Sn(ai,{children:t.items?.map(s=>Sn(we,{id:s.id,style:r,className:o?.className||e},s.id))})};import{useEffect as it,useMemo as at}from"react";import{useEffect as kn,useMemo as Nn}from"react";import{useCallback as Rn,useMemo as ci}from"react";function si(e,n){let t=e?.iiif?.meta[n];return t?t.annotationPageManager:null}function Cn(e,n){return T(t=>{let r=[];if(!e)return r;let o=Object.keys(t.iiif.entities.AnnotationPage);for(let s of o)if(!n||n.indexOf(s)!==-1){let i=si(t,s);i&&i.views&&i.views[e]&&r.push(s)}return r},[e,n])}function xn({canvas:e,manifest:n,all:t,canvases:r}){let o=[];if(n)for(let s of n.annotations)o.indexOf(s.id)===-1&&o.push(s.id);if(t){if(r&&r.length)for(let s of r)for(let i of s.annotations)o.indexOf(i.id)===-1&&o.push(i.id)}else if(e)for(let s of e.annotations)o.indexOf(s.id)===-1&&o.push(s.id);return o}function ui(e,n){let t=e?.iiif?.meta[n];return t?t.annotationPageManager:null}function bn(e,n={}){let t=A(),r=M(),o=b(),s=xe(),i=ci(()=>xn({all:n.all,manifest:r,canvas:o,canvases:s}),[n.all,o,s,r]),a=Cn(e,n.all?void 0:i),c=Rn(l=>{e&&t.setMetaValue([l,"annotationPageManager","views"],d=>d&&!d[e]?d:{...d||{},[e]:!1})},[e,t]),u=Rn((l,d={})=>{if(!e)return;let v=t.getState(),y=[];if(d?.deselectOthers){let p=Object.keys(v.iiif.entities.AnnotationPage);for(let m of p){let S=ui(v,m);S&&S.views&&S.views[e]&&y.push(m)}}for(let p of y)c(p);t.setMetaValue([l,"annotationPageManager","views"],p=>p&&p[e]?p:{...p||{},[e]:!0})},[e,c,t]);return{availablePageIds:i,enabledPageIds:a,setPageEnabled:u,setPageDisabled:c}}function An(e,n){return T((t,r)=>r.get(e.map(o=>({id:o,type:n}))),[e,n])}import fi from"mitt";import{useCallback as pi}from"react";import{createStore as gi}from"zustand";import li,{useContext as di}from"react";import{imageServices as mi}from"@iiif/helpers/image-service";import{useStore as Me}from"zustand";var Pn=li.createContext(mi.store);Pn.displayName="ImageServicesHelper";function Ee(){return di(Pn)}function Tn(e){let n=Ee();return Me(n,({loaded:t})=>t[e])}function Ve(){let e=Ee();return Me(e,({loadServiceSync:n})=>n)}function In(){let e=Ee();return Me(e,({loaded:n})=>n)}function Sd(){let e=Ee();return Me(e,({loadService:n})=>n)}var vi=gi((e,n)=>({loaded:{},setLoaded:(t,r="done")=>{e(o=>({loaded:{...o.loaded,[t]:r}}))}})),hi=fi();hi.on("loaded",e=>{vi.getState().setLoaded(e.imageServiceId)});function wn(){let e=Ve(),n=In();return[pi((r,{height:o,width:s})=>r&&e(r,{height:o,width:s},!0),[e]),n]}import{useCallback as yi,useMemo as En,useState as Si}from"react";function Mn(e={}){let n=Ie(),t=b(e.canvasId?{id:e.canvasId}:void 0);return T((r,o)=>{if(!t)return[];if(n&&e.enableSingleAnnotation)return[n];let s=o.get(t.items),i=[];for(let a of s)i.push(...o.get(a.items));return i},[t])}import{createPaintingAnnotationsHelper as Ci}from"@iiif/helpers/painting-annotations";function Vn(e,n=[]){let t=A(),r=En(()=>Ci(t),[]),o=Mn({enableSingleAnnotation:e?.enableSingleAnnotation}),[s,i]=Si(e?.defaultChoices||[]),a=En(()=>r.getPaintables(o,s),[t,o,s,...n]),u={makeChoice:yi((l,{deselectOthers:d=!0,deselect:v=!1}={})=>{a.choice&&i(y=>{if(v){let m=y.filter(S=>S!==l);if(m.length===0){let S=a.items[0].resource.id;return S?[S]:[]}return m}if(d)return[l];let p=[...y];if(p.length===0&&a.items.length){let m=a.items[0].resource.id;m&&p.push(m)}return y.indexOf(l)!==-1?y:[...y,l]})},[a.choice])};return[a,u]}function Ln(e){let n=M(),t=b(),r=A(),o=Jt(),s=e?.emitter||o,[i,a]=wn(),{enabledPageIds:c}=bn(e?.annotationPageManagerId||n?.id||t?.id,{all:!1}),u=An(c,"AnnotationPage"),l=e?.strategies||["empty","images","media","textual-content","complex-timeline"],[d,v]=Vn(e,[a]);kn(()=>{let p=m=>{v.makeChoice(m.choiceId,{deselectOthers:m.deselectOthers,deselect:m.deselect})};return s.on("make-choice",p),()=>{s.off("make-choice",p)}},[]);let y=Nn(()=>At({canvas:t,paintables:d,supports:l,loadImageService:i,vault:r}),[t,d,r,v.makeChoice]);return kn(()=>{let p=d.allChoices,m={canvasId:t?.id,manifestId:n?.id};p&&s.emit("choice-change",{choice:p,partOf:m})},[t?.id,d.allChoices]),Nn(()=>y.type==="unknown"?[y,bt]:[{...y,annotations:{pages:u}},v],[y,u])}import{createContext as xi,useContext as Ri}from"react";var ke=xi(null);ke.displayName="Strategy";function w(){let e=Ri(ke);if(!e)throw new Error("useStrategy must be used within a StrategyProvider");return e}import{createStylesHelper as Pi}from"@iiif/helpers";import{createContext as bi,useContext as Ai}from"react";var Ne=bi(null);Ne.displayName="Controls";function L(){let e=Ai(Ne);if(!e)throw new Error("useStrategy must be used within a StrategyProvider");return e}import{jsx as zn}from"react/jsx-runtime";function On({strategies:e,registerActions:n,defaultChoices:t,onChoiceChange:r,mediaControlsDeps:o,renderMediaControls:s,renderViewerControls:i,viewControlsDeps:a,renderComplexTimelineControls:c,complexTimelineControlsDeps:u,throwOnUnknown:l,children:d}){let v=b(),y=A(),p=at(()=>Pi(y),[y]),[m,S]=Ln({strategies:e||["images"],defaultChoices:t?.map(({id:C})=>C)}),g="choice"in m?m.choice:void 0;if(it(()=>{n&&n(S)},[m.annotations]),it(()=>{r&&r(g)},[g]),it(()=>{if(t)for(let C of t)typeof C.opacity<"u"&&p.applyStyles({id:C.id},"atlas",{opacity:C.opacity})},[t]),m.type==="unknown"&&l)throw new Error(m.reason||"Unknown strategy");let h=at(()=>({renderMediaControls:s,mediaControlsDeps:o||[],renderViewerControls:i,viewControlsDeps:a||[],renderComplexTimelineControls:c,complexTimelineControlsDeps:u||[]}),[o,s,i,a,c,u]),f=at(()=>({strategy:m,actions:S,choices:"choice"in m?m.choice:[]}),[m,v]);return zn(Ne.Provider,{value:h,children:zn(ke.Provider,{value:f,children:d})})}import{useMemo as Ti}from"react";import{jsx as Ii}from"react/jsx-runtime";function Hn({x:e=0,y:n=0,keepCanvasScale:t,children:r}){let{strategy:o}=w(),s=b(),i=Te(s,["deep-zoom"]),a=Ti(()=>t?1:Math.max(1,...o.type==="images"?o.images.map(u=>(u.width||0)/u.target?.spatial.width):[]),[t,o]);fn(a);let c=o.type==="images"?o.images.length:0;return s?Ii("world-object",{height:s.height,width:s.width,x:e,y:n,...i,children:r},`${s.id}/${o.type}/${c}`):null}import{jsx as wi}from"react/jsx-runtime";function Le({style:e}){let n=b();return!n||!n.height||!n.width?null:wi("box",{interactive:!1,target:{x:0,y:0,width:Number(n.width),height:Number(n.height)},style:e})}import{jsx as Mi}from"react/jsx-runtime";function Fn({backgroundStyle:e,alwaysShowBackground:n}){let{strategy:t}=w();return t.type!=="empty"&&!n?null:Mi(Le,{style:e})}import{useLayoutEffect as Qi,useMemo as Gi}from"react";import ki from"mitt";import{useCallback as $,useEffect as st,useReducer as Ei,useRef as ze}from"react";function Dn(e){return{isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,volume:100,duration:e}}function Vi(e,n){switch(n.type){case"RESET":return n.state;case"FINISHED":return{...e,isFinished:!0,isPlaying:!1,playRequested:!1};case"PLAY_PAUSE":return{...e,isFinished:!1,isPlaying:!e.isPlaying};case"PLAY_REQUESTED":return{...e,isFinished:!1,playRequested:!0};case"PAUSE":return{...e,isPlaying:!1};case"PLAY":return{...e,isFinished:!1,playRequested:!1,isPlaying:!0};case"MUTE":return{...e,isMuted:!0};case"SET_VOLUME":return{...e,volume:n.volume,isMuted:n.volume===0};case"TOGGLE_MUTE":return{...e,isMuted:!e.isMuted};case"UNMUTE":return{...e,isMuted:!1}}return e}function ct(e){let n=Math.round(e);return`${Math.floor(n/60)}:${`${n%60}`.padStart(2,"0")}`}function ie(e){let[n,t]=Ei(Vi,Dn(e.duration));st(()=>{t({type:"RESET",state:Dn(e.duration)})},[e.duration]);let r=ze(null),o=ze(null),s=ze(null),i=ze(!1),a=$(()=>{o.current&&r.current&&(o.current.innerHTML=ct(r.current.currentTime),s.current&&(s.current.style.width=`${r.current.currentTime/e.duration*100}%`),i.current!==r.current.muted&&(i.current=r.current.muted,t(r.current.muted?{type:"MUTE"}:{type:"UNMUTE"})))},[e.duration]),c=$(()=>{r.current&&(t({type:"PLAY_REQUESTED"}),r.current.play().then(()=>{t({type:"PLAY"})}),a())},[a]),u=$(()=>{r.current&&(r.current.duration>0&&r.current.paused?c():l())},[a]),l=$(()=>{r.current&&(r.current.pause(),t({type:"PAUSE"}),a())},[a]),d=$(()=>{r.current&&(r.current.muted=!r.current.muted,t(r.current.muted?{type:"MUTE"}:{type:"UNMUTE"}))},[]),v=$(()=>{r.current&&(r.current.muted=!0,t({type:"MUTE"}))},[]),y=$(()=>{r.current&&(r.current.muted=!1,t({type:"UNMUTE"}))},[]),p=$(g=>{r.current&&(r.current.muted=!1,r.current.volume=g/100,t({type:"SET_VOLUME",volume:g}))},[]),m=$(g=>{r.current&&(r.current.currentTime=Math.max(0,Math.min(g*e.duration,e.duration)),a())},[]),S=$(g=>{if(r.current){let h=typeof g=="function"?g(r.current.currentTime):g;r.current.currentTime=Math.max(0,Math.min(h,e.duration)),a()}},[]);return st(()=>{let g=setInterval(()=>{a()},350);return()=>clearInterval(g)},[a,e.duration]),st(()=>{let g=()=>{t({type:"FINISHED"})},h=r.current;return h?.addEventListener("ended",g),()=>h?.removeEventListener("ended",g)},[]),[{element:r,currentTime:o,progress:s},n,{play:c,pause:l,playPause:u,mute:v,unmute:y,toggleMute:d,setVolume:p,setDurationPercent:m,setTime:S}]}import{createStore as Ni}from"zustand/vanilla";function $n({currentKeyFrameIndex:e,keyframes:n,targetTime:t,currentTime:r}){if(r<=t){let o=n.findIndex(a=>a.time>t);if(o===-1)return[e,[]];let s={},i=n.slice(e,o);for(let a of i)a.type==="enter"&&(s[a.id]=a),a.type==="exit"&&(s[a.id]?delete s[a.id]:s[a.id]=a);return[o,Object.values(s)]}return[e,[]]}function Bn({complexTimeline:e,startTime:n=0}){let t=ki(),r={},o={progress:null,currentTime:null},s=0,i=null,a=0,c=null;function u(){let h=S.getState().visibleElements,f=r,C=[],P=Object.keys(f);for(let I of P){let R=f[I],x=h[I];R&&x&&C.push(R)}return C}function l(){return Object.keys(r).map(h=>r[h])}function d(g){o.currentTime&&(o.currentTime.innerHTML=ct(g),o.progress&&(o.progress.style.width=`${g/e.duration*100}%`))}let v=()=>{let g=S.getState(),h=g.currentPrime;if(!h)return;let f=r,C=g.visibleElements,P=Object.keys(f);for(let I of P){let R=f[I],x=C[I];if(R&&I!==h.id&&x){let N=a-x.time*1e3;Math.abs(a-x.time*1e3-R.currentTime*1e3)>300&&(R.currentTime=N/1e3)}}},y=(g=0)=>{let h=g-s,f=S.getState();if(f.isPlaying){let C=f.currentPrime;if(C){let x=r[C.id];x&&(x.paused?a+=h:a=(C.time+x.currentTime)*1e3)}else a+=h;let P=a/1e3;if(P>f.duration){S.getState().setTime(0),S.setState({isPlaying:!1}),p(),d(0);return}d(P);let[I,R]=$n({currentTime:P,currentKeyFrameIndex:f.nextKeyframeIndex,keyframes:f.complexTimeline.keyframes,targetTime:P});R.length&&f.applyKeyframes(I,R)}s=g,i=requestAnimationFrame(y)},p=()=>{i&&cancelAnimationFrame(i)},m=(g,h)=>{},S=Ni((g,h)=>({complexTimeline:e,elements:{},visibleElements:{},isBuffering:!1,bufferMap:{},isMuted:!1,playRequested:!1,isPlaying:!1,isFinished:!1,isReady:!1,volume:100,duration:e.duration,clockStartRequests:0,clockStartTime:0,primeTime:0,currentPrime:null,clockRunning:!1,nextKeyframeIndex:0,startClock:()=>{h().clockRunning||(y(),c=setInterval(v,500)),g({clockRunning:!0,clockStartRequests:h().clockStartRequests+1})},applyKeyframes(f,C){let P=h(),I={...P.visibleElements},R=P.currentPrime;for(let x of C)x.type==="enter"&&(I[x.id]=x,t.emit("complex-timeline.enter",{id:x.id})),x.type==="exit"&&(I[x.id]=null,t.emit("complex-timeline.exit",{id:x.id})),x.isPrime&&(R=x);g({nextKeyframeIndex:f,visibleElements:I,currentPrime:R})},stopClock:()=>{let f=h().clockStartRequests;if(f!==0){if(f===1){p(),c&&clearInterval(c),g({clockRunning:!1,clockStartRequests:0});return}g({clockStartRequests:f-1})}},setElement:(f,C)=>{r[f]=C;let P=Object.keys(r),I=h().complexTimeline;m(C,f),I.items.filter(x=>x.type!=="Image"&&x.type!=="Text").every(x=>P.includes(x.annotationId))&&!h().isReady&&(t.emit("complex-timeline.ready",{complexTimeline:I}),g({isReady:!0}))},removeElement:f=>{delete r[f]},mute(){for(let f of l())f.muted=!0;g({isMuted:!0})},unmute(){for(let f of l())f.muted=!1;g({isMuted:!1})},play(){if(!h().isPlaying){for(let C of u())C.play();g({isPlaying:!0})}},pause(){if(h().isPlaying){for(let C of u())C.pause();g({isPlaying:!1})}},playPause(){let f=h();f.isPlaying?f.pause():f.play()},setDurationPercent(f){let P=h().duration*f;h().setTime(P)},setTime(f){let C=h(),P=a/1e3,I=typeof f=="function"?f(P):f,R=C.nextKeyframeIndex;if(P>I){g({visibleElements:{},currentPrime:null});let ye=Object.keys(C.visibleElements);for(let Se of ye)t.emit("complex-timeline.exit",{id:Se});P=0,R=0}let[x,N]=$n({currentTime:P,currentKeyFrameIndex:R,keyframes:C.complexTimeline.keyframes,targetTime:I});C.applyKeyframes(x,N),a=I*1e3;let F=S.getState().visibleElements,Tr=r,Ir=Object.keys(F);for(let ye of Ir){let Se=F[ye];if(Se){let Rt=Tr[ye];Rt&&(Rt.currentTime=(a-Se.time*1e3)/1e3)}}d(I)},setVolume(f){for(let C of l())C.volume=Math.min(1,Math.max(0,f/100));g({volume:f})},toggleMute(){let f=h();f.isMuted?(f.unmute(),g({isMuted:!1})):(f.mute(),g({isMuted:!0}))},clearProgressElement(){o.progress=null},setProgressElement(f){o.progress=f},setCurrentTimeElement(f){o.currentTime=f},clearCurrentTimeElement(){o.currentTime=null}}));return t.on("complex-timeline.enter",g=>{let h=S.getState(),f=g.id,C=r[f];C&&h.isPlaying&&C.play()}),t.on("complex-timeline.exit",g=>{let h=S.getState(),f=g.id,C=r[f];C&&(C.currentTime=0,C.pause())}),S.getState().setTime(n),{store:S,emitter:t}}import{HTMLPortal as Zi}from"@atlas-viewer/atlas";import{Fragment as Gn,useMemo as qi}from"react";import{HTMLPortal as Di}from"@atlas-viewer/atlas";import{getId as $i}from"@iiif/parser/image-3";import ae,{useMemo as ut}from"react";import{jsx as B}from"react/jsx-runtime";var qn=ae.createContext("en"),_n=ae.createContext({}),Kn=ae.createContext(null);function Fm(e){return B(_n.Provider,{value:e.translations,children:e.children})}function Dm(e){return B(qn.Provider,{value:e.language,children:e.children})}function $m(e){return B(Kn.Provider,{value:e.convert,children:e.children})}function jn(){return ae.useContext(Kn)}function lt(){return ae.useContext(qn)}function Wn(){return ae.useContext(_n)}function Un(e){return e.indexOf("-")!==-1?e.slice(0,e.indexOf("-")):e}function Li({as:e,language:n,children:t,viewingDirection:r,...o}){let s=lt();return ut(()=>Un(s)===Un(n),[s,n])?e?B(e,{...o,children:t}):B("span",{...o,children:t}):e?B(e,{...o,lang:n,dir:r,children:t}):B("span",{...o,lang:n,dir:r,children:t})}function Yn(e,n,t){if(n.length===0)return;if(n.length===1)return n[0];if(n.indexOf(e)!==-1)return e;let r=e.indexOf("-")!==-1?e.slice(0,e.indexOf("-")):null;if(r&&n.indexOf(r)!==-1)return r;for(let o of t)if(n.indexOf(o)!==-1)return o;return n.indexOf("none")!==-1?"none":n.indexOf("@none")!==-1?"@none":n[0]}var zi=(e,n=[])=>{let t=lt();return ut(()=>{let r=e();return Yn(t,r,[])},[t,...n])};function G(e,n,t,r){return n?t?t(e[n]||n,r||"none"):e[n]||n:""}function Oi(e,n,t=`
|
|
2
|
-
`,r={}){let o=jn(),s=zi(()=>Object.keys(e||{}),[e]);return[ut(()=>{if(!e)return G(r,n,o)||"";if(typeof e=="string")return G(r,e,o);let i=s?e[s]:void 0;return i?typeof i=="string"?i:i.map(a=>G(r,a,o,s)).join(t):""},[s,n,e]),s]}function Bm(){let e=lt(),n=Wn(),t=jn();return function(o,s="",i=`
|
|
3
|
-
`,a=n){let c=Object.keys(o||{}),u=Yn(e,c,[]);if(!o)return G(a,s,t)||"";if(typeof o=="string")return G(a,o,t);let l=u?o[u]:void 0;return l?typeof l=="string"?G(a,l,t,u):l.map(d=>G(a,d,t,u)).join(typeof i<"u"?i:`
|
|
4
|
-
`):""}}function ge({as:e,defaultText:n,enableDangerouslySetInnerHTML:t,children:r,separator:o,...s}){let i=Wn(),[a,c]=Oi(r,n,o,i);return c?B(Li,{...s,as:e,language:c,title:t?void 0:a,dangerouslySetInnerHTML:t?{__html:a}:void 0,children:t?void 0:a}):e?B(e,{...s,children:a}):B("span",{...s,title:t?void 0:a,dangerouslySetInnerHTML:t?{__html:a}:void 0,children:t?void 0:a})}import{isImageServiceLevel as Hi}from"@iiif/parser/image-3";import{useMemo as dt}from"react";import{jsx as Oe,jsxs as Fi}from"react/jsx-runtime";var mt=e=>{let n=e.format||"jpg",t=e.width/(e.crop?.width||e.tiles.width),r=e.tiles.imageService.sizes||[],o=e.enableThumbnail,s=e.enableSizes,i=dt(()=>{let u=e.tiles.imageService.id||e.tiles.imageService["@id"];return u?.endsWith("/info.json")?u.slice(0,-1*10):u},[e.tiles.imageService.id,e.tiles.imageService["@id"]]),a=dt(()=>{let u=e.tiles.imageService.tiles||[];if(!u.length){let l=e.width,d=[1],v=1;for(;Math.pow(2,v)<l;)v=v*2,d.push(v);return(e.tiles.imageService.maxArea||e.tiles.imageService.maxWidth||e.tiles.imageService.maxHeight)&&Hi(2,e.tiles.imageService)?[{width:256,height:256,scaleFactors:d}]:[]}return u},[e.tiles.imageService,e.width]),c=dt(()=>{let u=e.tiles.imageService;return(u?u["@context"]?Array.isArray(u["@context"])?u["@context"]:[u["@context"]]:[]:[]).indexOf("http://iiif.io/api/image/3/context.json")!==-1},[e.tiles.imageService.id,e.tiles.imageService]);return Oe("world-object",{rotation:e.rotation,scale:t,height:e.crop?.height||e.tiles.height,width:e.crop?.width||e.tiles.width,x:e.x,y:e.y,onClick:e.onClick,children:Fi("composite-image",{id:e.tiles.imageService.id,width:e.crop?.width||e.tiles.width,height:e.crop?.height||e.tiles.height,crop:e.crop,renderOptions:e.renderOptions,children:[o&&e.tiles.thumbnail?Oe("world-image",{priority:!0,uri:e.tiles.thumbnail.id,target:{width:e.tiles.width,height:e.tiles.height},display:{width:e.tiles.thumbnail.width,height:e.tiles.thumbnail.height},crop:e.crop}):null,s&&r.map((u,l)=>Oe("world-image",{uri:`${i}/full/${u.width},${c?u.height:""}/0/default.${n}`,target:{width:e.tiles.width,height:e.tiles.height},display:{width:u.width,height:u.height},crop:e.crop},l)),a.map(u=>(u.scaleFactors||[]).map(l=>Oe("tiled-image",{uri:e.tiles.imageService.id,display:{width:e.tiles.width,height:e.tiles.height},format:n,tile:u,scaleFactor:l,crop:e.crop,version3:c},`${e.tiles.imageService.id}-tile-${l}`)))]},e.tiles.imageService.id)},e.tiles.imageService.id)};import{jsx as j,jsxs as Ui}from"react/jsx-runtime";function Bi({resource:e,heading:n,note:t,extra:r}){return r?j(Di,{target:{x:0,y:0,width:r.target?.spatial.width,height:r.target?.spatial.height},backgroundColor:"#333",relative:!0,children:j("div",{style:{display:"flex",alignContent:"center",justifyContent:"center",alignItems:"center",height:"100%",width:"100%",background:"#444",color:"#BBB"},children:Ui("div",{children:[j(ge,{children:n||"Not authorised"}),t&&j("p",{children:j(ge,{children:t})}),j("p",{children:e.id||e["@id"]||"unknown"})]})})}):null}function Qn({image:e,thumbnail:n,crop:t,enableSizes:r,enableThumbnail:o,renderOptions:s}){let i=jt(),a=$i(e.service),c=Tn(a),u=Ve(),l=c?.service;u(e.service,e);let d=l&&c?.status==="done",v=(l?.preferredFormats||[])[0],y=n&&n.type==="fixed"&&n.id&&!n.id.includes("/full/full/")&&!n.id.includes("/max/")?n:void 0;if(d===!1)return null;if(!i){let p=e.service,m=p.width||e.width||0,S=p.height||e.height||0;return j(mt,{enableThumbnail:o,renderOptions:s,tiles:{id:p.id||p["@id"]||"unknown",height:S,width:m,imageService:p,thumbnail:y},enableSizes:r,x:0,y:0,format:v,width:e.target?.spatial.width,height:e.target?.spatial.height,crop:t})}return j(Wt,{resource:e.service,errorComponent:Bi,extra:e,children:p=>{let m=p.width||e.width||0,S=p.height||e.height||0;return j(mt,{enableThumbnail:o,renderOptions:s,tiles:{id:p.id||p["@id"]||"unknown",height:S,width:m,imageService:p,thumbnail:y},format:v,enableSizes:r,x:0,y:0,width:e.target?.spatial.width,height:e.target?.spatial.height,crop:t})}},e.id)}import{jsx as ft,jsxs as Zn}from"react/jsx-runtime";function se({id:e,image:n,thumbnail:t,isStatic:r,x:o=0,y:s=0,children:i,selector:a,onClick:c,enableSizes:u}){let l=qi(()=>{if(!(!a||a.spatial.x===0&&a.spatial.y===0))return a.spatial},[a]);return ft("world-object",{x:o+n.target.spatial.x,y:s+n.target.spatial.y,width:n.target.spatial.width,height:n.target.spatial.height,onClick:c,children:n.service?Zn(Gn,{children:[ft(Qn,{image:n,thumbnail:t,crop:l,enableSizes:u}),i]},"service"):Zn(Gn,{children:[ft("world-image",{onClick:c,uri:n.id,target:{x:0,y:0,width:n.target.spatial.width,height:n.target.spatial.height},display:n.width&&n.height?{width:n.width,height:n.height}:void 0,crop:l}),i]},"no-service")},e+(n.service?"server":"no-service"))}import{useStore as er}from"zustand";import{createContext as _i,useContext as Ki}from"react";import{useStore as ji}from"zustand";import{jsx as Wi}from"react/jsx-runtime";var pt=_i(null);pt.displayName="ComplexTimeline";function Xn({children:e,store:n}){return Wi(pt.Provider,{value:n,children:e})}function ff(e){let n=Ki(pt);if(!n)throw new Error("useComplexTimeline must be used within a ComplexTimelineProvider");return ji(n,e)}import{HTMLPortal as Yi}from"@atlas-viewer/atlas";import{Fragment as Jn,jsx as ve}from"react/jsx-runtime";function He({strategy:e,onClickPaintingAnnotation:n}){return ve(Jn,{children:e.items.map((t,r)=>ve(Jn,{children:ve(Yi,{onClick:n?o=>{o.stopPropagation(),n(t.annotationId,t,o)}:void 0,target:t.target?.spatial||void 0,children:ve("div",{"data-textual-content":!0,children:ve(ge,{enableDangerouslySetInnerHTML:!0,children:t.text})})},r)}))})}import{Fragment as Xi,jsx as Fe,jsxs as Ji}from"react/jsx-runtime";function tr({strategy:e,children:n}){let{store:t}=Gi(()=>Bn({complexTimeline:e}),[e]),r=er(t,i=>i.isReady),o=er(t,i=>i.visibleElements);function s(i){return a=>{a&&t.getState().setElement(i,a)}}return Qi(()=>{if(r){let{startClock:i,stopClock:a}=t.getState();return i(),()=>{a()}}},[e,r]),E("portal","custom-controls",Xn,{store:t,children:n},[r]),Ji(Xi,{children:[e.items.map(i=>i.type!=="Image"||!o[i.annotationId]?null:Fe(se,{image:i,id:i.annotationId},i.id)),e.items.map((i,a)=>i.type!=="Text"||!o[i.annotationId]?null:Fe(He,{strategy:{type:"textual-content",items:[i]}},a)),e.items.map((i,a)=>i.type!=="Video"||!i.target.spatial?null:Fe(Zi,{target:i.target.spatial,children:Fe("video",{ref:s(i.annotationId),src:i.url,style:{height:"100%",width:"100%",opacity:o[i.annotationId]?1:0}})},a))]})}import{jsx as ea}from"react/jsx-runtime";function nr(){let{strategy:e}=w(),{renderComplexTimelineControls:n}=L();return e.type!=="complex-timeline"?null:ea(tr,{strategy:e,children:n?n(e):null})}import{Fragment as na,jsx as ta,jsxs as ra}from"react/jsx-runtime";function rr({onClickPaintingAnnotation:e,children:n}){let{strategy:t}=w(),{renderViewerControls:r,viewControlsDeps:o}=L(),s=Ae(),i=b();return E(s&&t.type==="textual-content"&&r?"overlay":"none",`canvas-portal-controls-${i?.id}`,Q.Provider,r?{value:s||null,children:r(t)}:{},[i,s,t,...o||[]]),t.type!=="textual-content"?null:ra(na,{children:[ta(He,{strategy:t,onClickPaintingAnnotation:e}),n]})}import{useEffect as ua,useMemo as la,useRef as da,useState as ma}from"react";import{useEffect as oa}from"react";var or=(e,n=[])=>{let t=A();oa(()=>{e(t)},[t,...n])};import ia,{useContext as aa}from"react";import{ImageServiceLoader as sa}from"@iiif/helpers/image-service";var ca=ia.createContext(new sa);function ir(){return aa(ca)}import{createThumbnailHelper as fa}from"@iiif/helpers/thumbnail";function ce(e,n,{canvasId:t,manifestId:r}={}){let o=A(),s=ir(),i=la(()=>fa(o,{imageServiceLoader:s}),[o,s]),[a,c]=ma(),u=M(r?{id:r}:void 0),l=b(t?{id:t}:void 0),d=l||u,v=da(!1);if(ua(()=>(v.current=!1,()=>{v.current=!0}),[]),!d)throw new Error("Must be called under a manifest or canvas context.");return or(y=>{i.getBestThumbnailAtSize(d,e,n).then(p=>{p.best&&!v.current&&c(p.best)})},[d]),a}import{Fragment as ga,jsx as pa,jsxs as va}from"react/jsx-runtime";function ar({isStatic:e=!1,enableSizes:n=!1,onClickPaintingAnnotation:t,children:r}){let{strategy:o}=w(),{renderViewerControls:s,viewControlsDeps:i}=L(),a=b(),c=Ae(),u=ce({maxWidth:256,maxHeight:256});return E(c&&o.type==="images"&&s?"overlay":"none",`canvas-portal-controls-${a?.id}`,Q.Provider,s?{value:c||null,children:s(o)}:{},[a,c,o,...i||[]]),o.type!=="images"?null:va(ga,{children:[o.images.map((l,d)=>pa(se,{isStatic:e,image:l,id:l.id,thumbnail:d===0?u:void 0,selector:l.selector,enableSizes:n,onClick:t?v=>{t(l.annotationId,l,v)}:void 0},l.id+d)),r]})}import{Fragment as ha,jsx as gt,jsxs as ya}from"react/jsx-runtime";function vt({model:e}){return ya(ha,{children:[gt("style",{children:`
|
|
5
|
-
.model-container {
|
|
6
|
-
position: absolute;
|
|
7
|
-
top: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
left: 0;
|
|
10
|
-
right: 0;
|
|
11
|
-
background: #000;
|
|
12
|
-
z-index: 13;
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
pointer-events: visible;
|
|
16
|
-
}
|
|
17
|
-
`}),gt("div",{className:"model-container",children:gt("model-viewer",{"interaction-prompt":"none",style:{width:"100%",height:"100%"},"camera-controls":"","ar-status":"not-presenting",src:e.id})})]})}function De({model:e,name:n}){return E("overlay",`model-${n}`,vt,{model:e},[e]),null}import{jsx as Sa}from"react/jsx-runtime";function sr(){let{strategy:e}=w();return e.type!=="3d-model"?null:Sa(De,{model:e.model})}import{Fragment as Ca,jsx as cr,jsxs as xa}from"react/jsx-runtime";function ur({children:e}){let{strategy:n}=w(),[t]=un();return n.type!=="images"?null:xa(Ca,{children:[t?cr(pe,{page:t}):null,n.annotations&&n.annotations.pages?n.annotations.pages.map(r=>cr(pe,{page:r},r.id)):null,e]})}import{createContext as yt,useContext as St}from"react";import{jsx as ht}from"react/jsx-runtime";var lr=yt(null),dr=yt(null),mr=yt(null);function Pp(){let e=St(lr);if(!e)throw new Error("Ctx not found");return e}function Tp(){let e=St(dr);if(!e)throw new Error("Ctx not found");return e}function Ip(){let e=St(mr);if(!e)throw new Error("Ctx not found");return e}function $e({actions:e,state:n,children:t,currentTime:r,progress:o,element:s}){return ht(mr.Provider,{value:{currentTime:r,progress:o,element:s},children:ht(dr.Provider,{value:e,children:ht(lr.Provider,{value:n,children:t})})})}import{useMemo as Ra}from"react";import{expandTarget as ba}from"@iiif/helpers";function Be(){let e=M(),n=b();return Ra(()=>{if(!e||!n||!e.start)return null;let t=ba(e.start);return!t||t.source.id!==n.id||!t||!t.selector||t.selector.type!=="TemporalSelector"?null:t.selector.temporal},[e,n])}import{jsx as Aa,jsxs as Pa}from"react/jsx-runtime";function Ct({media:e,startTime:n,children:t}){let[{element:r,currentTime:o,progress:s},i,a]=ie({duration:e.duration}),c=n?`${e.url}#t=${n}`:e.url;return Pa($e,{state:i,actions:a,currentTime:o,progress:s,element:r,children:[Aa("audio",{ref:r,src:c}),t]},e.url)}function Ue({media:e,mediaControlsDeps:n,audioCopmonent:t=Ct,children:r}){let o=Be();return E("portal","audio",t,{media:e,startTime:o?o.startTime:null,children:r},[e,o,...n||[]]),null}import{jsx as fr}from"react/jsx-runtime";function ue({x:e=0,y:n=0}){let t=b(),r=ce({maxWidth:256,maxHeight:256});return!t||!r||r.type!=="fixed"?null:fr("world-object",{height:t.height,width:t.width,x:e,y:n,children:fr("world-image",{uri:r.id,target:{x:0,y:0,width:t.width,height:t.height},display:r.width&&r.height?{width:r.width,height:r.height}:void 0,crop:void 0})})}import{Fragment as Ia,jsx as pr,jsxs as Ta}from"react/jsx-runtime";function gr({as:e}){let{strategy:n}=w(),{renderMediaControls:t,mediaControlsDeps:r}=L();return n.type!=="media"||n.media.type!=="Sound"?null:pr(Ia,{children:Ta(Ue,{media:n.media,mediaControlsDeps:r,audioCopmonent:e,children:[pr(ue,{}),t?t(n):null]},n.media.url)})}import{Fragment as wa,jsx as qe,jsxs as Ma}from"react/jsx-runtime";function vr(){let{strategy:e}=w(),{renderViewerControls:n,viewControlsDeps:t}=L(),r=b(),o=r?.accompanyingCanvas,s=r?.placeholderCanvas;return Ma(wa,{children:[e.type==="media"&&e.media.type==="Sound"&&o?qe(_,{canvas:o.id,children:qe(Z,{renderViewerControls:n,viewControlsDeps:t})}):null,e.type==="media"&&e.media.type==="Sound"&&s&&!o?qe(_,{canvas:s.id,children:qe(Z,{renderViewerControls:n,viewControlsDeps:t})}):null]})}import{jsx as hr,jsxs as Ea}from"react/jsx-runtime";function xt({element:e,media:n,startTime:t,playPause:r,poster:o}){let s="div",i=t?`${n.url}#t=${t}`:n.url;return Ea(s,{className:"video-container",part:"video-container",onClick:r,children:[hr("style",{children:`
|
|
18
|
-
.video-container {
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: 0;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
right: 0;
|
|
24
|
-
background: #000;
|
|
25
|
-
z-index: 13;
|
|
26
|
-
display: flex;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
pointer-events: visible;
|
|
29
|
-
}
|
|
30
|
-
`}),hr("video",{poster:o,ref:e,src:i,style:{width:"100%",objectFit:"contain"}})]})}function _e({media:e,mediaControlsDeps:n,children:t,videoComponent:r=xt,captions:o}){let s=b(),i=Be(),a=s&&s.placeholderCanvas&&s.placeholderCanvas.id||void 0,c=ce({},!1,{canvasId:a}),[{element:u,currentTime:l,progress:d},v,y]=ie({duration:e.duration});return E("overlay","video-element",r,{element:u,media:e,playPause:y.playPause,poster:c?.id,canvas:s,startTime:i?i.startTime:null,captions:o},[c]),E("portal","custom-controls",$e,{state:v,actions:y,currentTime:l,progress:d,element:u,children:t},[l,v,e,...n||[]]),null}import{jsx as Va,jsxs as ka}from"react/jsx-runtime";function yr({as:e}){let{strategy:n}=w(),{renderMediaControls:t,mediaControlsDeps:r}=L();return n.type!=="media"||n.media.type!=="Video"?null:ka(_e,{captions:n.captions,media:n.media,mediaControlsDeps:r,videoComponent:e,children:[Va(ue,{}),t?t(n):null]},n.media.url)}import{useRef as Na}from"react";import{jsx as Sr,jsxs as za}from"react/jsx-runtime";function La({element:e,media:n,playPause:t}){let r=Na(null);return n.youTubeId?za("div",{className:"video-container",part:"video-container",onClick:t,children:[Sr("style",{children:`
|
|
31
|
-
.video-container {
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 0;
|
|
34
|
-
bottom: 0;
|
|
35
|
-
left: 0;
|
|
36
|
-
right: 0;
|
|
37
|
-
background: #000;
|
|
38
|
-
z-index: 13;
|
|
39
|
-
display: flex;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
pointer-events: visible;
|
|
42
|
-
}
|
|
43
|
-
.video-yt {
|
|
44
|
-
border: none;
|
|
45
|
-
width: 100%;
|
|
46
|
-
object-fit: contain;
|
|
47
|
-
}
|
|
48
|
-
`}),Sr("iframe",{className:"video-yt",ref:r,src:`https://www.youtube.com/embed/${n.youTubeId}?enablejsapi=1&origin=${window.location.host}`,referrerPolicy:"no-referrer",sandbox:"allow-scripts allow-same-origin allow-presentation"})]}):null}function Cr({media:e,mediaControlsDeps:n,children:t}){let[{element:r,currentTime:o,progress:s},i,a]=ie({duration:e.duration});return E("overlay","video-element",La,{element:r,media:e,playPause:a.playPause}),null}import{jsx as Oa,jsxs as Ha}from"react/jsx-runtime";function xr(){let{strategy:e}=w(),{renderMediaControls:n,mediaControlsDeps:t}=L();return e.type!=="media"||e.media.type!=="VideoYouTube"?null:Ha(Cr,{media:e.media,mediaControlsDeps:t,children:[Oa(ue,{}),n?n(e):null]})}import{jsx as U,jsxs as Rr}from"react/jsx-runtime";function Z({x:e,y:n,onChoiceChange:t,registerActions:r,defaultChoices:o,isStatic:s,renderViewerControls:i,renderMediaControls:a,renderComplexTimelineControls:c,complexTimelineControlsDeps:u,viewControlsDeps:l,mediaControlsDeps:d,strategies:v,throwOnUnknown:y,backgroundStyle:p,alwaysShowBackground:m,keepCanvasScale:S=!1,enableSizes:g=!1,enableYouTube:h=!0,onClickPaintingAnnotation:f,components:C={},children:P}){return Rr(On,{throwOnUnknown:y,onChoiceChange:t,registerActions:r,strategies:v,defaultChoices:o,mediaControlsDeps:d,renderMediaControls:a,renderViewerControls:i,renderComplexTimelineControls:c,complexTimelineControlsDeps:u,viewControlsDeps:l,children:[Rr(Hn,{keepCanvasScale:S,x:e,y:n,children:[U(Fn,{alwaysShowBackground:m,backgroundStyle:p}),U(nr,{}),U(rr,{}),U(ar,{isStatic:s,enableSizes:g,onClickPaintingAnnotation:f}),U(ur,{}),U(sr,{}),U(gr,{as:C.Audio}),U(yr,{as:C.Video}),h?U(xr,{}):null,P]}),U(vr,{})]})}import{jsx as br}from"react/jsx-runtime";function Ar(e){let n=b();return!n||!n.placeholderCanvas?null:br(_,{canvas:n.placeholderCanvas.id,children:br(Z,{renderViewerControls:e.renderViewerControls})})}import{Fragment as Ba,jsx as q,jsxs as Ua}from"react/jsx-runtime";var $a=Pr(function(n,t){let r=M(),o=xe(),s=Xt(),{ViewerControls:i,MediaControls:a,ComplexTimelineControls:c}=n.components||{};if(Fa(t,()=>s,[s]),!r)return q("div",{});let u=0,l=r.viewingDirection==="top-to-bottom",d=r.viewingDirection==="bottom-to-top",v=r.viewingDirection==="left-to-right",y=r.viewingDirection==="right-to-left",m=r.behavior.includes("continuous")?0:n.spacing||0,S=d||y,g=Da(()=>S?[...o].reverse():o,[o,S]);return Ua(Ba,{children:[n.header,q(k.Viewer,{height:n.height,mode:n.mode,renderPreset:n.renderPreset,runtimeOptions:n.runtimeOptions,children:g.map((h,f)=>{let C=0,P=0;return l?(C=u,u+=h.width+m):(P=u,u+=h.height+m),q(_,{canvas:h.id,children:q(k.RenderCanvas,{strategies:["3d-model","media","images","empty","textual-content","complex-timeline"],renderViewerControls:f===0&&i?()=>q(i,{}):void 0,renderMediaControls:f===0&&a?()=>q(a,{}):void 0,renderComplexTimelineControls:f===0&&c?()=>q(c,{}):void 0,x:C,y:P,...n.canvasProps||{},children:n.annotations},h.id)},h.id)})},n.reuseAtlas?"":s.currentSequenceIndex),n.children]})}),k=Pr(function({children:n,height:t,annotations:r,canvasProps:o,spacing:s,header:i,components:a,mode:c,reuseAtlas:u,renderPreset:l,runtimeOptions:d,...v},y){let p=J();return q(X,{vault:p,children:q(Zt,{...v,children:q($a,{ref:y,height:t,components:a,spacing:s,canvasProps:o,annotations:r,header:i,mode:c,reuseAtlas:u,renderPreset:l,runtimeOptions:d,children:n})})})});k.RenderImage=se;k.RenderCanvas=Z;k.RenderAnnotationPage=pe;k.RenderAnnotation=we;k.Viewer=vn;k.CanvasBackground=Le;k.Audio=Ue;k.Video=_e;k.Model=De;k.AudioHTML=Ct;k.VideoHTML=xt;k.ModelHTML=vt;k.PlaceholderCanvas=Ar;export{Ce as a,O as b,W as c,Y as d,X as e,J as f,It as g,wt as h,Mt as i,_ as j,A as k,T as l,ee as m,xe as n,M as o,Et as p,Qr as q,je as r,Fs as s,Vt as t,Bs as u,We as v,kt as w,Nt as x,ec as y,Ot as z,Ht as A,Ft as B,Ye as C,Lt as D,te as E,ro as F,oo as G,Kt as H,jt as I,de as J,io as K,yc as L,ao as M,qt as N,Sc as O,Wt as P,Qt as Q,fe as R,yo as S,Zt as T,Xt as U,bo as V,re as W,Jt as X,lu as Y,en as Z,Io as _,Au as $,tn as aa,nn as ba,rn as ca,sn as da,un as ea,ln as fa,dn as ga,Q as ha,Ae as ia,E as ja,b as ka,vn as la,Te as ma,oe as na,Ie as oa,yn as pa,xn as qa,bn as ra,An as sa,Ve as ta,Sd as ua,wn as va,Mn as wa,Vn as xa,Ln as ya,ke as za,w as Aa,Ne as Ba,L as Ca,On as Da,Hn as Ea,Fn as Fa,ct as Ga,ie as Ha,Fm as Ia,Dm as Ja,$m as Ka,jn as La,lt as Ma,Wn as Na,Li as Oa,zi as Pa,Oi as Qa,Bm as Ra,ge as Sa,se as Ta,Xn as Ua,ff as Va,nr as Wa,rr as Xa,or as Ya,ca as Za,ir as _a,ce as $a,ar as ab,sr as bb,ur as cb,Pp as db,Tp as eb,Ip as fb,$e as gb,Be as hb,ue as ib,gr as jb,vr as kb,yr as lb,xr as mb,k as nb};
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import React__default, { ReactNode, FC, ComponentType, RefObject, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { AtlasProps, Preset, BoxStyle, ViewerMode } from '@atlas-viewer/atlas';
|
|
4
|
-
import { AnnotationPage, Reference } from '@iiif/presentation-3';
|
|
5
|
-
import { AnnotationPageNormalized, CanvasNormalized } from '@iiif/presentation-3-normalized';
|
|
6
|
-
import { S as SingleAudio, a as SingleVideo, M as MediaStrategy, b as StrategyActions, c as SingleImageStrategy, E as EmptyStrategy, C as ComplexTimelineStrategy, R as RenderingStrategy, I as ImageWithOptionalService } from './useRenderingStrategy-BiuSDiXu.cjs';
|
|
7
|
-
import { ChoiceDescription, ImageCandidate, BoxSelector } from '@iiif/helpers';
|
|
8
|
-
import { Vault } from '@iiif/helpers/vault';
|
|
9
|
-
|
|
10
|
-
declare function Viewer({ children, errorFallback, outerContainerProps, worldScale: _worldScale, ...props }: AtlasProps & {
|
|
11
|
-
height?: number | string;
|
|
12
|
-
width?: number | string;
|
|
13
|
-
resizeHash?: number;
|
|
14
|
-
containerProps?: any;
|
|
15
|
-
outerContainerProps?: any;
|
|
16
|
-
aspectRatio?: number;
|
|
17
|
-
errorFallback?: any;
|
|
18
|
-
renderPreset?: Preset;
|
|
19
|
-
worldScale?: number;
|
|
20
|
-
} & {
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}): react_jsx_runtime.JSX.Element;
|
|
23
|
-
|
|
24
|
-
declare const RenderAnnotation: FC<{
|
|
25
|
-
id: string;
|
|
26
|
-
className?: string;
|
|
27
|
-
style?: BoxStyle;
|
|
28
|
-
interactive?: boolean;
|
|
29
|
-
}>;
|
|
30
|
-
|
|
31
|
-
declare const RenderAnnotationPage: FC<{
|
|
32
|
-
page: AnnotationPage | AnnotationPageNormalized;
|
|
33
|
-
className?: string;
|
|
34
|
-
}>;
|
|
35
|
-
|
|
36
|
-
interface AudioComponentProps {
|
|
37
|
-
media: SingleAudio;
|
|
38
|
-
startTime?: number | null;
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
}
|
|
41
|
-
declare function AudioHTML({ media, startTime, children }: AudioComponentProps): react_jsx_runtime.JSX.Element;
|
|
42
|
-
declare function Audio({ media, mediaControlsDeps, audioCopmonent, children, }: {
|
|
43
|
-
media: SingleAudio;
|
|
44
|
-
mediaControlsDeps?: any[];
|
|
45
|
-
children: ReactNode;
|
|
46
|
-
audioCopmonent?: ComponentType<AudioComponentProps>;
|
|
47
|
-
}): null;
|
|
48
|
-
|
|
49
|
-
interface VideoComponentProps {
|
|
50
|
-
element: RefObject<HTMLVideoElement>;
|
|
51
|
-
media: SingleVideo;
|
|
52
|
-
playPause: () => void;
|
|
53
|
-
canvas: CanvasNormalized;
|
|
54
|
-
poster?: string;
|
|
55
|
-
startTime?: number;
|
|
56
|
-
captions?: MediaStrategy['captions'];
|
|
57
|
-
}
|
|
58
|
-
declare function VideoHTML({ element, media, startTime, playPause, poster, }: VideoComponentProps): react_jsx_runtime.JSX.Element;
|
|
59
|
-
declare function Video({ media, mediaControlsDeps, children, videoComponent, captions, }: {
|
|
60
|
-
media: SingleVideo;
|
|
61
|
-
mediaControlsDeps?: any[];
|
|
62
|
-
children: ReactNode;
|
|
63
|
-
posterCanvasId?: string;
|
|
64
|
-
videoComponent?: ComponentType<VideoComponentProps>;
|
|
65
|
-
captions?: MediaStrategy['captions'];
|
|
66
|
-
}): null;
|
|
67
|
-
|
|
68
|
-
type CanvasProps = {
|
|
69
|
-
x?: number;
|
|
70
|
-
y?: number;
|
|
71
|
-
onCreated?: any;
|
|
72
|
-
onChoiceChange?: (choice?: ChoiceDescription) => void;
|
|
73
|
-
registerActions?: (actions: StrategyActions) => void;
|
|
74
|
-
defaultChoices?: Array<{
|
|
75
|
-
id: string;
|
|
76
|
-
opacity?: number;
|
|
77
|
-
}>;
|
|
78
|
-
isStatic?: boolean;
|
|
79
|
-
keepCanvasScale?: boolean;
|
|
80
|
-
children?: ReactNode;
|
|
81
|
-
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
82
|
-
viewControlsDeps?: any[];
|
|
83
|
-
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
84
|
-
renderComplexTimelineControls?: (strategy: ComplexTimelineStrategy) => ReactNode;
|
|
85
|
-
complexTimelineControlsDeps?: any[];
|
|
86
|
-
mediaControlsDeps?: any[];
|
|
87
|
-
strategies?: Array<RenderingStrategy['type']>;
|
|
88
|
-
backgroundStyle?: BoxStyle;
|
|
89
|
-
alwaysShowBackground?: boolean;
|
|
90
|
-
enableSizes?: boolean;
|
|
91
|
-
enableYouTube?: boolean;
|
|
92
|
-
ignoreSize?: boolean;
|
|
93
|
-
throwOnUnknown?: boolean;
|
|
94
|
-
onClickPaintingAnnotation?: (id: string, image: ImageWithOptionalService, e: any) => void;
|
|
95
|
-
components?: {
|
|
96
|
-
Video?: React__default.ComponentType<VideoComponentProps>;
|
|
97
|
-
Audio?: React__default.ComponentType<AudioComponentProps>;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, complexTimelineControlsDeps, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableYouTube, onClickPaintingAnnotation, components, children, }: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
101
|
-
|
|
102
|
-
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, enableSizes, }: {
|
|
103
|
-
id: string;
|
|
104
|
-
image: ImageWithOptionalService;
|
|
105
|
-
thumbnail?: ImageCandidate;
|
|
106
|
-
isStatic?: boolean;
|
|
107
|
-
enableSizes?: boolean;
|
|
108
|
-
selector?: BoxSelector;
|
|
109
|
-
x?: number;
|
|
110
|
-
y?: number;
|
|
111
|
-
children?: ReactNode;
|
|
112
|
-
onClick?: (e: any) => void;
|
|
113
|
-
}): react_jsx_runtime.JSX.Element;
|
|
114
|
-
|
|
115
|
-
declare function CanvasBackground({ style }: {
|
|
116
|
-
style?: BoxStyle;
|
|
117
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
118
|
-
|
|
119
|
-
type SimpleViewerContext = {
|
|
120
|
-
items: Reference<'Canvas'>[];
|
|
121
|
-
sequence: number[][];
|
|
122
|
-
hasNext: boolean;
|
|
123
|
-
hasPrevious: boolean;
|
|
124
|
-
setSequenceIndex: (newId: number) => void;
|
|
125
|
-
setCurrentCanvasId: (newId: string) => void;
|
|
126
|
-
setCurrentCanvasIndex: (newId: number) => void;
|
|
127
|
-
currentSequenceIndex: number;
|
|
128
|
-
nextCanvas: () => void;
|
|
129
|
-
previousCanvas: () => void;
|
|
130
|
-
};
|
|
131
|
-
type SimpleViewerProps = {
|
|
132
|
-
vault?: Vault;
|
|
133
|
-
manifest: string;
|
|
134
|
-
pagingEnabled?: boolean;
|
|
135
|
-
children: ReactNode;
|
|
136
|
-
startCanvas?: string;
|
|
137
|
-
rangeId?: string;
|
|
138
|
-
};
|
|
139
|
-
type SimpleViewerReducerState = {
|
|
140
|
-
sequence: number[][];
|
|
141
|
-
availableCanvases: Reference<'Canvas'>[];
|
|
142
|
-
visibleCanvases: Reference<'Canvas'>[];
|
|
143
|
-
currentCanvas: string | null;
|
|
144
|
-
isPaged: boolean;
|
|
145
|
-
rangeId: string | null;
|
|
146
|
-
};
|
|
147
|
-
interface SimpleViewerActions {
|
|
148
|
-
setCurrentCanvasId(newId: string): void;
|
|
149
|
-
setCurrentCanvasIndex(newId: number): void;
|
|
150
|
-
nextCanvas(): void;
|
|
151
|
-
previousCanvas(): void;
|
|
152
|
-
setCurrentRange(newId: string): void;
|
|
153
|
-
clearRange(): void;
|
|
154
|
-
setPagingEnabled(isEnabled: boolean): void;
|
|
155
|
-
}
|
|
156
|
-
type SimpleViewerActionsType = {
|
|
157
|
-
[T in keyof SimpleViewerActions]: {
|
|
158
|
-
type: T;
|
|
159
|
-
payload: Parameters<SimpleViewerActions[T]>[0];
|
|
160
|
-
};
|
|
161
|
-
}[keyof SimpleViewerActions];
|
|
162
|
-
|
|
163
|
-
declare function ModelHTML({ model }: {
|
|
164
|
-
model: any;
|
|
165
|
-
}): react_jsx_runtime.JSX.Element;
|
|
166
|
-
declare function Model({ model, name }: {
|
|
167
|
-
model: any;
|
|
168
|
-
name?: string;
|
|
169
|
-
}): null;
|
|
170
|
-
|
|
171
|
-
interface PlaceholderCanvasProps {
|
|
172
|
-
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
173
|
-
}
|
|
174
|
-
declare function PlaceholderCanvas(props: PlaceholderCanvasProps): react_jsx_runtime.JSX.Element | null;
|
|
175
|
-
|
|
176
|
-
interface CanvasPanelProps {
|
|
177
|
-
manifest: string;
|
|
178
|
-
startCanvas?: string;
|
|
179
|
-
rangeId?: string;
|
|
180
|
-
pagingEnabled?: boolean;
|
|
181
|
-
header?: ReactNode;
|
|
182
|
-
children?: ReactNode;
|
|
183
|
-
mode?: ViewerMode;
|
|
184
|
-
reuseAtlas?: boolean;
|
|
185
|
-
runtimeOptions?: any;
|
|
186
|
-
renderPreset?: any;
|
|
187
|
-
height?: number;
|
|
188
|
-
spacing?: number;
|
|
189
|
-
components?: {
|
|
190
|
-
ViewerControls?: FC;
|
|
191
|
-
MediaControls?: FC;
|
|
192
|
-
ComplexTimelineControls?: FC;
|
|
193
|
-
};
|
|
194
|
-
canvasProps?: Omit<Partial<CanvasProps>, 'x'>;
|
|
195
|
-
annotations?: ReactNode;
|
|
196
|
-
}
|
|
197
|
-
type CanvasPanelType = ForwardRefExoticComponent<CanvasPanelProps & RefAttributes<SimpleViewerContext>> & {
|
|
198
|
-
RenderImage: typeof RenderImage;
|
|
199
|
-
RenderCanvas: typeof RenderCanvas;
|
|
200
|
-
RenderAnnotationPage: typeof RenderAnnotationPage;
|
|
201
|
-
RenderAnnotation: typeof RenderAnnotation;
|
|
202
|
-
Viewer: typeof Viewer;
|
|
203
|
-
CanvasBackground: typeof CanvasBackground;
|
|
204
|
-
Audio: typeof Audio;
|
|
205
|
-
Video: typeof Video;
|
|
206
|
-
Model: typeof Model;
|
|
207
|
-
AudioHTML: typeof AudioHTML;
|
|
208
|
-
VideoHTML: typeof VideoHTML;
|
|
209
|
-
ModelHTML: typeof ModelHTML;
|
|
210
|
-
PlaceholderCanvas: typeof PlaceholderCanvas;
|
|
211
|
-
};
|
|
212
|
-
declare const CanvasPanel: CanvasPanelType;
|
|
213
|
-
|
|
214
|
-
export { type AudioComponentProps as A, CanvasPanel as C, type SimpleViewerContext as S, type VideoComponentProps as V, type SimpleViewerProps as a, type SimpleViewerReducerState as b, type SimpleViewerActions as c, type SimpleViewerActionsType as d };
|
package/dist/index-CrfymD6m.d.ts
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import React__default, { ReactNode, FC, ComponentType, RefObject, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { AtlasProps, Preset, BoxStyle, ViewerMode } from '@atlas-viewer/atlas';
|
|
4
|
-
import { AnnotationPage, Reference } from '@iiif/presentation-3';
|
|
5
|
-
import { AnnotationPageNormalized, CanvasNormalized } from '@iiif/presentation-3-normalized';
|
|
6
|
-
import { S as SingleAudio, a as SingleVideo, M as MediaStrategy, b as StrategyActions, c as SingleImageStrategy, E as EmptyStrategy, C as ComplexTimelineStrategy, R as RenderingStrategy, I as ImageWithOptionalService } from './useRenderingStrategy-BiuSDiXu.js';
|
|
7
|
-
import { ChoiceDescription, ImageCandidate, BoxSelector } from '@iiif/helpers';
|
|
8
|
-
import { Vault } from '@iiif/helpers/vault';
|
|
9
|
-
|
|
10
|
-
declare function Viewer({ children, errorFallback, outerContainerProps, worldScale: _worldScale, ...props }: AtlasProps & {
|
|
11
|
-
height?: number | string;
|
|
12
|
-
width?: number | string;
|
|
13
|
-
resizeHash?: number;
|
|
14
|
-
containerProps?: any;
|
|
15
|
-
outerContainerProps?: any;
|
|
16
|
-
aspectRatio?: number;
|
|
17
|
-
errorFallback?: any;
|
|
18
|
-
renderPreset?: Preset;
|
|
19
|
-
worldScale?: number;
|
|
20
|
-
} & {
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
}): react_jsx_runtime.JSX.Element;
|
|
23
|
-
|
|
24
|
-
declare const RenderAnnotation: FC<{
|
|
25
|
-
id: string;
|
|
26
|
-
className?: string;
|
|
27
|
-
style?: BoxStyle;
|
|
28
|
-
interactive?: boolean;
|
|
29
|
-
}>;
|
|
30
|
-
|
|
31
|
-
declare const RenderAnnotationPage: FC<{
|
|
32
|
-
page: AnnotationPage | AnnotationPageNormalized;
|
|
33
|
-
className?: string;
|
|
34
|
-
}>;
|
|
35
|
-
|
|
36
|
-
interface AudioComponentProps {
|
|
37
|
-
media: SingleAudio;
|
|
38
|
-
startTime?: number | null;
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
}
|
|
41
|
-
declare function AudioHTML({ media, startTime, children }: AudioComponentProps): react_jsx_runtime.JSX.Element;
|
|
42
|
-
declare function Audio({ media, mediaControlsDeps, audioCopmonent, children, }: {
|
|
43
|
-
media: SingleAudio;
|
|
44
|
-
mediaControlsDeps?: any[];
|
|
45
|
-
children: ReactNode;
|
|
46
|
-
audioCopmonent?: ComponentType<AudioComponentProps>;
|
|
47
|
-
}): null;
|
|
48
|
-
|
|
49
|
-
interface VideoComponentProps {
|
|
50
|
-
element: RefObject<HTMLVideoElement>;
|
|
51
|
-
media: SingleVideo;
|
|
52
|
-
playPause: () => void;
|
|
53
|
-
canvas: CanvasNormalized;
|
|
54
|
-
poster?: string;
|
|
55
|
-
startTime?: number;
|
|
56
|
-
captions?: MediaStrategy['captions'];
|
|
57
|
-
}
|
|
58
|
-
declare function VideoHTML({ element, media, startTime, playPause, poster, }: VideoComponentProps): react_jsx_runtime.JSX.Element;
|
|
59
|
-
declare function Video({ media, mediaControlsDeps, children, videoComponent, captions, }: {
|
|
60
|
-
media: SingleVideo;
|
|
61
|
-
mediaControlsDeps?: any[];
|
|
62
|
-
children: ReactNode;
|
|
63
|
-
posterCanvasId?: string;
|
|
64
|
-
videoComponent?: ComponentType<VideoComponentProps>;
|
|
65
|
-
captions?: MediaStrategy['captions'];
|
|
66
|
-
}): null;
|
|
67
|
-
|
|
68
|
-
type CanvasProps = {
|
|
69
|
-
x?: number;
|
|
70
|
-
y?: number;
|
|
71
|
-
onCreated?: any;
|
|
72
|
-
onChoiceChange?: (choice?: ChoiceDescription) => void;
|
|
73
|
-
registerActions?: (actions: StrategyActions) => void;
|
|
74
|
-
defaultChoices?: Array<{
|
|
75
|
-
id: string;
|
|
76
|
-
opacity?: number;
|
|
77
|
-
}>;
|
|
78
|
-
isStatic?: boolean;
|
|
79
|
-
keepCanvasScale?: boolean;
|
|
80
|
-
children?: ReactNode;
|
|
81
|
-
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
82
|
-
viewControlsDeps?: any[];
|
|
83
|
-
renderMediaControls?: (strategy: MediaStrategy) => ReactNode;
|
|
84
|
-
renderComplexTimelineControls?: (strategy: ComplexTimelineStrategy) => ReactNode;
|
|
85
|
-
complexTimelineControlsDeps?: any[];
|
|
86
|
-
mediaControlsDeps?: any[];
|
|
87
|
-
strategies?: Array<RenderingStrategy['type']>;
|
|
88
|
-
backgroundStyle?: BoxStyle;
|
|
89
|
-
alwaysShowBackground?: boolean;
|
|
90
|
-
enableSizes?: boolean;
|
|
91
|
-
enableYouTube?: boolean;
|
|
92
|
-
ignoreSize?: boolean;
|
|
93
|
-
throwOnUnknown?: boolean;
|
|
94
|
-
onClickPaintingAnnotation?: (id: string, image: ImageWithOptionalService, e: any) => void;
|
|
95
|
-
components?: {
|
|
96
|
-
Video?: React__default.ComponentType<VideoComponentProps>;
|
|
97
|
-
Audio?: React__default.ComponentType<AudioComponentProps>;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
declare function RenderCanvas({ x, y, onChoiceChange, registerActions, defaultChoices, isStatic, renderViewerControls, renderMediaControls, renderComplexTimelineControls, complexTimelineControlsDeps, viewControlsDeps, mediaControlsDeps, strategies, throwOnUnknown, backgroundStyle, alwaysShowBackground, keepCanvasScale, enableSizes, enableYouTube, onClickPaintingAnnotation, components, children, }: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
101
|
-
|
|
102
|
-
declare function RenderImage({ id, image, thumbnail, isStatic, x, y, children, selector, onClick, enableSizes, }: {
|
|
103
|
-
id: string;
|
|
104
|
-
image: ImageWithOptionalService;
|
|
105
|
-
thumbnail?: ImageCandidate;
|
|
106
|
-
isStatic?: boolean;
|
|
107
|
-
enableSizes?: boolean;
|
|
108
|
-
selector?: BoxSelector;
|
|
109
|
-
x?: number;
|
|
110
|
-
y?: number;
|
|
111
|
-
children?: ReactNode;
|
|
112
|
-
onClick?: (e: any) => void;
|
|
113
|
-
}): react_jsx_runtime.JSX.Element;
|
|
114
|
-
|
|
115
|
-
declare function CanvasBackground({ style }: {
|
|
116
|
-
style?: BoxStyle;
|
|
117
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
118
|
-
|
|
119
|
-
type SimpleViewerContext = {
|
|
120
|
-
items: Reference<'Canvas'>[];
|
|
121
|
-
sequence: number[][];
|
|
122
|
-
hasNext: boolean;
|
|
123
|
-
hasPrevious: boolean;
|
|
124
|
-
setSequenceIndex: (newId: number) => void;
|
|
125
|
-
setCurrentCanvasId: (newId: string) => void;
|
|
126
|
-
setCurrentCanvasIndex: (newId: number) => void;
|
|
127
|
-
currentSequenceIndex: number;
|
|
128
|
-
nextCanvas: () => void;
|
|
129
|
-
previousCanvas: () => void;
|
|
130
|
-
};
|
|
131
|
-
type SimpleViewerProps = {
|
|
132
|
-
vault?: Vault;
|
|
133
|
-
manifest: string;
|
|
134
|
-
pagingEnabled?: boolean;
|
|
135
|
-
children: ReactNode;
|
|
136
|
-
startCanvas?: string;
|
|
137
|
-
rangeId?: string;
|
|
138
|
-
};
|
|
139
|
-
type SimpleViewerReducerState = {
|
|
140
|
-
sequence: number[][];
|
|
141
|
-
availableCanvases: Reference<'Canvas'>[];
|
|
142
|
-
visibleCanvases: Reference<'Canvas'>[];
|
|
143
|
-
currentCanvas: string | null;
|
|
144
|
-
isPaged: boolean;
|
|
145
|
-
rangeId: string | null;
|
|
146
|
-
};
|
|
147
|
-
interface SimpleViewerActions {
|
|
148
|
-
setCurrentCanvasId(newId: string): void;
|
|
149
|
-
setCurrentCanvasIndex(newId: number): void;
|
|
150
|
-
nextCanvas(): void;
|
|
151
|
-
previousCanvas(): void;
|
|
152
|
-
setCurrentRange(newId: string): void;
|
|
153
|
-
clearRange(): void;
|
|
154
|
-
setPagingEnabled(isEnabled: boolean): void;
|
|
155
|
-
}
|
|
156
|
-
type SimpleViewerActionsType = {
|
|
157
|
-
[T in keyof SimpleViewerActions]: {
|
|
158
|
-
type: T;
|
|
159
|
-
payload: Parameters<SimpleViewerActions[T]>[0];
|
|
160
|
-
};
|
|
161
|
-
}[keyof SimpleViewerActions];
|
|
162
|
-
|
|
163
|
-
declare function ModelHTML({ model }: {
|
|
164
|
-
model: any;
|
|
165
|
-
}): react_jsx_runtime.JSX.Element;
|
|
166
|
-
declare function Model({ model, name }: {
|
|
167
|
-
model: any;
|
|
168
|
-
name?: string;
|
|
169
|
-
}): null;
|
|
170
|
-
|
|
171
|
-
interface PlaceholderCanvasProps {
|
|
172
|
-
renderViewerControls?: (strategy: SingleImageStrategy | EmptyStrategy) => ReactNode;
|
|
173
|
-
}
|
|
174
|
-
declare function PlaceholderCanvas(props: PlaceholderCanvasProps): react_jsx_runtime.JSX.Element | null;
|
|
175
|
-
|
|
176
|
-
interface CanvasPanelProps {
|
|
177
|
-
manifest: string;
|
|
178
|
-
startCanvas?: string;
|
|
179
|
-
rangeId?: string;
|
|
180
|
-
pagingEnabled?: boolean;
|
|
181
|
-
header?: ReactNode;
|
|
182
|
-
children?: ReactNode;
|
|
183
|
-
mode?: ViewerMode;
|
|
184
|
-
reuseAtlas?: boolean;
|
|
185
|
-
runtimeOptions?: any;
|
|
186
|
-
renderPreset?: any;
|
|
187
|
-
height?: number;
|
|
188
|
-
spacing?: number;
|
|
189
|
-
components?: {
|
|
190
|
-
ViewerControls?: FC;
|
|
191
|
-
MediaControls?: FC;
|
|
192
|
-
ComplexTimelineControls?: FC;
|
|
193
|
-
};
|
|
194
|
-
canvasProps?: Omit<Partial<CanvasProps>, 'x'>;
|
|
195
|
-
annotations?: ReactNode;
|
|
196
|
-
}
|
|
197
|
-
type CanvasPanelType = ForwardRefExoticComponent<CanvasPanelProps & RefAttributes<SimpleViewerContext>> & {
|
|
198
|
-
RenderImage: typeof RenderImage;
|
|
199
|
-
RenderCanvas: typeof RenderCanvas;
|
|
200
|
-
RenderAnnotationPage: typeof RenderAnnotationPage;
|
|
201
|
-
RenderAnnotation: typeof RenderAnnotation;
|
|
202
|
-
Viewer: typeof Viewer;
|
|
203
|
-
CanvasBackground: typeof CanvasBackground;
|
|
204
|
-
Audio: typeof Audio;
|
|
205
|
-
Video: typeof Video;
|
|
206
|
-
Model: typeof Model;
|
|
207
|
-
AudioHTML: typeof AudioHTML;
|
|
208
|
-
VideoHTML: typeof VideoHTML;
|
|
209
|
-
ModelHTML: typeof ModelHTML;
|
|
210
|
-
PlaceholderCanvas: typeof PlaceholderCanvas;
|
|
211
|
-
};
|
|
212
|
-
declare const CanvasPanel: CanvasPanelType;
|
|
213
|
-
|
|
214
|
-
export { type AudioComponentProps as A, CanvasPanel as C, type SimpleViewerContext as S, type VideoComponentProps as V, type SimpleViewerProps as a, type SimpleViewerReducerState as b, type SimpleViewerActions as c, type SimpleViewerActionsType as d };
|