platform-calendar-seatmap 2.1.6 → 2.1.8

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 (37) hide show
  1. package/dist/components/actionsHandler/ActionsHandler.d.ts +1 -0
  2. package/dist/components/app/App.d.ts +1 -0
  3. package/dist/components/background/Background.d.ts +0 -2
  4. package/dist/components/elementSelector/ElementSelector.d.ts +1 -0
  5. package/dist/components/elementSelector/FullscreenPreviewControls.d.ts +3 -0
  6. package/dist/components/elementSelector/HistoryControls.d.ts +3 -0
  7. package/dist/components/elementSelector/dropdown/Dropdown.d.ts +1 -0
  8. package/dist/components/elementSelector/dropdown/sections/arcSection/ArcSection.d.ts +8 -0
  9. package/dist/components/elementSelector/icons/ElementSelectorIcons.d.ts +26 -0
  10. package/dist/components/elementWrapper/ElementWrapper.d.ts +1 -0
  11. package/dist/components/elements/arcSection/ArcSection.d.ts +7 -0
  12. package/dist/components/elements/table/round/Round.d.ts +2 -2
  13. package/dist/components/elements/table/square/Square.d.ts +2 -2
  14. package/dist/components/scene3d/Scene3D.d.ts +1 -1
  15. package/dist/components/scene3d/builders/ArcSection3D.d.ts +3 -0
  16. package/dist/components/seat/Seat.d.ts +13 -13
  17. package/dist/components/seatTooltip/SeatTooltip.d.ts +1 -12
  18. package/dist/components/seatTooltip/SeatTooltipPortal.d.ts +11 -0
  19. package/dist/components/ticketLegend/TicketLegend.d.ts +3 -0
  20. package/dist/components/zoomControls/ZoomControls.d.ts +3 -0
  21. package/dist/helpers/constants/commons.d.ts +0 -1
  22. package/dist/helpers/constants/seatColors.d.ts +0 -1
  23. package/dist/helpers/functions/seatMap.d.ts +35 -4
  24. package/dist/helpers/functions/seatStatus.d.ts +1 -1
  25. package/dist/hooks/useElementVisibility.d.ts +11 -0
  26. package/dist/hooks/useKeyboardSeatNavigation.d.ts +2 -2
  27. package/dist/hooks/useRowVirtualization.d.ts +23 -0
  28. package/dist/hooks/useScaleTracker.d.ts +5 -1
  29. package/dist/index.js +1 -1
  30. package/dist/store/reducers/main/actionCreators.d.ts +6 -2
  31. package/dist/store/reducers/main/actionTypes.d.ts +5 -1
  32. package/dist/store/reducers/main/selectors.d.ts +5 -1
  33. package/dist/store/reducers/main/types.d.ts +31 -3
  34. package/dist/store/reducers/rootReducer.d.ts +1 -1
  35. package/dist/store/reducers/seatMap/selectors.d.ts +87 -10
  36. package/package.json +3 -3
  37. package/dist/components/previewMode/PreviewMode.d.ts +0 -24
@@ -3,6 +3,7 @@ type actions = {
3
3
  save: () => (T_SeatMap & {
4
4
  backgroundColor: string;
5
5
  ticketColors: Record<string, string>;
6
+ seatSize: number;
6
7
  }) | false;
7
8
  cancel: () => void;
8
9
  updateSeatMap: (seatMap: T_SeatMap) => void;
@@ -15,6 +15,7 @@ type T_Props = {
15
15
  mode?: T_Mode;
16
16
  soldSeats?: T_MainState['soldSeats'];
17
17
  currencySymbol?: string;
18
+ isFullscreen?: boolean;
18
19
  onSave?: () => void;
19
20
  onCancel?: () => void;
20
21
  onFullscreenChange?: (isFullscreen: boolean) => void;
@@ -2,8 +2,6 @@ import { FC, ReactNode } from 'react';
2
2
  type T_Props = {
3
3
  children: (ref: React.MutableRefObject<HTMLDivElement>) => ReactNode;
4
4
  backgroundColor?: string;
5
- /** Hide the dot pattern (e.g. in templates section preview) */
6
- hideDots?: boolean;
7
5
  };
8
6
  declare const Background: FC<T_Props>;
9
7
  export { Background };
@@ -2,6 +2,7 @@ import { FC } from 'react';
2
2
  import { T_SceneTransform } from 'helpers/types/commons';
3
3
  type T_Props = {
4
4
  sceneTransform: T_SceneTransform;
5
+ wrapperRef?: React.MutableRefObject<HTMLDivElement>;
5
6
  renderMode?: '2d' | '3d';
6
7
  onToggleRenderMode?: () => void;
7
8
  };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const FullscreenPreviewControls: FC;
3
+ export { FullscreenPreviewControls };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const HistoryControls: FC;
3
+ export { HistoryControls };
@@ -2,6 +2,7 @@ import { FC } from 'react';
2
2
  import { T_SceneTransform } from 'helpers/types/commons';
3
3
  type T_Props = {
4
4
  sceneTransform: T_SceneTransform;
5
+ wrapperRef?: React.MutableRefObject<HTMLDivElement>;
5
6
  };
6
7
  declare const Dropdown: FC<T_Props>;
7
8
  export { Dropdown };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { T_SceneTransform } from 'helpers/types/commons';
3
+ type T_Props = {
4
+ sceneTransform: T_SceneTransform;
5
+ wrapperRef?: React.MutableRefObject<HTMLDivElement>;
6
+ };
7
+ declare const ArcSectionSettings: FC<T_Props>;
8
+ export { ArcSectionSettings };
@@ -0,0 +1,26 @@
1
+ import { FC } from 'react';
2
+ /** Arc section: outer arc (7 dots) + inner arc (5 dots) */
3
+ export declare const ArcSectionIcon: FC<{
4
+ size?: number;
5
+ className?: string;
6
+ }>;
7
+ /** Seating group: equal rows and columns of dots, no borders */
8
+ export declare const SeatingGroupIcon: FC<{
9
+ size?: number;
10
+ className?: string;
11
+ }>;
12
+ /** Standing area: simple square outline */
13
+ export declare const StandingAreaIcon: FC<{
14
+ size?: number;
15
+ className?: string;
16
+ }>;
17
+ /** Table: central circle with 4 smaller circles around it */
18
+ export declare const TableIcon: FC<{
19
+ size?: number;
20
+ className?: string;
21
+ }>;
22
+ /** Text: capital T */
23
+ export declare const TextIcon: FC<{
24
+ size?: number;
25
+ className?: string;
26
+ }>;
@@ -14,6 +14,7 @@ type T_Props = {
14
14
  onDelete?: () => void;
15
15
  onDuplicate?: () => void;
16
16
  onRotate?: (angle: number) => void;
17
+ onDragEnd?: (position: T_Element['position']) => void;
17
18
  };
18
19
  declare const ElementWrapper: FC<PropsWithChildren<T_Props>>;
19
20
  export { ElementWrapper };
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { T_Element_ArcSection } from 'platform-calendar-helpers';
3
+ type T_Props = {
4
+ arcSection: T_Element_ArcSection;
5
+ };
6
+ declare const ArcSection: FC<T_Props>;
7
+ export { ArcSection };
@@ -1,12 +1,11 @@
1
1
  import { T_Element_Table, T_Seat, T_Ticket } from 'platform-calendar-helpers';
2
2
  import { FC } from 'react';
3
- import { selectSelectedSeatsObj } from 'store/reducers/seatMap/selectors';
4
3
  import { selectTicketByIds } from 'store/reducers/main/selectors';
5
4
  import { T_SeatColors } from 'helpers/constants/seatColors';
6
5
  import { T_TableNumberingConfig } from 'helpers/constants/numberingStyles';
7
6
  type T_Props = {
8
7
  table: T_Element_Table;
9
- selectedSeatsObj: ReturnType<typeof selectSelectedSeatsObj>;
8
+ selectedSeatIds: Record<string, any>;
10
9
  ticketIds: ReturnType<typeof selectTicketByIds>['ticketIds'];
11
10
  ticketsByIds?: {
12
11
  [key: number]: T_Ticket;
@@ -19,6 +18,7 @@ type T_Props = {
19
18
  ticketColors?: Record<string, string>;
20
19
  numberingConfig: T_TableNumberingConfig;
21
20
  iconType: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
21
+ highlightedTicketIds?: string[];
22
22
  };
23
23
  declare const Round: FC<T_Props>;
24
24
  export { Round };
@@ -1,12 +1,11 @@
1
1
  import { T_Element_Table, T_Seat, T_Ticket } from 'platform-calendar-helpers';
2
2
  import { FC } from 'react';
3
- import { selectSelectedSeatsObj } from 'store/reducers/seatMap/selectors';
4
3
  import { selectTicketByIds } from 'store/reducers/main/selectors';
5
4
  import { T_SeatColors } from 'helpers/constants/seatColors';
6
5
  import { T_TableNumberingConfig } from 'helpers/constants/numberingStyles';
7
6
  type T_Props = {
8
7
  table: T_Element_Table;
9
- selectedSeatsObj: ReturnType<typeof selectSelectedSeatsObj>;
8
+ selectedSeatIds: Record<string, any>;
10
9
  ticketIds: ReturnType<typeof selectTicketByIds>['ticketIds'];
11
10
  ticketsByIds?: {
12
11
  [key: number]: T_Ticket;
@@ -19,6 +18,7 @@ type T_Props = {
19
18
  ticketColors?: Record<string, string>;
20
19
  numberingConfig: T_TableNumberingConfig;
21
20
  iconType: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
21
+ highlightedTicketIds?: string[];
22
22
  };
23
23
  declare const Square: FC<T_Props>;
24
24
  export { Square };
@@ -1,6 +1,6 @@
1
1
  import { T_SceneTransform } from 'helpers/types/commons';
2
2
  type T_Scene3DRef = {
3
- zoomToFit: () => void;
3
+ zoomToFit: (animate?: boolean) => void;
4
4
  };
5
5
  type T_Props = {
6
6
  wrapperRef: React.MutableRefObject<HTMLDivElement>;
@@ -0,0 +1,3 @@
1
+ import { T_Element_ArcSection } from 'platform-calendar-helpers';
2
+ import { T_BuildContext, T_BuiltObject } from './types';
3
+ export declare const buildArcSection3D: (arcSection: T_Element_ArcSection, ctx: T_BuildContext) => T_BuiltObject;
@@ -8,38 +8,38 @@ type T_Props = {
8
8
  seatColors: T_SeatColors;
9
9
  soldSeatIds: Set<string | number>;
10
10
  iconType?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
11
+ /** Absolute top position (primitive instead of object for memo stability) */
12
+ posTop?: number;
13
+ /** Absolute left position (primitive instead of object for memo stability) */
14
+ posLeft?: number;
15
+ /** @deprecated Use posTop/posLeft primitives instead. Kept for backward compat. */
11
16
  absolutePosition?: {
12
17
  top?: number;
13
18
  left?: number;
14
19
  };
15
- /**
16
- * Optional data attributes for hit-testing / selection algorithms.
17
- * (Used by seating groups to expose row/col coordinates.)
18
- */
20
+ /** Row index for data attribute (primitive instead of dataAttributes object for memo stability) */
21
+ seatRow?: number;
22
+ /** Column index for data attribute (primitive instead of dataAttributes object for memo stability) */
23
+ seatCol?: number;
24
+ /** @deprecated Use seatRow/seatCol primitives instead. Kept for backward compat. */
19
25
  dataAttributes?: Record<string, string | number | undefined>;
20
26
  ticketIds: ReturnType<typeof selectTicketByIds>['ticketIds'];
21
- /** Ticket lookup by ID for enhanced tooltip */
22
27
  ticketsByIds?: {
23
28
  [key: number]: T_Ticket;
24
29
  };
25
30
  isViewOnly: boolean;
26
31
  select: (seat: T_Seat) => void;
27
- /** Show seat number inside the seat */
28
32
  showNumber?: boolean;
29
- /** Custom seat number to display (defaults to extracting from label or using index) */
30
33
  seatNumber?: string | number;
31
- /** Row label for enhanced tooltip */
32
34
  rowLabel?: string;
33
- /** Section/element name for enhanced tooltip */
34
35
  sectionName?: string;
35
- /** Currency symbol for price display in tooltip */
36
36
  currencySymbol?: string;
37
- /** Per-ticket color overrides from seatmap settings */
38
37
  ticketColors?: Record<string, string>;
39
- /** Computed display label (e.g. after hidden-seat renumbering). Falls back to seat.label. */
40
38
  displayLabel?: string;
41
- /** Whether flat numbering is active (no rows). Passed to tooltip to avoid showing row info. */
42
39
  flatNumbering?: boolean;
40
+ highlightedTicketIds?: string[];
41
+ /** Explicit pixel size - when provided, overrides CSS var(--seat-size) for arc sections and other absolute-positioned seats */
42
+ size?: number;
43
43
  };
44
44
  declare const Seat: FC<T_Props>;
45
45
  export { Seat };
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * ENHANCED SEAT TOOLTIP
3
3
  * Shows comprehensive seat information: row, seat number, price, ticket name, accessible badge, notes
4
+ * Uses a single global portal tooltip for smooth animated transitions between seats.
4
5
  */
5
- import { FC, ReactNode } from 'react';
6
6
  import { T_Seat, T_Ticket } from 'platform-calendar-helpers';
7
7
  export interface T_SeatTooltipData {
8
8
  seat: T_Seat;
@@ -19,14 +19,3 @@ export interface T_SeatTooltipData {
19
19
  /** When true, rows are irrelevant — don't show row info in the tooltip */
20
20
  flatNumbering?: boolean;
21
21
  }
22
- type T_Props = {
23
- data: T_SeatTooltipData;
24
- children: ReactNode;
25
- disabled?: boolean;
26
- };
27
- /**
28
- * Enhanced Seat Tooltip Component
29
- * Displays rich seat information on hover
30
- */
31
- declare const SeatTooltip: FC<T_Props>;
32
- export { SeatTooltip };
@@ -0,0 +1,11 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { T_SeatTooltipData } from './SeatTooltip';
3
+ type T_TooltipAPI = {
4
+ show: (data: T_SeatTooltipData, anchorEl: HTMLElement) => void;
5
+ hide: () => void;
6
+ };
7
+ export declare const useSeatTooltip: () => T_TooltipAPI;
8
+ export declare const SeatTooltipProvider: FC<{
9
+ children: ReactNode;
10
+ }>;
11
+ export {};
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const TicketLegend: FC;
3
+ export { TicketLegend };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const ZoomControls: FC;
3
+ export { ZoomControls };
@@ -11,6 +11,5 @@ declare const IS_MOBILE: boolean;
11
11
  declare const MODES: {
12
12
  readonly edit: "edit";
13
13
  readonly view: "view";
14
- readonly preview: "preview";
15
14
  };
16
15
  export { ALPHABET, ALPHABET_VENUE, CURVE_UPDATED_EVENT_NAME, STRETCH_UPDATED_EVENT_NAME, MODES, IS_MOBILE };
@@ -33,4 +33,3 @@ export declare const SEAT_SELECTION_COLOR = "#3B82F6";
33
33
  export declare const SEAT_SELECTION_GLOW = "rgba(59, 130, 246, 0.4)";
34
34
  export declare const VIEW_SELECTION_COLOR = "#10B981";
35
35
  export declare const VIEW_SELECTION_GLOW = "rgba(16, 185, 129, 0.4)";
36
- export declare const SEAT_SIZE = 22;
@@ -1,4 +1,4 @@
1
- import { T_Seat, T_SeatMap } from 'platform-calendar-helpers';
1
+ import { T_Seat, T_SeatMap, T_Element_ArcSection } from 'platform-calendar-helpers';
2
2
  import { T_SelectedSeats } from 'store/reducers/elementSelector/types';
3
3
  declare const removeFakeElementsFromSeatMap: (_seatMap: T_SeatMap) => {
4
4
  elements: {
@@ -8,19 +8,50 @@ declare const removeFakeElementsFromSeatMap: (_seatMap: T_SeatMap) => {
8
8
  tables: import("platform-calendar-helpers").T_Element_Table[];
9
9
  text: import("platform-calendar-helpers").T_Element_Text[];
10
10
  aisles: any;
11
+ arcSection: any;
11
12
  };
12
13
  id: number;
13
14
  name: string;
14
15
  backgroundColor?: string;
16
+ seatSize?: number;
15
17
  };
16
18
  declare const addFakeElementsToSeatMap: (_seatMap: T_SeatMap) => T_SeatMap;
19
+ /**
20
+ * Computes the bounding box (top, left, width, height) for an arc section in scene coordinates.
21
+ * Arc sections use centerPoint as their geometric center; this converts to top-left + dimensions
22
+ * to match how calculateZoomToFit expects element bounds.
23
+ */
24
+ declare const getArcSectionBoundingBox: (arc: T_Element_ArcSection, seatSize?: number) => {
25
+ top: number;
26
+ left: number;
27
+ width: number;
28
+ height: number;
29
+ };
17
30
  /**
18
31
  * Sold seats are not mutated. Sold status is determined by the soldSeats list (UI/selectors).
19
32
  * We do NOT set seat.locked for sold seats — being sold is separate from being locked.
20
33
  * (Previously this set locked:true on sold seats, which then got copied on paste/duplicate.)
21
34
  */
22
35
  declare const disableSoldSeats: (seatMap: T_SeatMap, _soldSeats: T_Seat[]) => T_SeatMap;
23
- declare const getElementInitialPosition: (sceneCoords: {
36
+ type T_GetElementInitialPositionParams = {
37
+ sceneCoords: {
38
+ x: number;
39
+ y: number;
40
+ };
41
+ /** When provided, places element at viewport center instead of fixed offset */
42
+ wrapperRef?: {
43
+ current: HTMLDivElement | null;
44
+ };
45
+ scale?: number;
46
+ /** Current seatmap elements — when provided, new element is placed in empty space */
47
+ elements?: T_SeatMap['elements'];
48
+ /** The element being created and its type — used to estimate size for empty-space search */
49
+ newElement?: {
50
+ element: any;
51
+ type: string;
52
+ };
53
+ };
54
+ declare const getElementInitialPosition: (params: T_GetElementInitialPositionParams | {
24
55
  x: number;
25
56
  y: number;
26
57
  }) => {
@@ -34,5 +65,5 @@ declare const getElementInitialPosition: (sceneCoords: {
34
65
  * @param soldSeats - Array of sold seats from Redux state
35
66
  * @returns true if the element has sold seats, false otherwise
36
67
  */
37
- declare const hasSoldSeats: (elementId: string | number, elementType: "tables" | "seatingGroup", soldSeats: T_SelectedSeats[keyof T_SelectedSeats][]) => boolean;
38
- export { removeFakeElementsFromSeatMap, addFakeElementsToSeatMap, getElementInitialPosition, disableSoldSeats, hasSoldSeats };
68
+ declare const hasSoldSeats: (elementId: string | number, elementType: "tables" | "seatingGroup" | "arcSection", soldSeats: T_SelectedSeats[keyof T_SelectedSeats][]) => boolean;
69
+ export { removeFakeElementsFromSeatMap, addFakeElementsToSeatMap, getElementInitialPosition, getArcSectionBoundingBox, disableSoldSeats, hasSoldSeats };
@@ -22,7 +22,7 @@ export declare const getSeatStatus: (seat: T_Seat, soldSeatIds: Set<string | num
22
22
  */
23
23
  export declare const getSeatColor: (seat: T_Seat, seatColors: T_SeatColors, soldSeatIds: Set<string | number>, ticketIds?: {
24
24
  [key: string | number]: boolean;
25
- }, ticketColors?: Record<string, string>) => string;
25
+ }, ticketColors?: Record<string, string>, highlightedTicketIds?: string[]) => string;
26
26
  /**
27
27
  * Gets seat colors with fallback to defaults if missing.
28
28
  * Locked seats now use ticket color (no dedicated lock color), but we keep locked in the type for backward compat.
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Returns `true` when the referenced element is within (or close to) the
4
+ * visible viewport. Uses IntersectionObserver with a generous root margin
5
+ * so seats are mounted slightly before they scroll into view, avoiding
6
+ * visible pop-in.
7
+ *
8
+ * For elements with few seats (below `seatThreshold`) the hook always
9
+ * returns `true` — the overhead of observing is not worth it.
10
+ */
11
+ export declare function useElementVisibility(ref: RefObject<HTMLElement | null>, seatCount: number, seatThreshold?: number): boolean;
@@ -7,14 +7,14 @@ export declare const useKeyboardSeatNavigation: (enabled?: boolean) => {
7
7
  focusedSeat: {
8
8
  seatId: T_Seat["id"];
9
9
  elementId: string;
10
- elementType: "seatingGroup" | "tables";
10
+ elementType: "seatingGroup" | "tables" | "arcSection";
11
11
  rowIndex: number;
12
12
  colIndex: number;
13
13
  };
14
14
  setFocusedSeat: import("react").Dispatch<import("react").SetStateAction<{
15
15
  seatId: T_Seat["id"];
16
16
  elementId: string;
17
- elementType: "seatingGroup" | "tables";
17
+ elementType: "seatingGroup" | "tables" | "arcSection";
18
18
  rowIndex: number;
19
19
  colIndex: number;
20
20
  }>>;
@@ -0,0 +1,23 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Returns a Set of row indices that should be rendered based on viewport visibility.
4
+ * Returns `null` when virtualization is not active (small seat count), meaning
5
+ * all rows should be rendered.
6
+ *
7
+ * For elements with an absolute-positioned layout (like ArcSection), provide
8
+ * `rowPositions` — an array of {top, height} per row in local element coordinates.
9
+ *
10
+ * For elements with a flexbox layout (like SeatingGroup), provide `rowHeight`
11
+ * and `rowGap` — the hook will calculate row positions automatically.
12
+ */
13
+ export declare function useRowVirtualization(containerRef: RefObject<HTMLElement | null>, totalRows: number, totalSeatCount: number, layout: {
14
+ type: 'flex';
15
+ rowHeight: number;
16
+ rowGap: number;
17
+ } | {
18
+ type: 'absolute';
19
+ rowPositions: Array<{
20
+ top: number;
21
+ height: number;
22
+ }>;
23
+ }): Set<number> | null;
@@ -1,2 +1,6 @@
1
- declare const useScaleTracker: (wrapperRef: React.MutableRefObject<HTMLDivElement>) => number;
1
+ /**
2
+ * Returns the current scale from Redux.
3
+ * Zoom is controlled via ZoomControls (+/- buttons) only; mouse wheel zoom is disabled.
4
+ */
5
+ declare const useScaleTracker: (_wrapperRef: React.MutableRefObject<HTMLDivElement>) => number;
2
6
  export { useScaleTracker };