@museumwnf/viewer-layout 2.17.0 → 3.0.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.
@@ -1,154 +1,2 @@
1
- import { t as e } from "./PageShell-CbJ9lQoQ.js";
2
- import { computed as t, createBlock as n, createSlots as r, mergeProps as i, openBlock as a, renderSlot as o, withCtx as s } from "vue";
3
- import { useI18n as c, useSection as l, useSiteConfig as u, useSiteRights as d } from "@museumwnf/viewer-core";
4
- import { useRouter as f } from "vue-router";
5
- //#region src/components/SiteShell.vue
6
- var p = /*@__PURE__*/ Object.assign({ inheritAttrs: !1 }, {
7
- __name: "SiteShell",
8
- props: {
9
- config: {
10
- type: Object,
11
- default: null
12
- },
13
- logos: {
14
- type: Array,
15
- default: () => []
16
- }
17
- },
18
- setup(p) {
19
- let m = p, { t: h, locale: g } = c(), _ = f(), v = l(), y = u(), b = t(() => ({
20
- ...y,
21
- ...m.config ?? {}
22
- })), x = t(() => b.value.navigation ?? {}), S = t(() => b.value.logos ?? null), C = t(() => b.value.banner ?? null), w = d(), T = t(() => w.holder ? {
23
- label: h("record.source.rightsHolder"),
24
- text: w.attribution ?? w.holder,
25
- termsHref: w.termsUrl,
26
- termsLabel: h("record.source.termsOfUse")
27
- } : null);
28
- function E(e) {
29
- return e.href ? e.href : e.to ? _.resolve(e.to).href : "";
30
- }
31
- function D(e) {
32
- return typeof e.when != "function" || !!e.when({
33
- section: v.value,
34
- locale: g.value
35
- });
36
- }
37
- function O(e, { active: t = !1 } = {}) {
38
- let n = {
39
- label: h(e.label),
40
- href: E(e),
41
- external: !!e.external
42
- };
43
- return t && (n.active = e.section === v.value), n;
44
- }
45
- let k = t(() => Array.isArray(x.value.links) ? x.value.links.filter(D).map((e) => O(e, { active: !0 })) : null), A = t(() => Array.isArray(x.value.headerLinks) ? x.value.headerLinks.map((e) => O(e)) : null), j = t(() => Array.isArray(x.value.footerLinks) ? x.value.footerLinks.map((e) => O(e)) : null), M = t(() => {
46
- let e = x.value.search;
47
- return e ? {
48
- placeholder: e.placeholder ? h(e.placeholder) : "",
49
- submitLabel: e.submitLabel ? h(e.submitLabel) : ""
50
- } : null;
51
- });
52
- function N(e) {
53
- let t = x.value.search;
54
- t?.route && _.push({
55
- name: t.route,
56
- query: { [t.key ?? "q"]: e || t.empty || "" }
57
- });
58
- }
59
- function P(e) {
60
- return typeof e == "function" ? e({
61
- section: v.value,
62
- locale: g.value,
63
- t: h
64
- }) : typeof e == "string" ? h(e) : e;
65
- }
66
- let F = t(() => {
67
- let e = C.value ? P(C.value.title) : "";
68
- if (e) return e;
69
- let t = x.value.sectionTitles?.[v.value];
70
- return t ? h(t) : "";
71
- }), I = [
72
- "variant",
73
- "image",
74
- "imageAlt",
75
- "caption",
76
- "captionLabel",
77
- "subtitle",
78
- "headline",
79
- "enter",
80
- "strapline"
81
- ], L = t(() => {
82
- let e = {};
83
- F.value && (e.bannerTitle = F.value);
84
- for (let t of I) {
85
- let n = C.value ? P(C.value[t]) : "";
86
- n && (e[`banner${t[0].toUpperCase()}${t.slice(1)}`] = n);
87
- }
88
- return e;
89
- }), R = t(() => {
90
- let e = S.value?.header;
91
- return typeof e == "function" ? m.logos.filter(e) : null;
92
- }), z = t(() => {
93
- let e = S.value?.headerTitle;
94
- return e && R.value?.length ? h(e) : "";
95
- }), B = t(() => {
96
- let e = S.value?.sponsorGroups;
97
- return typeof e == "function" ? e(m.logos, h) : null;
98
- }), V = t(() => {
99
- let e = { ...L.value };
100
- return Array.isArray(x.value.languages) && (e.languages = x.value.languages), k.value && (e.navLinks = k.value), A.value && (e.headerLinks = A.value), j.value && (e.footerLinks = j.value), M.value && (e.search = M.value), R.value && (e.headerLogos = R.value, z.value && (e.headerLogosTitle = z.value)), B.value && (e.sponsorGroups = B.value), T.value && (e.footerAttributionLabel = T.value.label, e.footerAttributionText = T.value.text, e.footerTermsHref = T.value.termsHref, e.footerTermsLabel = T.value.termsLabel), e;
101
- });
102
- return (t, c) => (a(), n(e, i({
103
- ...t.$attrs,
104
- ...V.value
105
- }, { onSearch: N }), r({ _: 2 }, [
106
- t.$slots.header ? {
107
- name: "header",
108
- fn: s(() => [o(t.$slots, "header")]),
109
- key: "0"
110
- } : void 0,
111
- t.$slots.brand ? {
112
- name: "header-brand",
113
- fn: s(() => [o(t.$slots, "brand")]),
114
- key: "1"
115
- } : void 0,
116
- t.$slots.banner ? {
117
- name: "banner",
118
- fn: s(() => [o(t.$slots, "banner")]),
119
- key: "2"
120
- } : void 0,
121
- t.$slots.navigation ? {
122
- name: "navigation",
123
- fn: s(() => [o(t.$slots, "navigation")]),
124
- key: "3"
125
- } : void 0,
126
- t.$slots.default || t.$slots.notice || t.$slots["after-content"] ? {
127
- name: "default",
128
- fn: s(() => [
129
- o(t.$slots, "notice"),
130
- o(t.$slots, "default"),
131
- o(t.$slots, "after-content")
132
- ]),
133
- key: "4"
134
- } : void 0,
135
- t.$slots.hyperlinks ? {
136
- name: "hyperlinks",
137
- fn: s(() => [o(t.$slots, "hyperlinks")]),
138
- key: "5"
139
- } : void 0,
140
- t.$slots.sponsors ? {
141
- name: "sponsors",
142
- fn: s(() => [o(t.$slots, "sponsors")]),
143
- key: "6"
144
- } : void 0,
145
- t.$slots.footer ? {
146
- name: "footer",
147
- fn: s(() => [o(t.$slots, "footer")]),
148
- key: "7"
149
- } : void 0
150
- ]), 1040));
151
- }
152
- });
153
- //#endregion
154
- export { p as SiteShell };
1
+ import { t as e } from "./SiteShell-C3OgZO8p.js";
2
+ export { e as SiteShell };
@@ -0,0 +1,84 @@
1
+ import "./FeaturedRecord-Dw6uf3ax.js";
2
+ import { a as e, l as t } from "./TimelineEventList-BhkWyY5-.js";
3
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, openBlock as c, renderList as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
4
+ import { useI18n as p } from "@museumwnf/viewer-core/i18n";
5
+ import { md as m, mdInline as h } from "@museumwnf/viewer-core";
6
+ //#region src/content/SpecialFeatures.vue
7
+ var g = ["innerHTML"], _ = ["innerHTML"], v = {
8
+ __name: "SpecialFeatures",
9
+ props: {
10
+ features: {
11
+ type: Array,
12
+ default: () => []
13
+ },
14
+ tr: {
15
+ type: Function,
16
+ default: () => ({})
17
+ },
18
+ language: {
19
+ type: String,
20
+ default: ""
21
+ },
22
+ glossary: { default: void 0 },
23
+ heading: {
24
+ type: String,
25
+ default: "sheet.field.specialFeatures"
26
+ },
27
+ dir: {
28
+ type: String,
29
+ default: ""
30
+ }
31
+ },
32
+ setup(v) {
33
+ let y = v, { t: b } = p(), x = r(() => [...y.features].sort((e, t) => (e.display_order ?? Infinity) - (t.display_order ?? Infinity)).map((e) => {
34
+ let t = y.tr(e) ?? {};
35
+ return {
36
+ id: e.id,
37
+ name: h(t.name ?? e.internal_name ?? e.id),
38
+ meta: [
39
+ t.location,
40
+ t.dates,
41
+ (e.artist_names ?? []).join(", ")
42
+ ].filter(Boolean),
43
+ description: m(t.description, { glossary: y.glossary }),
44
+ images: (e.images ?? []).map((e) => ({
45
+ url: e.url,
46
+ alt: e.captions?.[y.language] ?? ""
47
+ }))
48
+ };
49
+ }));
50
+ return (r, p) => x.value.length ? (c(), i(t, {
51
+ key: 0,
52
+ heading: v.heading ? d(b)(v.heading) : "",
53
+ dir: v.dir,
54
+ class: "mwnf-special-features"
55
+ }, {
56
+ default: f(() => [(c(!0), o(n, null, l(x.value, (t) => (c(), o("div", {
57
+ key: t.id,
58
+ class: "mwnf-special-features__item"
59
+ }, [
60
+ s("h3", {
61
+ class: "mwnf-special-features__name",
62
+ innerHTML: t.name
63
+ }, null, 8, g),
64
+ (c(!0), o(n, null, l(t.meta, (e, t) => (c(), o("p", {
65
+ key: t,
66
+ class: "mwnf-special-features__meta"
67
+ }, u(e), 1))), 128)),
68
+ t.description ? (c(), o("div", {
69
+ key: 0,
70
+ class: "mwnf-special-features__description mwnf-sheet__block",
71
+ innerHTML: t.description
72
+ }, null, 8, _)) : a("", !0),
73
+ t.images.length ? (c(), i(e, {
74
+ key: 1,
75
+ images: t.images,
76
+ variant: "row"
77
+ }, null, 8, ["images"])) : a("", !0)
78
+ ]))), 128))]),
79
+ _: 1
80
+ }, 8, ["heading", "dir"])) : a("", !0);
81
+ }
82
+ };
83
+ //#endregion
84
+ export { v as t };
package/dist/content.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./OnDisplayIn-ZfRUtPd1.js";
2
- import { _ as c, a as l, c as u, d, f, g as p, h as m, i as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w } from "./TimelineEventList-D5Hot788.js";
3
- import { a as T, i as E, n as D, o as O, r as k, t as A } from "./content-CvUktO-g.js";
4
- import { t as j } from "./BackLink-CYgmd0iX.js";
5
- export { j as BackLink, n as DynastyList, e as DynastyPopout, _ as FacetSelect, O as FeaturedPartners, o as FeaturedRecord, b as FilterPanel, h as GlossaryPopover, i as GlossaryTool, l as MediaGallery, s as OnDisplayIn, m as Pagination, x as PartnerMap, v as PartnerPanel, k as PictureGallery, D as PictureNarrative, E as PopupLogo, u as RecordCredits, p as RecordGrid, d as RecordLanguages, c as RecordList, w as RecordSheet, r as RelatedMedia, y as RelatedRecords, f as ResultsSummary, t as SectionCards, g as SheetSection, T as SiblingGalleries, S as SourceCredit, A as SpecialFeatures, C as TimelineEventList, a as TimelineLookup };
1
+ import { t as e } from "./FeaturedRecord-Dw6uf3ax.js";
2
+ import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v } from "./TimelineEventList-BhkWyY5-.js";
3
+ import { a as y, i as b, n as x, o as S, r as C, s as w, t as T } from "./OnDisplayIn-eSG5r48j.js";
4
+ import { t as E } from "./content-BxaDJIvY.js";
5
+ export { w as BackLink, b as DynastyList, y as DynastyPopout, u as FacetSelect, e as FeaturedRecord, p as FilterPanel, c as GlossaryPopover, S as GlossaryTool, n as MediaGallery, T as OnDisplayIn, s as Pagination, m as PartnerMap, d as PartnerPanel, r as RecordCredits, o as RecordGrid, i as RecordLanguages, t as RecordList, _ as RecordSheet, x as RelatedMedia, f as RelatedRecords, a as ResultsSummary, v as SectionCards, l as SheetSection, h as SourceCredit, E as SpecialFeatures, g as TimelineEventList, C as TimelineLookup };
@@ -0,0 +1,33 @@
1
+ import { partnerView as e } from "@museumwnf/viewer-core";
2
+ import { FACET_CATEGORIES as t, FACET_LABEL_KEYS as n, PAGE_SIZE as r, useExhibitionCollection as i, useExhibitionData as a, useExhibitionItemDetail as o, useExhibitionPartner as s, useExhibitionThemes as c, useExhibitionTimeline as l, useFacetLabels as u } from "@museumwnf/viewer-core/dxa";
3
+ //#region src/dxa/exhibition/data.js
4
+ var d = a(), f = i(d), p = l(d, f), m = s(d), h = c(d), { itemDetail: g } = o(d, p), { defaultLang: _, tr: v, md: y, mdInline: b, mdStrip: x, labelOf: S, loadEnglish: C, exhibition: w, relatedContent: T, items: E, itemById: D, countries: O, timelines: k, visiblePartners: A, visiblePartnerById: j, isHiddenPartner: M, itemRoute: N, partnerRoute: P, partnerObjectsRoute: F, chromeImage: I, countryLabelFromCode: L, exhibitionTitle: R, exhibitionSubtitle: z, exhibitionHeadline: B, bannerCaption: V } = d, { FACETS: H, haystack: U, tile: W, collectionResults: G, countryIdForCode: K } = f, { hasTimeline: q, timelineSpec: J, timelineGallerySpec: Y } = p, { partnerListSpec: X, partnerSheetSpec: Z } = m, Q = {
5
+ countryLabel: (e) => S("countries", e),
6
+ md: y,
7
+ mdInline: b,
8
+ route: P,
9
+ objectsRoute: F,
10
+ hidden: M
11
+ }, $ = {
12
+ spec: {
13
+ ...Z,
14
+ media: () => []
15
+ },
16
+ visible: (e) => !!j(e),
17
+ view: (t, n) => e(t, {
18
+ ...v("partners", t.id, _),
19
+ ...n
20
+ }, Q),
21
+ labels: {
22
+ partner: {
23
+ objects: "partner.action.viewObjects",
24
+ homepage: "partner.nav.homepage"
25
+ },
26
+ institution: {
27
+ objects: "exhibition.action.viewItems",
28
+ homepage: "exhibition.action.institutionHomepage"
29
+ }
30
+ }
31
+ };
32
+ //#endregion
33
+ export { h as A, y as C, F as D, X as E, v as F, u as I, j as L, Y as M, J as N, P as O, k as P, A as R, C as S, $ as T, U as _, V as a, E as b, O as c, _ as d, w as f, q as g, R as h, r as i, W as j, T as k, K as l, z as m, t as n, I as o, B as p, n as r, G as s, H as t, L as u, D as v, x as w, S as x, g as y };
@@ -0,0 +1,35 @@
1
+ import { partnerView as e } from "@museumwnf/viewer-core";
2
+ import { FACET_CATEGORIES as t, FACET_LABEL_KEYS as n, PAGE_SIZE as r, useFacetLabels as i, useGalleryCollection as a, useGalleryData as o, useGalleryItemDetail as s, useGalleryPartner as c, useGalleryTimeline as l } from "@museumwnf/viewer-core/dxa";
3
+ //#region src/dxa/gallery/data.js
4
+ var u = o(), d = a(u), f = l(u, d), p = c(u, d), { itemDetail: m } = s(u, f), { manifest: h, defaultLang: g, tr: _, md: v, mdInline: y, loadEnglish: b, labelOf: x, gallery: S, items: C, itemById: w, partners: T, countries: E, timelines: D, partnerById: O, itemRoute: k, partnerRoute: A, partnerObjectsRoute: j, itemFromUidPath: M, partnerFromKey: N, chromeImage: P, pickSiblings: F, siblingUrl: I } = u, { FACETS: L, haystack: R, tile: z, collectionResults: B, countryIdForCode: V } = d, { timelineResults: H, timelineGallery: U } = f, { partnerList: W, partnerSheet: G, partnerObjects: K } = p, q = {
5
+ countryLabel: (e) => x("countries", e),
6
+ md: v,
7
+ mdInline: y,
8
+ route: A,
9
+ objectsRoute: j
10
+ };
11
+ function J(t) {
12
+ let n = (T.value ?? []).filter((e) => e.featured);
13
+ for (let e = n.length - 1; e > 0; e--) {
14
+ let t = Math.floor(Math.random() * (e + 1));
15
+ [n[e], n[t]] = [n[t], n[e]];
16
+ }
17
+ return n.slice(0, t).map((t) => e(t, _("partners", t.id, g), q));
18
+ }
19
+ var Y = {
20
+ spec: {
21
+ ...G,
22
+ media: () => []
23
+ },
24
+ visible: () => !0,
25
+ view: (t, n) => e(t, {
26
+ ..._("partners", t.id, g),
27
+ ...n
28
+ }, q),
29
+ labels: { partner: {
30
+ objects: "partner.action.viewObjects",
31
+ homepage: "partner.nav.homepage"
32
+ } }
33
+ };
34
+ //#endregion
35
+ export { H as A, K as C, I as D, F as E, _ as M, i as N, z as O, W as S, A as T, b as _, P as a, Y as b, g as c, R as d, w as f, x as g, C as h, r as i, D as j, U as k, J as l, M as m, t as n, B as o, m as p, n as r, V as s, L as t, S as u, h as v, j as w, N as x, O as y };