@seatlayer/core 0.17.0 → 0.18.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/dist/index.d.cts CHANGED
@@ -109,6 +109,14 @@ interface AccessibilityMeta {
109
109
  declare const ACCESSIBILITY_TYPES: AccessibilityMeta[];
110
110
  /** Metadata for one accessibility key (undefined for unknown keys). */
111
111
  declare function accessibilityMeta(key: AccessibilityType): AccessibilityMeta | undefined;
112
+ /**
113
+ * Outer-ring colour per accommodation. Shared by the buyer picker and the
114
+ * designer canvas so an accessible seat reads with the same hue in both — the
115
+ * seat's first-listed type wins. `wheelchair` blue is the default fallback.
116
+ */
117
+ declare const ACCESSIBILITY_RING_COLOR: Record<AccessibilityType, string>;
118
+ /** Ring colour for a seat's accessibility set (first-listed type wins). */
119
+ declare function accessibilityRingColor(types: AccessibilityType[] | undefined): string;
112
120
  interface SeatOverride {
113
121
  /** 0-based seat index within the row. */
114
122
  index: number;
@@ -119,25 +127,66 @@ interface SeatOverride {
119
127
  dy?: number;
120
128
  /** Replace the computed label entirely. */
121
129
  label?: string;
130
+ /** Buyer-facing copy only. Booking/API identity remains row id + slot index
131
+ * internally and the legacy `label` externally for backwards compatibility. */
132
+ displayLabel?: string;
122
133
  categoryKey?: string;
123
134
  /** @deprecated legacy flag — read as `['wheelchair']`; write `accessibility`. */
124
135
  accessible?: boolean;
125
136
  /** Accessibility accommodations of this seat (empty/absent = none). */
126
137
  accessibility?: AccessibilityType[];
138
+ /** Commercial selling/view attributes are deliberately not accessibility. */
139
+ commercial?: SeatCommercialAttributes;
140
+ /** Seat-specific view photo; falls back to the row photo. */
141
+ viewFromSeatUrl?: string;
142
+ }
143
+ interface SeatCommercialAttributes {
144
+ restrictedView?: boolean;
145
+ obstructedView?: boolean;
146
+ premium?: boolean;
147
+ note?: string;
148
+ }
149
+ /**
150
+ * Per-object label ink + size overrides layered on top of the chart-wide Theme
151
+ * defaults (rowLabelColor / textColor for rows, the section-name ink for
152
+ * sections). Both fields are optional: an absent field means "inherit the theme
153
+ * default". `color` is a preferred hex — renderers still pass it through the
154
+ * shared auto-contrast rule (`stateAwareBookableLabelInk`), so a choice that
155
+ * would be illegible over the seat/section background is switched to black or
156
+ * white at paint time. `size` is a font size in chart units, clamped to
157
+ * LABEL_STYLE_MIN_SIZE..LABEL_STYLE_MAX_SIZE by the shared ops.
158
+ */
159
+ interface LabelStyle {
160
+ size?: number;
161
+ color?: string;
162
+ }
163
+ /** Clamp bounds for a per-object label `size`, shared by ops, MCP, and UI. */
164
+ declare const LABEL_STYLE_MIN_SIZE = 8;
165
+ declare const LABEL_STYLE_MAX_SIZE = 24;
166
+ interface LabelPresentation {
167
+ visible?: boolean;
168
+ /** Exact Designer-owned label anchor; public semantic MCP schemas omit it. */
169
+ position?: Point;
170
+ rotation?: number;
171
+ style?: 'plain' | 'pill';
172
+ /** Per-object size/color override for this row's or section's label. */
173
+ labelStyle?: LabelStyle;
127
174
  }
128
175
  /** Brand/venue theming — applied by the renderer in both designer and picker. */
129
176
  interface ChartTheme {
130
177
  /** Canvas background color (default dark: #0e1117-ish radial). */
131
178
  background?: string;
132
- /** Seat label text color (default dark ink #0b1220). */
179
+ /** Preferred text color for the numbers inside seat markers. */
133
180
  seatLabelColor?: string;
181
+ /** Preferred color for row identifiers such as A, B, C. Falls back to textColor. */
182
+ rowLabelColor?: string;
134
183
  /** Selection ring / accent color (default white ring + brand accent). */
135
184
  selectionColor?: string;
136
185
  /** Décor (stage/shape) default fill. */
137
186
  decorFill?: string;
138
187
  /** Free-text color default. */
139
188
  textColor?: string;
140
- /** Font family (CSS stack) for all rendered text — seat labels, sections, décor text. */
189
+ /** Font family (CSS stack) for all rendered text — row labels, seat numbers, sections, décor text. */
141
190
  fontFamily?: string;
142
191
  /** Seat size multiplier on the base radius (0.7–1.6, default 1) — bigger seats fit longer labels. */
143
192
  seatScale?: number;
@@ -157,6 +206,9 @@ interface RowObject {
157
206
  id: string;
158
207
  /** Row label, e.g. "A". Seat labels are `${label}-${n}`. */
159
208
  label: string;
209
+ /** Buyer-facing row name. `label` remains the legacy inventory prefix. */
210
+ displayLabel?: string;
211
+ labelPresentation?: LabelPresentation;
160
212
  /** Position of the FIRST seat. */
161
213
  origin: Point;
162
214
  /** Degrees, clockwise. 0 = seats laid out along +x. */
@@ -178,6 +230,35 @@ interface RowObject {
178
230
  * inventory. It enables revision-safe replacement without touching manually
179
231
  * authored rows or accepting client coordinates. */
180
232
  referenceInventorySource?: ReferenceInventorySource;
233
+ /** Semantic parameters for a row produced by the shared Arc/Fan operation.
234
+ * Designer can reopen these parameters while every segment in the group
235
+ * still carries the same generation signature. Public MCP tools never accept
236
+ * the stored center/angles as arbitrary model-authored coordinates. */
237
+ arcFanGeneration?: {
238
+ kind: 'arc-fan-v1';
239
+ groupId: string;
240
+ center: Point;
241
+ innerRadius: number;
242
+ rowCount: number;
243
+ rowGap: number;
244
+ startAngle: number;
245
+ endAngle: number;
246
+ seatPitch: number;
247
+ fit: 'seat-pitch' | 'fixed-count';
248
+ seatsPerRow?: number;
249
+ facing: 'inward' | 'outward';
250
+ taperDegrees: number;
251
+ skewDegrees: number;
252
+ aisleGaps: {
253
+ left: number;
254
+ center: number;
255
+ right: number;
256
+ };
257
+ rowLabelStart: number;
258
+ seatLabelStart: number;
259
+ rowIndex: number;
260
+ segmentIndex: number;
261
+ };
181
262
  /** First seat number (default 1). */
182
263
  seatLabelStart?: number;
183
264
  /** Seat numbering within the row (default ltr, step 1). */
@@ -200,6 +281,8 @@ interface RowObject {
200
281
  * generates a synthetic panorama from chart geometry.
201
282
  */
202
283
  viewFromSeatUrl?: string;
284
+ /** Default commercial attributes inherited by seats without an override. */
285
+ commercial?: SeatCommercialAttributes;
203
286
  }
204
287
  interface GAAreaObject {
205
288
  type: 'gaArea';
@@ -340,6 +423,9 @@ interface SectionObject {
340
423
  type: 'section';
341
424
  id: string;
342
425
  label: string;
426
+ /** Buyer-facing section name; logical/id fields remain stable. */
427
+ displayLabel?: string;
428
+ labelPresentation?: LabelPresentation;
343
429
  /**
344
430
  * Stable management/inventory identity shared by disconnected visual
345
431
  * components of one logical section. When absent, `id` is the logical id.
@@ -347,6 +433,9 @@ interface SectionObject {
347
433
  * editing, measured diffs, and source restoration remain exact.
348
434
  */
349
435
  logicalSectionId?: string;
436
+ /** Shared semantic Arc/Fan group wrapped by this section. The section id is
437
+ * preserved when the fan parameters are reopened and regenerated. */
438
+ arcFanGroupId?: string;
350
439
  /** Closed polygon, chart units. */
351
440
  outline: Point[];
352
441
  /** Optional true line/arc/cubic boundary. `outline` is a deterministic sample
@@ -536,6 +625,8 @@ interface ExpandedSeat {
536
625
  id: string;
537
626
  /** Public label: `${rowLabel}-${seatNumber}` */
538
627
  label: string;
628
+ /** Buyer-facing copy; absent on legacy charts, where `label` is displayed. */
629
+ displayLabel?: string;
539
630
  x: number;
540
631
  y: number;
541
632
  rowId: string;
@@ -546,6 +637,7 @@ interface ExpandedSeat {
546
637
  accessible?: boolean;
547
638
  /** Specific accessibility accommodations (absent = none) — picker badges/filters these. */
548
639
  accessibility?: AccessibilityType[];
640
+ commercial?: SeatCommercialAttributes;
549
641
  /** Organizer-supplied view-from-seat image (inherited from the row). */
550
642
  viewUrl?: string;
551
643
  }
@@ -964,10 +1056,13 @@ interface RowSeatSlot {
964
1056
  x: number;
965
1057
  y: number;
966
1058
  label: string;
1059
+ displayLabel: string;
967
1060
  categoryKey: string;
968
1061
  skipped: boolean;
969
1062
  accessible: boolean;
970
1063
  accessibility: AccessibilityType[];
1064
+ commercial?: RowObject['commercial'];
1065
+ viewUrl?: string;
971
1066
  }
972
1067
  declare function expandRowSlots(row: RowObject): RowSeatSlot[];
973
1068
  declare function expandRow(row: RowObject): ExpandedSeat[];
@@ -1394,8 +1489,10 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
1394
1489
  private renderBoothUnit;
1395
1490
  /** The category's display color — Okabe-Ito hue when colorblind-safe is on. */
1396
1491
  private seatBaseColor;
1397
- /** Authored free fills retain the chart's validated ink. Renderer-owned
1398
- * transient fills choose an ink against the paint that is actually visible. */
1492
+ /** Resolve label ink against the paint that is actually visible. The theme
1493
+ * ink remains preferred, but mixed category palettes cannot always share one
1494
+ * accessible text colour, so every free and transient state gets the same
1495
+ * deterministic dark/light fallback used by Designer. */
1399
1496
  private renderedBookableLabelInk;
1400
1497
  /** Apply fill/stroke/opacity for a seat's current status + selection. */
1401
1498
  private paintSeat;
@@ -2183,4 +2280,4 @@ declare function formatMoney(amount: number, currency?: string, fractionDigits?:
2183
2280
  /** Bare symbol for input adornments ("€", "$", "₹"). */
2184
2281
  declare function currencySymbol(currency?: string): string;
2185
2282
 
2186
- export { ACCESSIBILITY_TYPES, type AccessibilityMeta, type AccessibilityType, type AvailabilityRule, type BoothObject, CHART_STORAGE_KEY, type Category, type CategoryTier, type ChartDoc, type ChartObject, type ChartReferenceImage, type ChartTheme, type CubicPath, DEFAULT_CURRENCY, type DecorImageObject, type Dict, type ExpandedSeat, type Floor, type GAAreaObject, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, type ISeatmapRenderer, type Locale, type LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerOptions, type PickerSeat, type PickerTransport, type Point, type ReferenceAccessibilitySource, type ReferenceCalibration, type ReferenceCategorySource, type ReferenceDerivedScale, type ReferenceInventoryExclusionSource, type ReferenceInventorySource, type RenderedBookableLabelEvidence, type RenderedFreeTextEvidence, type RenderedGAAreaEvidence, type RenderedHierarchyLabelEvidence, type RenderedLabelHiddenReason, type RendererCallbacks, type RendererOptions, type RendererQualityEvidence, type RowObject, type RowSeatSlot, SUPPORTED_LOCALES, type SeatHoverDetails, type SeatOverride, type SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, type SectionObject, type SectionOutlinePath, type SectionPathSegment, type SectionSummary, type SelectionLayer, type ShapeObject, type TableObject, type TextObject, UNGROUPED_ID, type ZoneDef, accessibilityMeta, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, hiddenObjectIds, isGaUnitLabel, isSectionHidden, layerOf, loadLocale, objectCenter, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount };
2283
+ export { ACCESSIBILITY_RING_COLOR, ACCESSIBILITY_TYPES, type AccessibilityMeta, type AccessibilityType, type AvailabilityRule, type BoothObject, CHART_STORAGE_KEY, type Category, type CategoryTier, type ChartDoc, type ChartObject, type ChartReferenceImage, type ChartTheme, type CubicPath, DEFAULT_CURRENCY, type DecorImageObject, type Dict, type ExpandedSeat, type Floor, type GAAreaObject, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, type ISeatmapRenderer, LABEL_STYLE_MAX_SIZE, LABEL_STYLE_MIN_SIZE, type LabelPresentation, type LabelStyle, type Locale, type LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerOptions, type PickerSeat, type PickerTransport, type Point, type ReferenceAccessibilitySource, type ReferenceCalibration, type ReferenceCategorySource, type ReferenceDerivedScale, type ReferenceInventoryExclusionSource, type ReferenceInventorySource, type RenderedBookableLabelEvidence, type RenderedFreeTextEvidence, type RenderedGAAreaEvidence, type RenderedHierarchyLabelEvidence, type RenderedLabelHiddenReason, type RendererCallbacks, type RendererOptions, type RendererQualityEvidence, type RowObject, type RowSeatSlot, SUPPORTED_LOCALES, type SeatCommercialAttributes, type SeatHoverDetails, type SeatOverride, type SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, type SectionObject, type SectionOutlinePath, type SectionPathSegment, type SectionSummary, type SelectionLayer, type ShapeObject, type TableObject, type TextObject, UNGROUPED_ID, type ZoneDef, accessibilityMeta, accessibilityRingColor, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, hiddenObjectIds, isGaUnitLabel, isSectionHidden, layerOf, loadLocale, objectCenter, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount };
package/dist/index.d.ts CHANGED
@@ -109,6 +109,14 @@ interface AccessibilityMeta {
109
109
  declare const ACCESSIBILITY_TYPES: AccessibilityMeta[];
110
110
  /** Metadata for one accessibility key (undefined for unknown keys). */
111
111
  declare function accessibilityMeta(key: AccessibilityType): AccessibilityMeta | undefined;
112
+ /**
113
+ * Outer-ring colour per accommodation. Shared by the buyer picker and the
114
+ * designer canvas so an accessible seat reads with the same hue in both — the
115
+ * seat's first-listed type wins. `wheelchair` blue is the default fallback.
116
+ */
117
+ declare const ACCESSIBILITY_RING_COLOR: Record<AccessibilityType, string>;
118
+ /** Ring colour for a seat's accessibility set (first-listed type wins). */
119
+ declare function accessibilityRingColor(types: AccessibilityType[] | undefined): string;
112
120
  interface SeatOverride {
113
121
  /** 0-based seat index within the row. */
114
122
  index: number;
@@ -119,25 +127,66 @@ interface SeatOverride {
119
127
  dy?: number;
120
128
  /** Replace the computed label entirely. */
121
129
  label?: string;
130
+ /** Buyer-facing copy only. Booking/API identity remains row id + slot index
131
+ * internally and the legacy `label` externally for backwards compatibility. */
132
+ displayLabel?: string;
122
133
  categoryKey?: string;
123
134
  /** @deprecated legacy flag — read as `['wheelchair']`; write `accessibility`. */
124
135
  accessible?: boolean;
125
136
  /** Accessibility accommodations of this seat (empty/absent = none). */
126
137
  accessibility?: AccessibilityType[];
138
+ /** Commercial selling/view attributes are deliberately not accessibility. */
139
+ commercial?: SeatCommercialAttributes;
140
+ /** Seat-specific view photo; falls back to the row photo. */
141
+ viewFromSeatUrl?: string;
142
+ }
143
+ interface SeatCommercialAttributes {
144
+ restrictedView?: boolean;
145
+ obstructedView?: boolean;
146
+ premium?: boolean;
147
+ note?: string;
148
+ }
149
+ /**
150
+ * Per-object label ink + size overrides layered on top of the chart-wide Theme
151
+ * defaults (rowLabelColor / textColor for rows, the section-name ink for
152
+ * sections). Both fields are optional: an absent field means "inherit the theme
153
+ * default". `color` is a preferred hex — renderers still pass it through the
154
+ * shared auto-contrast rule (`stateAwareBookableLabelInk`), so a choice that
155
+ * would be illegible over the seat/section background is switched to black or
156
+ * white at paint time. `size` is a font size in chart units, clamped to
157
+ * LABEL_STYLE_MIN_SIZE..LABEL_STYLE_MAX_SIZE by the shared ops.
158
+ */
159
+ interface LabelStyle {
160
+ size?: number;
161
+ color?: string;
162
+ }
163
+ /** Clamp bounds for a per-object label `size`, shared by ops, MCP, and UI. */
164
+ declare const LABEL_STYLE_MIN_SIZE = 8;
165
+ declare const LABEL_STYLE_MAX_SIZE = 24;
166
+ interface LabelPresentation {
167
+ visible?: boolean;
168
+ /** Exact Designer-owned label anchor; public semantic MCP schemas omit it. */
169
+ position?: Point;
170
+ rotation?: number;
171
+ style?: 'plain' | 'pill';
172
+ /** Per-object size/color override for this row's or section's label. */
173
+ labelStyle?: LabelStyle;
127
174
  }
128
175
  /** Brand/venue theming — applied by the renderer in both designer and picker. */
129
176
  interface ChartTheme {
130
177
  /** Canvas background color (default dark: #0e1117-ish radial). */
131
178
  background?: string;
132
- /** Seat label text color (default dark ink #0b1220). */
179
+ /** Preferred text color for the numbers inside seat markers. */
133
180
  seatLabelColor?: string;
181
+ /** Preferred color for row identifiers such as A, B, C. Falls back to textColor. */
182
+ rowLabelColor?: string;
134
183
  /** Selection ring / accent color (default white ring + brand accent). */
135
184
  selectionColor?: string;
136
185
  /** Décor (stage/shape) default fill. */
137
186
  decorFill?: string;
138
187
  /** Free-text color default. */
139
188
  textColor?: string;
140
- /** Font family (CSS stack) for all rendered text — seat labels, sections, décor text. */
189
+ /** Font family (CSS stack) for all rendered text — row labels, seat numbers, sections, décor text. */
141
190
  fontFamily?: string;
142
191
  /** Seat size multiplier on the base radius (0.7–1.6, default 1) — bigger seats fit longer labels. */
143
192
  seatScale?: number;
@@ -157,6 +206,9 @@ interface RowObject {
157
206
  id: string;
158
207
  /** Row label, e.g. "A". Seat labels are `${label}-${n}`. */
159
208
  label: string;
209
+ /** Buyer-facing row name. `label` remains the legacy inventory prefix. */
210
+ displayLabel?: string;
211
+ labelPresentation?: LabelPresentation;
160
212
  /** Position of the FIRST seat. */
161
213
  origin: Point;
162
214
  /** Degrees, clockwise. 0 = seats laid out along +x. */
@@ -178,6 +230,35 @@ interface RowObject {
178
230
  * inventory. It enables revision-safe replacement without touching manually
179
231
  * authored rows or accepting client coordinates. */
180
232
  referenceInventorySource?: ReferenceInventorySource;
233
+ /** Semantic parameters for a row produced by the shared Arc/Fan operation.
234
+ * Designer can reopen these parameters while every segment in the group
235
+ * still carries the same generation signature. Public MCP tools never accept
236
+ * the stored center/angles as arbitrary model-authored coordinates. */
237
+ arcFanGeneration?: {
238
+ kind: 'arc-fan-v1';
239
+ groupId: string;
240
+ center: Point;
241
+ innerRadius: number;
242
+ rowCount: number;
243
+ rowGap: number;
244
+ startAngle: number;
245
+ endAngle: number;
246
+ seatPitch: number;
247
+ fit: 'seat-pitch' | 'fixed-count';
248
+ seatsPerRow?: number;
249
+ facing: 'inward' | 'outward';
250
+ taperDegrees: number;
251
+ skewDegrees: number;
252
+ aisleGaps: {
253
+ left: number;
254
+ center: number;
255
+ right: number;
256
+ };
257
+ rowLabelStart: number;
258
+ seatLabelStart: number;
259
+ rowIndex: number;
260
+ segmentIndex: number;
261
+ };
181
262
  /** First seat number (default 1). */
182
263
  seatLabelStart?: number;
183
264
  /** Seat numbering within the row (default ltr, step 1). */
@@ -200,6 +281,8 @@ interface RowObject {
200
281
  * generates a synthetic panorama from chart geometry.
201
282
  */
202
283
  viewFromSeatUrl?: string;
284
+ /** Default commercial attributes inherited by seats without an override. */
285
+ commercial?: SeatCommercialAttributes;
203
286
  }
204
287
  interface GAAreaObject {
205
288
  type: 'gaArea';
@@ -340,6 +423,9 @@ interface SectionObject {
340
423
  type: 'section';
341
424
  id: string;
342
425
  label: string;
426
+ /** Buyer-facing section name; logical/id fields remain stable. */
427
+ displayLabel?: string;
428
+ labelPresentation?: LabelPresentation;
343
429
  /**
344
430
  * Stable management/inventory identity shared by disconnected visual
345
431
  * components of one logical section. When absent, `id` is the logical id.
@@ -347,6 +433,9 @@ interface SectionObject {
347
433
  * editing, measured diffs, and source restoration remain exact.
348
434
  */
349
435
  logicalSectionId?: string;
436
+ /** Shared semantic Arc/Fan group wrapped by this section. The section id is
437
+ * preserved when the fan parameters are reopened and regenerated. */
438
+ arcFanGroupId?: string;
350
439
  /** Closed polygon, chart units. */
351
440
  outline: Point[];
352
441
  /** Optional true line/arc/cubic boundary. `outline` is a deterministic sample
@@ -536,6 +625,8 @@ interface ExpandedSeat {
536
625
  id: string;
537
626
  /** Public label: `${rowLabel}-${seatNumber}` */
538
627
  label: string;
628
+ /** Buyer-facing copy; absent on legacy charts, where `label` is displayed. */
629
+ displayLabel?: string;
539
630
  x: number;
540
631
  y: number;
541
632
  rowId: string;
@@ -546,6 +637,7 @@ interface ExpandedSeat {
546
637
  accessible?: boolean;
547
638
  /** Specific accessibility accommodations (absent = none) — picker badges/filters these. */
548
639
  accessibility?: AccessibilityType[];
640
+ commercial?: SeatCommercialAttributes;
549
641
  /** Organizer-supplied view-from-seat image (inherited from the row). */
550
642
  viewUrl?: string;
551
643
  }
@@ -964,10 +1056,13 @@ interface RowSeatSlot {
964
1056
  x: number;
965
1057
  y: number;
966
1058
  label: string;
1059
+ displayLabel: string;
967
1060
  categoryKey: string;
968
1061
  skipped: boolean;
969
1062
  accessible: boolean;
970
1063
  accessibility: AccessibilityType[];
1064
+ commercial?: RowObject['commercial'];
1065
+ viewUrl?: string;
971
1066
  }
972
1067
  declare function expandRowSlots(row: RowObject): RowSeatSlot[];
973
1068
  declare function expandRow(row: RowObject): ExpandedSeat[];
@@ -1394,8 +1489,10 @@ declare class SeatmapRenderer implements ISeatmapRenderer {
1394
1489
  private renderBoothUnit;
1395
1490
  /** The category's display color — Okabe-Ito hue when colorblind-safe is on. */
1396
1491
  private seatBaseColor;
1397
- /** Authored free fills retain the chart's validated ink. Renderer-owned
1398
- * transient fills choose an ink against the paint that is actually visible. */
1492
+ /** Resolve label ink against the paint that is actually visible. The theme
1493
+ * ink remains preferred, but mixed category palettes cannot always share one
1494
+ * accessible text colour, so every free and transient state gets the same
1495
+ * deterministic dark/light fallback used by Designer. */
1399
1496
  private renderedBookableLabelInk;
1400
1497
  /** Apply fill/stroke/opacity for a seat's current status + selection. */
1401
1498
  private paintSeat;
@@ -2183,4 +2280,4 @@ declare function formatMoney(amount: number, currency?: string, fractionDigits?:
2183
2280
  /** Bare symbol for input adornments ("€", "$", "₹"). */
2184
2281
  declare function currencySymbol(currency?: string): string;
2185
2282
 
2186
- export { ACCESSIBILITY_TYPES, type AccessibilityMeta, type AccessibilityType, type AvailabilityRule, type BoothObject, CHART_STORAGE_KEY, type Category, type CategoryTier, type ChartDoc, type ChartObject, type ChartReferenceImage, type ChartTheme, type CubicPath, DEFAULT_CURRENCY, type DecorImageObject, type Dict, type ExpandedSeat, type Floor, type GAAreaObject, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, type ISeatmapRenderer, type Locale, type LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerOptions, type PickerSeat, type PickerTransport, type Point, type ReferenceAccessibilitySource, type ReferenceCalibration, type ReferenceCategorySource, type ReferenceDerivedScale, type ReferenceInventoryExclusionSource, type ReferenceInventorySource, type RenderedBookableLabelEvidence, type RenderedFreeTextEvidence, type RenderedGAAreaEvidence, type RenderedHierarchyLabelEvidence, type RenderedLabelHiddenReason, type RendererCallbacks, type RendererOptions, type RendererQualityEvidence, type RowObject, type RowSeatSlot, SUPPORTED_LOCALES, type SeatHoverDetails, type SeatOverride, type SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, type SectionObject, type SectionOutlinePath, type SectionPathSegment, type SectionSummary, type SelectionLayer, type ShapeObject, type TableObject, type TextObject, UNGROUPED_ID, type ZoneDef, accessibilityMeta, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, hiddenObjectIds, isGaUnitLabel, isSectionHidden, layerOf, loadLocale, objectCenter, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount };
2283
+ export { ACCESSIBILITY_RING_COLOR, ACCESSIBILITY_TYPES, type AccessibilityMeta, type AccessibilityType, type AvailabilityRule, type BoothObject, CHART_STORAGE_KEY, type Category, type CategoryTier, type ChartDoc, type ChartObject, type ChartReferenceImage, type ChartTheme, type CubicPath, DEFAULT_CURRENCY, type DecorImageObject, type Dict, type ExpandedSeat, type Floor, type GAAreaObject, type HoldConflict, type HoldInfo, type HoldSelectionRequest, type HoldServerItem, type ISeatmapRenderer, LABEL_STYLE_MAX_SIZE, LABEL_STYLE_MIN_SIZE, type LabelPresentation, type LabelStyle, type Locale, type LodRung, MAX_EVENT_INVENTORY, MAX_GA_CAPACITY, type PanoramaResult, type PickerCallbacks, PickerController, type PickerOptions, type PickerSeat, type PickerTransport, type Point, type ReferenceAccessibilitySource, type ReferenceCalibration, type ReferenceCategorySource, type ReferenceDerivedScale, type ReferenceInventoryExclusionSource, type ReferenceInventorySource, type RenderedBookableLabelEvidence, type RenderedFreeTextEvidence, type RenderedGAAreaEvidence, type RenderedHierarchyLabelEvidence, type RenderedLabelHiddenReason, type RendererCallbacks, type RendererOptions, type RendererQualityEvidence, type RowObject, type RowSeatSlot, SUPPORTED_LOCALES, type SeatCommercialAttributes, type SeatHoverDetails, type SeatOverride, type SeatStatus, SeatmapRenderer, type SectionCategory, type SectionNode, type SectionObject, type SectionOutlinePath, type SectionPathSegment, type SectionSummary, type SelectionLayer, type ShapeObject, type TableObject, type TextObject, UNGROUPED_ID, type ZoneDef, accessibilityMeta, accessibilityRingColor, allObjects, applyHidden, chartBounds, computeSections, createRenderer, currencySymbol, expandBooth, expandChart, expandRow, expandRowSlots, expandTable, floorObjects, floorsOf, formatDate, formatMoney, gaAreasOf, gaUnitLabel, gaUnitLabels, generateSeatPanorama, generateSeatThumb, getLocale, hiddenObjectIds, isGaUnitLabel, isSectionHidden, layerOf, loadLocale, objectCenter, pointInPolygon, pointInPolygonWithHoles, polygonLabelPoint, resolveLocale, setLocale, setMoneyLocale, setStringOverrides, stackFloors, t, tCount };
package/dist/index.js CHANGED
@@ -12,6 +12,21 @@ var ACCESSIBILITY_LABEL = new Map(ACCESSIBILITY_TYPES.map((a) => [a.key, a]));
12
12
  function accessibilityMeta(key) {
13
13
  return ACCESSIBILITY_LABEL.get(key);
14
14
  }
15
+ var ACCESSIBILITY_RING_COLOR = {
16
+ wheelchair: "#3b82f6",
17
+ companion: "#8b5cf6",
18
+ "semi-ambulatory": "#0ea5e9",
19
+ hearing: "#14b8a6",
20
+ "sign-language": "#f59e0b",
21
+ "plus-size": "#ec4899",
22
+ "lift-armrest": "#22c55e"
23
+ };
24
+ function accessibilityRingColor(types) {
25
+ const primary = types?.[0];
26
+ return primary && ACCESSIBILITY_RING_COLOR[primary] || "#3b82f6";
27
+ }
28
+ var LABEL_STYLE_MIN_SIZE = 8;
29
+ var LABEL_STYLE_MAX_SIZE = 24;
15
30
  function layerOf(obj) {
16
31
  switch (obj.type) {
17
32
  case "row":
@@ -158,15 +173,21 @@ function expandRowSlots(row) {
158
173
  return rowSeatPositions(row).map((p, i) => {
159
174
  const o = ov.get(i);
160
175
  const accessibility = overrideAccessibility(o);
176
+ const inventoryLabel = o?.label ?? `${row.label}-${seatNumber(i)}`;
177
+ const displayPrefix = row.displayLabel ?? row.label;
178
+ const commercial = { ...row.commercial, ...o?.commercial };
161
179
  return {
162
180
  index: i,
163
181
  x: p.x + (o?.dx ?? 0),
164
182
  y: p.y + (o?.dy ?? 0),
165
- label: o?.label ?? `${row.label}-${seatNumber(i)}`,
183
+ label: inventoryLabel,
184
+ displayLabel: o?.displayLabel ?? `${displayPrefix}-${seatNumber(i)}`,
166
185
  categoryKey: o?.categoryKey ?? row.categoryKey,
167
186
  skipped: !!o?.skip,
168
187
  accessible: accessibility.length > 0,
169
- accessibility
188
+ accessibility,
189
+ commercial: Object.values(commercial).some((value) => value !== void 0 && value !== false && value !== "") ? commercial : void 0,
190
+ viewUrl: o?.viewFromSeatUrl ?? row.viewFromSeatUrl
170
191
  };
171
192
  });
172
193
  }
@@ -177,13 +198,15 @@ function expandRow(row) {
177
198
  seats.push({
178
199
  id: `${row.id}:${slot.index}`,
179
200
  label: slot.label,
201
+ displayLabel: slot.displayLabel === slot.label ? void 0 : slot.displayLabel,
180
202
  x: slot.x,
181
203
  y: slot.y,
182
204
  rowId: row.id,
183
205
  categoryKey: slot.categoryKey,
184
206
  accessible: slot.accessible || void 0,
185
207
  accessibility: slot.accessibility.length ? slot.accessibility : void 0,
186
- viewUrl: row.viewFromSeatUrl
208
+ commercial: slot.commercial,
209
+ viewUrl: slot.viewUrl
187
210
  });
188
211
  }
189
212
  return seats;
@@ -541,7 +564,7 @@ function computeSections(doc) {
541
564
  }
542
565
  nodes.set(logicalId, {
543
566
  id: logicalId,
544
- label: s.label || "Section",
567
+ label: s.displayLabel || s.label || "Section",
545
568
  zone: s.zone,
546
569
  seatCount: 0,
547
570
  objectIds: [],
@@ -869,15 +892,6 @@ var CLOSED_SEAT_OPACITY = 0.4;
869
892
  var FOCUS_DIM_OPACITY = 0.16;
870
893
  var FOCUS_BACKDROP_FILL = "rgba(244,246,248,0.06)";
871
894
  var CB_PALETTE = ["#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7"];
872
- var ACCESS_RING = {
873
- wheelchair: "#3b82f6",
874
- companion: "#8b5cf6",
875
- "semi-ambulatory": "#0ea5e9",
876
- hearing: "#14b8a6",
877
- "sign-language": "#f59e0b",
878
- "plus-size": "#ec4899",
879
- "lift-armrest": "#22c55e"
880
- };
881
895
  function seatMatchesAccess(seat, filter) {
882
896
  if (filter.length === 0) return !!seat.accessible;
883
897
  return !!seat.accessibility?.some((t2) => filter.includes(t2));
@@ -2327,13 +2341,12 @@ var _SeatmapRenderer = class _SeatmapRenderer {
2327
2341
  this.paintSeat(c, seat.id);
2328
2342
  target.add(c);
2329
2343
  if (seat.accessible) {
2330
- const primary = seat.accessibility?.[0];
2331
2344
  target.add(
2332
2345
  new Circle({
2333
2346
  x: seat.x,
2334
2347
  y: seat.y,
2335
2348
  radius: this.seatR + 1,
2336
- stroke: primary && ACCESS_RING[primary] || "#3b82f6",
2349
+ stroke: accessibilityRingColor(seat.accessibility),
2337
2350
  strokeWidth: 2,
2338
2351
  listening: false,
2339
2352
  perfectDrawEnabled: false,
@@ -2366,7 +2379,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
2366
2379
  const t2 = new Text({
2367
2380
  x: seat.x,
2368
2381
  y: seat.y,
2369
- text: seat.label,
2382
+ text: seat.displayLabel ?? seat.label,
2370
2383
  fontSize: BOOTH_LABEL_FONT_SIZE,
2371
2384
  fontStyle: "600",
2372
2385
  fontFamily: this.labelFont(),
@@ -2389,12 +2402,12 @@ var _SeatmapRenderer = class _SeatmapRenderer {
2389
2402
  const idx = this.catOrder.indexOf(categoryKey);
2390
2403
  return CB_PALETTE[(idx >= 0 ? idx : 0) % CB_PALETTE.length];
2391
2404
  }
2392
- /** Authored free fills retain the chart's validated ink. Renderer-owned
2393
- * transient fills choose an ink against the paint that is actually visible. */
2394
- renderedBookableLabelInk(id, shape) {
2405
+ /** Resolve label ink against the paint that is actually visible. The theme
2406
+ * ink remains preferred, but mixed category palettes cannot always share one
2407
+ * accessible text colour, so every free and transient state gets the same
2408
+ * deterministic dark/light fallback used by Designer. */
2409
+ renderedBookableLabelInk(shape) {
2395
2410
  const preferred = this.theme.seatLabelColor ?? DEF_SEAT_LABEL;
2396
- const status = this.statusById.get(id) ?? "free";
2397
- if (status === "free" && !this.selection.has(id)) return preferred;
2398
2411
  const fill = shape.fill();
2399
2412
  return stateAwareBookableLabelInk(typeof fill === "string" ? fill : "", preferred);
2400
2413
  }
@@ -2480,7 +2493,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
2480
2493
  if (this.selectionFocusId && id !== this.selectionFocusId) c.opacity(Math.min(c.opacity(), 0.16));
2481
2494
  const bookableLabel = this.boothLabelById.get(id) ?? this.seatLabelById.get(id);
2482
2495
  if (bookableLabel) {
2483
- bookableLabel.fill(this.renderedBookableLabelInk(id, c));
2496
+ bookableLabel.fill(this.renderedBookableLabelInk(c));
2484
2497
  bookableLabel.visible(
2485
2498
  isBookableLabelLegibleAtScale(bookableLabel.fontSize(), this.effScale()) && c.opacity() >= 0.5
2486
2499
  );
@@ -3021,14 +3034,19 @@ var _SeatmapRenderer = class _SeatmapRenderer {
3021
3034
  listening: false
3022
3035
  }, obj.outlinePath);
3023
3036
  bgTarget.add(blockPoly);
3037
+ const labelStyle = obj.labelPresentation?.labelStyle;
3038
+ const preferredInk = labelStyle?.color ?? palette.sectionInk;
3039
+ const labelScale = (labelStyle?.size ?? 18) / 18;
3024
3040
  const nameLabel = new Text({
3025
- x: centroid.x,
3026
- y: centroid.y,
3027
- text: obj.label,
3028
- fontSize: 22,
3041
+ x: obj.labelPresentation?.position?.x ?? centroid.x,
3042
+ y: obj.labelPresentation?.position?.y ?? centroid.y,
3043
+ text: obj.displayLabel ?? obj.label,
3044
+ rotation: obj.labelPresentation?.rotation ?? 0,
3045
+ visible: obj.labelPresentation?.visible !== false,
3046
+ fontSize: 22 * labelScale,
3029
3047
  fontStyle: "700",
3030
3048
  fontFamily: this.labelFont(),
3031
- fill: palette.sectionInk,
3049
+ fill: stateAwareBookableLabelInk(palette.sectionFill, preferredInk),
3032
3050
  listening: false,
3033
3051
  perfectDrawEnabled: false
3034
3052
  });
@@ -3052,7 +3070,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
3052
3070
  const sec = {
3053
3071
  id: obj.id,
3054
3072
  logicalId: obj.logicalSectionId ?? obj.id,
3055
- label: obj.label,
3073
+ label: obj.displayLabel ?? obj.label,
3056
3074
  outline: obj.outline,
3057
3075
  ...obj.outlinePath ? { outlinePath: obj.outlinePath } : {},
3058
3076
  holes: obj.holes ?? [],
@@ -3068,6 +3086,8 @@ var _SeatmapRenderer = class _SeatmapRenderer {
3068
3086
  blockPoly,
3069
3087
  nameLabel,
3070
3088
  subLabel,
3089
+ preferredInk,
3090
+ labelScale,
3071
3091
  nameLabelFits: true,
3072
3092
  subLabelFits: true,
3073
3093
  elevation,
@@ -3236,7 +3256,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
3236
3256
  const sectionFill = sec.blockPoly.fill();
3237
3257
  const sectionInk = stateAwareBookableLabelInk(
3238
3258
  typeof sectionFill === "string" ? sectionFill : sec.baseFill,
3239
- palette.sectionInk
3259
+ sec.preferredInk
3240
3260
  );
3241
3261
  sec.nameLabel.fill(sectionInk);
3242
3262
  sec.subLabel.fill(sectionInk);
@@ -3332,7 +3352,9 @@ var _SeatmapRenderer = class _SeatmapRenderer {
3332
3352
  fitSectionRungLabels(sec, sx) {
3333
3353
  const paddingPx = 8;
3334
3354
  sec.subLabelFits = false;
3335
- for (let fontPx = SECTION_LABEL_PX; fontPx >= MIN_SECTION_LABEL_PX; fontPx -= 1) {
3355
+ const maxPx = SECTION_LABEL_PX * sec.labelScale;
3356
+ const minPx = MIN_SECTION_LABEL_PX * sec.labelScale;
3357
+ for (let fontPx = maxPx; fontPx >= minPx; fontPx -= 1) {
3336
3358
  for (const rotation of [0, -90]) {
3337
3359
  sec.nameLabel.rotation(rotation);
3338
3360
  this.sizeLabel(sec.nameLabel, fontPx / sx, sec.nameLabel.y());
@@ -4169,7 +4191,7 @@ var _SeatmapRenderer = class _SeatmapRenderer {
4169
4191
  continue;
4170
4192
  }
4171
4193
  measure.fontSize(SEAT_LABEL_FONT_SIZE);
4172
- measure.text(bookableMarkerLabel(seat.label));
4194
+ measure.text(bookableMarkerLabel(seat.displayLabel ?? seat.label));
4173
4195
  const fitted = measure.width() > maxWidth ? Math.max(MIN_FITTED_SEAT_LABEL_FONT_SIZE, SEAT_LABEL_FONT_SIZE * maxWidth / measure.width()) : SEAT_LABEL_FONT_SIZE;
4174
4196
  minimumFont = Math.min(minimumFont, fitted);
4175
4197
  }
@@ -4323,11 +4345,11 @@ var _SeatmapRenderer = class _SeatmapRenderer {
4323
4345
  const t2 = new Text({
4324
4346
  x: seat.x,
4325
4347
  y: seat.y,
4326
- text: bookableMarkerLabel(seat.label),
4348
+ text: bookableMarkerLabel(seat.displayLabel ?? seat.label),
4327
4349
  fontSize: SEAT_LABEL_FONT_SIZE,
4328
4350
  fontStyle: "600",
4329
4351
  fontFamily: this.labelFont(),
4330
- fill: shape ? this.renderedBookableLabelInk(seat.id, shape) : this.theme.seatLabelColor ?? DEF_SEAT_LABEL,
4352
+ fill: shape ? this.renderedBookableLabelInk(shape) : this.theme.seatLabelColor ?? DEF_SEAT_LABEL,
4331
4353
  listening: false,
4332
4354
  perfectDrawEnabled: false
4333
4355
  });
@@ -5618,9 +5640,12 @@ async function loadLocale(code) {
5618
5640
  }
5619
5641
  }
5620
5642
  export {
5643
+ ACCESSIBILITY_RING_COLOR,
5621
5644
  ACCESSIBILITY_TYPES,
5622
5645
  CHART_STORAGE_KEY,
5623
5646
  DEFAULT_CURRENCY,
5647
+ LABEL_STYLE_MAX_SIZE,
5648
+ LABEL_STYLE_MIN_SIZE,
5624
5649
  MAX_EVENT_INVENTORY,
5625
5650
  MAX_GA_CAPACITY,
5626
5651
  PickerController,
@@ -5628,6 +5653,7 @@ export {
5628
5653
  SeatmapRenderer,
5629
5654
  UNGROUPED_ID,
5630
5655
  accessibilityMeta,
5656
+ accessibilityRingColor,
5631
5657
  allObjects,
5632
5658
  applyHidden,
5633
5659
  chartBounds,