bukazu-portal-react 4.0.0-beta.2 → 4.0.0-beta.3
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 +59 -2
- package/build/portal.es.js +147 -384
- package/build/portal.website.css +2 -0
- package/build/portal.website.js +1 -0
- package/package.json +5 -5
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
|
|
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,63 @@ 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 and all other dependencies — just drop two files into your page and add a `<div>` with the right attributes.
|
|
104
|
+
|
|
105
|
+
### 1. Download or reference the files
|
|
106
|
+
|
|
107
|
+
After installing the package, copy the files from the package (or reference them from a CDN/local path):
|
|
108
|
+
|
|
109
|
+
- `node_modules/bukazu-portal-react/build/portal.website.js`
|
|
110
|
+
- `node_modules/bukazu-portal-react/build/portal.website.css`
|
|
111
|
+
|
|
112
|
+
### 2. Add a host element
|
|
113
|
+
|
|
114
|
+
Place a `<div class="bukazu-app">` with the following HTML attributes wherever you want the portal to appear:
|
|
115
|
+
|
|
116
|
+
| Attribute | Required | Description |
|
|
117
|
+
|-----------|----------|-------------|
|
|
118
|
+
| `portal-code` | ✅ | Your Bukazu portal identifier |
|
|
119
|
+
| `object-code` | — | Property code (omit for the Search module) |
|
|
120
|
+
| `page` | — | Set to `"reviews"` for the Reviews module |
|
|
121
|
+
| `language` | — | Locale: `en` \| `nl` \| `de` \| `fr` \| `es` \| `it` (default: `en`) |
|
|
122
|
+
| `filters` | — | JSON-encoded filters object (see filter keys in the props table below) |
|
|
123
|
+
|
|
124
|
+
### 3. Include the script and stylesheet
|
|
125
|
+
|
|
126
|
+
```html
|
|
127
|
+
<!DOCTYPE html>
|
|
128
|
+
<html lang="en">
|
|
129
|
+
<head>
|
|
130
|
+
<meta charset="UTF-8" />
|
|
131
|
+
<title>My website</title>
|
|
132
|
+
<link rel="stylesheet" href="portal.website.css" />
|
|
133
|
+
</head>
|
|
134
|
+
<body>
|
|
135
|
+
|
|
136
|
+
<!-- Calendar for a specific property -->
|
|
137
|
+
<div class="bukazu-app"
|
|
138
|
+
portal-code="YOUR_PORTAL_CODE"
|
|
139
|
+
object-code="YOUR_OBJECT_CODE"
|
|
140
|
+
language="en">
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
<!-- Property search page -->
|
|
144
|
+
<div class="bukazu-app"
|
|
145
|
+
portal-code="YOUR_PORTAL_CODE"
|
|
146
|
+
language="en">
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<script src="portal.website.js"></script>
|
|
150
|
+
</body>
|
|
151
|
+
</html>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
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.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
101
158
|
## Props
|
|
102
159
|
|
|
103
160
|
| Prop | Type | Required | Default | Description |
|
|
@@ -107,7 +164,7 @@ Render the reviews page for a specific property by passing `objectCode` together
|
|
|
107
164
|
| `pageType` | `string` | — | — | Set to `"reviews"` to render the Reviews module. |
|
|
108
165
|
| `locale` | `string` | — | `"en"` | Display language. Supported values: `en`, `nl`, `de`, `fr`, `es`, `it`. |
|
|
109
166
|
| `filters` | `FiltersType` | — | `{}` | Pre-set filter values for the Search module (see below). |
|
|
110
|
-
| `api_url` | `string` | — | `https://api.bukazu.com
|
|
167
|
+
| `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
168
|
|
|
112
169
|
### `filters` object
|
|
113
170
|
|