@seatlayer/js 0.16.1 → 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/README.md +23 -0
- package/dist/index.cjs +519 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +67 -1
- package/dist/index.d.ts +67 -1
- package/dist/index.js +519 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -242,6 +242,25 @@ interface EmbeddedDesignerOptions {
|
|
|
242
242
|
style?: Partial<CSSStyleDeclaration>;
|
|
243
243
|
allow?: string;
|
|
244
244
|
referrerPolicy?: ReferrerPolicy;
|
|
245
|
+
/**
|
|
246
|
+
* Show the built-in branded loading skeleton and error/expiry card inside the
|
|
247
|
+
* container while the Designer boots. Defaults to `true`. Set `false` when the
|
|
248
|
+
* host renders its own loading and error chrome.
|
|
249
|
+
*/
|
|
250
|
+
showLoadingState?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* If the Designer never posts `ready` within this many milliseconds, the host
|
|
253
|
+
* transitions to the error card with a timeout message. Defaults to `20000`.
|
|
254
|
+
* Only used when `showLoadingState` is enabled.
|
|
255
|
+
*/
|
|
256
|
+
loadingTimeoutMs?: number;
|
|
257
|
+
/**
|
|
258
|
+
* Called when the user presses "Try again" on the error card. Use it to mint a
|
|
259
|
+
* fresh Designer session and call `setDesignerUrl()` with the new URL, which
|
|
260
|
+
* recreates the iframe and returns to the loading state. When omitted, "Try
|
|
261
|
+
* again" reloads the current `designerUrl` in place.
|
|
262
|
+
*/
|
|
263
|
+
onRequestRelaunch?: () => void;
|
|
245
264
|
onReady?: (message: EmbeddedDesignerMessage) => void;
|
|
246
265
|
onSaved?: (message: EmbeddedDesignerMessage) => void;
|
|
247
266
|
onPublished?: (message: EmbeddedDesignerMessage) => void;
|
|
@@ -253,12 +272,30 @@ declare class EmbeddedDesigner {
|
|
|
253
272
|
private options;
|
|
254
273
|
private frame;
|
|
255
274
|
private designerOrigin;
|
|
275
|
+
private overlay;
|
|
276
|
+
private timeoutTimer;
|
|
277
|
+
private phase;
|
|
278
|
+
private restoreContainerPosition;
|
|
256
279
|
constructor(options: EmbeddedDesignerOptions);
|
|
257
280
|
mount(): HTMLIFrameElement;
|
|
258
281
|
/** Replace the iframe instead of assigning a new fragment to an existing one. */
|
|
259
282
|
setDesignerUrl(designerUrl: string): HTMLIFrameElement;
|
|
260
283
|
getIframe(): HTMLIFrameElement | null;
|
|
261
284
|
destroy(): void;
|
|
285
|
+
private loadingStateEnabled;
|
|
286
|
+
private clearTimeoutTimer;
|
|
287
|
+
private ensureContainerPositioned;
|
|
288
|
+
private restoreContainerStyle;
|
|
289
|
+
private removeOverlay;
|
|
290
|
+
private showError;
|
|
291
|
+
private handleTryAgain;
|
|
292
|
+
/**
|
|
293
|
+
* Build (or rebuild) the overlay for the given phase. A single overlay element
|
|
294
|
+
* is reused so we never stack stale skeletons or cards.
|
|
295
|
+
*/
|
|
296
|
+
private renderOverlay;
|
|
297
|
+
private buildSkeleton;
|
|
298
|
+
private buildErrorCard;
|
|
262
299
|
private handleMessage;
|
|
263
300
|
}
|
|
264
301
|
|
|
@@ -929,6 +966,9 @@ interface SeatManagerActivity {
|
|
|
929
966
|
/** Human verb: held / booked / released / blocked / unblocked. */
|
|
930
967
|
verb: string;
|
|
931
968
|
status: DoStatus;
|
|
969
|
+
/** Spatial context for grouped activity when the chart defines sections. */
|
|
970
|
+
sectionIds?: string[];
|
|
971
|
+
sectionLabels?: string[];
|
|
932
972
|
}
|
|
933
973
|
/** Fired after a successful organizer action, for host toasts/telemetry. */
|
|
934
974
|
interface SeatManagerActionResult {
|
|
@@ -959,6 +999,11 @@ interface SeatManagerOptions {
|
|
|
959
999
|
* rAF throttling on occluded tabs never leaves the board stale. Default true.
|
|
960
1000
|
*/
|
|
961
1001
|
keepLiveWhileHidden?: boolean;
|
|
1002
|
+
/**
|
|
1003
|
+
* Opt in to camera-following for new buyer holds/bookings. Off by default so
|
|
1004
|
+
* a live event never steals an operator's current map context.
|
|
1005
|
+
*/
|
|
1006
|
+
followLive?: boolean;
|
|
962
1007
|
/** Chart + first snapshot are loaded and the board is live. */
|
|
963
1008
|
onReady?: () => void;
|
|
964
1009
|
/** Live KPI tallies changed. */
|
|
@@ -974,6 +1019,8 @@ interface SeatManagerOptions {
|
|
|
974
1019
|
}>;
|
|
975
1020
|
/** Tool/mode changed from inside the shared cockpit. */
|
|
976
1021
|
onModeChange?: (mode: SeatManagerMode) => void;
|
|
1022
|
+
/** Follow-live preference changed from inside the cockpit. */
|
|
1023
|
+
onFollowLiveChange?: (enabled: boolean) => void;
|
|
977
1024
|
/** Block-mode selection changed (marquee / ⌘A / category / section / tap). */
|
|
978
1025
|
onSelectionChange?: (seats: ExpandedSeat[]) => void;
|
|
979
1026
|
/** A block/unblock/cancel action completed successfully. */
|
|
@@ -1004,6 +1051,9 @@ declare class SeatManager {
|
|
|
1004
1051
|
private controlRoomSnapshot;
|
|
1005
1052
|
private trendWindowMinutes;
|
|
1006
1053
|
private heatEnabled;
|
|
1054
|
+
private followLive;
|
|
1055
|
+
private lastKpiValues;
|
|
1056
|
+
private activeKpiDeltas;
|
|
1007
1057
|
private ws;
|
|
1008
1058
|
private reconnectTimer;
|
|
1009
1059
|
private attempt;
|
|
@@ -1012,6 +1062,10 @@ declare class SeatManager {
|
|
|
1012
1062
|
private feed;
|
|
1013
1063
|
private feedTimer;
|
|
1014
1064
|
private toastTimer;
|
|
1065
|
+
private liveEventTimer;
|
|
1066
|
+
private kpiCleanupTimer;
|
|
1067
|
+
private followLiveTimer;
|
|
1068
|
+
private followSeatTimer;
|
|
1015
1069
|
private releaseAt;
|
|
1016
1070
|
private layoutObserver;
|
|
1017
1071
|
private tokenExpiresAt;
|
|
@@ -1026,12 +1080,15 @@ declare class SeatManager {
|
|
|
1026
1080
|
private unblockAllConfirmTimer;
|
|
1027
1081
|
private readonly onFullscreenChange;
|
|
1028
1082
|
private readonly onKeyDown;
|
|
1083
|
+
private readonly onRailClick;
|
|
1029
1084
|
constructor(options: SeatManagerOptions);
|
|
1030
1085
|
/** Build the DOM, load the chart, subscribe to realtime, mount the board. */
|
|
1031
1086
|
render(): Promise<this>;
|
|
1032
1087
|
setMode(mode: SeatManagerMode): void;
|
|
1033
1088
|
/** Toggle the normalized sales-velocity outline overlay without changing seat colors. */
|
|
1034
1089
|
setHeatOverlay(enabled: boolean): void;
|
|
1090
|
+
/** Toggle opt-in camera following for new buyer hold/book events. */
|
|
1091
|
+
setFollowLive(enabled: boolean): void;
|
|
1035
1092
|
/** Change the current-vs-previous sales window and refresh the private projection. */
|
|
1036
1093
|
setTrendWindow(windowMinutes: number): Promise<ControlRoomSnapshot>;
|
|
1037
1094
|
enterFullscreen(): Promise<void>;
|
|
@@ -1084,7 +1141,14 @@ declare class SeatManager {
|
|
|
1084
1141
|
private setSeatsLocal;
|
|
1085
1142
|
/** Keep the canvas painting on hidden/occluded tabs (war-room second monitor). */
|
|
1086
1143
|
private afterPaint;
|
|
1087
|
-
private
|
|
1144
|
+
private activityColor;
|
|
1145
|
+
private sectionsForLabels;
|
|
1146
|
+
private pulseSeatLabels;
|
|
1147
|
+
/** Render one grouped realtime operation at the right semantic zoom level. */
|
|
1148
|
+
private paintSpatialActivity;
|
|
1149
|
+
private locateSection;
|
|
1150
|
+
private locateActivity;
|
|
1151
|
+
private showLiveEvent;
|
|
1088
1152
|
private applyReportRevenue;
|
|
1089
1153
|
private refreshControlRoom;
|
|
1090
1154
|
private scheduleRevenueRefresh;
|
|
@@ -1100,12 +1164,14 @@ declare class SeatManager {
|
|
|
1100
1164
|
private sectionOptions;
|
|
1101
1165
|
private buildSectionOptions;
|
|
1102
1166
|
private paintModeTabs;
|
|
1167
|
+
private paintFollowLiveButton;
|
|
1103
1168
|
private paintHeatButton;
|
|
1104
1169
|
private paintMomentumHelp;
|
|
1105
1170
|
private paintFullscreenButton;
|
|
1106
1171
|
private paintTrendWindow;
|
|
1107
1172
|
private setLive;
|
|
1108
1173
|
private updateZoomHint;
|
|
1174
|
+
private formatKpiDelta;
|
|
1109
1175
|
private paintKpis;
|
|
1110
1176
|
private paintRail;
|
|
1111
1177
|
private renderViewRail;
|
package/dist/index.d.ts
CHANGED
|
@@ -242,6 +242,25 @@ interface EmbeddedDesignerOptions {
|
|
|
242
242
|
style?: Partial<CSSStyleDeclaration>;
|
|
243
243
|
allow?: string;
|
|
244
244
|
referrerPolicy?: ReferrerPolicy;
|
|
245
|
+
/**
|
|
246
|
+
* Show the built-in branded loading skeleton and error/expiry card inside the
|
|
247
|
+
* container while the Designer boots. Defaults to `true`. Set `false` when the
|
|
248
|
+
* host renders its own loading and error chrome.
|
|
249
|
+
*/
|
|
250
|
+
showLoadingState?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* If the Designer never posts `ready` within this many milliseconds, the host
|
|
253
|
+
* transitions to the error card with a timeout message. Defaults to `20000`.
|
|
254
|
+
* Only used when `showLoadingState` is enabled.
|
|
255
|
+
*/
|
|
256
|
+
loadingTimeoutMs?: number;
|
|
257
|
+
/**
|
|
258
|
+
* Called when the user presses "Try again" on the error card. Use it to mint a
|
|
259
|
+
* fresh Designer session and call `setDesignerUrl()` with the new URL, which
|
|
260
|
+
* recreates the iframe and returns to the loading state. When omitted, "Try
|
|
261
|
+
* again" reloads the current `designerUrl` in place.
|
|
262
|
+
*/
|
|
263
|
+
onRequestRelaunch?: () => void;
|
|
245
264
|
onReady?: (message: EmbeddedDesignerMessage) => void;
|
|
246
265
|
onSaved?: (message: EmbeddedDesignerMessage) => void;
|
|
247
266
|
onPublished?: (message: EmbeddedDesignerMessage) => void;
|
|
@@ -253,12 +272,30 @@ declare class EmbeddedDesigner {
|
|
|
253
272
|
private options;
|
|
254
273
|
private frame;
|
|
255
274
|
private designerOrigin;
|
|
275
|
+
private overlay;
|
|
276
|
+
private timeoutTimer;
|
|
277
|
+
private phase;
|
|
278
|
+
private restoreContainerPosition;
|
|
256
279
|
constructor(options: EmbeddedDesignerOptions);
|
|
257
280
|
mount(): HTMLIFrameElement;
|
|
258
281
|
/** Replace the iframe instead of assigning a new fragment to an existing one. */
|
|
259
282
|
setDesignerUrl(designerUrl: string): HTMLIFrameElement;
|
|
260
283
|
getIframe(): HTMLIFrameElement | null;
|
|
261
284
|
destroy(): void;
|
|
285
|
+
private loadingStateEnabled;
|
|
286
|
+
private clearTimeoutTimer;
|
|
287
|
+
private ensureContainerPositioned;
|
|
288
|
+
private restoreContainerStyle;
|
|
289
|
+
private removeOverlay;
|
|
290
|
+
private showError;
|
|
291
|
+
private handleTryAgain;
|
|
292
|
+
/**
|
|
293
|
+
* Build (or rebuild) the overlay for the given phase. A single overlay element
|
|
294
|
+
* is reused so we never stack stale skeletons or cards.
|
|
295
|
+
*/
|
|
296
|
+
private renderOverlay;
|
|
297
|
+
private buildSkeleton;
|
|
298
|
+
private buildErrorCard;
|
|
262
299
|
private handleMessage;
|
|
263
300
|
}
|
|
264
301
|
|
|
@@ -929,6 +966,9 @@ interface SeatManagerActivity {
|
|
|
929
966
|
/** Human verb: held / booked / released / blocked / unblocked. */
|
|
930
967
|
verb: string;
|
|
931
968
|
status: DoStatus;
|
|
969
|
+
/** Spatial context for grouped activity when the chart defines sections. */
|
|
970
|
+
sectionIds?: string[];
|
|
971
|
+
sectionLabels?: string[];
|
|
932
972
|
}
|
|
933
973
|
/** Fired after a successful organizer action, for host toasts/telemetry. */
|
|
934
974
|
interface SeatManagerActionResult {
|
|
@@ -959,6 +999,11 @@ interface SeatManagerOptions {
|
|
|
959
999
|
* rAF throttling on occluded tabs never leaves the board stale. Default true.
|
|
960
1000
|
*/
|
|
961
1001
|
keepLiveWhileHidden?: boolean;
|
|
1002
|
+
/**
|
|
1003
|
+
* Opt in to camera-following for new buyer holds/bookings. Off by default so
|
|
1004
|
+
* a live event never steals an operator's current map context.
|
|
1005
|
+
*/
|
|
1006
|
+
followLive?: boolean;
|
|
962
1007
|
/** Chart + first snapshot are loaded and the board is live. */
|
|
963
1008
|
onReady?: () => void;
|
|
964
1009
|
/** Live KPI tallies changed. */
|
|
@@ -974,6 +1019,8 @@ interface SeatManagerOptions {
|
|
|
974
1019
|
}>;
|
|
975
1020
|
/** Tool/mode changed from inside the shared cockpit. */
|
|
976
1021
|
onModeChange?: (mode: SeatManagerMode) => void;
|
|
1022
|
+
/** Follow-live preference changed from inside the cockpit. */
|
|
1023
|
+
onFollowLiveChange?: (enabled: boolean) => void;
|
|
977
1024
|
/** Block-mode selection changed (marquee / ⌘A / category / section / tap). */
|
|
978
1025
|
onSelectionChange?: (seats: ExpandedSeat[]) => void;
|
|
979
1026
|
/** A block/unblock/cancel action completed successfully. */
|
|
@@ -1004,6 +1051,9 @@ declare class SeatManager {
|
|
|
1004
1051
|
private controlRoomSnapshot;
|
|
1005
1052
|
private trendWindowMinutes;
|
|
1006
1053
|
private heatEnabled;
|
|
1054
|
+
private followLive;
|
|
1055
|
+
private lastKpiValues;
|
|
1056
|
+
private activeKpiDeltas;
|
|
1007
1057
|
private ws;
|
|
1008
1058
|
private reconnectTimer;
|
|
1009
1059
|
private attempt;
|
|
@@ -1012,6 +1062,10 @@ declare class SeatManager {
|
|
|
1012
1062
|
private feed;
|
|
1013
1063
|
private feedTimer;
|
|
1014
1064
|
private toastTimer;
|
|
1065
|
+
private liveEventTimer;
|
|
1066
|
+
private kpiCleanupTimer;
|
|
1067
|
+
private followLiveTimer;
|
|
1068
|
+
private followSeatTimer;
|
|
1015
1069
|
private releaseAt;
|
|
1016
1070
|
private layoutObserver;
|
|
1017
1071
|
private tokenExpiresAt;
|
|
@@ -1026,12 +1080,15 @@ declare class SeatManager {
|
|
|
1026
1080
|
private unblockAllConfirmTimer;
|
|
1027
1081
|
private readonly onFullscreenChange;
|
|
1028
1082
|
private readonly onKeyDown;
|
|
1083
|
+
private readonly onRailClick;
|
|
1029
1084
|
constructor(options: SeatManagerOptions);
|
|
1030
1085
|
/** Build the DOM, load the chart, subscribe to realtime, mount the board. */
|
|
1031
1086
|
render(): Promise<this>;
|
|
1032
1087
|
setMode(mode: SeatManagerMode): void;
|
|
1033
1088
|
/** Toggle the normalized sales-velocity outline overlay without changing seat colors. */
|
|
1034
1089
|
setHeatOverlay(enabled: boolean): void;
|
|
1090
|
+
/** Toggle opt-in camera following for new buyer hold/book events. */
|
|
1091
|
+
setFollowLive(enabled: boolean): void;
|
|
1035
1092
|
/** Change the current-vs-previous sales window and refresh the private projection. */
|
|
1036
1093
|
setTrendWindow(windowMinutes: number): Promise<ControlRoomSnapshot>;
|
|
1037
1094
|
enterFullscreen(): Promise<void>;
|
|
@@ -1084,7 +1141,14 @@ declare class SeatManager {
|
|
|
1084
1141
|
private setSeatsLocal;
|
|
1085
1142
|
/** Keep the canvas painting on hidden/occluded tabs (war-room second monitor). */
|
|
1086
1143
|
private afterPaint;
|
|
1087
|
-
private
|
|
1144
|
+
private activityColor;
|
|
1145
|
+
private sectionsForLabels;
|
|
1146
|
+
private pulseSeatLabels;
|
|
1147
|
+
/** Render one grouped realtime operation at the right semantic zoom level. */
|
|
1148
|
+
private paintSpatialActivity;
|
|
1149
|
+
private locateSection;
|
|
1150
|
+
private locateActivity;
|
|
1151
|
+
private showLiveEvent;
|
|
1088
1152
|
private applyReportRevenue;
|
|
1089
1153
|
private refreshControlRoom;
|
|
1090
1154
|
private scheduleRevenueRefresh;
|
|
@@ -1100,12 +1164,14 @@ declare class SeatManager {
|
|
|
1100
1164
|
private sectionOptions;
|
|
1101
1165
|
private buildSectionOptions;
|
|
1102
1166
|
private paintModeTabs;
|
|
1167
|
+
private paintFollowLiveButton;
|
|
1103
1168
|
private paintHeatButton;
|
|
1104
1169
|
private paintMomentumHelp;
|
|
1105
1170
|
private paintFullscreenButton;
|
|
1106
1171
|
private paintTrendWindow;
|
|
1107
1172
|
private setLive;
|
|
1108
1173
|
private updateZoomHint;
|
|
1174
|
+
private formatKpiDelta;
|
|
1109
1175
|
private paintKpis;
|
|
1110
1176
|
private paintRail;
|
|
1111
1177
|
private renderViewRail;
|