@escape-game-over/atlas 0.1.104 → 0.1.105

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escape-game-over/atlas",
3
- "version": "0.1.104",
3
+ "version": "0.1.105",
4
4
  "type": "module",
5
5
  "description": "Typed, data-driven machinery for static multi-locale, multi-deployment Astro sites.",
6
6
  "private": false,
@@ -18,6 +18,7 @@
18
18
  "./client": "./src/astro/client.ts",
19
19
  "./astro/auto-dialog": "./src/astro/AutoDialog.astro",
20
20
  "./astro/background-video": "./src/astro/BackgroundVideo.astro",
21
+ "./astro/booking-widget": "./src/astro/BookingWidget.astro",
21
22
  "./astro/consent-banner": "./src/astro/ConsentBanner.astro",
22
23
  "./astro/document": "./src/astro/Document.astro",
23
24
  "./astro/element": "./src/astro/AtlasElement.astro",
@@ -0,0 +1,31 @@
1
+ ---
2
+ /**
3
+ * A booking widget, whatever its vendor: the one place that picks the
4
+ * vendor's component, so a site passes what its config holds and nothing
5
+ * else. Attributes go to that component's element.
6
+ *
7
+ * ```astro
8
+ * <BookingWidget widget={settings.booking} locale={locale} class="my-8" />
9
+ * ```
10
+ */
11
+ import type { HTMLAttributes } from "astro/types";
12
+ import type { BookingWidget } from "../booking/widget.ts";
13
+ import FourEscape from "./FourEscape.astro";
14
+
15
+ type Props = HTMLAttributes<"div"> & {
16
+ readonly widget: BookingWidget;
17
+ /** The page's: the widget speaks it when its vendor has it. */
18
+ readonly locale: string;
19
+ };
20
+
21
+ const { widget, locale, ...attrs } = Astro.props;
22
+ ---
23
+
24
+ {widget.vendor === "4escape" && (
25
+ <FourEscape
26
+ {...attrs}
27
+ widgetId={widget.widgetId}
28
+ domain={widget.domain}
29
+ locale={locale}
30
+ />
31
+ )}