@museumwnf/viewer-layout 2.15.1 → 2.16.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,5 +1,5 @@
1
- import "./TimelineLookup-DRc43FkL.js";
2
- import { g as e } from "./TimelineEventList-BmfLBaTT.js";
1
+ import "./TimelineLookup-D-p1aQ_Z.js";
2
+ import { v as e } from "./TimelineEventList-D5Hot788.js";
3
3
  import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, normalizeClass as c, normalizeStyle as l, onBeforeUnmount as u, onMounted as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, vModelCheckbox as _, vShow as v, watch as y, withCtx as b, withDirectives as x } from "vue";
4
4
  import { renderBlock as S, renderInline as C, useI18n as w } from "@museumwnf/viewer-core";
5
5
  //#region src/content/FeaturedPartners.vue
@@ -9,7 +9,7 @@ var T = {
9
9
  }, E = { class: "mwnf-featured-partners__heading" }, D = { class: "mwnf-featured-partners__carousel" }, O = {
10
10
  key: 0,
11
11
  class: "mwnf-featured-partners__image"
12
- }, ee = ["src", "alt"], te = { class: "mwnf-featured-partners__body" }, k = { class: "mwnf-featured-partners__name" }, A = { class: "mwnf-featured-partners__location" }, j = { key: 0 }, M = { class: "mwnf-featured-partners__description" }, N = {
12
+ }, k = ["src", "alt"], A = { class: "mwnf-featured-partners__body" }, ee = { class: "mwnf-featured-partners__name" }, te = { class: "mwnf-featured-partners__location" }, j = { key: 0 }, M = { class: "mwnf-featured-partners__description" }, N = {
13
13
  key: 0,
14
14
  class: "mwnf-featured-partners__controls"
15
15
  }, P = ["aria-label", "onClick"], F = 8e3, I = {
@@ -19,24 +19,49 @@ var T = {
19
19
  type: Array,
20
20
  default: () => []
21
21
  },
22
+ partners: {
23
+ type: Array,
24
+ default: () => []
25
+ },
26
+ descriptionLength: {
27
+ type: Number,
28
+ default: 420
29
+ },
22
30
  headingEntry: {
23
31
  type: String,
24
32
  default: "partner.featured"
25
33
  }
26
34
  },
27
- setup(n) {
28
- let l = n, g = p(0), _ = null;
29
- function y(e) {
30
- g.value = e, S();
35
+ setup(l) {
36
+ let g = l;
37
+ function _(e) {
38
+ return String(e ?? "").replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
39
+ }
40
+ function y(e, t) {
41
+ if (!e || e.length <= t) return e;
42
+ let n = e.lastIndexOf(" ", t);
43
+ return `${e.slice(0, n > 0 ? n : t)}...`;
44
+ }
45
+ let S = n(() => g.partners.length ? g.partners.map((e) => ({
46
+ id: e.id,
47
+ name: e.plainName,
48
+ logo: e.pictures?.[0]?.url ?? e.logos?.[0]?.url ?? null,
49
+ city: e.city,
50
+ country: e.country,
51
+ description: y(_(e.description), g.descriptionLength),
52
+ route: e.route
53
+ })) : g.records), C = p(0), w = null;
54
+ function I(e) {
55
+ C.value = e, L();
31
56
  }
32
- function S() {
33
- _ && clearInterval(_), l.records.length > 0 && (_ = setInterval(() => {
34
- g.value = (g.value + 1) % l.records.length;
57
+ function L() {
58
+ w && clearInterval(w), S.value.length > 0 && (w = setInterval(() => {
59
+ C.value = (C.value + 1) % S.value.length;
35
60
  }, F));
36
61
  }
37
- return d(S), u(() => _ && clearInterval(_)), (l, u) => n.records.length ? (f(), a("section", T, [
38
- o("h2", E, h(l.$t(n.headingEntry)), 1),
39
- o("div", D, [(f(!0), a(t, null, m(n.records, (t, n) => x((f(), r(e, {
62
+ return d(L), u(() => w && clearInterval(w)), (n, u) => S.value.length ? (f(), a("section", T, [
63
+ o("h2", E, h(n.$t(l.headingEntry)), 1),
64
+ o("div", D, [(f(!0), a(t, null, m(S.value, (t, n) => x((f(), r(e, {
40
65
  key: t.id,
41
66
  to: t.route,
42
67
  class: "mwnf-featured-partners__card"
@@ -45,18 +70,18 @@ var T = {
45
70
  src: t.logo,
46
71
  alt: t.name,
47
72
  class: "mwnf-featured-partners__logo"
48
- }, null, 8, ee)])) : i("", !0), o("span", te, [
49
- o("span", k, h(t.name), 1),
50
- o("span", A, [t.city ? (f(), a("span", j, h(t.city) + ", ", 1)) : i("", !0), s(h(t.country), 1)]),
73
+ }, null, 8, k)])) : i("", !0), o("span", A, [
74
+ o("span", ee, h(t.name), 1),
75
+ o("span", te, [t.city ? (f(), a("span", j, h(t.city) + ", ", 1)) : i("", !0), s(h(t.country), 1)]),
51
76
  o("span", M, h(t.description), 1)
52
77
  ])]),
53
78
  _: 2
54
- }, 1032, ["to"])), [[v, n === g.value]])), 128))]),
55
- n.records.length > 1 ? (f(), a("div", N, [(f(!0), a(t, null, m(n.records, (e, t) => (f(), a("button", {
79
+ }, 1032, ["to"])), [[v, n === C.value]])), 128))]),
80
+ S.value.length > 1 ? (f(), a("div", N, [(f(!0), a(t, null, m(S.value, (e, t) => (f(), a("button", {
56
81
  key: e.id,
57
- class: c(["mwnf-featured-partners__bullet", { "mwnf-featured-partners__bullet--active": t === g.value }]),
58
- "aria-label": `${l.$t("core.action.show")} ${e.name}`,
59
- onClick: (e) => y(t)
82
+ class: c(["mwnf-featured-partners__bullet", { "mwnf-featured-partners__bullet--active": t === C.value }]),
83
+ "aria-label": `${n.$t("core.action.show")} ${e.name}`,
84
+ onClick: (e) => I(t)
60
85
  }, null, 10, P))), 128))])) : i("", !0)
61
86
  ])) : i("", !0);
62
87
  }
package/dist/content.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./TimelineLookup-DRc43FkL.js";
2
- import { a as o, c as s, d as c, f as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as v, t as y, u as b } from "./TimelineEventList-BmfLBaTT.js";
3
- import { n as x, t as S } from "./BackLink-BJ16COHd.js";
4
- import { a as C, i as w, n as T, r as E, t as D } from "./content-DUXrQ-l8.js";
5
- export { S as BackLink, n as DynastyList, i as DynastyPopout, l as FacetSelect, C as FeaturedPartners, e as FeaturedRecord, c as FilterPanel, m as GlossaryPopover, t as GlossaryTool, _ as MediaGallery, g as Pagination, x as PartnerMap, T as PictureGallery, D as PictureNarrative, E as PopupLogo, h as RecordCredits, p as RecordGrid, f as RecordLanguages, u as RecordList, s as RecordSheet, d as RelatedRecords, b as ResultsSummary, r as SectionCards, v as SheetSection, w as SiblingGalleries, o as SourceCredit, y as TimelineEventList, a as TimelineLookup };
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./TimelineLookup-D-p1aQ_Z.js";
2
+ import { _ as o, a as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S } from "./TimelineEventList-D5Hot788.js";
3
+ import { a as C, i as w, n as T, r as E, t as D } from "./content-DncTPD5P.js";
4
+ import { t as O } from "./BackLink-LfSIuXnL.js";
5
+ export { O as BackLink, n as DynastyList, i as DynastyPopout, h as FacetSelect, C as FeaturedPartners, e as FeaturedRecord, v as FilterPanel, p as GlossaryPopover, t as GlossaryTool, s as MediaGallery, f as Pagination, y as PartnerMap, g as PartnerPanel, T as PictureGallery, D as PictureNarrative, E as PopupLogo, c as RecordCredits, d as RecordGrid, l as RecordLanguages, o as RecordList, S as RecordSheet, _ as RelatedRecords, u as ResultsSummary, r as SectionCards, m as SheetSection, w as SiblingGalleries, b as SourceCredit, x as TimelineEventList, a as TimelineLookup };