@3dsource/metabox-modular-configurator-api 3.0.36 → 3.0.38

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.
@@ -1,5 +1,4 @@
1
- import { Observable } from 'rxjs';
2
-
1
+ import { Observable } from "rxjs";
3
2
  /**
4
3
  * @internal
5
4
  * @hidden
@@ -20,7 +19,7 @@ import { Observable } from 'rxjs';
20
19
  *
21
20
  * @internal
22
21
  */
23
- declare const Metabox = "metabox";
22
+ export declare const Metabox = "metabox";
24
23
  /**
25
24
  * Identifier used as the `host` field in postMessage envelopes sent to the iframe.
26
25
  *
@@ -36,7 +35,7 @@ declare const Metabox = "metabox";
36
35
  *
37
36
  * @internal
38
37
  */
39
- declare const MetaboxHost = "metaboxHost";
38
+ export declare const MetaboxHost = "metaboxHost";
40
39
  /**
41
40
  * Action string dispatched by the iframe when the configurator app has loaded.
42
41
  *
@@ -52,7 +51,7 @@ declare const MetaboxHost = "metaboxHost";
52
51
  *
53
52
  * @internal
54
53
  */
55
- declare const AppLoaded = "appLoaded";
54
+ export declare const AppLoaded = "appLoaded";
56
55
  /**
57
56
  * Default MetaBox domain for production environments.
58
57
  *
@@ -72,16 +71,16 @@ declare const AppLoaded = "appLoaded";
72
71
  /**
73
72
  * @deprecated
74
73
  */
75
- declare const Metabox_V3 = "metabox_v3";
74
+ export declare const Metabox_V3 = "metabox_v3";
76
75
  /**
77
76
  * @deprecated
78
77
  */
79
- declare const MetaboxHost_V3 = "metaboxHost_v3";
78
+ export declare const MetaboxHost_V3 = "metaboxHost_v3";
80
79
  /**
81
80
  * @deprecated
82
81
  */
83
- declare const AppLoaded_V3 = "appLoaded_v3";
84
- declare const MetaboxDomain = "metabox.3dsource.com";
82
+ export declare const AppLoaded_V3 = "appLoaded_v3";
83
+ export declare const MetaboxDomain = "metabox.3dsource.com";
85
84
  /**
86
85
  * Base route URL segment for the Modular Configurator.
87
86
  *
@@ -98,10 +97,8 @@ declare const MetaboxDomain = "metabox.3dsource.com";
98
97
  *
99
98
  * @internal
100
99
  */
101
- declare const BasicRouteUrl = "metabox-configurator/modular";
102
-
103
- declare const VERSION = "3.0.36";
104
-
100
+ export declare const BasicRouteUrl = "metabox-configurator/modular";
101
+ export declare const VERSION = "3.0.38";
105
102
  /**
106
103
  * Configuration options for integrating the Metabox Modular Configurator iframe into a host page.
107
104
  * Passed as the `config` parameter to {@link integrateMetabox}.
@@ -124,30 +121,30 @@ declare const VERSION = "3.0.36";
124
121
  * manually via the ResumeStream command.
125
122
  */
126
123
  interface IntegrateMetaboxConfig {
127
- /** If true, disables Metabox custom template and all related logic. */
128
- standalone?: boolean;
129
- /** URL to an image displayed while the configurator is loading (added as `?loadingImage=...`). */
130
- loadingImage?: string;
131
- /** URL to a video shown on the intro screen (added as `?introVideo=...`). */
132
- introVideo?: string;
133
- /** URL to an image shown on the intro screen (added as `?introImage=...`). */
134
- introImage?: string;
135
- /** Predefined state for the configurator on initial loading in rison format (see
136
- * https://github.com/Nanonid/rison) (added as `?state=...`). */
137
- state?: string;
138
- /** Custom domain for testing purposes. Defaults to `metabox.3dsource.com`. HTTPS is enforced. */
139
- domain?: string;
140
- /** If true, shows the loading progress bar inside the configurator (added as `?showLoadingProgress=true`). */
141
- showLoadingProgress?: boolean;
142
- /** If true, shows the resume stream popup when the stream is paused (added as `?showResumeStreamPopup=true`). */
143
- showResumeStreamPopup?: boolean;
144
- /** If true, shows the user inactivity countdown popup before disconnecting (added as `?showUserInactivityTimer=true`). */
145
- showUserInactivityTimer?: boolean;
146
- /** Inactivity timeout in seconds before the user is warned and eventually disconnected (added as `?userInactivityTimeout=...`). */
147
- userInactivityTimeout?: number;
148
- /** Controls whether the pixel stream starts automatically on load (added as `?autoStartStream=...`).
149
- * Set to `false` to defer streaming until you start it manually via the {@link ResumeStream} command. */
150
- autoStartStream?: boolean;
124
+ /** If true, disables Metabox custom template and all related logic. */
125
+ standalone?: boolean;
126
+ /** URL to an image displayed while the configurator is loading (added as `?loadingImage=...`). */
127
+ loadingImage?: string;
128
+ /** URL to a video shown on the intro screen (added as `?introVideo=...`). */
129
+ introVideo?: string;
130
+ /** URL to an image shown on the intro screen (added as `?introImage=...`). */
131
+ introImage?: string;
132
+ /** Predefined state for the configurator on initial loading in rison format (see
133
+ * https://github.com/Nanonid/rison) (added as `?state=...`). */
134
+ state?: string;
135
+ /** Custom domain for testing purposes. Defaults to `metabox.3dsource.com`. HTTPS is enforced. */
136
+ domain?: string;
137
+ /** If true, shows the loading progress bar inside the configurator (added as `?showLoadingProgress=true`). */
138
+ showLoadingProgress?: boolean;
139
+ /** If true, shows the resume stream popup when the stream is paused (added as `?showResumeStreamPopup=true`). */
140
+ showResumeStreamPopup?: boolean;
141
+ /** If true, shows the user inactivity countdown popup before disconnecting (added as `?showUserInactivityTimer=true`). */
142
+ showUserInactivityTimer?: boolean;
143
+ /** Inactivity timeout in seconds before the user is warned and eventually disconnected (added as `?userInactivityTimeout=...`). */
144
+ userInactivityTimeout?: number;
145
+ /** Controls whether the pixel stream starts automatically on load (added as `?autoStartStream=...`).
146
+ * Set to `false` to defer streaming until you start it manually via the {@link ResumeStream} command. */
147
+ autoStartStream?: boolean;
151
148
  }
152
149
  /**
153
150
  * Internal configuration sent to the Metabox Modular Configurator via postMessage.
@@ -165,14 +162,13 @@ interface IntegrateMetaboxConfig {
165
162
  * command class constructors for their specific parameter requirements rather than this config.
166
163
  */
167
164
  interface MetaboxCommandConfig {
168
- /** If true, disables Metabox custom template and all related logic. */
169
- standalone?: boolean;
170
- /** The URL of the host page embedding the configurator. */
171
- hostUrl: string;
172
- /** The API version string sent to the configurator for compatibility. */
173
- apiVersion: string;
165
+ /** If true, disables Metabox custom template and all related logic. */
166
+ standalone?: boolean;
167
+ /** The URL of the host page embedding the configurator. */
168
+ hostUrl: string;
169
+ /** The API version string sent to the configurator for compatibility. */
170
+ apiVersion: string;
174
171
  }
175
-
176
172
  /**
177
173
  * Registry of all action identifiers that can be sent from the host application to the Metabox Modular Configurator.
178
174
  * Each key maps to a string used as the `action` field in the postMessage envelope.
@@ -189,33 +185,33 @@ interface MetaboxCommandConfig {
189
185
  * Each key is an action name, value is its description. Excellent reference for AI coding agents to understand
190
186
  * the full command vocabulary available.
191
187
  */
192
- declare const MetaboxModularConfiguratorActions: {
193
- readonly metaboxConfig: "metaboxConfig";
194
- readonly resumeStream: "resumeStream";
195
- readonly stopStream: "stopStream";
196
- readonly setEnvironment: "setEnvironment";
197
- readonly setEnvironmentMaterialById: "setEnvironmentMaterialById";
198
- readonly setComponent: "setComponent";
199
- readonly setComponentMaterialById: "setComponentMaterialById";
200
- readonly setMaterials: "setMaterials";
201
- readonly getPdf: "getPdf";
202
- readonly getCallToActionInformation: "getCallToActionInformation";
203
- readonly getScreenshot: "getScreenshot";
204
- readonly showEmbeddedMenu: "showEmbeddedMenu";
205
- readonly showOverlayInterface: "showOverlayInterface";
206
- readonly getCamera: "getCamera";
207
- readonly setCamera: "setCamera";
208
- readonly resetCamera: "resetCamera";
209
- readonly resetConfiguration: "resetConfiguration";
210
- readonly applyZoom: "applyZoom";
211
- readonly initShowcase: "initShowcase";
212
- readonly playShowcase: "playShowcase";
213
- readonly pauseShowcase: "pauseShowcase";
214
- readonly stopShowcase: "stopShowcase";
215
- readonly sendCommandToUnreal: "sendCommandToUnreal";
216
- readonly showMeasurement: "showMeasurement";
217
- readonly hideMeasurement: "hideMeasurement";
218
- readonly resetUserInactivityTimer: "resetUserInactivityTimer";
188
+ export declare const MetaboxModularConfiguratorActions: {
189
+ readonly metaboxConfig: "metaboxConfig";
190
+ readonly resumeStream: "resumeStream";
191
+ readonly stopStream: "stopStream";
192
+ readonly setEnvironment: "setEnvironment";
193
+ readonly setEnvironmentMaterialById: "setEnvironmentMaterialById";
194
+ readonly setComponent: "setComponent";
195
+ readonly setComponentMaterialById: "setComponentMaterialById";
196
+ readonly setMaterials: "setMaterials";
197
+ readonly getPdf: "getPdf";
198
+ readonly getCallToActionInformation: "getCallToActionInformation";
199
+ readonly getScreenshot: "getScreenshot";
200
+ readonly showEmbeddedMenu: "showEmbeddedMenu";
201
+ readonly showOverlayInterface: "showOverlayInterface";
202
+ readonly getCamera: "getCamera";
203
+ readonly setCamera: "setCamera";
204
+ readonly resetCamera: "resetCamera";
205
+ readonly resetConfiguration: "resetConfiguration";
206
+ readonly applyZoom: "applyZoom";
207
+ readonly initShowcase: "initShowcase";
208
+ readonly playShowcase: "playShowcase";
209
+ readonly pauseShowcase: "pauseShowcase";
210
+ readonly stopShowcase: "stopShowcase";
211
+ readonly sendCommandToUnreal: "sendCommandToUnreal";
212
+ readonly showMeasurement: "showMeasurement";
213
+ readonly hideMeasurement: "hideMeasurement";
214
+ readonly resetUserInactivityTimer: "resetUserInactivityTimer";
219
215
  };
220
216
  /**
221
217
  * Union of all action string literals from {@link MetaboxModularConfiguratorActions}.
@@ -231,12 +227,12 @@ declare const MetaboxModularConfiguratorActions: {
231
227
  * Reference for building command dispatchers or admin tools. Full command set includes all values of
232
228
  * MetaboxModularConfiguratorActions like: "metaboxConfig" | "setEnvironment" | "setEnvironmentMaterialById" | ...
233
229
  */
234
- type ToMetaBoxActions = (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];
230
+ export type ToMetaBoxActions = (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];
235
231
  /**
236
232
  * @internal
237
233
  * @hidden
238
234
  */
239
- type ToMetaboxMessagePayload = ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];
235
+ export type ToMetaboxMessagePayload = ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];
240
236
  /**
241
237
  * Interface for messages sent from the application to the Metabox Modular Configurator.
242
238
  *
@@ -251,63 +247,63 @@ type ToMetaboxMessagePayload = ToMetaboxMessagePayloads[keyof ToMetaboxMessagePa
251
247
  * Use as TypeScript type reference for proper typing when building dynamic command dispatchers.
252
248
  * Each key corresponds to a command name and its value defines the expected payload structure.
253
249
  */
254
- interface ToMetaboxMessagePayloads {
255
- [MetaboxModularConfiguratorActions.metaboxConfig]: {
256
- appId: string;
257
- config: MetaboxCommandConfig;
258
- };
259
- [MetaboxModularConfiguratorActions.setEnvironment]: {
260
- id: string;
261
- };
262
- [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: {
263
- slotId: string;
264
- materialId: string;
265
- };
266
- [MetaboxModularConfiguratorActions.setComponent]: {
267
- id: string;
268
- typeId: string;
269
- };
270
- [MetaboxModularConfiguratorActions.setComponentMaterialById]: {
271
- componentId: string;
272
- slotId: string;
273
- materialId: string;
274
- };
275
- [MetaboxModularConfiguratorActions.setMaterials]: {
276
- materials: MaterialCommandEnvelope[];
277
- };
278
- [MetaboxModularConfiguratorActions.getScreenshot]: {
279
- format: MimeType;
280
- size?: {
281
- x: number;
282
- y: number;
283
- };
284
- };
285
- [MetaboxModularConfiguratorActions.getCallToActionInformation]: void;
286
- [MetaboxModularConfiguratorActions.getPdf]: void;
287
- [MetaboxModularConfiguratorActions.showEmbeddedMenu]: {
288
- visible: boolean;
289
- };
290
- [MetaboxModularConfiguratorActions.showOverlayInterface]: {
291
- visible: boolean;
292
- };
293
- [MetaboxModularConfiguratorActions.getCamera]: void;
294
- [MetaboxModularConfiguratorActions.setCamera]: {
295
- camera: CameraCommandPayload;
296
- };
297
- [MetaboxModularConfiguratorActions.resetCamera]: void;
298
- [MetaboxModularConfiguratorActions.resetConfiguration]: void;
299
- [MetaboxModularConfiguratorActions.applyZoom]: {
300
- zoom: number;
250
+ export interface ToMetaboxMessagePayloads {
251
+ [MetaboxModularConfiguratorActions.metaboxConfig]: {
252
+ appId: string;
253
+ config: MetaboxCommandConfig;
254
+ };
255
+ [MetaboxModularConfiguratorActions.setEnvironment]: {
256
+ id: string;
257
+ };
258
+ [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: {
259
+ slotId: string;
260
+ materialId: string;
261
+ };
262
+ [MetaboxModularConfiguratorActions.setComponent]: {
263
+ id: string;
264
+ typeId: string;
265
+ };
266
+ [MetaboxModularConfiguratorActions.setComponentMaterialById]: {
267
+ componentId: string;
268
+ slotId: string;
269
+ materialId: string;
270
+ };
271
+ [MetaboxModularConfiguratorActions.setMaterials]: {
272
+ materials: MaterialCommandEnvelope[];
273
+ };
274
+ [MetaboxModularConfiguratorActions.getScreenshot]: {
275
+ format: MimeType;
276
+ size?: {
277
+ x: number;
278
+ y: number;
301
279
  };
302
- [MetaboxModularConfiguratorActions.initShowcase]: void;
303
- [MetaboxModularConfiguratorActions.playShowcase]: void;
304
- [MetaboxModularConfiguratorActions.pauseShowcase]: void;
305
- [MetaboxModularConfiguratorActions.stopShowcase]: void;
306
- [MetaboxModularConfiguratorActions.sendCommandToUnreal]: object;
307
- [MetaboxModularConfiguratorActions.showMeasurement]: void;
308
- [MetaboxModularConfiguratorActions.hideMeasurement]: void;
309
- [MetaboxModularConfiguratorActions.resetUserInactivityTimer]: void;
310
- [MetaboxModularConfiguratorActions.stopStream]: void;
280
+ };
281
+ [MetaboxModularConfiguratorActions.getCallToActionInformation]: void;
282
+ [MetaboxModularConfiguratorActions.getPdf]: void;
283
+ [MetaboxModularConfiguratorActions.showEmbeddedMenu]: {
284
+ visible: boolean;
285
+ };
286
+ [MetaboxModularConfiguratorActions.showOverlayInterface]: {
287
+ visible: boolean;
288
+ };
289
+ [MetaboxModularConfiguratorActions.getCamera]: void;
290
+ [MetaboxModularConfiguratorActions.setCamera]: {
291
+ camera: CameraCommandPayload;
292
+ };
293
+ [MetaboxModularConfiguratorActions.resetCamera]: void;
294
+ [MetaboxModularConfiguratorActions.resetConfiguration]: void;
295
+ [MetaboxModularConfiguratorActions.applyZoom]: {
296
+ zoom: number;
297
+ };
298
+ [MetaboxModularConfiguratorActions.initShowcase]: void;
299
+ [MetaboxModularConfiguratorActions.playShowcase]: void;
300
+ [MetaboxModularConfiguratorActions.pauseShowcase]: void;
301
+ [MetaboxModularConfiguratorActions.stopShowcase]: void;
302
+ [MetaboxModularConfiguratorActions.sendCommandToUnreal]: object;
303
+ [MetaboxModularConfiguratorActions.showMeasurement]: void;
304
+ [MetaboxModularConfiguratorActions.hideMeasurement]: void;
305
+ [MetaboxModularConfiguratorActions.resetUserInactivityTimer]: void;
306
+ [MetaboxModularConfiguratorActions.stopStream]: void;
311
307
  }
312
308
  /**
313
309
  * One entry of a {@link SetMaterials} batch — the full envelope of a single material command,
@@ -325,19 +321,19 @@ interface ToMetaboxMessagePayloads {
325
321
  * Reference this type when parsing or logging raw postMessage traffic, or when reconstructing a
326
322
  * saved configuration. Discriminate on `action` to tell the targets apart.
327
323
  */
328
- type MaterialCommandEnvelope = {
329
- action: typeof MetaboxModularConfiguratorActions.setComponentMaterialById;
330
- payload: {
331
- componentId: string;
332
- slotId: string;
333
- materialId: string;
334
- };
324
+ export type MaterialCommandEnvelope = {
325
+ action: typeof MetaboxModularConfiguratorActions.setComponentMaterialById;
326
+ payload: {
327
+ componentId: string;
328
+ slotId: string;
329
+ materialId: string;
330
+ };
335
331
  } | {
336
- action: typeof MetaboxModularConfiguratorActions.setEnvironmentMaterialById;
337
- payload: {
338
- slotId: string;
339
- materialId: string;
340
- };
332
+ action: typeof MetaboxModularConfiguratorActions.setEnvironmentMaterialById;
333
+ payload: {
334
+ slotId: string;
335
+ materialId: string;
336
+ };
341
337
  };
342
338
  /**
343
339
  * Payload for the {@link SetCamera} command describing the desired camera state in the Unreal scene.
@@ -357,33 +353,33 @@ type MaterialCommandEnvelope = {
357
353
  * Only include restriction fields you want to enforce; omitted values keep current settings.
358
354
  * In orbit mode, distance limits are relative to the orbit pivot.
359
355
  */
360
- interface CameraCommandPayload {
361
- /** Field of view angle in degrees. */
362
- fov?: number;
363
- /** Camera control mode: `'fps'` for first-person or `'orbit'` for orbital rotation around pivot. */
364
- mode?: 'fps' | 'orbit';
365
- /** Camera position in 3D world space. */
366
- position?: {
367
- x: number;
368
- y: number;
369
- z: number;
370
- };
371
- /** Camera rotation angles in degrees. */
372
- rotation?: {
373
- horizontal: number;
374
- vertical: number;
375
- };
376
- /** Min/max constraints applied to camera movement, zoom, and rotation. */
377
- restrictions?: {
378
- maxDistanceToPivot?: number;
379
- maxFov?: number;
380
- maxHorizontalRotation?: number;
381
- maxVerticalRotation?: number;
382
- minDistanceToPivot?: number;
383
- minFov?: number;
384
- minHorizontalRotation?: number;
385
- minVerticalRotation?: number;
386
- };
356
+ export interface CameraCommandPayload {
357
+ /** Field of view angle in degrees. */
358
+ fov?: number;
359
+ /** Camera control mode: `'fps'` for first-person or `'orbit'` for orbital rotation around pivot. */
360
+ mode?: 'fps' | 'orbit';
361
+ /** Camera position in 3D world space. */
362
+ position?: {
363
+ x: number;
364
+ y: number;
365
+ z: number;
366
+ };
367
+ /** Camera rotation angles in degrees. */
368
+ rotation?: {
369
+ horizontal: number;
370
+ vertical: number;
371
+ };
372
+ /** Min/max constraints applied to camera movement, zoom, and rotation. */
373
+ restrictions?: {
374
+ maxDistanceToPivot?: number;
375
+ maxFov?: number;
376
+ maxHorizontalRotation?: number;
377
+ maxVerticalRotation?: number;
378
+ minDistanceToPivot?: number;
379
+ minFov?: number;
380
+ minHorizontalRotation?: number;
381
+ minVerticalRotation?: number;
382
+ };
387
383
  }
388
384
  /**
389
385
  * @internal
@@ -401,15 +397,15 @@ interface CameraCommandPayload {
401
397
  * Do not construct manually. The Communicator handles all message wrapping. Only reference this interface
402
398
  * if debugging raw postMessage traffic in browser devtools to diagnose why commands aren't being received.
403
399
  */
404
- interface ToMetaBoxMessageEnvelope {
405
- action: ToMetaBoxActions;
406
- payload?: ToMetaboxMessagePayload | never;
400
+ export interface ToMetaBoxMessageEnvelope {
401
+ action: ToMetaBoxActions;
402
+ payload?: ToMetaboxMessagePayload | never;
407
403
  }
408
404
  /**
409
405
  * @internal
410
406
  * @hidden
411
407
  */
412
- type ToMetaboxTarget = 'metabox' | 'child';
408
+ export type ToMetaboxTarget = 'metabox' | 'child';
413
409
  /**
414
410
  * @internal
415
411
  * @hidden
@@ -426,17 +422,23 @@ type ToMetaboxTarget = 'metabox' | 'child';
426
422
  * Do not construct ToMetaBoxMessage objects. Always use `api.sendCommandToMetabox(new CommandName(...))`.
427
423
  * The Communicator wraps your command in the correct message format automatically.
428
424
  */
429
- interface ToMetaBoxMessage {
430
- host: typeof MetaboxHost;
431
- envelope: ToMetaBoxMessageEnvelope;
432
- /**
433
- * @deprecated, use envelope instead of payload
434
- */
435
- payload: ToMetaBoxMessageEnvelope;
436
- target: ToMetaboxTarget;
437
- apiVersion: string;
425
+ export interface ToMetaBoxMessage {
426
+ host: typeof MetaboxHost;
427
+ envelope: ToMetaBoxMessageEnvelope;
428
+ /**
429
+ * @deprecated, use envelope instead of payload
430
+ */
431
+ payload: ToMetaBoxMessageEnvelope;
432
+ target: ToMetaboxTarget;
433
+ apiVersion: string;
434
+ /**
435
+ * True when the command is sent while the host page has transient user activation
436
+ * (a click or key press within the last few seconds). Metabox counts analytics for
437
+ * embed API commands only when it is true, so a command sent on page load is not
438
+ * recorded as a shopper's choice.
439
+ */
440
+ userActivated: boolean;
438
441
  }
439
-
440
442
  /**
441
443
  * Represents a modular configurator envelope with an initial configurator, configuration tree,
442
444
  * all components by active component type, component selected materials, and associated environment.
@@ -459,20 +461,20 @@ interface ToMetaBoxMessage {
459
461
  * Rebuild affected UI sections on each update.
460
462
  */
461
463
  interface ModularConfiguratorEnvelope {
462
- /**
463
- * Represents the modular configurator api with its components, component types, and environments
464
- * */
465
- configurator: InitialModularConfigurator;
466
- /** The unique tree of components and parent and component type id */
467
- configurationTree: ComponentWithParent[];
468
- /** A record mapping all components by current component type */
469
- componentsByComponentType: Record<string, string>;
470
- /** A record mapping component material selection */
471
- componentMaterialsIds: SelectedIds;
472
- /** The unique environment identifier */
473
- environmentId: string;
474
- /** A record mapping environment material selections */
475
- environmentMaterialsIds: SelectedIds;
464
+ /**
465
+ * Represents the modular configurator api with its components, component types, and environments
466
+ * */
467
+ configurator: InitialModularConfigurator;
468
+ /** The unique tree of components and parent and component type id */
469
+ configurationTree: ComponentWithParent[];
470
+ /** A record mapping all components by current component type */
471
+ componentsByComponentType: Record<string, string>;
472
+ /** A record mapping component material selection */
473
+ componentMaterialsIds: SelectedIds;
474
+ /** The unique environment identifier */
475
+ environmentId: string;
476
+ /** A record mapping environment material selections */
477
+ environmentMaterialsIds: SelectedIds;
476
478
  }
477
479
  /**
478
480
  * Represents the modular configurator API with its components, component types, and environments.
@@ -491,24 +493,24 @@ interface ModularConfiguratorEnvelope {
491
493
  * to build dynamic selection UIs. Only changes if the configurator definition is updated in MetaBox admin.
492
494
  */
493
495
  interface InitialModularConfigurator {
494
- /** Unique identifier for the configurator. */
495
- id: string;
496
- /** The name of the configurator. */
497
- name: string;
498
- /** A list of components for the configurator. */
499
- components: ModularConfiguratorComponent[];
500
- /** A list of available environments. */
501
- environments: ModularConfiguratorEnvironment[];
502
- /** A list of a component type for the configurator. */
503
- componentTypes: ModularConfiguratorComponentType[];
504
- /** Indicates if the configurator is active. */
505
- isActive: boolean;
506
- /** Indicates if the cta in ecom configurator is enabled or not. */
507
- ctaEnabled: boolean;
508
- /** A list of available connectors shows connections between all component types. */
509
- connectors: ModularConfiguratorConnector[];
510
- /** Represents object typename for the Modular Configurator. */
511
- __typename: 'ModularConfigurator';
496
+ /** Unique identifier for the configurator. */
497
+ id: string;
498
+ /** The name of the configurator. */
499
+ name: string;
500
+ /** A list of components for the configurator. */
501
+ components: ModularConfiguratorComponent[];
502
+ /** A list of available environments. */
503
+ environments: ModularConfiguratorEnvironment[];
504
+ /** A list of a component type for the configurator. */
505
+ componentTypes: ModularConfiguratorComponentType[];
506
+ /** Indicates if the configurator is active. */
507
+ isActive: boolean;
508
+ /** Indicates if the cta in ecom configurator is enabled or not. */
509
+ ctaEnabled: boolean;
510
+ /** A list of available connectors shows connections between all component types. */
511
+ connectors: ModularConfiguratorConnector[];
512
+ /** Represents object typename for the Modular Configurator. */
513
+ __typename: 'ModularConfigurator';
512
514
  }
513
515
  /**
514
516
  * Represents a configurator component within the modular configurator.
@@ -527,20 +529,20 @@ interface InitialModularConfigurator {
527
529
  * Use product.externalId for ERP/PIM lookups. Check virtualSocketToConnectorsMap for modular assembly validation.
528
530
  */
529
531
  interface ModularConfiguratorComponent {
530
- /** The id unique identifier. */
531
- id: string;
532
- /** The modular configurator component type identifier. */
533
- componentType: ModularConfiguratorComponentType;
534
- /** Display the name for the product. */
535
- name: string;
536
- /** Position index of the product. */
537
- position: number;
538
- /** The detailed product information. */
539
- product: Product;
540
- /** Connectors between connectors and virtual sockets. */
541
- virtualSocketToConnectorsMap?: ModularConfiguratorVirtualSocketToConnector[];
542
- /** Represents object typename for the component. */
543
- __typename: 'ModularConfiguratorComponent';
532
+ /** The id unique identifier. */
533
+ id: string;
534
+ /** The modular configurator component type identifier. */
535
+ componentType: ModularConfiguratorComponentType;
536
+ /** Display the name for the product. */
537
+ name: string;
538
+ /** Position index of the product. */
539
+ position: number;
540
+ /** The detailed product information. */
541
+ product: Product;
542
+ /** Connectors between connectors and virtual sockets. */
543
+ virtualSocketToConnectorsMap?: ModularConfiguratorVirtualSocketToConnector[];
544
+ /** Represents object typename for the component. */
545
+ __typename: 'ModularConfiguratorComponent';
544
546
  }
545
547
  /**
546
548
  * Represents a component type within the modular configurator.
@@ -559,18 +561,18 @@ interface ModularConfiguratorComponent {
559
561
  * The type.id is what you pass as typeId to SetComponent.
560
562
  */
561
563
  interface ModularConfiguratorComponentType {
562
- /** Display the name for the component type. */
563
- name: string;
564
- /** Position index of the component type. */
565
- position: number;
566
- /** Is root current component type or not. */
567
- isRoot: boolean;
568
- /** Is required current component type or not. */
569
- isRequired: boolean;
570
- /** The id unique identifier. */
571
- id: string;
572
- /** Represents object typename for the component type. */
573
- __typename: 'ModularConfiguratorComponentType';
564
+ /** Display the name for the component type. */
565
+ name: string;
566
+ /** Position index of the component type. */
567
+ position: number;
568
+ /** Is root current component type or not. */
569
+ isRoot: boolean;
570
+ /** Is required current component type or not. */
571
+ isRequired: boolean;
572
+ /** The id unique identifier. */
573
+ id: string;
574
+ /** Represents object typename for the component type. */
575
+ __typename: 'ModularConfiguratorComponentType';
574
576
  }
575
577
  /**
576
578
  * Represents the mapping between virtual sockets and connectors in the modular configurator.
@@ -589,10 +591,10 @@ interface ModularConfiguratorComponentType {
589
591
  * compatible socket. Prevents invalid configurations.
590
592
  */
591
593
  interface ModularConfiguratorVirtualSocketToConnector {
592
- virtualSocketId: string;
593
- connectorId: string;
594
- /** Represents object typename for the virtual map socket. */
595
- __typename: 'ModularConfiguratorVirtualSocketToConnector';
594
+ virtualSocketId: string;
595
+ connectorId: string;
596
+ /** Represents object typename for the virtual map socket. */
597
+ __typename: 'ModularConfiguratorVirtualSocketToConnector';
596
598
  }
597
599
  /**
598
600
  * Represents a connector in the modular configurator.
@@ -612,11 +614,11 @@ interface ModularConfiguratorVirtualSocketToConnector {
612
614
  * sending SetComponent commands in custom builder UIs.
613
615
  */
614
616
  interface ModularConfiguratorConnector {
615
- id: string;
616
- componentTypeId1: string;
617
- componentTypeId2: string;
618
- /** Represents object typename for connector. */
619
- __typename: 'ModularConfiguratorConnector';
617
+ id: string;
618
+ componentTypeId1: string;
619
+ componentTypeId2: string;
620
+ /** Represents object typename for connector. */
621
+ __typename: 'ModularConfiguratorConnector';
620
622
  }
621
623
  /**
622
624
  * Represents product details including visual assets and configuration.
@@ -635,30 +637,30 @@ interface ModularConfiguratorConnector {
635
637
  * underlying 3D asset the component renders in the Unreal viewport.
636
638
  */
637
639
  interface Product {
638
- /** The title of the product. */
639
- title: string;
640
- /** List of thumbnails for the product. */
641
- thumbnailList: Thumbnail[];
642
- /** Available slots for the product. */
643
- slots: Slot[];
644
- /** List of metaProperties for the product. */
645
- metaProperties: MetaProperty[];
646
- /** List of virtualSockets for the product. */
647
- virtualSockets: VirtualSocket[];
648
- /**
649
- * @internal
650
- * @hidden
651
- * The model information associated with the product.
652
- */
653
- model: Model;
654
- /** Unique identifier for the product. */
655
- id: string;
656
- /** Unique external id for the product. */
657
- externalId: string;
658
- /** Showcase details for the product. */
659
- showcase?: Showcase;
660
- /** Represents object typename for the product. */
661
- __typename: 'Product';
640
+ /** The title of the product. */
641
+ title: string;
642
+ /** List of thumbnails for the product. */
643
+ thumbnailList: Thumbnail[];
644
+ /** Available slots for the product. */
645
+ slots: Slot[];
646
+ /** List of metaProperties for the product. */
647
+ metaProperties: MetaProperty[];
648
+ /** List of virtualSockets for the product. */
649
+ virtualSockets: VirtualSocket[];
650
+ /**
651
+ * @internal
652
+ * @hidden
653
+ * The model information associated with the product.
654
+ */
655
+ model: Model;
656
+ /** Unique identifier for the product. */
657
+ id: string;
658
+ /** Unique external id for the product. */
659
+ externalId: string;
660
+ /** Showcase details for the product. */
661
+ showcase?: Showcase;
662
+ /** Represents object typename for the product. */
663
+ __typename: 'Product';
662
664
  }
663
665
  /**
664
666
  * Represents a virtual socket on a product used for modular assembly connections.
@@ -678,12 +680,12 @@ interface Product {
678
680
  * by UI code.
679
681
  */
680
682
  interface VirtualSocket {
681
- /** Unique identifier for the virtual socket. */
682
- id: string;
683
- /** Display name of the virtual socket. */
684
- name: string;
685
- /** List of original socket identifiers on the 3D model that this virtual socket maps to. */
686
- originalSockets: string[];
683
+ /** Unique identifier for the virtual socket. */
684
+ id: string;
685
+ /** Display name of the virtual socket. */
686
+ name: string;
687
+ /** List of original socket identifiers on the 3D model that this virtual socket maps to. */
688
+ originalSockets: string[];
687
689
  }
688
690
  /**
689
691
  * @internal
@@ -705,16 +707,16 @@ interface VirtualSocket {
705
707
  * for business-logic lookups (pricing, inventory) rather than model paths.
706
708
  */
707
709
  interface Model {
708
- /** Unique identifier for the model. */
709
- id: string;
710
- /** Unreal Engine asset path used to locate the model within the project. */
711
- assetPath: string;
712
- /** Path to the .pak file containing the packaged model asset. */
713
- pakFilePath: string;
714
- /** Unreal Engine version the model asset was built for. */
715
- unrealVersion: string;
716
- /** Represents object typename for the model. */
717
- __typename: 'Model';
710
+ /** Unique identifier for the model. */
711
+ id: string;
712
+ /** Unreal Engine asset path used to locate the model within the project. */
713
+ assetPath: string;
714
+ /** Path to the .pak file containing the packaged model asset. */
715
+ pakFilePath: string;
716
+ /** Unreal Engine version the model asset was built for. */
717
+ unrealVersion: string;
718
+ /** Represents object typename for the model. */
719
+ __typename: 'Model';
718
720
  }
719
721
  /**
720
722
  * Represents a thumbnail image entity with dimensions and URL path.
@@ -732,14 +734,14 @@ interface Model {
732
734
  * visible category.
733
735
  */
734
736
  interface Thumbnail {
735
- /** Width of the thumbnail. */
736
- width: number;
737
- /** Height of the thumbnail. */
738
- height: number;
739
- /** URL path to the thumbnail image. */
740
- urlPath: string;
741
- /** Represents object typename (as a string, flexible type). */
742
- __typename: 'Thumbnail';
737
+ /** Width of the thumbnail. */
738
+ width: number;
739
+ /** Height of the thumbnail. */
740
+ height: number;
741
+ /** URL path to the thumbnail image. */
742
+ urlPath: string;
743
+ /** Represents object typename (as a string, flexible type). */
744
+ __typename: 'Thumbnail';
743
745
  }
744
746
  /**
745
747
  * Represents a slot within a product that may allow material customization.
@@ -758,14 +760,14 @@ interface Thumbnail {
758
760
  * the swatch picker for that specific surface.
759
761
  */
760
762
  interface Slot {
761
- /** Unique identifier for the slot. */
762
- id: string;
763
- /** Display a label for the slot. */
764
- label: string;
765
- /** A list of enabled materials for the slot. */
766
- enabledMaterials: Material[];
767
- /** Represents object typename for the slot. */
768
- __typename: 'Slot';
763
+ /** Unique identifier for the slot. */
764
+ id: string;
765
+ /** Display a label for the slot. */
766
+ label: string;
767
+ /** A list of enabled materials for the slot. */
768
+ enabledMaterials: Material[];
769
+ /** Represents object typename for the slot. */
770
+ __typename: 'Slot';
769
771
  }
770
772
  /**
771
773
  * Represents a metaProperty within a product that may allow business logic customization.
@@ -783,16 +785,16 @@ interface Slot {
783
785
  * content teams in MetaBox admin.
784
786
  */
785
787
  interface MetaProperty {
786
- /** Unique identifier for the metaProperty. */
787
- id: string;
788
- /** Display the name for the metaProperty. */
789
- name: string;
790
- /** Value for the metaProperty. */
791
- value: string;
792
- /** Type for the metaProperty. */
793
- type: string;
794
- /** Represents object typename for the metaProperty. */
795
- __typename: 'MetaProperty';
788
+ /** Unique identifier for the metaProperty. */
789
+ id: string;
790
+ /** Display the name for the metaProperty. */
791
+ name: string;
792
+ /** Value for the metaProperty. */
793
+ value: string;
794
+ /** Type for the metaProperty. */
795
+ type: string;
796
+ /** Represents object typename for the metaProperty. */
797
+ __typename: 'MetaProperty';
796
798
  }
797
799
  /**
798
800
  * Represents a material that can be applied to a product slot.
@@ -811,22 +813,22 @@ interface MetaProperty {
811
813
  * Pass material.id to SetComponentMaterial or SetEnvironmentMaterial.
812
814
  */
813
815
  interface Material {
814
- /** Unique identifier for the material. */
815
- id: string;
816
- /** Title or name of the material. */
817
- title: string;
818
- /** Unique external id for the material. */
819
- externalId: string;
820
- /** List of thumbnails for the material. */
821
- thumbnailList: Thumbnail[];
822
- /**
823
- * @internal
824
- * @hidden
825
- * The model information associated with the material.
826
- */
827
- model: Model;
828
- /** Represents object typename for the material. */
829
- __typename: 'Material';
816
+ /** Unique identifier for the material. */
817
+ id: string;
818
+ /** Title or name of the material. */
819
+ title: string;
820
+ /** Unique external id for the material. */
821
+ externalId: string;
822
+ /** List of thumbnails for the material. */
823
+ thumbnailList: Thumbnail[];
824
+ /**
825
+ * @internal
826
+ * @hidden
827
+ * The model information associated with the material.
828
+ */
829
+ model: Model;
830
+ /** Represents object typename for the material. */
831
+ __typename: 'Material';
830
832
  }
831
833
  /**
832
834
  * Details showcase the presentation of a product.
@@ -845,12 +847,12 @@ interface Material {
845
847
  * Playback sequence: InitShowcase → PlayShowcase → monitor via showcaseStatusChanged.
846
848
  */
847
849
  interface Showcase {
848
- /** A list of low-bandwidth versions for the showcase (optional). */
849
- lowBandwidth?: (Timecode | null)[] | null;
850
- /** Duration for the showcase (optional). */
851
- duration?: number;
852
- /** Represents object typename for the showcase. */
853
- __typename: 'Showcase';
850
+ /** A list of low-bandwidth versions for the showcase (optional). */
851
+ lowBandwidth?: (Timecode | null)[] | null;
852
+ /** Duration for the showcase (optional). */
853
+ duration?: number;
854
+ /** Represents object typename for the showcase. */
855
+ __typename: 'Showcase';
854
856
  }
855
857
  /**
856
858
  * Represents a low-bandwidth entity used in showcases in LBM mode.
@@ -869,12 +871,12 @@ interface Showcase {
869
871
  * for product demo presentations.
870
872
  */
871
873
  interface Timecode {
872
- /** Time marker for the entity. */
873
- time: number;
874
- /** Duration of the entity display. */
875
- duration: number;
876
- /** Represents object typename (as a string, flexible type). */
877
- __typename: 'Timecode';
874
+ /** Time marker for the entity. */
875
+ time: number;
876
+ /** Duration of the entity display. */
877
+ duration: number;
878
+ /** Represents object typename (as a string, flexible type). */
879
+ __typename: 'Timecode';
878
880
  }
879
881
  /**
880
882
  * Represents the environment settings for a modular configurator.
@@ -893,16 +895,16 @@ interface Timecode {
893
895
  * List available slots for environment material customization.
894
896
  */
895
897
  interface ModularConfiguratorEnvironment {
896
- /** Unique identifier for the environment. */
897
- environmentId: string;
898
- /** Position index of the environment. */
899
- position: number;
900
- /** Display label for the environment. */
901
- label: string;
902
- /** Detailed environment configuration. */
903
- environment: Environment;
904
- /** Represents object typename for the environment. */
905
- __typename: 'ModularConfiguratorEnvironment';
898
+ /** Unique identifier for the environment. */
899
+ environmentId: string;
900
+ /** Position index of the environment. */
901
+ position: number;
902
+ /** Display label for the environment. */
903
+ label: string;
904
+ /** Detailed environment configuration. */
905
+ environment: Environment;
906
+ /** Represents object typename for the environment. */
907
+ __typename: 'ModularConfiguratorEnvironment';
906
908
  }
907
909
  /**
908
910
  * Represents an environment with associated media and configuration.
@@ -921,28 +923,28 @@ interface ModularConfiguratorEnvironment {
921
923
  * Iterate slots array to build environment material pickers.
922
924
  */
923
925
  interface Environment {
924
- /** Unique identifier for the environment. */
925
- id: string;
926
- /** Title or name of the environment. */
927
- title: string;
928
- /** Flag indicating if UDS is enabled. */
929
- udsEnabled: boolean;
930
- /** The north yaw of the sun in the environment. */
931
- sunNorthYaw: number;
932
- /** The UDS hour setting for the environment. */
933
- udsHour: number;
934
- /** List of thumbnails for the environment (optional). */
935
- thumbnailList: Thumbnail[];
936
- /** List of slots for the environment (optional). */
937
- slots: Slot[];
938
- /**
939
- * @internal
940
- * @hidden
941
- * The model information associated with the environment.
942
- */
943
- model: Model;
944
- /** Represents object typename for the environment. */
945
- __typename: 'Environment';
926
+ /** Unique identifier for the environment. */
927
+ id: string;
928
+ /** Title or name of the environment. */
929
+ title: string;
930
+ /** Flag indicating if UDS is enabled. */
931
+ udsEnabled: boolean;
932
+ /** The north yaw of the sun in the environment. */
933
+ sunNorthYaw: number;
934
+ /** The UDS hour setting for the environment. */
935
+ udsHour: number;
936
+ /** List of thumbnails for the environment (optional). */
937
+ thumbnailList: Thumbnail[];
938
+ /** List of slots for the environment (optional). */
939
+ slots: Slot[];
940
+ /**
941
+ * @internal
942
+ * @hidden
943
+ * The model information associated with the environment.
944
+ */
945
+ model: Model;
946
+ /** Represents object typename for the environment. */
947
+ __typename: 'Environment';
946
948
  }
947
949
  /**
948
950
  * Defines the structure for a component tree where every component has id and parent.
@@ -961,9 +963,9 @@ interface Environment {
961
963
  * The root component will have no parent reference (parentId is null).
962
964
  */
963
965
  interface ComponentWithParent {
964
- id: string;
965
- componentTypeId: string;
966
- parentId: string | null;
966
+ id: string;
967
+ componentTypeId: string;
968
+ parentId: string | null;
967
969
  }
968
970
  /**
969
971
  * Defines the structure for a mapping of selected materials.
@@ -1013,8 +1015,8 @@ type ShowCaseStatus = 'init' | 'play' | 'pause' | 'stop';
1013
1015
  * overlay positioning, inform users about stream quality, or scale screenshot size requests proportionally.
1014
1016
  */
1015
1017
  interface VideoResolution {
1016
- width: number | null;
1017
- height: number | null;
1018
+ width: number | null;
1019
+ height: number | null;
1018
1020
  }
1019
1021
  /**
1020
1022
  * Video stream statistics reported by the Metabox player.
@@ -1032,26 +1034,25 @@ interface VideoResolution {
1032
1034
  * Subscribe via `api.addEventListener('videoStatsUpdated', (stats: VideoStats) => {...})`.
1033
1035
  */
1034
1036
  interface VideoStats {
1035
- /** Video encoder quantization parameter (lower = better quality). */
1036
- qp?: number;
1037
- /** Current bitrate in bits per second. */
1038
- bitrate?: number;
1039
- /** Decoded frames per second. */
1040
- framesPerSecond?: number;
1041
- /** Inter-arrival jitter in seconds. */
1042
- jitter?: number;
1043
- /** Current round-trip time in seconds. */
1044
- rtt?: number;
1045
- /** The total number of frames successfully decoded. */
1046
- framesDecoded?: number;
1047
- /** The total number of frames dropped. */
1048
- framesDropped?: number;
1049
- /** Total number of frames received. */
1050
- framesReceived?: number;
1051
- /** Total number of packets lost. */
1052
- packetsLost?: number;
1037
+ /** Video encoder quantization parameter (lower = better quality). */
1038
+ qp?: number;
1039
+ /** Current bitrate in bits per second. */
1040
+ bitrate?: number;
1041
+ /** Decoded frames per second. */
1042
+ framesPerSecond?: number;
1043
+ /** Inter-arrival jitter in seconds. */
1044
+ jitter?: number;
1045
+ /** Current round-trip time in seconds. */
1046
+ rtt?: number;
1047
+ /** The total number of frames successfully decoded. */
1048
+ framesDecoded?: number;
1049
+ /** The total number of frames dropped. */
1050
+ framesDropped?: number;
1051
+ /** Total number of frames received. */
1052
+ framesReceived?: number;
1053
+ /** Total number of packets lost. */
1054
+ packetsLost?: number;
1053
1055
  }
1054
-
1055
1056
  /**
1056
1057
  * Represents an ecom configurator object with all necessary information about cta.
1057
1058
  *
@@ -1068,14 +1069,14 @@ interface VideoStats {
1068
1069
  * configuration data when CTA is triggered.
1069
1070
  */
1070
1071
  interface EcomConfigurator {
1071
- /** The unique ecom configurator identifier. */
1072
- id: string;
1073
- /** The created data of ecom configurator. */
1074
- createdAt: string;
1075
- /** A reference to the Call To Action Information. */
1076
- cta?: Cta;
1077
- /** Represents object typename for the ecom configurator. */
1078
- __typename: 'Configurator';
1072
+ /** The unique ecom configurator identifier. */
1073
+ id: string;
1074
+ /** The created data of ecom configurator. */
1075
+ createdAt: string;
1076
+ /** A reference to the Call To Action Information. */
1077
+ cta?: Cta;
1078
+ /** Represents object typename for the ecom configurator. */
1079
+ __typename: 'Configurator';
1079
1080
  }
1080
1081
  /**
1081
1082
  * Represents the call-to-action information for an ecom configurator.
@@ -1094,16 +1095,15 @@ interface EcomConfigurator {
1094
1095
  * the config JSON to the callback URL. The backend returns `{ redirectUrl }`.
1095
1096
  */
1096
1097
  interface Cta {
1097
- /** The indicator of whether the call-to-action is enabled or not. */
1098
- enabled: boolean;
1099
- /** Label of button for call-to-action. */
1100
- label: string;
1101
- /** Callback URL using for sent configurator selected information to this url and redirected to the url after get response. */
1102
- callbackUrl: string;
1103
- /** Represents object typename for the CTA object. */
1104
- __typename: 'Cta';
1098
+ /** The indicator of whether the call-to-action is enabled or not. */
1099
+ enabled: boolean;
1100
+ /** Label of button for call-to-action. */
1101
+ label: string;
1102
+ /** Callback URL using for sent configurator selected information to this url and redirected to the url after get response. */
1103
+ callbackUrl: string;
1104
+ /** Represents object typename for the CTA object. */
1105
+ __typename: 'Cta';
1105
1106
  }
1106
-
1107
1107
  /**
1108
1108
  * Lifecycle of a {@link GetPdf} render.
1109
1109
  *
@@ -1168,76 +1168,81 @@ type CtaStatus = 'started' | 'ready' | 'failed';
1168
1168
  * viewportReady→boolean, showcaseStatusChanged→ShowCaseStatus.
1169
1169
  */
1170
1170
  interface FromMetaboxMessagePayloads {
1171
- /**
1172
- * Dispatches every time the configurator data is updated.
1173
- * I.e., when the user changes the configuration. (Material, Component Tree, Components, Component Type, Environment)
1174
- */
1175
- configuratorDataUpdated: ModularConfiguratorEnvelope;
1176
- /**
1177
- * Dispatches every time the ecom configurator data is updated (label, endpointUrl).
1178
- */
1179
- ecomConfiguratorDataUpdated: EcomConfigurator;
1180
- /**
1181
- * Dispatches every time when the Unreal Viewport is visible/hidden.
1182
- */
1183
- viewportReady: boolean;
1184
- /**
1185
- * Dispatches every time when while the configurator loads. Shows showcase status information on a scene.
1186
- */
1187
- showcaseStatusChanged: ShowCaseStatus;
1188
- /**
1189
- * Dispatches at the moment while the configurator loads. Shows status information.
1190
- */
1191
- statusMessageChanged: string | null;
1192
- /**
1193
- * Dispatches every time when Unreal is sending an ordered render with a new GetScreenshot() command.
1194
- */
1195
- screenshotReady: string | null;
1196
- /**
1197
- * Dispatches as a GetPdf() render starts, finishes or fails. The document is
1198
- * delivered by the browser download either way; this only reports progress.
1199
- */
1200
- pdfStatusChanged: PdfStatus;
1201
- /**
1202
- * Dispatches as a GetCallToActionInformation() workflow starts, completes or
1203
- * fails. MetaBox handles the redirect itself; this only reports progress.
1204
- */
1205
- ctaStatusChanged: CtaStatus;
1206
- /**
1207
- * Dispatches every time when Unreal is changing its video stream size.
1208
- */
1209
- videoResolutionChanged: VideoResolution;
1210
- /**
1211
- * Dispatches every time when the User sends get camera command new GetCamera() command.
1212
- */
1213
- getCameraResult: CameraCommandPayload;
1214
- /**
1215
- * @deprecated
1216
- * Dispatches every time when the configurator connected/disconnected with Unreal Engine.
1217
- */
1218
- dataChannelConnected: boolean;
1219
- /**
1220
- * Dispatches periodically with aggregated video stream statistics.
1221
- */
1222
- videoStatsUpdated: VideoStats;
1223
- /**
1224
- * Dispatches when the loading progress or loader visibility changes.
1225
- * `percents` is the smoothed progress value (0–100).
1226
- * `loaderVisible` indicates whether the loading overlay is currently shown.
1227
- */
1228
- loadingStatusChanged: {
1229
- percents: number;
1230
- loaderVisible: boolean;
1231
- };
1232
- /**
1233
- * Dispatches when user inactivity (AFK) is detected and the countdown to disconnect begins.
1234
- * `remainingSecondsToDisconnect` counts down (e.g. 15, 14, 13…) until the session is terminated.
1235
- * `countdownVisible` indicates whether the AFK countdown popup is currently shown.
1236
- */
1237
- userInactivityDetected: {
1238
- remainingSecondsToDisconnect: number;
1239
- countdownVisible: boolean;
1240
- };
1171
+ /**
1172
+ * Dispatches every time the configurator data is updated.
1173
+ * I.e., when the user changes the configuration. (Material, Component Tree, Components, Component Type, Environment)
1174
+ */
1175
+ configuratorDataUpdated: ModularConfiguratorEnvelope;
1176
+ /**
1177
+ * Dispatches every time the ecom configurator data is updated (label, endpointUrl).
1178
+ */
1179
+ ecomConfiguratorDataUpdated: EcomConfigurator;
1180
+ /**
1181
+ * Dispatches every time when the Unreal Viewport is visible/hidden.
1182
+ */
1183
+ viewportReady: boolean;
1184
+ /**
1185
+ * Dispatches every time when while the configurator loads. Shows showcase status information on a scene.
1186
+ */
1187
+ showcaseStatusChanged: ShowCaseStatus;
1188
+ /**
1189
+ * Dispatches at the moment while the configurator loads. Shows status information.
1190
+ */
1191
+ statusMessageChanged: string | null;
1192
+ /**
1193
+ * Dispatches every time when Unreal is sending an ordered render with a new GetScreenshot() command.
1194
+ */
1195
+ screenshotReady: string | null;
1196
+ /**
1197
+ * Dispatches as a GetPdf() render starts, finishes or fails. The document is
1198
+ * delivered by the browser download either way; this only reports progress.
1199
+ */
1200
+ pdfStatusChanged: PdfStatus;
1201
+ /**
1202
+ * Dispatches as a GetCallToActionInformation() workflow starts, completes or
1203
+ * fails. MetaBox handles the redirect itself; this only reports progress.
1204
+ */
1205
+ ctaStatusChanged: CtaStatus;
1206
+ /**
1207
+ * Dispatches every time when Unreal is changing its video stream size.
1208
+ */
1209
+ videoResolutionChanged: VideoResolution;
1210
+ /**
1211
+ * Dispatches every time when the User sends get camera command new GetCamera() command.
1212
+ */
1213
+ getCameraResult: CameraCommandPayload;
1214
+ /**
1215
+ * @deprecated
1216
+ * Dispatches every time when the configurator connected/disconnected with Unreal Engine.
1217
+ */
1218
+ dataChannelConnected: boolean;
1219
+ /**
1220
+ * Dispatches periodically with aggregated video stream statistics.
1221
+ */
1222
+ videoStatsUpdated: VideoStats;
1223
+ /**
1224
+ * Dispatches when the loading progress or loader visibility changes.
1225
+ * `percents` is the smoothed progress value (0–100).
1226
+ * `loaderVisible` indicates whether the loading overlay is currently shown.
1227
+ */
1228
+ loadingStatusChanged: {
1229
+ percents: number;
1230
+ loaderVisible: boolean;
1231
+ };
1232
+ /**
1233
+ * Dispatches when user inactivity (AFK) is detected and the countdown to disconnect begins.
1234
+ * `remainingSecondsToDisconnect` counts down (e.g. 15, 14, 13…) until the session is terminated.
1235
+ * `countdownVisible` indicates whether the AFK countdown popup is currently shown.
1236
+ */
1237
+ userInactivityDetected: {
1238
+ remainingSecondsToDisconnect: number;
1239
+ countdownVisible: boolean;
1240
+ };
1241
+ /**
1242
+ * Dispatches when the configurator id does not exist or is not available.
1243
+ * Nothing will load; `configuratorDataUpdated` will not follow.
1244
+ */
1245
+ configuratorNotFound: true;
1241
1246
  }
1242
1247
  /**
1243
1248
  * Union of all event names received from MetaBox.
@@ -1273,9 +1278,9 @@ type FromMetaBoxApiEvents = keyof FromMetaboxMessagePayloads;
1273
1278
  * against this structure to diagnose malformed messages. The Communicator handles all wrapping/unwrapping.
1274
1279
  */
1275
1280
  interface MetaBoxApiEnvelope<T extends FromMetaBoxApiEvents> {
1276
- action: 'bridge';
1277
- eventType: T;
1278
- payload: FromMetaboxMessagePayloads[T];
1281
+ action: 'bridge';
1282
+ eventType: T;
1283
+ payload: FromMetaboxMessagePayloads[T];
1279
1284
  }
1280
1285
  /**
1281
1286
  * Identifies which side of the iframe boundary the Communicator is running on.
@@ -1299,21 +1304,19 @@ type MetaboxEnvironment = 'metabox' | 'host';
1299
1304
  * Used for signaling that the app is loaded and ready to open api.
1300
1305
  */
1301
1306
  interface MCAppLoaded {
1302
- action: typeof AppLoaded;
1303
- eventType?: unknown;
1304
- payload: {
1305
- appId: string;
1306
- version?: string;
1307
- };
1307
+ action: typeof AppLoaded;
1308
+ eventType?: unknown;
1309
+ payload: {
1310
+ appId: string;
1311
+ version?: string;
1312
+ };
1308
1313
  }
1309
1314
  /**
1310
1315
  * @internal
1311
1316
  * @hidden
1312
1317
  * This creates a union of all event envelopes defined in MetaBoxAPIPayloads.
1313
1318
  */
1314
- type FromMetaBoxAPIEnvelope = {
1315
- [K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>;
1316
- }[keyof FromMetaboxMessagePayloads] | MCAppLoaded;
1319
+ type FromMetaBoxAPIEnvelope = { [K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>; }[keyof FromMetaboxMessagePayloads] | MCAppLoaded;
1317
1320
  /**
1318
1321
  * @internal
1319
1322
  * @hidden
@@ -1336,11 +1339,10 @@ type FromMetaboxTarget = 'parent' | 'communicator';
1336
1339
  * Only reference if debugging raw postMessage traffic in browser devtools.
1337
1340
  */
1338
1341
  interface FromMetaBoxMessage {
1339
- host: typeof Metabox;
1340
- envelope: FromMetaBoxAPIEnvelope;
1341
- target: FromMetaboxTarget;
1342
+ host: typeof Metabox;
1343
+ envelope: FromMetaBoxAPIEnvelope;
1344
+ target: FromMetaboxTarget;
1342
1345
  }
1343
-
1344
1346
  /**
1345
1347
  * Base class for commands sent to the Metabox API.
1346
1348
  *
@@ -1359,11 +1361,10 @@ interface FromMetaBoxMessage {
1359
1361
  * @internal
1360
1362
  * @hidden
1361
1363
  */
1362
- declare class CommandBase {
1363
- /** The message envelope populated by subclass constructors and sent via {@link Communicator.sendCommandToMetabox}. */
1364
- data: ToMetaBoxMessageEnvelope;
1364
+ export declare class CommandBase {
1365
+ /** The message envelope populated by subclass constructors and sent via {@link Communicator.sendCommandToMetabox}. */
1366
+ data: ToMetaBoxMessageEnvelope;
1365
1367
  }
1366
-
1367
1368
  /**
1368
1369
  * Represents a callback listener for specific message types.
1369
1370
  * Used internally by EventDispatcher to store event listeners.
@@ -1382,11 +1383,11 @@ declare class CommandBase {
1382
1383
  *
1383
1384
  * @public
1384
1385
  */
1385
- interface Listener {
1386
- /** The message type this listener is registered for */
1387
- messageType: string;
1388
- /** The callback function to execute when a message of the specified type is received */
1389
- callback: (data: unknown) => void;
1386
+ export interface Listener {
1387
+ /** The message type this listener is registered for */
1388
+ messageType: string;
1389
+ /** The callback function to execute when a message of the specified type is received */
1390
+ callback: (data: unknown) => void;
1390
1391
  }
1391
1392
  /**
1392
1393
  * EventDispatcher is a class that manages event listeners and dispatches events to them.
@@ -1402,39 +1403,38 @@ interface Listener {
1402
1403
  * Do not reference or extend EventDispatcher in application code. Use only the Communicator interface methods.
1403
1404
  * If debugging communication failures, check browser console for postMessage errors related to this layer.
1404
1405
  */
1405
- declare class EventDispatcher {
1406
- /**
1407
- * Storage for callback listeners by message type.
1408
- */
1409
- listeners: Listener[];
1410
- /**
1411
- * Removes all registered listeners. Subclasses override this to perform additional cleanup.
1412
- * @param key - Instance key (used by subclass overrides for registry cleanup).
1413
- */
1414
- destroy(key: string): void;
1415
- /**
1416
- * Adds an event listener for receiving specific types of messages.
1417
- *
1418
- * @param {string} messageType - The message type to listen for.
1419
- * @param callback - The callback function to execute when a message is received.
1420
- */
1421
- addEventListener(messageType: string, callback: (data: unknown) => void): this;
1422
- /**
1423
- * Dispatches an event to all listeners of a specific message type.
1424
- *
1425
- * @param {string} messageType - The message type.
1426
- * @param data - The data associated with the event.
1427
- */
1428
- dispatchEvent(messageType: string, data: unknown): this;
1429
- /**
1430
- * Removes an event listener for a specific type of message.
1431
- *
1432
- * @param {string} messageType - The message type.
1433
- * @param callback - The callback function to remove.
1434
- */
1435
- removeEventListener(messageType: string, callback: (data: unknown) => void): this;
1406
+ export declare class EventDispatcher {
1407
+ /**
1408
+ * Storage for callback listeners by message type.
1409
+ */
1410
+ listeners: Listener[];
1411
+ /**
1412
+ * Removes all registered listeners. Subclasses override this to perform additional cleanup.
1413
+ * @param key - Instance key (used by subclass overrides for registry cleanup).
1414
+ */
1415
+ destroy(key: string): void;
1416
+ /**
1417
+ * Adds an event listener for receiving specific types of messages.
1418
+ *
1419
+ * @param {string} messageType - The message type to listen for.
1420
+ * @param callback - The callback function to execute when a message is received.
1421
+ */
1422
+ addEventListener(messageType: string, callback: (data: unknown) => void): this;
1423
+ /**
1424
+ * Dispatches an event to all listeners of a specific message type.
1425
+ *
1426
+ * @param {string} messageType - The message type.
1427
+ * @param data - The data associated with the event.
1428
+ */
1429
+ dispatchEvent(messageType: string, data: unknown): this;
1430
+ /**
1431
+ * Removes an event listener for a specific type of message.
1432
+ *
1433
+ * @param {string} messageType - The message type.
1434
+ * @param callback - The callback function to remove.
1435
+ */
1436
+ removeEventListener(messageType: string, callback: (data: unknown) => void): this;
1436
1437
  }
1437
-
1438
1438
  /**
1439
1439
  * What `integrateMetabox` knows about the iframe it created and the origin it
1440
1440
  * pointed that iframe at. Lets the Communicator check who is talking to it and
@@ -1442,11 +1442,11 @@ declare class EventDispatcher {
1442
1442
  *
1443
1443
  * @internal
1444
1444
  */
1445
- interface CommunicatorConnection {
1446
- /** The embedded iframe, when we created it ourselves. */
1447
- iframe: HTMLIFrameElement | null;
1448
- /** Origin of the configurator document, or `null` when it is not known yet. */
1449
- origin: string | null;
1445
+ export interface CommunicatorConnection {
1446
+ /** The embedded iframe, when we created it ourselves. */
1447
+ iframe: HTMLIFrameElement | null;
1448
+ /** Origin of the configurator document, or `null` when it is not known yet. */
1449
+ origin: string | null;
1450
1450
  }
1451
1451
  /**
1452
1452
  * Handles messaging between the host page and embedded Metabox content.
@@ -1467,121 +1467,120 @@ interface CommunicatorConnection {
1467
1467
  *
1468
1468
  * @internal Use {@link Communicator.createInstance} or the {@link integrateMetabox} helper to instantiate.
1469
1469
  */
1470
- declare class Communicator extends EventDispatcher {
1471
- /**
1472
- * Bound handler for incoming postMessage events.
1473
- */
1474
- private binder;
1475
- /** Which side of the iframe boundary this instance runs on — see `acceptsMessageFrom`. */
1476
- private readonly environment;
1477
- /** The iframe we drive, when the integration created it. */
1478
- private readonly iframe;
1479
- /** Pinned configurator origin; `null` until we learn it. */
1480
- private readonly targetOrigin;
1481
- /** Keeps the "rejected an inbound message" warning to one per instance. */
1482
- private senderRejectionReported;
1483
- /** Keeps the "unknown configurator origin" warning to one per instance. */
1484
- private wildcardTargetReported;
1485
- /** Keeps the "our iframe left the document" warning to one per instance. */
1486
- private staleFrameReported;
1487
- /**
1488
- * Constructs a Communicator, replacing any existing instance, and begins listening for messages.
1489
- * @internal
1490
- */
1491
- constructor(data: MCAppLoaded['payload'], environment: MetaboxEnvironment, config?: Partial<MetaboxCommandConfig>, connection?: CommunicatorConnection);
1492
- /**
1493
- * Listens for Metabox to signal readiness, then initializes communicator.
1494
- * @param apiReadyCallback - Called with the new Communicator once the Metabox is loaded.
1495
- * @param {MetaboxEnvironment} environment - The environment in which the Communicator is running.
1496
- * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
1497
- * @param {CommunicatorConnection} connection - the iframe and origin `integrateMetabox`
1498
- * built, so the handshake can be attributed and later messages addressed precisely.
1499
- * Omitted by hand-rolled embeds, which are then identified through the
1500
- * `embeddedContent` id and the handshake's own origin.
1501
- * @returns A cancel function that removes the handshake `message` listener.
1502
- * `integrateMetabox` (the public entry point) calls this automatically when
1503
- * a new integration supersedes a still-pending one, so direct internal
1504
- * callers only need it for explicit early teardown. Idempotent.
1505
- */
1506
- static createInstance(apiReadyCallback: (api: Communicator) => void, environment: MetaboxEnvironment, config?: Partial<MetaboxCommandConfig>, connection?: CommunicatorConnection): () => void;
1507
- /**
1508
- * The origin to address the configurator by, decided once from the handshake.
1509
- *
1510
- * Prefers what `integrateMetabox` computed from the iframe URL, but yields to
1511
- * the origin the handshake actually came from when the two disagree: a redirect
1512
- * (a `config.domain` override pointing at a host that 30x's elsewhere) would
1513
- * otherwise pin an origin nothing answers on, and every command would be
1514
- * dropped silently. The sender already passed the window gate, so this cannot
1515
- * be steered by an unrelated page.
1516
- */
1517
- private static resolveHandshakeOrigin;
1518
- /**
1519
- * Cleans up resources and stops listening for messages.
1520
- */
1521
- destroy(key: string): void;
1522
- /** Destroys all active Communicator instances and clears the internal registry. */
1523
- static clearAll(): void;
1524
- /**
1525
- * Retrieves a registered Communicator instance by its key.
1526
- * @param key - The composite key (`version_environment_appId`) identifying the instance.
1527
- */
1528
- static getCommunicator(key: string): {
1529
- instance: Communicator;
1530
- } | undefined;
1531
- /**
1532
- * Posts a command to the Metabox iframe.
1533
- * @param command - An action command containing data to send.
1534
- */
1535
- sendCommandToMetabox<T extends CommandBase>(command: T): void;
1536
- /**
1537
- * A superseding `integrateMetabox` call removes the iframe this handle was
1538
- * built for. Commands then fall through to whatever now holds the contract id,
1539
- * addressed by the origin pinned for the *old* integration — so if the new one
1540
- * points at a different origin, the browser drops them without a word. The
1541
- * handle is stale at that point and should be replaced by the one from the new
1542
- * integration; say so rather than letting it fail quietly.
1543
- */
1544
- private reportStaleFrame;
1545
- /**
1546
- * `targetOrigin` for the iframe. The very first command is `metaboxConfig`,
1547
- * which carries `hostUrl: location.href` — on a shop page that routinely holds
1548
- * order ids and session parameters — so it must not be broadcast to whatever
1549
- * document currently occupies the frame.
1550
- *
1551
- * Falls back to a wildcard rather than refusing to send: this leg carries
1552
- * commands, and a configurator that silently stops responding on a customer
1553
- * site is worse than the status quo. The fallback is reported once so it does
1554
- * not pass unnoticed.
1555
- */
1556
- private resolveTarget;
1557
- /**
1558
- * Registers an event listener for messages dispatched by the Metabox.
1559
- * @param messageType - The event name to listen for (e.g. `'configuratorDataUpdated'`).
1560
- * @param callback - Handler invoked with the typed payload when the event fires.
1561
- * @override
1562
- */
1563
- addEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
1564
- /**
1565
- * Dispatches a typed event to all registered listeners.
1566
- * @param messageType - The event name to dispatch.
1567
- * @param data - The payload to pass to each listener.
1568
- * @override
1569
- */
1570
- dispatchEvent<T extends FromMetaBoxApiEvents>(messageType: T, data: FromMetaboxMessagePayloads[T]): this;
1571
- /**
1572
- * Removes a previously registered event listener.
1573
- * @param messageType - The event name the listener was registered for.
1574
- * @param callback - The same function reference that was passed to {@link addEventListener}.
1575
- * @override
1576
- */
1577
- removeEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
1578
- /**
1579
- * Filters and dispatches incoming messages from the Metabox.
1580
- * @param event - The postMessage event received on a window.
1581
- */
1582
- private handleMessageReceived;
1470
+ export declare class Communicator extends EventDispatcher {
1471
+ /**
1472
+ * Bound handler for incoming postMessage events.
1473
+ */
1474
+ private binder;
1475
+ /** Which side of the iframe boundary this instance runs on — see `acceptsMessageFrom`. */
1476
+ private readonly environment;
1477
+ /** The iframe we drive, when the integration created it. */
1478
+ private readonly iframe;
1479
+ /** Pinned configurator origin; `null` until we learn it. */
1480
+ private readonly targetOrigin;
1481
+ /** Keeps the "rejected an inbound message" warning to one per instance. */
1482
+ private senderRejectionReported;
1483
+ /** Keeps the "unknown configurator origin" warning to one per instance. */
1484
+ private wildcardTargetReported;
1485
+ /** Keeps the "our iframe left the document" warning to one per instance. */
1486
+ private staleFrameReported;
1487
+ /**
1488
+ * Constructs a Communicator, replacing any existing instance, and begins listening for messages.
1489
+ * @internal
1490
+ */
1491
+ constructor(data: MCAppLoaded['payload'], environment: MetaboxEnvironment, config?: Partial<MetaboxCommandConfig>, connection?: CommunicatorConnection);
1492
+ /**
1493
+ * Listens for Metabox to signal readiness, then initializes communicator.
1494
+ * @param apiReadyCallback - Called with the new Communicator once the Metabox is loaded.
1495
+ * @param {MetaboxEnvironment} environment - The environment in which the Communicator is running.
1496
+ * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
1497
+ * @param {CommunicatorConnection} connection - the iframe and origin `integrateMetabox`
1498
+ * built, so the handshake can be attributed and later messages addressed precisely.
1499
+ * Omitted by hand-rolled embeds, which are then identified through the
1500
+ * `embeddedContent` id and the handshake's own origin.
1501
+ * @returns A cancel function that removes the handshake `message` listener.
1502
+ * `integrateMetabox` (the public entry point) calls this automatically when
1503
+ * a new integration supersedes a still-pending one, so direct internal
1504
+ * callers only need it for explicit early teardown. Idempotent.
1505
+ */
1506
+ static createInstance(apiReadyCallback: (api: Communicator) => void, environment: MetaboxEnvironment, config?: Partial<MetaboxCommandConfig>, connection?: CommunicatorConnection): () => void;
1507
+ /**
1508
+ * The origin to address the configurator by, decided once from the handshake.
1509
+ *
1510
+ * Prefers what `integrateMetabox` computed from the iframe URL, but yields to
1511
+ * the origin the handshake actually came from when the two disagree: a redirect
1512
+ * (a `config.domain` override pointing at a host that 30x's elsewhere) would
1513
+ * otherwise pin an origin nothing answers on, and every command would be
1514
+ * dropped silently. The sender already passed the window gate, so this cannot
1515
+ * be steered by an unrelated page.
1516
+ */
1517
+ private static resolveHandshakeOrigin;
1518
+ /**
1519
+ * Cleans up resources and stops listening for messages.
1520
+ */
1521
+ destroy(key: string): void;
1522
+ /** Destroys all active Communicator instances and clears the internal registry. */
1523
+ static clearAll(): void;
1524
+ /**
1525
+ * Retrieves a registered Communicator instance by its key.
1526
+ * @param key - The composite key (`version_environment_appId`) identifying the instance.
1527
+ */
1528
+ static getCommunicator(key: string): {
1529
+ instance: Communicator;
1530
+ } | undefined;
1531
+ /**
1532
+ * Posts a command to the Metabox iframe.
1533
+ * @param command - An action command containing data to send.
1534
+ */
1535
+ sendCommandToMetabox<T extends CommandBase>(command: T): void;
1536
+ /**
1537
+ * A superseding `integrateMetabox` call removes the iframe this handle was
1538
+ * built for. Commands then fall through to whatever now holds the contract id,
1539
+ * addressed by the origin pinned for the *old* integration — so if the new one
1540
+ * points at a different origin, the browser drops them without a word. The
1541
+ * handle is stale at that point and should be replaced by the one from the new
1542
+ * integration; say so rather than letting it fail quietly.
1543
+ */
1544
+ private reportStaleFrame;
1545
+ /**
1546
+ * `targetOrigin` for the iframe. The very first command is `metaboxConfig`,
1547
+ * which carries `hostUrl: location.href` — on a shop page that routinely holds
1548
+ * order ids and session parameters — so it must not be broadcast to whatever
1549
+ * document currently occupies the frame.
1550
+ *
1551
+ * Falls back to a wildcard rather than refusing to send: this leg carries
1552
+ * commands, and a configurator that silently stops responding on a customer
1553
+ * site is worse than the status quo. The fallback is reported once so it does
1554
+ * not pass unnoticed.
1555
+ */
1556
+ private resolveTarget;
1557
+ /**
1558
+ * Registers an event listener for messages dispatched by the Metabox.
1559
+ * @param messageType - The event name to listen for (e.g. `'configuratorDataUpdated'`).
1560
+ * @param callback - Handler invoked with the typed payload when the event fires.
1561
+ * @override
1562
+ */
1563
+ addEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
1564
+ /**
1565
+ * Dispatches a typed event to all registered listeners.
1566
+ * @param messageType - The event name to dispatch.
1567
+ * @param data - The payload to pass to each listener.
1568
+ * @override
1569
+ */
1570
+ dispatchEvent<T extends FromMetaBoxApiEvents>(messageType: T, data: FromMetaboxMessagePayloads[T]): this;
1571
+ /**
1572
+ * Removes a previously registered event listener.
1573
+ * @param messageType - The event name the listener was registered for.
1574
+ * @param callback - The same function reference that was passed to {@link addEventListener}.
1575
+ * @override
1576
+ */
1577
+ removeEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
1578
+ /**
1579
+ * Filters and dispatches incoming messages from the Metabox.
1580
+ * @param event - The postMessage event received on a window.
1581
+ */
1582
+ private handleMessageReceived;
1583
1583
  }
1584
-
1585
1584
  /**
1586
1585
  * Integrates the Metabox Modular Configurator into the page by injecting an iframe and
1587
1586
  * initializing a Communicator instance for host-to-iframe messaging.
@@ -1657,8 +1656,7 @@ declare class Communicator extends EventDispatcher {
1657
1656
  * },
1658
1657
  * );
1659
1658
  */
1660
- declare function integrateMetabox(configuratorId: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: IntegrateMetaboxConfig): () => void;
1661
-
1659
+ export declare function integrateMetabox(configuratorId: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: IntegrateMetaboxConfig): () => void;
1662
1660
  /**
1663
1661
  * Saves an image by triggering a download.
1664
1662
  *
@@ -1688,8 +1686,7 @@ declare function integrateMetabox(configuratorId: string, containerId: string, a
1688
1686
  * @param {string} imageUrl - The URL of the image to save.
1689
1687
  * @param {string} filename - The name of the file to save.
1690
1688
  */
1691
- declare function saveImage(imageUrl: string, filename: string): void;
1692
-
1689
+ export declare function saveImage(imageUrl: string, filename: string): void;
1693
1690
  /**
1694
1691
  * Constructs the iframe source URL for the Metabox Modular Configurator.
1695
1692
  *
@@ -1712,8 +1709,7 @@ declare function saveImage(imageUrl: string, filename: string): void;
1712
1709
  * @param {string} configuratorId - An string identifier for the configurator.
1713
1710
  * @param {IntegrateMetaboxConfig} config - An object containing the configuration options.
1714
1711
  */
1715
- declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetaboxConfig) => string;
1716
-
1712
+ export declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetaboxConfig) => string;
1717
1713
  /**
1718
1714
  * Wrapper helper function to use with RxJS the same way as `fromEvent`, to listen to events from the Communicator.
1719
1715
  *
@@ -1734,8 +1730,7 @@ declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetab
1734
1730
  * @returns An Observable that emits the typed payload each time the event fires.
1735
1731
  * @internal
1736
1732
  */
1737
- declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
1738
-
1733
+ export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
1739
1734
  /**
1740
1735
  * Represents a command to send Metabox Config to Metabox Modular Configurator.
1741
1736
  *
@@ -1758,10 +1753,9 @@ declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: C
1758
1753
  * @param {string} appId - The unique identifier for the Communicator Instance
1759
1754
  * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
1760
1755
  */
1761
- declare class MetaboxConfig extends CommandBase {
1762
- constructor(appId: string, config: MetaboxCommandConfig);
1756
+ export declare class MetaboxConfig extends CommandBase {
1757
+ constructor(appId: string, config: MetaboxCommandConfig);
1763
1758
  }
1764
-
1765
1759
  /**
1766
1760
  * Represents a command to get a PDF from Metabox Modular Configurator.
1767
1761
  * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
@@ -1808,10 +1802,9 @@ declare class MetaboxConfig extends CommandBase {
1808
1802
  * api.sendCommandToMetabox(new GetPdf());
1809
1803
  * };
1810
1804
  */
1811
- declare class GetPdf extends CommandBase {
1812
- constructor();
1805
+ export declare class GetPdf extends CommandBase {
1806
+ constructor();
1813
1807
  }
1814
-
1815
1808
  /**
1816
1809
  * Represents a command to get a Call To Action Information from Metabox Modular Configurator.
1817
1810
  * This class sends a message to the Metabox API to generate Call To Action information based on the current
@@ -1853,10 +1846,9 @@ declare class GetPdf extends CommandBase {
1853
1846
  * api.sendCommandToMetabox(new GetCallToActionInformation());
1854
1847
  * };
1855
1848
  */
1856
- declare class GetCallToActionInformation extends CommandBase {
1857
- constructor();
1849
+ export declare class GetCallToActionInformation extends CommandBase {
1850
+ constructor();
1858
1851
  }
1859
-
1860
1852
  /**
1861
1853
  * Represents a command to get the camera configuration from Unreal.
1862
1854
  * This class sends a message to the Metabox API to get the camera from a scene.
@@ -1887,10 +1879,9 @@ declare class GetCallToActionInformation extends CommandBase {
1887
1879
  * api.sendCommandToMetabox(new GetCamera());
1888
1880
  * };
1889
1881
  */
1890
- declare class GetCamera extends CommandBase {
1891
- constructor();
1882
+ export declare class GetCamera extends CommandBase {
1883
+ constructor();
1892
1884
  }
1893
-
1894
1885
  /**
1895
1886
  * Represents a command to set the camera configuration.
1896
1887
  * This class sends a message to the Metabox API to set the camera on a scene.
@@ -1932,10 +1923,9 @@ declare class GetCamera extends CommandBase {
1932
1923
  *
1933
1924
  * @param {CameraCommandPayload} camera - The camera configuration.
1934
1925
  */
1935
- declare class SetCamera extends CommandBase {
1936
- constructor(camera: CameraCommandPayload);
1926
+ export declare class SetCamera extends CommandBase {
1927
+ constructor(camera: CameraCommandPayload);
1937
1928
  }
1938
-
1939
1929
  /**
1940
1930
  * Represents a command to reset the camera to its initial position.
1941
1931
  * This class sends a message to the Metabox API to reset the camera on a scene.
@@ -1957,10 +1947,9 @@ declare class SetCamera extends CommandBase {
1957
1947
  * api.sendCommandToMetabox(new ResetCamera());
1958
1948
  * };
1959
1949
  */
1960
- declare class ResetCamera extends CommandBase {
1961
- constructor();
1950
+ export declare class ResetCamera extends CommandBase {
1951
+ constructor();
1962
1952
  }
1963
-
1964
1953
  /**
1965
1954
  * Represents a command to reset the modular configurator state to its defaults.
1966
1955
  * This class sends a message to the Metabox API to restore the component tree, component materials,
@@ -2000,10 +1989,9 @@ declare class ResetCamera extends CommandBase {
2000
1989
  * api.sendCommandToMetabox(new ResetConfiguration());
2001
1990
  * };
2002
1991
  */
2003
- declare class ResetConfiguration extends CommandBase {
2004
- constructor();
1992
+ export declare class ResetConfiguration extends CommandBase {
1993
+ constructor();
2005
1994
  }
2006
-
2007
1995
  /**
2008
1996
  * Represents a command to apply zoom and change the camera zoom on a scene.
2009
1997
  * This class sends a command to the Metabox API to change zoom on a scene.
@@ -2029,10 +2017,9 @@ declare class ResetConfiguration extends CommandBase {
2029
2017
  *
2030
2018
  * @param {number} zoom - The zoom value to apply.
2031
2019
  */
2032
- declare class ApplyZoom extends CommandBase {
2033
- constructor(zoom: number);
2020
+ export declare class ApplyZoom extends CommandBase {
2021
+ constructor(zoom: number);
2034
2022
  }
2035
-
2036
2023
  /**
2037
2024
  * Represents a command to initialize Showcase for a component scene and start a sequence for the component.
2038
2025
  * This class sends a command to the Metabox API to initialize showcase if the component has a sequence.
@@ -2063,10 +2050,9 @@ declare class ApplyZoom extends CommandBase {
2063
2050
  * api.sendCommandToMetabox(new InitShowcase());
2064
2051
  * };
2065
2052
  */
2066
- declare class InitShowcase extends CommandBase {
2067
- constructor();
2053
+ export declare class InitShowcase extends CommandBase {
2054
+ constructor();
2068
2055
  }
2069
-
2070
2056
  /**
2071
2057
  * Represents a command to play Showcase for a component when it is already initialized and paused.
2072
2058
  * This class sends a command to the Metabox API to play showcase for a component if it is already initialized and paused.
@@ -2096,19 +2082,17 @@ declare class InitShowcase extends CommandBase {
2096
2082
  * api.sendCommandToMetabox(new PlayShowcase());
2097
2083
  * };
2098
2084
  */
2099
- declare class PlayShowcase extends CommandBase {
2100
- constructor();
2085
+ export declare class PlayShowcase extends CommandBase {
2086
+ constructor();
2101
2087
  }
2102
-
2103
2088
  /**
2104
2089
  * @internal
2105
2090
  * @hidden
2106
2091
  * Represents a command to send Unreal command.
2107
2092
  */
2108
- declare class UnrealCommand extends CommandBase {
2109
- constructor(payload: object);
2093
+ export declare class UnrealCommand extends CommandBase {
2094
+ constructor(payload: object);
2110
2095
  }
2111
-
2112
2096
  /**
2113
2097
  * Represents a command to pause Showcase for a component when it is already initialized and playing.
2114
2098
  * This class sends a command to the Metabox API to pause showcase for a component if it is already initialized and playing.
@@ -2138,10 +2122,9 @@ declare class UnrealCommand extends CommandBase {
2138
2122
  * api.sendCommandToMetabox(new PauseShowcase());
2139
2123
  * };
2140
2124
  */
2141
- declare class PauseShowcase extends CommandBase {
2142
- constructor();
2125
+ export declare class PauseShowcase extends CommandBase {
2126
+ constructor();
2143
2127
  }
2144
-
2145
2128
  /**
2146
2129
  * Represents a command to stop Showcase for a component when it is already initialized, and you want to destroy it.
2147
2130
  * This class sends a command to the Metabox API to stop showcase for a component if it is already initialized.
@@ -2172,10 +2155,9 @@ declare class PauseShowcase extends CommandBase {
2172
2155
  * api.sendCommandToMetabox(new StopShowcase());
2173
2156
  * };
2174
2157
  */
2175
- declare class StopShowcase extends CommandBase {
2176
- constructor();
2158
+ export declare class StopShowcase extends CommandBase {
2159
+ constructor();
2177
2160
  }
2178
-
2179
2161
  /**
2180
2162
  * Image format.
2181
2163
  * This type represents the allowed image formats.
@@ -2230,13 +2212,12 @@ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
2230
2212
  * @param {MimeType} mimeType - The output format.
2231
2213
  * @param {{ x: number; y: number }} [size] - Optional size in pixels.
2232
2214
  */
2233
- declare class GetScreenshot extends CommandBase {
2234
- constructor(mimeType: MimeType, size?: {
2235
- x: number;
2236
- y: number;
2237
- });
2215
+ export declare class GetScreenshot extends CommandBase {
2216
+ constructor(mimeType: MimeType, size?: {
2217
+ x: number;
2218
+ y: number;
2219
+ });
2238
2220
  }
2239
-
2240
2221
  /**
2241
2222
  * Represents a command to set a component by its data (ID, typeId).
2242
2223
  * This action sends a message to the Metabox API to set a component using the provided data.
@@ -2273,10 +2254,9 @@ declare class GetScreenshot extends CommandBase {
2273
2254
  * @param {string} id - The component ID.
2274
2255
  * @param {string} typeId - The component type ID.
2275
2256
  */
2276
- declare class SetComponent extends CommandBase {
2277
- constructor(id: string, typeId: string);
2257
+ export declare class SetComponent extends CommandBase {
2258
+ constructor(id: string, typeId: string);
2278
2259
  }
2279
-
2280
2260
  /**
2281
2261
  * Represents a command to set component material by its slot ID and Material ID.
2282
2262
  * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
@@ -2314,10 +2294,9 @@ declare class SetComponent extends CommandBase {
2314
2294
  * @param {string} slotId - The slot ID.
2315
2295
  * @param {string} materialId - The material ID.
2316
2296
  */
2317
- declare class SetComponentMaterial extends CommandBase {
2318
- constructor(componentId: string, slotId: string, materialId: string);
2297
+ export declare class SetComponentMaterial extends CommandBase {
2298
+ constructor(componentId: string, slotId: string, materialId: string);
2319
2299
  }
2320
-
2321
2300
  /**
2322
2301
  * Represents a command to set the environment by its ID.
2323
2302
  * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
@@ -2348,10 +2327,9 @@ declare class SetComponentMaterial extends CommandBase {
2348
2327
  *
2349
2328
  * @param {string} environmentId - The environment ID.
2350
2329
  */
2351
- declare class SetEnvironment extends CommandBase {
2352
- constructor(environmentId: string);
2330
+ export declare class SetEnvironment extends CommandBase {
2331
+ constructor(environmentId: string);
2353
2332
  }
2354
-
2355
2333
  /**
2356
2334
  * Represents a command to set an environment material by its slot ID and Material ID.
2357
2335
  * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
@@ -2387,10 +2365,9 @@ declare class SetEnvironment extends CommandBase {
2387
2365
  * @param {string} slotId - The slot ID.
2388
2366
  * @param {string} materialId - The material ID.
2389
2367
  */
2390
- declare class SetEnvironmentMaterial extends CommandBase {
2391
- constructor(slotId: string, materialId: string);
2368
+ export declare class SetEnvironmentMaterial extends CommandBase {
2369
+ constructor(slotId: string, materialId: string);
2392
2370
  }
2393
-
2394
2371
  /**
2395
2372
  * A single material command accepted inside a {@link SetMaterials} batch.
2396
2373
  *
@@ -2446,10 +2423,9 @@ type MaterialCommand = SetComponentMaterial | SetEnvironmentMaterial;
2446
2423
  *
2447
2424
  * @param {MaterialCommand[]} commands - The material commands to apply, in order.
2448
2425
  */
2449
- declare class SetMaterials extends CommandBase {
2450
- constructor(commands: MaterialCommand[]);
2426
+ export declare class SetMaterials extends CommandBase {
2427
+ constructor(commands: MaterialCommand[]);
2451
2428
  }
2452
-
2453
2429
  /**
2454
2430
  * Represents a command to toggle the embedded Metabox menu.
2455
2431
  * This command can only be used when using the metabox menu.
@@ -2475,10 +2451,9 @@ declare class SetMaterials extends CommandBase {
2475
2451
  *
2476
2452
  * @param {boolean} visible - A flag indicating whether the embedded menu should be visible.
2477
2453
  */
2478
- declare class ShowEmbeddedMenu extends CommandBase {
2479
- constructor(visible: boolean);
2454
+ export declare class ShowEmbeddedMenu extends CommandBase {
2455
+ constructor(visible: boolean);
2480
2456
  }
2481
-
2482
2457
  /**
2483
2458
  * Represents a command to toggle the Unreal Overlay Interface Menu.
2484
2459
  * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.
@@ -2504,10 +2479,9 @@ declare class ShowEmbeddedMenu extends CommandBase {
2504
2479
  *
2505
2480
  * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.
2506
2481
  */
2507
- declare class ShowOverlayInterface extends CommandBase {
2508
- constructor(visible: boolean);
2482
+ export declare class ShowOverlayInterface extends CommandBase {
2483
+ constructor(visible: boolean);
2509
2484
  }
2510
-
2511
2485
  /**
2512
2486
  * Represents a command to show measurement for a product when it is already loaded.
2513
2487
  * This class sends a command to the Metabox API to show measurement for a product if it is already initialized.
@@ -2529,10 +2503,9 @@ declare class ShowOverlayInterface extends CommandBase {
2529
2503
  * api.sendCommandToMetabox(new ShowMeasurement());
2530
2504
  * };
2531
2505
  */
2532
- declare class ShowMeasurement extends CommandBase {
2533
- constructor();
2506
+ export declare class ShowMeasurement extends CommandBase {
2507
+ constructor();
2534
2508
  }
2535
-
2536
2509
  /**
2537
2510
  * Represents a command to hide measurement for a product when it is already loaded.
2538
2511
  * This class sends a command to the Metabox API to hide measurement for a product if it is already initialized.
@@ -2554,10 +2527,9 @@ declare class ShowMeasurement extends CommandBase {
2554
2527
  * api.sendCommandToMetabox(new HideMeasurement());
2555
2528
  * };
2556
2529
  */
2557
- declare class HideMeasurement extends CommandBase {
2558
- constructor();
2530
+ export declare class HideMeasurement extends CommandBase {
2531
+ constructor();
2559
2532
  }
2560
-
2561
2533
  /**
2562
2534
  * Represents a command to resume the pixel streaming session.
2563
2535
  * This class sends a message to the Metabox API to resume a paused or disconnected stream.
@@ -2579,10 +2551,9 @@ declare class HideMeasurement extends CommandBase {
2579
2551
  * api.sendCommandToMetabox(new ResumeStream());
2580
2552
  * };
2581
2553
  */
2582
- declare class ResumeStream extends CommandBase {
2583
- constructor();
2554
+ export declare class ResumeStream extends CommandBase {
2555
+ constructor();
2584
2556
  }
2585
-
2586
2557
  /**
2587
2558
  * Represents a command to stop the pixel streaming session.
2588
2559
  * This class sends a message to the Metabox API to stop the active stream and release its resources.
@@ -2605,10 +2576,9 @@ declare class ResumeStream extends CommandBase {
2605
2576
  * api.sendCommandToMetabox(new StopStream());
2606
2577
  * };
2607
2578
  */
2608
- declare class StopStream extends CommandBase {
2609
- constructor();
2579
+ export declare class StopStream extends CommandBase {
2580
+ constructor();
2610
2581
  }
2611
-
2612
2582
  /**
2613
2583
  * Represents a command to reset the user inactivity (AFK) timer.
2614
2584
  * This class sends a message to the Metabox API to restart the inactivity countdown,
@@ -2638,9 +2608,7 @@ declare class StopStream extends CommandBase {
2638
2608
  * });
2639
2609
  * };
2640
2610
  */
2641
- declare class ResetUserInactivityTimer extends CommandBase {
2642
- constructor();
2611
+ export declare class ResetUserInactivityTimer extends CommandBase {
2612
+ constructor();
2643
2613
  }
2644
-
2645
- export { AppLoaded, AppLoaded_V3, ApplyZoom, BasicRouteUrl, CommandBase, Communicator, EventDispatcher, GetCallToActionInformation, GetCamera, GetPdf, GetScreenshot, HideMeasurement, InitShowcase, Metabox, MetaboxConfig, MetaboxDomain, MetaboxHost, MetaboxHost_V3, MetaboxModularConfiguratorActions, Metabox_V3, PauseShowcase, PlayShowcase, ResetCamera, ResetConfiguration, ResetUserInactivityTimer, ResumeStream, SetCamera, SetComponent, SetComponentMaterial, SetEnvironment, SetEnvironmentMaterial, SetMaterials, ShowEmbeddedMenu, ShowMeasurement, ShowOverlayInterface, StopShowcase, StopStream, UnrealCommand, VERSION, fromCommunicatorEvent, integrateMetabox, prepareIframeSrc, saveImage };
2646
- export type { CameraCommandPayload, CommunicatorConnection, ComponentWithParent, Cta, CtaStatus, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxMessagePayloads, FromMetaboxTarget, InitialModularConfigurator, IntegrateMetaboxConfig, Listener, MCAppLoaded, Material, MaterialCommand, MaterialCommandEnvelope, MetaBoxApiEnvelope, MetaProperty, MetaboxCommandConfig, MetaboxEnvironment, MimeType, Model, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, PdfStatus, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Thumbnail, Timecode, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, ToMetaboxTarget, VideoResolution, VideoStats, VirtualSocket };
2614
+ export type { ComponentWithParent, Cta, CtaStatus, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxMessagePayloads, FromMetaboxTarget, InitialModularConfigurator, IntegrateMetaboxConfig, MCAppLoaded, Material, MaterialCommand, MetaBoxApiEnvelope, MetaProperty, MetaboxCommandConfig, MetaboxEnvironment, MimeType, Model, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, PdfStatus, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Thumbnail, Timecode, VideoResolution, VideoStats, VirtualSocket };