@seatlayer/js 0.17.0 → 0.18.1

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
@@ -87,6 +87,11 @@ const designer = new EmbeddedDesigner({
87
87
  onPublished: ({ chartId }) => refreshVenue(chartId),
88
88
  onClose: () => closeVenueEditor(),
89
89
  onError: ({ code, message }) => showError(code ?? message),
90
+ // Mint a fresh session when the user retries an expired/failed editor:
91
+ onRequestRelaunch: async () => {
92
+ const next = await mintDesignerSession(session.chartId);
93
+ designer.setDesignerUrl(next.designerUrl);
94
+ },
90
95
  });
91
96
  designer.mount();
92
97
 
@@ -99,6 +104,24 @@ designer.destroy();
99
104
  Give the container a height, for example `min-height: 760px`. Keep the default
100
105
  `referrerPolicy: 'origin'`; the Designer uses it to verify the parent origin.
101
106
 
107
+ ### Built-in loading, error, and expiry states
108
+
109
+ By default the host paints a lightweight, branded skeleton inside the container
110
+ while the Designer boots, then removes it the moment the iframe reports `ready`.
111
+ If the session expires, the identity check fails, the iframe reports an error, or
112
+ it never becomes ready, the host swaps in a dark **"Try again"** card with copy
113
+ matched to the cause. The skeleton respects `prefers-reduced-motion` and adds no
114
+ CSS files or external assets.
115
+
116
+ | Option | Type | Default | What it does |
117
+ | --- | --- | --- | --- |
118
+ | `showLoadingState` | `boolean` | `true` | Render the built-in skeleton and error card. Set `false` when you draw your own chrome. |
119
+ | `loadingTimeoutMs` | `number` | `20000` | If `ready` never arrives within this window, show the error card with a timeout message. |
120
+ | `onRequestRelaunch` | `() => void` | — | Called by **"Try again"**. Mint a fresh session and call `setDesignerUrl()`; the iframe recreates and returns to loading. When omitted, "Try again" reloads the current URL in place. |
121
+
122
+ `setDesignerUrl()` always returns the host to the loading state, so a relaunch
123
+ flow needs no extra bookkeeping.
124
+
102
125
  ## API
103
126
 
104
127
  `new SeatingChart(options)` — options: `container` (selector or element, required),