@canopy-iiif/app 1.1.0 → 1.2.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/lib/build/dev.js +85 -1
- package/lib/build/mdx.js +591 -4
- package/lib/build/pages.js +24 -1
- package/lib/search/search.js +13 -1
- package/package.json +1 -1
- package/ui/dist/server.mjs +1 -0
- package/ui/dist/server.mjs.map +2 -2
package/lib/search/search.js
CHANGED
|
@@ -278,7 +278,19 @@ async function buildSearchPage() {
|
|
|
278
278
|
return rel;
|
|
279
279
|
}
|
|
280
280
|
const vendorTags = `<script src="${verRel(vendorReactAbs)}"></script><script src="${verRel(vendorFlexAbs)}"></script><script src="${verRel(vendorSearchFormAbs)}"></script>`;
|
|
281
|
-
let
|
|
281
|
+
let customRuntimeTag = '';
|
|
282
|
+
if (body && body.indexOf('data-canopy-client-component') !== -1) {
|
|
283
|
+
try {
|
|
284
|
+
await mdx.ensureCustomClientRuntime();
|
|
285
|
+
const runtimeAbs = path.join(OUT_DIR, 'scripts', 'canopy-custom-components.js');
|
|
286
|
+
let rel = path.relative(path.dirname(outPath), runtimeAbs).split(path.sep).join('/');
|
|
287
|
+
try { const st = require('fs').statSync(runtimeAbs); rel += `?v=${Math.floor(st.mtimeMs || Date.now())}`; } catch (_) {}
|
|
288
|
+
customRuntimeTag = `<script type="module" src="${rel}"></script>`;
|
|
289
|
+
} catch (e) {
|
|
290
|
+
console.warn('[search] failed to build custom client runtime:', e && (e.message || e));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
let headExtra = vendorTags + head + importMap + customRuntimeTag;
|
|
282
294
|
try {
|
|
283
295
|
const { BASE_PATH } = require('../common');
|
|
284
296
|
if (BASE_PATH) {
|
package/package.json
CHANGED
package/ui/dist/server.mjs
CHANGED
|
@@ -2286,6 +2286,7 @@ function ReferencedItems({
|
|
|
2286
2286
|
// ui/src/content/References.jsx
|
|
2287
2287
|
import React25 from "react";
|
|
2288
2288
|
import navigationHelpers5 from "@canopy-iiif/app/lib/components/navigation.js";
|
|
2289
|
+
import referenced from "@canopy-iiif/app/lib/components/referenced.js";
|
|
2289
2290
|
function getPageContext() {
|
|
2290
2291
|
if (!navigationHelpers5 || typeof navigationHelpers5.getPageContext !== "function") {
|
|
2291
2292
|
return null;
|