@canopy-iiif/app 1.5.11 → 1.5.13
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/package.json +1 -1
- package/ui/dist/server.mjs +58 -3
- package/ui/dist/server.mjs.map +2 -2
- package/ui/styles/components/_buttons.scss +2 -29
- package/ui/styles/components/_interstitial-hero.scss +1 -1
- package/ui/styles/components/_map.scss +14 -11
- package/ui/styles/components/_nav-tree.scss +9 -2
- package/ui/styles/components/_sub-navigation.scss +2 -1
- package/ui/styles/components/header/_navbar.scss +8 -2
- package/ui/styles/components/search/_form.scss +1 -1
- package/ui/styles/index.css +32 -32
- package/ui/theme.js +3 -7
package/package.json
CHANGED
package/ui/dist/server.mjs
CHANGED
|
@@ -3453,6 +3453,10 @@ TimelinePoint.displayName = "TimelinePoint";
|
|
|
3453
3453
|
// ui/src/utils/manifestReferences.js
|
|
3454
3454
|
import React31 from "react";
|
|
3455
3455
|
import navigationHelpers6 from "@canopy-iiif/app/lib/components/navigation.js";
|
|
3456
|
+
import referencedHelpers from "@canopy-iiif/app/lib/components/referenced.js";
|
|
3457
|
+
var referencedModule = referencedHelpers && typeof referencedHelpers === "object" ? referencedHelpers : null;
|
|
3458
|
+
var buildReferencedItems = referencedModule && typeof referencedModule.buildReferencedItems === "function" ? referencedModule.buildReferencedItems : null;
|
|
3459
|
+
var normalizeReferencedManifestList = referencedModule && typeof referencedModule.normalizeReferencedManifestList === "function" ? referencedModule.normalizeReferencedManifestList : null;
|
|
3456
3460
|
function normalizeManifestId(raw) {
|
|
3457
3461
|
if (!raw) return "";
|
|
3458
3462
|
try {
|
|
@@ -3512,6 +3516,57 @@ function resolveManifestReferences(ids, manifestMap) {
|
|
|
3512
3516
|
});
|
|
3513
3517
|
return out;
|
|
3514
3518
|
}
|
|
3519
|
+
function resolveReferencedManifests(ids, manifestMap) {
|
|
3520
|
+
if (!Array.isArray(ids) || !ids.length) return [];
|
|
3521
|
+
const order = [];
|
|
3522
|
+
const seen = /* @__PURE__ */ new Set();
|
|
3523
|
+
ids.forEach((value) => {
|
|
3524
|
+
const normalized = normalizeManifestId(value);
|
|
3525
|
+
if (!normalized || seen.has(normalized)) return;
|
|
3526
|
+
seen.add(normalized);
|
|
3527
|
+
order.push(normalized);
|
|
3528
|
+
});
|
|
3529
|
+
if (!order.length) return [];
|
|
3530
|
+
const manifestRecords = /* @__PURE__ */ new Map();
|
|
3531
|
+
if (manifestMap) {
|
|
3532
|
+
const resolved = resolveManifestReferences(ids, manifestMap);
|
|
3533
|
+
resolved.forEach((entry) => {
|
|
3534
|
+
const key = normalizeManifestId(entry && (entry.id || entry.href));
|
|
3535
|
+
if (key && !manifestRecords.has(key)) {
|
|
3536
|
+
manifestRecords.set(key, entry);
|
|
3537
|
+
}
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
const missing = order.filter((key) => key && !manifestRecords.has(key));
|
|
3541
|
+
if (missing.length && buildReferencedItems) {
|
|
3542
|
+
let fallbackItems = [];
|
|
3543
|
+
try {
|
|
3544
|
+
const normalizedMissing = normalizeReferencedManifestList ? normalizeReferencedManifestList(missing) : missing;
|
|
3545
|
+
if (normalizedMissing && normalizedMissing.length) {
|
|
3546
|
+
fallbackItems = buildReferencedItems(normalizedMissing) || [];
|
|
3547
|
+
}
|
|
3548
|
+
} catch (_) {
|
|
3549
|
+
fallbackItems = [];
|
|
3550
|
+
}
|
|
3551
|
+
fallbackItems.forEach((item) => {
|
|
3552
|
+
if (!item) return;
|
|
3553
|
+
const fallbackKey = normalizeManifestId(item.id || item.href);
|
|
3554
|
+
if (!fallbackKey || manifestRecords.has(fallbackKey)) return;
|
|
3555
|
+
manifestRecords.set(fallbackKey, {
|
|
3556
|
+
id: item.id || item.href || fallbackKey,
|
|
3557
|
+
href: item.href || null,
|
|
3558
|
+
title: item.title || item.href || "",
|
|
3559
|
+
summary: item.summary || "",
|
|
3560
|
+
thumbnail: item.thumbnail || null,
|
|
3561
|
+
thumbnailWidth: item.thumbnailWidth,
|
|
3562
|
+
thumbnailHeight: item.thumbnailHeight,
|
|
3563
|
+
type: item.type || "work",
|
|
3564
|
+
metadata: Array.isArray(item.metadata) && item.metadata.length ? item.metadata : item.summary ? [item.summary] : []
|
|
3565
|
+
});
|
|
3566
|
+
});
|
|
3567
|
+
}
|
|
3568
|
+
return order.map((key) => manifestRecords.get(key)).filter(Boolean);
|
|
3569
|
+
}
|
|
3515
3570
|
|
|
3516
3571
|
// ui/src/content/timeline/MdxTimeline.jsx
|
|
3517
3572
|
function normalizeResource(resource, index) {
|
|
@@ -3553,7 +3608,7 @@ function normalizePoint(child, index, options) {
|
|
|
3553
3608
|
}
|
|
3554
3609
|
const resources = Array.isArray(props.iiifResources) ? props.iiifResources.map(normalizeResource).filter(Boolean) : [];
|
|
3555
3610
|
const manifestValues = Array.isArray(props.referencedManifests) ? props.referencedManifests : props.manifest ? [props.manifest] : Array.isArray(props.manifests) ? props.manifests : [];
|
|
3556
|
-
const manifests =
|
|
3611
|
+
const manifests = resolveReferencedManifests(manifestValues, options.manifestMap);
|
|
3557
3612
|
return {
|
|
3558
3613
|
id,
|
|
3559
3614
|
title: props.title || props.label || `Point ${index + 1}`,
|
|
@@ -3669,7 +3724,7 @@ function normalizeCustomPoint(child, index, manifestMap) {
|
|
|
3669
3724
|
let thumbnailHeight = normalizeNumber(props.thumbnailHeight);
|
|
3670
3725
|
const detailsHtml = renderDetailsHtml(props.children);
|
|
3671
3726
|
const manifestValues = Array.isArray(props.referencedManifests) ? props.referencedManifests : props.manifest ? [props.manifest] : Array.isArray(props.manifests) ? props.manifests : [];
|
|
3672
|
-
const manifests =
|
|
3727
|
+
const manifests = resolveReferencedManifests(manifestValues, manifestMap);
|
|
3673
3728
|
if (!thumbnail && manifests.length) {
|
|
3674
3729
|
const manifestWithThumb = manifests.find(
|
|
3675
3730
|
(manifest) => manifest && manifest.thumbnail
|
|
@@ -4315,7 +4370,7 @@ function DocsCodeBlock(props = {}) {
|
|
|
4315
4370
|
padding: "0.2rem 0.55rem",
|
|
4316
4371
|
fontSize: "0.7rem",
|
|
4317
4372
|
fontWeight: 500,
|
|
4318
|
-
color: "var(--color-accent-
|
|
4373
|
+
color: "var(--color-accent-default)",
|
|
4319
4374
|
cursor: "pointer"
|
|
4320
4375
|
}
|
|
4321
4376
|
},
|