@canopy-iiif/app 0.8.4 → 0.8.6
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/iiif.js +361 -84
- package/lib/build/mdx.js +16 -8
- package/lib/build/pages.js +2 -1
- package/lib/build/styles.js +53 -1
- package/lib/common.js +28 -6
- package/lib/search/search-app.jsx +177 -25
- package/lib/search/search-form-runtime.js +126 -19
- package/lib/search/search.js +130 -18
- package/package.json +4 -1
- package/ui/dist/index.mjs +239 -97
- package/ui/dist/index.mjs.map +4 -4
- package/ui/dist/server.mjs +129 -72
- package/ui/dist/server.mjs.map +4 -4
- package/ui/styles/_variables.scss +1 -0
- package/ui/styles/base/_common.scss +27 -5
- package/ui/styles/base/_heading.scss +2 -4
- package/ui/styles/base/index.scss +1 -0
- package/ui/styles/components/_card.scss +47 -4
- package/ui/styles/components/_sub-navigation.scss +14 -14
- package/ui/styles/components/header/_header.scss +1 -4
- package/ui/styles/components/header/_logo.scss +33 -10
- package/ui/styles/components/search/_filters.scss +5 -7
- package/ui/styles/components/search/_form.scss +55 -17
- package/ui/styles/components/search/_results.scss +13 -15
- package/ui/styles/index.css +250 -72
- package/ui/styles/index.scss +2 -4
- package/ui/tailwind-canopy-iiif-plugin.js +10 -2
- package/ui/tailwind-canopy-iiif-preset.js +21 -19
- package/ui/theme.js +303 -0
- package/ui/styles/variables.emit.scss +0 -72
- package/ui/styles/variables.scss +0 -76
package/ui/dist/server.mjs
CHANGED
|
@@ -149,8 +149,45 @@ var Slider = (props) => {
|
|
|
149
149
|
return /* @__PURE__ */ React3.createElement(CloverSlider, { ...props });
|
|
150
150
|
};
|
|
151
151
|
|
|
152
|
+
// ui/src/iiif/Scroll.jsx
|
|
153
|
+
import React4, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
154
|
+
var Scroll = (props) => {
|
|
155
|
+
const [CloverScroll, setCloverScroll] = useState3(null);
|
|
156
|
+
useEffect3(() => {
|
|
157
|
+
let mounted = true;
|
|
158
|
+
const canUseDom = typeof window !== "undefined" && typeof document !== "undefined";
|
|
159
|
+
if (canUseDom) {
|
|
160
|
+
import("@samvera/clover-iiif/scroll").then((mod) => {
|
|
161
|
+
if (!mounted) return;
|
|
162
|
+
const Comp = mod && (mod.default || mod.Scroll || mod);
|
|
163
|
+
setCloverScroll(() => Comp);
|
|
164
|
+
}).catch(() => {
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
return () => {
|
|
168
|
+
mounted = false;
|
|
169
|
+
};
|
|
170
|
+
}, []);
|
|
171
|
+
if (!CloverScroll) {
|
|
172
|
+
let json = "{}";
|
|
173
|
+
try {
|
|
174
|
+
json = JSON.stringify(props || {});
|
|
175
|
+
} catch (_) {
|
|
176
|
+
json = "{}";
|
|
177
|
+
}
|
|
178
|
+
return /* @__PURE__ */ React4.createElement("div", { "data-canopy-scroll": "1", className: "not-prose" }, /* @__PURE__ */ React4.createElement(
|
|
179
|
+
"script",
|
|
180
|
+
{
|
|
181
|
+
type: "application/json",
|
|
182
|
+
dangerouslySetInnerHTML: { __html: json }
|
|
183
|
+
}
|
|
184
|
+
));
|
|
185
|
+
}
|
|
186
|
+
return /* @__PURE__ */ React4.createElement(CloverScroll, { ...props });
|
|
187
|
+
};
|
|
188
|
+
|
|
152
189
|
// ui/src/iiif/MdxRelatedItems.jsx
|
|
153
|
-
import
|
|
190
|
+
import React5 from "react";
|
|
154
191
|
function MdxRelatedItems(props) {
|
|
155
192
|
let json = "{}";
|
|
156
193
|
try {
|
|
@@ -158,12 +195,12 @@ function MdxRelatedItems(props) {
|
|
|
158
195
|
} catch (_) {
|
|
159
196
|
json = "{}";
|
|
160
197
|
}
|
|
161
|
-
return /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ React5.createElement("div", { "data-canopy-related-items": "1", className: "not-prose" }, /* @__PURE__ */ React5.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
162
199
|
}
|
|
163
200
|
|
|
164
201
|
// ui/src/iiif/Hero.jsx
|
|
165
202
|
var import_hero_utils = __toESM(require_hero_utils());
|
|
166
|
-
import
|
|
203
|
+
import React6 from "react";
|
|
167
204
|
import helpers from "@canopy-iiif/app/lib/components/featured.js";
|
|
168
205
|
var basePath = (() => {
|
|
169
206
|
try {
|
|
@@ -235,17 +272,17 @@ function Hero({
|
|
|
235
272
|
const figureClassName = ["canopy-hero", className].filter(Boolean).join(" ");
|
|
236
273
|
const figureStyles = { margin: 0, padding: 0, ...style };
|
|
237
274
|
const safeHref = applyBasePath(href);
|
|
238
|
-
return /* @__PURE__ */
|
|
275
|
+
return /* @__PURE__ */ React6.createElement("a", { href: safeHref, className: "canopy-hero-link" }, /* @__PURE__ */ React6.createElement("figure", { className: figureClassName, style: figureStyles, ...sanitizedRest }, /* @__PURE__ */ React6.createElement("div", { className: "canopy-hero__media", style: mediaStyles }, thumbnail ? /* @__PURE__ */ React6.createElement("img", { src: thumbnail, alt: "", "aria-hidden": "true", style: imgStyles }) : null), title ? /* @__PURE__ */ React6.createElement("figcaption", null, title) : null));
|
|
239
276
|
}
|
|
240
277
|
|
|
241
278
|
// ui/src/iiif/FeaturedHero.jsx
|
|
242
|
-
import
|
|
279
|
+
import React7 from "react";
|
|
243
280
|
function FeaturedHero(props = {}) {
|
|
244
|
-
return /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ React7.createElement(Hero, { ...props });
|
|
245
282
|
}
|
|
246
283
|
|
|
247
284
|
// ui/src/layout/SubNavigation.jsx
|
|
248
|
-
import
|
|
285
|
+
import React8 from "react";
|
|
249
286
|
import navigationHelpers from "@canopy-iiif/app/lib/components/navigation.js";
|
|
250
287
|
function resolveRelativeCandidate(page, current) {
|
|
251
288
|
if (page && typeof page.relativePath === "string" && page.relativePath) return page.relativePath;
|
|
@@ -270,14 +307,14 @@ function renderNodes(nodes, parentKey = "node") {
|
|
|
270
307
|
if (node.isActive) classes.push("is-active");
|
|
271
308
|
const linkClass = classes.join(" ");
|
|
272
309
|
const Tag = node.href ? "a" : "span";
|
|
273
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ React8.createElement(
|
|
274
311
|
"li",
|
|
275
312
|
{
|
|
276
313
|
key,
|
|
277
314
|
className: "canopy-sub-navigation__item",
|
|
278
315
|
"data-depth": depth
|
|
279
316
|
},
|
|
280
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ React8.createElement(
|
|
281
318
|
Tag,
|
|
282
319
|
{
|
|
283
320
|
className: linkClass,
|
|
@@ -286,7 +323,7 @@ function renderNodes(nodes, parentKey = "node") {
|
|
|
286
323
|
},
|
|
287
324
|
node.title || node.slug
|
|
288
325
|
),
|
|
289
|
-
showChildren ? /* @__PURE__ */
|
|
326
|
+
showChildren ? /* @__PURE__ */ React8.createElement("ul", { className: "canopy-sub-navigation__list canopy-sub-navigation__list--nested", role: "list" }, renderNodes(node.children, key)) : null
|
|
290
327
|
);
|
|
291
328
|
});
|
|
292
329
|
}
|
|
@@ -300,12 +337,12 @@ function SubNavigation({
|
|
|
300
337
|
ariaLabel
|
|
301
338
|
}) {
|
|
302
339
|
const PageContext = navigationHelpers && navigationHelpers.getPageContext ? navigationHelpers.getPageContext() : null;
|
|
303
|
-
const context = PageContext ?
|
|
340
|
+
const context = PageContext ? React8.useContext(PageContext) : null;
|
|
304
341
|
const contextNavigation = context && context.navigation ? context.navigation : null;
|
|
305
342
|
const contextPage = context && context.page ? context.page : null;
|
|
306
343
|
const effectiveNavigation = navigationProp || contextNavigation;
|
|
307
344
|
const effectivePage = page || contextPage;
|
|
308
|
-
const resolvedNavigation =
|
|
345
|
+
const resolvedNavigation = React8.useMemo(() => {
|
|
309
346
|
if (effectiveNavigation && effectiveNavigation.root) return effectiveNavigation;
|
|
310
347
|
const candidate = resolveRelativeCandidate(effectivePage, current);
|
|
311
348
|
if (!candidate) return effectiveNavigation || null;
|
|
@@ -329,11 +366,11 @@ function SubNavigation({
|
|
|
329
366
|
if (!Object.prototype.hasOwnProperty.call(inlineStyle, "--sub-nav-indent")) {
|
|
330
367
|
inlineStyle["--sub-nav-indent"] = "0.85rem";
|
|
331
368
|
}
|
|
332
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ React8.createElement("nav", { className: combinedClassName, style: inlineStyle, "aria-label": navLabel }, finalHeading ? /* @__PURE__ */ React8.createElement("div", { className: "canopy-sub-navigation__heading" }, finalHeading) : null, /* @__PURE__ */ React8.createElement("ul", { className: "canopy-sub-navigation__list", role: "list" }, renderNodes([rootNode], rootNode.slug || "root")));
|
|
333
370
|
}
|
|
334
371
|
|
|
335
372
|
// ui/src/search/MdxSearchResults.jsx
|
|
336
|
-
import
|
|
373
|
+
import React9 from "react";
|
|
337
374
|
function MdxSearchResults(props) {
|
|
338
375
|
let json = "{}";
|
|
339
376
|
try {
|
|
@@ -341,11 +378,11 @@ function MdxSearchResults(props) {
|
|
|
341
378
|
} catch (_) {
|
|
342
379
|
json = "{}";
|
|
343
380
|
}
|
|
344
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ React9.createElement("div", { "data-canopy-search-results": "1" }, /* @__PURE__ */ React9.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
345
382
|
}
|
|
346
383
|
|
|
347
384
|
// ui/src/search/SearchSummary.jsx
|
|
348
|
-
import
|
|
385
|
+
import React10 from "react";
|
|
349
386
|
function SearchSummary(props) {
|
|
350
387
|
let json = "{}";
|
|
351
388
|
try {
|
|
@@ -353,11 +390,11 @@ function SearchSummary(props) {
|
|
|
353
390
|
} catch (_) {
|
|
354
391
|
json = "{}";
|
|
355
392
|
}
|
|
356
|
-
return /* @__PURE__ */
|
|
393
|
+
return /* @__PURE__ */ React10.createElement("div", { "data-canopy-search-summary": "1" }, /* @__PURE__ */ React10.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
357
394
|
}
|
|
358
395
|
|
|
359
396
|
// ui/src/search/MdxSearchTabs.jsx
|
|
360
|
-
import
|
|
397
|
+
import React11 from "react";
|
|
361
398
|
function MdxSearchTabs(props) {
|
|
362
399
|
let json = "{}";
|
|
363
400
|
try {
|
|
@@ -365,18 +402,18 @@ function MdxSearchTabs(props) {
|
|
|
365
402
|
} catch (_) {
|
|
366
403
|
json = "{}";
|
|
367
404
|
}
|
|
368
|
-
return /* @__PURE__ */
|
|
405
|
+
return /* @__PURE__ */ React11.createElement("div", { "data-canopy-search-tabs": "1" }, /* @__PURE__ */ React11.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: json } }));
|
|
369
406
|
}
|
|
370
407
|
|
|
371
408
|
// ui/src/search-form/MdxSearchFormModal.jsx
|
|
372
|
-
import
|
|
409
|
+
import React15 from "react";
|
|
373
410
|
|
|
374
411
|
// ui/src/Icons.jsx
|
|
375
|
-
import
|
|
376
|
-
var MagnifyingGlassIcon = (props) => /* @__PURE__ */
|
|
412
|
+
import React12 from "react";
|
|
413
|
+
var MagnifyingGlassIcon = (props) => /* @__PURE__ */ React12.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", ...props }, /* @__PURE__ */ React12.createElement("path", { d: "M456.69 421.39L362.6 327.3a173.81 173.81 0 0034.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 00327.3 362.6l94.09 94.09a25 25 0 0035.3-35.3zM97.92 222.72a124.8 124.8 0 11124.8 124.8 124.95 124.95 0 01-124.8-124.8z" }));
|
|
377
414
|
|
|
378
415
|
// ui/src/search/SearchPanelForm.jsx
|
|
379
|
-
import
|
|
416
|
+
import React13 from "react";
|
|
380
417
|
function readBasePath() {
|
|
381
418
|
const normalize = (val) => {
|
|
382
419
|
const raw = typeof val === "string" ? val.trim() : "";
|
|
@@ -435,21 +472,22 @@ function SearchPanelForm(props = {}) {
|
|
|
435
472
|
buttonLabel = "Search",
|
|
436
473
|
label,
|
|
437
474
|
searchPath = "/search",
|
|
438
|
-
inputId: inputIdProp
|
|
475
|
+
inputId: inputIdProp,
|
|
476
|
+
clearLabel = "Clear search"
|
|
439
477
|
} = props || {};
|
|
440
478
|
const text = typeof label === "string" && label.trim() ? label.trim() : buttonLabel;
|
|
441
|
-
const action =
|
|
479
|
+
const action = React13.useMemo(
|
|
442
480
|
() => resolveSearchPath(searchPath),
|
|
443
481
|
[searchPath]
|
|
444
482
|
);
|
|
445
|
-
const autoId = typeof
|
|
446
|
-
const [fallbackId] =
|
|
483
|
+
const autoId = typeof React13.useId === "function" ? React13.useId() : void 0;
|
|
484
|
+
const [fallbackId] = React13.useState(
|
|
447
485
|
() => `canopy-search-form-${Math.random().toString(36).slice(2, 10)}`
|
|
448
486
|
);
|
|
449
487
|
const inputId = inputIdProp || autoId || fallbackId;
|
|
450
|
-
const inputRef =
|
|
451
|
-
const [hasValue, setHasValue] =
|
|
452
|
-
const focusInput =
|
|
488
|
+
const inputRef = React13.useRef(null);
|
|
489
|
+
const [hasValue, setHasValue] = React13.useState(false);
|
|
490
|
+
const focusInput = React13.useCallback(() => {
|
|
453
491
|
const el = inputRef.current;
|
|
454
492
|
if (!el) return;
|
|
455
493
|
if (document.activeElement === el) return;
|
|
@@ -462,30 +500,44 @@ function SearchPanelForm(props = {}) {
|
|
|
462
500
|
}
|
|
463
501
|
}
|
|
464
502
|
}, []);
|
|
465
|
-
const handlePointerDown =
|
|
503
|
+
const handlePointerDown = React13.useCallback(
|
|
466
504
|
(event) => {
|
|
467
505
|
const target = event.target;
|
|
468
506
|
if (target && typeof target.closest === "function") {
|
|
469
507
|
if (target.closest("[data-canopy-search-form-trigger]")) return;
|
|
508
|
+
if (target.closest("[data-canopy-search-form-clear]")) return;
|
|
470
509
|
}
|
|
471
510
|
event.preventDefault();
|
|
472
511
|
focusInput();
|
|
473
512
|
},
|
|
474
513
|
[focusInput]
|
|
475
514
|
);
|
|
476
|
-
|
|
515
|
+
React13.useEffect(() => {
|
|
477
516
|
const el = inputRef.current;
|
|
478
517
|
if (!el) return;
|
|
479
518
|
if (el.value && el.value.trim()) {
|
|
480
519
|
setHasValue(true);
|
|
481
520
|
}
|
|
482
521
|
}, []);
|
|
483
|
-
const handleInputChange =
|
|
522
|
+
const handleInputChange = React13.useCallback((event) => {
|
|
484
523
|
var _a;
|
|
485
|
-
const nextHasValue = Boolean(
|
|
524
|
+
const nextHasValue = Boolean(
|
|
525
|
+
((_a = event == null ? void 0 : event.target) == null ? void 0 : _a.value) && event.target.value.trim()
|
|
526
|
+
);
|
|
486
527
|
setHasValue(nextHasValue);
|
|
487
528
|
}, []);
|
|
488
|
-
|
|
529
|
+
const handleClear = React13.useCallback((event) => {
|
|
530
|
+
}, []);
|
|
531
|
+
const handleClearKey = React13.useCallback(
|
|
532
|
+
(event) => {
|
|
533
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
534
|
+
event.preventDefault();
|
|
535
|
+
handleClear(event);
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
[handleClear]
|
|
539
|
+
);
|
|
540
|
+
return /* @__PURE__ */ React13.createElement(
|
|
489
541
|
"form",
|
|
490
542
|
{
|
|
491
543
|
action,
|
|
@@ -495,59 +547,63 @@ function SearchPanelForm(props = {}) {
|
|
|
495
547
|
spellCheck: "false",
|
|
496
548
|
className: "canopy-search-form canopy-search-form-shell",
|
|
497
549
|
onPointerDown: handlePointerDown,
|
|
498
|
-
"data-placeholder": placeholder || "",
|
|
499
550
|
"data-has-value": hasValue ? "1" : "0"
|
|
500
551
|
},
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
"
|
|
552
|
+
/* @__PURE__ */ React13.createElement("label", { htmlFor: inputId, className: "canopy-search-form__label" }, /* @__PURE__ */ React13.createElement(MagnifyingGlassIcon, { className: "canopy-search-form__icon" }), /* @__PURE__ */ React13.createElement(
|
|
553
|
+
"input",
|
|
503
554
|
{
|
|
504
|
-
|
|
505
|
-
|
|
555
|
+
id: inputId,
|
|
556
|
+
type: "search",
|
|
557
|
+
name: "q",
|
|
558
|
+
inputMode: "search",
|
|
559
|
+
"data-canopy-search-form-input": true,
|
|
560
|
+
placeholder,
|
|
561
|
+
className: "canopy-search-form__input",
|
|
562
|
+
"aria-label": "Search",
|
|
563
|
+
ref: inputRef,
|
|
564
|
+
onChange: handleInputChange,
|
|
565
|
+
onInput: handleInputChange
|
|
566
|
+
}
|
|
567
|
+
)),
|
|
568
|
+
hasValue ? /* @__PURE__ */ React13.createElement(
|
|
569
|
+
"button",
|
|
570
|
+
{
|
|
571
|
+
type: "button",
|
|
572
|
+
className: "canopy-search-form__clear",
|
|
573
|
+
onClick: handleClear,
|
|
574
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
575
|
+
onKeyDown: handleClearKey,
|
|
576
|
+
"aria-label": clearLabel,
|
|
577
|
+
"data-canopy-search-form-clear": true
|
|
506
578
|
},
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
{
|
|
511
|
-
id: inputId,
|
|
512
|
-
type: "search",
|
|
513
|
-
name: "q",
|
|
514
|
-
inputMode: "search",
|
|
515
|
-
"data-canopy-search-form-input": true,
|
|
516
|
-
placeholder,
|
|
517
|
-
className: "canopy-search-form__input",
|
|
518
|
-
"aria-label": "Search",
|
|
519
|
-
ref: inputRef,
|
|
520
|
-
onChange: handleInputChange,
|
|
521
|
-
onInput: handleInputChange
|
|
522
|
-
}
|
|
523
|
-
)
|
|
524
|
-
),
|
|
525
|
-
/* @__PURE__ */ React12.createElement(
|
|
579
|
+
"\xD7"
|
|
580
|
+
) : null,
|
|
581
|
+
/* @__PURE__ */ React13.createElement(
|
|
526
582
|
"button",
|
|
527
583
|
{
|
|
528
584
|
type: "submit",
|
|
529
585
|
"data-canopy-search-form-trigger": "submit",
|
|
530
586
|
className: "canopy-search-form__submit"
|
|
531
587
|
},
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ React13.createElement("span", null, text),
|
|
589
|
+
/* @__PURE__ */ React13.createElement("span", { "aria-hidden": true, className: "canopy-search-form__shortcut" }, /* @__PURE__ */ React13.createElement("span", null, "\u2318"), /* @__PURE__ */ React13.createElement("span", null, "K"))
|
|
534
590
|
)
|
|
535
591
|
);
|
|
536
592
|
}
|
|
537
593
|
|
|
538
594
|
// ui/src/search/SearchPanelTeaserResults.jsx
|
|
539
|
-
import
|
|
595
|
+
import React14 from "react";
|
|
540
596
|
function SearchPanelTeaserResults(props = {}) {
|
|
541
597
|
const { style, className } = props || {};
|
|
542
598
|
const classes = ["canopy-search-teaser", className].filter(Boolean).join(" ");
|
|
543
|
-
return /* @__PURE__ */
|
|
599
|
+
return /* @__PURE__ */ React14.createElement(
|
|
544
600
|
"div",
|
|
545
601
|
{
|
|
546
602
|
"data-canopy-search-form-panel": true,
|
|
547
603
|
className: classes || void 0,
|
|
548
604
|
style
|
|
549
605
|
},
|
|
550
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ React14.createElement("div", { id: "cplist" })
|
|
551
607
|
);
|
|
552
608
|
}
|
|
553
609
|
|
|
@@ -567,11 +623,11 @@ function MdxSearchFormModal(props = {}) {
|
|
|
567
623
|
const text = typeof label === "string" && label.trim() ? label.trim() : buttonLabel;
|
|
568
624
|
const resolvedSearchPath = resolveSearchPath(searchPath);
|
|
569
625
|
const data = { placeholder, hotkey, maxResults, groupOrder, label: text, searchPath: resolvedSearchPath };
|
|
570
|
-
return /* @__PURE__ */
|
|
626
|
+
return /* @__PURE__ */ React15.createElement("div", { "data-canopy-search-form": true, className: "flex-1 min-w-0" }, /* @__PURE__ */ React15.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React15.createElement(SearchPanelForm, { placeholder, buttonLabel, label, searchPath: resolvedSearchPath }), /* @__PURE__ */ React15.createElement(SearchPanelTeaserResults, null)), /* @__PURE__ */ React15.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: JSON.stringify(data) } }));
|
|
571
627
|
}
|
|
572
628
|
|
|
573
629
|
// ui/src/search/SearchPanel.jsx
|
|
574
|
-
import
|
|
630
|
+
import React16 from "react";
|
|
575
631
|
function SearchPanel(props = {}) {
|
|
576
632
|
const {
|
|
577
633
|
placeholder = "Search\u2026",
|
|
@@ -588,11 +644,11 @@ function SearchPanel(props = {}) {
|
|
|
588
644
|
const text = typeof label === "string" && label.trim() ? label.trim() : buttonLabel;
|
|
589
645
|
const resolvedSearchPath = resolveSearchPath(searchPath);
|
|
590
646
|
const data = { placeholder, hotkey, maxResults, groupOrder, label: text, searchPath: resolvedSearchPath };
|
|
591
|
-
return /* @__PURE__ */
|
|
647
|
+
return /* @__PURE__ */ React16.createElement("div", { "data-canopy-search-form": true, className: "flex-1 min-w-0" }, /* @__PURE__ */ React16.createElement("div", { className: "relative w-full" }, /* @__PURE__ */ React16.createElement(SearchPanelForm, { placeholder, buttonLabel, label, searchPath: resolvedSearchPath }), /* @__PURE__ */ React16.createElement(SearchPanelTeaserResults, null)), /* @__PURE__ */ React16.createElement("script", { type: "application/json", dangerouslySetInnerHTML: { __html: JSON.stringify(data) } }));
|
|
592
648
|
}
|
|
593
649
|
|
|
594
650
|
// ui/src/iiif/ManifestPrimitives.jsx
|
|
595
|
-
import
|
|
651
|
+
import React17 from "react";
|
|
596
652
|
import {
|
|
597
653
|
Label as CloverLabel,
|
|
598
654
|
Metadata as CloverMetadata,
|
|
@@ -617,24 +673,24 @@ function ensureMetadata(items) {
|
|
|
617
673
|
function Label({ manifest, label, ...rest }) {
|
|
618
674
|
const intl = label || manifest && manifest.label;
|
|
619
675
|
if (!hasInternationalValue(intl)) return null;
|
|
620
|
-
return /* @__PURE__ */
|
|
676
|
+
return /* @__PURE__ */ React17.createElement(CloverLabel, { label: intl, ...rest });
|
|
621
677
|
}
|
|
622
678
|
function Summary({ manifest, summary, ...rest }) {
|
|
623
679
|
const intl = summary || manifest && manifest.summary;
|
|
624
680
|
if (!hasInternationalValue(intl)) return null;
|
|
625
|
-
return /* @__PURE__ */
|
|
681
|
+
return /* @__PURE__ */ React17.createElement(CloverSummary, { summary: intl, ...rest });
|
|
626
682
|
}
|
|
627
683
|
function Metadata({ manifest, metadata, ...rest }) {
|
|
628
684
|
const items = ensureMetadata(metadata || manifest && manifest.metadata);
|
|
629
685
|
if (!items.length) return null;
|
|
630
|
-
return /* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ React17.createElement(CloverMetadata, { metadata: items, ...rest });
|
|
631
687
|
}
|
|
632
688
|
function RequiredStatement({ manifest, requiredStatement, ...rest }) {
|
|
633
689
|
const stmt = requiredStatement || manifest && manifest.requiredStatement;
|
|
634
690
|
if (!stmt || !hasInternationalValue(stmt.label) || !hasInternationalValue(stmt.value)) {
|
|
635
691
|
return null;
|
|
636
692
|
}
|
|
637
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ React17.createElement(CloverRequiredStatement, { requiredStatement: stmt, ...rest });
|
|
638
694
|
}
|
|
639
695
|
export {
|
|
640
696
|
FeaturedHero,
|
|
@@ -644,6 +700,7 @@ export {
|
|
|
644
700
|
Metadata,
|
|
645
701
|
MdxRelatedItems as RelatedItems,
|
|
646
702
|
RequiredStatement,
|
|
703
|
+
Scroll,
|
|
647
704
|
MdxSearchFormModal as SearchFormModal,
|
|
648
705
|
SearchPanel,
|
|
649
706
|
SearchPanelForm,
|