bukazu-portal-react 4.0.0-beta.2 → 4.0.0-beta.4

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
@@ -6,7 +6,7 @@ A React component library that embeds the [Bukazu](https://www.bukazu.com) booki
6
6
 
7
7
  ## What is Bukazu?
8
8
 
9
- [Bukazu](https://www.bukazu.com) is an online booking and property-management platform for holiday rentals. It provides a fully-managed back-end (availability calendars, pricing, booking forms, guest reviews) and exposes that data through a GraphQL API. This library is the official front-end component that lets you surface Bukazu data on your own website without building the UI from scratch.
9
+ [Bukazu](https://www.bukazu.com) is an online booking and property-management platform for holiday rentals. It provides a fully-managed back-end (availability calendars, pricing, booking forms, guest reviews) and exposes that data through a REST API. This library is the official front-end component that lets you surface Bukazu data on your own website without building the UI from scratch.
10
10
 
11
11
  ### Modules included
12
12
 
@@ -98,6 +98,70 @@ Render the reviews page for a specific property by passing `objectCode` together
98
98
 
99
99
  ---
100
100
 
101
+ ## Direct website usage (no bundler required)
102
+
103
+ If you are not using a JavaScript bundler or a React application, you can use the self-contained **website build** instead. This single file includes React, every other dependency, and the stylesheet — drop it into your page and add a `<div>` with the right attributes.
104
+
105
+ ### 1. Download or reference the file
106
+
107
+ After installing the package, copy the file from the package (or reference it from a CDN/local path):
108
+
109
+ - `node_modules/bukazu-portal-react/build/portal.website.js`
110
+
111
+ The bundle injects its own `<style>` element, so no stylesheet link is required. A companion `node_modules/bukazu-portal-react/build/portal.website.css` is published as well, for pages whose Content-Security-Policy forbids inline styles (`style-src` without `'unsafe-inline'`).
112
+
113
+ ### 2. Add a host element
114
+
115
+ Place a `<div class="bukazu-app">` with the following HTML attributes wherever you want the portal to appear:
116
+
117
+ | Attribute | Required | Description |
118
+ |-----------|----------|-------------|
119
+ | `portal-code` | ✅ | Your Bukazu portal identifier |
120
+ | `object-code` | — | Property code (omit for the Search module) |
121
+ | `page` | — | Set to `"reviews"` for the Reviews module |
122
+ | `language` | — | Locale: `en` \| `nl` \| `de` \| `fr` \| `es` \| `it`, or a full BCP-47 tag such as `nl-NL` (default: `en`) |
123
+ | `filters` | — | JSON-encoded filters object (see filter keys in the props table below) |
124
+ | `sentry-dsn` | — | Sentry DSN for error reporting. Defaults to the DSN baked into the bundle; pass `off` to disable reporting |
125
+
126
+ The host element is found by the `bukazu-app` class. Pages that carry no such
127
+ element fall back to a single element with `id="bukazu-app"`, which is what older
128
+ embed snippets use.
129
+
130
+ ### 3. Include the script and stylesheet
131
+
132
+ ```html
133
+ <!DOCTYPE html>
134
+ <html lang="en">
135
+ <head>
136
+ <meta charset="UTF-8" />
137
+ <title>My website</title>
138
+ </head>
139
+ <body>
140
+
141
+ <!-- Calendar for a specific property -->
142
+ <div class="bukazu-app"
143
+ portal-code="YOUR_PORTAL_CODE"
144
+ object-code="YOUR_OBJECT_CODE"
145
+ language="en">
146
+ </div>
147
+
148
+ <!-- Property search page -->
149
+ <div class="bukazu-app"
150
+ portal-code="YOUR_PORTAL_CODE"
151
+ language="en">
152
+ </div>
153
+
154
+ <script src="portal.website.js"></script>
155
+ </body>
156
+ </html>
157
+ ```
158
+
159
+ The script automatically initialises every `.bukazu-app` element it finds on the page when the DOM is ready. Multiple portals on the same page are supported, and loading the bundle twice is harmless — it re-renders the existing portals rather than mounting duplicates.
160
+
161
+ For advanced use the bundle exposes `BukazuPortal.init()`, `BukazuPortal.mountPortal(element)` and `BukazuPortal.version` as globals, so you can mount a portal into an element you inserted after page load.
162
+
163
+ ---
164
+
101
165
  ## Props
102
166
 
103
167
  | Prop | Type | Required | Default | Description |
@@ -107,7 +171,7 @@ Render the reviews page for a specific property by passing `objectCode` together
107
171
  | `pageType` | `string` | — | — | Set to `"reviews"` to render the Reviews module. |
108
172
  | `locale` | `string` | — | `"en"` | Display language. Supported values: `en`, `nl`, `de`, `fr`, `es`, `it`. |
109
173
  | `filters` | `FiltersType` | — | `{}` | Pre-set filter values for the Search module (see below). |
110
- | `api_url` | `string` | — | `https://api.bukazu.com/graphql` | Override the GraphQL endpoint (useful for staging environments). |
174
+ | `api_url` | `string` | — | `https://api.bukazu.com` | Override the API origin (useful for staging environments). Only the origin is used, so an old `.../graphql` URL keeps working. |
111
175
 
112
176
  ### `filters` object
113
177