iticket-seatingplan-dev 1.8.7 → 2.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.
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = Controls;
7
- var _reactLeafletCustomControl = _interopRequireDefault(require("react-leaflet-custom-control"));
7
+ var _Control = _interopRequireDefault(require("./Control"));
8
8
  var _reactLeafletDraw = require("react-leaflet-draw");
9
9
  var _reactLeaflet = require("react-leaflet");
10
10
  var _react = _interopRequireWildcard(require("react"));
@@ -35,7 +35,7 @@ function Controls(_ref) {
35
35
  } = _ref;
36
36
  const [isLegendOpen, setIsLegendOpen] = (0, _react.useState)(true);
37
37
  const map = (0, _reactLeaflet.useMap)();
38
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, preventOrphanedSeats && /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
38
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, preventOrphanedSeats && /*#__PURE__*/_react.default.createElement(_Control.default, {
39
39
  position: "topright"
40
40
  }, /*#__PURE__*/_react.default.createElement("div", {
41
41
  className: "extra-controls seat-quantity-control"
@@ -49,7 +49,7 @@ function Controls(_ref) {
49
49
  height: "16px",
50
50
  width: "16px",
51
51
  strokeWidth: "2"
52
- })))), /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
52
+ })))), /*#__PURE__*/_react.default.createElement(_Control.default, {
53
53
  position: "bottomright"
54
54
  }, /*#__PURE__*/_react.default.createElement("div", {
55
55
  className: "legendBox"
@@ -90,7 +90,7 @@ function Controls(_ref) {
90
90
  src: _encodedSvgs.userIcon,
91
91
  width: 15,
92
92
  height: 15
93
- }), /*#__PURE__*/_react.default.createElement("p", null, "membership seats"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)))), /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
93
+ }), /*#__PURE__*/_react.default.createElement("p", null, "membership seats"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null)))), /*#__PURE__*/_react.default.createElement(_Control.default, {
94
94
  position: "topleft"
95
95
  }, /*#__PURE__*/_react.default.createElement("div", {
96
96
  className: "extra-controls"
@@ -120,7 +120,7 @@ function Controls(_ref) {
120
120
  style: {
121
121
  height: "17px"
122
122
  }
123
- })))), /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
123
+ })))), /*#__PURE__*/_react.default.createElement(_Control.default, {
124
124
  position: "topleft"
125
125
  }, /*#__PURE__*/_react.default.createElement("div", {
126
126
  className: "extra-controls full-screen-control"
@@ -135,7 +135,7 @@ function Controls(_ref) {
135
135
  style: {
136
136
  height: "24px"
137
137
  }
138
- })))), canMultiSelect && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
138
+ })))), canMultiSelect && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Control.default, {
139
139
  position: "bottomleft"
140
140
  }, /*#__PURE__*/_react.default.createElement("div", {
141
141
  className: "extra-controls multi-select-control"
@@ -215,7 +215,7 @@ function Controls(_ref) {
215
215
  onMounted: drawInstance => {
216
216
  drawRef.current = drawInstance;
217
217
  }
218
- }))), /*#__PURE__*/_react.default.createElement(_reactLeafletCustomControl.default, {
218
+ }))), /*#__PURE__*/_react.default.createElement(_Control.default, {
219
219
  position: "topright"
220
220
  }, /*#__PURE__*/_react.default.createElement("button", {
221
221
  title: "Close full screen",
@@ -91,7 +91,7 @@ function SeatMap(_ref) {
91
91
  center: seatCenter
92
92
  })];
93
93
  })), [seats.seats, height, priceSectionIds]);
94
- const isOrphanMode = (seats === null || seats === void 0 ? void 0 : seats.preventOrphanedSeats) && desiredSeatQuantity > 0;
94
+ const isOrphanMode = (seats === null || seats === void 0 ? void 0 : seats.preventOrphanedSeats) && desiredSeatQuantity > 0 && mode === _utils.modes.SINGLE;
95
95
  const isTouchScreen = (0, _utils.getIsTouchScreen)();
96
96
 
97
97
  // L.drawLocal.draw.toolbar.buttons.rectangle = "Box select";
@@ -123,7 +123,7 @@ function SeatMap(_ref) {
123
123
  } else if (mode === _utils.modes.REMOVE) {
124
124
  const seatsToRemove = [];
125
125
  selectedSeats.forEach(seat => {
126
- if (!seatsToRemove.find(s => s.ssId === seat.ssId) && seat.s === _utils.statuses.USER_PENDING) {
126
+ if (!seatsToRemove.some(s => s.ssId === seat.ssId) && seat.s === _utils.statuses.USER_PENDING) {
127
127
  seatsToRemove.push(seat);
128
128
  }
129
129
  });
@@ -227,7 +227,7 @@ function SeatMap(_ref) {
227
227
  lng: seat.x
228
228
  };
229
229
  const latlng = [seatCenter.lat, seatCenter.lng];
230
- if (boxBounds.contains(latlng) && !seatsToBook.find(s => s.ssId === seat.ssId) && seat.s === _utils.statuses.UNSOLD) {
230
+ if (boxBounds.contains(latlng) && !seatsToBook.some(s => s.ssId === seat.ssId) && seat.s === _utils.statuses.UNSOLD) {
231
231
  seatsToBook.push(seat);
232
232
  }
233
233
  });
@@ -328,7 +328,7 @@ function SeatMap(_ref) {
328
328
  }
329
329
  };
330
330
  const onMouseDown = (0, _react.useCallback)((s, hasSeatPrices) => {
331
- if ((mode === _utils.modes.DRAG || mode === _utils.modes.REMOVE) && canMultiSelect && hasSeatPrices && !selectedSeats.find(seat => seat.ssId === s.ssId) && s.s === (mode === _utils.modes.DRAG ? _utils.statuses.UNSOLD : _utils.statuses.USER_PENDING)) {
331
+ if ((mode === _utils.modes.DRAG || mode === _utils.modes.REMOVE) && canMultiSelect && hasSeatPrices && !selectedSeats.some(seat => seat.ssId === s.ssId) && s.s === (mode === _utils.modes.DRAG ? _utils.statuses.UNSOLD : _utils.statuses.USER_PENDING)) {
332
332
  setSelectedSeats(prev => [...prev, s]);
333
333
  }
334
334
  }, [mode, canMultiSelect, selectedSeats, setSelectedSeats]);
@@ -339,7 +339,7 @@ function SeatMap(_ref) {
339
339
  if (hideTooltipTimeoutRef.current) {
340
340
  clearTimeout(hideTooltipTimeoutRef.current);
341
341
  }
342
- if ((mode === _utils.modes.DRAG || mode === _utils.modes.REMOVE) && isDragging && canMultiSelect && hasSeatPrices && !selectedSeats.find(seat => seat.ssId === s.ssId) && s.s === (mode === _utils.modes.DRAG ? _utils.statuses.UNSOLD : _utils.statuses.USER_PENDING)) {
342
+ if ((mode === _utils.modes.DRAG || mode === _utils.modes.REMOVE) && isDragging && canMultiSelect && hasSeatPrices && !selectedSeats.some(seat => seat.ssId === s.ssId) && s.s === (mode === _utils.modes.DRAG ? _utils.statuses.UNSOLD : _utils.statuses.USER_PENDING)) {
343
343
  setSelectedSeats(prev => [...prev, s]);
344
344
  return;
345
345
  }
@@ -371,7 +371,7 @@ function SeatMap(_ref) {
371
371
  infoVisible: false
372
372
  }));
373
373
  }
374
- if ((highlightedSeats === null || highlightedSeats === void 0 ? void 0 : highlightedSeats.length) > 0) {
374
+ if ((highlightedSeats === null || highlightedSeats === void 0 ? void 0 : highlightedSeats.length) > 0 && mode === _utils.modes.SINGLE) {
375
375
  setHighlightedSeats([]);
376
376
  }
377
377
  }, 400);
@@ -473,7 +473,7 @@ function SeatMap(_ref) {
473
473
  zIndex: 10
474
474
  }) : /*#__PURE__*/_react.default.createElement(_reactLeaflet.Circle, {
475
475
  center: [seatCenter.lat, seatCenter.lng],
476
- pathOptions: (0, _utils.getInitialColor)(s, price, s.loading || ticketPopupOpen && (chosenSeat === null || chosenSeat === void 0 || (_chosenSeat$seat3 = chosenSeat.seat) === null || _chosenSeat$seat3 === void 0 ? void 0 : _chosenSeat$seat3.ssId) === s.ssId, !hasSeatPrices, (selectedSeats.some(selectedSeat => selectedSeat.ssId === s.ssId) || highlightedSeats.some(hs => hs.ssId === s.ssId)) && isHoveringOnSeat, greyedOutSeats.some(gs => gs.ssId === s.ssId)),
476
+ pathOptions: (0, _utils.getInitialColor)(s, price, s.loading || ticketPopupOpen && (chosenSeat === null || chosenSeat === void 0 || (_chosenSeat$seat3 = chosenSeat.seat) === null || _chosenSeat$seat3 === void 0 ? void 0 : _chosenSeat$seat3.ssId) === s.ssId, !hasSeatPrices, (selectedSeats.some(selectedSeat => selectedSeat.ssId === s.ssId) || highlightedSeats.some(hs => hs.ssId === s.ssId)) && (isOrphanMode ? isHoveringOnSeat : true), greyedOutSeats.some(gs => gs.ssId === s.ssId)),
477
477
  radius: 12000,
478
478
  eventHandlers: eventHandlers
479
479
  }, s.s === _utils.statuses.UNSOLD && hasSeatPrices ? /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, {
@@ -44,7 +44,15 @@ const SeatingPlan = _ref => {
44
44
  connectedShowings,
45
45
  areaName,
46
46
  promoCode,
47
- bookingMode = _utils.bookingModes.SHOPSITE
47
+ bookingMode = _utils.bookingModes.SHOPSITE,
48
+ theme = {
49
+ accent: "#6366f1",
50
+ accentDark: "#3730a3",
51
+ accentLight: "#e0e7ff",
52
+ flexiAccent: "#e32664",
53
+ flexiAccentDark: "#ffd3e2",
54
+ flexiAccentLight: "#be003f"
55
+ }
48
56
  } = _ref;
49
57
  const [initialiseMessage, setInitialiseMessage] = (0, _react.useState)("Initialising seating plan...");
50
58
  const [isReloading, setIsReloading] = (0, _react.useState)(false);
@@ -532,19 +540,28 @@ const SeatingPlan = _ref => {
532
540
  // in full screen mode, render the map in the body, otherwise render in the seating-plan-root div
533
541
  const mapContainer = mounted && (isFullScreen ? (_document = document) === null || _document === void 0 ? void 0 : _document.body : (_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.getElementById("seating-plan-root"));
534
542
  const backdropContainer = mounted && ((_document3 = document) === null || _document3 === void 0 ? void 0 : _document3.body);
535
-
536
- // return seating plan
543
+ const themeStyles = {
544
+ "--accent": theme.accent,
545
+ "--accent-dark": theme.accentDark,
546
+ "--accent-light": theme.accentLight,
547
+ "--flexi-accent": theme.flexiAccent,
548
+ "--flexi-accent-light": theme.flexiAccentLight,
549
+ "--flexi-accent-dark": theme.flexiAccentDark
550
+ };
537
551
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
538
552
  className: "seating-plan-root",
539
- id: "seating-plan-root"
553
+ id: "seating-plan-root",
554
+ style: themeStyles
540
555
  }, error ? /*#__PURE__*/_react.default.createElement("div", {
541
556
  className: "loading"
542
557
  }, /*#__PURE__*/_react.default.createElement("h1", null, "OOPS!"), /*#__PURE__*/_react.default.createElement("div", null, error.response.data.message)) : position && area === areaId ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, backdropContainer && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement("div", {
543
558
  className: "seating-plan-backdrop ".concat(isFullScreen ? "full-screen" : ""),
544
- onClick: () => setIsFullScreen(false)
559
+ onClick: () => setIsFullScreen(false),
560
+ style: themeStyles
545
561
  }), backdropContainer), mapContainer && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement("div", {
546
562
  className: "seating-plan-container ".concat(isFullScreen ? "full-screen" : ""),
547
- "data-mode": mode
563
+ "data-mode": mode,
564
+ style: themeStyles
548
565
  }, pricingPopupOpen && seats && seats.pricing && (canMultiSelect || seats.preventOrphanedSeats) ? /*#__PURE__*/_react.default.createElement(_PricingPopup.default, {
549
566
  onClose: () => {
550
567
  setPricingPopupOpen(false);
@@ -27,12 +27,12 @@ button {
27
27
  }
28
28
 
29
29
  .seating-plan-container {
30
- --accent: rgb(99 102 241);
30
+ /* --accent: rgb(99 102 241);
31
31
  --accent-dark: rgb(55 48 163);
32
32
  --accent-light: rgb(224 231 255);
33
33
  --flexi-accent: rgb(227 38 100);
34
34
  --flexi-accent-light: rgb(255 211 226);
35
- --flexi-accent-dark: rgb(190 0 63);
35
+ --flexi-accent-dark: rgb(190 0 63); */
36
36
  font-family: inherit;
37
37
  }
38
38
 
@@ -42,6 +42,7 @@ button {
42
42
  border-radius: 3px;
43
43
  text-align: left;
44
44
  backdrop-filter: blur(2px);
45
+ color: #333;
45
46
  }
46
47
 
47
48
  .legend-header {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "iticket-seatingplan-dev",
3
3
  "description": "Seating plan with FLEXi pricing",
4
4
  "author": "gedwyne",
5
- "version": "1.8.7",
5
+ "version": "2.0.0",
6
6
  "private": false,
7
7
  "keywords": [
8
8
  "iticket",
@@ -18,12 +18,11 @@
18
18
  "@babel/polyfill": "^7.12.1",
19
19
  "@types/leaflet": "^1.9.14",
20
20
  "@types/leaflet-draw": "^1.0.11",
21
- "leaflet": "^1.9.3",
21
+ "leaflet": "^1.9.4",
22
22
  "leaflet-draw": "^1.0.4",
23
- "react": "^18.3.1",
24
- "react-dom": "^18.3.1",
25
- "react-leaflet": "^4.2.1",
26
- "react-leaflet-custom-control": "^1.3.5",
23
+ "react": "^19.0.0",
24
+ "react-dom": "^19.0.0",
25
+ "react-leaflet": "^5.0.0-rc.2",
27
26
  "react-leaflet-draw": "^0.20.4",
28
27
  "react-scripts": "^5.0.1"
29
28
  },