@zonetrix/viewer 1.0.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 +165 -0
- package/dist/components/SeatMapViewer.d.ts +18 -0
- package/dist/hooks/useConfigFetcher.d.ts +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +504 -0
- package/dist/index.mjs +7436 -0
- package/dist/types/index.d.ts +75 -0
- package/package.json +49 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export type SeatState = "available" | "reserved" | "selected" | "unavailable";
|
|
2
|
+
export type SeatShape = "circle" | "square" | "rounded-square";
|
|
3
|
+
export interface SeatData {
|
|
4
|
+
id: string;
|
|
5
|
+
state: SeatState;
|
|
6
|
+
shape?: SeatShape;
|
|
7
|
+
sectionName?: string;
|
|
8
|
+
rowLabel?: string;
|
|
9
|
+
columnLabel?: string;
|
|
10
|
+
price?: number;
|
|
11
|
+
seatNumber?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SerializedSeat {
|
|
14
|
+
id: string;
|
|
15
|
+
position: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
shape: SeatShape;
|
|
20
|
+
state: SeatState;
|
|
21
|
+
sectionName?: string;
|
|
22
|
+
rowLabel?: string;
|
|
23
|
+
columnLabel?: string;
|
|
24
|
+
seatNumber?: string;
|
|
25
|
+
price?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface SerializedSection {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
position: {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
config: any;
|
|
35
|
+
seatIds: string[];
|
|
36
|
+
}
|
|
37
|
+
export interface SerializedStage {
|
|
38
|
+
id: string;
|
|
39
|
+
position: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
config: any;
|
|
44
|
+
}
|
|
45
|
+
export interface ColorSettings {
|
|
46
|
+
canvasBackground: string;
|
|
47
|
+
stageColor: string;
|
|
48
|
+
seatAvailable: string;
|
|
49
|
+
seatReserved: string;
|
|
50
|
+
seatSelected: string;
|
|
51
|
+
seatUnavailable: string;
|
|
52
|
+
gridLines: string;
|
|
53
|
+
currency: string;
|
|
54
|
+
}
|
|
55
|
+
export interface SeatMapConfig {
|
|
56
|
+
version: string;
|
|
57
|
+
metadata: {
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
updatedAt: string;
|
|
62
|
+
venue?: string;
|
|
63
|
+
capacity?: number;
|
|
64
|
+
};
|
|
65
|
+
canvas: {
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
backgroundColor: string;
|
|
69
|
+
};
|
|
70
|
+
colors: ColorSettings;
|
|
71
|
+
seats: SerializedSeat[];
|
|
72
|
+
sections?: SerializedSection[];
|
|
73
|
+
stages?: SerializedStage[];
|
|
74
|
+
}
|
|
75
|
+
export declare const DEFAULT_COLORS: ColorSettings;
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zonetrix/viewer",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Lightweight React component for rendering interactive seat maps",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.mjs",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./styles.css": "./dist/style.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"dev": "vite build --watch"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"seat-map",
|
|
26
|
+
"seating",
|
|
27
|
+
"react",
|
|
28
|
+
"viewer",
|
|
29
|
+
"interactive",
|
|
30
|
+
"booking"
|
|
31
|
+
],
|
|
32
|
+
"author": "",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"fabric": "^6.7.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/react": "^19.2.0",
|
|
43
|
+
"@types/react-dom": "^19.2.0",
|
|
44
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
45
|
+
"typescript": "^5.8.3",
|
|
46
|
+
"vite": "^5.4.19",
|
|
47
|
+
"vite-plugin-dts": "^3.7.0"
|
|
48
|
+
}
|
|
49
|
+
}
|