@forgebuild/sidon-booking-widget 1.2.0 → 1.3.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
@@ -243,7 +243,8 @@ shows the booking view again, with a *Start a new booking* action.
243
243
  | `maps-api-key` | | Google Maps JS API key. The map renders only when this is set. It never renders on step 3 or in booking-page mode. |
244
244
  | `map-style` | `chart` | `chart` (buoy circles) or `coastal` (SVG pontoon overlays). |
245
245
  | `map-height` / `map-width` / `map-gap` | `280px` / `100%` / `0px` | The map's size, and the gap below it. `map-width="100vw"` breaks the map out of the card. |
246
- | `width` | `560px` | The element's max width, read once at mount. |
246
+ | `width` | `560px` | The element's max width, read once at mount. In `overlay` layout, the card's max width. |
247
+ | `layout` | `stacked` | `stacked` puts the map above the card. `overlay` floats the card over the map's left side, `map-gap` down from its top and `--sbw-card-inset` (CSS custom property, default `24px`) in from its left. Read once at mount. Below 768px it stacks. |
247
248
  | `logo-mark` / `marina-name` | | The marina's logo pin on the map. |
248
249
  | `otherMarinas` (JS property) | `[]` | Peer-marina pins; see [`otherMarinas`](#othermarinas-js-property). |
249
250
 
@@ -57,6 +57,7 @@ export interface SidonBookingWidgetElement extends HTMLElement {
57
57
  mapWidth?: string;
58
58
  mapGap?: string;
59
59
  width?: string;
60
+ layout?: 'stacked' | 'overlay';
60
61
  logoMark?: string | null;
61
62
  marinaName?: string;
62
63
  otherMarinas?: OtherMarina[];
@@ -2651,8 +2651,7 @@ function Ri(e, t) {
2651
2651
  let t = {};
2652
2652
  for (let e of u()) e.berthId && (t[e.berthId] = {
2653
2653
  price: e.pricePerNight,
2654
- status: e.status,
2655
- rotation: e.rotation
2654
+ status: e.status
2656
2655
  });
2657
2656
  try {
2658
2657
  let n = new DOMParser().parseFromString(e, "image/svg+xml");
@@ -2664,15 +2663,7 @@ function Ri(e, t) {
2664
2663
  let a = D[i] ?? D.occupied, o = e.querySelector("rect:not([data-role]), circle");
2665
2664
  o && (o.setAttribute("fill", a.fill), o.setAttribute("stroke", a.stroke));
2666
2665
  let s = e.querySelector("[data-role=\"entrance\"]");
2667
- if (s && s.setAttribute("fill", a.stroke), r?.rotation != null && o) {
2668
- let t = o, n = 0, i = 0;
2669
- if (t.tagName.toLowerCase() === "rect") {
2670
- let e = parseFloat(t.getAttribute("x") || "0"), r = parseFloat(t.getAttribute("y") || "0"), a = parseFloat(t.getAttribute("width") || "0"), o = parseFloat(t.getAttribute("height") || "0");
2671
- n = e + a / 2, i = r + o / 2;
2672
- } else t.tagName.toLowerCase() === "circle" && (n = parseFloat(t.getAttribute("cx") || "0"), i = parseFloat(t.getAttribute("cy") || "0"));
2673
- let a = e.getAttribute("transform") || "";
2674
- e.setAttribute("transform", `${a} rotate(${r.rotation} ${n} ${i})`.trim());
2675
- }
2666
+ s && s.setAttribute("fill", a.stroke);
2676
2667
  });
2677
2668
  let r = n.createElementNS("http://www.w3.org/2000/svg", "style");
2678
2669
  return r.textContent = `