maverick-wave-astro 1.26.0 → 1.27.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,54 +1,74 @@
1
1
  ---
2
2
  // Imprint from imprint.json as a card - the way the product sites show it.
3
- // The site brings the page frame and heading itself.
3
+ // The site brings the page frame and heading itself. The headings come from
4
+ // here so every site reads the same; a topic left empty is left out.
4
5
  import { config } from '../dist/config.js';
5
6
  import PostalAddress from './PostalAddress.astro';
6
7
 
7
- interface AddressNotes {
8
- noVisitors?: boolean;
9
- noParcels?: boolean;
10
- }
11
-
12
8
  interface Props {
13
9
  imprint: {
14
- subtitle: string;
15
10
  address: { company?: string; name: string; street: string; city: string };
16
- addressNotes?: AddressNotes;
17
- contactTitle: string;
18
- vatIdTitle?: string;
19
- vatId?: string;
20
- disputeTitle: string;
21
- disputeText: string;
22
- licensesTitle?: string;
23
- licensesText?: string;
11
+ addressNotes?: { noVisitors?: boolean; noParcels?: boolean };
12
+ // What the trade adds: profession, chamber, permit, register, representation
13
+ sections?: readonly { title: string; lines: readonly string[] }[];
14
+ vat?: string;
15
+ responsible?: string;
16
+ dispute: string;
17
+ credits?: readonly string[];
24
18
  };
25
19
  mail: { href: string; text: string };
26
- addressNoteTexts?: Partial<Record<keyof AddressNotes, string>>;
20
+ phone?: { href: string; text: string };
27
21
  class?: string;
28
22
  }
29
23
 
30
- const german = config.site.lang.startsWith('de');
24
+ const text = config.site.lang.startsWith('de')
25
+ ? {
26
+ address: 'Angaben gemäß § 5 DDG',
27
+ contact: 'Kontakt',
28
+ phone: 'Telefon',
29
+ mail: 'E-Mail',
30
+ vat: 'Umsatzsteuer',
31
+ responsible: 'Verantwortlich für den Inhalt nach § 18 Abs. 2 MStV',
32
+ dispute: 'Verbraucherstreitbeilegung',
33
+ credits: 'Lizenzen und Nachweise',
34
+ noVisitors:
35
+ 'Kein Publikumsverkehr - Besuche nur nach Terminvereinbarung.',
36
+ noParcels: 'Keine Annahme von Paketen und Warensendungen.',
37
+ }
38
+ : {
39
+ address: 'Information according to Section 5 DDG',
40
+ contact: 'Contact',
41
+ phone: 'Phone',
42
+ mail: 'Email',
43
+ vat: 'VAT',
44
+ responsible: 'Responsible for content according to Section 18(2) MStV',
45
+ dispute: 'Consumer dispute resolution',
46
+ credits: 'Licenses and credits',
47
+ noVisitors: 'No walk-in visitors - visits by appointment only.',
48
+ noParcels: 'Parcels and goods deliveries are not accepted.',
49
+ };
31
50
 
32
- const { imprint, mail, addressNoteTexts = {}, class: className } = Astro.props;
51
+ const { imprint, mail, phone, class: className } = Astro.props;
33
52
 
34
53
  // Letters are never excluded here - a note against mail would let the address
35
54
  // count as not serviceable (§ 5 DDG).
36
- const noteTexts = {
37
- noVisitors: german
38
- ? 'Kein Publikumsverkehr - Besuche nur nach Terminvereinbarung.'
39
- : 'No walk-in visitors - visits by appointment only.',
40
- noParcels: german
41
- ? 'Keine Annahme von Paketen und Warensendungen.'
42
- : 'Parcels and goods deliveries are not accepted.',
43
- ...addressNoteTexts,
44
- };
45
55
  const notes = (['noVisitors', 'noParcels'] as const)
46
56
  .filter(key => imprint.addressNotes?.[key])
47
- .map(key => noteTexts[key]);
57
+ .map(key => text[key]);
58
+
59
+ const sections = [
60
+ ...(imprint.sections ?? []),
61
+ { title: text.vat, lines: [imprint.vat] },
62
+ { title: text.responsible, lines: [imprint.responsible] },
63
+ { title: text.dispute, lines: [imprint.dispute] },
64
+ { title: text.credits, lines: imprint.credits ?? [] },
65
+ ]
66
+ .map(section => ({ ...section, lines: section.lines.filter(Boolean) }))
67
+ .filter(section => section.lines.length > 0);
48
68
  ---
49
69
 
50
70
  <div class:list={['mw-card mw-card-simple mw-prose', className]}>
51
- <h2>{imprint.subtitle}</h2>
71
+ <h2>{text.address}</h2>
52
72
  <PostalAddress address={imprint.address} />
53
73
  {
54
74
  notes.length > 0 && (
@@ -63,27 +83,32 @@ const notes = (['noVisitors', 'noParcels'] as const)
63
83
  )
64
84
  }
65
85
 
66
- <h2>{imprint.contactTitle}</h2>
67
- <p><a href={mail.href}>{mail.text}</a></p>
86
+ <h2>{text.contact}</h2>
87
+ <p>
88
+ {
89
+ phone && (
90
+ <Fragment>
91
+ {text.phone}: <a href={phone.href}>{phone.text}</a>
92
+ <br />
93
+ </Fragment>
94
+ )
95
+ }
96
+ {text.mail}: <a href={mail.href}>{mail.text}</a>
97
+ </p>
68
98
 
69
99
  {
70
- imprint.vatId && (
100
+ sections.map(section => (
71
101
  <Fragment>
72
- <h2>{imprint.vatIdTitle}</h2>
73
- <p>{imprint.vatId}</p>
102
+ <h2>{section.title}</h2>
103
+ <p>
104
+ {section.lines.map((line, index) => (
105
+ <Fragment>
106
+ {index > 0 && <br />}
107
+ {line}
108
+ </Fragment>
109
+ ))}
110
+ </p>
74
111
  </Fragment>
75
- )
76
- }
77
-
78
- <h2>{imprint.disputeTitle}</h2>
79
- <p>{imprint.disputeText}</p>
80
-
81
- {
82
- imprint.licensesTitle && (
83
- <Fragment>
84
- <h2>{imprint.licensesTitle}</h2>
85
- <p>{imprint.licensesText}</p>
86
- </Fragment>
87
- )
112
+ ))
88
113
  }
89
114
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maverick-wave-astro",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "Shared frame for static Astro homepages built with MaverickWave: layout, SEO, design variants, schedule, building blocks.",
5
5
  "type": "module",
6
6
  "license": "MIT",