@samvera/nectar-iiif
Advanced tools
Comparing version 0.0.13 to 0.0.14
import React from "react"; | ||
import { NectarContentResource } from "types/nectar"; | ||
import { NectarContentResource } from "../../types/nectar"; | ||
declare const ContentResource: React.FC<NectarContentResource>; | ||
export default ContentResource; |
import React from "react"; | ||
import { NectarHomepage } from "types/nectar"; | ||
import { NectarHomepage } from "../../types/nectar"; | ||
declare const Homepage: React.FC<NectarHomepage>; | ||
export default Homepage; |
import React from "react"; | ||
import { NectarLabel } from "types/nectar"; | ||
import { NectarLabel } from "../../types/nectar"; | ||
declare const Label: React.FC<NectarLabel>; | ||
export default Label; |
import React from "react"; | ||
import { NectarMarkup } from "types/nectar"; | ||
import { NectarMarkup } from "../../types/nectar"; | ||
declare const Markup: React.FC<NectarMarkup>; | ||
export default Markup; |
import React from "react"; | ||
import { NectarMetadataItem } from "types/nectar"; | ||
import { NectarMetadataItem } from "../../types/nectar"; | ||
declare const MetadataItem: React.FC<NectarMetadataItem>; | ||
export default MetadataItem; |
import React from "react"; | ||
import { NectarMetadata } from "types/nectar"; | ||
import { NectarMetadata } from "../../types/nectar"; | ||
declare const Metadata: React.FC<NectarMetadata>; | ||
export default Metadata; |
import React from "react"; | ||
import { NectarRequiredStatement } from "types/nectar"; | ||
import { NectarRequiredStatement } from "../../types/nectar"; | ||
declare const RequiredStatement: React.FC<NectarRequiredStatement>; | ||
export default RequiredStatement; |
import React from "react"; | ||
import { NectarSeeAlso } from "types/nectar"; | ||
import { NectarSeeAlso } from "../../types/nectar"; | ||
declare const SeeAlso: React.FC<NectarSeeAlso>; | ||
export default SeeAlso; |
import React from "react"; | ||
import { NectarSummary } from "types/nectar"; | ||
import { NectarSummary } from "../../types/nectar"; | ||
declare const Summary: React.FC<NectarSummary>; | ||
export default Summary; |
import React from "react"; | ||
import { NectarThumbnail } from "types/nectar"; | ||
import { NectarThumbnail } from "../../types/nectar"; | ||
declare const Thumbnail: React.FC<NectarThumbnail>; | ||
export default Thumbnail; |
import React from "react"; | ||
import { NectarValue } from "types/nectar"; | ||
import { NectarValue } from "../../types/nectar"; | ||
declare const Value: React.FC<NectarValue>; | ||
export default Value; |
@@ -1,9 +0,9 @@ | ||
import Homepage from "components/Homepage/Homepage"; | ||
import Label from "components/Label/Label"; | ||
import Metadata from "components/Metadata/Metadata"; | ||
import RequiredStatement from "components/RequiredStatement/RequiredStatement"; | ||
import SeeAlso from "components/SeeAlso/SeeAlso"; | ||
import Summary from "components/Summary/Summary"; | ||
import Thumbnail from "components/Thumbnail/Thumbnail"; | ||
import Value from "components/Value/Value"; | ||
import Homepage from "./components/Homepage/Homepage"; | ||
import Label from "./components/Label/Label"; | ||
import Metadata from "./components/Metadata/Metadata"; | ||
import RequiredStatement from "./components/RequiredStatement/RequiredStatement"; | ||
import SeeAlso from "./components/SeeAlso/SeeAlso"; | ||
import Summary from "./components/Summary/Summary"; | ||
import Thumbnail from "./components/Thumbnail/Thumbnail"; | ||
import Value from "./components/Value/Value"; | ||
export { Homepage, Label, Metadata, RequiredStatement, SeeAlso, Summary, Thumbnail, Value, }; |
{ | ||
"name": "@samvera/nectar-iiif", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.cjs.js", | ||
"scripts": { | ||
"build": "npm run clean && node build.js&& tsc --emitDeclarationOnly --outDir dist && rm -rf dist/tsconfig.tsbuildinfo dist/index.cjs.js.map dist/index.esm.js.map", | ||
"build": "npm run clean && node build.js&& tsc --emitDeclarationOnly", | ||
"build:static": "NODE_ENV=static OUT_DIR=static node build-static.js", | ||
@@ -24,3 +24,3 @@ "clean": "rimraf dist", | ||
"type": "git", | ||
"url": "git+https://github.com/mathewjordan/nectar-iiif.git" | ||
"url": "git+https://github.com/samvera-labs/nectar-iiif.git" | ||
}, | ||
@@ -30,5 +30,5 @@ "author": "Northwestern University Libraries", | ||
"bugs": { | ||
"url": "https://github.com/mathewjordan/nectar-iiif/issues" | ||
"url": "https://github.com/samvera-labs/nectar-iiif.git/issues" | ||
}, | ||
"homepage": "https://github.com/mathewjordan/nectar-iiif#readme", | ||
"homepage": "https://github.com/samvera-labs/nectar-iiif.git#readme", | ||
"devDependencies": { | ||
@@ -35,0 +35,0 @@ "@iiif/presentation-3": "^1.0.4", |
151
README.md
@@ -5,3 +5,3 @@ # Nectar IIIF | ||
[**Demo**](https://samvera-labs.github.io/nectar-iiif) | ||
[**Demo**](https://samvera-labs.github.io/nectar-iiif) | [**Code**](https://github.com/samvera-labs/nectar-iiif) | ||
@@ -16,6 +16,10 @@ --- | ||
- [Label](#label) | ||
- [Summary](#summary) | ||
- [Required Statement](#required-statement) | ||
- [Homepage](#homepage) | ||
- [Metadata](#metadata) | ||
- [RequiredStatement](#requiredstatement) | ||
- [SeeAlso](#seealso) | ||
- [Summary](#summary) | ||
- [Thumbnail](#thumbnail) | ||
- [Attributes](#attributes) | ||
- [Language](#language-internationalization) | ||
@@ -50,3 +54,3 @@ --- | ||
/** | ||
* Some logic may be required to fetch the IIIF Manifest. | ||
* Some logic may be required to retrieve the IIIF Manifest. | ||
*/ | ||
@@ -67,15 +71,25 @@ const manifest = {...}; | ||
All primitives accept HTMLElement attributes. | ||
Primitives aim to cover most of the noted [Descriptive](https://iiif.io/api/presentation/3.0/#31-descriptive-properties) and [Linking](https://iiif.io/api/presentation/3.0/#31-descriptive-properties) properties noted in the IIIF Presentation API 3.0 specification. Some of these, specifically PartOf and Provider may have a more complex component structure. | ||
| Prop | Type | Default | | ||
| ----------- | ----------------------------- | ----------- | | ||
| `className` | `string`, `undefined` | `undefined` | | ||
| `style` | `CSSProperties`, `undefined` | `undefined` | | ||
| `lang` | `string`, `undefined` | `undefined` | | ||
| `title` | `string`, `undefined` | `undefined` | | ||
| `data-*` | `string`, `undefined` | `undefined` | | ||
| `aria-*` | `AriaAttributes`, `undefined` | `undefined` | | ||
Completed (initial release) and proposed primitives include: | ||
The value of `lang` will couple with [InternationalString](https://github.com/IIIF-Commons/presentation-3-types/blob/main/iiif/descriptive.d.ts#L6-L8) props to output the denoted `label`, `value`, `summary` entries. If lang is undefined, entries will default to the first entry in the array index. | ||
**Descriptive Properties** | ||
- [x] Label | ||
- [x] Metadata | ||
- [x] Summary | ||
- [x] RequiredStatement | ||
- [ ] Rights | ||
- [ ] Provider | ||
- [x] Thumbnail | ||
**Linking Properties** | ||
- [x] Homepage | ||
- [ ] Logo | ||
- [ ] Rendering | ||
- [x] SeeAlso | ||
- [ ] PartOf | ||
---- | ||
### Label | ||
@@ -88,3 +102,3 @@ | ||
| `as` | ` span`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p`, `label`, `dt`, `dd` | `span` | -- | | ||
| `label` | [See IIIF](https://iiif.io/api/presentation/3.0/#label) | -- | :white_check_mark: | | ||
| `label` | [label](https://iiif.io/api/presentation/3.0/#label) | -- | **Yes** | | ||
@@ -101,21 +115,28 @@ #### Usage | ||
### Summary | ||
---- | ||
#### Reference | ||
### Homepage | ||
| Prop | Type | Default | Required | | ||
| --------- | --------------------------------------------------------- | ------- | ------------------ | | ||
| `as` | ` span`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p` | `span` | -- | | ||
| `summary` | [See IIIF](https://iiif.io/api/presentation/3.0/#summary) | -- | :white_check_mark: | | ||
```jsx | ||
import { Homepage } from "@samvera/nectar-iiif"; | ||
``` | ||
#### Usage | ||
Wrap resource label with homepage id. | ||
```jsx | ||
import { Summary } from "@samvera/nectar-iiif"; | ||
return <Homepage homepage={manifest.homepage} />; | ||
``` | ||
Wrap React children with homepage id. | ||
```jsx | ||
return <Summary summary={manifest.summary} as="p" />; | ||
return ( | ||
<Homepage homepage={manifest.homepage}> | ||
<figure>...</figure> | ||
</Homepage> | ||
); | ||
``` | ||
---- | ||
### Metadata | ||
@@ -131,4 +152,6 @@ | ||
### Required Statement | ||
---- | ||
### RequiredStatement | ||
```jsx | ||
@@ -142,26 +165,25 @@ import { RequiredStatement } from "@samvera/nectar-iiif"; | ||
### Homepage | ||
---- | ||
```jsx | ||
import { Homepage } from "@samvera/nectar-iiif"; | ||
``` | ||
### SeeAlso | ||
Wrap resource label with homepage id. | ||
#### Reference | ||
| Prop | Type | Default | Required | | ||
| --------- | --------------------------------------------------------- | ------- | ------------------ | | ||
| `as` | ` ol`, `ul` | `ul` | -- | | ||
| `seeAlso` | [seeAlso](https://iiif.io/api/presentation/3.0/#seealso) | -- | **Yes** | | ||
```jsx | ||
return <Homepage homepage={manifest.homepage} />; | ||
import { SeeAlso } from "@samvera/nectar-iiif"; | ||
``` | ||
Wrap React children with homepage id. | ||
```jsx | ||
return ( | ||
<Homepage homepage={manifest.homepage}> | ||
<figure>...</figure> | ||
</Homepage> | ||
); | ||
return <SeeAlso seeAlso={manifest.seeAlso} as="li" />; | ||
``` | ||
### SeeAlso | ||
---- | ||
### Summary | ||
#### Reference | ||
@@ -171,11 +193,54 @@ | ||
| --------- | --------------------------------------------------------- | ------- | ------------------ | | ||
| `as` | ` ol`, `ul` | `ul` | -- | | ||
| `seeAlso` | [See IIIF](https://iiif.io/api/presentation/3.0/#seealso) | -- | :white_check_mark: | | ||
| `as` | ` span`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `p` | `span` | -- | | ||
| `summary` | [summary](https://iiif.io/api/presentation/3.0/#summary) | -- | **Yes** | | ||
#### Usage | ||
```jsx | ||
import { SeeAlso } from "@samvera/nectar-iiif"; | ||
import { Summary } from "@samvera/nectar-iiif"; | ||
``` | ||
```jsx | ||
return <SeeAlso seeAlso={manifest.seeAlso} as="li" />; | ||
return <Summary summary={manifest.summary} as="p" />; | ||
``` | ||
---- | ||
### Thumbnail | ||
Thumbnails are rendered to a relative HTML `<img>` or `<video>` element dependendent on the type of the resource in the thumbnail entry. Currently, only `type` **Image** and **Video** are supported. | ||
<img width="300" alt="image" src="https://github.com/mathewjordan/fet/blob/main/nectar-thumb-trimmed.gif?raw=true"> | ||
#### Reference | ||
| Prop | Type | Default | Required | | ||
| --------- | -------------------------------------------------------------- | ------- | ------------------ | | ||
| `thumbnail` | [thumbnail](https://iiif.io/api/presentation/3.0/#thumbnail) | -- | **Yes** | | ||
| `altAsLabel`| [label](https://iiif.io/api/presentation/3.0/#label) | -- | -- | | ||
```jsx | ||
import { Thumbnail } from "@samvera/nectar-iiif"; | ||
``` | ||
```jsx | ||
return <Thumbnail thumbnail={manifest.thumbnail} altAsLabel={manifest.label} />; | ||
``` | ||
## Attributes | ||
All primitives accept common HTMLElement attributes. | ||
| Prop | Type | Default | | ||
| ----------- | ----------------------------- | ----------- | | ||
| `className` | `string`, `undefined` | `undefined` | | ||
| `style` | `CSSProperties`, `undefined` | `undefined` | | ||
| `lang` | `string`, `undefined` | `undefined` | | ||
| `title` | `string`, `undefined` | `undefined` | | ||
| `data-*` | `string`, `undefined` | `undefined` | | ||
| `aria-*` | `AriaAttributes`, `undefined` | `undefined` | | ||
## Language (Internationalization) | ||
The value of `lang` will couple with [InternationalString](https://github.com/IIIF-Commons/presentation-3-types/blob/main/iiif/descriptive.d.ts#L6-L8) props to output the denoted `label`, `value`, `summary` entries. If `lang` is undefined, entries will default to the first entry in the array index. |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
63379
26
238
1