maverick-wave-astro 1.15.0 → 1.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
@@ -147,11 +147,14 @@ their schemas; a site not yet moved has `contentmanager/sections.json`.
147
147
  `mwa-check && astro build` in the build script so a broken file stops the
148
148
  build - it knows the formats `date`, `email`, `uri` and the keywords `x-widget`,
149
149
  `x-item-title`, `x-labels`, `x-empty`, `x-not-before`, `x-groups`,
150
- `x-newest-first`, `x-translate`. Photos uploaded in the werkbank land in
151
- `public/images/uploads/`; the integration derives their sizes before the build
152
- (`maverick-wave-astro/uploads`), skips a file sharp cannot read and removes the
153
- originals from `dist/`, since they still carry EXIF and GPS. Tooling: re-export
154
- `maverick-wave-astro/eslint` and `/prettier`.
150
+ `x-newest-first`, `x-translate`, `x-show-if` (the werkbank shows a field only
151
+ while a neighbour has one of the given values) and `x-width` (`narrow` |
152
+ `medium` | `wide`: how wide a field stands next to other short ones). Photos
153
+ uploaded in the werkbank land in `public/images/uploads/`; the integration
154
+ derives their sizes before the build (`maverick-wave-astro/uploads`), skips a
155
+ file sharp cannot read and removes the originals from `dist/`, since they still
156
+ carry EXIF and GPS. Tooling: re-export `maverick-wave-astro/eslint` and
157
+ `/prettier`.
155
158
 
156
159
  Pages read sections and the texts of the code through
157
160
  `maverick-wave-astro/werkbank`:
package/bin/check.mjs CHANGED
@@ -26,6 +26,12 @@ ajv.addVocabulary([
26
26
  'x-groups',
27
27
  'x-newest-first',
28
28
  'x-translate',
29
+ // The werkbank turns it into the fields of the section a story tab hangs on.
30
+ 'x-fields',
31
+ // Only the form reads these: a field shows when a neighbour has one of the
32
+ // values, and how wide it stands next to other short fields.
33
+ 'x-show-if',
34
+ 'x-width',
29
35
  ]);
30
36
  // Same rule as in the werkbank: YYYY-MM-DD compares as text.
31
37
  ajv.addKeyword({
@@ -2,7 +2,7 @@
2
2
  // Call, directions, book - held at the bottom edge of a phone. From a tablet
3
3
  // up it steps aside unless `always` is set; while it shows, the page keeps
4
4
  // its height free. Place it last in the body, after the footer.
5
- import { config } from '../dist/config.js';
5
+ import { actionBarFloats, config } from '../dist/config.js';
6
6
  import { PACKAGE_ICONS } from '../dist/icons.js';
7
7
  import { linkTo } from '../dist/path.js';
8
8
  import Icon from './Icon.astro';
@@ -24,6 +24,7 @@ interface Props {
24
24
  // At the bottom of its own frame instead of the window, e.g. a device.
25
25
  embedded?: boolean;
26
26
  // Floats above the bottom edge as the counterpart to the header island.
27
+ // Without it, design.actionBar decides - the owner switches it in the werkbank.
27
28
  island?: boolean;
28
29
  class?: string;
29
30
  }
@@ -48,7 +49,7 @@ const {
48
49
  items,
49
50
  always = false,
50
51
  embedded = false,
51
- island = false,
52
+ island = actionBarFloats(),
52
53
  class: className,
53
54
  } = Astro.props;
54
55
  ---
@@ -39,7 +39,8 @@ interface Props {
39
39
  links?: readonly { label: string; href: string }[];
40
40
  owner: string;
41
41
  ownerHref?: string;
42
- // "ein Format von" - without it the formatwerke mark is left out.
42
+ // "ein Format von" - without it the formatwerke mark is left out. The slot
43
+ // "bar" takes its place, e.g. for the mark on formatwerke.de itself.
43
44
  credit?: string;
44
45
  lastUpdated?: { label: string; date: string };
45
46
  // The dark bookend of the header bar, in both themes.
@@ -201,7 +202,7 @@ const frame = container
201
202
  }
202
203
  </div>
203
204
 
204
- {credit && <FormatwerkeMark label={credit} />}
205
+ <slot name="bar">{credit && <FormatwerkeMark label={credit} />}</slot>
205
206
 
206
207
  {
207
208
  legalLinks.length > 0 && (
@@ -7,19 +7,25 @@ import '../styles/formatwerke-mark.css';
7
7
  import { config } from '../dist/config.js';
8
8
 
9
9
  interface Props {
10
- // "ein Format von", followed by the name
10
+ // "ein Format von", followed by the name - empty for the name alone
11
11
  label?: string;
12
+ // "/" on formatwerke.de itself; only an outside address opens a new tab
13
+ href?: string;
12
14
  }
13
15
 
14
16
  const german = config.site.lang.startsWith('de');
15
- const { label = german ? 'ein Format von' : 'a format by' } = Astro.props;
17
+ const {
18
+ label = german ? 'ein Format von' : 'a format by',
19
+ href = 'https://formatwerke.de',
20
+ } = Astro.props;
21
+ const external = /^https?:/.test(href);
16
22
  ---
17
23
 
18
24
  <a
19
25
  class="mwa-fw-mark"
20
- href="https://formatwerke.de"
21
- target="_blank"
22
- rel="noopener noreferrer"
26
+ href={href}
27
+ target={external ? '_blank' : undefined}
28
+ rel={external ? 'noopener noreferrer' : undefined}
23
29
  >
24
30
  <svg
25
31
  class="mwa-fw-mark-signet"
@@ -55,7 +61,9 @@ const { label = german ? 'ein Format von' : 'a format by' } = Astro.props;
55
61
  ></path>
56
62
  </g>
57
63
  </svg>
58
- <span>{label} <span class="mwa-fw-mark-name">formatwerke</span></span>
64
+ <span>
65
+ {label && `${label} `}<span class="mwa-fw-mark-name">formatwerke</span>
66
+ </span>
59
67
  </a>
60
68
 
61
69
  <script>