@samvera/nectar-iiif
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -1,2 +0,1 @@ | ||
var O=Object.create;var y=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols,B=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(t,e,r)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))M.call(e,r)&&x(t,r,e[r]);if(L)for(var r of L(e))D.call(e,r)&&x(t,r,e[r]);return t};var J=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},F=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of P(e))!M.call(t,a)&&a!==r&&y(t,a,{get:()=>e[a],enumerable:!(o=W(e,a))||o.enumerable});return t};var l=(t,e,r)=>(r=t!=null?O(B(t)):{},F(e||!t||!t.__esModule?y(r,"default",{value:t,enumerable:!0}):r,t)),K=t=>F(y({},"__esModule",{value:!0}),t);var st={};J(st,{Homepage:()=>C,Label:()=>u,Metadata:()=>R,RequiredStatement:()=>$,Summary:()=>G,Thumbnail:()=>V,Value:()=>v});module.exports=K(st);var S=l(require("react"));var q=require("@stitches/react"),{styled:m,css:ut,keyframes:ft}=(0,q.createStitches)({prefix:"nectar"});var p=(t,e="none")=>{var o;if(!t)return null;if(typeof t=="string")return[t];if(!t[e]){let a=Object.getOwnPropertyNames(t);if(a.length>0)return(o=t[a[0]])==null?void 0:o.join(", ")}return!t[e]||!Array.isArray(t[e])?null:t[e].join(", ")};var Q=m("div",{}),U=m("span",{}),X=({as:t="div",children:e,homepage:r,lang:o="none"})=>{let a="span";return t!=="div"&&(a="li"),S.default.createElement(Q,{as:t,"data-testid":"nectar-homepage"},r.map(i=>{let d=p(i.label,o);return S.default.createElement(U,{as:a,key:i.id},S.default.createElement("a",{href:i.id,"aria-label":d},e||d))}))},C=X;var H=l(require("react"));function Y(t,e){let r=Object.keys(t).filter(a=>e.includes(a)?null:a),o=new Object;return r.forEach(a=>{o[a]=t[a]}),o}var s=Y;var Z=m("span",{}),_=t=>{let{as:e,label:r}=t,a=s(t,["as","label"]);return H.default.createElement(Z,n({as:e},a),p(r,a.lang))},u=_;var c=l(require("react"));var N=l(require("react"));var j=l(require("react"));var tt=({as:t="dd",lang:e,value:r})=>j.default.createElement(u,{label:r,as:t,lang:e}),v=tt;var et=t=>{let{item:e,lang:r}=t,{label:o,value:a}=e;return N.default.createElement("div",{role:"group"},N.default.createElement(u,{as:"dt",label:o,lang:r}),N.default.createElement(v,{as:"dd",value:a,lang:r}))},h=et;var rt=m("dl",{}),at=t=>{let{as:e,metadata:r}=t;if(!Array.isArray(r))return c.default.createElement(c.default.Fragment,null);let a=s(t,["as","metadata"]);return c.default.createElement(c.default.Fragment,null,r.length>0&&c.default.createElement(rt,n({as:e},a),r.map((i,d)=>c.default.createElement(h,{item:i,key:d,lang:a.lang}))))},R=at;var b=l(require("react"));var ot=m("dl",{}),it=t=>{let{as:e,requiredStatement:r}=t;if(!r)return b.default.createElement(b.default.Fragment,null);let a=s(t,["as","requiredStatement"]);return b.default.createElement(ot,n({as:e},a),b.default.createElement(h,{item:r,lang:a.lang}))},$=it;var w=l(require("react"));var mt=t=>{let{as:e,summary:r}=t,a=s(t,["as","summary"]);return w.default.createElement(u,n({as:e,label:r},a))},G=mt;var f=l(require("react"));var T=(t,e="200,",r="full")=>{Array.isArray(t)&&(t=t[0]);let{id:o,service:a}=t,i;if(!a)return o;if(Array.isArray(t.service)&&t.service.length>0&&(i=a[0]),i){if(i["@id"])return`${i["@id"]}/${r}/${e}/0/default.jpg`;if(i.id)return`${i.id}/${r}/${e}/0/default.jpg`}};var A=m("img",{}),nt=t=>{let{thumbnail:e,altAsLabel:r}=t,o;r&&(o=p(r));let i=s(t,["thumbnail","altAsLabel"]);return f.default.createElement(f.default.Fragment,null,e&&e.map(d=>{let{type:I,id:g,width:k=200,height:z}=d;switch(I){case"Image":let E=T(d);return f.default.createElement(A,n({as:"img",alt:o,src:E,key:g,css:{width:k,height:z}},i));case"Sound":return f.default.createElement(A,{as:"video",key:g,src:g});case"Video":return f.default.createElement(A,{as:"video",key:g,src:g});default:return console.warn(`Resource type: ${I} is not valid or not yet supported in Nectar.`),f.default.createElement(f.default.Fragment,null)}}))},V=nt; | ||
//# sourceMappingURL=index.cjs.js.map | ||
var R=Object.create;var b=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols,B=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var x=(t,e,r)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m=(t,e)=>{for(var r in e||(e={}))M.call(e,r)&&x(t,r,e[r]);if(L)for(var r of L(e))D.call(e,r)&&x(t,r,e[r]);return t};var J=(t,e)=>{for(var r in e)b(t,r,{get:e[r],enumerable:!0})},F=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of P(e))!M.call(t,a)&&a!==r&&b(t,a,{get:()=>e[a],enumerable:!(o=W(e,a))||o.enumerable});return t};var l=(t,e,r)=>(r=t!=null?R(B(t)):{},F(e||!t||!t.__esModule?b(r,"default",{value:t,enumerable:!0}):r,t)),K=t=>F(b({},"__esModule",{value:!0}),t);var nt={};J(nt,{Homepage:()=>C,Label:()=>u,Metadata:()=>$,RequiredStatement:()=>w,Summary:()=>G,Thumbnail:()=>V,Value:()=>v});module.exports=K(nt);var S=l(require("react"));var q=require("@stitches/react"),{styled:s,css:lt,keyframes:ut}=(0,q.createStitches)({prefix:"nectar"});var p=(t,e="none")=>{var o;if(!t)return null;if(typeof t=="string")return[t];if(!t[e]){let a=Object.getOwnPropertyNames(t);if(a.length>0)return(o=t[a[0]])==null?void 0:o.join(", ")}return!t[e]||!Array.isArray(t[e])?null:t[e].join(", ")};function Q(t,e){let r=Object.keys(t).filter(a=>e.includes(a)?null:a),o=new Object;return r.forEach(a=>{o[a]=t[a]}),o}var n=Q;var U=s("a",{}),X=t=>{let{children:e,homepage:r}=t,a=n(t,["children","homepage"]);return S.default.createElement(S.default.Fragment,null,r&&r.map(i=>{let d=p(i.label,a.lang);return S.default.createElement(U,m({"aria-label":e?d:void 0,href:i.id,key:i.id},a),e||d)}))},C=X;var H=l(require("react"));var Y=s("span",{}),Z=t=>{let{as:e,label:r}=t,a=n(t,["as","label"]);return H.default.createElement(Y,m({as:e},a),p(r,a.lang))},u=Z;var c=l(require("react"));var h=l(require("react"));var j=l(require("react"));var _=({as:t="dd",lang:e,value:r})=>j.default.createElement(u,{label:r,as:t,lang:e}),v=_;var tt=t=>{let{item:e,lang:r}=t,{label:o,value:a}=e;return h.default.createElement("div",{role:"group"},h.default.createElement(u,{as:"dt",label:o,lang:r}),h.default.createElement(v,{as:"dd",value:a,lang:r}))},A=tt;var et=s("dl",{}),rt=t=>{let{as:e,metadata:r}=t;if(!Array.isArray(r))return c.default.createElement(c.default.Fragment,null);let a=n(t,["as","metadata"]);return c.default.createElement(c.default.Fragment,null,r.length>0&&c.default.createElement(et,m({as:e},a),r.map((i,d)=>c.default.createElement(A,{item:i,key:d,lang:a.lang}))))},$=rt;var y=l(require("react"));var at=s("dl",{}),ot=t=>{let{as:e,requiredStatement:r}=t;if(!r)return y.default.createElement(y.default.Fragment,null);let a=n(t,["as","requiredStatement"]);return y.default.createElement(at,m({as:e},a),y.default.createElement(A,{item:r,lang:a.lang}))},w=ot;var z=l(require("react"));var it=t=>{let{as:e,summary:r}=t,a=n(t,["as","summary"]);return z.default.createElement(u,m({as:e,label:r},a))},G=it;var f=l(require("react"));var T=(t,e="200,",r="full")=>{Array.isArray(t)&&(t=t[0]);let{id:o,service:a}=t,i;if(!a)return o;if(Array.isArray(t.service)&&t.service.length>0&&(i=a[0]),i){if(i["@id"])return`${i["@id"]}/${r}/${e}/0/default.jpg`;if(i.id)return`${i.id}/${r}/${e}/0/default.jpg`}};var I=s("img",{}),mt=t=>{let{thumbnail:e,altAsLabel:r}=t,o;r&&(o=p(r));let i=n(t,["thumbnail","altAsLabel"]);return f.default.createElement(f.default.Fragment,null,e&&e.map(d=>{let{type:N,id:g,width:k=200,height:E}=d;switch(N){case"Image":let O=T(d);return f.default.createElement(I,m({as:"img",alt:o,src:O,key:g,css:{width:k,height:E}},i));case"Sound":return f.default.createElement(I,{as:"video",key:g,src:g});case"Video":return f.default.createElement(I,{as:"video",key:g,src:g});default:return console.warn(`Resource type: ${N} is not valid or not yet supported in Nectar.`),f.default.createElement(f.default.Fragment,null)}}))},V=mt; |
@@ -1,2 +0,1 @@ | ||
var q=Object.defineProperty;var A=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var I=(t,e,r)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,n=(t,e)=>{for(var r in e||(e={}))C.call(e,r)&&I(t,r,e[r]);if(A)for(var r of A(e))H.call(e,r)&&I(t,r,e[r]);return t};import b from"react";import{createStitches as j}from"@stitches/react";var{styled:m,css:rt,keyframes:at}=j({prefix:"nectar"});var d=(t,e="none")=>{var o;if(!t)return null;if(typeof t=="string")return[t];if(!t[e]){let a=Object.getOwnPropertyNames(t);if(a.length>0)return(o=t[a[0]])==null?void 0:o.join(", ")}return!t[e]||!Array.isArray(t[e])?null:t[e].join(", ")};var R=m("div",{}),$=m("span",{}),w=({as:t="div",children:e,homepage:r,lang:o="none"})=>{let a="span";return t!=="div"&&(a="li"),b.createElement(R,{as:t,"data-testid":"nectar-homepage"},r.map(i=>{let l=d(i.label,o);return b.createElement($,{as:a,key:i.id},b.createElement("a",{href:i.id,"aria-label":l},e||l))}))},G=w;import V from"react";function T(t,e){let r=Object.keys(t).filter(a=>e.includes(a)?null:a),o=new Object;return r.forEach(a=>{o[a]=t[a]}),o}var s=T;var k=m("span",{}),z=t=>{let{as:e,label:r}=t,a=s(t,["as","label"]);return V.createElement(k,n({as:e},a),d(r,a.lang))},u=z;import c from"react";import v from"react";import E from"react";var O=({as:t="dd",lang:e,value:r})=>E.createElement(u,{label:r,as:t,lang:e}),S=O;var W=t=>{let{item:e,lang:r}=t,{label:o,value:a}=e;return v.createElement("div",{role:"group"},v.createElement(u,{as:"dt",label:o,lang:r}),v.createElement(S,{as:"dd",value:a,lang:r}))},g=W;var P=m("dl",{}),B=t=>{let{as:e,metadata:r}=t;if(!Array.isArray(r))return c.createElement(c.Fragment,null);let a=s(t,["as","metadata"]);return c.createElement(c.Fragment,null,r.length>0&&c.createElement(P,n({as:e},a),r.map((i,l)=>c.createElement(g,{item:i,key:l,lang:a.lang}))))},D=B;import y from"react";var J=m("dl",{}),K=t=>{let{as:e,requiredStatement:r}=t;if(!r)return y.createElement(y.Fragment,null);let a=s(t,["as","requiredStatement"]);return y.createElement(J,n({as:e},a),y.createElement(g,{item:r,lang:a.lang}))},Q=K;import U from"react";var X=t=>{let{as:e,summary:r}=t,a=s(t,["as","summary"]);return U.createElement(u,n({as:e,label:r},a))},Y=X;import f from"react";var L=(t,e="200,",r="full")=>{Array.isArray(t)&&(t=t[0]);let{id:o,service:a}=t,i;if(!a)return o;if(Array.isArray(t.service)&&t.service.length>0&&(i=a[0]),i){if(i["@id"])return`${i["@id"]}/${r}/${e}/0/default.jpg`;if(i.id)return`${i.id}/${r}/${e}/0/default.jpg`}};var N=m("img",{}),Z=t=>{let{thumbnail:e,altAsLabel:r}=t,o;r&&(o=d(r));let i=s(t,["thumbnail","altAsLabel"]);return f.createElement(f.Fragment,null,e&&e.map(l=>{let{type:h,id:p,width:x=200,height:M}=l;switch(h){case"Image":let F=L(l);return f.createElement(N,n({as:"img",alt:o,src:F,key:p,css:{width:x,height:M}},i));case"Sound":return f.createElement(N,{as:"video",key:p,src:p});case"Video":return f.createElement(N,{as:"video",key:p,src:p});default:return console.warn(`Resource type: ${h} is not valid or not yet supported in Nectar.`),f.createElement(f.Fragment,null)}}))},_=Z;export{G as Homepage,u as Label,D as Metadata,Q as RequiredStatement,Y as Summary,_ as Thumbnail,S as Value}; | ||
//# sourceMappingURL=index.esm.js.map | ||
var q=Object.defineProperty;var I=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var N=(t,e,r)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m=(t,e)=>{for(var r in e||(e={}))C.call(e,r)&&N(t,r,e[r]);if(I)for(var r of I(e))H.call(e,r)&&N(t,r,e[r]);return t};import y from"react";import{createStitches as j}from"@stitches/react";var{styled:s,css:et,keyframes:rt}=j({prefix:"nectar"});var d=(t,e="none")=>{var o;if(!t)return null;if(typeof t=="string")return[t];if(!t[e]){let a=Object.getOwnPropertyNames(t);if(a.length>0)return(o=t[a[0]])==null?void 0:o.join(", ")}return!t[e]||!Array.isArray(t[e])?null:t[e].join(", ")};function $(t,e){let r=Object.keys(t).filter(a=>e.includes(a)?null:a),o=new Object;return r.forEach(a=>{o[a]=t[a]}),o}var n=$;var w=s("a",{}),z=t=>{let{children:e,homepage:r}=t,a=n(t,["children","homepage"]);return y.createElement(y.Fragment,null,r&&r.map(i=>{let l=d(i.label,a.lang);return y.createElement(w,m({"aria-label":e?l:void 0,href:i.id,key:i.id},a),e||l)}))},G=z;import T from"react";var V=s("span",{}),k=t=>{let{as:e,label:r}=t,a=n(t,["as","label"]);return T.createElement(V,m({as:e},a),d(r,a.lang))},u=k;import c from"react";import v from"react";import E from"react";var O=({as:t="dd",lang:e,value:r})=>E.createElement(u,{label:r,as:t,lang:e}),S=O;var R=t=>{let{item:e,lang:r}=t,{label:o,value:a}=e;return v.createElement("div",{role:"group"},v.createElement(u,{as:"dt",label:o,lang:r}),v.createElement(S,{as:"dd",value:a,lang:r}))},g=R;var W=s("dl",{}),P=t=>{let{as:e,metadata:r}=t;if(!Array.isArray(r))return c.createElement(c.Fragment,null);let a=n(t,["as","metadata"]);return c.createElement(c.Fragment,null,r.length>0&&c.createElement(W,m({as:e},a),r.map((i,l)=>c.createElement(g,{item:i,key:l,lang:a.lang}))))},B=P;import b from"react";var D=s("dl",{}),J=t=>{let{as:e,requiredStatement:r}=t;if(!r)return b.createElement(b.Fragment,null);let a=n(t,["as","requiredStatement"]);return b.createElement(D,m({as:e},a),b.createElement(g,{item:r,lang:a.lang}))},K=J;import Q from"react";var U=t=>{let{as:e,summary:r}=t,a=n(t,["as","summary"]);return Q.createElement(u,m({as:e,label:r},a))},X=U;import f from"react";var L=(t,e="200,",r="full")=>{Array.isArray(t)&&(t=t[0]);let{id:o,service:a}=t,i;if(!a)return o;if(Array.isArray(t.service)&&t.service.length>0&&(i=a[0]),i){if(i["@id"])return`${i["@id"]}/${r}/${e}/0/default.jpg`;if(i.id)return`${i.id}/${r}/${e}/0/default.jpg`}};var h=s("img",{}),Y=t=>{let{thumbnail:e,altAsLabel:r}=t,o;r&&(o=d(r));let i=n(t,["thumbnail","altAsLabel"]);return f.createElement(f.Fragment,null,e&&e.map(l=>{let{type:A,id:p,width:x=200,height:M}=l;switch(A){case"Image":let F=L(l);return f.createElement(h,m({as:"img",alt:o,src:F,key:p,css:{width:x,height:M}},i));case"Sound":return f.createElement(h,{as:"video",key:p,src:p});case"Video":return f.createElement(h,{as:"video",key:p,src:p});default:return console.warn(`Resource type: ${A} is not valid or not yet supported in Nectar.`),f.createElement(f.Fragment,null)}}))},Z=Y;export{G as Homepage,u as Label,B as Metadata,K as RequiredStatement,X as Summary,Z as Thumbnail,S as Value}; |
@@ -8,14 +8,13 @@ import { IIIFExternalWebResource, InternationalString, MetadataItem } from "@iiif/presentation-3"; | ||
} | ||
export interface NectarExternalWebResource { | ||
id: string; | ||
type: "Dataset" | "Image" | "Video" | "Sound" | "Text"; | ||
format?: string; | ||
label: InternationalString; | ||
language?: string | string[]; | ||
} | ||
export interface NectarHomepage extends NectarPrimitive { | ||
as?: "div" | "ol" | "ul"; | ||
children?: ReactNode | ReactNode[]; | ||
homepage: Array<NectarResource>; | ||
homepage: NectarExternalWebResource[]; | ||
} | ||
export interface NectarResource extends NectarPrimitive { | ||
as?: "span" | "li"; | ||
format?: string; | ||
id: string; | ||
label: InternationalString; | ||
type: string; | ||
} | ||
export interface NectarLabel extends NectarPrimitive { | ||
@@ -22,0 +21,0 @@ as?: "span" | "p" | "label" | "dt" | "dd" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; |
{ | ||
"name": "@samvera/nectar-iiif", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
22827
177