@zonetrix/shared 2.0.0 → 2.2.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 CHANGED
@@ -22,6 +22,8 @@ pnpm add @zonetrix/shared
22
22
  - ✅ **Validation** - Built-in configuration validation
23
23
  - 🔧 **Utilities** - Helper functions for config manipulation
24
24
  - 🎨 **Default Settings** - Pre-configured color schemes and settings
25
+ - 🏢 **Multi-floor Support** - Organize seats and stages across multiple floors
26
+ - 👁️ **Hidden Seats** - Support for hidden/invisible seats in layouts
25
27
  - 📦 **Zero dependencies** - Lightweight and fast
26
28
 
27
29
  ## Type Definitions
@@ -37,12 +39,13 @@ import {
37
39
  SeatState,
38
40
  SeatShape,
39
41
  ColorSettings,
42
+ FloorConfig,
40
43
  } from '@zonetrix/shared';
41
44
  ```
42
45
 
43
46
  #### SeatState
44
47
  ```typescript
45
- type SeatState = 'available' | 'reserved' | 'selected' | 'unavailable';
48
+ type SeatState = 'available' | 'reserved' | 'selected' | 'unavailable' | 'hidden';
46
49
  ```
47
50
 
48
51
  #### SeatShape
@@ -62,6 +65,7 @@ interface SerializedSeat {
62
65
  columnLabel?: string;
63
66
  seatNumber?: string;
64
67
  price?: number;
68
+ floorId?: string; // Floor reference for multi-floor venues
65
69
  }
66
70
  ```
67
71
 
@@ -74,11 +78,22 @@ interface ColorSettings {
74
78
  seatReserved: string;
75
79
  seatSelected: string;
76
80
  seatUnavailable: string;
81
+ seatHidden: string;
77
82
  gridLines: string;
78
83
  currency: string;
79
84
  }
80
85
  ```
81
86
 
87
+ #### FloorConfig
88
+ ```typescript
89
+ interface FloorConfig {
90
+ id: string;
91
+ name: string;
92
+ order: number;
93
+ color?: string;
94
+ }
95
+ ```
96
+
82
97
  #### SeatMapConfig
83
98
  ```typescript
84
99
  interface SeatMapConfig {
@@ -100,6 +115,7 @@ interface SeatMapConfig {
100
115
  seats: SerializedSeat[];
101
116
  sections?: SerializedSection[];
102
117
  stages?: SerializedStage[];
118
+ floors?: FloorConfig[]; // Multi-floor venue support
103
119
  }
104
120
  ```
105
121
 
@@ -274,6 +290,7 @@ console.log(DEFAULT_COLORS);
274
290
  // seatReserved: '#FCEA00',
275
291
  // seatSelected: '#3A7DE5',
276
292
  // seatUnavailable: '#6b7280',
293
+ // seatHidden: '#4a4a4a',
277
294
  // gridLines: '#404040',
278
295
  // currency: 'KD'
279
296
  // }
package/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * Centralized type definitions for the Seat Map Studio packages
3
3
  */
4
- type SeatState = "available" | "reserved" | "selected" | "unavailable";
4
+ type SeatState = "available" | "reserved" | "selected" | "unavailable" | "hidden";
5
5
  type SeatShape = "circle" | "square" | "rounded-square";
6
- type Tool = "select" | "seat" | "row" | "section" | "stage";
6
+ type Tool = "select" | "seat" | "row" | "section" | "object";
7
7
  type EditorMode = "edit" | "read";
8
+ type ObjectType = "stage" | "table" | "wall" | "barrier" | "dj-booth" | "bar" | "entry-exit" | "custom";
8
9
  /**
9
10
  * Seat data structure used in the editor and viewer
10
11
  */
@@ -16,6 +17,7 @@ interface SeatData {
16
17
  columnLabel?: string;
17
18
  price?: number;
18
19
  seatNumber?: string;
20
+ floorId?: string;
19
21
  }
20
22
  /**
21
23
  * Section configuration for creating seat groups
@@ -47,6 +49,22 @@ interface StageConfig {
47
49
  height: number;
48
50
  rotation?: number;
49
51
  color?: string;
52
+ floorId?: string;
53
+ }
54
+ /**
55
+ * Object configuration (extends StageConfig with object type support)
56
+ */
57
+ interface ObjectConfig extends StageConfig {
58
+ objectType?: ObjectType;
59
+ }
60
+ /**
61
+ * Floor configuration for multi-floor venues
62
+ */
63
+ interface FloorConfig {
64
+ id: string;
65
+ name: string;
66
+ order: number;
67
+ color?: string;
50
68
  }
51
69
  /**
52
70
  * Color settings for customizing the appearance
@@ -58,6 +76,7 @@ interface ColorSettings {
58
76
  seatReserved: string;
59
77
  seatSelected: string;
60
78
  seatUnavailable: string;
79
+ seatHidden: string;
61
80
  gridLines: string;
62
81
  currency: string;
63
82
  }
@@ -108,6 +127,7 @@ interface SerializedSeat {
108
127
  columnLabel?: string;
109
128
  seatNumber?: string;
110
129
  price?: number;
130
+ floorId?: string;
111
131
  }
112
132
  /**
113
133
  * Serialized section for JSON export/import
@@ -132,6 +152,7 @@ interface SerializedStage {
132
152
  y: number;
133
153
  };
134
154
  config: StageConfig;
155
+ floorId?: string;
135
156
  }
136
157
  /**
137
158
  * Canvas configuration for export/import
@@ -164,6 +185,7 @@ interface SeatMapConfig {
164
185
  seats: SerializedSeat[];
165
186
  sections?: SerializedSection[];
166
187
  stages?: SerializedStage[];
188
+ floors?: FloorConfig[];
167
189
  }
168
190
  /**
169
191
  * Validation result for config validation
@@ -232,4 +254,4 @@ declare function importConfigFromJSON(jsonString: string): SeatMapConfig;
232
254
  */
233
255
  declare function downloadConfigAsFile(config: SeatMapConfig, filename?: string): void;
234
256
 
235
- export { type AlignmentGuide, type BookingSelection, type CanvasConfig, type CanvasState, type ColorSettings, DEFAULT_COLORS, type EditorMode, type RowPricing, type SeatData, type SeatMapConfig, type SeatMapMetadata, type SeatShape, type SeatState, type SectionConfig, type SerializedSeat, type SerializedSection, type SerializedStage, type StageConfig, type Tool, type ValidationResult, applySeatStateOverrides, calculateAvailableSeats, calculateCapacity, calculateSeatPrice, cloneConfig, createDefaultConfig, downloadConfigAsFile, exportConfigAsJSON, formatDate, generateId, getSelectedSeats, importConfigFromJSON, updateConfigTimestamp, validateSeatMapConfig };
257
+ export { type AlignmentGuide, type BookingSelection, type CanvasConfig, type CanvasState, type ColorSettings, DEFAULT_COLORS, type EditorMode, type ObjectConfig, type ObjectType, type RowPricing, type SeatData, type SeatMapConfig, type SeatMapMetadata, type SeatShape, type SeatState, type SectionConfig, type SerializedSeat, type SerializedSection, type SerializedStage, type StageConfig, type Tool, type ValidationResult, applySeatStateOverrides, calculateAvailableSeats, calculateCapacity, calculateSeatPrice, cloneConfig, createDefaultConfig, downloadConfigAsFile, exportConfigAsJSON, formatDate, generateId, getSelectedSeats, importConfigFromJSON, updateConfigTimestamp, validateSeatMapConfig };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * Centralized type definitions for the Seat Map Studio packages
3
3
  */
4
- type SeatState = "available" | "reserved" | "selected" | "unavailable";
4
+ type SeatState = "available" | "reserved" | "selected" | "unavailable" | "hidden";
5
5
  type SeatShape = "circle" | "square" | "rounded-square";
6
- type Tool = "select" | "seat" | "row" | "section" | "stage";
6
+ type Tool = "select" | "seat" | "row" | "section" | "object";
7
7
  type EditorMode = "edit" | "read";
8
+ type ObjectType = "stage" | "table" | "wall" | "barrier" | "dj-booth" | "bar" | "entry-exit" | "custom";
8
9
  /**
9
10
  * Seat data structure used in the editor and viewer
10
11
  */
@@ -16,6 +17,7 @@ interface SeatData {
16
17
  columnLabel?: string;
17
18
  price?: number;
18
19
  seatNumber?: string;
20
+ floorId?: string;
19
21
  }
20
22
  /**
21
23
  * Section configuration for creating seat groups
@@ -47,6 +49,22 @@ interface StageConfig {
47
49
  height: number;
48
50
  rotation?: number;
49
51
  color?: string;
52
+ floorId?: string;
53
+ }
54
+ /**
55
+ * Object configuration (extends StageConfig with object type support)
56
+ */
57
+ interface ObjectConfig extends StageConfig {
58
+ objectType?: ObjectType;
59
+ }
60
+ /**
61
+ * Floor configuration for multi-floor venues
62
+ */
63
+ interface FloorConfig {
64
+ id: string;
65
+ name: string;
66
+ order: number;
67
+ color?: string;
50
68
  }
51
69
  /**
52
70
  * Color settings for customizing the appearance
@@ -58,6 +76,7 @@ interface ColorSettings {
58
76
  seatReserved: string;
59
77
  seatSelected: string;
60
78
  seatUnavailable: string;
79
+ seatHidden: string;
61
80
  gridLines: string;
62
81
  currency: string;
63
82
  }
@@ -108,6 +127,7 @@ interface SerializedSeat {
108
127
  columnLabel?: string;
109
128
  seatNumber?: string;
110
129
  price?: number;
130
+ floorId?: string;
111
131
  }
112
132
  /**
113
133
  * Serialized section for JSON export/import
@@ -132,6 +152,7 @@ interface SerializedStage {
132
152
  y: number;
133
153
  };
134
154
  config: StageConfig;
155
+ floorId?: string;
135
156
  }
136
157
  /**
137
158
  * Canvas configuration for export/import
@@ -164,6 +185,7 @@ interface SeatMapConfig {
164
185
  seats: SerializedSeat[];
165
186
  sections?: SerializedSection[];
166
187
  stages?: SerializedStage[];
188
+ floors?: FloorConfig[];
167
189
  }
168
190
  /**
169
191
  * Validation result for config validation
@@ -232,4 +254,4 @@ declare function importConfigFromJSON(jsonString: string): SeatMapConfig;
232
254
  */
233
255
  declare function downloadConfigAsFile(config: SeatMapConfig, filename?: string): void;
234
256
 
235
- export { type AlignmentGuide, type BookingSelection, type CanvasConfig, type CanvasState, type ColorSettings, DEFAULT_COLORS, type EditorMode, type RowPricing, type SeatData, type SeatMapConfig, type SeatMapMetadata, type SeatShape, type SeatState, type SectionConfig, type SerializedSeat, type SerializedSection, type SerializedStage, type StageConfig, type Tool, type ValidationResult, applySeatStateOverrides, calculateAvailableSeats, calculateCapacity, calculateSeatPrice, cloneConfig, createDefaultConfig, downloadConfigAsFile, exportConfigAsJSON, formatDate, generateId, getSelectedSeats, importConfigFromJSON, updateConfigTimestamp, validateSeatMapConfig };
257
+ export { type AlignmentGuide, type BookingSelection, type CanvasConfig, type CanvasState, type ColorSettings, DEFAULT_COLORS, type EditorMode, type ObjectConfig, type ObjectType, type RowPricing, type SeatData, type SeatMapConfig, type SeatMapMetadata, type SeatShape, type SeatState, type SectionConfig, type SerializedSeat, type SerializedSection, type SerializedStage, type StageConfig, type Tool, type ValidationResult, applySeatStateOverrides, calculateAvailableSeats, calculateCapacity, calculateSeatPrice, cloneConfig, createDefaultConfig, downloadConfigAsFile, exportConfigAsJSON, formatDate, generateId, getSelectedSeats, importConfigFromJSON, updateConfigTimestamp, validateSeatMapConfig };
package/dist/index.js CHANGED
@@ -42,10 +42,11 @@ module.exports = __toCommonJS(index_exports);
42
42
  var DEFAULT_COLORS = {
43
43
  canvasBackground: "#1a1a1a",
44
44
  stageColor: "#808080",
45
- seatAvailable: "#2C2B30",
45
+ seatAvailable: "#808080",
46
46
  seatReserved: "#FCEA00",
47
47
  seatSelected: "#3A7DE5",
48
48
  seatUnavailable: "#6b7280",
49
+ seatHidden: "#4a4a4a",
49
50
  gridLines: "#404040",
50
51
  currency: "KD"
51
52
  };
package/dist/index.mjs CHANGED
@@ -2,10 +2,11 @@
2
2
  var DEFAULT_COLORS = {
3
3
  canvasBackground: "#1a1a1a",
4
4
  stageColor: "#808080",
5
- seatAvailable: "#2C2B30",
5
+ seatAvailable: "#808080",
6
6
  seatReserved: "#FCEA00",
7
7
  seatSelected: "#3A7DE5",
8
8
  seatUnavailable: "#6b7280",
9
+ seatHidden: "#4a4a4a",
9
10
  gridLines: "#404040",
10
11
  currency: "KD"
11
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonetrix/shared",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Shared types and utilities for seat-map-studio packages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",