@ikaros-arch/react-3dhop-iiif 0.2.0 → 0.3.0

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/index.d.mts CHANGED
@@ -168,6 +168,12 @@ type IIIFCollectionItem = {
168
168
  label?: LocalizableValue;
169
169
  summary?: LocalizableValue;
170
170
  thumbnail?: IIIFThumbnail | IIIFThumbnail[];
171
+ /**
172
+ * The IIIF Cookbook's "Simple Collection" recipe names "minimal metadata" as a property a
173
+ * Manifest reference may carry for presentation, alongside `thumbnail`, so clients can list and
174
+ * filter without dereferencing every Manifest: https://iiif.io/api/cookbook/recipe/0032-collection/
175
+ */
176
+ metadata?: IIIFMetadataEntry[];
171
177
  };
172
178
  type IIIFCollection = {
173
179
  id?: string;
@@ -182,6 +188,11 @@ type ParsedCollectionItem = {
182
188
  summary?: string;
183
189
  /** URL of the first thumbnail image, when the item has one. */
184
190
  thumbnail?: string;
191
+ /** The item's own `metadata` entries, resolved into the active language. Empty when absent. */
192
+ fields: Array<{
193
+ label: string;
194
+ value: string;
195
+ }>;
185
196
  };
186
197
  type ParsedCollection = {
187
198
  collection: IIIFCollection;
package/dist/index.d.ts CHANGED
@@ -168,6 +168,12 @@ type IIIFCollectionItem = {
168
168
  label?: LocalizableValue;
169
169
  summary?: LocalizableValue;
170
170
  thumbnail?: IIIFThumbnail | IIIFThumbnail[];
171
+ /**
172
+ * The IIIF Cookbook's "Simple Collection" recipe names "minimal metadata" as a property a
173
+ * Manifest reference may carry for presentation, alongside `thumbnail`, so clients can list and
174
+ * filter without dereferencing every Manifest: https://iiif.io/api/cookbook/recipe/0032-collection/
175
+ */
176
+ metadata?: IIIFMetadataEntry[];
171
177
  };
172
178
  type IIIFCollection = {
173
179
  id?: string;
@@ -182,6 +188,11 @@ type ParsedCollectionItem = {
182
188
  summary?: string;
183
189
  /** URL of the first thumbnail image, when the item has one. */
184
190
  thumbnail?: string;
191
+ /** The item's own `metadata` entries, resolved into the active language. Empty when absent. */
192
+ fields: Array<{
193
+ label: string;
194
+ value: string;
195
+ }>;
185
196
  };
186
197
  type ParsedCollection = {
187
198
  collection: IIIFCollection;
package/dist/index.js CHANGED
@@ -1427,11 +1427,16 @@ function parseCollection(collection, options = {}) {
1427
1427
  onDiagnostic?.({ level: "warning", message: "Collection item has no id; skipping." });
1428
1428
  return;
1429
1429
  }
1430
+ const fields = (item.metadata ?? []).map((entry) => ({
1431
+ label: resolve(entry.label),
1432
+ value: resolve(entry.value)
1433
+ }));
1430
1434
  items.push({
1431
1435
  id: item.id,
1432
1436
  label: resolve(item.label) || item.id,
1433
1437
  summary: resolve(item.summary) || void 0,
1434
- thumbnail: firstThumbnail(item)
1438
+ thumbnail: firstThumbnail(item),
1439
+ fields
1435
1440
  });
1436
1441
  });
1437
1442
  return {