@alisaitteke/seatmap-canvas 2.5.19 → 2.6.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.
Files changed (28) hide show
  1. package/README.md +148 -130
  2. package/dist/CLAUDE.md +11 -0
  3. package/dist/cjs/CLAUDE.md +11 -0
  4. package/dist/cjs/seatmap.canvas.css +4 -0
  5. package/dist/cjs/seatmap.canvas.js +2 -2
  6. package/dist/cjs/seatmap.canvas.js.map +1 -1
  7. package/dist/cjs/types/models/styles/seat.style.d.ts +5 -0
  8. package/dist/cjs/types/models/styles/tooltip.style.d.ts +8 -0
  9. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +7 -3
  10. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.path-area.d.ts +7 -0
  11. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.path.d.ts +13 -0
  12. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.rect-area.d.ts +7 -0
  13. package/dist/cjs/types/svg/stage/blocks/block-item/seat/seat-item.rect.d.ts +11 -0
  14. package/dist/cjs/types/utils/svg-parser.d.ts +5 -0
  15. package/dist/dependencies.txt +0 -54
  16. package/dist/esm/CLAUDE.md +11 -0
  17. package/dist/esm/seatmap.canvas.css +4 -0
  18. package/dist/esm/seatmap.canvas.js +2 -2
  19. package/dist/esm/seatmap.canvas.js.map +1 -1
  20. package/dist/esm/types/models/styles/seat.style.d.ts +5 -0
  21. package/dist/esm/types/models/styles/tooltip.style.d.ts +8 -0
  22. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.index.d.ts +7 -3
  23. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.path-area.d.ts +7 -0
  24. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.path.d.ts +13 -0
  25. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.rect-area.d.ts +7 -0
  26. package/dist/esm/types/svg/stage/blocks/block-item/seat/seat-item.rect.d.ts +11 -0
  27. package/dist/esm/types/utils/svg-parser.d.ts +5 -0
  28. package/package.json +2 -2
package/README.md CHANGED
@@ -4,12 +4,13 @@ Seatmap Canvas is an advanced, open-source library for interactive seat selectio
4
4
  [![LIVE DEMO](assets/banner_ui.png)](https://alisaitteke.github.io/seatmap-canvas)
5
5
 
6
6
  ## Features
7
- * React Integration: Designed specifically for React projects, offering a streamlined development experience.
8
- * Dynamic Seat Selection: Enables interactive selection, categorization, and location of seats.
9
- * Customizable Styles: Extensive styling options for seats, blocks, and labels to fit your application's design.
10
- * Interactive Seat Models: Define properties and behaviors for seats, including salability, notes, and custom data.
11
- * Block Model Configuration: Organize seats into blocks with customizable titles, colors, and labels.
12
- * Event Handling: Simplified event listeners for seat interactions, allowing dynamic responses to user actions.
7
+
8
+ - **Framework Agnostic** - Core library works with vanilla JS, plus official React and Vue 3 wrappers
9
+ - **Dynamic Seat Selection** - Interactive selection, categorization, and location of seats
10
+ - **Customizable Styles** - Extensive styling options for seats, blocks, and labels
11
+ - **Interactive Seat Models** - Define properties like salability, notes, colors, and custom data
12
+ - **Block Organization** - Organize seats into blocks with titles, colors, and labels
13
+ - **Event System** - Simplified event listeners for seat interactions
13
14
 
14
15
  ## Screenshot
15
16
  [![LIVE DEMO](assets/screenshot_1.png)](https://alisaitteke.github.io/seatmap-canvas)
@@ -108,22 +109,32 @@ Seatmap Canvas is an advanced, open-source library for interactive seat selectio
108
109
 
109
110
  ## Installation
110
111
 
111
- <pre>
112
- npm i <a href="https://npm.pkg.github.com/alisaitteke/seatmap-canvas">@alisaitteke/seatmap-canvas</a> --save
113
- OR
114
- yarn add <a href="https://npm.pkg.github.com/alisaitteke/seatmap-canvas">@alisaitteke/seatmap-canvas</a> --save
115
- </pre>
112
+ ```bash
113
+ npm install @alisaitteke/seatmap-canvas
114
+ ```
116
115
 
117
116
  ## Quick Start
118
117
 
119
- ### Vue.js 3
118
+ ---
119
+
120
+ <h3>
121
+ <img src="https://api.iconify.design/logos:vue.svg" width="28" height="28" alt="Vue.js" style="vertical-align: middle;" />
122
+ &nbsp;Vue.js 3
123
+ </h3>
124
+
125
+ <table>
126
+ <tr>
127
+ <td width="50%">
128
+
129
+ **Installation**
120
130
 
121
131
  ```bash
122
132
  npm install @alisaitteke/seatmap-canvas
123
133
  ```
124
134
 
135
+ **Setup** (`main.ts`)
136
+
125
137
  ```typescript
126
- // main.ts
127
138
  import { createApp } from 'vue';
128
139
  import App from './App.vue';
129
140
  import SeatmapCanvasPlugin from '@alisaitteke/seatmap-canvas/vue';
@@ -134,8 +145,12 @@ app.use(SeatmapCanvasPlugin);
134
145
  app.mount('#app');
135
146
  ```
136
147
 
148
+ </td>
149
+ <td width="50%">
150
+
151
+ **Component Usage**
152
+
137
153
  ```vue
138
- <!-- Component.vue -->
139
154
  <template>
140
155
  <SeatmapCanvas
141
156
  :options="seatmapOptions"
@@ -161,16 +176,39 @@ const onSeatClick = (seat) => {
161
176
  </script>
162
177
  ```
163
178
 
164
- **[📖 Full Vue.js Documentation](src/vue/README.md)** | **[🎯 Vue.js Examples](examples/vue/)**
179
+ </td>
180
+ </tr>
181
+ </table>
165
182
 
166
- ### React
183
+ <p align="center">
184
+ <a href="src/vue/README.md"><img src="https://img.shields.io/badge/📖_Full_Documentation-4FC08D?style=for-the-badge&logoColor=white" alt="Documentation"/></a>
185
+ &nbsp;
186
+ <a href="examples/vue/"><img src="https://img.shields.io/badge/🎯_Examples-35495E?style=for-the-badge&logoColor=white" alt="Examples"/></a>
187
+ </p>
188
+
189
+ ---
190
+
191
+ <h3>
192
+ <img src="https://api.iconify.design/logos:react.svg" width="28" height="28" alt="React" style="vertical-align: middle;" />
193
+ &nbsp;React
194
+ </h3>
195
+
196
+ <table>
197
+ <tr>
198
+ <td width="50%">
199
+
200
+ **Installation**
167
201
 
168
202
  ```bash
169
- npm install @alisaitteke/seatmap-canvas react react-dom
203
+ npm install @alisaitteke/seatmap-canvas
170
204
  ```
171
205
 
206
+ </td>
207
+ <td width="50%">
208
+
209
+ **Component Usage**
210
+
172
211
  ```tsx
173
- import React from 'react';
174
212
  import { SeatmapCanvas } from '@alisaitteke/seatmap-canvas/react';
175
213
  import '@alisaitteke/seatmap-canvas/dist/seatmap.canvas.css';
176
214
 
@@ -180,64 +218,83 @@ function App() {
180
218
  };
181
219
 
182
220
  return (
183
- <div style={{ width: '100%', height: '600px' }}>
184
- <SeatmapCanvas
185
- options={{
186
- legend: true,
187
- style: {
188
- seat: {
189
- hover: '#8fe100',
190
- selected: '#8fe100',
191
- }
192
- }
193
- }}
194
- data={blocks}
195
- onSeatClick={handleSeatClick}
196
- />
197
- </div>
221
+ <SeatmapCanvas
222
+ options={{
223
+ legend: true,
224
+ style: {
225
+ seat: { hover: '#8fe100', selected: '#8fe100' }
226
+ }
227
+ }}
228
+ data={blocks}
229
+ onSeatClick={handleSeatClick}
230
+ />
198
231
  );
199
232
  }
200
233
  ```
201
234
 
202
- **[📖 Full React Documentation](src/react/README.md)** | **[🎯 React Examples](examples/react/)**
235
+ </td>
236
+ </tr>
237
+ </table>
238
+
239
+ <p align="center">
240
+ <a href="src/react/README.md"><img src="https://img.shields.io/badge/📖_Full_Documentation-61DAFB?style=for-the-badge&logoColor=black" alt="Documentation"/></a>
241
+ &nbsp;
242
+ <a href="examples/react/"><img src="https://img.shields.io/badge/🎯_Examples-20232A?style=for-the-badge&logoColor=white" alt="Examples"/></a>
243
+ </p>
203
244
 
204
- ### Vanilla JavaScript
245
+ ---
205
246
 
247
+ <h3>
248
+ <img src="https://api.iconify.design/logos:javascript.svg" width="24" height="24" alt="JavaScript" style="vertical-align: middle;" />
249
+ &nbsp;Vanilla JavaScript
250
+ </h3>
206
251
 
252
+ <table>
253
+ <tr>
254
+ <td width="50%">
207
255
 
256
+ **Quick Setup**
208
257
 
209
- #### Example Config
210
- ```json
211
- {
212
- "resizable": true,
213
- "seat_style": {
214
- "radius": 12,
215
- "color": "#6796ff",
216
- "hover": "#5671ff",
217
- "not_salable": "#424747",
218
- "selected": "#56aa45",
219
- "focus": "#435fa4",
220
- "focus_out": "#56aa45"
221
- },
222
- "block_style": {
223
- "fill": "#e2e2e2",
224
- "stroke": "#e2e2e2"
225
- },
226
- "label_style": {
227
- "color": "#000",
228
- "radius": 12,
229
- "font-size": "12px",
230
- "bg": "#ffffff"
231
- }
232
- }
258
+ ```js
259
+ const config = {
260
+ resizable: true,
261
+ seat_style: {
262
+ radius: 12,
263
+ color: "#6796ff",
264
+ hover: "#5671ff",
265
+ selected: "#56aa45"
266
+ }
267
+ };
233
268
 
269
+ const seatmap = new SeatmapCanvas(".container", config);
270
+ seatmap.setData(data);
234
271
  ```
235
272
 
236
- #### Usage
273
+ </td>
274
+ <td width="50%">
275
+
276
+ **Event Handling**
277
+
237
278
  ```js
238
- var seatmap = new SeatmapCanvas(".seats_container",config);
279
+ seatmap.addEventListener("seat_click", (seat) => {
280
+ if (seat.selected) {
281
+ seatmap.seatUnselect(seat);
282
+ } else {
283
+ seatmap.seatSelect(seat);
284
+ }
285
+ });
286
+
287
+ // Get selected seats
288
+ const selected = seatmap.getSelectedSeats();
239
289
  ```
240
290
 
291
+ </td>
292
+ </tr>
293
+ </table>
294
+
295
+ <details>
296
+ <summary><strong>📋 Data Models Reference</strong></summary>
297
+
241
298
  #### Seat Model
242
299
  ```json
243
300
  {
@@ -257,81 +314,30 @@ var seatmap = new SeatmapCanvas(".seats_container",config);
257
314
  #### Block Model
258
315
  ```json
259
316
  {
260
- "blocks": [
261
- {
262
- "id": 1,
263
- "title": "Test Block 1",
264
- "color": "#2c2828",
265
- "labels": [
266
- {
267
- "title": "A",
268
- "x": -30,
269
- "y": 0
270
- },
271
- {
272
- "title": "B",
273
- "x": 120,
274
- "y": 30
275
- }
276
- ],
277
- "seats": [
278
- {
279
- "id": 1,
280
- "x": 0,
281
- "y": 0,
282
- "salable": true,
283
- "note": "note test",
284
- "title": "49"
285
- },
286
- {
287
- "id": 2,
288
- "x": 30,
289
- "y": 0,
290
- "salable": true,
291
- "note": "note test",
292
- "title": "47"
293
- }
294
- ]
295
- }
296
- ]
317
+ "blocks": [{
318
+ "id": 1,
319
+ "title": "Test Block 1",
320
+ "color": "#2c2828",
321
+ "labels": [{ "title": "A", "x": -30, "y": 0 }],
322
+ "seats": [
323
+ { "id": 1, "x": 0, "y": 0, "salable": true, "title": "49" },
324
+ { "id": 2, "x": 30, "y": 0, "salable": true, "title": "47" }
325
+ ]
326
+ }]
297
327
  }
298
-
299
- ```
300
-
301
- #### Set Block Data
302
- ```js
303
- seatmap.setData(data);
304
328
  ```
305
329
 
306
- #### Seat Click Trigger
330
+ #### Configuration Options
307
331
  ```js
308
- seatmap.addEventListener("seat_click", (seat) => {
309
- console.log(seat);
310
- if (seat.selected) {
311
- seatmap.seatUnselect(seat);
312
- } else {
313
- seatmap.seatSelect(seat);
314
- }
315
- });
316
- ```
317
-
318
- #### Activated unsalable seat click
319
- ##### click_enable_sold_seats param add to config object
320
- ```javascript
321
- let config = {
322
- click_enable_sold_seats: true // default false
332
+ {
333
+ click_enable_sold_seats: true // Enable clicking on unavailable seats (default: false)
323
334
  }
324
335
  ```
325
336
 
326
- #### Get selected seat
327
- ```javascript
328
- seatmap.addEventListener("seat_click", (seat) => {
329
- var selectedSeats = seatmap.getSelectedSeats();
330
- });
331
- ```
337
+ </details>
332
338
 
333
-
334
- #### Complete Example Code
339
+ <details>
340
+ <summary><strong>📝 Complete Example</strong></summary>
335
341
  ```javascript
336
342
 
337
343
  var config = {
@@ -408,8 +414,20 @@ var data = {
408
414
 
409
415
  // SET SEATS DATA
410
416
  seatmap.setData(data);
411
-
412
417
  ```
413
418
 
419
+ </details>
420
+
421
+ <p align="center">
422
+ <a href="examples/"><img src="https://img.shields.io/badge/📖_Documentation-F7DF1E?style=for-the-badge&logoColor=black" alt="Documentation"/></a>
423
+ &nbsp;
424
+ <a href="examples/"><img src="https://img.shields.io/badge/🎯_Examples-333333?style=for-the-badge&logoColor=white" alt="Examples"/></a>
425
+ </p>
426
+
427
+ ---
428
+
414
429
  ## Contributors
415
- Ali Sait Teke <alisaitt@gmail.com>
430
+
431
+ <a href="https://github.com/alisaitteke">
432
+ <img src="https://img.shields.io/badge/Ali_Sait_Teke-Maintainer-blue?style=flat-square&logo=github" alt="Ali Sait Teke"/>
433
+ </a>
package/dist/CLAUDE.md ADDED
@@ -0,0 +1,11 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ ### Jan 23, 2026
7
+
8
+ | ID | Time | T | Title | Read |
9
+ |----|------|---|-------|------|
10
+ | #72 | 2:45 PM | 🔵 | Successful Build with npm After Migration from Yarn | ~426 |
11
+ </claude-mem-context>
@@ -0,0 +1,11 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ ### Jan 23, 2026
7
+
8
+ | ID | Time | T | Title | Read |
9
+ |----|------|---|-------|------|
10
+ | #72 | 2:45 PM | 🔵 | Successful Build with npm After Migration from Yarn | ~426 |
11
+ </claude-mem-context>
@@ -94,6 +94,10 @@
94
94
  .seatmap-svg .stage .blocks .block .seats .seat.selected {
95
95
  cursor: pointer;
96
96
  }
97
+ .seatmap-svg .stage .blocks .block .seats .seat.not-salable {
98
+ cursor: not-allowed;
99
+ opacity: 0.7;
100
+ }
97
101
  .seatmap-svg .stage .blocks .block .seats .seat .label-text {
98
102
  text-anchor: middle;
99
103
  dominant-baseline: central;