@forgebuild/sidon-booking-widget 4.1.7 → 4.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 +632 -629
- package/dist/sidon-berth-map.js +1 -1
- package/package.json +50 -50
- package/dist/custom-element-berth-map.d.ts +0 -1
- package/dist/custom-element.d.ts +0 -1
- package/dist/elements.d.ts +0 -127
- package/dist/sidon-booking-widget.js +0 -14081
package/dist/sidon-berth-map.js
CHANGED
|
@@ -4977,7 +4977,7 @@ async function Ya(e, t, n) {
|
|
|
4977
4977
|
departure: n.departure,
|
|
4978
4978
|
boat_length_m: String(n.boatLengthM)
|
|
4979
4979
|
});
|
|
4980
|
-
return n.boatBeamM && r.set("boat_beam_m", String(n.boatBeamM)), Ei(await qa(`${Si(e, t)}/availability?${r}`, "Failed to load availability"));
|
|
4980
|
+
return n.boatBeamM && r.set("boat_beam_m", String(n.boatBeamM)), n.boatDraftM && r.set("boat_draft_m", String(n.boatDraftM)), Ei(await qa(`${Si(e, t)}/availability?${r}`, "Failed to load availability"));
|
|
4981
4981
|
}
|
|
4982
4982
|
//#endregion
|
|
4983
4983
|
//#region src/BerthMap.svelte
|
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@forgebuild/sidon-booking-widget",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "Berth booking and berth map custom elements for marinas on OTA, plus an Astro forwarder route and server client.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "UNLICENSED",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"main": "./dist/sidon-booking-widget.js",
|
|
11
|
-
"module": "./dist/sidon-booking-widget.js",
|
|
12
|
-
"types": "./dist/custom-element.d.ts",
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"types": "./dist/custom-element.d.ts",
|
|
16
|
-
"import": "./dist/sidon-booking-widget.js"
|
|
17
|
-
},
|
|
18
|
-
"./berth-map": {
|
|
19
|
-
"types": "./dist/custom-element-berth-map.d.ts",
|
|
20
|
-
"import": "./dist/sidon-berth-map.js"
|
|
21
|
-
},
|
|
22
|
-
"./astro-proxy": {
|
|
23
|
-
"types": "./dist/astro-proxy.d.ts",
|
|
24
|
-
"import": "./dist/astro-proxy.js"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"dev": "vite",
|
|
32
|
-
"build": "vite build --config vite.berth-map.config.ts && vite build && node scripts/write-element-types.mjs && tsc -p tsconfig.proxy.json",
|
|
33
|
-
"prepublishOnly": "npm run build",
|
|
34
|
-
"preview": "vite preview",
|
|
35
|
-
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json && tsc -p tsconfig.proxy.json --noEmit",
|
|
36
|
-
"test": "node scripts/check-astro-proxy.ts && node scripts/check-ota.ts && node scripts/check-berth-shape.ts"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@stripe/stripe-js": "^9.13.0",
|
|
40
|
-
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
41
|
-
"@tsconfig/svelte": "^5.0.8",
|
|
42
|
-
"@types/node": "^24.13.3",
|
|
43
|
-
"ably": "^2.26.0",
|
|
44
|
-
"flatpickr": "^4.6.13",
|
|
45
|
-
"svelte": "^5.56.8",
|
|
46
|
-
"svelte-check": "^4.7.3",
|
|
47
|
-
"typescript": "~6.0.2",
|
|
48
|
-
"vite": "^8.2.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@forgebuild/sidon-booking-widget",
|
|
3
|
+
"version": "4.3.0",
|
|
4
|
+
"description": "Berth booking and berth map custom elements for marinas on OTA, plus an Astro forwarder route and server client.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/sidon-booking-widget.js",
|
|
11
|
+
"module": "./dist/sidon-booking-widget.js",
|
|
12
|
+
"types": "./dist/custom-element.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/custom-element.d.ts",
|
|
16
|
+
"import": "./dist/sidon-booking-widget.js"
|
|
17
|
+
},
|
|
18
|
+
"./berth-map": {
|
|
19
|
+
"types": "./dist/custom-element-berth-map.d.ts",
|
|
20
|
+
"import": "./dist/sidon-berth-map.js"
|
|
21
|
+
},
|
|
22
|
+
"./astro-proxy": {
|
|
23
|
+
"types": "./dist/astro-proxy.d.ts",
|
|
24
|
+
"import": "./dist/astro-proxy.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"dev": "vite",
|
|
32
|
+
"build": "vite build --config vite.berth-map.config.ts && vite build && node scripts/write-element-types.mjs && tsc -p tsconfig.proxy.json",
|
|
33
|
+
"prepublishOnly": "npm run build",
|
|
34
|
+
"preview": "vite preview",
|
|
35
|
+
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json && tsc -p tsconfig.proxy.json --noEmit",
|
|
36
|
+
"test": "node scripts/check-astro-proxy.ts && node scripts/check-ota.ts && node scripts/check-berth-shape.ts"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@stripe/stripe-js": "^9.13.0",
|
|
40
|
+
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
41
|
+
"@tsconfig/svelte": "^5.0.8",
|
|
42
|
+
"@types/node": "^24.13.3",
|
|
43
|
+
"ably": "^2.26.0",
|
|
44
|
+
"flatpickr": "^4.6.13",
|
|
45
|
+
"svelte": "^5.56.8",
|
|
46
|
+
"svelte-check": "^4.7.3",
|
|
47
|
+
"typescript": "~6.0.2",
|
|
48
|
+
"vite": "^8.2.0"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './elements.js';
|
package/dist/custom-element.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './elements.js';
|
package/dist/elements.d.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Hand-written typings for <sidon-booking-widget> and <sidon-berth-map>.
|
|
2
|
-
// The entry modules only register the elements (side-effect imports), so
|
|
3
|
-
// generated declarations come out as an empty `export {}`. The build copies
|
|
4
|
-
// this file verbatim to dist/elements.d.ts and both entry .d.ts files
|
|
5
|
-
// re-export it (scripts/write-element-types.mjs), which is why it imports
|
|
6
|
-
// nothing: a relative import would dangle in dist/.
|
|
7
|
-
//
|
|
8
|
-
// Keep it in step with the `props` blocks in BookingWidget.svelte and
|
|
9
|
-
// BerthMap.svelte and the events they emit. `npm run check` skips .d.ts
|
|
10
|
-
// files (skipLibCheck), so check an edit with:
|
|
11
|
-
// npx tsc --ignoreConfig --noEmit --skipLibCheck false --lib es2023,dom src/elements.d.ts
|
|
12
|
-
|
|
13
|
-
/** Peer-marina logo pin. Mirrors OtherMarina in lib/types.ts. */
|
|
14
|
-
export interface OtherMarina {
|
|
15
|
-
name: string;
|
|
16
|
-
lat: number;
|
|
17
|
-
lng: number;
|
|
18
|
-
logoMark: string | null;
|
|
19
|
-
/** Always host-supplied: the package owns no site's routing. */
|
|
20
|
-
href: string | null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** OTA booking status. An expired booking reports `cancelled`. */
|
|
24
|
-
export type SidonBookingStatus = 'hold' | 'pending' | 'confirmed' | 'declined' | 'cancelled';
|
|
25
|
-
|
|
26
|
-
/** 1 Documents, 2 Details, 3 Payment, 4 Booking. */
|
|
27
|
-
export interface SidonStepChangeDetail { step: 1 | 2 | 3 | 4 }
|
|
28
|
-
/** The booking widget fires this from the wizard only, never in booking-page mode. */
|
|
29
|
-
export interface SidonLoaChangeDetail { loa: number }
|
|
30
|
-
/** `bookingId` is OTA's booking UUID, `marina` the marina slug. */
|
|
31
|
-
export interface SidonBookedDetail { bookingId: string; marina: string }
|
|
32
|
-
export interface SidonBookingStatusDetail { bookingId: string; status: SidonBookingStatus }
|
|
33
|
-
/** A berth label, or null when deselected. */
|
|
34
|
-
export interface SidonBerthSelectedDetail { berthId: string | null }
|
|
35
|
-
/** Dates are `YYYY-MM-DD`; `berth` is a berth label. */
|
|
36
|
-
export interface SidonQuickbookSubmitDetail { from: string | null; to: string | null; length: number; berth: string | null }
|
|
37
|
-
|
|
38
|
-
// Element properties mirror the attributes, camelCased; optional like them.
|
|
39
|
-
export interface SidonBookingWidgetElement extends HTMLElement {
|
|
40
|
-
/** OTA marina slug. */
|
|
41
|
-
marina?: string;
|
|
42
|
-
/** '' (default) = this page's origin, where the forwarder route lives. */
|
|
43
|
-
apiOrigin?: string;
|
|
44
|
-
from?: string;
|
|
45
|
-
to?: string;
|
|
46
|
-
length?: number;
|
|
47
|
-
berth?: string;
|
|
48
|
-
/** en/it/fr/es (first two letters). Unset: the wizard is English and the
|
|
49
|
-
booking page follows the booking's own locale. */
|
|
50
|
-
locale?: string;
|
|
51
|
-
currencySymbol?: string;
|
|
52
|
-
variant?: 'navy' | 'dark';
|
|
53
|
-
/** Present (even empty) = booking-page mode; a value overrides `?booking=`. */
|
|
54
|
-
bookingId?: string | null;
|
|
55
|
-
mapsApiKey?: string;
|
|
56
|
-
mapStyle?: 'chart' | 'coastal';
|
|
57
|
-
mapHeight?: string;
|
|
58
|
-
mapWidth?: string;
|
|
59
|
-
mapGap?: string;
|
|
60
|
-
width?: string;
|
|
61
|
-
layout?: 'stacked' | 'overlay';
|
|
62
|
-
logoMark?: string | null;
|
|
63
|
-
marinaName?: string;
|
|
64
|
-
otherMarinas?: OtherMarina[];
|
|
65
|
-
/** Sidon's origin for the Documents step's sign-in popup; defaults to https://sidonmarine.uk. */
|
|
66
|
-
sidonOrigin?: string;
|
|
67
|
-
/** Size in px of Sidon's sign-in window; default 480 x 720. */
|
|
68
|
-
signInWidth?: number;
|
|
69
|
-
signInHeight?: number;
|
|
70
|
-
/** Origin serving OTA's /api/sailor/documents; '' (default) = this page's origin. */
|
|
71
|
-
sailorApiOrigin?: string;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface SidonBerthMapElement extends HTMLElement {
|
|
75
|
-
/** OTA marina slug. */
|
|
76
|
-
marina?: string;
|
|
77
|
-
mapsApiKey?: string;
|
|
78
|
-
/** '' (default) = this page's origin, where the forwarder route lives. */
|
|
79
|
-
apiOrigin?: string;
|
|
80
|
-
mapStyle?: 'chart' | 'coastal';
|
|
81
|
-
locale?: string;
|
|
82
|
-
currencySymbol?: string;
|
|
83
|
-
from?: string;
|
|
84
|
-
to?: string;
|
|
85
|
-
length?: number;
|
|
86
|
-
berth?: string;
|
|
87
|
-
/** 'staff' (the OTA dashboard): every listed berth is clickable and fires
|
|
88
|
-
sidon-berth-selected, occupied berths are painted for [from, to), and
|
|
89
|
-
from/to follow their attributes. No card, availability or boat-length
|
|
90
|
-
checks. Default 'guest'. */
|
|
91
|
-
mode?: 'guest' | 'staff';
|
|
92
|
-
/** Re-reads the map payload. Undefined until the element has mounted
|
|
93
|
-
(a microtask after it is connected), so call `el.refresh?.()`. */
|
|
94
|
-
readonly refresh?: () => void;
|
|
95
|
-
bookPath?: string;
|
|
96
|
-
logoMark?: string | null;
|
|
97
|
-
marinaName?: string;
|
|
98
|
-
otherMarinas?: OtherMarina[];
|
|
99
|
-
mapHeight?: string;
|
|
100
|
-
showWeather?: boolean;
|
|
101
|
-
eyebrow?: string;
|
|
102
|
-
cardTitle?: string;
|
|
103
|
-
intro?: string;
|
|
104
|
-
rangeLabel?: string;
|
|
105
|
-
rangePlaceholder?: string;
|
|
106
|
-
lengthLabel?: string;
|
|
107
|
-
selectedLabel?: string;
|
|
108
|
-
selectedPlaceholder?: string;
|
|
109
|
-
ctaLabel?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
declare global {
|
|
113
|
-
interface HTMLElementTagNameMap {
|
|
114
|
-
'sidon-booking-widget': SidonBookingWidgetElement;
|
|
115
|
-
'sidon-berth-map': SidonBerthMapElement;
|
|
116
|
-
}
|
|
117
|
-
// Dispatched with bubbles + composed, so listeners on any ancestor
|
|
118
|
-
// element get the typed detail too.
|
|
119
|
-
interface HTMLElementEventMap {
|
|
120
|
-
'sidon-step-change': CustomEvent<SidonStepChangeDetail>;
|
|
121
|
-
'sidon-loa-change': CustomEvent<SidonLoaChangeDetail>;
|
|
122
|
-
'sidon-booked': CustomEvent<SidonBookedDetail>;
|
|
123
|
-
'sidon-booking-status': CustomEvent<SidonBookingStatusDetail>;
|
|
124
|
-
'sidon-berth-selected': CustomEvent<SidonBerthSelectedDetail>;
|
|
125
|
-
'sidon-quickbook-submit': CustomEvent<SidonQuickbookSubmitDetail>;
|
|
126
|
-
}
|
|
127
|
-
}
|