@seatlayer/react 0.92.5 → 0.93.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 +27 -27
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -26,16 +26,16 @@ selects and **holds**, and your trusted server **books** the hold.
|
|
|
26
26
|
|
|
27
27
|
## What is included
|
|
28
28
|
|
|
29
|
-
- `SeatingChart
|
|
29
|
+
- `SeatingChart`: the lower-level interactive chart, mounted into a plain `<div>`
|
|
30
30
|
your styles own.
|
|
31
|
-
- `SeatPicker
|
|
31
|
+
- `SeatPicker`: the complete buyer experience: map, legend, tray, pricing, and
|
|
32
32
|
the checkout hand-off.
|
|
33
|
-
- `SeasonPicker
|
|
33
|
+
- `SeasonPicker`: fixed-inclusion Season selection and returning-holder intent
|
|
34
34
|
with the same typed lifecycle and imperative-handle conventions.
|
|
35
|
-
- `SeatManager
|
|
35
|
+
- `SeatManager`: the organizer control room, for dashboards that monitor and
|
|
36
36
|
block live inventory.
|
|
37
|
-
- `EmbeddedDesigner
|
|
38
|
-
- `SeatPickerWidget` and `attachPickerFrame
|
|
37
|
+
- `EmbeddedDesigner`: a hosted chart Designer inside your own application.
|
|
38
|
+
- `SeatPickerWidget` and `attachPickerFrame`: the framework-agnostic modal and
|
|
39
39
|
iframe helpers, re-exported so a React host depends on this package alone.
|
|
40
40
|
- TypeScript declarations for ESM (`dist/index.d.ts`) and CommonJS
|
|
41
41
|
(`dist/index.d.cts`), plus the `@seatlayer/react/manager` subpath.
|
|
@@ -44,7 +44,7 @@ selects and **holds**, and your trusted server **books** the hold.
|
|
|
44
44
|
|
|
45
45
|
- React 17 or newer (declared as a peer dependency).
|
|
46
46
|
- A browser DOM. The chart is created inside an effect, and this package ships
|
|
47
|
-
no `'use client'` banner of its own
|
|
47
|
+
no `'use client'` banner of its own. In the Next.js App Router, mark the
|
|
48
48
|
component that imports it.
|
|
49
49
|
|
|
50
50
|
## Install
|
|
@@ -106,8 +106,8 @@ apply the package price, tax, and payment decision before booking the
|
|
|
106
106
|
identity-only allocation. `SeasonPicker` is supported in `@seatlayer/react`
|
|
107
107
|
`0.72.0` and newer.
|
|
108
108
|
|
|
109
|
-
For the complete buyer experience
|
|
110
|
-
hand-off
|
|
109
|
+
For the complete buyer experience (map, legend, priced tray, and the checkout
|
|
110
|
+
hand-off), render `SeatPicker` instead:
|
|
111
111
|
|
|
112
112
|
```tsx
|
|
113
113
|
import { SeatPicker } from '@seatlayer/react';
|
|
@@ -198,7 +198,7 @@ Extends the vanilla SDK options minus `container` (the component owns its own mo
|
|
|
198
198
|
| `onHold` | `(result) => void` | Fires when seats are held; hand `holdId` to your server. |
|
|
199
199
|
| `onHoldRestored` | `(result) => void` | Fires after `resumeHold()` verifies an active hold. |
|
|
200
200
|
| `onError` | `(err) => void` | Fires on errors. |
|
|
201
|
-
| `className` / `style` |
|
|
201
|
+
| `className` / `style` | not applicable | Applied to the container element. |
|
|
202
202
|
|
|
203
203
|
Changing a callback prop does **not** rebuild the canvas. `selectedObjects` and
|
|
204
204
|
`selectableObjects` are initial values; use the imperative methods for later
|
|
@@ -217,7 +217,7 @@ and books** the hold after payment or order validation.
|
|
|
217
217
|
- Send only the `holdId` and your normal checkout context to your backend.
|
|
218
218
|
- Calculate the charge from server-inspected hold items, not from browser input.
|
|
219
219
|
- Reuse your stable order id as `bookingRef` so a retried booking is idempotent.
|
|
220
|
-
- Organizer surfaces take a short-lived, event-scoped `mse_` browser grant
|
|
220
|
+
- Organizer surfaces take a short-lived, event-scoped `mse_` browser grant,
|
|
221
221
|
never a tenant `sk_` secret.
|
|
222
222
|
|
|
223
223
|
Read [how the integration works](https://docs.seatlayer.io/start/how-it-works/)
|
|
@@ -244,7 +244,7 @@ are unsupported in React/browser code and must stay on your server. Keep the
|
|
|
244
244
|
grant in memory, never in a URL, browser storage, or logs. Monitor, Inspect,
|
|
245
245
|
Block/unblock, fullscreen, presence, exact configured
|
|
246
246
|
booked value, booking velocity, and the **Booking momentum** overlay are one
|
|
247
|
-
shared package surface
|
|
247
|
+
shared package surface, not host-owned tabs.
|
|
248
248
|
Block mode includes explicit multi-select category controls plus a searchable,
|
|
249
249
|
section-filtered blocked-inventory list for restoring specific seats to sale.
|
|
250
250
|
Select mode adds host-owned initial/programmatic selection, availability policy,
|
|
@@ -273,7 +273,7 @@ compact embeds, and the buyer SDK remains unchanged when manager options are off
|
|
|
273
273
|
## Embed the chart Designer
|
|
274
274
|
|
|
275
275
|
`EmbeddedDesigner` gives an organizer the hosted Designer inside your React
|
|
276
|
-
application. Mint `designerUrl` from your backend
|
|
276
|
+
application. Mint `designerUrl` from your backend, never from a browser using an
|
|
277
277
|
account secret key. The component verifies messages by iframe source, Designer origin,
|
|
278
278
|
and the chart/workspace ids you provide.
|
|
279
279
|
|
|
@@ -325,31 +325,31 @@ with cause-specific copy. The skeleton honors `prefers-reduced-motion`.
|
|
|
325
325
|
| --- | --- | --- | --- |
|
|
326
326
|
| `showLoadingState` | `boolean?` | `true` | Render the built-in skeleton and error card. Set `false` to supply your own chrome. |
|
|
327
327
|
| `loadingTimeoutMs` | `number?` | `20000` | Show the error card if `ready` never arrives within this window. |
|
|
328
|
-
| `onRequestRelaunch` | `() => void` |
|
|
328
|
+
| `onRequestRelaunch` | `() => void` | none | Called by **"Try again"** _and_ by automatic renewal (below). Mint a fresh session and set a new `designerUrl` (which recreates the iframe and returns to loading). When omitted, "Try again" reloads the current URL. |
|
|
329
329
|
| `autoRenewSession` | `boolean?` | `true`¹ | Silently renew the session before it expires and auto-recover once if an expiry error slips through. ¹Defaults `true` only when `onRequestRelaunch` is provided; a no-op without it. Set `false` for fully manual "Try again". |
|
|
330
330
|
|
|
331
|
-
All props are optional and additive
|
|
331
|
+
All props are optional and additive: existing integrations keep working
|
|
332
332
|
unchanged.
|
|
333
333
|
|
|
334
334
|
### Session lifecycle
|
|
335
335
|
|
|
336
336
|
Designer sessions are **short-lived by design**: your backend mints a `dse_`
|
|
337
337
|
token (default 1 hour, up to 4 hours via `expiresInSeconds`) baked into
|
|
338
|
-
`designerUrl`. Choose a TTL that matches how long organizers actually edit
|
|
338
|
+
`designerUrl`. Choose a TTL that matches how long organizers actually edit: the
|
|
339
339
|
renewal below keeps even a multi-hour session alive, so you needn't over-provision.
|
|
340
340
|
|
|
341
341
|
Pass `onRequestRelaunch` that mints (and awaits) a fresh session and updates the
|
|
342
342
|
`designerUrl` state, and the component makes expiry a non-event:
|
|
343
343
|
|
|
344
|
-
- **Silent proactive renewal
|
|
344
|
+
- **Silent proactive renewal**: from each `ready`'s `expiresAt` it schedules an
|
|
345
345
|
automatic relaunch shortly before the session lapses (~3 min ahead, or after 80%
|
|
346
346
|
of the remaining life for a sub-15-minute TTL, never sooner than 30s after
|
|
347
347
|
`ready`), re-armed on every `ready`.
|
|
348
|
-
- **Automatic expiry recovery
|
|
348
|
+
- **Automatic expiry recovery**: if an expiry error slips through anyway, it makes
|
|
349
349
|
**one** automatic relaunch attempt before showing the "Try again" card.
|
|
350
350
|
|
|
351
351
|
The wrapper **recreates the iframe whenever `designerUrl` changes**, and
|
|
352
|
-
**in-progress work is autosaved server-side**, so relaunching is safe
|
|
352
|
+
**in-progress work is autosaved server-side**, so relaunching is safe: the
|
|
353
353
|
organizer's chart is restored right where they left off.
|
|
354
354
|
|
|
355
355
|
```tsx
|
|
@@ -401,12 +401,12 @@ throwing, so a ref used one frame early is safe.
|
|
|
401
401
|
| `onSelectionLimit` | Active numeric cap |
|
|
402
402
|
| `onHold` | `HoldResult` |
|
|
403
403
|
| `onHoldRestored` | `HoldResult` |
|
|
404
|
-
| `onHoldExpired` |
|
|
404
|
+
| `onHoldExpired` | no payload |
|
|
405
405
|
| `onGAClick` | `GAAreaAvailability` |
|
|
406
406
|
| `onError` | `unknown` |
|
|
407
407
|
| `onDeckTap` | `string` (floor id) |
|
|
408
|
-
| `onHint` | `string \| null
|
|
409
|
-
| `onSeatHover` | `SeatHoverDetails \| null
|
|
408
|
+
| `onHint` | `string \| null`: `null` clears the hint |
|
|
409
|
+
| `onSeatHover` | `SeatHoverDetails \| null`: `null` when the pointer leaves |
|
|
410
410
|
| `onAccessExpired` | `BuyerAccessExpiredEvent` |
|
|
411
411
|
| `onAccessUnavailable` | `BuyerAccessUnavailableEvent` |
|
|
412
412
|
| `onSelectedObjectUnavailable` | `SelectedObjectUnavailableEvent` |
|
|
@@ -425,7 +425,7 @@ covers props, events, holds, and checkout in depth.
|
|
|
425
425
|
### Is this a real React component or an iframe?
|
|
426
426
|
|
|
427
427
|
`SeatingChart`, `SeatPicker`, and `SeatManager` are real React components that
|
|
428
|
-
render a plain `<div>` into your own tree
|
|
428
|
+
render a plain `<div>` into your own tree, with no iframe, no portal, and no
|
|
429
429
|
stylesheet of their own to fight with. `EmbeddedDesigner` is the one exception:
|
|
430
430
|
the organizer Designer is deliberately hosted in a sandboxed iframe so no
|
|
431
431
|
Designer credential ever reaches your bundle. If you *want* an iframe for the
|
|
@@ -434,7 +434,7 @@ buyer picker, `attachPickerFrame` is exported for that.
|
|
|
434
434
|
### What is the difference between `SeatPicker` and `SeatingChart`?
|
|
435
435
|
|
|
436
436
|
`SeatingChart` is the chart alone: it draws the venue, manages selection, and
|
|
437
|
-
hands you the seats
|
|
437
|
+
hands you the seats, and you build the surrounding UI. `SeatPicker` is the complete
|
|
438
438
|
buyer experience with legend, priced tray, hold timer, and checkout hand-off
|
|
439
439
|
already built. Start with `SeatPicker` if you want a working ticket flow today,
|
|
440
440
|
and drop to `SeatingChart` when your design system owns the chrome.
|
|
@@ -443,8 +443,8 @@ and drop to `SeatingChart` when your design system owns the chrome.
|
|
|
443
443
|
|
|
444
444
|
When a buyer commits to a selection, `hold()` reserves that inventory against
|
|
445
445
|
concurrent buyers for a limited checkout window and returns an opaque `holdId`.
|
|
446
|
-
The hold lapses on its own if checkout never completes
|
|
447
|
-
the app to return the buyer to the map
|
|
446
|
+
The hold lapses on its own if checkout never completes. `onHoldExpired` tells
|
|
447
|
+
the app to return the buyer to the map, and `resumeHold()` restores it after a
|
|
448
448
|
same-tab checkout navigation or a reload. This is what prevents double-selling
|
|
449
449
|
without locking seats forever.
|
|
450
450
|
|
|
@@ -463,7 +463,7 @@ without it, no payment code is downloaded.
|
|
|
463
463
|
You can explore a live seating chart in the browser at the
|
|
464
464
|
[buyer seat-map demo](https://app.seatlayer.io/demo/play/grand-theatre) with no
|
|
465
465
|
account. Rendering your own venue needs an event key, because the chart and its
|
|
466
|
-
availability are served by the SeatLayer API
|
|
466
|
+
availability are served by the SeatLayer API: create a free test event for
|
|
467
467
|
that, which books no real inventory.
|
|
468
468
|
|
|
469
469
|
### Does it work with Next.js and other React frameworks?
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatlayer/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "SeatLayer's official React seating chart and seat map SDK
|
|
3
|
+
"version": "0.93.0",
|
|
4
|
+
"description": "SeatLayer's official React seating chart and seat map SDK: live availability, seat selection, temporary holds, and a typed TypeScript API for ticketing apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "SeatLayer",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"typescript"
|
|
74
74
|
],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@seatlayer/core": "0.
|
|
77
|
-
"@seatlayer/js": "0.
|
|
76
|
+
"@seatlayer/core": "0.93.0",
|
|
77
|
+
"@seatlayer/js": "0.93.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"react": ">=17.0.0"
|