maverick-wave-astro 1.7.0 → 1.8.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.
@@ -2,7 +2,10 @@
2
2
  // One device frame drawn by the framework - a laptop or a phone - with a page
3
3
  // on the glass: a full-page screenshot from public/, or the live page in an
4
4
  // iframe laid out at the device's width and scaled to fit. Both frames
5
- // together are Devices.
5
+ // together are Devices. The slot holds what stays put while the screenshot
6
+ // tours past, e.g. a picture of an action bar at the bottom of the glass.
7
+ import '../styles/device.css';
8
+
6
9
  import { config } from '../dist/config.js';
7
10
  import { publicImage } from '../dist/image-size.js';
8
11
  import { linkTo } from '../dist/path.js';
@@ -37,6 +40,10 @@ const {
37
40
  // A live page scrolls by itself - the tour needs a picture to move
38
41
  const button = tour && Boolean(image);
39
42
  const Frame = button ? 'button' : 'div';
43
+ // Devices always hands its phone slot on, so an empty one arrives as well
44
+ const overlay = Astro.slots.has('default')
45
+ ? (await Astro.slots.render('default')).trim()
46
+ : '';
40
47
  ---
41
48
 
42
49
  <Frame
@@ -56,5 +63,6 @@ const Frame = button ? 'button' : 'div';
56
63
  src && <iframe src={linkTo(src)} title={title} loading="lazy" />
57
64
  )
58
65
  }
66
+ {overlay && <span class="mwa-device-overlay" set:html={overlay} />}
59
67
  </span>
60
68
  </Frame>
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  // Laptop and phone together: the phone stands over the laptop's lower right
3
3
  // corner, below it once the container gets narrow. Each screen takes what
4
- // Device takes.
4
+ // Device takes, the slot "phone" goes into the phone's slot.
5
5
  import Device from './Device.astro';
6
6
 
7
7
  interface Screen {
@@ -25,5 +25,7 @@ const { laptop, phone, tour = true, tourLabel, class: className } = Astro.props;
25
25
 
26
26
  <div class:list={['mw-devices', className]}>
27
27
  <Device kind="laptop" {...laptop} />
28
- <Device kind="phone" {...phone} tour={tour} tourLabel={tourLabel} />
28
+ <Device kind="phone" {...phone} tour={tour} tourLabel={tourLabel}>
29
+ <slot name="phone" />
30
+ </Device>
29
31
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maverick-wave-astro",
3
- "version": "1.7.0",
3
+ "version": "1.8.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",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "peerDependencies": {
54
54
  "astro": "^7.2.0",
55
- "maverick-wave": "^6.4.0"
55
+ "maverick-wave": "^6.5.0"
56
56
  },
57
57
  "dependencies": {
58
58
  "@astrojs/sitemap": "^3.7.3",
@@ -67,7 +67,7 @@
67
67
  "eslint-plugin-astro": "^1.5.0",
68
68
  "eslint-plugin-simple-import-sort": "^12.1.1",
69
69
  "globals": "^16.5.0",
70
- "maverick-wave": "^6.4.0",
70
+ "maverick-wave": "^6.5.0",
71
71
  "prettier": "^3.6.2",
72
72
  "prettier-plugin-astro": "^0.14.1",
73
73
  "typescript": "^6.0.3",
@@ -0,0 +1,13 @@
1
+ /* Not a direct child of the glass, so the tour that moves the screenshot
2
+ leaves it where it is. Taps go through to the device and start the tour. */
3
+ .mwa-device-overlay {
4
+ position: absolute;
5
+ inset: auto 0 0;
6
+ pointer-events: none;
7
+ }
8
+
9
+ .mwa-device-overlay > img {
10
+ display: block;
11
+ width: 100%;
12
+ height: auto;
13
+ }