@seatlayer/angular 0.35.0 → 0.36.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.
@@ -43,6 +43,14 @@ class SeatLayerSeatingChartComponent {
43
43
  seatTooltip;
44
44
  /** Copy overrides, read once per rebuild. */
45
45
  messages;
46
+ /**
47
+ * Sales Channels: mint a buyer access session on demand. Called with a
48
+ * `reason`; returns `{ token, expiresAt }` from YOUR backend. The token is
49
+ * held in memory only — never storage, never a URL, never a log.
50
+ */
51
+ buyerAccessTokenProvider;
52
+ /** One-shot session for hosts that own the lifecycle. Cannot be renewed. */
53
+ buyerAccessToken;
46
54
  /** The buyer's selection changed. */
47
55
  selectionChange = new EventEmitter();
48
56
  /** A hold succeeded. */
@@ -61,6 +69,12 @@ class SeatLayerSeatingChartComponent {
61
69
  hint = new EventEmitter();
62
70
  /** The pointer moved onto a seat, or off one (`null`). */
63
71
  seatHover = new EventEmitter();
72
+ /** The buyer access session lapsed; `refreshed` says whether it recovered. */
73
+ accessExpired = new EventEmitter();
74
+ /** Private inventory is unavailable and refreshing will not fix it. */
75
+ accessUnavailable = new EventEmitter();
76
+ /** Selected-but-unheld units stopped being selectable. */
77
+ selectedObjectUnavailable = new EventEmitter();
64
78
  container;
65
79
  zone = inject(NgZone);
66
80
  chart = null;
@@ -142,6 +156,13 @@ class SeatLayerSeatingChartComponent {
142
156
  zoomToFit() {
143
157
  this.chart?.zoomToFit();
144
158
  }
159
+ /**
160
+ * Re-acquire the buyer access session after your app re-authorizes the buyer
161
+ * (Sales Channels). Resolves false when the chart is not access-scoped.
162
+ */
163
+ refreshAccess() {
164
+ return this.chart?.refreshAccess() ?? Promise.resolve(false);
165
+ }
145
166
  // ---------- internals ----------
146
167
  build() {
147
168
  const element = this.container?.nativeElement;
@@ -174,6 +195,11 @@ class SeatLayerSeatingChartComponent {
174
195
  onDeckTap: (floorId) => emit(this.deckTap, floorId),
175
196
  onHint: (message) => emit(this.hint, message),
176
197
  onSeatHover: (details) => emit(this.seatHover, details),
198
+ buyerAccessTokenProvider: this.buyerAccessTokenProvider,
199
+ buyerAccessToken: this.buyerAccessToken,
200
+ onAccessExpired: (state) => emit(this.accessExpired, state),
201
+ onAccessUnavailable: (state) => emit(this.accessUnavailable, state),
202
+ onSelectedObjectUnavailable: (state) => emit(this.selectedObjectUnavailable, state),
177
203
  });
178
204
  this.chart = instance;
179
205
  void instance.render();
@@ -184,7 +210,7 @@ class SeatLayerSeatingChartComponent {
184
210
  this.chart = null;
185
211
  }
186
212
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SeatLayerSeatingChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
187
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: SeatLayerSeatingChartComponent, isStandalone: true, selector: "seatlayer-seating-chart", inputs: { event: "event", apiBase: "apiBase", maxSelection: "maxSelection", publicKey: "publicKey", locale: "locale", currency: "currency", colorblindSafe: "colorblindSafe", seatTooltip: "seatTooltip", messages: "messages" }, outputs: { selectionChange: "selectionChange", hold: "hold", holdRestored: "holdRestored", holdExpired: "holdExpired", gaClick: "gaClick", errored: "errored", deckTap: "deckTap", hint: "hint", seatHover: "seatHover" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #container class="seatlayer-container"></div>', isInline: true, styles: [":host{display:block}.seatlayer-container{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
213
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: SeatLayerSeatingChartComponent, isStandalone: true, selector: "seatlayer-seating-chart", inputs: { event: "event", apiBase: "apiBase", maxSelection: "maxSelection", publicKey: "publicKey", locale: "locale", currency: "currency", colorblindSafe: "colorblindSafe", seatTooltip: "seatTooltip", messages: "messages", buyerAccessTokenProvider: "buyerAccessTokenProvider", buyerAccessToken: "buyerAccessToken" }, outputs: { selectionChange: "selectionChange", hold: "hold", holdRestored: "holdRestored", holdExpired: "holdExpired", gaClick: "gaClick", errored: "errored", deckTap: "deckTap", hint: "hint", seatHover: "seatHover", accessExpired: "accessExpired", accessUnavailable: "accessUnavailable", selectedObjectUnavailable: "selectedObjectUnavailable" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: '<div #container class="seatlayer-container"></div>', isInline: true, styles: [":host{display:block}.seatlayer-container{width:100%;height:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
188
214
  }
189
215
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SeatLayerSeatingChartComponent, decorators: [{
190
216
  type: Component,
@@ -208,6 +234,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
208
234
  type: Input
209
235
  }], messages: [{
210
236
  type: Input
237
+ }], buyerAccessTokenProvider: [{
238
+ type: Input
239
+ }], buyerAccessToken: [{
240
+ type: Input
211
241
  }], selectionChange: [{
212
242
  type: Output
213
243
  }], hold: [{
@@ -226,6 +256,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
226
256
  type: Output
227
257
  }], seatHover: [{
228
258
  type: Output
259
+ }], accessExpired: [{
260
+ type: Output
261
+ }], accessUnavailable: [{
262
+ type: Output
263
+ }], selectedObjectUnavailable: [{
264
+ type: Output
229
265
  }], container: [{
230
266
  type: ViewChild,
231
267
  args: ['container', { static: true }]
@@ -1 +1 @@
1
- {"version":3,"file":"seatlayer-angular.mjs","sources":["../../src/seating-chart.component.ts","../../src/index.ts","../../src/seatlayer-angular.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild,\n inject,\n} from '@angular/core';\nimport {\n SeatingChart as CoreSeatingChart,\n type SeatingChartOptions,\n type SelectedSeat,\n type HoldResult,\n type BestAvailableResult,\n type GAAreaAvailability,\n type SeatHoverDetails,\n} from '@seatlayer/js';\n\n/**\n * Angular wrapper around the framework-agnostic `@seatlayer/js` SDK.\n *\n * Standalone, so it is imported directly rather than through an NgModule.\n *\n * The canvas is created once and torn down on destroy. Only the inputs that\n * change the chart's identity — `event`, `apiBase`, `maxSelection`, `publicKey`,\n * `locale`, `currency`, `colorblindSafe` — trigger a rebuild, so an unrelated\n * change-detection pass never destroys the canvas mid-selection.\n *\n * @example\n * ```html\n * <seatlayer-seating-chart\n * #chart\n * event=\"summer-gala\"\n * (selectionChange)=\"onSelectionChange($event)\"\n * (hold)=\"onHold($event)\"\n * />\n * <button (click)=\"chart.hold()\">Continue</button>\n * ```\n */\n@Component({\n selector: 'seatlayer-seating-chart',\n standalone: true,\n template: '<div #container class=\"seatlayer-container\"></div>',\n styles: [':host { display: block; } .seatlayer-container { width: 100%; height: 100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SeatLayerSeatingChartComponent implements OnChanges {\n /** Event key to render. Changing it rebuilds the chart. */\n @Input({ required: true }) event!: string;\n\n /** API base URL. Defaults to the public API. */\n @Input() apiBase?: string;\n\n /** Cap on how many seats a buyer may select. */\n @Input() maxSelection?: number;\n\n /** Publishable key, when your integration uses one. */\n @Input() publicKey?: string;\n\n /** BCP-47 locale for built-in copy. */\n @Input() locale?: string;\n\n /** ISO currency for price formatting. */\n @Input() currency?: string;\n\n /** Render with colorblind-safe seat glyphs. */\n @Input() colorblindSafe?: boolean;\n\n /** Show the built-in seat tooltip. Set false to draw your own from `seatHover`. */\n @Input() seatTooltip?: boolean;\n\n /** Copy overrides, read once per rebuild. */\n @Input() messages?: SeatingChartOptions['messages'];\n\n /** The buyer's selection changed. */\n @Output() readonly selectionChange: EventEmitter<SelectedSeat[]> = new EventEmitter<SelectedSeat[]>();\n\n /** A hold succeeded. */\n @Output() readonly hold: EventEmitter<HoldResult> = new EventEmitter<HoldResult>();\n\n /** A previous hold was restored on mount. */\n @Output() readonly holdRestored: EventEmitter<HoldResult> = new EventEmitter<HoldResult>();\n\n /** The active hold lapsed. */\n @Output() readonly holdExpired: EventEmitter<void> = new EventEmitter<void>();\n\n /** A GA area was clicked. */\n @Output() readonly gaClick: EventEmitter<GAAreaAvailability> = new EventEmitter<GAAreaAvailability>();\n\n /** Something failed — a network error, a rejected hold. */\n @Output() readonly errored: EventEmitter<unknown> = new EventEmitter<unknown>();\n\n /** A floor deck was tapped in the 3D view. */\n @Output() readonly deckTap: EventEmitter<string> = new EventEmitter<string>();\n\n /** A transient hint worth showing the buyer, or `null` to clear it. */\n @Output() readonly hint: EventEmitter<string | null> = new EventEmitter<string | null>();\n\n /** The pointer moved onto a seat, or off one (`null`). */\n @Output() readonly seatHover: EventEmitter<SeatHoverDetails | null> = new EventEmitter<SeatHoverDetails | null>();\n\n @ViewChild('container', { static: true })\n private readonly container!: ElementRef<HTMLDivElement>;\n\n private readonly zone = inject(NgZone);\n private chart: CoreSeatingChart | null = null;\n\n /** Inputs that require tearing the canvas down and rebuilding it. */\n private static readonly REBUILD_INPUTS = [\n 'event', 'apiBase', 'maxSelection', 'publicKey', 'locale', 'currency', 'colorblindSafe',\n ] as const;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.destroy());\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const needsRebuild = SeatLayerSeatingChartComponent.REBUILD_INPUTS.some((name) => name in changes);\n if (needsRebuild) {\n this.build();\n }\n }\n\n // ---------- imperative API, for a template ref ----------\n\n /** Hold the current selection. Resolves the hold, or `null` on a 409 conflict. */\n holdSelection(options?: { ttlMs?: number }): Promise<HoldResult | null> {\n return this.chart?.hold(options) ?? Promise.resolve(null);\n }\n\n /** Restore an active hold by its opaque id. */\n resumeHold(holdId: string): Promise<HoldResult | null> {\n return this.chart?.resumeHold(holdId) ?? Promise.resolve(null);\n }\n\n /** Current active hold known to the chart. */\n getCurrentHold(): HoldResult | null {\n return this.chart?.getCurrentHold() ?? null;\n }\n\n /** GA areas with live remaining capacity. */\n getGAAreas(): GAAreaAvailability[] {\n return this.chart?.getGAAreas() ?? [];\n }\n\n /** Atomically hold a quantity from one GA area. */\n holdGA(\n areaId: string,\n qty: number,\n options?: { tierId?: string | null; ttlMs?: number },\n ): Promise<HoldResult | null> {\n return this.chart?.holdGA(areaId, qty, options) ?? Promise.resolve(null);\n }\n\n /** Ask the server for the `qty` best free seats and hold them atomically. */\n bestAvailable(qty: number, categoryKey?: string): Promise<BestAvailableResult | null> {\n return this.chart?.bestAvailable(qty, categoryKey) ?? Promise.resolve(null);\n }\n\n /** Release the current hold (if any). */\n release(): Promise<void> {\n return this.chart?.release() ?? Promise.resolve();\n }\n\n /** Release some held labels while keeping the remainder active. */\n releaseLabels(labels: string[]): Promise<boolean> {\n return this.chart?.releaseLabels(labels) ?? Promise.resolve(false);\n }\n\n /** The current selection, with prices resolved from the chart categories. */\n getSelection(): SelectedSeat[] {\n return this.chart?.getSelection() ?? [];\n }\n\n /** Choose a ticket tier for a selected seat; `null` reverts to the default. */\n setSeatTier(seatId: string, tierId: string | null): void {\n this.chart?.setSeatTier(seatId, tierId);\n }\n\n /** Floors of a multi-floor chart. Empty before the first render. */\n getFloors(): { id: string; name: string }[] {\n return this.chart?.getFloors() ?? [];\n }\n\n /** Switch the shown floor (2D). No-ops on single-floor charts. */\n setFloor(floorId: string): void {\n this.chart?.setFloor(floorId);\n }\n\n /** Toggle colorblind-safe rendering at runtime. */\n setColorblindSafe(on: boolean): void {\n this.chart?.setColorblindSafe(on);\n }\n\n /** Zoom in one step (same increment as the wheel/pinch gesture). */\n zoomIn(): void {\n this.chart?.zoomIn();\n }\n\n /** Zoom out one step. */\n zoomOut(): void {\n this.chart?.zoomOut();\n }\n\n /** Reset the camera so the whole chart fits the container. */\n zoomToFit(): void {\n this.chart?.zoomToFit();\n }\n\n // ---------- internals ----------\n\n private build(): void {\n const element = this.container?.nativeElement;\n if (!element) return;\n\n this.destroy();\n\n // The chart runs a rAF render loop and pointer handlers. Left inside the\n // Angular zone, every frame would schedule change detection for the whole\n // application — so it is built outside, and each callback re-enters the zone\n // only to emit, which is the only part Angular needs to see.\n this.zone.runOutsideAngular(() => {\n const emit = <T>(emitter: EventEmitter<T>, value: T) =>\n this.zone.run(() => emitter.emit(value));\n\n const instance = new CoreSeatingChart({\n container: element,\n event: this.event,\n apiBase: this.apiBase,\n maxSelection: this.maxSelection,\n publicKey: this.publicKey,\n locale: this.locale,\n currency: this.currency,\n colorblindSafe: this.colorblindSafe,\n seatTooltip: this.seatTooltip,\n messages: this.messages,\n onSelectionChange: (seats) => emit(this.selectionChange, seats),\n onHold: (result) => emit(this.hold, result),\n onHoldRestored: (result) => emit(this.holdRestored, result),\n onHoldExpired: () => this.zone.run(() => this.holdExpired.emit()),\n onGAClick: (area) => emit(this.gaClick, area),\n onError: (error) => emit(this.errored, error),\n onDeckTap: (floorId) => emit(this.deckTap, floorId),\n onHint: (message) => emit(this.hint, message),\n onSeatHover: (details) => emit(this.seatHover, details),\n });\n\n this.chart = instance;\n void instance.render();\n });\n }\n\n private destroy(): void {\n this.chart?.destroy();\n this.chart = null;\n }\n}\n","/**\n * @seatlayer/angular — the Angular wrapper for the SeatLayer embed SDK.\n *\n * The component is standalone; import it directly rather than through an\n * NgModule.\n */\nexport { SeatLayerSeatingChartComponent } from './seating-chart.component';\n\nexport type {\n SelectedSeat,\n HoldResult,\n BestAvailableResult,\n GAAreaAvailability,\n HoldLineItem,\n SeatHoverDetails,\n} from '@seatlayer/js';\n\n// The framework-agnostic widget class — for the one-call modal (SeatPickerWidget.open()).\nexport { SeatPicker as SeatPickerWidget } from '@seatlayer/js';\n\n// Host-side embed helper: grows the iframe on `seatlayer:height` and pins it on\n// `seatlayer:fullscreen`. Angular hosts depend on this package alone, so it has to\n// be reachable here rather than only from @seatlayer/js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GkB,OAAO,EAAA,CAAA;sBAAzB;gBAGkB,OAAO,EAAA,CAAA;sBAAzB;gBAGkB,IAAI,EAAA,CAAA;sBAAtB;gBAGkB,SAAS,EAAA,CAAA;sBAA3B;gBAGgB,SAAS,EAAA,CAAA;sBADzB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;AC3G1C;;;;;AAKG;;ACLH;;AAEG;;;;"}
1
+ {"version":3,"file":"seatlayer-angular.mjs","sources":["../../src/seating-chart.component.ts","../../src/index.ts","../../src/seatlayer-angular.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n Output,\n SimpleChanges,\n ViewChild,\n inject,\n} from '@angular/core';\nimport {\n SeatingChart as CoreSeatingChart,\n type SeatingChartOptions,\n type SelectedSeat,\n type HoldResult,\n type BestAvailableResult,\n type GAAreaAvailability,\n type SeatHoverDetails,\n type BuyerAccessToken,\n type BuyerAccessTokenProvider,\n type BuyerAccessExpiredEvent,\n type BuyerAccessUnavailableEvent,\n type SelectedObjectUnavailableEvent,\n} from '@seatlayer/js';\n\n/**\n * Angular wrapper around the framework-agnostic `@seatlayer/js` SDK.\n *\n * Standalone, so it is imported directly rather than through an NgModule.\n *\n * The canvas is created once and torn down on destroy. Only the inputs that\n * change the chart's identity — `event`, `apiBase`, `maxSelection`, `publicKey`,\n * `locale`, `currency`, `colorblindSafe` — trigger a rebuild, so an unrelated\n * change-detection pass never destroys the canvas mid-selection.\n *\n * @example\n * ```html\n * <seatlayer-seating-chart\n * #chart\n * event=\"summer-gala\"\n * (selectionChange)=\"onSelectionChange($event)\"\n * (hold)=\"onHold($event)\"\n * />\n * <button (click)=\"chart.hold()\">Continue</button>\n * ```\n */\n@Component({\n selector: 'seatlayer-seating-chart',\n standalone: true,\n template: '<div #container class=\"seatlayer-container\"></div>',\n styles: [':host { display: block; } .seatlayer-container { width: 100%; height: 100%; }'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SeatLayerSeatingChartComponent implements OnChanges {\n /** Event key to render. Changing it rebuilds the chart. */\n @Input({ required: true }) event!: string;\n\n /** API base URL. Defaults to the public API. */\n @Input() apiBase?: string;\n\n /** Cap on how many seats a buyer may select. */\n @Input() maxSelection?: number;\n\n /** Publishable key, when your integration uses one. */\n @Input() publicKey?: string;\n\n /** BCP-47 locale for built-in copy. */\n @Input() locale?: string;\n\n /** ISO currency for price formatting. */\n @Input() currency?: string;\n\n /** Render with colorblind-safe seat glyphs. */\n @Input() colorblindSafe?: boolean;\n\n /** Show the built-in seat tooltip. Set false to draw your own from `seatHover`. */\n @Input() seatTooltip?: boolean;\n\n /** Copy overrides, read once per rebuild. */\n @Input() messages?: SeatingChartOptions['messages'];\n\n /**\n * Sales Channels: mint a buyer access session on demand. Called with a\n * `reason`; returns `{ token, expiresAt }` from YOUR backend. The token is\n * held in memory only — never storage, never a URL, never a log.\n */\n @Input() buyerAccessTokenProvider?: BuyerAccessTokenProvider;\n\n /** One-shot session for hosts that own the lifecycle. Cannot be renewed. */\n @Input() buyerAccessToken?: string | BuyerAccessToken;\n\n /** The buyer's selection changed. */\n @Output() readonly selectionChange: EventEmitter<SelectedSeat[]> = new EventEmitter<SelectedSeat[]>();\n\n /** A hold succeeded. */\n @Output() readonly hold: EventEmitter<HoldResult> = new EventEmitter<HoldResult>();\n\n /** A previous hold was restored on mount. */\n @Output() readonly holdRestored: EventEmitter<HoldResult> = new EventEmitter<HoldResult>();\n\n /** The active hold lapsed. */\n @Output() readonly holdExpired: EventEmitter<void> = new EventEmitter<void>();\n\n /** A GA area was clicked. */\n @Output() readonly gaClick: EventEmitter<GAAreaAvailability> = new EventEmitter<GAAreaAvailability>();\n\n /** Something failed — a network error, a rejected hold. */\n @Output() readonly errored: EventEmitter<unknown> = new EventEmitter<unknown>();\n\n /** A floor deck was tapped in the 3D view. */\n @Output() readonly deckTap: EventEmitter<string> = new EventEmitter<string>();\n\n /** A transient hint worth showing the buyer, or `null` to clear it. */\n @Output() readonly hint: EventEmitter<string | null> = new EventEmitter<string | null>();\n\n /** The pointer moved onto a seat, or off one (`null`). */\n @Output() readonly seatHover: EventEmitter<SeatHoverDetails | null> = new EventEmitter<SeatHoverDetails | null>();\n\n /** The buyer access session lapsed; `refreshed` says whether it recovered. */\n @Output() readonly accessExpired: EventEmitter<BuyerAccessExpiredEvent> =\n new EventEmitter<BuyerAccessExpiredEvent>();\n\n /** Private inventory is unavailable and refreshing will not fix it. */\n @Output() readonly accessUnavailable: EventEmitter<BuyerAccessUnavailableEvent> =\n new EventEmitter<BuyerAccessUnavailableEvent>();\n\n /** Selected-but-unheld units stopped being selectable. */\n @Output() readonly selectedObjectUnavailable: EventEmitter<SelectedObjectUnavailableEvent> =\n new EventEmitter<SelectedObjectUnavailableEvent>();\n\n @ViewChild('container', { static: true })\n private readonly container!: ElementRef<HTMLDivElement>;\n\n private readonly zone = inject(NgZone);\n private chart: CoreSeatingChart | null = null;\n\n /** Inputs that require tearing the canvas down and rebuilding it. */\n private static readonly REBUILD_INPUTS = [\n 'event', 'apiBase', 'maxSelection', 'publicKey', 'locale', 'currency', 'colorblindSafe',\n ] as const;\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.destroy());\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const needsRebuild = SeatLayerSeatingChartComponent.REBUILD_INPUTS.some((name) => name in changes);\n if (needsRebuild) {\n this.build();\n }\n }\n\n // ---------- imperative API, for a template ref ----------\n\n /** Hold the current selection. Resolves the hold, or `null` on a 409 conflict. */\n holdSelection(options?: { ttlMs?: number }): Promise<HoldResult | null> {\n return this.chart?.hold(options) ?? Promise.resolve(null);\n }\n\n /** Restore an active hold by its opaque id. */\n resumeHold(holdId: string): Promise<HoldResult | null> {\n return this.chart?.resumeHold(holdId) ?? Promise.resolve(null);\n }\n\n /** Current active hold known to the chart. */\n getCurrentHold(): HoldResult | null {\n return this.chart?.getCurrentHold() ?? null;\n }\n\n /** GA areas with live remaining capacity. */\n getGAAreas(): GAAreaAvailability[] {\n return this.chart?.getGAAreas() ?? [];\n }\n\n /** Atomically hold a quantity from one GA area. */\n holdGA(\n areaId: string,\n qty: number,\n options?: { tierId?: string | null; ttlMs?: number },\n ): Promise<HoldResult | null> {\n return this.chart?.holdGA(areaId, qty, options) ?? Promise.resolve(null);\n }\n\n /** Ask the server for the `qty` best free seats and hold them atomically. */\n bestAvailable(qty: number, categoryKey?: string): Promise<BestAvailableResult | null> {\n return this.chart?.bestAvailable(qty, categoryKey) ?? Promise.resolve(null);\n }\n\n /** Release the current hold (if any). */\n release(): Promise<void> {\n return this.chart?.release() ?? Promise.resolve();\n }\n\n /** Release some held labels while keeping the remainder active. */\n releaseLabels(labels: string[]): Promise<boolean> {\n return this.chart?.releaseLabels(labels) ?? Promise.resolve(false);\n }\n\n /** The current selection, with prices resolved from the chart categories. */\n getSelection(): SelectedSeat[] {\n return this.chart?.getSelection() ?? [];\n }\n\n /** Choose a ticket tier for a selected seat; `null` reverts to the default. */\n setSeatTier(seatId: string, tierId: string | null): void {\n this.chart?.setSeatTier(seatId, tierId);\n }\n\n /** Floors of a multi-floor chart. Empty before the first render. */\n getFloors(): { id: string; name: string }[] {\n return this.chart?.getFloors() ?? [];\n }\n\n /** Switch the shown floor (2D). No-ops on single-floor charts. */\n setFloor(floorId: string): void {\n this.chart?.setFloor(floorId);\n }\n\n /** Toggle colorblind-safe rendering at runtime. */\n setColorblindSafe(on: boolean): void {\n this.chart?.setColorblindSafe(on);\n }\n\n /** Zoom in one step (same increment as the wheel/pinch gesture). */\n zoomIn(): void {\n this.chart?.zoomIn();\n }\n\n /** Zoom out one step. */\n zoomOut(): void {\n this.chart?.zoomOut();\n }\n\n /** Reset the camera so the whole chart fits the container. */\n zoomToFit(): void {\n this.chart?.zoomToFit();\n }\n\n /**\n * Re-acquire the buyer access session after your app re-authorizes the buyer\n * (Sales Channels). Resolves false when the chart is not access-scoped.\n */\n refreshAccess(): Promise<boolean> {\n return this.chart?.refreshAccess() ?? Promise.resolve(false);\n }\n\n // ---------- internals ----------\n\n private build(): void {\n const element = this.container?.nativeElement;\n if (!element) return;\n\n this.destroy();\n\n // The chart runs a rAF render loop and pointer handlers. Left inside the\n // Angular zone, every frame would schedule change detection for the whole\n // application — so it is built outside, and each callback re-enters the zone\n // only to emit, which is the only part Angular needs to see.\n this.zone.runOutsideAngular(() => {\n const emit = <T>(emitter: EventEmitter<T>, value: T) =>\n this.zone.run(() => emitter.emit(value));\n\n const instance = new CoreSeatingChart({\n container: element,\n event: this.event,\n apiBase: this.apiBase,\n maxSelection: this.maxSelection,\n publicKey: this.publicKey,\n locale: this.locale,\n currency: this.currency,\n colorblindSafe: this.colorblindSafe,\n seatTooltip: this.seatTooltip,\n messages: this.messages,\n onSelectionChange: (seats) => emit(this.selectionChange, seats),\n onHold: (result) => emit(this.hold, result),\n onHoldRestored: (result) => emit(this.holdRestored, result),\n onHoldExpired: () => this.zone.run(() => this.holdExpired.emit()),\n onGAClick: (area) => emit(this.gaClick, area),\n onError: (error) => emit(this.errored, error),\n onDeckTap: (floorId) => emit(this.deckTap, floorId),\n onHint: (message) => emit(this.hint, message),\n onSeatHover: (details) => emit(this.seatHover, details),\n buyerAccessTokenProvider: this.buyerAccessTokenProvider,\n buyerAccessToken: this.buyerAccessToken,\n onAccessExpired: (state) => emit(this.accessExpired, state),\n onAccessUnavailable: (state) => emit(this.accessUnavailable, state),\n onSelectedObjectUnavailable: (state) => emit(this.selectedObjectUnavailable, state),\n });\n\n this.chart = instance;\n void instance.render();\n });\n }\n\n private destroy(): void {\n this.chart?.destroy();\n this.chart = null;\n }\n}\n","/**\n * @seatlayer/angular — the Angular wrapper for the SeatLayer embed SDK.\n *\n * The component is standalone; import it directly rather than through an\n * NgModule.\n */\nexport { SeatLayerSeatingChartComponent } from './seating-chart.component';\n\nexport type {\n SelectedSeat,\n HoldResult,\n BestAvailableResult,\n GAAreaAvailability,\n HoldLineItem,\n SeatHoverDetails,\n} from '@seatlayer/js';\n\n// Sales Channels — buyer access sessions for private channel inventory.\nexport type {\n BuyerAccessToken,\n BuyerAccessTokenProvider,\n BuyerAccessRefreshReason,\n BuyerAccessUnavailableReason,\n BuyerAccessExpiredEvent,\n BuyerAccessUnavailableEvent,\n SelectedObjectUnavailableEvent,\n} from '@seatlayer/js';\n\n// The framework-agnostic widget class — for the one-call modal (SeatPickerWidget.open()).\nexport { SeatPicker as SeatPickerWidget } from '@seatlayer/js';\n\n// Host-side embed helper: grows the iframe on `seatlayer:height` and pins it on\n// `seatlayer:fullscreen`. Angular hosts depend on this package alone, so it has to\n// be reachable here rather than only from @seatlayer/js.\nexport { attachPickerFrame } from '@seatlayer/js';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["CoreSeatingChart"],"mappings":";;;;;AA6BA;;;;;;;;;;;;;;;;;;;;AAoBG;MAQU,8BAA8B,CAAA;;AAEd,IAAA,KAAK;;AAGvB,IAAA,OAAO;;AAGP,IAAA,YAAY;;AAGZ,IAAA,SAAS;;AAGT,IAAA,MAAM;;AAGN,IAAA,QAAQ;;AAGR,IAAA,cAAc;;AAGd,IAAA,WAAW;;AAGX,IAAA,QAAQ;AAEjB;;;;AAIG;AACM,IAAA,wBAAwB;;AAGxB,IAAA,gBAAgB;;AAGN,IAAA,eAAe,GAAiC,IAAI,YAAY,EAAkB;;AAGlF,IAAA,IAAI,GAA6B,IAAI,YAAY,EAAc;;AAG/D,IAAA,YAAY,GAA6B,IAAI,YAAY,EAAc;;AAGvE,IAAA,WAAW,GAAuB,IAAI,YAAY,EAAQ;;AAG1D,IAAA,OAAO,GAAqC,IAAI,YAAY,EAAsB;;AAGlF,IAAA,OAAO,GAA0B,IAAI,YAAY,EAAW;;AAG5D,IAAA,OAAO,GAAyB,IAAI,YAAY,EAAU;;AAG1D,IAAA,IAAI,GAAgC,IAAI,YAAY,EAAiB;;AAGrE,IAAA,SAAS,G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,CAAA;sBAAzB;gBAGkB,OAAO,EAAA,CAAA;sBAAzB;gBAGkB,IAAI,EAAA,CAAA;sBAAtB;gBAGkB,SAAS,EAAA,CAAA;sBAA3B;gBAGkB,aAAa,EAAA,CAAA;sBAA/B;gBAIkB,iBAAiB,EAAA,CAAA;sBAAnC;gBAIkB,yBAAyB,EAAA,CAAA;sBAA3C;gBAIgB,SAAS,EAAA,CAAA;sBADzB,SAAS;AAAC,gBAAA,IAAA,EAAA,CAAA,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;;ACtI1C;;;;;AAKG;;ACLH;;AAEG;;;;"}
package/dist/index.d.ts CHANGED
@@ -6,5 +6,6 @@
6
6
  */
7
7
  export { SeatLayerSeatingChartComponent } from './seating-chart.component';
8
8
  export type { SelectedSeat, HoldResult, BestAvailableResult, GAAreaAvailability, HoldLineItem, SeatHoverDetails, } from '@seatlayer/js';
9
+ export type { BuyerAccessToken, BuyerAccessTokenProvider, BuyerAccessRefreshReason, BuyerAccessUnavailableReason, BuyerAccessExpiredEvent, BuyerAccessUnavailableEvent, SelectedObjectUnavailableEvent, } from '@seatlayer/js';
9
10
  export { SeatPicker as SeatPickerWidget } from '@seatlayer/js';
10
11
  export { attachPickerFrame } from '@seatlayer/js';
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
- import { type SeatingChartOptions, type SelectedSeat, type HoldResult, type BestAvailableResult, type GAAreaAvailability, type SeatHoverDetails } from '@seatlayer/js';
2
+ import { type SeatingChartOptions, type SelectedSeat, type HoldResult, type BestAvailableResult, type GAAreaAvailability, type SeatHoverDetails, type BuyerAccessToken, type BuyerAccessTokenProvider, type BuyerAccessExpiredEvent, type BuyerAccessUnavailableEvent, type SelectedObjectUnavailableEvent } from '@seatlayer/js';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Angular wrapper around the framework-agnostic `@seatlayer/js` SDK.
@@ -41,6 +41,14 @@ export declare class SeatLayerSeatingChartComponent implements OnChanges {
41
41
  seatTooltip?: boolean;
42
42
  /** Copy overrides, read once per rebuild. */
43
43
  messages?: SeatingChartOptions['messages'];
44
+ /**
45
+ * Sales Channels: mint a buyer access session on demand. Called with a
46
+ * `reason`; returns `{ token, expiresAt }` from YOUR backend. The token is
47
+ * held in memory only — never storage, never a URL, never a log.
48
+ */
49
+ buyerAccessTokenProvider?: BuyerAccessTokenProvider;
50
+ /** One-shot session for hosts that own the lifecycle. Cannot be renewed. */
51
+ buyerAccessToken?: string | BuyerAccessToken;
44
52
  /** The buyer's selection changed. */
45
53
  readonly selectionChange: EventEmitter<SelectedSeat[]>;
46
54
  /** A hold succeeded. */
@@ -59,6 +67,12 @@ export declare class SeatLayerSeatingChartComponent implements OnChanges {
59
67
  readonly hint: EventEmitter<string | null>;
60
68
  /** The pointer moved onto a seat, or off one (`null`). */
61
69
  readonly seatHover: EventEmitter<SeatHoverDetails | null>;
70
+ /** The buyer access session lapsed; `refreshed` says whether it recovered. */
71
+ readonly accessExpired: EventEmitter<BuyerAccessExpiredEvent>;
72
+ /** Private inventory is unavailable and refreshing will not fix it. */
73
+ readonly accessUnavailable: EventEmitter<BuyerAccessUnavailableEvent>;
74
+ /** Selected-but-unheld units stopped being selectable. */
75
+ readonly selectedObjectUnavailable: EventEmitter<SelectedObjectUnavailableEvent>;
62
76
  private readonly container;
63
77
  private readonly zone;
64
78
  private chart;
@@ -106,8 +120,13 @@ export declare class SeatLayerSeatingChartComponent implements OnChanges {
106
120
  zoomOut(): void;
107
121
  /** Reset the camera so the whole chart fits the container. */
108
122
  zoomToFit(): void;
123
+ /**
124
+ * Re-acquire the buyer access session after your app re-authorizes the buyer
125
+ * (Sales Channels). Resolves false when the chart is not access-scoped.
126
+ */
127
+ refreshAccess(): Promise<boolean>;
109
128
  private build;
110
129
  private destroy;
111
130
  static ɵfac: i0.ɵɵFactoryDeclaration<SeatLayerSeatingChartComponent, never>;
112
- static ɵcmp: i0.ɵɵComponentDeclaration<SeatLayerSeatingChartComponent, "seatlayer-seating-chart", never, { "event": { "alias": "event"; "required": true; }; "apiBase": { "alias": "apiBase"; "required": false; }; "maxSelection": { "alias": "maxSelection"; "required": false; }; "publicKey": { "alias": "publicKey"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "currency": { "alias": "currency"; "required": false; }; "colorblindSafe": { "alias": "colorblindSafe"; "required": false; }; "seatTooltip": { "alias": "seatTooltip"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; }, { "selectionChange": "selectionChange"; "hold": "hold"; "holdRestored": "holdRestored"; "holdExpired": "holdExpired"; "gaClick": "gaClick"; "errored": "errored"; "deckTap": "deckTap"; "hint": "hint"; "seatHover": "seatHover"; }, never, never, true, never>;
131
+ static ɵcmp: i0.ɵɵComponentDeclaration<SeatLayerSeatingChartComponent, "seatlayer-seating-chart", never, { "event": { "alias": "event"; "required": true; }; "apiBase": { "alias": "apiBase"; "required": false; }; "maxSelection": { "alias": "maxSelection"; "required": false; }; "publicKey": { "alias": "publicKey"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "currency": { "alias": "currency"; "required": false; }; "colorblindSafe": { "alias": "colorblindSafe"; "required": false; }; "seatTooltip": { "alias": "seatTooltip"; "required": false; }; "messages": { "alias": "messages"; "required": false; }; "buyerAccessTokenProvider": { "alias": "buyerAccessTokenProvider"; "required": false; }; "buyerAccessToken": { "alias": "buyerAccessToken"; "required": false; }; }, { "selectionChange": "selectionChange"; "hold": "hold"; "holdRestored": "holdRestored"; "holdExpired": "holdExpired"; "gaClick": "gaClick"; "errored": "errored"; "deckTap": "deckTap"; "hint": "hint"; "seatHover": "seatHover"; "accessExpired": "accessExpired"; "accessUnavailable": "accessUnavailable"; "selectedObjectUnavailable": "selectedObjectUnavailable"; }, never, never, true, never>;
113
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seatlayer/angular",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Angular component for the SeatLayer embed SDK — render an interactive seat picker and hold seats.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://docs.seatlayer.io/buyer-sdk/seat-picker/",
@@ -24,8 +24,8 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "tslib": "^2.8.1",
27
- "@seatlayer/core": "0.35.0",
28
- "@seatlayer/js": "0.35.0"
27
+ "@seatlayer/core": "0.36.0",
28
+ "@seatlayer/js": "0.36.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@angular/common": ">=17.0.0",