@3dsource/metabox-modular-configurator-api 3.0.36-dev.0 → 3.0.37

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-dev.0";
104
-
100
+ export declare const BasicRouteUrl = "metabox-configurator/modular";
101
+ export declare const VERSION = "3.0.37";
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-dev.0";
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,16 @@ 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;
438
434
  }
439
-
440
435
  /**
441
436
  * Represents a modular configurator envelope with an initial configurator, configuration tree,
442
437
  * all components by active component type, component selected materials, and associated environment.
@@ -459,20 +454,20 @@ interface ToMetaBoxMessage {
459
454
  * Rebuild affected UI sections on each update.
460
455
  */
461
456
  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;
457
+ /**
458
+ * Represents the modular configurator api with its components, component types, and environments
459
+ * */
460
+ configurator: InitialModularConfigurator;
461
+ /** The unique tree of components and parent and component type id */
462
+ configurationTree: ComponentWithParent[];
463
+ /** A record mapping all components by current component type */
464
+ componentsByComponentType: Record<string, string>;
465
+ /** A record mapping component material selection */
466
+ componentMaterialsIds: SelectedIds;
467
+ /** The unique environment identifier */
468
+ environmentId: string;
469
+ /** A record mapping environment material selections */
470
+ environmentMaterialsIds: SelectedIds;
476
471
  }
477
472
  /**
478
473
  * Represents the modular configurator API with its components, component types, and environments.
@@ -491,24 +486,24 @@ interface ModularConfiguratorEnvelope {
491
486
  * to build dynamic selection UIs. Only changes if the configurator definition is updated in MetaBox admin.
492
487
  */
493
488
  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';
489
+ /** Unique identifier for the configurator. */
490
+ id: string;
491
+ /** The name of the configurator. */
492
+ name: string;
493
+ /** A list of components for the configurator. */
494
+ components: ModularConfiguratorComponent[];
495
+ /** A list of available environments. */
496
+ environments: ModularConfiguratorEnvironment[];
497
+ /** A list of a component type for the configurator. */
498
+ componentTypes: ModularConfiguratorComponentType[];
499
+ /** Indicates if the configurator is active. */
500
+ isActive: boolean;
501
+ /** Indicates if the cta in ecom configurator is enabled or not. */
502
+ ctaEnabled: boolean;
503
+ /** A list of available connectors shows connections between all component types. */
504
+ connectors: ModularConfiguratorConnector[];
505
+ /** Represents object typename for the Modular Configurator. */
506
+ __typename: 'ModularConfigurator';
512
507
  }
513
508
  /**
514
509
  * Represents a configurator component within the modular configurator.
@@ -527,20 +522,20 @@ interface InitialModularConfigurator {
527
522
  * Use product.externalId for ERP/PIM lookups. Check virtualSocketToConnectorsMap for modular assembly validation.
528
523
  */
529
524
  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';
525
+ /** The id unique identifier. */
526
+ id: string;
527
+ /** The modular configurator component type identifier. */
528
+ componentType: ModularConfiguratorComponentType;
529
+ /** Display the name for the product. */
530
+ name: string;
531
+ /** Position index of the product. */
532
+ position: number;
533
+ /** The detailed product information. */
534
+ product: Product;
535
+ /** Connectors between connectors and virtual sockets. */
536
+ virtualSocketToConnectorsMap?: ModularConfiguratorVirtualSocketToConnector[];
537
+ /** Represents object typename for the component. */
538
+ __typename: 'ModularConfiguratorComponent';
544
539
  }
545
540
  /**
546
541
  * Represents a component type within the modular configurator.
@@ -559,18 +554,18 @@ interface ModularConfiguratorComponent {
559
554
  * The type.id is what you pass as typeId to SetComponent.
560
555
  */
561
556
  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';
557
+ /** Display the name for the component type. */
558
+ name: string;
559
+ /** Position index of the component type. */
560
+ position: number;
561
+ /** Is root current component type or not. */
562
+ isRoot: boolean;
563
+ /** Is required current component type or not. */
564
+ isRequired: boolean;
565
+ /** The id unique identifier. */
566
+ id: string;
567
+ /** Represents object typename for the component type. */
568
+ __typename: 'ModularConfiguratorComponentType';
574
569
  }
575
570
  /**
576
571
  * Represents the mapping between virtual sockets and connectors in the modular configurator.
@@ -589,10 +584,10 @@ interface ModularConfiguratorComponentType {
589
584
  * compatible socket. Prevents invalid configurations.
590
585
  */
591
586
  interface ModularConfiguratorVirtualSocketToConnector {
592
- virtualSocketId: string;
593
- connectorId: string;
594
- /** Represents object typename for the virtual map socket. */
595
- __typename: 'ModularConfiguratorVirtualSocketToConnector';
587
+ virtualSocketId: string;
588
+ connectorId: string;
589
+ /** Represents object typename for the virtual map socket. */
590
+ __typename: 'ModularConfiguratorVirtualSocketToConnector';
596
591
  }
597
592
  /**
598
593
  * Represents a connector in the modular configurator.
@@ -612,11 +607,11 @@ interface ModularConfiguratorVirtualSocketToConnector {
612
607
  * sending SetComponent commands in custom builder UIs.
613
608
  */
614
609
  interface ModularConfiguratorConnector {
615
- id: string;
616
- componentTypeId1: string;
617
- componentTypeId2: string;
618
- /** Represents object typename for connector. */
619
- __typename: 'ModularConfiguratorConnector';
610
+ id: string;
611
+ componentTypeId1: string;
612
+ componentTypeId2: string;
613
+ /** Represents object typename for connector. */
614
+ __typename: 'ModularConfiguratorConnector';
620
615
  }
621
616
  /**
622
617
  * Represents product details including visual assets and configuration.
@@ -635,30 +630,30 @@ interface ModularConfiguratorConnector {
635
630
  * underlying 3D asset the component renders in the Unreal viewport.
636
631
  */
637
632
  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';
633
+ /** The title of the product. */
634
+ title: string;
635
+ /** List of thumbnails for the product. */
636
+ thumbnailList: Thumbnail[];
637
+ /** Available slots for the product. */
638
+ slots: Slot[];
639
+ /** List of metaProperties for the product. */
640
+ metaProperties: MetaProperty[];
641
+ /** List of virtualSockets for the product. */
642
+ virtualSockets: VirtualSocket[];
643
+ /**
644
+ * @internal
645
+ * @hidden
646
+ * The model information associated with the product.
647
+ */
648
+ model: Model;
649
+ /** Unique identifier for the product. */
650
+ id: string;
651
+ /** Unique external id for the product. */
652
+ externalId: string;
653
+ /** Showcase details for the product. */
654
+ showcase?: Showcase;
655
+ /** Represents object typename for the product. */
656
+ __typename: 'Product';
662
657
  }
663
658
  /**
664
659
  * Represents a virtual socket on a product used for modular assembly connections.
@@ -678,12 +673,12 @@ interface Product {
678
673
  * by UI code.
679
674
  */
680
675
  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[];
676
+ /** Unique identifier for the virtual socket. */
677
+ id: string;
678
+ /** Display name of the virtual socket. */
679
+ name: string;
680
+ /** List of original socket identifiers on the 3D model that this virtual socket maps to. */
681
+ originalSockets: string[];
687
682
  }
688
683
  /**
689
684
  * @internal
@@ -705,16 +700,16 @@ interface VirtualSocket {
705
700
  * for business-logic lookups (pricing, inventory) rather than model paths.
706
701
  */
707
702
  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';
703
+ /** Unique identifier for the model. */
704
+ id: string;
705
+ /** Unreal Engine asset path used to locate the model within the project. */
706
+ assetPath: string;
707
+ /** Path to the .pak file containing the packaged model asset. */
708
+ pakFilePath: string;
709
+ /** Unreal Engine version the model asset was built for. */
710
+ unrealVersion: string;
711
+ /** Represents object typename for the model. */
712
+ __typename: 'Model';
718
713
  }
719
714
  /**
720
715
  * Represents a thumbnail image entity with dimensions and URL path.
@@ -732,14 +727,14 @@ interface Model {
732
727
  * visible category.
733
728
  */
734
729
  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';
730
+ /** Width of the thumbnail. */
731
+ width: number;
732
+ /** Height of the thumbnail. */
733
+ height: number;
734
+ /** URL path to the thumbnail image. */
735
+ urlPath: string;
736
+ /** Represents object typename (as a string, flexible type). */
737
+ __typename: 'Thumbnail';
743
738
  }
744
739
  /**
745
740
  * Represents a slot within a product that may allow material customization.
@@ -758,14 +753,14 @@ interface Thumbnail {
758
753
  * the swatch picker for that specific surface.
759
754
  */
760
755
  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';
756
+ /** Unique identifier for the slot. */
757
+ id: string;
758
+ /** Display a label for the slot. */
759
+ label: string;
760
+ /** A list of enabled materials for the slot. */
761
+ enabledMaterials: Material[];
762
+ /** Represents object typename for the slot. */
763
+ __typename: 'Slot';
769
764
  }
770
765
  /**
771
766
  * Represents a metaProperty within a product that may allow business logic customization.
@@ -783,16 +778,16 @@ interface Slot {
783
778
  * content teams in MetaBox admin.
784
779
  */
785
780
  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';
781
+ /** Unique identifier for the metaProperty. */
782
+ id: string;
783
+ /** Display the name for the metaProperty. */
784
+ name: string;
785
+ /** Value for the metaProperty. */
786
+ value: string;
787
+ /** Type for the metaProperty. */
788
+ type: string;
789
+ /** Represents object typename for the metaProperty. */
790
+ __typename: 'MetaProperty';
796
791
  }
797
792
  /**
798
793
  * Represents a material that can be applied to a product slot.
@@ -811,22 +806,22 @@ interface MetaProperty {
811
806
  * Pass material.id to SetComponentMaterial or SetEnvironmentMaterial.
812
807
  */
813
808
  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';
809
+ /** Unique identifier for the material. */
810
+ id: string;
811
+ /** Title or name of the material. */
812
+ title: string;
813
+ /** Unique external id for the material. */
814
+ externalId: string;
815
+ /** List of thumbnails for the material. */
816
+ thumbnailList: Thumbnail[];
817
+ /**
818
+ * @internal
819
+ * @hidden
820
+ * The model information associated with the material.
821
+ */
822
+ model: Model;
823
+ /** Represents object typename for the material. */
824
+ __typename: 'Material';
830
825
  }
831
826
  /**
832
827
  * Details showcase the presentation of a product.
@@ -845,12 +840,12 @@ interface Material {
845
840
  * Playback sequence: InitShowcase → PlayShowcase → monitor via showcaseStatusChanged.
846
841
  */
847
842
  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';
843
+ /** A list of low-bandwidth versions for the showcase (optional). */
844
+ lowBandwidth?: (Timecode | null)[] | null;
845
+ /** Duration for the showcase (optional). */
846
+ duration?: number;
847
+ /** Represents object typename for the showcase. */
848
+ __typename: 'Showcase';
854
849
  }
855
850
  /**
856
851
  * Represents a low-bandwidth entity used in showcases in LBM mode.
@@ -869,12 +864,12 @@ interface Showcase {
869
864
  * for product demo presentations.
870
865
  */
871
866
  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';
867
+ /** Time marker for the entity. */
868
+ time: number;
869
+ /** Duration of the entity display. */
870
+ duration: number;
871
+ /** Represents object typename (as a string, flexible type). */
872
+ __typename: 'Timecode';
878
873
  }
879
874
  /**
880
875
  * Represents the environment settings for a modular configurator.
@@ -893,16 +888,16 @@ interface Timecode {
893
888
  * List available slots for environment material customization.
894
889
  */
895
890
  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';
891
+ /** Unique identifier for the environment. */
892
+ environmentId: string;
893
+ /** Position index of the environment. */
894
+ position: number;
895
+ /** Display label for the environment. */
896
+ label: string;
897
+ /** Detailed environment configuration. */
898
+ environment: Environment;
899
+ /** Represents object typename for the environment. */
900
+ __typename: 'ModularConfiguratorEnvironment';
906
901
  }
907
902
  /**
908
903
  * Represents an environment with associated media and configuration.
@@ -921,28 +916,28 @@ interface ModularConfiguratorEnvironment {
921
916
  * Iterate slots array to build environment material pickers.
922
917
  */
923
918
  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';
919
+ /** Unique identifier for the environment. */
920
+ id: string;
921
+ /** Title or name of the environment. */
922
+ title: string;
923
+ /** Flag indicating if UDS is enabled. */
924
+ udsEnabled: boolean;
925
+ /** The north yaw of the sun in the environment. */
926
+ sunNorthYaw: number;
927
+ /** The UDS hour setting for the environment. */
928
+ udsHour: number;
929
+ /** List of thumbnails for the environment (optional). */
930
+ thumbnailList: Thumbnail[];
931
+ /** List of slots for the environment (optional). */
932
+ slots: Slot[];
933
+ /**
934
+ * @internal
935
+ * @hidden
936
+ * The model information associated with the environment.
937
+ */
938
+ model: Model;
939
+ /** Represents object typename for the environment. */
940
+ __typename: 'Environment';
946
941
  }
947
942
  /**
948
943
  * Defines the structure for a component tree where every component has id and parent.
@@ -961,9 +956,9 @@ interface Environment {
961
956
  * The root component will have no parent reference (parentId is null).
962
957
  */
963
958
  interface ComponentWithParent {
964
- id: string;
965
- componentTypeId: string;
966
- parentId: string | null;
959
+ id: string;
960
+ componentTypeId: string;
961
+ parentId: string | null;
967
962
  }
968
963
  /**
969
964
  * Defines the structure for a mapping of selected materials.
@@ -1013,8 +1008,8 @@ type ShowCaseStatus = 'init' | 'play' | 'pause' | 'stop';
1013
1008
  * overlay positioning, inform users about stream quality, or scale screenshot size requests proportionally.
1014
1009
  */
1015
1010
  interface VideoResolution {
1016
- width: number | null;
1017
- height: number | null;
1011
+ width: number | null;
1012
+ height: number | null;
1018
1013
  }
1019
1014
  /**
1020
1015
  * Video stream statistics reported by the Metabox player.
@@ -1032,26 +1027,25 @@ interface VideoResolution {
1032
1027
  * Subscribe via `api.addEventListener('videoStatsUpdated', (stats: VideoStats) => {...})`.
1033
1028
  */
1034
1029
  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;
1030
+ /** Video encoder quantization parameter (lower = better quality). */
1031
+ qp?: number;
1032
+ /** Current bitrate in bits per second. */
1033
+ bitrate?: number;
1034
+ /** Decoded frames per second. */
1035
+ framesPerSecond?: number;
1036
+ /** Inter-arrival jitter in seconds. */
1037
+ jitter?: number;
1038
+ /** Current round-trip time in seconds. */
1039
+ rtt?: number;
1040
+ /** The total number of frames successfully decoded. */
1041
+ framesDecoded?: number;
1042
+ /** The total number of frames dropped. */
1043
+ framesDropped?: number;
1044
+ /** Total number of frames received. */
1045
+ framesReceived?: number;
1046
+ /** Total number of packets lost. */
1047
+ packetsLost?: number;
1053
1048
  }
1054
-
1055
1049
  /**
1056
1050
  * Represents an ecom configurator object with all necessary information about cta.
1057
1051
  *
@@ -1068,14 +1062,14 @@ interface VideoStats {
1068
1062
  * configuration data when CTA is triggered.
1069
1063
  */
1070
1064
  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';
1065
+ /** The unique ecom configurator identifier. */
1066
+ id: string;
1067
+ /** The created data of ecom configurator. */
1068
+ createdAt: string;
1069
+ /** A reference to the Call To Action Information. */
1070
+ cta?: Cta;
1071
+ /** Represents object typename for the ecom configurator. */
1072
+ __typename: 'Configurator';
1079
1073
  }
1080
1074
  /**
1081
1075
  * Represents the call-to-action information for an ecom configurator.
@@ -1094,16 +1088,15 @@ interface EcomConfigurator {
1094
1088
  * the config JSON to the callback URL. The backend returns `{ redirectUrl }`.
1095
1089
  */
1096
1090
  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';
1091
+ /** The indicator of whether the call-to-action is enabled or not. */
1092
+ enabled: boolean;
1093
+ /** Label of button for call-to-action. */
1094
+ label: string;
1095
+ /** Callback URL using for sent configurator selected information to this url and redirected to the url after get response. */
1096
+ callbackUrl: string;
1097
+ /** Represents object typename for the CTA object. */
1098
+ __typename: 'Cta';
1105
1099
  }
1106
-
1107
1100
  /**
1108
1101
  * Lifecycle of a {@link GetPdf} render.
1109
1102
  *
@@ -1168,76 +1161,81 @@ type CtaStatus = 'started' | 'ready' | 'failed';
1168
1161
  * viewportReady→boolean, showcaseStatusChanged→ShowCaseStatus.
1169
1162
  */
1170
1163
  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
- };
1164
+ /**
1165
+ * Dispatches every time the configurator data is updated.
1166
+ * I.e., when the user changes the configuration. (Material, Component Tree, Components, Component Type, Environment)
1167
+ */
1168
+ configuratorDataUpdated: ModularConfiguratorEnvelope;
1169
+ /**
1170
+ * Dispatches every time the ecom configurator data is updated (label, endpointUrl).
1171
+ */
1172
+ ecomConfiguratorDataUpdated: EcomConfigurator;
1173
+ /**
1174
+ * Dispatches every time when the Unreal Viewport is visible/hidden.
1175
+ */
1176
+ viewportReady: boolean;
1177
+ /**
1178
+ * Dispatches every time when while the configurator loads. Shows showcase status information on a scene.
1179
+ */
1180
+ showcaseStatusChanged: ShowCaseStatus;
1181
+ /**
1182
+ * Dispatches at the moment while the configurator loads. Shows status information.
1183
+ */
1184
+ statusMessageChanged: string | null;
1185
+ /**
1186
+ * Dispatches every time when Unreal is sending an ordered render with a new GetScreenshot() command.
1187
+ */
1188
+ screenshotReady: string | null;
1189
+ /**
1190
+ * Dispatches as a GetPdf() render starts, finishes or fails. The document is
1191
+ * delivered by the browser download either way; this only reports progress.
1192
+ */
1193
+ pdfStatusChanged: PdfStatus;
1194
+ /**
1195
+ * Dispatches as a GetCallToActionInformation() workflow starts, completes or
1196
+ * fails. MetaBox handles the redirect itself; this only reports progress.
1197
+ */
1198
+ ctaStatusChanged: CtaStatus;
1199
+ /**
1200
+ * Dispatches every time when Unreal is changing its video stream size.
1201
+ */
1202
+ videoResolutionChanged: VideoResolution;
1203
+ /**
1204
+ * Dispatches every time when the User sends get camera command new GetCamera() command.
1205
+ */
1206
+ getCameraResult: CameraCommandPayload;
1207
+ /**
1208
+ * @deprecated
1209
+ * Dispatches every time when the configurator connected/disconnected with Unreal Engine.
1210
+ */
1211
+ dataChannelConnected: boolean;
1212
+ /**
1213
+ * Dispatches periodically with aggregated video stream statistics.
1214
+ */
1215
+ videoStatsUpdated: VideoStats;
1216
+ /**
1217
+ * Dispatches when the loading progress or loader visibility changes.
1218
+ * `percents` is the smoothed progress value (0–100).
1219
+ * `loaderVisible` indicates whether the loading overlay is currently shown.
1220
+ */
1221
+ loadingStatusChanged: {
1222
+ percents: number;
1223
+ loaderVisible: boolean;
1224
+ };
1225
+ /**
1226
+ * Dispatches when user inactivity (AFK) is detected and the countdown to disconnect begins.
1227
+ * `remainingSecondsToDisconnect` counts down (e.g. 15, 14, 13…) until the session is terminated.
1228
+ * `countdownVisible` indicates whether the AFK countdown popup is currently shown.
1229
+ */
1230
+ userInactivityDetected: {
1231
+ remainingSecondsToDisconnect: number;
1232
+ countdownVisible: boolean;
1233
+ };
1234
+ /**
1235
+ * Dispatches when the configurator id does not exist or is not available.
1236
+ * Nothing will load; `configuratorDataUpdated` will not follow.
1237
+ */
1238
+ configuratorNotFound: true;
1241
1239
  }
1242
1240
  /**
1243
1241
  * Union of all event names received from MetaBox.
@@ -1273,9 +1271,9 @@ type FromMetaBoxApiEvents = keyof FromMetaboxMessagePayloads;
1273
1271
  * against this structure to diagnose malformed messages. The Communicator handles all wrapping/unwrapping.
1274
1272
  */
1275
1273
  interface MetaBoxApiEnvelope<T extends FromMetaBoxApiEvents> {
1276
- action: 'bridge';
1277
- eventType: T;
1278
- payload: FromMetaboxMessagePayloads[T];
1274
+ action: 'bridge';
1275
+ eventType: T;
1276
+ payload: FromMetaboxMessagePayloads[T];
1279
1277
  }
1280
1278
  /**
1281
1279
  * Identifies which side of the iframe boundary the Communicator is running on.
@@ -1299,21 +1297,19 @@ type MetaboxEnvironment = 'metabox' | 'host';
1299
1297
  * Used for signaling that the app is loaded and ready to open api.
1300
1298
  */
1301
1299
  interface MCAppLoaded {
1302
- action: typeof AppLoaded;
1303
- eventType?: unknown;
1304
- payload: {
1305
- appId: string;
1306
- version?: string;
1307
- };
1300
+ action: typeof AppLoaded;
1301
+ eventType?: unknown;
1302
+ payload: {
1303
+ appId: string;
1304
+ version?: string;
1305
+ };
1308
1306
  }
1309
1307
  /**
1310
1308
  * @internal
1311
1309
  * @hidden
1312
1310
  * This creates a union of all event envelopes defined in MetaBoxAPIPayloads.
1313
1311
  */
1314
- type FromMetaBoxAPIEnvelope = {
1315
- [K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>;
1316
- }[keyof FromMetaboxMessagePayloads] | MCAppLoaded;
1312
+ type FromMetaBoxAPIEnvelope = { [K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>; }[keyof FromMetaboxMessagePayloads] | MCAppLoaded;
1317
1313
  /**
1318
1314
  * @internal
1319
1315
  * @hidden
@@ -1336,11 +1332,10 @@ type FromMetaboxTarget = 'parent' | 'communicator';
1336
1332
  * Only reference if debugging raw postMessage traffic in browser devtools.
1337
1333
  */
1338
1334
  interface FromMetaBoxMessage {
1339
- host: typeof Metabox;
1340
- envelope: FromMetaBoxAPIEnvelope;
1341
- target: FromMetaboxTarget;
1335
+ host: typeof Metabox;
1336
+ envelope: FromMetaBoxAPIEnvelope;
1337
+ target: FromMetaboxTarget;
1342
1338
  }
1343
-
1344
1339
  /**
1345
1340
  * Base class for commands sent to the Metabox API.
1346
1341
  *
@@ -1359,11 +1354,10 @@ interface FromMetaBoxMessage {
1359
1354
  * @internal
1360
1355
  * @hidden
1361
1356
  */
1362
- declare class CommandBase {
1363
- /** The message envelope populated by subclass constructors and sent via {@link Communicator.sendCommandToMetabox}. */
1364
- data: ToMetaBoxMessageEnvelope;
1357
+ export declare class CommandBase {
1358
+ /** The message envelope populated by subclass constructors and sent via {@link Communicator.sendCommandToMetabox}. */
1359
+ data: ToMetaBoxMessageEnvelope;
1365
1360
  }
1366
-
1367
1361
  /**
1368
1362
  * Represents a callback listener for specific message types.
1369
1363
  * Used internally by EventDispatcher to store event listeners.
@@ -1382,11 +1376,11 @@ declare class CommandBase {
1382
1376
  *
1383
1377
  * @public
1384
1378
  */
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;
1379
+ export interface Listener {
1380
+ /** The message type this listener is registered for */
1381
+ messageType: string;
1382
+ /** The callback function to execute when a message of the specified type is received */
1383
+ callback: (data: unknown) => void;
1390
1384
  }
1391
1385
  /**
1392
1386
  * EventDispatcher is a class that manages event listeners and dispatches events to them.
@@ -1402,39 +1396,38 @@ interface Listener {
1402
1396
  * Do not reference or extend EventDispatcher in application code. Use only the Communicator interface methods.
1403
1397
  * If debugging communication failures, check browser console for postMessage errors related to this layer.
1404
1398
  */
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;
1399
+ export declare class EventDispatcher {
1400
+ /**
1401
+ * Storage for callback listeners by message type.
1402
+ */
1403
+ listeners: Listener[];
1404
+ /**
1405
+ * Removes all registered listeners. Subclasses override this to perform additional cleanup.
1406
+ * @param key - Instance key (used by subclass overrides for registry cleanup).
1407
+ */
1408
+ destroy(key: string): void;
1409
+ /**
1410
+ * Adds an event listener for receiving specific types of messages.
1411
+ *
1412
+ * @param {string} messageType - The message type to listen for.
1413
+ * @param callback - The callback function to execute when a message is received.
1414
+ */
1415
+ addEventListener(messageType: string, callback: (data: unknown) => void): this;
1416
+ /**
1417
+ * Dispatches an event to all listeners of a specific message type.
1418
+ *
1419
+ * @param {string} messageType - The message type.
1420
+ * @param data - The data associated with the event.
1421
+ */
1422
+ dispatchEvent(messageType: string, data: unknown): this;
1423
+ /**
1424
+ * Removes an event listener for a specific type of message.
1425
+ *
1426
+ * @param {string} messageType - The message type.
1427
+ * @param callback - The callback function to remove.
1428
+ */
1429
+ removeEventListener(messageType: string, callback: (data: unknown) => void): this;
1436
1430
  }
1437
-
1438
1431
  /**
1439
1432
  * What `integrateMetabox` knows about the iframe it created and the origin it
1440
1433
  * pointed that iframe at. Lets the Communicator check who is talking to it and
@@ -1442,11 +1435,11 @@ declare class EventDispatcher {
1442
1435
  *
1443
1436
  * @internal
1444
1437
  */
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;
1438
+ export interface CommunicatorConnection {
1439
+ /** The embedded iframe, when we created it ourselves. */
1440
+ iframe: HTMLIFrameElement | null;
1441
+ /** Origin of the configurator document, or `null` when it is not known yet. */
1442
+ origin: string | null;
1450
1443
  }
1451
1444
  /**
1452
1445
  * Handles messaging between the host page and embedded Metabox content.
@@ -1467,121 +1460,120 @@ interface CommunicatorConnection {
1467
1460
  *
1468
1461
  * @internal Use {@link Communicator.createInstance} or the {@link integrateMetabox} helper to instantiate.
1469
1462
  */
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;
1463
+ export declare class Communicator extends EventDispatcher {
1464
+ /**
1465
+ * Bound handler for incoming postMessage events.
1466
+ */
1467
+ private binder;
1468
+ /** Which side of the iframe boundary this instance runs on — see `acceptsMessageFrom`. */
1469
+ private readonly environment;
1470
+ /** The iframe we drive, when the integration created it. */
1471
+ private readonly iframe;
1472
+ /** Pinned configurator origin; `null` until we learn it. */
1473
+ private readonly targetOrigin;
1474
+ /** Keeps the "rejected an inbound message" warning to one per instance. */
1475
+ private senderRejectionReported;
1476
+ /** Keeps the "unknown configurator origin" warning to one per instance. */
1477
+ private wildcardTargetReported;
1478
+ /** Keeps the "our iframe left the document" warning to one per instance. */
1479
+ private staleFrameReported;
1480
+ /**
1481
+ * Constructs a Communicator, replacing any existing instance, and begins listening for messages.
1482
+ * @internal
1483
+ */
1484
+ constructor(data: MCAppLoaded['payload'], environment: MetaboxEnvironment, config?: Partial<MetaboxCommandConfig>, connection?: CommunicatorConnection);
1485
+ /**
1486
+ * Listens for Metabox to signal readiness, then initializes communicator.
1487
+ * @param apiReadyCallback - Called with the new Communicator once the Metabox is loaded.
1488
+ * @param {MetaboxEnvironment} environment - The environment in which the Communicator is running.
1489
+ * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
1490
+ * @param {CommunicatorConnection} connection - the iframe and origin `integrateMetabox`
1491
+ * built, so the handshake can be attributed and later messages addressed precisely.
1492
+ * Omitted by hand-rolled embeds, which are then identified through the
1493
+ * `embeddedContent` id and the handshake's own origin.
1494
+ * @returns A cancel function that removes the handshake `message` listener.
1495
+ * `integrateMetabox` (the public entry point) calls this automatically when
1496
+ * a new integration supersedes a still-pending one, so direct internal
1497
+ * callers only need it for explicit early teardown. Idempotent.
1498
+ */
1499
+ static createInstance(apiReadyCallback: (api: Communicator) => void, environment: MetaboxEnvironment, config?: Partial<MetaboxCommandConfig>, connection?: CommunicatorConnection): () => void;
1500
+ /**
1501
+ * The origin to address the configurator by, decided once from the handshake.
1502
+ *
1503
+ * Prefers what `integrateMetabox` computed from the iframe URL, but yields to
1504
+ * the origin the handshake actually came from when the two disagree: a redirect
1505
+ * (a `config.domain` override pointing at a host that 30x's elsewhere) would
1506
+ * otherwise pin an origin nothing answers on, and every command would be
1507
+ * dropped silently. The sender already passed the window gate, so this cannot
1508
+ * be steered by an unrelated page.
1509
+ */
1510
+ private static resolveHandshakeOrigin;
1511
+ /**
1512
+ * Cleans up resources and stops listening for messages.
1513
+ */
1514
+ destroy(key: string): void;
1515
+ /** Destroys all active Communicator instances and clears the internal registry. */
1516
+ static clearAll(): void;
1517
+ /**
1518
+ * Retrieves a registered Communicator instance by its key.
1519
+ * @param key - The composite key (`version_environment_appId`) identifying the instance.
1520
+ */
1521
+ static getCommunicator(key: string): {
1522
+ instance: Communicator;
1523
+ } | undefined;
1524
+ /**
1525
+ * Posts a command to the Metabox iframe.
1526
+ * @param command - An action command containing data to send.
1527
+ */
1528
+ sendCommandToMetabox<T extends CommandBase>(command: T): void;
1529
+ /**
1530
+ * A superseding `integrateMetabox` call removes the iframe this handle was
1531
+ * built for. Commands then fall through to whatever now holds the contract id,
1532
+ * addressed by the origin pinned for the *old* integration — so if the new one
1533
+ * points at a different origin, the browser drops them without a word. The
1534
+ * handle is stale at that point and should be replaced by the one from the new
1535
+ * integration; say so rather than letting it fail quietly.
1536
+ */
1537
+ private reportStaleFrame;
1538
+ /**
1539
+ * `targetOrigin` for the iframe. The very first command is `metaboxConfig`,
1540
+ * which carries `hostUrl: location.href` — on a shop page that routinely holds
1541
+ * order ids and session parameters — so it must not be broadcast to whatever
1542
+ * document currently occupies the frame.
1543
+ *
1544
+ * Falls back to a wildcard rather than refusing to send: this leg carries
1545
+ * commands, and a configurator that silently stops responding on a customer
1546
+ * site is worse than the status quo. The fallback is reported once so it does
1547
+ * not pass unnoticed.
1548
+ */
1549
+ private resolveTarget;
1550
+ /**
1551
+ * Registers an event listener for messages dispatched by the Metabox.
1552
+ * @param messageType - The event name to listen for (e.g. `'configuratorDataUpdated'`).
1553
+ * @param callback - Handler invoked with the typed payload when the event fires.
1554
+ * @override
1555
+ */
1556
+ addEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
1557
+ /**
1558
+ * Dispatches a typed event to all registered listeners.
1559
+ * @param messageType - The event name to dispatch.
1560
+ * @param data - The payload to pass to each listener.
1561
+ * @override
1562
+ */
1563
+ dispatchEvent<T extends FromMetaBoxApiEvents>(messageType: T, data: FromMetaboxMessagePayloads[T]): this;
1564
+ /**
1565
+ * Removes a previously registered event listener.
1566
+ * @param messageType - The event name the listener was registered for.
1567
+ * @param callback - The same function reference that was passed to {@link addEventListener}.
1568
+ * @override
1569
+ */
1570
+ removeEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
1571
+ /**
1572
+ * Filters and dispatches incoming messages from the Metabox.
1573
+ * @param event - The postMessage event received on a window.
1574
+ */
1575
+ private handleMessageReceived;
1583
1576
  }
1584
-
1585
1577
  /**
1586
1578
  * Integrates the Metabox Modular Configurator into the page by injecting an iframe and
1587
1579
  * initializing a Communicator instance for host-to-iframe messaging.
@@ -1657,8 +1649,7 @@ declare class Communicator extends EventDispatcher {
1657
1649
  * },
1658
1650
  * );
1659
1651
  */
1660
- declare function integrateMetabox(configuratorId: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: IntegrateMetaboxConfig): () => void;
1661
-
1652
+ export declare function integrateMetabox(configuratorId: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: IntegrateMetaboxConfig): () => void;
1662
1653
  /**
1663
1654
  * Saves an image by triggering a download.
1664
1655
  *
@@ -1688,8 +1679,7 @@ declare function integrateMetabox(configuratorId: string, containerId: string, a
1688
1679
  * @param {string} imageUrl - The URL of the image to save.
1689
1680
  * @param {string} filename - The name of the file to save.
1690
1681
  */
1691
- declare function saveImage(imageUrl: string, filename: string): void;
1692
-
1682
+ export declare function saveImage(imageUrl: string, filename: string): void;
1693
1683
  /**
1694
1684
  * Constructs the iframe source URL for the Metabox Modular Configurator.
1695
1685
  *
@@ -1712,8 +1702,7 @@ declare function saveImage(imageUrl: string, filename: string): void;
1712
1702
  * @param {string} configuratorId - An string identifier for the configurator.
1713
1703
  * @param {IntegrateMetaboxConfig} config - An object containing the configuration options.
1714
1704
  */
1715
- declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetaboxConfig) => string;
1716
-
1705
+ export declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetaboxConfig) => string;
1717
1706
  /**
1718
1707
  * Wrapper helper function to use with RxJS the same way as `fromEvent`, to listen to events from the Communicator.
1719
1708
  *
@@ -1734,8 +1723,7 @@ declare const prepareIframeSrc: (configuratorId: string, config?: IntegrateMetab
1734
1723
  * @returns An Observable that emits the typed payload each time the event fires.
1735
1724
  * @internal
1736
1725
  */
1737
- declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
1738
-
1726
+ export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
1739
1727
  /**
1740
1728
  * Represents a command to send Metabox Config to Metabox Modular Configurator.
1741
1729
  *
@@ -1758,10 +1746,9 @@ declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: C
1758
1746
  * @param {string} appId - The unique identifier for the Communicator Instance
1759
1747
  * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic
1760
1748
  */
1761
- declare class MetaboxConfig extends CommandBase {
1762
- constructor(appId: string, config: MetaboxCommandConfig);
1749
+ export declare class MetaboxConfig extends CommandBase {
1750
+ constructor(appId: string, config: MetaboxCommandConfig);
1763
1751
  }
1764
-
1765
1752
  /**
1766
1753
  * Represents a command to get a PDF from Metabox Modular Configurator.
1767
1754
  * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
@@ -1808,10 +1795,9 @@ declare class MetaboxConfig extends CommandBase {
1808
1795
  * api.sendCommandToMetabox(new GetPdf());
1809
1796
  * };
1810
1797
  */
1811
- declare class GetPdf extends CommandBase {
1812
- constructor();
1798
+ export declare class GetPdf extends CommandBase {
1799
+ constructor();
1813
1800
  }
1814
-
1815
1801
  /**
1816
1802
  * Represents a command to get a Call To Action Information from Metabox Modular Configurator.
1817
1803
  * This class sends a message to the Metabox API to generate Call To Action information based on the current
@@ -1853,10 +1839,9 @@ declare class GetPdf extends CommandBase {
1853
1839
  * api.sendCommandToMetabox(new GetCallToActionInformation());
1854
1840
  * };
1855
1841
  */
1856
- declare class GetCallToActionInformation extends CommandBase {
1857
- constructor();
1842
+ export declare class GetCallToActionInformation extends CommandBase {
1843
+ constructor();
1858
1844
  }
1859
-
1860
1845
  /**
1861
1846
  * Represents a command to get the camera configuration from Unreal.
1862
1847
  * This class sends a message to the Metabox API to get the camera from a scene.
@@ -1887,10 +1872,9 @@ declare class GetCallToActionInformation extends CommandBase {
1887
1872
  * api.sendCommandToMetabox(new GetCamera());
1888
1873
  * };
1889
1874
  */
1890
- declare class GetCamera extends CommandBase {
1891
- constructor();
1875
+ export declare class GetCamera extends CommandBase {
1876
+ constructor();
1892
1877
  }
1893
-
1894
1878
  /**
1895
1879
  * Represents a command to set the camera configuration.
1896
1880
  * This class sends a message to the Metabox API to set the camera on a scene.
@@ -1932,10 +1916,9 @@ declare class GetCamera extends CommandBase {
1932
1916
  *
1933
1917
  * @param {CameraCommandPayload} camera - The camera configuration.
1934
1918
  */
1935
- declare class SetCamera extends CommandBase {
1936
- constructor(camera: CameraCommandPayload);
1919
+ export declare class SetCamera extends CommandBase {
1920
+ constructor(camera: CameraCommandPayload);
1937
1921
  }
1938
-
1939
1922
  /**
1940
1923
  * Represents a command to reset the camera to its initial position.
1941
1924
  * This class sends a message to the Metabox API to reset the camera on a scene.
@@ -1957,10 +1940,9 @@ declare class SetCamera extends CommandBase {
1957
1940
  * api.sendCommandToMetabox(new ResetCamera());
1958
1941
  * };
1959
1942
  */
1960
- declare class ResetCamera extends CommandBase {
1961
- constructor();
1943
+ export declare class ResetCamera extends CommandBase {
1944
+ constructor();
1962
1945
  }
1963
-
1964
1946
  /**
1965
1947
  * Represents a command to reset the modular configurator state to its defaults.
1966
1948
  * This class sends a message to the Metabox API to restore the component tree, component materials,
@@ -2000,10 +1982,9 @@ declare class ResetCamera extends CommandBase {
2000
1982
  * api.sendCommandToMetabox(new ResetConfiguration());
2001
1983
  * };
2002
1984
  */
2003
- declare class ResetConfiguration extends CommandBase {
2004
- constructor();
1985
+ export declare class ResetConfiguration extends CommandBase {
1986
+ constructor();
2005
1987
  }
2006
-
2007
1988
  /**
2008
1989
  * Represents a command to apply zoom and change the camera zoom on a scene.
2009
1990
  * This class sends a command to the Metabox API to change zoom on a scene.
@@ -2029,10 +2010,9 @@ declare class ResetConfiguration extends CommandBase {
2029
2010
  *
2030
2011
  * @param {number} zoom - The zoom value to apply.
2031
2012
  */
2032
- declare class ApplyZoom extends CommandBase {
2033
- constructor(zoom: number);
2013
+ export declare class ApplyZoom extends CommandBase {
2014
+ constructor(zoom: number);
2034
2015
  }
2035
-
2036
2016
  /**
2037
2017
  * Represents a command to initialize Showcase for a component scene and start a sequence for the component.
2038
2018
  * This class sends a command to the Metabox API to initialize showcase if the component has a sequence.
@@ -2063,10 +2043,9 @@ declare class ApplyZoom extends CommandBase {
2063
2043
  * api.sendCommandToMetabox(new InitShowcase());
2064
2044
  * };
2065
2045
  */
2066
- declare class InitShowcase extends CommandBase {
2067
- constructor();
2046
+ export declare class InitShowcase extends CommandBase {
2047
+ constructor();
2068
2048
  }
2069
-
2070
2049
  /**
2071
2050
  * Represents a command to play Showcase for a component when it is already initialized and paused.
2072
2051
  * This class sends a command to the Metabox API to play showcase for a component if it is already initialized and paused.
@@ -2096,19 +2075,17 @@ declare class InitShowcase extends CommandBase {
2096
2075
  * api.sendCommandToMetabox(new PlayShowcase());
2097
2076
  * };
2098
2077
  */
2099
- declare class PlayShowcase extends CommandBase {
2100
- constructor();
2078
+ export declare class PlayShowcase extends CommandBase {
2079
+ constructor();
2101
2080
  }
2102
-
2103
2081
  /**
2104
2082
  * @internal
2105
2083
  * @hidden
2106
2084
  * Represents a command to send Unreal command.
2107
2085
  */
2108
- declare class UnrealCommand extends CommandBase {
2109
- constructor(payload: object);
2086
+ export declare class UnrealCommand extends CommandBase {
2087
+ constructor(payload: object);
2110
2088
  }
2111
-
2112
2089
  /**
2113
2090
  * Represents a command to pause Showcase for a component when it is already initialized and playing.
2114
2091
  * This class sends a command to the Metabox API to pause showcase for a component if it is already initialized and playing.
@@ -2138,10 +2115,9 @@ declare class UnrealCommand extends CommandBase {
2138
2115
  * api.sendCommandToMetabox(new PauseShowcase());
2139
2116
  * };
2140
2117
  */
2141
- declare class PauseShowcase extends CommandBase {
2142
- constructor();
2118
+ export declare class PauseShowcase extends CommandBase {
2119
+ constructor();
2143
2120
  }
2144
-
2145
2121
  /**
2146
2122
  * Represents a command to stop Showcase for a component when it is already initialized, and you want to destroy it.
2147
2123
  * This class sends a command to the Metabox API to stop showcase for a component if it is already initialized.
@@ -2172,10 +2148,9 @@ declare class PauseShowcase extends CommandBase {
2172
2148
  * api.sendCommandToMetabox(new StopShowcase());
2173
2149
  * };
2174
2150
  */
2175
- declare class StopShowcase extends CommandBase {
2176
- constructor();
2151
+ export declare class StopShowcase extends CommandBase {
2152
+ constructor();
2177
2153
  }
2178
-
2179
2154
  /**
2180
2155
  * Image format.
2181
2156
  * This type represents the allowed image formats.
@@ -2230,13 +2205,12 @@ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
2230
2205
  * @param {MimeType} mimeType - The output format.
2231
2206
  * @param {{ x: number; y: number }} [size] - Optional size in pixels.
2232
2207
  */
2233
- declare class GetScreenshot extends CommandBase {
2234
- constructor(mimeType: MimeType, size?: {
2235
- x: number;
2236
- y: number;
2237
- });
2208
+ export declare class GetScreenshot extends CommandBase {
2209
+ constructor(mimeType: MimeType, size?: {
2210
+ x: number;
2211
+ y: number;
2212
+ });
2238
2213
  }
2239
-
2240
2214
  /**
2241
2215
  * Represents a command to set a component by its data (ID, typeId).
2242
2216
  * This action sends a message to the Metabox API to set a component using the provided data.
@@ -2273,10 +2247,9 @@ declare class GetScreenshot extends CommandBase {
2273
2247
  * @param {string} id - The component ID.
2274
2248
  * @param {string} typeId - The component type ID.
2275
2249
  */
2276
- declare class SetComponent extends CommandBase {
2277
- constructor(id: string, typeId: string);
2250
+ export declare class SetComponent extends CommandBase {
2251
+ constructor(id: string, typeId: string);
2278
2252
  }
2279
-
2280
2253
  /**
2281
2254
  * Represents a command to set component material by its slot ID and Material ID.
2282
2255
  * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
@@ -2314,10 +2287,9 @@ declare class SetComponent extends CommandBase {
2314
2287
  * @param {string} slotId - The slot ID.
2315
2288
  * @param {string} materialId - The material ID.
2316
2289
  */
2317
- declare class SetComponentMaterial extends CommandBase {
2318
- constructor(componentId: string, slotId: string, materialId: string);
2290
+ export declare class SetComponentMaterial extends CommandBase {
2291
+ constructor(componentId: string, slotId: string, materialId: string);
2319
2292
  }
2320
-
2321
2293
  /**
2322
2294
  * Represents a command to set the environment by its ID.
2323
2295
  * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
@@ -2348,10 +2320,9 @@ declare class SetComponentMaterial extends CommandBase {
2348
2320
  *
2349
2321
  * @param {string} environmentId - The environment ID.
2350
2322
  */
2351
- declare class SetEnvironment extends CommandBase {
2352
- constructor(environmentId: string);
2323
+ export declare class SetEnvironment extends CommandBase {
2324
+ constructor(environmentId: string);
2353
2325
  }
2354
-
2355
2326
  /**
2356
2327
  * Represents a command to set an environment material by its slot ID and Material ID.
2357
2328
  * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
@@ -2387,10 +2358,9 @@ declare class SetEnvironment extends CommandBase {
2387
2358
  * @param {string} slotId - The slot ID.
2388
2359
  * @param {string} materialId - The material ID.
2389
2360
  */
2390
- declare class SetEnvironmentMaterial extends CommandBase {
2391
- constructor(slotId: string, materialId: string);
2361
+ export declare class SetEnvironmentMaterial extends CommandBase {
2362
+ constructor(slotId: string, materialId: string);
2392
2363
  }
2393
-
2394
2364
  /**
2395
2365
  * A single material command accepted inside a {@link SetMaterials} batch.
2396
2366
  *
@@ -2446,10 +2416,9 @@ type MaterialCommand = SetComponentMaterial | SetEnvironmentMaterial;
2446
2416
  *
2447
2417
  * @param {MaterialCommand[]} commands - The material commands to apply, in order.
2448
2418
  */
2449
- declare class SetMaterials extends CommandBase {
2450
- constructor(commands: MaterialCommand[]);
2419
+ export declare class SetMaterials extends CommandBase {
2420
+ constructor(commands: MaterialCommand[]);
2451
2421
  }
2452
-
2453
2422
  /**
2454
2423
  * Represents a command to toggle the embedded Metabox menu.
2455
2424
  * This command can only be used when using the metabox menu.
@@ -2475,10 +2444,9 @@ declare class SetMaterials extends CommandBase {
2475
2444
  *
2476
2445
  * @param {boolean} visible - A flag indicating whether the embedded menu should be visible.
2477
2446
  */
2478
- declare class ShowEmbeddedMenu extends CommandBase {
2479
- constructor(visible: boolean);
2447
+ export declare class ShowEmbeddedMenu extends CommandBase {
2448
+ constructor(visible: boolean);
2480
2449
  }
2481
-
2482
2450
  /**
2483
2451
  * Represents a command to toggle the Unreal Overlay Interface Menu.
2484
2452
  * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.
@@ -2504,10 +2472,9 @@ declare class ShowEmbeddedMenu extends CommandBase {
2504
2472
  *
2505
2473
  * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.
2506
2474
  */
2507
- declare class ShowOverlayInterface extends CommandBase {
2508
- constructor(visible: boolean);
2475
+ export declare class ShowOverlayInterface extends CommandBase {
2476
+ constructor(visible: boolean);
2509
2477
  }
2510
-
2511
2478
  /**
2512
2479
  * Represents a command to show measurement for a product when it is already loaded.
2513
2480
  * This class sends a command to the Metabox API to show measurement for a product if it is already initialized.
@@ -2529,10 +2496,9 @@ declare class ShowOverlayInterface extends CommandBase {
2529
2496
  * api.sendCommandToMetabox(new ShowMeasurement());
2530
2497
  * };
2531
2498
  */
2532
- declare class ShowMeasurement extends CommandBase {
2533
- constructor();
2499
+ export declare class ShowMeasurement extends CommandBase {
2500
+ constructor();
2534
2501
  }
2535
-
2536
2502
  /**
2537
2503
  * Represents a command to hide measurement for a product when it is already loaded.
2538
2504
  * This class sends a command to the Metabox API to hide measurement for a product if it is already initialized.
@@ -2554,10 +2520,9 @@ declare class ShowMeasurement extends CommandBase {
2554
2520
  * api.sendCommandToMetabox(new HideMeasurement());
2555
2521
  * };
2556
2522
  */
2557
- declare class HideMeasurement extends CommandBase {
2558
- constructor();
2523
+ export declare class HideMeasurement extends CommandBase {
2524
+ constructor();
2559
2525
  }
2560
-
2561
2526
  /**
2562
2527
  * Represents a command to resume the pixel streaming session.
2563
2528
  * This class sends a message to the Metabox API to resume a paused or disconnected stream.
@@ -2579,10 +2544,9 @@ declare class HideMeasurement extends CommandBase {
2579
2544
  * api.sendCommandToMetabox(new ResumeStream());
2580
2545
  * };
2581
2546
  */
2582
- declare class ResumeStream extends CommandBase {
2583
- constructor();
2547
+ export declare class ResumeStream extends CommandBase {
2548
+ constructor();
2584
2549
  }
2585
-
2586
2550
  /**
2587
2551
  * Represents a command to stop the pixel streaming session.
2588
2552
  * This class sends a message to the Metabox API to stop the active stream and release its resources.
@@ -2605,10 +2569,9 @@ declare class ResumeStream extends CommandBase {
2605
2569
  * api.sendCommandToMetabox(new StopStream());
2606
2570
  * };
2607
2571
  */
2608
- declare class StopStream extends CommandBase {
2609
- constructor();
2572
+ export declare class StopStream extends CommandBase {
2573
+ constructor();
2610
2574
  }
2611
-
2612
2575
  /**
2613
2576
  * Represents a command to reset the user inactivity (AFK) timer.
2614
2577
  * This class sends a message to the Metabox API to restart the inactivity countdown,
@@ -2638,9 +2601,7 @@ declare class StopStream extends CommandBase {
2638
2601
  * });
2639
2602
  * };
2640
2603
  */
2641
- declare class ResetUserInactivityTimer extends CommandBase {
2642
- constructor();
2604
+ export declare class ResetUserInactivityTimer extends CommandBase {
2605
+ constructor();
2643
2606
  }
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 };
2607
+ 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 };