@seatschart/angular 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SeatsChart
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,148 @@
1
- # Temporary Holding Version
1
+ # @seatschart/angular
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Angular standalone components for SeatsChart: the buyer seat chart, the Event Manager and the map designer. They are
4
+ thin wrappers over the script-tag host API of [`@seatschart/embed`](https://www.npmjs.com/package/@seatschart/embed)
5
+ (`SeatsChart`, `SeatsChartEventManager`, `SeatsChartDesigner`): same options, seats.io-compatible callback names and
6
+ the same commands. SSR-safe (Angular SSR / Universal): nothing touches `window` at import and the iframe is created
7
+ in the browser only, after the view is ready.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @seatschart/angular @seatschart/embed
13
+ ```
14
+
15
+ Angular 18 or newer (tested with the Angular 21 LTS). The package ships partially compiled (Ivy) components that the
16
+ Angular CLI links into your app; it works with and without zone.js.
17
+
18
+ ## Buyer seat chart
19
+
20
+ `token` is a short-lived buyer JWT minted by your server with the API key (`POST /api/viewer-tokens`). Never pass an
21
+ API key or a secret to the browser.
22
+
23
+ ```ts
24
+ import { Component, ViewChild } from "@angular/core";
25
+ import { SeatChartComponent, type SeatChartPrompt } from "@seatschart/angular";
26
+ import type { ChartObjectSelected, ChartSessionHold } from "@seatschart/embed";
27
+
28
+ @Component({
29
+ selector: "app-seats",
30
+ imports: [SeatChartComponent],
31
+ template: `
32
+ <seatschart-chart
33
+ #chart
34
+ class="seat-map"
35
+ webBase="https://your-tenant.seatschart.com"
36
+ [event]="eventId"
37
+ [token]="jwt"
38
+ language="pt"
39
+ [height]="640"
40
+ [maxSelectedObjects]="maxSeats"
41
+ [objectColor]="{ byStatus: { locked: '#f59e0b' } }"
42
+ [settings3d]="{ lightPreset: 'exteriorSunset' }"
43
+ (chartRendered)="ready = true"
44
+ (objectSelected)="onSelected($event)"
45
+ (sessionHold)="onHold($event)"
46
+ (holdFailed)="error = $event.message"
47
+ />
48
+ <button type="button" (click)="chart.clearSelection()">Clear</button>
49
+ <button type="button" (click)="chart.selectBestAvailable({ number: 2, categories: ['VIP'] })">Best 2 VIP</button>
50
+ `,
51
+ })
52
+ export class SeatsComponent {
53
+ @ViewChild(SeatChartComponent) chart?: SeatChartComponent;
54
+ eventId = "EVENT_UUID";
55
+ jwt = "";
56
+ maxSeats = 4;
57
+ ready = false;
58
+ error = "";
59
+ cart: string[] = [];
60
+
61
+ onSelected(e: ChartObjectSelected): void {
62
+ this.cart = [...this.cart, e.label];
63
+ }
64
+ onHold(e: ChartSessionHold): void {
65
+ // Route to your payment step with e.holdToken + e.seatIds.
66
+ }
67
+ async viewFromSeat(label: string): Promise<void> {
68
+ await this.chart?.showViewFromSeat(label); // "3d" or "photo"
69
+ }
70
+ }
71
+ ```
72
+
73
+ - **Inputs** are the `SeatsChart` options of `@seatschart/embed` (`event`, `token`, `webBase`, `parentOrigin`,
74
+ `channel`, `channelKey(s)`, `holdToken`, `pricing`, `language`, `theme`, `defaultRenderer`, …) and every declarative
75
+ renderer option (`objectColor`, `objectLabel`, `tooltip`, `maxSelectedObjects`, `legend`, `filterControls`,
76
+ `settings3d`, …). The chart `style` option (`{ font, cornerRadius, buttonShape }`) is **`chartStyle`**: `class` and
77
+ `style` style the host element `<seatschart-chart>` (a block); `className` styles the iframe.
78
+ - **Changes** (`ngOnChanges`) are compared by value — pass new object references, in-place mutations are not seen.
79
+ Declarative options and `pricing` are applied live with `changeConfig` (no reload); `height`, `title` and
80
+ `className` update the iframe in place; any other input re-renders the iframe and the hold session continues.
81
+ - **Outputs**: every chart callback without `on`: `(objectSelected)`, `(objectClicked)`, `(holdSucceeded)`,
82
+ `(holdConfirmed)`, `(selectionInvalid)`, `(bestAvailableSelected)`, `(floorChanged)`, `(fullScreenOpened)`,
83
+ `(holdCreated)` (`SEATSCHART_RESERVATION_SUCCESS`), … with the `@seatschart/embed` payload as `$event`. Chart
84
+ messages run outside the Angular zone: only outputs you subscribe to trigger change detection.
85
+ - **Host-drawn prompts**: subscribing to `(placesPrompt)`, `(ticketTypePrompt)` or `(placesWithTicketTypesPrompt)`
86
+ switches that viewer prompt to your page; `$event` is `{ params, confirm, cancel }` (`SeatChartPrompt<T>`).
87
+ - **Commands** are component methods (`@ViewChild` or a template variable): every `SeatsChart` command —
88
+ `selectObjects`, `deselectObjects`, `clearSelection`, `trySelectObjects`, `selectBestAvailable`, `changeConfig`,
89
+ `setFilters`, `zoomToObjects`, `zoomToSection`, `goToFloor`, `showViewFromSeat`, `getHoldToken`,
90
+ `releaseHoldToken`, `exportImage`, … Each resolves once the chart rendered and rejects with `ChartCommandError`.
91
+ `chart` is the `SeatsChart` instance (`chart?.selectedObjects`, `chart?.holdToken` synchronously); `getIframe()`
92
+ and `rerender()` are there too.
93
+ - **Cleanup**: `ngOnDestroy` removes the iframe and its message listener; pending commands reject.
94
+
95
+ ## Event Manager (back office)
96
+
97
+ ```ts
98
+ import { EventManagerComponent } from "@seatschart/angular";
99
+
100
+ @Component({
101
+ selector: "app-box-office",
102
+ imports: [EventManagerComponent],
103
+ template: `
104
+ <seatschart-event-manager #manager webBase="https://your-tenant.seatschart.com" [event]="eventId"
105
+ [token]="managerEmbedToken" mode="select" colorScheme="auto" [maxSelectedObjects]="8"
106
+ (selectionChanged)="cart = $event" (managerError)="error = $event.message" />
107
+ <button type="button" (click)="manager.setHighlightedObjects(['A-1'])">Highlight A-1</button>
108
+ `,
109
+ })
110
+ export class BoxOfficeComponent { /* … */ }
111
+ ```
112
+
113
+ Selectability rules, `maxSelectedObjects`, `selectedObjects`, `order`, `filters`, `language` and `colorScheme`
114
+ change live (`changeConfig`); `mode`, `event` or `token` re-render the iframe. Methods: every
115
+ `SeatsChartEventManager` command (`listSelectedObjects`, `selectObjects`, `listOrderChanges`, `zoomToObjects`, …);
116
+ `manager` is the instance. The seats.io `onError` callback is `(managerError)` (an output named `error` would also
117
+ catch native DOM `error` events).
118
+
119
+ ## Designer
120
+
121
+ ```ts
122
+ import { DesignerComponent } from "@seatschart/angular";
123
+
124
+ @Component({
125
+ selector: "app-venue-editor",
126
+ imports: [DesignerComponent],
127
+ template: `
128
+ <seatschart-designer #designer webBase="https://your-tenant.seatschart.com" [token]="designerEmbedToken"
129
+ [chartId]="chartId" mode="safe" canvasColorScheme="dark"
130
+ (chartUpdated)="saved = true" (exitRequested)="close()" />
131
+ <button type="button" (click)="designer.publish('Summer layout')">Publish</button>
132
+ `,
133
+ })
134
+ export class VenueEditorComponent { /* … */ }
135
+ ```
136
+
137
+ Without `chartId` the designer creates a chart (`(chartCreated)`). The Exit button shows only when something
138
+ subscribes to `(exitRequested)`. Outputs emit the callback's event (`(chartUpdated)` gets `{ chartId, draftUpdatedAt,
139
+ … }`); `onError` is `(designerError)`. `language`, `colorScheme`, `canvasColorScheme`, `mode` and `safeModeOptions`
140
+ change live. Methods: `save()`, `publish(note?)`, `getState()`, `changeConfig()`; `designer?.chartId` is the chart
141
+ being edited.
142
+
143
+ ## Documentation
144
+
145
+ - [Embed guide](https://github.com/seatschart/seatschart-prod/blob/main/docs/locales/en/README.md) and
146
+ [Quickstart](https://github.com/seatschart/seatschart-prod/blob/main/docs/locales/en/QUICKSTART.md)
147
+ - Every option, callback and command: `@seatschart/embed` (`SeatsChartConfig`, `SeatsChartEventManagerConfig`,
148
+ `SeatsChartDesignerConfig`).
@@ -0,0 +1,62 @@
1
+ import { type AfterViewInit, type EventEmitter, type OnChanges, type OnDestroy } from "@angular/core";
2
+ import type { DesignerCallbacks, DesignerErrorInfo, SeatsChartDesigner, SeatsChartDesignerConfig } from "@seatschart/embed";
3
+ import { type DesignerCallbackKey, type DesignerCommands, type DesignerConfigKey } from "./host-core.js";
4
+ import { type CallbackOutputs } from "./outputs.js";
5
+ import * as i0 from "@angular/core";
6
+ /** `<seatschart-designer>` inputs: the `SeatsChartDesigner` config (seats.io `SeatingChartDesigner` names). */
7
+ export type DesignerInputs = {
8
+ [K in DesignerConfigKey]?: SeatsChartDesignerConfig[K];
9
+ };
10
+ /**
11
+ * Every designer callback as an output, emitting the callback's event (`onChartUpdated(chartId, event)` →
12
+ * `(chartUpdated)` with `event`, which carries `chartId`). Subscribing to `(exitRequested)` shows the Exit button.
13
+ * `onError` is `(designerError)`: an output named like a DOM event would also catch native `error` events.
14
+ */
15
+ export type DesignerOutputs = Omit<CallbackOutputs<DesignerCallbacks, DesignerCallbackKey>, "error"> & {
16
+ readonly designerError: EventEmitter<DesignerErrorInfo>;
17
+ };
18
+ declare const INPUTS: readonly ["webBase", "chartId", "chartKey", "token", "mode", "safeModeOptions", "features", "language", "colorScheme", "canvasColorScheme", "openDraftDrawing", "openLatestDrawing", "parentOrigin", "height", "title", "className", "timeoutMs"];
19
+ declare const OUTPUTS: readonly ["designerRendered", "designerRenderingFailed", "chartCreated", "chartUpdated", "chartPublished", "exitRequested", "actionRefused", "designerError"];
20
+ type Assert<T extends true> = T;
21
+ type Same<A, B> = [Exclude<A, B> | Exclude<B, A>] extends [never] ? true : false;
22
+ /** Compile-time guard: the literal lists name every designer option and callback. */
23
+ export type DesignerMetadataCovered = [
24
+ Assert<Same<(typeof INPUTS)[number], keyof DesignerInputs>>,
25
+ Assert<Same<(typeof OUTPUTS)[number], keyof DesignerOutputs>>
26
+ ];
27
+ /**
28
+ * `<seatschart-designer>`: the embedded SeatsChart map designer. Without `chartId` it creates a chart
29
+ * (`(chartCreated)`). `language`, `colorScheme`, `canvasColorScheme`, `mode` and `safeModeOptions` are applied live
30
+ * with `changeConfig`; other changes re-render the iframe. `save()`, `publish()`, `getState()` and `changeConfig()`
31
+ * are methods. `token` is a short-lived designer embed token from your backend — never a secret key.
32
+ */
33
+ export declare class DesignerComponent implements AfterViewInit, OnChanges, OnDestroy {
34
+ private readonly host;
35
+ private readonly zone;
36
+ private readonly browser;
37
+ private readonly forwarders;
38
+ private readonly exit;
39
+ constructor();
40
+ /**
41
+ * The underlying `SeatsChartDesigner` (null before the view is ready, on the server and after destroy):
42
+ * `designer?.chartId` is the chart being edited (the created one when no `chartId` input was given).
43
+ */
44
+ get designer(): SeatsChartDesigner | null;
45
+ getIframe(): HTMLIFrameElement | null;
46
+ /** Re-create the iframe with the current inputs (keeps the chart created inside the designer). */
47
+ rerender(): void;
48
+ ngOnChanges(): void;
49
+ ngAfterViewInit(): void;
50
+ ngOnDestroy(): void;
51
+ private config;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<DesignerComponent, never>;
53
+ static ɵcmp: i0.ɵɵComponentDeclaration<DesignerComponent, "seatschart-designer", never, { "webBase": { "alias": "webBase"; "required": false; }; "chartId": { "alias": "chartId"; "required": false; }; "chartKey": { "alias": "chartKey"; "required": false; }; "token": { "alias": "token"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "safeModeOptions": { "alias": "safeModeOptions"; "required": false; }; "features": { "alias": "features"; "required": false; }; "language": { "alias": "language"; "required": false; }; "colorScheme": { "alias": "colorScheme"; "required": false; }; "canvasColorScheme": { "alias": "canvasColorScheme"; "required": false; }; "openDraftDrawing": { "alias": "openDraftDrawing"; "required": false; }; "openLatestDrawing": { "alias": "openLatestDrawing"; "required": false; }; "parentOrigin": { "alias": "parentOrigin"; "required": false; }; "height": { "alias": "height"; "required": false; }; "title": { "alias": "title"; "required": false; }; "className": { "alias": "className"; "required": false; }; "timeoutMs": { "alias": "timeoutMs"; "required": false; }; }, { "designerRendered": "designerRendered"; "designerRenderingFailed": "designerRenderingFailed"; "chartCreated": "chartCreated"; "chartUpdated": "chartUpdated"; "chartPublished": "chartPublished"; "exitRequested": "exitRequested"; "actionRefused": "actionRefused"; "designerError": "designerError"; }, never, never, true, never>;
54
+ }
55
+ export interface DesignerComponent extends DesignerInputs, DesignerOutputs, DesignerCommands {
56
+ }
57
+ /** `<seatschart-designer>` input names. */
58
+ export declare const DESIGNER_INPUTS: readonly string[];
59
+ /** `<seatschart-designer>` output names (`onError` → `designerError`). */
60
+ export declare const DESIGNER_OUTPUTS: readonly string[];
61
+ export {};
62
+ //# sourceMappingURL=designer.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"designer.component.d.ts","sourceRoot":"","sources":["../src/designer.component.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC5H,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA0D,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;;AAE5G,+GAA+G;AAC/G,MAAM,MAAM,cAAc,GAAG;KAAG,CAAC,IAAI,iBAAiB,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC;CAAE,CAAC;AAExF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,GAAG;IACrG,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;CACzD,CAAC;AAEF,QAAA,MAAM,MAAM,mPAIF,CAAC;AACX,QAAA,MAAM,OAAO,+JAGH,CAAC;AAGX,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAChC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACjF,qFAAqF;AACrF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,cAAc,CAAC,CAAC;IAC3D,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC,CAAC;CAC9D,CAAC;AAKF;;;;;GAKG;AACH,qBAUa,iBAAkB,YAAW,aAAa,EAAE,SAAS,EAAE,SAAS;IAC3E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+C;IACpE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAGnB;;IAQF;;;OAGG;IACH,IAAI,QAAQ,IAAI,kBAAkB,GAAG,IAAI,CAExC;IAED,SAAS,IAAI,iBAAiB,GAAG,IAAI;IAIrC,kGAAkG;IAClG,QAAQ,IAAI,IAAI;IAIhB,WAAW,IAAI,IAAI;IAKnB,eAAe,IAAI,IAAI;IAMvB,WAAW,IAAI,IAAI;IAInB,OAAO,CAAC,MAAM;yCAhDH,iBAAiB;2CAAjB,iBAAiB;CAwD7B;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc,EAAE,eAAe,EAAE,gBAAgB;CAAG;AAY/F,2CAA2C;AAC3C,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAW,CAAC;AACzD,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAY,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { isPlatformBrowser } from "@angular/common";
2
+ import { ChangeDetectionStrategy, Component, ElementRef, NgZone, PLATFORM_ID, inject, } from "@angular/core";
3
+ import { DESIGNER_CALLBACKS, DESIGNER_COMMANDS, DESIGNER_KIND, EmbedBinding, runCommand, } from "./host-core.js";
4
+ import { createOutputs, emitterOf, outputForwarders, pickInputs } from "./outputs.js";
5
+ import * as i0 from "@angular/core";
6
+ const INPUTS = [
7
+ "webBase", "chartId", "chartKey", "token", "mode", "safeModeOptions", "features", "language", "colorScheme",
8
+ "canvasColorScheme", "openDraftDrawing", "openLatestDrawing", "parentOrigin", "height", "title", "className",
9
+ "timeoutMs",
10
+ ];
11
+ const OUTPUTS = [
12
+ "designerRendered", "designerRenderingFailed", "chartCreated", "chartUpdated", "chartPublished", "exitRequested",
13
+ "actionRefused", "designerError",
14
+ ];
15
+ const RENAMES = { onError: "designerError" };
16
+ const EVENT_CALLBACKS = DESIGNER_CALLBACKS.filter((key) => key !== "onExitRequested");
17
+ const bindings = new WeakMap();
18
+ /**
19
+ * `<seatschart-designer>`: the embedded SeatsChart map designer. Without `chartId` it creates a chart
20
+ * (`(chartCreated)`). `language`, `colorScheme`, `canvasColorScheme`, `mode` and `safeModeOptions` are applied live
21
+ * with `changeConfig`; other changes re-render the iframe. `save()`, `publish()`, `getState()` and `changeConfig()`
22
+ * are methods. `token` is a short-lived designer embed token from your backend — never a secret key.
23
+ */
24
+ export class DesignerComponent {
25
+ constructor() {
26
+ this.host = inject(ElementRef);
27
+ this.zone = inject(NgZone);
28
+ this.browser = isPlatformBrowser(inject(PLATFORM_ID));
29
+ this.exit = () => {
30
+ const emitter = emitterOf(this, "exitRequested");
31
+ if (emitter.observed)
32
+ this.zone.run(() => emitter.emit(undefined));
33
+ };
34
+ createOutputs(this, OUTPUTS);
35
+ bindings.set(this, new EmbedBinding(DESIGNER_KIND));
36
+ this.forwarders = outputForwarders(this, EVENT_CALLBACKS, this.zone, RENAMES);
37
+ }
38
+ /**
39
+ * The underlying `SeatsChartDesigner` (null before the view is ready, on the server and after destroy):
40
+ * `designer?.chartId` is the chart being edited (the created one when no `chartId` input was given).
41
+ */
42
+ get designer() {
43
+ return bindings.get(this)?.current ?? null;
44
+ }
45
+ getIframe() {
46
+ return this.designer?.getIframe() ?? null;
47
+ }
48
+ /** Re-create the iframe with the current inputs (keeps the chart created inside the designer). */
49
+ rerender() {
50
+ this.zone.runOutsideAngular(() => bindings.get(this)?.rerender());
51
+ }
52
+ ngOnChanges() {
53
+ const config = this.config();
54
+ this.zone.runOutsideAngular(() => bindings.get(this)?.update(config));
55
+ }
56
+ ngAfterViewInit() {
57
+ if (!this.browser)
58
+ return;
59
+ const config = this.config();
60
+ this.zone.runOutsideAngular(() => bindings.get(this)?.mount(this.host.nativeElement, config));
61
+ }
62
+ ngOnDestroy() {
63
+ bindings.get(this)?.destroy();
64
+ }
65
+ config() {
66
+ return {
67
+ ...pickInputs(this, INPUTS),
68
+ ...this.forwarders,
69
+ // A subscribed (exitRequested) shows the Exit button.
70
+ ...(emitterOf(this, "exitRequested").observed ? { onExitRequested: this.exit } : {}),
71
+ };
72
+ }
73
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: DesignerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
74
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: DesignerComponent, isStandalone: true, selector: "seatschart-designer", inputs: { webBase: "webBase", chartId: "chartId", chartKey: "chartKey", token: "token", mode: "mode", safeModeOptions: "safeModeOptions", features: "features", language: "language", colorScheme: "colorScheme", canvasColorScheme: "canvasColorScheme", openDraftDrawing: "openDraftDrawing", openLatestDrawing: "openLatestDrawing", parentOrigin: "parentOrigin", height: "height", title: "title", className: "className", timeoutMs: "timeoutMs" }, outputs: { designerRendered: "designerRendered", designerRenderingFailed: "designerRenderingFailed", chartCreated: "chartCreated", chartUpdated: "chartUpdated", chartPublished: "chartPublished", exitRequested: "exitRequested", actionRefused: "actionRefused", designerError: "designerError" }, host: { attributes: { "data-seatschart-designer": "" } }, usesOnChanges: true, ngImport: i0, template: "", isInline: true, styles: [":host{display:block}"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
75
+ }
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: DesignerComponent, decorators: [{
77
+ type: Component,
78
+ args: [{ selector: "seatschart-designer", standalone: true, template: "", changeDetection: ChangeDetectionStrategy.OnPush, host: { "data-seatschart-designer": "" }, inputs: [...INPUTS], outputs: [...OUTPUTS], styles: [":host{display:block}"] }]
79
+ }], ctorParameters: () => [] });
80
+ for (const name of DESIGNER_COMMANDS) {
81
+ Object.defineProperty(DesignerComponent.prototype, name, {
82
+ configurable: true,
83
+ writable: true,
84
+ value(...args) {
85
+ return runCommand(bindings.get(this)?.current ?? null, name, DESIGNER_KIND.label, args);
86
+ },
87
+ });
88
+ }
89
+ /** `<seatschart-designer>` input names. */
90
+ export const DESIGNER_INPUTS = INPUTS;
91
+ /** `<seatschart-designer>` output names (`onError` → `designerError`). */
92
+ export const DESIGNER_OUTPUTS = OUTPUTS;
@@ -0,0 +1,61 @@
1
+ import { type AfterViewInit, type EventEmitter, type OnChanges, type OnDestroy } from "@angular/core";
2
+ import type { EventManagerCallbacks, EventManagerErrorInfo, SeatsChartEventManager, SeatsChartEventManagerConfig } from "@seatschart/embed";
3
+ import { type EventManagerCallbackKey, type EventManagerCommands, type EventManagerConfigKey } from "./host-core.js";
4
+ import { type CallbackOutputs } from "./outputs.js";
5
+ import * as i0 from "@angular/core";
6
+ /** `<seatschart-event-manager>` inputs: the `SeatsChartEventManager` config (seats.io `EventManager` names). */
7
+ export type EventManagerInputs = {
8
+ [K in EventManagerConfigKey]?: SeatsChartEventManagerConfig[K];
9
+ };
10
+ /**
11
+ * Every manager callback as an output (`onSelectionChanged` → `(selectionChanged)`). `onError` is `(managerError)`:
12
+ * an output named like a DOM event would also catch native `error` events.
13
+ */
14
+ export type EventManagerOutputs = Omit<CallbackOutputs<EventManagerCallbacks, EventManagerCallbackKey>, "error"> & {
15
+ readonly managerError: EventEmitter<EventManagerErrorInfo>;
16
+ };
17
+ declare const INPUTS: readonly ["isObjectSelectable", "unavailableObjectsSelectable", "selectableObjects", "selectedObjects", "maxSelectedObjects", "order", "filters", "webBase", "event", "eventId", "token", "mode", "language", "colorScheme", "parentOrigin", "height", "title", "className", "timeoutMs"];
18
+ declare const OUTPUTS: readonly ["eventManagerRendered", "chartRendered", "chartRenderingFailed", "objectSelected", "objectDeselected", "selectionChanged", "selectionInvalid", "orderChanged", "modeChanged", "submitSucceeded", "submitFailed", "managerError"];
19
+ type Assert<T extends true> = T;
20
+ type Same<A, B> = [Exclude<A, B> | Exclude<B, A>] extends [never] ? true : false;
21
+ /** Compile-time guard: the literal lists name every manager option and callback. */
22
+ export type EventManagerMetadataCovered = [
23
+ Assert<Same<(typeof INPUTS)[number], keyof EventManagerInputs>>,
24
+ Assert<Same<(typeof OUTPUTS)[number], keyof EventManagerOutputs>>
25
+ ];
26
+ /**
27
+ * `<seatschart-event-manager>`: the embedded SeatsChart Event Manager (back office). Selectability rules,
28
+ * `maxSelectedObjects`, `selectedObjects`, `order`, `filters`, `language` and `colorScheme` are applied live with
29
+ * `changeConfig`; other changes re-render the iframe. Every `SeatsChartEventManager` command is a method. `token` is a
30
+ * short-lived manager embed token from your backend — never a secret key.
31
+ */
32
+ export declare class EventManagerComponent implements AfterViewInit, OnChanges, OnDestroy {
33
+ private readonly host;
34
+ private readonly zone;
35
+ private readonly browser;
36
+ private readonly forwarders;
37
+ constructor();
38
+ /**
39
+ * The underlying `SeatsChartEventManager` (null before the view is ready, on the server and after destroy):
40
+ * `manager?.selectedObjects` and `manager?.mode` give the live selection and mode (the component's
41
+ * `selectedObjects` / `mode` are the inputs).
42
+ */
43
+ get manager(): SeatsChartEventManager | null;
44
+ getIframe(): HTMLIFrameElement | null;
45
+ /** Re-create the iframe with the current inputs (the selection is cleared). */
46
+ rerender(): void;
47
+ ngOnChanges(): void;
48
+ ngAfterViewInit(): void;
49
+ ngOnDestroy(): void;
50
+ private config;
51
+ static ɵfac: i0.ɵɵFactoryDeclaration<EventManagerComponent, never>;
52
+ static ɵcmp: i0.ɵɵComponentDeclaration<EventManagerComponent, "seatschart-event-manager", never, { "isObjectSelectable": { "alias": "isObjectSelectable"; "required": false; }; "unavailableObjectsSelectable": { "alias": "unavailableObjectsSelectable"; "required": false; }; "selectableObjects": { "alias": "selectableObjects"; "required": false; }; "selectedObjects": { "alias": "selectedObjects"; "required": false; }; "maxSelectedObjects": { "alias": "maxSelectedObjects"; "required": false; }; "order": { "alias": "order"; "required": false; }; "filters": { "alias": "filters"; "required": false; }; "webBase": { "alias": "webBase"; "required": false; }; "event": { "alias": "event"; "required": false; }; "eventId": { "alias": "eventId"; "required": false; }; "token": { "alias": "token"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "language": { "alias": "language"; "required": false; }; "colorScheme": { "alias": "colorScheme"; "required": false; }; "parentOrigin": { "alias": "parentOrigin"; "required": false; }; "height": { "alias": "height"; "required": false; }; "title": { "alias": "title"; "required": false; }; "className": { "alias": "className"; "required": false; }; "timeoutMs": { "alias": "timeoutMs"; "required": false; }; }, { "eventManagerRendered": "eventManagerRendered"; "chartRendered": "chartRendered"; "chartRenderingFailed": "chartRenderingFailed"; "objectSelected": "objectSelected"; "objectDeselected": "objectDeselected"; "selectionChanged": "selectionChanged"; "selectionInvalid": "selectionInvalid"; "orderChanged": "orderChanged"; "modeChanged": "modeChanged"; "submitSucceeded": "submitSucceeded"; "submitFailed": "submitFailed"; "managerError": "managerError"; }, never, never, true, never>;
53
+ }
54
+ export interface EventManagerComponent extends EventManagerInputs, EventManagerOutputs, EventManagerCommands {
55
+ }
56
+ /** `<seatschart-event-manager>` input names. */
57
+ export declare const EVENT_MANAGER_INPUTS: readonly string[];
58
+ /** `<seatschart-event-manager>` output names (`onError` → `managerError`). */
59
+ export declare const EVENT_MANAGER_OUTPUTS: readonly string[];
60
+ export {};
61
+ //# sourceMappingURL=event-manager.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-manager.component.d.ts","sourceRoot":"","sources":["../src/event-manager.component.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAML,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAE3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA+C,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;;AAEjG,gHAAgH;AAChH,MAAM,MAAM,kBAAkB,GAAG;KAAG,CAAC,IAAI,qBAAqB,CAAC,CAAC,EAAE,4BAA4B,CAAC,CAAC,CAAC;CAAE,CAAC;AAEpG;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,EAAE,OAAO,CAAC,GAAG;IACjH,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAC;CAC5D,CAAC;AAEF,QAAA,MAAM,MAAM,2RAIF,CAAC;AACX,QAAA,MAAM,OAAO,4OAIH,CAAC;AAGX,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC;AAChC,KAAK,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AACjF,oFAAoF;AACpF,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,kBAAkB,CAAC,CAAC;IAC/D,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,mBAAmB,CAAC,CAAC;CAClE,CAAC;AAIF;;;;;GAKG;AACH,qBAUa,qBAAsB,YAAW,aAAa,EAAE,SAAS,EAAE,SAAS;IAC/E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+C;IACpE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0C;IAClE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;;IAQzC;;;;OAIG;IACH,IAAI,OAAO,IAAI,sBAAsB,GAAG,IAAI,CAE3C;IAED,SAAS,IAAI,iBAAiB,GAAG,IAAI;IAIrC,+EAA+E;IAC/E,QAAQ,IAAI,IAAI;IAIhB,WAAW,IAAI,IAAI;IAKnB,eAAe,IAAI,IAAI;IAMvB,WAAW,IAAI,IAAI;IAInB,OAAO,CAAC,MAAM;yCA7CH,qBAAqB;2CAArB,qBAAqB;CAgDjC;AAED,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB,EAAE,mBAAmB,EAAE,oBAAoB;CAAG;AAY/G,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAAW,CAAC;AAC9D,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAAY,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { isPlatformBrowser } from "@angular/common";
2
+ import { ChangeDetectionStrategy, Component, ElementRef, NgZone, PLATFORM_ID, inject, } from "@angular/core";
3
+ import { EVENT_MANAGER_CALLBACKS, EVENT_MANAGER_COMMANDS, EVENT_MANAGER_KIND, EmbedBinding, runCommand, } from "./host-core.js";
4
+ import { createOutputs, outputForwarders, pickInputs } from "./outputs.js";
5
+ import * as i0 from "@angular/core";
6
+ const INPUTS = [
7
+ "isObjectSelectable", "unavailableObjectsSelectable", "selectableObjects", "selectedObjects", "maxSelectedObjects",
8
+ "order", "filters", "webBase", "event", "eventId", "token", "mode", "language", "colorScheme", "parentOrigin",
9
+ "height", "title", "className", "timeoutMs",
10
+ ];
11
+ const OUTPUTS = [
12
+ "eventManagerRendered", "chartRendered", "chartRenderingFailed", "objectSelected", "objectDeselected",
13
+ "selectionChanged", "selectionInvalid", "orderChanged", "modeChanged", "submitSucceeded", "submitFailed",
14
+ "managerError",
15
+ ];
16
+ const RENAMES = { onError: "managerError" };
17
+ const bindings = new WeakMap();
18
+ /**
19
+ * `<seatschart-event-manager>`: the embedded SeatsChart Event Manager (back office). Selectability rules,
20
+ * `maxSelectedObjects`, `selectedObjects`, `order`, `filters`, `language` and `colorScheme` are applied live with
21
+ * `changeConfig`; other changes re-render the iframe. Every `SeatsChartEventManager` command is a method. `token` is a
22
+ * short-lived manager embed token from your backend — never a secret key.
23
+ */
24
+ export class EventManagerComponent {
25
+ constructor() {
26
+ this.host = inject(ElementRef);
27
+ this.zone = inject(NgZone);
28
+ this.browser = isPlatformBrowser(inject(PLATFORM_ID));
29
+ createOutputs(this, OUTPUTS);
30
+ bindings.set(this, new EmbedBinding(EVENT_MANAGER_KIND));
31
+ this.forwarders = outputForwarders(this, EVENT_MANAGER_CALLBACKS, this.zone, RENAMES);
32
+ }
33
+ /**
34
+ * The underlying `SeatsChartEventManager` (null before the view is ready, on the server and after destroy):
35
+ * `manager?.selectedObjects` and `manager?.mode` give the live selection and mode (the component's
36
+ * `selectedObjects` / `mode` are the inputs).
37
+ */
38
+ get manager() {
39
+ return bindings.get(this)?.current ?? null;
40
+ }
41
+ getIframe() {
42
+ return this.manager?.getIframe() ?? null;
43
+ }
44
+ /** Re-create the iframe with the current inputs (the selection is cleared). */
45
+ rerender() {
46
+ this.zone.runOutsideAngular(() => bindings.get(this)?.rerender());
47
+ }
48
+ ngOnChanges() {
49
+ const config = this.config();
50
+ this.zone.runOutsideAngular(() => bindings.get(this)?.update(config));
51
+ }
52
+ ngAfterViewInit() {
53
+ if (!this.browser)
54
+ return;
55
+ const config = this.config();
56
+ this.zone.runOutsideAngular(() => bindings.get(this)?.mount(this.host.nativeElement, config));
57
+ }
58
+ ngOnDestroy() {
59
+ bindings.get(this)?.destroy();
60
+ }
61
+ config() {
62
+ return { ...pickInputs(this, INPUTS), ...this.forwarders };
63
+ }
64
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: EventManagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
65
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: EventManagerComponent, isStandalone: true, selector: "seatschart-event-manager", inputs: { isObjectSelectable: "isObjectSelectable", unavailableObjectsSelectable: "unavailableObjectsSelectable", selectableObjects: "selectableObjects", selectedObjects: "selectedObjects", maxSelectedObjects: "maxSelectedObjects", order: "order", filters: "filters", webBase: "webBase", event: "event", eventId: "eventId", token: "token", mode: "mode", language: "language", colorScheme: "colorScheme", parentOrigin: "parentOrigin", height: "height", title: "title", className: "className", timeoutMs: "timeoutMs" }, outputs: { eventManagerRendered: "eventManagerRendered", chartRendered: "chartRendered", chartRenderingFailed: "chartRenderingFailed", objectSelected: "objectSelected", objectDeselected: "objectDeselected", selectionChanged: "selectionChanged", selectionInvalid: "selectionInvalid", orderChanged: "orderChanged", modeChanged: "modeChanged", submitSucceeded: "submitSucceeded", submitFailed: "submitFailed", managerError: "managerError" }, host: { attributes: { "data-seatschart-event-manager": "" } }, usesOnChanges: true, ngImport: i0, template: "", isInline: true, styles: [":host{display:block}"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
66
+ }
67
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: EventManagerComponent, decorators: [{
68
+ type: Component,
69
+ args: [{ selector: "seatschart-event-manager", standalone: true, template: "", changeDetection: ChangeDetectionStrategy.OnPush, host: { "data-seatschart-event-manager": "" }, inputs: [...INPUTS], outputs: [...OUTPUTS], styles: [":host{display:block}"] }]
70
+ }], ctorParameters: () => [] });
71
+ for (const name of EVENT_MANAGER_COMMANDS) {
72
+ Object.defineProperty(EventManagerComponent.prototype, name, {
73
+ configurable: true,
74
+ writable: true,
75
+ value(...args) {
76
+ return runCommand(bindings.get(this)?.current ?? null, name, EVENT_MANAGER_KIND.label, args);
77
+ },
78
+ });
79
+ }
80
+ /** `<seatschart-event-manager>` input names. */
81
+ export const EVENT_MANAGER_INPUTS = INPUTS;
82
+ /** `<seatschart-event-manager>` output names (`onError` → `managerError`). */
83
+ export const EVENT_MANAGER_OUTPUTS = OUTPUTS;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Framework-agnostic glue between a component and one `@seatschart/embed` host instance (`SeatsChart`,
3
+ * `SeatsChartEventManager` or `SeatsChartDesigner`). This file is identical in `@seatschart/vue` and
4
+ * `@seatschart/angular` (a unit test keeps the two copies in step): the wrappers only map framework props, events
5
+ * and lifecycle onto it, every embed behaviour (iframe, origin checks, commands, sessions) stays in the embed.
6
+ *
7
+ * Prop updates are compared by value with what the instance last received, then applied the cheapest correct way:
8
+ * iframe attributes in place, live keys through `changeConfig` (no reload), other keys through `rerender(config)`
9
+ * (the hold session / the created chart is kept), mount-only keys by re-creating the instance.
10
+ */
11
+ import { DESIGNER_CALLBACKS, EVENT_MANAGER_CALLBACKS, SeatsChart, SeatsChartDesigner, SeatsChartEventManager, type SeatsChartConfig, type SeatsChartDesignerConfig, type SeatsChartEventManagerConfig } from "@seatschart/embed";
12
+ /** Every buyer chart option a component accepts as a prop / input (the host config keys first). */
13
+ export declare const CHART_CONFIG_KEYS: readonly ["objectColor", "objectLabel", "tooltip", "priceFormatter", "numberOfPlacesToSelect", "maxSelectedObjects", "showSectionContents", "showMinimap", "showSurroundings", "sessionMode", "selectionValidators", "accessibilityFilter", "mode", "prompts", "objectWithoutPricingSelectable", "fitTo", "loading", "messages", "selectedObjects", "gestureHandling", "selectionModes", "showSeatLabels", "minimumSelectedPlaces", "sectionColor", "objectIcon", "isObjectVisible", "hideSectionsNotForSale", "selectableObjects", "objectWithoutCategorySelectable", "showSectionPricingOverlay", "showObjectPopover", "showFilterControls", "showLegend", "showZoomOutButton", "showFullScreenButton", "fullScreenTarget", "canGoBack", "resaleListings", "partySize", "style", "objectPopover", "legend", "filterControls", "activeFloor", "lockActiveFloor", "showFloorElevator", "settings3d", "webBase", "event", "events", "publicKey", "workspaceKey", "token", "parentOrigin", "channel", "channelKey", "channelKeys", "session", "season", "language", "multiSelectEnabled", "holdToken", "availableCategories", "unavailableCategories", "currency", "theme", "statusPalette", "transparent", "backgroundColor", "pricing", "defaultRenderer", "height", "title", "className", "allowFullscreen", "timeoutMs", "holdTokenInputName", "selectedObjectsInputName", "form"];
14
+ export type ChartConfigKey = (typeof CHART_CONFIG_KEYS)[number];
15
+ /** Chart callbacks (seats.io names) forwarded as component events. */
16
+ export declare const CHART_CALLBACKS: readonly ["onObjectSelected", "onObjectDeselected", "onSessionHold", "onHoldSucceeded", "onHoldCallsInProgress", "onHoldCallsComplete", "onHoldConfirmed", "onReleaseHoldSucceeded", "onReleaseHoldFailed", "onSelectedObjectUnavailable", "onChartRerenderingStarted", "onPromptRequest", "onHoldTokenExpired", "onChartRendered", "onChartRenderingFailed", "onObjectClicked", "onObjectHovered", "onObjectUnhovered", "onHoldFailed", "onSelectionInvalid", "onSelectionValid", "onObjectStatusChanged", "onBestAvailableSelected", "onBestAvailableFailed", "onFilteredCategoriesChanged", "onAccessibilityFilterChanged", "onFiltersChanged", "onSessionInitialized", "onFloorChanged", "onFullScreenOpened", "onFullScreenClosed", "onFullScreenRequest", "onObjectMouseOver", "onObjectMouseOut", "onBestAvailableSelectionFailed", "onSelectedObjectBooked", "onHoldCreated"];
17
+ export type ChartCallbackKey = (typeof CHART_CALLBACKS)[number];
18
+ /** Host-drawn prompts: registering one switches the matching viewer prompt to the host. */
19
+ export declare const PROMPT_CALLBACKS: readonly ["onPlacesPrompt", "onTicketTypePrompt", "onPlacesWithTicketTypesPrompt"];
20
+ export type PromptCallbackKey = (typeof PROMPT_CALLBACKS)[number];
21
+ export declare const EVENT_MANAGER_KEYS: readonly ["isObjectSelectable", "unavailableObjectsSelectable", "selectableObjects", "selectedObjects", "maxSelectedObjects", "order", "filters", "webBase", "event", "eventId", "token", "mode", "language", "colorScheme", "parentOrigin", "height", "title", "className", "timeoutMs"];
22
+ export type EventManagerConfigKey = (typeof EVENT_MANAGER_KEYS)[number];
23
+ export { EVENT_MANAGER_CALLBACKS };
24
+ export type EventManagerCallbackKey = (typeof EVENT_MANAGER_CALLBACKS)[number];
25
+ export declare const DESIGNER_KEYS: readonly ["webBase", "chartId", "chartKey", "token", "mode", "safeModeOptions", "features", "language", "colorScheme", "canvasColorScheme", "openDraftDrawing", "openLatestDrawing", "parentOrigin", "height", "title", "className", "timeoutMs"];
26
+ export type DesignerConfigKey = (typeof DESIGNER_KEYS)[number];
27
+ export { DESIGNER_CALLBACKS };
28
+ export type DesignerCallbackKey = (typeof DESIGNER_CALLBACKS)[number];
29
+ type Assert<T extends true> = T;
30
+ type Covers<All, Listed> = [Exclude<All, Listed>] extends [never] ? true : false;
31
+ /** Compile-time guard: a new embed option or callback must be mapped by the wrappers. */
32
+ export type ConfigKeysCovered = [
33
+ Assert<Covers<keyof SeatsChartConfig, ChartConfigKey | ChartCallbackKey | PromptCallbackKey | "divId" | "container">>,
34
+ Assert<Covers<keyof SeatsChartEventManagerConfig, EventManagerConfigKey | EventManagerCallbackKey | "divId" | "container">>,
35
+ Assert<Covers<keyof SeatsChartDesignerConfig, DesignerConfigKey | DesignerCallbackKey | "divId" | "container">>
36
+ ];
37
+ /** `"onObjectSelected"` → `"objectSelected"` (Vue event / Angular output name). */
38
+ export type EventNameOf<K> = K extends `on${infer N}` ? Uncapitalize<N> : never;
39
+ /** `onObjectSelected` → `objectSelected`. */
40
+ export declare function eventName<K extends string>(callback: K): EventNameOf<K>;
41
+ type PromiseMethods<T> = {
42
+ [K in keyof T]-?: T[K] extends (...args: never[]) => Promise<unknown> ? K : never;
43
+ }[keyof T];
44
+ /** Every promise command of `SeatsChart` (each waits for the chart to render; rejects with `ChartCommandError`). */
45
+ export declare const CHART_COMMANDS: readonly ["whenReady", "request", "selectObjects", "deselectObjects", "clearSelection", "listSelectedObjects", "selectBestAvailable", "findObject", "listCategories", "setFilteredCategories", "clearFilteredCategories", "setFilters", "clearFilters", "highlightObjects", "clearHighlights", "zoomToObjects", "zoomToSelectedObjects", "zoomToSection", "zoomToFilteredCategories", "resetView", "goToFloor", "listFloors", "goToAllFloorsView", "getReportBySelectability", "getReportBySelectabilityGroupedBy", "getHoldToken", "startNewSession", "releaseHoldToken", "isObjectInChannel", "showViewFromSeat", "trySelectObjects", "doSelectObjects", "selectCategories", "deselectCategories", "listZones", "setSpotlight", "setSpotlightObjects", "setSpotlightOnSelection", "clearSpotlight", "clearSpotlightObjects", "pulse", "unpulse", "resolvePrompt", "exportImage", "setPricing", "changeConfig"];
46
+ export type ChartCommands = Pick<SeatsChart, (typeof CHART_COMMANDS)[number]>;
47
+ /** Every promise command of `SeatsChartEventManager` (seats.io `EventManager` methods). */
48
+ export declare const EVENT_MANAGER_COMMANDS: readonly ["whenReady", "request", "listSelectedObjects", "selectObjects", "doSelectObjects", "trySelectObjects", "deselectObjects", "clearSelection", "setHighlightedObjects", "clearHighlightedObjects", "listOrderChanges", "zoomToObjects", "zoomToSelectedObjects", "changeConfig"];
49
+ export type EventManagerCommands = Pick<SeatsChartEventManager, (typeof EVENT_MANAGER_COMMANDS)[number]>;
50
+ /** Every promise command of `SeatsChartDesigner`. */
51
+ export declare const DESIGNER_COMMANDS: readonly ["whenReady", "request", "save", "publish", "getState", "changeConfig"];
52
+ export type DesignerCommands = Pick<SeatsChartDesigner, (typeof DESIGNER_COMMANDS)[number]>;
53
+ /** Compile-time guard: a new embed command must be exposed by the wrappers. */
54
+ export type CommandsCovered = [
55
+ Assert<Covers<PromiseMethods<SeatsChart>, (typeof CHART_COMMANDS)[number]>>,
56
+ Assert<Covers<PromiseMethods<SeatsChartEventManager>, (typeof EVENT_MANAGER_COMMANDS)[number]>>,
57
+ Assert<Covers<PromiseMethods<SeatsChartDesigner>, (typeof DESIGNER_COMMANDS)[number]>>
58
+ ];
59
+ /**
60
+ * Methods that forward to the current instance (re-created instances included). Before mount and after unmount
61
+ * they reject with `ChartCommandError` ("… is not mounted.") instead of throwing.
62
+ */
63
+ export declare function delegateCommands<I extends object, K extends keyof I & string>(current: () => I | null, names: readonly K[], label: string): Pick<I, K>;
64
+ /** Run one promise command on the instance (rejects with `ChartCommandError` without one). */
65
+ export declare function runCommand(instance: object | null, name: string, label: string, args: readonly unknown[]): Promise<unknown>;
66
+ /**
67
+ * Order-independent fingerprint of a prop value: plain objects and arrays by value (reactive proxies included),
68
+ * functions as "a function", other objects (a form element) by identity. `undefined` = not set.
69
+ */
70
+ export declare function valueKey(value: unknown): string | undefined;
71
+ /**
72
+ * Deep copy of plain objects and arrays (reactive proxies become plain data the embed can post to the iframe);
73
+ * functions and other objects are kept as they are.
74
+ */
75
+ export declare function toPlain<T>(value: T): T;
76
+ /** What every embed host instance offers the binding. */
77
+ export type EmbedInstance = {
78
+ render(): unknown;
79
+ destroy(): void;
80
+ getIframe(): HTMLIFrameElement | null;
81
+ };
82
+ export type EmbedConfig = Record<string, unknown>;
83
+ export type EmbedKind<I extends EmbedInstance> = {
84
+ /** "Seat chart", "Event Manager", "Designer" (error messages). */
85
+ label: string;
86
+ create: (config: EmbedConfig & {
87
+ container: HTMLElement;
88
+ }) => I;
89
+ rerender: (instance: I, config: EmbedConfig) => void;
90
+ changeConfig: (instance: I, patch: EmbedConfig, config: EmbedConfig) => Promise<unknown>;
91
+ /** Keys applied live through `changeConfig`. */
92
+ liveKeys: ReadonlySet<string>;
93
+ /** Keys read when the instance is created (a change re-creates it). */
94
+ mountKeys: ReadonlySet<string>;
95
+ defaultHeight: number;
96
+ defaultTitle: string;
97
+ };
98
+ export type BindingAction = "none" | "frame" | "changeConfig" | "rerender" | "remount";
99
+ /** One mounted embed instance driven by component props. */
100
+ export declare class EmbedBinding<I extends EmbedInstance> {
101
+ private readonly kind;
102
+ private instance;
103
+ private container;
104
+ private config;
105
+ private applied;
106
+ constructor(kind: EmbedKind<I>);
107
+ /** The live embed instance (null before mount / after unmount). */
108
+ get current(): I | null;
109
+ get label(): string;
110
+ /** Create the instance in `container` and render it (browser only). */
111
+ mount(container: HTMLElement, config: EmbedConfig): void;
112
+ /** Apply new props; returns what was done (tests and diagnostics). */
113
+ update(next: EmbedConfig): BindingAction;
114
+ /** Re-create the iframe with the current props (seats.io `rerender()`). */
115
+ rerender(): void;
116
+ /** Remove the iframe and every listener. */
117
+ destroy(): void;
118
+ private remember;
119
+ private remount;
120
+ private applyFrame;
121
+ }
122
+ export declare const CHART_KIND: EmbedKind<SeatsChart>;
123
+ export declare const EVENT_MANAGER_KIND: EmbedKind<SeatsChartEventManager>;
124
+ export declare const DESIGNER_KIND: EmbedKind<SeatsChartDesigner>;
125
+ //# sourceMappingURL=host-core.d.ts.map