@canopy-iiif/app 1.11.2 → 1.12.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.
@@ -138,7 +138,7 @@ async function writeFacetCollections(labelWhitelist, combined) {
138
138
  }
139
139
  const selfId = absoluteUrl(`/api/facet/${labelSlug}/${valueSlug}.json`);
140
140
  const parentId = absoluteUrl(`/api/facet/${labelSlug}.json`);
141
- const homepage = absoluteUrl(`/search?${encodeURIComponent(labelSlug)}=${encodeURIComponent(valueSlug)}`);
141
+ const homepage = absoluteUrl(`/search/index.html?${encodeURIComponent(labelSlug)}=${encodeURIComponent(valueSlug)}`);
142
142
  const col = {
143
143
  '@context': 'https://iiif.io/api/presentation/3/context.json',
144
144
  id: selfId,
@@ -42,7 +42,7 @@ function collectAbsoluteUrls(iiifRecords, pageRecords) {
42
42
  push(record.href);
43
43
  });
44
44
  // Ensure the search page is always present even though it is generated separately
45
- push('/search.html');
45
+ push('/search/index.html');
46
46
  return Array.from(urls.values()).sort((a, b) => a.localeCompare(b));
47
47
  }
48
48
 
@@ -105,7 +105,7 @@ function isOnSearchPage() {
105
105
  let path = String(location.pathname || '');
106
106
  if (base && path.startsWith(base)) path = path.slice(base.length);
107
107
  if (path.endsWith('/')) path = path.slice(0, -1);
108
- return path === '/search';
108
+ return path === '/search' || path === '/search/index.html';
109
109
  } catch (_) {
110
110
  return false;
111
111
  }
@@ -114,10 +114,7 @@ function getSearchRouteEntries() {
114
114
  function resolveSearchOutputRelative(routeValue) {
115
115
  const defaultRoute = getDefaultRoute('search') || 'search';
116
116
  const trimmed = typeof routeValue === 'string' ? routeValue.trim().replace(/^\/+|\/+$/g, '') : '';
117
- if (!trimmed || trimmed === defaultRoute) {
118
- return `${trimmed || defaultRoute}.html`;
119
- }
120
- return path.join(trimmed, 'index.html');
117
+ return path.join(trimmed || defaultRoute, 'index.html');
121
118
  }
122
119
 
123
120
  async function ensureSearchRuntime() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canopy-iiif/app",
3
- "version": "1.11.2",
3
+ "version": "1.12.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Mat Jordan <mat@northwestern.edu>",
package/ui/dist/index.mjs CHANGED
@@ -43458,7 +43458,7 @@ function isAbsoluteUrl(href) {
43458
43458
  }
43459
43459
  function resolveSearchPath(pathValue) {
43460
43460
  let raw = typeof pathValue === "string" ? pathValue.trim() : "";
43461
- if (!raw) raw = "/search";
43461
+ if (!raw) raw = "/search/index.html";
43462
43462
  if (isAbsoluteUrl(raw)) return raw;
43463
43463
  const normalizedPath = raw.startsWith("/") ? raw : `/${raw}`;
43464
43464
  const base = readBasePath();
@@ -43477,7 +43477,7 @@ function SearchPanelForm(props = {}) {
43477
43477
  placeholder,
43478
43478
  buttonLabel,
43479
43479
  label,
43480
- searchPath = "/search",
43480
+ searchPath = "/search/index.html",
43481
43481
  inputId: inputIdProp,
43482
43482
  clearLabel
43483
43483
  } = props || {};
@@ -43633,7 +43633,7 @@ function SearchPanel(props = {}) {
43633
43633
  // eslint-disable-line no-unused-vars
43634
43634
  buttonLabel: buttonLabelProp,
43635
43635
  label,
43636
- searchPath = "/search"
43636
+ searchPath = "/search/index.html"
43637
43637
  } = props || {};
43638
43638
  const { getString } = useLocale();
43639
43639
  const placeholder = placeholderProp != null ? placeholderProp : getString("common.phrases.placeholder_search", "Search\u2026");
@@ -44627,7 +44627,7 @@ function CanopyHeader(props = {}) {
44627
44627
  const defaultSearchRoute = siteDefaultRoutes && typeof siteDefaultRoutes.search === "string" ? siteDefaultRoutes.search : "search";
44628
44628
  const trimmedSearchRoute = searchRouteValue ? searchRouteValue.replace(/^\/+|\/+$/g, "") : "";
44629
44629
  const usesDirectorySearchRoute = trimmedSearchRoute && trimmedSearchRoute !== (defaultSearchRoute || "search");
44630
- const normalizedSearchRoute = usesDirectorySearchRoute ? `/${trimmedSearchRoute}/` : `/${(trimmedSearchRoute || defaultSearchRoute || "search").replace(/^\/+/, "")}`;
44630
+ const normalizedSearchRoute = usesDirectorySearchRoute ? `/${trimmedSearchRoute}/` : `/${(trimmedSearchRoute || defaultSearchRoute || "search").replace(/^\/+/, "")}/index.html`;
44631
44631
  const resolvedLanguageToggle = languageToggleProp === false ? null : languageToggleProp === true || typeof languageToggleProp === "undefined" ? siteLanguageToggle : languageToggleProp;
44632
44632
  const resolvedSearchLabel = searchLabelProp != null ? searchLabelProp : getString("common.nouns.search", "Search");
44633
44633
  const resolvedSearchPlaceholder = searchPlaceholderProp != null ? searchPlaceholderProp : getString("common.phrases.placeholder_search", "Search\u2026");
@@ -46316,7 +46316,7 @@ function MdxSearchFormModal(props = {}) {
46316
46316
  // kept for backward compat; ignored by teaser form
46317
46317
  buttonLabel: buttonLabelProp,
46318
46318
  label,
46319
- searchPath = "/search"
46319
+ searchPath = "/search/index.html"
46320
46320
  } = props || {};
46321
46321
  const { getString } = useLocale();
46322
46322
  const placeholder = placeholderProp != null ? placeholderProp : getString("common.phrases.placeholder_search", "Search\u2026");