@forgebuild/sidon-booking-widget 2.0.0 → 3.0.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 +19 -14
- package/dist/elements.d.ts +2 -2
- package/dist/sidon-booking-widget.js +3196 -3194
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -215,12 +215,14 @@ an HTML tag. Without a bundler, load `dist/sidon-booking-widget.js` with `<scrip
|
|
|
215
215
|
The wizard has four steps:
|
|
216
216
|
|
|
217
217
|
1. **Documents**: the sailor's documents, held once for all marinas. The guest signs in with Sidon
|
|
218
|
-
(
|
|
218
|
+
(a popup on Sidon's site), and the step shows which of the marina's requirements are met and lets them upload
|
|
219
219
|
what's missing. Uploads go straight to OTA, not through your forwarder. *Next* unlocks once
|
|
220
220
|
OTA says the requirements pass for the stay's dates.
|
|
221
221
|
- It applies only where OTA has switched on the marina's `sailor_documents`. Other marinas keep
|
|
222
|
-
the per-booking upload on [the booking page](#the-booking-page)
|
|
223
|
-
|
|
222
|
+
the per-booking upload on [the booking page](#the-booking-page), and the wizard skips this
|
|
223
|
+
step: it opens on Details and the stepper shows 1 Details, 2 Payment, 3 Booking. Events
|
|
224
|
+
still carry the step numbers below (Details is `2`).
|
|
225
|
+
- It needs `sailor-api-origin`; see [Documents setup](#documents-setup).
|
|
224
226
|
2. **Details**: dates, boat length and berth (with an optional map), then the guest's contact and
|
|
225
227
|
boat details. *Next* puts a 30-minute hold on the berth.
|
|
226
228
|
3. **Payment**: Stripe's Payment Element. The card is authorised at this step and captured when the
|
|
@@ -247,7 +249,7 @@ shows the booking view again, with a *Start a new booking* action.
|
|
|
247
249
|
| `currency-symbol` | `''` | When empty, amounts are formatted in the marina's currency with `Intl.NumberFormat`. Set it, to `$` for example, to show that fixed symbol before amounts instead. |
|
|
248
250
|
| `variant` | `navy` | `navy` or `dark`; see [Theming](#theming). |
|
|
249
251
|
| `booking-id` | absent | When present, the element is in [booking-page mode](#the-booking-page). A value overrides the booking id in the URL. |
|
|
250
|
-
| `
|
|
252
|
+
| `sidon-origin` | `https://marina.sidonmarine.uk` | Where the Documents step's *Sign in with Sidon* popup opens; see [Documents setup](#documents-setup). Override only to test against another Sidon. |
|
|
251
253
|
| `sailor-api-origin` | `''` | OTA's origin, where the Documents step uploads to (`/api/sailor/documents`). Uploads don't go through the forwarder. |
|
|
252
254
|
| `maps-api-key` | | Google Maps JS API key. The map renders only when this is set. It never renders on step 4 or in booking-page mode. |
|
|
253
255
|
| `map-style` | `chart` | `chart` (buoy circles) or `coastal` (SVG pontoon overlays). |
|
|
@@ -275,18 +277,21 @@ root and can be caught anywhere on the page:
|
|
|
275
277
|
|
|
276
278
|
### Documents setup
|
|
277
279
|
|
|
280
|
+
Sign-in is Sidon's, not the site's: *Sign in with Sidon* opens a popup on Sidon's `/connect` page,
|
|
281
|
+
and the sailor signs in (or signs up) with their Sidon account there. The popup hands the widget a
|
|
282
|
+
sailor token, which it keeps for the browser tab. The site has no auth setup of its own.
|
|
283
|
+
|
|
278
284
|
Per site:
|
|
279
285
|
|
|
280
|
-
1.
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
4. On OTA, switch on the marina's `sailor_documents`, last, and only once every site booking that
|
|
286
|
-
marina runs the new widget. Switching it on earlier shows guests "Sign-in is unavailable" and
|
|
287
|
-
gives 1.x sites a raw "Sign in required".
|
|
286
|
+
1. Ask Sidon to add the site's origin (e.g. `https://www.example.com`) to `CONNECT_ORIGINS`. The
|
|
287
|
+
popup refuses any other origin.
|
|
288
|
+
2. Upgrade the widget and the forwarder, then set `sailor-api-origin` on the element.
|
|
289
|
+
3. On OTA, switch on the marina's `sailor_documents`, last, and only once every site booking that
|
|
290
|
+
marina runs the new widget. 1.x sites get a raw "Sign in required" once it's on.
|
|
288
291
|
|
|
289
|
-
|
|
292
|
+
`sidon-origin` points the popup at another Sidon (a local or staging one); leave it unset in
|
|
293
|
+
production. Sidon's Clerk instance needs the `ota` JWT template (claims `email` and `name`), and
|
|
294
|
+
OTA's `SAILOR_CLERK_SECRET_KEYS` must hold that instance's secret key.
|
|
290
295
|
|
|
291
296
|
The forwarder forwards the `X-Sailor-Token` header, so update `@forgebuild/sidon-booking-widget`
|
|
292
297
|
in the forwarder's project too.
|
|
@@ -526,7 +531,7 @@ between two styles:
|
|
|
526
531
|
The wizard gained a first step, so the step numbers moved: 1 Documents, 2 Details, 3 Payment,
|
|
527
532
|
4 Booking. **This breaks hosts listening to `sidon-step-change`** (and anything keyed on step 3
|
|
528
533
|
being the booking), so it ships as a major version. Update those listeners, and set
|
|
529
|
-
`
|
|
534
|
+
`sailor-api-origin` ([Documents setup](#documents-setup)). On
|
|
530
535
|
[the booking page](#the-booking-page), marinas on sailor documents no longer show the per-booking
|
|
531
536
|
upload.
|
|
532
537
|
|
package/dist/elements.d.ts
CHANGED
|
@@ -62,8 +62,8 @@ export interface SidonBookingWidgetElement extends HTMLElement {
|
|
|
62
62
|
logoMark?: string | null;
|
|
63
63
|
marinaName?: string;
|
|
64
64
|
otherMarinas?: OtherMarina[];
|
|
65
|
-
/**
|
|
66
|
-
|
|
65
|
+
/** Sidon's origin for the Documents step's sign-in popup; defaults to https://marina.sidonmarine.uk. */
|
|
66
|
+
sidonOrigin?: string;
|
|
67
67
|
/** Origin serving OTA's /api/sailor/documents; '' (default) = this page's origin. */
|
|
68
68
|
sailorApiOrigin?: string;
|
|
69
69
|
}
|