@museumwnf/viewer-layout 2.16.0 → 2.17.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/README.md CHANGED
@@ -322,7 +322,7 @@ the application registered, without any router coupling here.
322
322
  | `FeaturedPartners` | `records: [{ id, name, logo, city, country, description, route }]`, or `partners` (view-models from viewer-core's `partnerView()`: the first picture or logo, "city, country", the description as plain text cut at `descriptionLength`, 420), `headingEntry` ('partner.featured') | a carousel of partners with bullet controls, rotated on an 8-second timer; the site provides filtered/shuffled records and routes |
323
323
  | `SiblingGalleries` | `galleries: [{ id, name, image?, route }]`, `museums: [{ name, to \| href, accent?, textColor? }]`, `galleriesHeadingEntry`, `seeMoreGalleriesEntry`, `seeMoreGalleriesHref`, `museumsHeadingEntry` | two blocks of links: sibling galleries (may be unresolved, rendering as non-clickable tiles) and MWNF virtual museums (text initials over a coloured background) |
324
324
  | `PopupLogo` | `content` (Markdown or raw HTML), `rawHtml` (false), `enabled` (true), `closeLabel` ('core.action.close') | a dismissible fixed modal for sponsor notices; renders content through `renderInline` by default (escaping, Markdown); when `rawHtml: true`, passes content as-is (for trusted HTML from the importer) |
325
- | `BackLink` | `label` ('core.action.back'), `to \| href` (fallback when history is unavailable) | a "back" link that calls `router.back()` when browser history is available (length > 1); falls back to the provided route |
325
+ | `BackLink` | `label` ('core.action.back'), `to \| href` (the fallback), `variant: 'button' \| 'bar'`, `arrow` ('←', the bar's leading mark) | a "back" link: `router.back()` when the previous page is one of this website's own (vue-router's `history.state.back`), the fallback otherwise, so a visitor who arrived from another site stays on this one; with no fallback, back through whatever history the tab has. The default is a button (`.mwnf-back-link`); `bar` is a link carrying `.mwnf-back-bar`, addressed to the fallback so it also opens in a new tab, whose default slot replaces the label |
326
326
  | `GlossaryTool` | `language`, `entity` ('glossary'), `labels` (entry-name overrides), `dir` | the search box four item sheets and a theme page each wrote for themselves: an input, the hits viewer-core's `searchGlossary` finds, the chosen definition as Markdown; a native `<details>` toggle |
327
327
  | `DynastyPopout` | `dynasty` (record: `from_ah`/`to_ah`/`from_ad`/`to_ad`), `text` (its translation: `name`, `also_known_as`, `area`, `history`), `dir` | one dynasty, collapsed behind a native `<details>` toggle: name, also known as, area, AH/AD dates, history as Markdown |
328
328
  | `DynastyList` | `heading`, `dynasties`, `tr` (dynasty → its translation), `dir` | one `DynastyPopout` per dynasty of a record, `RelatedRecords`'s shape |
@@ -330,7 +330,9 @@ the application registered, without any router coupling here.
330
330
  | `PictureGallery` | `pictures: [{ id, image, imageAlt?, name (inline HTML), imageCaption?, detail?, fields?: [{ label, value }], to (route \| null), backRelated?: [{ picture, reciprocalText }] }]`, `selectedId` (v-model), `seeItemEntry`/`unresolvedEntry`/`emptyEntry`/`addRelatedEntry`/`hideRelatedEntry` (entry names) | a DXA exhibition theme page's curated-picture side panel + thumbnail strip: the selected picture large, its fields, a link to the parent record (or the "not in this exhibition" message when `to` is `null`); a picture that is the target of some other picture's related link (`backRelated`) starts hidden behind an "Add related works" toggle |
331
331
  | `PictureNarrative` | `picture` (the selected picture, `PictureGallery`'s shape plus `related: [{ picture, text }]` and `backRelated: [{ picture, reciprocalText }]`), `contextualDescription` (Markdown), `relatedHeadingEntry`/`reciprocalFallbackEntry` (entry names); emits `select(id)` | the same page's narrative body, below `EssayView`'s own prose: the selected picture's own curated text, then the pictures it relates to (forward) and, when one points at it, the one it is related to (backward) — either direction may cross a theme boundary, which is why the website resolves the target/source picture rather than this component |
332
332
  | `TimelineLookup` | `info: { trigger? (entry, default `record.related.timelineForItem`), heading (entry), countries: [{ value, label }], defaultCountry?() => value, events(value) => [{ id?, year_from, text: { description } }], range: [from, to], era?(year) => string, searchTo(value, range) => to }` | the timeline popout `RecordSheetView`'s related block opens onto (see below): a trigger line, a country select, the events for the chosen country within the record's own date range (rendered through `md()`), and a "begin a full search" link — the DXA gallery/exhibition pair's shared shape, parameterized by the site's own timeline composable |
333
-
333
+ | `SpecialFeatures` | `features` (the record's `details`: `{ id, internal_name, display_order, images, artist_names }`), `tr` (feature → its translation: `name`, `location`, `dates`, `description`), `language` (the pictures' captions), `glossary` (`RecordView`'s), `heading` ('sheet.field.specialFeatures'), `dir` | a monument's sub-details, as the data package embeds them on it: each one's name, location, dates and artists, its description as Markdown with the record's glossary terms, its pictures in a row; `DynastyList`'s shape |
334
+ | `RelatedMedia` | `media` (the record's `media`: `{ title, description, url, language }`), `language` (the entries in it when there are any, all otherwise), `descriptions` (true), `heading` ('record.related.audioVideo'), `dir` | a record's audio and video, each a ↗ link opening elsewhere, its description under it |
335
+ | `OnDisplayIn` | `groups: [{ heading? (entry), links: [{ id?, label (inline HTML), to? \| href?, external? }] }]`, `heading` ('record.related.onDisplayIn'; '' renders the groups alone), `pendingLabel` (entry, after a name with no address), `dir` | the exhibitions, chapters and galleries that show a record: a route links inside the site, an `external` address opens elsewhere marked ↗, a name with neither is plain text |
334
336
  The record contract `RecordList`, `RecordGrid` and `RelatedRecords` share:
335
337
  `{ id, image?, imageAlt?, name (inline HTML), meta: [string], badge?, href? | to? }`.
336
338
  `PictureGallery` and `PictureNarrative` share a narrower one — a curated
@@ -345,7 +347,7 @@ every bundle of `@museumwnf/viewer-i18n` from 1.7.0. `GlossaryTool` also reads
345
347
  `record.glossary.instructions`, `.definition` (1.7.0) and `record.glossary.tool`
346
348
  (2.3.0); `PartnerPanel` reads `partner.info.about`, `.contact`, `.logo`,
347
349
  `.addresses`, `.phone`, `.fax`, `partner.nav.homepage`,
348
- `partner.item.objectsInSite` and `partner.action.readMore`, `.viewObjects` (4.2.0); `DynastyPopout` reads `record.dynasty.heading` (2.3.0) and
350
+ `partner.item.objectsInSite` and `partner.action.readMore`, `.viewObjects` (4.2.0); `SpecialFeatures`, `RelatedMedia` and `OnDisplayIn` default to `sheet.field.specialFeatures`, `record.related.audioVideo` and `record.related.onDisplayIn`; `DynastyPopout` reads `record.dynasty.heading` (2.3.0) and
349
351
  `sheet.field.alsoKnownAs`, `.area`, `.history`. `SourceCredit` reads
350
352
  `record.source.label` (2.5.0); the footer attribution (`SiteShell`) reads
351
353
  `record.source.rightsHolder` and `.termsOfUse` (2.5.0). `PictureGallery`/
@@ -373,7 +375,7 @@ Building blocks copied from the legacy sites' own `site.css` files, available as
373
375
  | `.mwnf-form-table` | Table layout for label/value pairs in search and filter forms; header cells left-aligned, data cells right-padded |
374
376
  | `.mwnf-button` | Styled button for primary actions; variant `.mwnf-button--secondary` for secondary/destructive actions |
375
377
  | `.mwnf-select` | Legacy-styled select element with fixed height and padding |
376
- | `.mwnf-back-bar` | Container for back-link buttons with standard padding and hover styling |
378
+ | `.mwnf-back-bar` | Container for back-link buttons with standard padding and hover styling; `.mwnf-back-bar--link` is `BackLink`'s `bar` variant, the link itself as the bar (`--mwnf-back-bar-margin`) |
377
379
  | `.mwnf-chip` | Inline project/source chip; variants `.mwnf-chip--<family>` where family is one of `ISLandEPM`, `DBA`, `AWE`, `DCA`, `DGA`, `EXH`, or `Galleries`, each with its own project-colour token |
378
380
  | `.mwnf-popout` | Detail box for sheet data; used in record detail popups and panels |
379
381
  | `.mwnf-loader` | Loading/spinner message container with centered text and standard padding |
@@ -425,7 +427,7 @@ export default {
425
427
 
426
428
  | View | Declaration | Slots |
427
429
  |---|---|---|
428
- | `HomeView` | `config.home` or the same as props: `title`, `intro` (Markdown), `cards: [{ title, description, action, to \| href }]`, `featured: { entity, heading, action, route, eyebrow, meta, seed }` — the pick is `useFeaturedRecord` | `before`, default, `after` |
430
+ | `HomeView` | `config.home` or the same as props: `title`, `intro` (Markdown), `cards: [{ title, description, action, to \| href }]`, `featured: { entity, heading, action, route, eyebrow, meta, seed, filter }` — the pick is `useFeaturedRecord`, among the records `filter` keeps (viewer-core 2.2.0) — `panels` (the welcome and the record as `.mwnf-panel` boxes) | `before`, default, `after` |
429
431
  | `CatalogueResultsView` | `spec`: `entity`, `keys`, `facets` (viewer-core's facet spec), `facetScope: 'all' \| 'matching'`, `controls: [{ key, type: 'select' \| 'year' \| 'query' \| 'checkbox', label, placeholder, anyLabel, hideEmpty }]`, `filterMode: 'apply' \| 'immediate'`, `scope(record, filters)`, `match(record, filters)`, `narrow(list, filters, helpers)` (a rule over the whole list — a keyword index, say), `dates: { mode, begin, end }`, `sort`, `pageSize`, `variant: 'list' \| 'grid'`, `record(record, helpers)`, `recordRoute`, `summary(context)`, `title`, `filterTitle`, `empty`, `actionLabel`, `pagination` | `before`, `filters`, `actions`, `aside`, `empty`, `after` — each given `{ filters, active, apply, reset, goToPage, matching, pageInfo, options }`, enough to compose the panel in the aside or a second pagination |
430
432
  | `RecordView` | `spec` and `id`: `entity`, `translations`, `attribution`, `fields` (viewer-core's `sheetRows` spec, or a function of the context), `sections`, `layout`, `shortDescription`, `media(record, ctx)`, `mediaVariant`, `credits`, `workingNumber`, `citation: { project, permalink: true \| false \| string, heading } \| false` (the permalink is `sourceUrl(currentRoute)` — null, so no address, until the website declares `site.origin` — unless the spec disables it with `false` or overrides it with a string), `related: { variant, heading, record, route } \| false`, `back: { label, to \| href }`, `title(ctx)` | `header`, `before-sheet`, `after-sheet`, `aside`, `source` (under the citation; default `SourceCredit`), `related`, `after`, and one named after every `custom` or `link` row — each given `{ record, text, language, languages, select, dir, glossary, ready, attribution, t, tr }`; `related` also `records` (the rows) and `outside` (the related records the package does not carry) |
431
433
  | `RecordSheetView` | Every `RecordView` prop (`spec`, `id`, `entity`) plus `dataGetter(id) => record \| null \| undefined` — a website's own language-subset record lookup (an exhibition's per-build `itemById.get`); omitted, every `id` `RecordView` itself finds is treated as present (the gallery shape); supplied and it reports `id` missing, `NotFoundView` renders before `RecordView` ever mounts (the exhibition shape's per-language-build 404), and it also narrows the related block's `records`/outside-reference split the same way. The DXA gallery/exhibition item sheet's own blocks, on top of `spec`: `sourceDatabase: { label?, chipClass(record, ctx), addToCollection: { label? } \| false } \| false` (the source-database line + `backward_compatibility` code + "add to my collection" link — `chipClass` is a site's own project→colour map, the name comes from `useProjects()`), `notice: { show(record, ctx), label } \| false` (the Explore-partner notice), `museum: { route(partnerId, ctx) } \| false` (the holding-museum row: the item's holder text, then the partner as `PartnerPanel`'s `summary` — "About {name}, {city}, {country}" — linked through `route`; `route` returning null keeps the name without a link, for a hidden partner; `false` keeps the holder text alone; decision D3), and on `spec.related`: `title`, `description` (entries, above the block), `notInPackageLabel`, `outsideChip(ref, ctx)` (an outside reference's chip — `TODO(#1727)`, no `project_id` on a stub yet), `artisticIntroductionLabel` (with `useProjects().links(record.project_id).artisticIntroductionUrl`), `databaseLabel` (ditto, `.relatedDatabaseUrl`), `overallDatabase: { label, linkLabel } \| false` (`mwnfLinks.overallDatabase`), `onDisplayIn: { linkPendingLabel } \| false` (`record.gallery_references`, by `kind`), `download: false` (default on, `record.action.download`/`.downloadPdf`, prints), `glossary: false` (default on, `GlossaryTool`), `dynasties(record, language, ctx) => { records, tr } \| null` (`DynastyList`), `media: false` (default on, `record.media`, a `SheetSection`), `timeline(record, ctx) => TimelineInfo \| null` (`TimelineLookup` — see `docs/slot-catalogue.md`) | Every `RecordView` slot, forwarded straight through by name, unmodified, **except** `before-sheet`/`museum`/`related`: each always has this view's own default content (above), which a website's own slot still replaces entirely — "a slot fills, the default content renders otherwise" |
@@ -0,0 +1,73 @@
1
+ import { v as e } from "./TimelineEventList-D5Hot788.js";
2
+ import { computed as t, createBlock as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, openBlock as o, renderSlot as s, toDisplayString as c, withCtx as l } from "vue";
3
+ import { useRouter as u } from "vue-router";
4
+ //#region src/content/BackLink.vue
5
+ var d = ["href"], f = {
6
+ class: "mwnf-back-bar__arrow",
7
+ "aria-hidden": "true"
8
+ }, p = {
9
+ key: 1,
10
+ class: "mwnf-back-link"
11
+ }, m = {
12
+ __name: "BackLink",
13
+ props: {
14
+ label: {
15
+ type: String,
16
+ default: "core.action.back"
17
+ },
18
+ to: {
19
+ type: [String, Object],
20
+ default: null
21
+ },
22
+ href: {
23
+ type: String,
24
+ default: ""
25
+ },
26
+ variant: {
27
+ type: String,
28
+ default: "button",
29
+ validator: (e) => ["button", "bar"].includes(e)
30
+ },
31
+ arrow: {
32
+ type: String,
33
+ default: "←"
34
+ }
35
+ },
36
+ setup(m) {
37
+ let h = u(), g = m, _ = t(() => !!(g.to || g.href));
38
+ function v() {
39
+ return window.history.state?.back != null || !_.value && window.history.length > 1;
40
+ }
41
+ function y() {
42
+ v() && h.back();
43
+ }
44
+ let b = t(() => g.to && h ? h.resolve(g.to).href : g.href || (typeof g.to == "string" ? g.to : "") || "#");
45
+ function x(e) {
46
+ e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || (v() ? (e.preventDefault(), h.back()) : g.to && h ? (e.preventDefault(), h.push(g.to)) : _.value || e.preventDefault());
47
+ }
48
+ return (t, u) => m.variant === "bar" ? (o(), r("a", {
49
+ key: 0,
50
+ href: b.value,
51
+ class: "mwnf-back-bar mwnf-back-bar--link",
52
+ onClick: x
53
+ }, [
54
+ i("span", f, c(m.arrow), 1),
55
+ u[0] ||= a(),
56
+ s(t.$slots, "default", {}, () => [a(c(t.$t(m.label)), 1)])
57
+ ], 8, d)) : (o(), r("div", p, [_.value && !v() ? (o(), n(e, {
58
+ key: 0,
59
+ to: m.to,
60
+ href: m.href,
61
+ class: "mwnf-back-link__button"
62
+ }, {
63
+ default: l(() => [a(" ↩ " + c(t.$t(m.label)), 1)]),
64
+ _: 1
65
+ }, 8, ["to", "href"])) : (o(), r("button", {
66
+ key: 1,
67
+ class: "mwnf-back-link__button",
68
+ onClick: y
69
+ }, " ↩ " + c(t.$t(m.label)), 1))]));
70
+ }
71
+ };
72
+ //#endregion
73
+ export { m as t };
@@ -0,0 +1,547 @@
1
+ import { l as e, v as t } from "./TimelineEventList-D5Hot788.js";
2
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, mergeProps as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useSlots as y, vModelSelect as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withKeys as T } from "vue";
3
+ import { useI18n as E } from "@museumwnf/viewer-core/i18n";
4
+ import { md as D, mdInline as O, searchGlossary as ee } from "@museumwnf/viewer-core";
5
+ //#region src/content/SectionCards.vue
6
+ var k = ["innerHTML"], A = ["innerHTML"], te = {
7
+ key: 1,
8
+ class: "mwnf-cards__action"
9
+ }, ne = {
10
+ key: 0,
11
+ class: "mwnf-cards__image-container"
12
+ }, j = ["src", "alt"], M = { class: "mwnf-cards__content" }, N = {
13
+ key: 0,
14
+ class: "mwnf-cards__number"
15
+ }, P = ["innerHTML"], F = ["innerHTML"], I = {
16
+ key: 0,
17
+ class: "mwnf-cards__image-container"
18
+ }, L = ["src", "alt"], R = {
19
+ key: 1,
20
+ class: "mwnf-cards__number"
21
+ }, z = ["innerHTML"], B = {
22
+ key: 3,
23
+ class: "mwnf-cards__details"
24
+ }, V = { class: "mwnf-cards__summary" }, H = {
25
+ key: 0,
26
+ class: "mwnf-cards__number"
27
+ }, U = ["innerHTML"], W = {
28
+ key: 0,
29
+ class: "mwnf-cards__children"
30
+ }, G = {
31
+ __name: "SectionCards",
32
+ props: {
33
+ cards: {
34
+ type: Array,
35
+ default: () => []
36
+ },
37
+ variant: {
38
+ type: String,
39
+ default: "cards",
40
+ validate: (e) => [
41
+ "cards",
42
+ "rows",
43
+ "covers",
44
+ "accordion"
45
+ ].includes(e)
46
+ }
47
+ },
48
+ setup(e) {
49
+ return (r, u) => e.cards.length ? (f(), o("ul", {
50
+ key: 0,
51
+ class: d(["mwnf-cards", `mwnf-cards--${e.variant}`])
52
+ }, [(f(!0), o(n, null, m(e.cards, (r) => (f(), o("li", {
53
+ key: r.href ?? r.title,
54
+ class: d(["mwnf-cards__card"])
55
+ }, [e.variant === "cards" ? (f(), i(t, {
56
+ key: 0,
57
+ class: "mwnf-cards__link",
58
+ to: r.to,
59
+ href: r.href
60
+ }, {
61
+ default: C(() => [
62
+ s("span", {
63
+ class: "mwnf-cards__title",
64
+ innerHTML: v(O)(r.title)
65
+ }, null, 8, k),
66
+ r.description ? (f(), o("span", {
67
+ key: 0,
68
+ class: "mwnf-cards__text",
69
+ innerHTML: v(O)(r.description)
70
+ }, null, 8, A)) : a("", !0),
71
+ r.action ? (f(), o("span", te, _(r.action) + " →", 1)) : a("", !0)
72
+ ]),
73
+ _: 2
74
+ }, 1032, ["to", "href"])) : e.variant === "rows" ? (f(), i(t, {
75
+ key: 1,
76
+ class: "mwnf-cards__link",
77
+ to: r.to,
78
+ href: r.href
79
+ }, {
80
+ default: C(() => [r.image ? (f(), o("div", ne, [s("img", {
81
+ class: "mwnf-cards__image",
82
+ src: r.image,
83
+ alt: r.alt || ""
84
+ }, null, 8, j)])) : a("", !0), s("div", M, [
85
+ r.number ? (f(), o("span", N, _(r.number), 1)) : a("", !0),
86
+ s("span", {
87
+ class: "mwnf-cards__title",
88
+ innerHTML: v(O)(r.title)
89
+ }, null, 8, P),
90
+ r.description ? (f(), o("span", {
91
+ key: 1,
92
+ class: "mwnf-cards__text",
93
+ innerHTML: v(O)(r.description)
94
+ }, null, 8, F)) : a("", !0)
95
+ ])]),
96
+ _: 2
97
+ }, 1032, ["to", "href"])) : e.variant === "covers" ? (f(), i(t, {
98
+ key: 2,
99
+ class: "mwnf-cards__link",
100
+ to: r.to,
101
+ href: r.href
102
+ }, {
103
+ default: C(() => [
104
+ r.image ? (f(), o("div", I, [s("img", {
105
+ class: "mwnf-cards__image",
106
+ src: r.image,
107
+ alt: r.alt || ""
108
+ }, null, 8, L)])) : a("", !0),
109
+ r.number ? (f(), o("span", R, _(r.number), 1)) : a("", !0),
110
+ s("span", {
111
+ class: "mwnf-cards__title",
112
+ innerHTML: v(O)(r.title)
113
+ }, null, 8, z)
114
+ ]),
115
+ _: 2
116
+ }, 1032, ["to", "href"])) : e.variant === "accordion" ? (f(), o("details", B, [s("summary", V, [r.number ? (f(), o("span", H, _(r.number), 1)) : a("", !0), s("span", {
117
+ class: "mwnf-cards__title",
118
+ innerHTML: v(O)(r.title)
119
+ }, null, 8, U)]), r.children?.length ? (f(), o("ul", W, [(f(!0), o(n, null, m(r.children, (e) => (f(), o("li", {
120
+ key: e.href ?? e.title,
121
+ class: "mwnf-cards__child"
122
+ }, [l(t, {
123
+ class: "mwnf-cards__child-link",
124
+ to: e.to,
125
+ href: e.href
126
+ }, {
127
+ default: C(() => [c(_(e.title), 1)]),
128
+ _: 2
129
+ }, 1032, ["to", "href"])]))), 128))])) : a("", !0)])) : a("", !0)]))), 128))], 2)) : a("", !0);
130
+ }
131
+ }, K = {
132
+ key: 0,
133
+ class: "mwnf-featured"
134
+ }, q = {
135
+ key: 0,
136
+ class: "mwnf-featured__heading"
137
+ }, J = {
138
+ key: 0,
139
+ class: "mwnf-featured__media"
140
+ }, Y = ["src", "alt"], X = { class: "mwnf-featured__body" }, Z = {
141
+ key: 0,
142
+ class: "mwnf-featured__eyebrow"
143
+ }, re = ["innerHTML"], ie = {
144
+ key: 1,
145
+ class: "mwnf-featured__action"
146
+ }, ae = {
147
+ __name: "FeaturedRecord",
148
+ props: {
149
+ image: {
150
+ type: String,
151
+ default: ""
152
+ },
153
+ imageAlt: {
154
+ type: String,
155
+ default: ""
156
+ },
157
+ eyebrow: {
158
+ type: String,
159
+ default: ""
160
+ },
161
+ name: {
162
+ type: String,
163
+ default: ""
164
+ },
165
+ meta: {
166
+ type: Array,
167
+ default: () => []
168
+ },
169
+ action: {
170
+ type: String,
171
+ default: ""
172
+ },
173
+ to: {
174
+ type: [String, Object],
175
+ default: null
176
+ },
177
+ href: {
178
+ type: String,
179
+ default: ""
180
+ },
181
+ heading: {
182
+ type: String,
183
+ default: ""
184
+ }
185
+ },
186
+ setup(e) {
187
+ let i = e, c = y(), u = r(() => !!(i.name || i.image || c.default));
188
+ return (r, i) => u.value ? (f(), o("section", K, [e.heading ? (f(), o("h2", q, _(e.heading), 1)) : a("", !0), h(r.$slots, "default", {}, () => [l(t, {
189
+ class: "mwnf-featured__link",
190
+ to: e.to,
191
+ href: e.href
192
+ }, {
193
+ default: C(() => [e.image ? (f(), o("span", J, [s("img", {
194
+ class: "mwnf-featured__image",
195
+ src: e.image,
196
+ alt: e.imageAlt,
197
+ loading: "eager"
198
+ }, null, 8, Y)])) : a("", !0), s("span", X, [
199
+ e.eyebrow ? (f(), o("span", Z, _(e.eyebrow), 1)) : a("", !0),
200
+ s("span", {
201
+ class: "mwnf-featured__name",
202
+ innerHTML: e.name
203
+ }, null, 8, re),
204
+ (f(!0), o(n, null, m(e.meta, (e, t) => (f(), o("span", {
205
+ key: t,
206
+ class: "mwnf-featured__meta"
207
+ }, _(e), 1))), 128)),
208
+ e.action ? (f(), o("span", ie, _(e.action) + " →", 1)) : a("", !0)
209
+ ])]),
210
+ _: 1
211
+ }, 8, ["to", "href"])])])) : a("", !0);
212
+ }
213
+ }, oe = ["dir"], se = { class: "mwnf-glossary-tool__toggle" }, ce = { class: "mwnf-glossary-tool__panel" }, le = { class: "mwnf-glossary-tool__heading" }, ue = { class: "mwnf-glossary-tool__instructions" }, de = ["aria-expanded", "aria-label"], fe = {
214
+ key: 0,
215
+ class: "mwnf-glossary-tool__hits",
216
+ role: "listbox"
217
+ }, pe = [
218
+ "aria-selected",
219
+ "onClick",
220
+ "onKeydown"
221
+ ], me = {
222
+ key: 1,
223
+ class: "mwnf-glossary-tool__no-results"
224
+ }, he = {
225
+ key: 2,
226
+ class: "mwnf-glossary-tool__definition"
227
+ }, ge = { class: "mwnf-glossary-tool__definition-label" }, _e = ["innerHTML"], ve = {
228
+ __name: "GlossaryTool",
229
+ props: {
230
+ language: {
231
+ type: String,
232
+ default: ""
233
+ },
234
+ entity: {
235
+ type: String,
236
+ default: "glossary"
237
+ },
238
+ labels: {
239
+ type: Object,
240
+ default: () => ({})
241
+ },
242
+ dir: {
243
+ type: String,
244
+ default: ""
245
+ }
246
+ },
247
+ setup(e) {
248
+ let t = e, i = {
249
+ tool: "record.glossary.tool",
250
+ heading: "record.glossary.heading",
251
+ instructions: "record.glossary.instructions",
252
+ definition: "record.glossary.definition",
253
+ close: "record.glossary.close",
254
+ ...t.labels
255
+ }, { t: c } = E(), l = p(""), u = p(null), h = p(-1), g = r(() => l.value.trim() ? ee(l.value, t.language, { entity: t.entity }) : []), y = r(() => g.value.length > 0 && !u.value), b = r(() => u.value ? D(u.value.definition) : ""), S = r(() => i.noResults ? c(i.noResults) : ""), C = r(() => !!S.value && l.value.trim() && !u.value && g.value.length === 0);
256
+ function O() {
257
+ u.value = null, h.value = -1;
258
+ }
259
+ function k(e) {
260
+ u.value = e, l.value = e.spelling, h.value = -1;
261
+ }
262
+ function A(e) {
263
+ y.value && (e.key === "ArrowDown" ? (e.preventDefault(), h.value = (h.value + 1) % g.value.length) : e.key === "ArrowUp" ? (e.preventDefault(), h.value = (h.value - 1 + g.value.length) % g.value.length) : e.key === "Enter" && h.value >= 0 ? (e.preventDefault(), k(g.value[h.value])) : e.key === "Escape" && (h.value = -1));
264
+ }
265
+ return (t, r) => (f(), o("details", {
266
+ class: "mwnf-glossary-tool",
267
+ dir: e.dir || void 0
268
+ }, [s("summary", se, _(v(c)(i.tool)), 1), s("div", ce, [
269
+ s("p", le, _(v(c)(i.heading)), 1),
270
+ s("p", ue, _(v(c)(i.instructions)), 1),
271
+ w(s("input", {
272
+ "onUpdate:modelValue": r[0] ||= (e) => l.value = e,
273
+ type: "text",
274
+ class: "mwnf-glossary-tool__input",
275
+ role: "combobox",
276
+ "aria-autocomplete": "list",
277
+ "aria-expanded": y.value,
278
+ "aria-label": v(c)(i.heading),
279
+ onInput: O,
280
+ onKeydown: A
281
+ }, null, 40, de), [[x, l.value]]),
282
+ y.value ? (f(), o("ul", fe, [(f(!0), o(n, null, m(g.value, (e, t) => (f(), o("li", {
283
+ key: e.id,
284
+ role: "option",
285
+ "aria-selected": t === h.value,
286
+ tabindex: "0",
287
+ class: d(["mwnf-glossary-tool__hit", { "mwnf-glossary-tool__hit--active": t === h.value }]),
288
+ onClick: (t) => k(e),
289
+ onKeydown: T((t) => k(e), ["enter"])
290
+ }, _(e.spelling), 43, pe))), 128))])) : C.value ? (f(), o("p", me, _(S.value), 1)) : a("", !0),
291
+ u.value ? (f(), o("div", he, [s("p", ge, _(v(c)(i.definition)), 1), s("div", {
292
+ class: "mwnf-sheet__block",
293
+ innerHTML: b.value
294
+ }, null, 8, _e)])) : a("", !0)
295
+ ])], 8, oe));
296
+ }
297
+ }, ye = ["dir"], be = ["innerHTML"], xe = { class: "mwnf-dynasty__body" }, Se = { class: "mwnf-dynasty__eyebrow" }, Ce = {
298
+ key: 0,
299
+ class: "mwnf-dynasty__field"
300
+ }, we = { class: "mwnf-dynasty__label" }, Te = {
301
+ key: 1,
302
+ class: "mwnf-dynasty__field"
303
+ }, Ee = { class: "mwnf-dynasty__label" }, De = {
304
+ key: 2,
305
+ class: "mwnf-dynasty__dates"
306
+ }, Oe = {
307
+ key: 3,
308
+ class: "mwnf-dynasty__history"
309
+ }, ke = { class: "mwnf-dynasty__label" }, Ae = ["innerHTML"], Q = {
310
+ __name: "DynastyPopout",
311
+ props: {
312
+ dynasty: {
313
+ type: Object,
314
+ required: !0
315
+ },
316
+ text: {
317
+ type: Object,
318
+ default: () => ({})
319
+ },
320
+ dir: {
321
+ type: String,
322
+ default: ""
323
+ }
324
+ },
325
+ setup(e) {
326
+ let t = e, { t: n } = E(), i = r(() => {
327
+ let { from_ad: e, to_ad: n, from_ah: r, to_ah: i } = t.dynasty ?? {};
328
+ return e == null && n == null ? "" : `${r != null || i != null ? `AH ${r ?? "?"}–${i ?? "?"} / ` : ""}AD ${e ?? "?"}–${n ?? "?"}`;
329
+ });
330
+ return (t, r) => (f(), o("details", {
331
+ class: "mwnf-dynasty",
332
+ dir: e.dir || void 0
333
+ }, [s("summary", {
334
+ class: "mwnf-dynasty__summary",
335
+ innerHTML: v(O)(e.text.name || e.dynasty.id)
336
+ }, null, 8, be), s("div", xe, [
337
+ s("p", Se, _(v(n)("record.dynasty.heading")), 1),
338
+ e.text.also_known_as ? (f(), o("p", Ce, [s("span", we, _(v(n)("sheet.field.alsoKnownAs")) + ":", 1), c(" " + _(e.text.also_known_as), 1)])) : a("", !0),
339
+ e.text.area ? (f(), o("p", Te, [s("span", Ee, _(v(n)("sheet.field.area")) + ":", 1), c(" " + _(e.text.area), 1)])) : a("", !0),
340
+ i.value ? (f(), o("p", De, _(i.value), 1)) : a("", !0),
341
+ e.text.history ? (f(), o("div", Oe, [s("p", ke, _(v(n)("sheet.field.history")), 1), s("div", {
342
+ class: "mwnf-sheet__block",
343
+ innerHTML: v(D)(e.text.history)
344
+ }, null, 8, Ae)])) : a("", !0)
345
+ ])], 8, ye));
346
+ }
347
+ }, je = ["dir"], Me = {
348
+ key: 0,
349
+ class: "mwnf-dynasty-list__heading"
350
+ }, Ne = {
351
+ __name: "DynastyList",
352
+ props: {
353
+ heading: {
354
+ type: String,
355
+ default: ""
356
+ },
357
+ dynasties: {
358
+ type: Array,
359
+ default: () => []
360
+ },
361
+ tr: {
362
+ type: Function,
363
+ default: null
364
+ },
365
+ dir: {
366
+ type: String,
367
+ default: ""
368
+ }
369
+ },
370
+ setup(e) {
371
+ return (t, r) => e.dynasties.length ? (f(), o("section", {
372
+ key: 0,
373
+ class: "mwnf-dynasty-list",
374
+ dir: e.dir || void 0
375
+ }, [e.heading ? (f(), o("h2", Me, _(e.heading), 1)) : a("", !0), (f(!0), o(n, null, m(e.dynasties, (t) => (f(), i(Q, {
376
+ key: t.id,
377
+ dynasty: t,
378
+ text: e.tr ? e.tr(t) : t,
379
+ dir: e.dir
380
+ }, null, 8, [
381
+ "dynasty",
382
+ "text",
383
+ "dir"
384
+ ]))), 128))], 8, je)) : a("", !0);
385
+ }
386
+ }, Pe = { class: "mwnf-sheet-timeline" }, Fe = {
387
+ key: 0,
388
+ class: "mwnf-sheet-timeline__popout",
389
+ dir: "ltr"
390
+ }, Ie = ["aria-label"], Le = { class: "mwnf-sheet-timeline__title" }, Re = { class: "mwnf-sheet-timeline__option" }, ze = ["value"], Be = { class: "mwnf-sheet-timeline__scroll" }, Ve = { class: "mwnf-sheet-timeline__subheader" }, $ = {
391
+ key: 0,
392
+ class: "mwnf-sheet-timeline__empty"
393
+ }, He = { class: "mwnf-sheet-timeline__date" }, Ue = ["innerHTML"], We = {
394
+ __name: "TimelineLookup",
395
+ props: { info: {
396
+ type: Object,
397
+ required: !0
398
+ } },
399
+ setup(e) {
400
+ let i = e, { t: u } = E(), d = p(!1), h = p(i.info.defaultCountry ? i.info.defaultCountry() : "all");
401
+ S(() => i.info, (e) => {
402
+ h.value = e.defaultCountry ? e.defaultCountry() : "all";
403
+ });
404
+ let g = r(() => i.info.range ?? [null, null]), y = r(() => i.info.events(h.value)), x = r(() => i.info.countries.find((e) => e.value === h.value)?.label ?? ""), T = (e) => i.info.era ? i.info.era(e) : String(e ?? "");
405
+ return (r, i) => (f(), o("div", Pe, [s("p", {
406
+ class: "mwnf-sheet-timeline__trigger",
407
+ onClick: i[0] ||= (e) => d.value = !d.value
408
+ }, "➤ " + _(v(u)(e.info.trigger ?? "record.related.timelineForItem")), 1), d.value ? (f(), o("div", Fe, [
409
+ s("button", {
410
+ type: "button",
411
+ class: "mwnf-sheet-timeline__close",
412
+ "aria-label": v(u)("core.action.close"),
413
+ onClick: i[1] ||= (e) => d.value = !1
414
+ }, "✕", 8, Ie),
415
+ s("p", Le, _(v(u)(e.info.heading)), 1),
416
+ s("div", Re, [w(s("select", {
417
+ "onUpdate:modelValue": i[2] ||= (e) => h.value = e,
418
+ class: "mwnf-sheet-timeline__select"
419
+ }, [(f(!0), o(n, null, m(e.info.countries, (e) => (f(), o("option", {
420
+ key: e.value,
421
+ value: e.value
422
+ }, _(e.label), 9, ze))), 128))], 512), [[b, h.value]]), l(t, {
423
+ class: "mwnf-sheet-timeline__link",
424
+ to: e.info.searchTo(h.value, g.value)
425
+ }, {
426
+ default: C(() => [c("➤ " + _(v(u)("timeline.action.beginFullSearch")), 1)]),
427
+ _: 1
428
+ }, 8, ["to"])]),
429
+ s("div", Be, [
430
+ s("p", Ve, _(x.value) + ", " + _(T(g.value[0])) + " – " + _(T(g.value[1])), 1),
431
+ y.value.length ? a("", !0) : (f(), o("p", $, _(v(u)("timeline.results.noEvents")), 1)),
432
+ (f(!0), o(n, null, m(y.value, (e, t) => (f(), o("div", {
433
+ key: e.id ?? t,
434
+ class: "mwnf-sheet-timeline__event"
435
+ }, [s("div", He, _(T(e.year_from)), 1), s("div", {
436
+ class: "mwnf-sheet-timeline__description",
437
+ innerHTML: v(D)(e.text.description)
438
+ }, null, 8, Ue)]))), 128))
439
+ ])
440
+ ])) : a("", !0)]));
441
+ }
442
+ }, Ge = ["href"], Ke = {
443
+ key: 0,
444
+ class: "mwnf-related-media__description"
445
+ }, qe = {
446
+ __name: "RelatedMedia",
447
+ props: {
448
+ media: {
449
+ type: Array,
450
+ default: () => []
451
+ },
452
+ language: {
453
+ type: String,
454
+ default: ""
455
+ },
456
+ descriptions: {
457
+ type: Boolean,
458
+ default: !0
459
+ },
460
+ heading: {
461
+ type: String,
462
+ default: "record.related.audioVideo"
463
+ },
464
+ dir: {
465
+ type: String,
466
+ default: ""
467
+ }
468
+ },
469
+ setup(t) {
470
+ let c = t, { t: l } = E(), u = r(() => {
471
+ let e = c.media.filter((e) => e?.url);
472
+ if (!c.language) return e;
473
+ let t = e.filter((e) => e.language === c.language);
474
+ return t.length ? t : e;
475
+ });
476
+ return (r, c) => u.value.length ? (f(), i(e, {
477
+ key: 0,
478
+ heading: t.heading ? v(l)(t.heading) : "",
479
+ dir: t.dir,
480
+ class: "mwnf-related-media"
481
+ }, {
482
+ default: C(() => [(f(!0), o(n, null, m(u.value, (e) => (f(), o("div", {
483
+ key: e.url,
484
+ class: "mwnf-related-media__entry"
485
+ }, [s("a", {
486
+ href: e.url,
487
+ target: "_blank",
488
+ rel: "noopener",
489
+ class: "mwnf-related-media__link"
490
+ }, "↗ " + _(e.title || e.url), 9, Ge), t.descriptions && e.description ? (f(), o("p", Ke, _(e.description), 1)) : a("", !0)]))), 128))]),
491
+ _: 1
492
+ }, 8, ["heading", "dir"])) : a("", !0);
493
+ }
494
+ }, Je = {
495
+ key: 0,
496
+ class: "mwnf-on-display__subheading"
497
+ }, Ye = { class: "mwnf-on-display__list" }, Xe = ["innerHTML"], Ze = ["innerHTML"], Qe = { class: "mwnf-on-display__pending" }, $e = {
498
+ __name: "OnDisplayIn",
499
+ props: {
500
+ groups: {
501
+ type: Array,
502
+ default: () => []
503
+ },
504
+ heading: {
505
+ type: String,
506
+ default: "record.related.onDisplayIn"
507
+ },
508
+ pendingLabel: {
509
+ type: String,
510
+ default: ""
511
+ },
512
+ dir: {
513
+ type: String,
514
+ default: ""
515
+ }
516
+ },
517
+ setup(l) {
518
+ let d = l, { t: p } = E(), h = r(() => d.groups.filter((e) => e.links?.length));
519
+ return (r, d) => h.value.length ? (f(), i(g(l.heading ? e : "div"), u({ key: 0 }, l.heading ? { heading: v(p)(l.heading) } : {}, {
520
+ dir: l.dir || void 0,
521
+ class: "mwnf-on-display"
522
+ }), {
523
+ default: C(() => [(f(!0), o(n, null, m(h.value, (e, r) => (f(), o("div", {
524
+ key: e.heading ?? r,
525
+ class: "mwnf-on-display__group"
526
+ }, [e.heading ? (f(), o("p", Je, _(v(p)(e.heading)), 1)) : a("", !0), s("ul", Ye, [(f(!0), o(n, null, m(e.links, (e, r) => (f(), o("li", {
527
+ key: e.id ?? r,
528
+ class: "mwnf-on-display__item"
529
+ }, [e.to || e.href ? (f(), i(t, {
530
+ key: 0,
531
+ to: e.to,
532
+ href: e.href,
533
+ external: !!e.external
534
+ }, {
535
+ default: C(() => [e.external ? (f(), o(n, { key: 0 }, [c("↗ ")], 64)) : a("", !0), s("span", { innerHTML: e.label }, null, 8, Xe)]),
536
+ _: 2
537
+ }, 1032, [
538
+ "to",
539
+ "href",
540
+ "external"
541
+ ])) : (f(), o(n, { key: 1 }, [s("span", { innerHTML: e.label }, null, 8, Ze), l.pendingLabel ? (f(), o(n, { key: 0 }, [d[0] ||= c(_(" "), -1), s("span", Qe, _(v(p)(l.pendingLabel)), 1)], 64)) : a("", !0)], 64))]))), 128))])]))), 128))]),
542
+ _: 1
543
+ }, 16, ["dir"])) : a("", !0);
544
+ }
545
+ };
546
+ //#endregion
547
+ export { Q as a, G as c, Ne as i, qe as n, ve as o, We as r, ae as s, $e as t };