@seatmap.pro/renderer 1.55.2 → 1.56.5
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 +74 -0
- package/lib/index.d.ts +139 -7
- package/lib/index.js +1 -1
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @seatmap.pro/renderer
|
|
2
|
+
|
|
3
|
+
A powerful and flexible interactive seat map renderer for event ticketing systems.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Seatmap.pro Renderer is a high-performance JavaScript library for rendering interactive venue seating charts. It provides a complete solution for displaying, selecting, and managing seats for events, concerts, theaters, sports venues, and more.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Interactive seat selection and deselection
|
|
12
|
+
- Support for general admission areas
|
|
13
|
+
- Customizable seat and section styling
|
|
14
|
+
- Zoom and pan functionality
|
|
15
|
+
- Mobile-friendly with touch support
|
|
16
|
+
- High performance rendering using Canvas/WebGL
|
|
17
|
+
- Comprehensive event system for integration with ticketing platforms
|
|
18
|
+
- Accessibility features
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @seatmap.pro/renderer
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
or
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
yarn add @seatmap.pro/renderer
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Basic Usage
|
|
33
|
+
|
|
34
|
+
```javascript
|
|
35
|
+
import { SeatmapBookingRenderer } from '@seatmap.pro/renderer';
|
|
36
|
+
|
|
37
|
+
// Create a new renderer instance
|
|
38
|
+
const renderer = new SeatmapBookingRenderer({
|
|
39
|
+
container: document.getElementById('seatmap-container'),
|
|
40
|
+
onSeatSelect: (seat) => {
|
|
41
|
+
console.log('Seat selected:', seat);
|
|
42
|
+
},
|
|
43
|
+
onSchemaDataLoaded: () => {
|
|
44
|
+
console.log('Schema data loaded successfully');
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Load event data
|
|
49
|
+
renderer.loadEvent(eventId);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Documentation
|
|
53
|
+
|
|
54
|
+
For detailed documentation, visit our:
|
|
55
|
+
|
|
56
|
+
- [Knowledge Base](https://seatmap.pro/knowledge-base/) - Complete documentation for all Seatmap.pro components
|
|
57
|
+
- [Renderer Specification](https://seatmap.pro/knowledge-base/renderer/spec/) - Detailed API reference for the renderer
|
|
58
|
+
- [API Documentation](https://seatmap.pro/knowledge-base/api/v2/) - Additional API documentation
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
Check out our [examples page](https://seatmap.pro/knowledge-base/renderer/sdk/) for implementation samples.
|
|
63
|
+
|
|
64
|
+
## Product Website
|
|
65
|
+
|
|
66
|
+
For more information, pricing, and demos, visit [https://seatmap.pro](https://seatmap.pro).
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
This package is licensed under a commercial license. Please contact [support@seatmap.pro](mailto:support@seatmap.pro) for licensing information.
|
|
71
|
+
|
|
72
|
+
## Support
|
|
73
|
+
|
|
74
|
+
For support, please contact [support@seatmap.pro](mailto:support@seatmap.pro) or visit our [support portal](https://support.seatmap.pro).
|
package/lib/index.d.ts
CHANGED
|
@@ -1147,6 +1147,62 @@ interface IMinimapSettings {
|
|
|
1147
1147
|
*/
|
|
1148
1148
|
showCartPins?: boolean;
|
|
1149
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Loading phase identifiers for progress tracking.
|
|
1152
|
+
*/
|
|
1153
|
+
type LoadingPhase = 'schema' | 'prices' | 'rows' | 'background-blurred' | 'background-preview' | 'background-full' | 'processing';
|
|
1154
|
+
/**
|
|
1155
|
+
* Progress event data passed to onLoadProgress callback.
|
|
1156
|
+
*/
|
|
1157
|
+
interface ILoadProgressEvent {
|
|
1158
|
+
phase: LoadingPhase;
|
|
1159
|
+
progress: number;
|
|
1160
|
+
isIndeterminate: boolean;
|
|
1161
|
+
message: string;
|
|
1162
|
+
}
|
|
1163
|
+
/**
|
|
1164
|
+
* Background image loaded event data.
|
|
1165
|
+
* @hidden
|
|
1166
|
+
*/
|
|
1167
|
+
interface IBackgroundImageLoadedEvent {
|
|
1168
|
+
type: 'blurred' | 'preview' | 'full';
|
|
1169
|
+
loadTimeMs: number;
|
|
1170
|
+
sizeBytes?: number;
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Loader display style.
|
|
1174
|
+
*/
|
|
1175
|
+
type LoaderStyle = 'overlay' | 'top-bar';
|
|
1176
|
+
/**
|
|
1177
|
+
* Loader theme configuration.
|
|
1178
|
+
*/
|
|
1179
|
+
interface ILoaderTheme {
|
|
1180
|
+
overlayColor?: string;
|
|
1181
|
+
overlayOpacity?: number;
|
|
1182
|
+
progressBarColor?: string;
|
|
1183
|
+
progressBarBackgroundColor?: string;
|
|
1184
|
+
progressBarHeight?: number;
|
|
1185
|
+
textColor?: string;
|
|
1186
|
+
fontSize?: number;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Loader configuration settings.
|
|
1190
|
+
*/
|
|
1191
|
+
interface ILoaderSettings {
|
|
1192
|
+
enabled: boolean;
|
|
1193
|
+
style?: LoaderStyle;
|
|
1194
|
+
theme?: ILoaderTheme;
|
|
1195
|
+
showText?: boolean;
|
|
1196
|
+
texts?: {
|
|
1197
|
+
schema?: string;
|
|
1198
|
+
prices?: string;
|
|
1199
|
+
rows?: string;
|
|
1200
|
+
backgroundBlurred?: string;
|
|
1201
|
+
backgroundPreview?: string;
|
|
1202
|
+
backgroundFull?: string;
|
|
1203
|
+
processing?: string;
|
|
1204
|
+
};
|
|
1205
|
+
}
|
|
1150
1206
|
/**
|
|
1151
1207
|
* Configuration settings for the renderer.
|
|
1152
1208
|
* Defines various options that control the behavior and appearance of the renderer.
|
|
@@ -1162,6 +1218,12 @@ interface IRendererSettings {
|
|
|
1162
1218
|
* Can be 'local', 'stage', or 'production' (default).
|
|
1163
1219
|
*/
|
|
1164
1220
|
env?: string;
|
|
1221
|
+
/**
|
|
1222
|
+
* Base URL prefix for background images.
|
|
1223
|
+
* Used to resolve relative image paths to absolute URLs.
|
|
1224
|
+
* Absolute URLs (starting with http://, https://, or data:) are used as-is.
|
|
1225
|
+
*/
|
|
1226
|
+
backgroundImageBaseUrl?: string;
|
|
1165
1227
|
/**
|
|
1166
1228
|
* External price information for seats.
|
|
1167
1229
|
*/
|
|
@@ -1261,6 +1323,11 @@ interface IRendererSettings {
|
|
|
1261
1323
|
* Minimap configuration settings.
|
|
1262
1324
|
*/
|
|
1263
1325
|
minimap?: IMinimapSettings;
|
|
1326
|
+
/**
|
|
1327
|
+
* Loader configuration settings.
|
|
1328
|
+
* Controls the loading overlay with progress bar during event loading.
|
|
1329
|
+
*/
|
|
1330
|
+
loader?: ILoaderSettings;
|
|
1264
1331
|
/**
|
|
1265
1332
|
* Option to configure zoom settings
|
|
1266
1333
|
*/
|
|
@@ -1388,6 +1455,24 @@ interface IRendererSettings {
|
|
|
1388
1455
|
* schema being fully initialized.
|
|
1389
1456
|
*/
|
|
1390
1457
|
onSchemaDataLoaded?: () => void;
|
|
1458
|
+
/**
|
|
1459
|
+
* Fires during loading to report progress.
|
|
1460
|
+
*
|
|
1461
|
+
* @remarks
|
|
1462
|
+
*
|
|
1463
|
+
* Progress event contains phase, progress percentage (0-100),
|
|
1464
|
+
* whether the phase is indeterminate, and a status message.
|
|
1465
|
+
*/
|
|
1466
|
+
onLoadProgress?: (event: ILoadProgressEvent) => void;
|
|
1467
|
+
/**
|
|
1468
|
+
* Fires when a background image has been loaded.
|
|
1469
|
+
*
|
|
1470
|
+
* @remarks
|
|
1471
|
+
*
|
|
1472
|
+
* Provides the image type (blurred, preview, full), load time in ms, and size in bytes.
|
|
1473
|
+
* @hidden
|
|
1474
|
+
*/
|
|
1475
|
+
onBackgroundImageLoaded?: (event: IBackgroundImageLoadedEvent) => void;
|
|
1391
1476
|
/**
|
|
1392
1477
|
* Fires while panning.
|
|
1393
1478
|
*/
|
|
@@ -1592,6 +1677,43 @@ declare class OutlineLayer {
|
|
|
1592
1677
|
appendRowsOverlay(rowsFragment: string, css?: string): void;
|
|
1593
1678
|
}
|
|
1594
1679
|
|
|
1680
|
+
interface IRendererZoomControls {
|
|
1681
|
+
zoomToFit: () => void;
|
|
1682
|
+
getSectionsWithCoords: () => ISectionWithCoords[];
|
|
1683
|
+
}
|
|
1684
|
+
interface ISectionTransform {
|
|
1685
|
+
rotationAngle: number;
|
|
1686
|
+
center: IPoint;
|
|
1687
|
+
top: IPoint;
|
|
1688
|
+
section: IPoint;
|
|
1689
|
+
skewAngle: number;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
interface IStageLayer {
|
|
1693
|
+
destroy: () => void;
|
|
1694
|
+
backgroundElement: HTMLImageElement;
|
|
1695
|
+
redraw: () => void;
|
|
1696
|
+
drawOffscreenCanvas: () => void;
|
|
1697
|
+
drawOnscreenCanvas: (scale: number, translate: IPoint) => void;
|
|
1698
|
+
getVisibleSeats: () => any[];
|
|
1699
|
+
updateSize: () => void;
|
|
1700
|
+
sectionViewActive: boolean;
|
|
1701
|
+
getAnimationState: () => {
|
|
1702
|
+
inProgress: boolean;
|
|
1703
|
+
rotationAngle: number;
|
|
1704
|
+
skewAngle: number;
|
|
1705
|
+
duration: number;
|
|
1706
|
+
};
|
|
1707
|
+
applySectionViewAnimation: (section: ISectionWithCoords, options: IRendererZoomControls) => Promise<boolean>;
|
|
1708
|
+
getAnimationPoint: () => IPoint;
|
|
1709
|
+
sectionViewTransform: ISectionTransform;
|
|
1710
|
+
/**
|
|
1711
|
+
* Captures a snapshot of the full seatmap (background-sized) for use in minimap.
|
|
1712
|
+
* Should resolve after the first full render finishes.
|
|
1713
|
+
*/
|
|
1714
|
+
captureSeatmap: () => Promise<HTMLImageElement | null>;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1595
1717
|
/**
|
|
1596
1718
|
* @hidden
|
|
1597
1719
|
*/
|
|
@@ -1882,10 +2004,11 @@ declare class Renderer implements IRenderer {
|
|
|
1882
2004
|
private width;
|
|
1883
2005
|
private padding;
|
|
1884
2006
|
protected readonly context: Context;
|
|
1885
|
-
|
|
2007
|
+
protected stageLayer: IStageLayer;
|
|
1886
2008
|
private selectionLayer;
|
|
1887
2009
|
protected outlineLayer: OutlineLayer;
|
|
1888
2010
|
private minimapLayer?;
|
|
2011
|
+
private loaderLayer?;
|
|
1889
2012
|
private service;
|
|
1890
2013
|
private zoomToFitScale;
|
|
1891
2014
|
private isTouchMode;
|
|
@@ -1930,6 +2053,9 @@ declare class Renderer implements IRenderer {
|
|
|
1930
2053
|
* @returns The version string
|
|
1931
2054
|
*/
|
|
1932
2055
|
getVersion(): string;
|
|
2056
|
+
protected showLoader(): void;
|
|
2057
|
+
protected updateLoaderProgress(phase: LoadingPhase, phaseProgress?: number): void;
|
|
2058
|
+
protected completeLoader(): void;
|
|
1933
2059
|
/**
|
|
1934
2060
|
* Sets the interaction mode for the renderer.
|
|
1935
2061
|
*
|
|
@@ -2617,7 +2743,9 @@ interface IBookingRendererSettings extends IRendererSettings {
|
|
|
2617
2743
|
declare class SeatmapBookingRenderer extends Renderer {
|
|
2618
2744
|
private apiClient;
|
|
2619
2745
|
private stats;
|
|
2620
|
-
private tags
|
|
2746
|
+
private tags?;
|
|
2747
|
+
private lastSentViewBox?;
|
|
2748
|
+
private debugOverlay?;
|
|
2621
2749
|
/**
|
|
2622
2750
|
* Creates a new instance of the SeatmapBookingRenderer.
|
|
2623
2751
|
*
|
|
@@ -2634,7 +2762,7 @@ declare class SeatmapBookingRenderer extends Renderer {
|
|
|
2634
2762
|
*
|
|
2635
2763
|
* @throws {Error} Throws an error if the public key is undefined
|
|
2636
2764
|
*/
|
|
2637
|
-
constructor(element: HTMLElement, settings?: IBookingRendererSettings, tags?:
|
|
2765
|
+
constructor(element: HTMLElement, settings?: IBookingRendererSettings, tags?: Record<string, string | number | boolean>);
|
|
2638
2766
|
/**
|
|
2639
2767
|
* Gets the current view box properties.
|
|
2640
2768
|
*
|
|
@@ -2642,11 +2770,13 @@ declare class SeatmapBookingRenderer extends Renderer {
|
|
|
2642
2770
|
* @private
|
|
2643
2771
|
*/
|
|
2644
2772
|
private getViewBox;
|
|
2773
|
+
private hasViewBoxChanged;
|
|
2645
2774
|
/**
|
|
2646
2775
|
* Loads event's schema and prices.
|
|
2647
2776
|
*
|
|
2648
2777
|
* Fetches the schema, prices, and row SVG data for the specified event.
|
|
2649
|
-
*
|
|
2778
|
+
* Uses progressive loading: renders schema immediately with disabled interactions,
|
|
2779
|
+
* then enables interactions when prices arrive.
|
|
2650
2780
|
*
|
|
2651
2781
|
* @example
|
|
2652
2782
|
* ```js
|
|
@@ -2668,9 +2798,11 @@ declare class SeatmapBookingRenderer extends Renderer {
|
|
|
2668
2798
|
*
|
|
2669
2799
|
* @param eventId - Event GUID to load
|
|
2670
2800
|
* @param sectorId - Optional sector ID to show only a specific sector
|
|
2671
|
-
* @returns A promise that resolves when the
|
|
2801
|
+
* @returns A promise that resolves when the schema is loaded and rendered
|
|
2672
2802
|
*/
|
|
2673
2803
|
loadEvent(eventId: string, sectorId?: number): Promise<void>;
|
|
2804
|
+
private handlePricesLoaded;
|
|
2805
|
+
private setupEventHandlers;
|
|
2674
2806
|
/**
|
|
2675
2807
|
* Creates a statistics data object for seat selection/deselection events.
|
|
2676
2808
|
*
|
|
@@ -2696,7 +2828,7 @@ declare class SeatmapBookingRenderer extends Renderer {
|
|
|
2696
2828
|
* Package version information
|
|
2697
2829
|
* This file is automatically updated during the build process
|
|
2698
2830
|
*/
|
|
2699
|
-
declare const VERSION = "1.
|
|
2831
|
+
declare const VERSION = "1.56.5";
|
|
2700
2832
|
|
|
2701
2833
|
declare const defaultZoomSettings: IZoomSettings;
|
|
2702
2834
|
declare const mergeSettings: (defaults: IRendererSettings, settings?: Partial<IRendererSettings>) => IRendererSettings & Partial<IRendererSettings>;
|
|
@@ -2739,4 +2871,4 @@ declare class RotationAnimation {
|
|
|
2739
2871
|
getAnimation(): IRotationAnimation | null;
|
|
2740
2872
|
}
|
|
2741
2873
|
|
|
2742
|
-
export { BookingApiClient, type ById, type ColorById, type ColorSequenceSettings, type DeepPartial, type DestEvent, DestEventType, type IAdminRendererSettings, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IExtendedSeat, type IMinimapSettings, type IMouseMoveSrcEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, type IVisibilitySettings, type IZoomSettings, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, RotationAnimation, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, mergeSettings, sortPrices };
|
|
2874
|
+
export { BookingApiClient, type ById, type ColorById, type ColorSequenceSettings, type DeepPartial, type DestEvent, DestEventType, type IAdminRendererSettings, type IBackgroundImageLoadedEvent, type IBaseSeat, type IBaseSector, type IBasicSeatStyle, type IBeforeSeatDrawEvent, type IBookingRendererSettings, type ICart, type ICartGa, type ICartSeat, type IClickSrcEvent, type IColoredPrice, type IConfigurationDTO, type IDeselectDestEvent, type IDragEndSrcEvent, type IDragMoveSrcEvent, type IDragStartSrcEvent, type IExtendedSeat, type ILoadProgressEvent, type ILoaderSettings, type ILoaderTheme, type IMinimapSettings, type IMouseMoveSrcEvent, type IPanDestEvent, type IPanZoomDestEvent, type IPlainSeatsDTO, type IPngBackgroundDTO, type IPoint, type IPrice, type IPriceDTO, type IPriceId, type IPriceListDTO, type IRectSelectDestEvent, type IRemovedCartGa, type IRenderer, type IRendererAnimation, type IRendererMachineContext, type IRendererSeatStyleSettings, type IRendererSettings, type IRendererSvgSectionStylesSetting, type IRendererTheme, type IRowDTO, type ISVGBackgroundDTO, type ISchemaDTO, type ISeat, type ISeatCartSwitchDestEvent, type ISeatDTO, type ISeatMouseEnterDestEvent, type ISeatMouseLeaveDestEvent, type ISeatPriceScheme, type ISeatSelectDestEvent, type ISeatStyle, type ISection, type ISectionClickDestEvent, type ISectionMouseEnterDestEvent, type ISectionMouseLeaveDestEvent, type ISectionRect, type ISectionWithCoords, type ISector, type ISectorDTO, type ISpecialPrice, type ISpecialState, type ISvgSectionStyle, type IVenueDTO, type IVisibilitySettings, type IZoomSettings, type LoaderStyle, type LoadingPhase, type MinimapPosition, type Nullable, Renderer, type RendererMachine, type RendererMachineReducer, type RendererMachineService, RendererSelectMode, RendererTargetType, type RequestMetrics, RotationAnimation, type SeatFilter, type SeatInteractionState, SeatmapAdminRenderer, SeatmapBookingRenderer, type SrcEvent, SrcEventType, type TransformArray, VERSION, convertPricesToColored, convertPricesToColoredById, defaultZoomSettings, mergeSettings, sortPrices };
|